Browse Source

合并提交

master
j1ack 3 years ago
parent
commit
87311436e2
  1. 5
      pages/me/aboutUs.vue
  2. 66
      pages/me/changeLoginPassword.vue
  3. 2
      utils/api.js
  4. 5
      utils/axios.js
  5. 6
      utils/language/en_US.js

5
pages/me/aboutUs.vue

@ -5,9 +5,8 @@
<!-- 列表 -->
<view class="content">
<view class="card" v-for="(item, index) in aboutus" :key="index">
<view class="title">{{ i18n.Consulting }}</view>
<view class="text">A Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, </view>
<view class="title">{{ item.title }}</view>
<view class="text" v-html="item.content"></view>
</view>
</view>
</view>

66
pages/me/changeLoginPassword.vue

@ -6,12 +6,14 @@
<u-input class="input" type="password" v-model="oldPassword" color="#A1A0A8" fontSize="28rpx" border="none"
:placeholder="i18n.PleaseEnterTheOldPassword">
</u-input>
<u-input class="input" type="password" v-model="newPassword" color="#A1A0A8" fontSize="28rpx" border="none"
<u-input class="input" type="password" v-model="password" color="#A1A0A8" fontSize="28rpx" border="none"
:placeholder="i18n.CreateNewLoginPassword">
</u-input>
<!-- 修改登录密码按钮 -->
<u-button class="button" color="#00E8A2" throttleTime="500" :disabled="disabled">
<u-input class="input" type="password" v-model="confirmPassword" color="#A1A0A8" fontSize="28rpx" border="none"
:placeholder="i18n.confirmPassword">
</u-input>
<!-- 修改登录密码按钮 :disabled="disabled"-->
<u-button class="button" color="#00E8A2" throttleTime="500" @click="changePassword()" :throttleTime="500">
{{ i18n.Confirm }}
</u-button>
</view>
@ -25,10 +27,13 @@ export default {
name: "changeLoginPassword",
data() {
return {
oldPassword: '',
password: '',
confirmPassword:'',
oldPassword: '',
password: '',
confirmPassword:'',
disabled: true,
//
isCanPassword: false,
};
},
computed: {
@ -36,11 +41,58 @@ export default {
return this.$t("me");
},
},
watch: {
'password': {
handler(newValue) {
const numberReg = /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[A-Za-z0-9 _]{6,20}$/
this.isCanPassword = numberReg.test(newValue)
}
},
},
onLoad() {
},
onShow() { },
methods: {
//
changePassword() {
if (!this.password) {
uni.$u.toast(this.$t("login").passwordInputMessage)
return
}
if (!this.isCanPassword) {
let message = this.$t("login").passwordRule
uni.$u.toast(message)
return
}
//
if (this.password !== this.confirmPassword) {
uni.$u.toast(this.$t("login").passwordConfirm)
return
}
if (!this.oldPassword) {
uni.$u.toast(this.$t("login").PleaseEnterTheOldPassword)
return
}
let userInfo = {
oldPassword:md5(this.oldPassword),
password: md5(this.password),
confirmPassword: md5(this.confirmPassword),
}
api.updatePassword(userInfo).then(res => {
setTimeout(() => {
uni.showToast({
title: this.$t("me").ModifiedSuccessfully
})
}, 600)
uni.setStorageSync('ticket',null)
uni.reLaunch({
url: '/pages/login/index'
})
})
},
},
}
</script>

2
utils/api.js

@ -84,7 +84,7 @@ const api = {
aboutus: (params) => Vue.prototype.$axios.post('/api/index/aboutus',params),//关于我们
loginOut: (params) => Vue.prototype.$axios.post('/api/user/loginOut',params),//退出登录
forgotPassword: (params) => Vue.prototype.$axios.post('/api/user/forgotPassword',params),//忘记密码
updatePassword: () => Vue.prototype.$axios.get('/api/user/updatePassword'),//修改登录密码
updatePassword: (params) => Vue.prototype.$axios.post('/api/user/updatePassword',params),//修改登录密码
userAccount: (params) => Vue.prototype.$axios.post('/api/user/userAccount',params),//用户余额信息
bankCardInfo: (params) => Vue.prototype.$axios.post('/api/user/bankCardInfo',params),//获取银行卡信息
bindBank: (params) => Vue.prototype.$axios.post('/api/user/bindBank',params),//绑定/修改银行卡

5
utils/axios.js

@ -41,7 +41,9 @@ service.interceptors.request.use(
const ticket = uni.getStorageSync('ticket')
if (ticket) {
config.data = {};
if(!config.data){
config.data = {};
}
config.data['ticket'] = ticket
}
if (Vue.prototype.$showDialog) {
@ -71,7 +73,6 @@ service.interceptors.request.use(
}
//console.log(config.url,111111,config.data,dataStr)
config.data = {};
dataStr.forEach(function(e) {
config.data[e.split('=')[0]] = e.split('=')[1];
});

6
utils/language/en_US.js

@ -327,6 +327,7 @@ export default {
isLogOut:'Are you sure you want to log out?',
account: 'account',
Recharge: 'Recharge',
confirmPassword: 'Confirm Password',
Withdrawal: 'Withdrawal',
Transfer: 'Transfer',
Balance: 'Balance(U)',
@ -361,7 +362,7 @@ export default {
Cancel: 'Cancel',
ModifyWithdrawalPassword: 'Modify Withdrawal Password',
CreateNewPassword: 'Create new password',
ModifiedSuccessfully:'Modified successfully',
Fresh: 'Fresh',
Release: 'Release',
@ -380,9 +381,6 @@ export default {
TransferNumber: 'Transfer number',
PleaseEnterNumber: 'Please enter number',
Usable: 'Usable :',
ALL: 'ALL',
Consulting:'Consulting',
}
}

Loading…
Cancel
Save