[liang] 3 years ago
parent
commit
44b8bb8a65
  1. 97
      pages/me/about.vue
  2. 29
      pages/me/aboutUs.vue
  3. 65
      pages/me/changeLoginPassword.vue
  4. 2
      utils/api.js
  5. 3
      utils/axios.js
  6. 6
      utils/language/en_US.js

97
pages/me/about.vue

@ -1,97 +0,0 @@
<template>
<view class="main">
<!-- nav -->
<navigation>{{ i18n.AboutUs }}</navigation>
<view class="body">
</view>
</view>
</template>
<script>
import api from '@/utils/api'
export default {
name: "AboutUs",
data() {
return {
};
},
computed: {
i18n() {
return this.$t("me");
},
},
onLoad() {
this.about();
},
onShow() { },
methods: {
//
about() {
api.aboutus().then(res => {
console.log(res)
})
},
},
}
</script>
<style lang="scss" scoped>
.main {
.body {
overflow: hidden;
margin-top: 200rpx;
padding: 0 48rpx;
.shareText {
margin-top: 104rpx;
font-size: 60rpx;
font-weight: 800;
text-align: center;
}
.scanText {
font-size: 32rpx;
text-align: center;
color: #A2A0A8;
}
.QRCode {
box-sizing: border-box;
margin: 66rpx auto;
width: 520rpx;
height: 520rpx;
background-image: url(../../static/me/bg_QR_code.png);
background-repeat: no-repeat;
background-size: 520rpx;
padding: 52rpx;
.QRCodeImg {
margin-left: 8rpx;
}
}
.myIdText {
font-size: 48rpx;
font-weight: 800;
text-align: center;
}
.button {
height: 112rpx;
margin: 72rpx 0;
border-radius: 32rpx;
color: #15141F !important;
font-weight: 700;
font-size: 32rpx;
}
}
}
</style>

29
pages/me/aboutUs.vue

@ -4,20 +4,21 @@
<navigation :bgTransparent="true">{{ i18n.AboutUs }}</navigation> <navigation :bgTransparent="true">{{ i18n.AboutUs }}</navigation>
<!-- 列表 --> <!-- 列表 -->
<view class="content"> <view class="content">
<view class="card" v-for="(item, index) in 5" :key="index"> <view class="card" v-for="(item, index) in aboutus" :key="index">
<view class="title">{{ i18n.Consulting }}</view> <view class="title">{{ item.title }}</view>
<view class="text">A Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem <view class="text" v-html="item.content"></view>
Ipsum has been the industry's standard dummy text ever since the 1500s, </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { import api from '@/utils/api'
export default {
name: "aboutUs", name: "aboutUs",
data() { data() {
return { return {
aboutus:[],
}; };
}, },
computed: { computed: {
@ -26,16 +27,22 @@ export default {
}, },
}, },
onLoad() { onLoad() {
this.about()
}, },
onShow() { },
methods: {
onShow() {},
methods: {
about() {
api.aboutus().then(res => {
this.aboutus = res
})
},
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main {
background-image: url(../../static/me/image.png); background-image: url(../../static/me/image.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 750rpx 424rpx; background-size: 750rpx 424rpx;
@ -43,7 +50,7 @@ export default {
&::after { &::after {
content: ""; content: "";
position:fixed; position: fixed;
bottom: 0px; bottom: 0px;
right: 0px; right: 0px;
width: 418rpx; width: 418rpx;
@ -82,5 +89,5 @@ export default {
} }
} }
} }
</style> </style>

65
pages/me/changeLoginPassword.vue

@ -6,12 +6,14 @@
<u-input class="input" type="password" v-model="oldPassword" color="#A1A0A8" fontSize="28rpx" border="none" <u-input class="input" type="password" v-model="oldPassword" color="#A1A0A8" fontSize="28rpx" border="none"
:placeholder="i18n.PleaseEnterTheOldPassword"> :placeholder="i18n.PleaseEnterTheOldPassword">
</u-input> </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"> :placeholder="i18n.CreateNewLoginPassword">
</u-input> </u-input>
<u-input class="input" type="password" v-model="confirmPassword" color="#A1A0A8" fontSize="28rpx" border="none"
<!-- 修改登录密码按钮 --> :placeholder="i18n.confirmPassword">
<u-button class="button" color="#00E8A2" throttleTime="500" :disabled="disabled"> </u-input>
<!-- 修改登录密码按钮 :disabled="disabled"-->
<u-button class="button" color="#00E8A2" throttleTime="500" @click="changePassword()" :throttleTime="500">
{{ i18n.Confirm }} {{ i18n.Confirm }}
</u-button> </u-button>
</view> </view>
@ -19,13 +21,19 @@
</template> </template>
<script> <script>
import api from '@/utils/api'
import md5 from 'js-md5'
export default { export default {
name: "changeLoginPassword", name: "changeLoginPassword",
data() { data() {
return { return {
oldPassword: '', oldPassword: '',
newPassword: '', password: '',
confirmPassword:'',
disabled: true, disabled: true,
//
isCanPassword: false,
}; };
}, },
computed: { computed: {
@ -33,11 +41,58 @@ export default {
return this.$t("me"); 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() { onLoad() {
}, },
onShow() { }, onShow() { },
methods: { 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> </script>

2
utils/api.js

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

3
utils/axios.js

@ -41,7 +41,9 @@ service.interceptors.request.use(
const ticket = uni.getStorageSync('ticket') const ticket = uni.getStorageSync('ticket')
if (ticket) { if (ticket) {
if(!config.data){
config.data = {}; config.data = {};
}
config.data['ticket'] = ticket config.data['ticket'] = ticket
} }
if (Vue.prototype.$showDialog) { if (Vue.prototype.$showDialog) {
@ -71,7 +73,6 @@ service.interceptors.request.use(
} }
//console.log(config.url,111111,config.data,dataStr) //console.log(config.url,111111,config.data,dataStr)
config.data = {}; config.data = {};
dataStr.forEach(function(e) { dataStr.forEach(function(e) {
config.data[e.split('=')[0]] = e.split('=')[1]; 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?', isLogOut:'Are you sure you want to log out?',
account: 'account', account: 'account',
Recharge: 'Recharge', Recharge: 'Recharge',
confirmPassword: 'Confirm Password',
Withdrawal: 'Withdrawal', Withdrawal: 'Withdrawal',
Transfer: 'Transfer', Transfer: 'Transfer',
Balance: 'Balance(U)', Balance: 'Balance(U)',
@ -361,7 +362,7 @@ export default {
Cancel: 'Cancel', Cancel: 'Cancel',
ModifyWithdrawalPassword: 'Modify Withdrawal Password', ModifyWithdrawalPassword: 'Modify Withdrawal Password',
CreateNewPassword: 'Create new password', CreateNewPassword: 'Create new password',
ModifiedSuccessfully:'Modified successfully',
Fresh: 'Fresh', Fresh: 'Fresh',
Release: 'Release', Release: 'Release',
@ -380,9 +381,6 @@ export default {
TransferNumber: 'Transfer number', TransferNumber: 'Transfer number',
PleaseEnterNumber: 'Please enter number', PleaseEnterNumber: 'Please enter number',
Usable: 'Usable :', Usable: 'Usable :',
ALL: 'ALL', ALL: 'ALL',
Consulting:'Consulting',
} }
} }

Loading…
Cancel
Save