2025-06-06 03:08:19 +08:00
|
|
|
<template>
|
|
|
|
<view class="page">
|
2025-06-07 21:01:16 +08:00
|
|
|
<nav-bar :title="$t('setPin.title')" bgColor="#fff"></nav-bar>
|
2025-06-06 03:08:19 +08:00
|
|
|
<view style="width: 92%; margin: 10px auto; padding: 15px 10px;">
|
|
|
|
<uni-forms label-position="top" label-width="80px" :model="model" :rules="rules" ref="model">
|
2025-06-07 21:01:16 +08:00
|
|
|
<uni-forms-item :label="$t('setPin.text1')" name="password">
|
|
|
|
<uni-easyinput type="password" :passwordIcon="true" v-model="model.password" :placeholder="$t('setPin.text2')" />
|
2025-06-06 03:08:19 +08:00
|
|
|
</uni-forms-item>
|
2025-06-07 21:01:16 +08:00
|
|
|
<uni-forms-item :label="$t('setPin.text3')" name="newpassword">
|
|
|
|
<uni-easyinput type="password" :passwordIcon="true" v-model="model.newpassword" :placeholder="$t('setPin.text4')" />
|
2025-06-06 03:08:19 +08:00
|
|
|
</uni-forms-item>
|
2025-06-07 21:01:16 +08:00
|
|
|
<uni-forms-item :label="$t('setPin.text5')" name="renewpassword">
|
|
|
|
<uni-easyinput type="password" :passwordIcon="true" v-model="model.renewpassword" :placeholder="$t('setPin.text6')" />
|
2025-06-06 03:08:19 +08:00
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms>
|
|
|
|
</view>
|
|
|
|
<view style="bottom: 0px; position: absolute; width:100vw; height: 60px;">
|
|
|
|
<view class="cell_list">
|
2025-06-09 00:34:46 +08:00
|
|
|
<button type="primary" round style="width: 100%;" @click="submit">{{$t('buttonSubmit')}}</button>
|
2025-06-06 03:08:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
mapState,
|
|
|
|
mapMutations
|
|
|
|
} from 'vuex';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
model: {
|
|
|
|
password: '',
|
|
|
|
newpassword: '',
|
|
|
|
renewpassword: ''
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
password:{
|
2025-06-07 21:08:06 +08:00
|
|
|
rules:[{required: true,errorMessage: this.$t('setPin.text7')},
|
|
|
|
{minLength: 6, maxLength: 6, errorMessage: this.$t('setPin.text8'), }],
|
2025-06-06 03:08:19 +08:00
|
|
|
},
|
2025-06-07 21:08:06 +08:00
|
|
|
newpassword: {rules:[{required: true,errorMessage: this.$t('setPin.text9')},
|
|
|
|
{minLength: 6, maxLength: 6, errorMessage: this.$t('setPin.text10'), }],
|
2025-06-06 03:08:19 +08:00
|
|
|
},
|
2025-06-07 21:08:06 +08:00
|
|
|
renewpassword:{rules:[{required: true,errorMessage: this.$t('setPin.text11')},
|
|
|
|
{minLength: 6, maxLength: 6, errorMessage: this.$t('setPin.text10'), }],
|
2025-06-06 03:08:19 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState(['userInfo'])
|
|
|
|
},
|
|
|
|
//第一次加载
|
|
|
|
onLoad(e) {
|
|
|
|
},
|
|
|
|
//页面显示
|
|
|
|
onShow() {},
|
|
|
|
//方法
|
|
|
|
methods: {
|
|
|
|
onPageJump(url) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: url
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onTokenJump(url) {
|
|
|
|
this.judgeLogin(() => {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: url
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
submit(){
|
|
|
|
this.$refs.model.validate().then(res=>{
|
|
|
|
if (this.model.newpassword !== this.model.renewpassword) {
|
|
|
|
uni.showToast({
|
2025-06-07 21:08:06 +08:00
|
|
|
title:this.$t('setPin.text12'),
|
2025-06-06 03:08:19 +08:00
|
|
|
icon:'error'
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.$http.post('/api/user/change_trade_password', this.model).then(res => {
|
|
|
|
if(res.code == 0){
|
|
|
|
uni.showToast({
|
|
|
|
title: res.data.mes
|
|
|
|
});
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.navigateBack();
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
//页面隐藏
|
|
|
|
onHide() {},
|
|
|
|
//页面卸载
|
|
|
|
onUnload() {},
|
|
|
|
//页面下来刷新
|
|
|
|
onPullDownRefresh() {},
|
|
|
|
//页面上拉触底
|
|
|
|
onReachBottom() {},
|
|
|
|
//用户点击分享
|
|
|
|
onShareAppMessage(e) {
|
|
|
|
return this.wxShare();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '@/style/mixin.scss';
|
|
|
|
body{background-color: #fff;}
|
|
|
|
.page{min-height: 95vh;position: relative;}
|
|
|
|
.rechargeTitle{
|
|
|
|
font-weight: 400;font-size: 16px;color: #999999;line-height: 23px; text-align: center; margin-top: 30px;
|
|
|
|
}
|
|
|
|
.rechargeNet{
|
|
|
|
font-weight: 600;font-size: 20px;color: #333;line-height: 23px; text-align: center; margin-top: 20px;
|
|
|
|
}
|
|
|
|
.txt{
|
|
|
|
font-size: 14px; color:#999; font-weight: 500;
|
|
|
|
}
|
|
|
|
.cell_right{
|
|
|
|
font-size: 14px; color:#333; font-weight: 500;
|
|
|
|
}
|
|
|
|
</style>
|