<!-- 修改用户信息(二合一) -->
|
|
<template>
|
|
<view class="modify-user">
|
|
<navbar :leftClick="leftClick"></navbar>
|
|
|
|
|
|
<!-- 修改钱包地址 -->
|
|
<view class="edit-user content" v-if="$route.query.type == 2">
|
|
<view class="edit-list">
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.network') }}</view>
|
|
<input type="text" disabled value="USDT-TRC20" />
|
|
</view>
|
|
|
|
<view class="edit-item" v-if="userInfo.moneyAddress">
|
|
<view class="title">{{ $t('page.center.wallet') }}</view>
|
|
<input type="text"
|
|
disabled
|
|
:placeholder="$t('page.modifyUser.wallet-placeholder')"
|
|
v-model="form.moneyAddress" />
|
|
</view>
|
|
<view class="edit-item" v-else>
|
|
<view class="title">{{ $t('page.center.wallet') }}</view>
|
|
<input type="text"
|
|
:placeholder="$t('page.modifyUser.wallet-placeholder')"
|
|
v-model="form.moneyAddress" />
|
|
</view>
|
|
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.payment') }}</view>
|
|
<input type="password" :placeholder="$t('page.modifyUser.payment-placeholder')"
|
|
v-model="form.newPassword" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 修改pin -->
|
|
<view class="edit-user content" v-else>
|
|
<view class="edit-list">
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.oldPassword') }}</view>
|
|
<input type="password" v-model="form.oldPassword" />
|
|
</view>
|
|
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.newPassword') }}</view>
|
|
<input type="password" v-model="form.newPassword" />
|
|
</view>
|
|
|
|
<!-- <view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.confirmNewPassword') }}</view>
|
|
<input type="text" :placeholder="$t('page.modifyUser.newPassword')" v-model="form.confirmNewPassword"/>
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="box">
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.oldPassword') }}</view>
|
|
<input type="text" :placeholder="$t('page.modifyUser.oldPasswordPlaceholder')" v-model="form.oldPassword"/>
|
|
</view>
|
|
|
|
<view class="edit-item">
|
|
<view class="title">{{ $t('page.modifyUser.newPassword') }}</view>
|
|
<input type="text" :placeholder="$t('page.modifyUser.newPasswordPlaceholder')" v-model="form.newPassword"/>
|
|
</view>
|
|
</view> -->
|
|
|
|
<!-- 提交按钮 -->
|
|
<view class="confirm content"
|
|
v-if="!userInfo.moneyAddress || $route.query.type != 2"
|
|
@click="submit">{{ $t('page.modifyUser.confirm') }}</view>
|
|
|
|
<!-- 提示信息 -->
|
|
<!-- <view class="tips content">{{ $t(`page.modifyUser.${tips[$route.query.type]}`) }}</view> -->
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import navbar from '@/components/base/m-navbar.vue'
|
|
|
|
export default {
|
|
components: {
|
|
navbar
|
|
},
|
|
data() {
|
|
return {
|
|
titles: ['editPinTitle', 'editPasswordTitle'],
|
|
tips: ['pinTips', 'passwordTips'],
|
|
form: {
|
|
oldPassword: '',
|
|
newPassword: '',
|
|
confirmNewPassword: '',
|
|
moneyAddress : ''
|
|
},
|
|
userInfo: {
|
|
moneyAddress : '123'
|
|
},
|
|
}
|
|
},
|
|
onShow() {
|
|
this.getUserInfo()
|
|
},
|
|
methods: {
|
|
leftClick() {
|
|
uni.navigateTo({
|
|
url: '/pages/center/center'
|
|
})
|
|
},
|
|
|
|
//获取用户信息
|
|
getUserInfo() {
|
|
this.request('userInfo').then(res => {
|
|
if (res.code == 200) {
|
|
this.userInfo = res.result.userInfo
|
|
this.vipInfo = res.result.vip
|
|
this.form.moneyAddress = this.userInfo.moneyAddress
|
|
}
|
|
})
|
|
},
|
|
|
|
//提交
|
|
submit() {
|
|
this.$play()
|
|
|
|
|
|
if (this.$route.query.type == 0) { //修改pin逻辑
|
|
this.request('editPayPass', {}, {
|
|
oldPayPass: this.form.oldPassword,
|
|
payPass: this.form.newPassword,
|
|
okPayPass: this.form.confirmNewPassword,
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
console.log(res.message);
|
|
uni.$u.toast(this.$t(`message.${res.message}`))
|
|
setTimeout(() => uni.navigateTo({
|
|
url: '/pages/center/center'
|
|
}), 1000)
|
|
}
|
|
})
|
|
} else if (this.$route.query.type == 1) { //修改密码逻辑
|
|
this.request('editPass', {}, {
|
|
oldPass: this.form.oldPassword,
|
|
password: this.form.newPassword,
|
|
okPassword: this.form.confirmNewPassword,
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
uni.$u.toast(this.$t(`message.${res.message}`))
|
|
setTimeout(() => uni.navigateTo({
|
|
url: '/pages/center/center'
|
|
}), 1000)
|
|
}
|
|
})
|
|
} else { //修改钱包地址
|
|
this.request('editMoneyAddress', {}, {
|
|
moneyAddress : this.form.moneyAddress,
|
|
payPass : this.form.newPassword
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
uni.$u.toast(this.$t(`message.${res.message}`))
|
|
setTimeout(() => uni.navigateTo({
|
|
url: '/pages/center/center'
|
|
}), 500)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.modify-user {
|
|
width: 750rpx;
|
|
min-height: 100vh;
|
|
// background-color: black;
|
|
margin: 0 auto;
|
|
background-size: 100%;
|
|
background-repeat: no-repeat;
|
|
|
|
.content {
|
|
width: 96%;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
|
|
.edit-user {
|
|
padding-top: 20rpx;
|
|
|
|
.edit-list {
|
|
|
|
.edit-item {
|
|
box-sizing: border-box;
|
|
padding: 15rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
border-bottom: 1px solid #33333333;
|
|
|
|
.title {
|
|
color: $uni-text-color;
|
|
font-size: 28rpx;
|
|
margin-top: 10rpx;
|
|
min-width: 25%;
|
|
}
|
|
|
|
input {
|
|
color: $uni-text-color;
|
|
text-indent: 1em;
|
|
height: 60rpx;
|
|
font-size: 28rpx;
|
|
margin-top: 15rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.confirm {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: $uni-bg-color-app;
|
|
margin: 30rpx auto;
|
|
border-radius: 20rpx;
|
|
height: 100rpx;
|
|
font-size: 35rpx;
|
|
font-weight: bold;
|
|
color: $uni-text-color-inverse;
|
|
}
|
|
|
|
.tips {
|
|
color: rgb(191, 118, 112);
|
|
text-align: center;
|
|
font-size: 26rpx;
|
|
padding: 0rpx 20rpx;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
</style>
|