yujialong 4 months ago
parent b728ec2d21
commit cb43773265
  1. 13
      apis/modules/user.js
  2. 10
      apis/request.js
  3. 3
      components/realName/realName.vue
  4. 2
      course/courseDetail/courseDetail.vue
  5. 12
      libs/share.js
  6. 8
      pages.json
  7. 153
      pages/login/login.vue
  8. BIN
      static/image/tab2-1.png
  9. BIN
      static/image/tab2.png
  10. 3
      styles/common.scss
  11. 100
      user/email/email.vue
  12. 13
      user/info/info.vue
  13. 52
      user/password/password.vue
  14. 91
      user/phone/phone.vue
  15. 2
      user/reg/reg.vue
  16. 2
      user/selectAccount/selectAccount.vue

@ -1,6 +1,6 @@
import Config from '@/config/request.js' import Config from '@/config/request.js'
import request from '@/apis/request.js' import request from '@/apis/request.js'
const { get, post } = request const { get, post, put } = request
export const studentWeChatAppletCallback = (data) => { export const studentWeChatAppletCallback = (data) => {
return post('users/users/user/studentWeChatAppletCallback', data) return post('users/users/user/studentWeChatAppletCallback', data)
@ -58,6 +58,9 @@ export const userBinding = (data) => {
export const sendPhoneOrEmailCode = (data) => { export const sendPhoneOrEmailCode = (data) => {
return post('users/users/userAccount/sendPhoneOrEmailCode', data) return post('users/users/userAccount/sendPhoneOrEmailCode', data)
} }
export const bindPhoneOrEmail = (data) => {
return post('users/users/userAccount/bindPhoneOrEmail', data)
}
export const examinePassword = (data) => { export const examinePassword = (data) => {
return post('users/users/userAccount/examinePassword', data) return post('users/users/userAccount/examinePassword', data)
@ -91,18 +94,10 @@ export const updateMyEmail = (data) => {
return post('nakadai/nakadai/partner-team/updateMyEmail', data) return post('nakadai/nakadai/partner-team/updateMyEmail', data)
} }
export const mailCodeSend = (data) => {
return post('nakadai/nakadai/partner-team/mailCodeSend', data)
}
export const changeAccount = account => { export const changeAccount = account => {
return post(`users/users/applets/mine/changeAccount?account=${account}`) return post(`users/users/applets/mine/changeAccount?account=${account}`)
} }
export const changePhoneNumber = (phone, code) => {
return post(`users/users/applets/mine/changePhoneNumber?phone=${phone}&code=${code}`)
}
export const checkIfAnAccountExists = account => { export const checkIfAnAccountExists = account => {
return post(`users/users/applets/mine/checkIfAnAccountExists?account=${account}`) return post(`users/users/applets/mine/checkIfAnAccountExists?account=${account}`)
} }

@ -73,8 +73,16 @@ const post = (url, data, options = {}) => {
return request(options) return request(options)
} }
const put = (url, data, options = {}) => {
options.method = 'PUT'
options.data = data
options.url = url
return request(options)
}
export default { export default {
request, request,
get, get,
post post,
put
} }

@ -28,8 +28,7 @@
} }
}, },
mounted() { mounted() {
console.log('realname:')
// this.handleRealName()
}, },
methods: { methods: {
// //

@ -77,7 +77,7 @@
<view v-for="(item, i) in practices" :key="i" class="item" @click="toPrac(item)"> <view v-for="(item, i) in practices" :key="i" class="item" @click="toPrac(item)">
<view class="c-name">{{ item.projectName }}</view> <view class="c-name">{{ item.projectName }}</view>
<view class="line">最高分{{ item.hightScore }}&emsp;&emsp;练习次数{{ item.practiceNum }}</view> <view class="line">最高分{{ item.hightScore }}&emsp;&emsp;练习次数{{ item.practiceNum }}</view>
<view class="line">累计练习时长小时{{ item.hightScore }}</view> <view class="line">累计练习时长小时{{ item.duration }}</view>
<view class="line">最近练习时间{{ item.lastTime }}</view> <view class="line">最近练习时间{{ item.lastTime }}</view>
<view class="btn">练习情况</view> <view class="btn">练习情况</view>
</view> </view>

@ -19,17 +19,17 @@ export default{
// 分享到朋友圈 // 分享到朋友圈
onShareTimeline:function(res){ onShareTimeline:function(res){
return { return {
title: '慧教云舟', title: '慧教云舟',
// imageUrl:'/static/image/phone.png', imageUrl: 'https://eduvessel.com/images/occupationlab/share-cover.jpg',
query:'' query:''
} }
}, },
// 收藏 // 收藏
onAddToFavorites:function(res) { onAddToFavorites:function(res) {
return { return {
title: '慧教云舟', title: '慧教云舟',
// imageUrl:'/static/image/phone.png', imageUrl: 'https://eduvessel.com/images/occupationlab/share-cover.jpg',
query: '', query: '',
} }
} }

@ -94,7 +94,7 @@
"path" : "switchAccount/switchAccount", "path" : "switchAccount/switchAccount",
"style" : "style" :
{ {
"navigationBarTitleText": "切换账号", "navigationBarTitleText": "选择账号",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -110,7 +110,7 @@
"path" : "password/password", "path" : "password/password",
"style" : "style" :
{ {
"navigationBarTitleText": "修改密码", "navigationBarTitleText": "更换密码",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
@ -118,7 +118,7 @@
"path" : "phone/phone", "path" : "phone/phone",
"style" : "style" :
{ {
"navigationBarTitleText": "修改手机号", "navigationBarTitleText": "更换手机号",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
@ -126,7 +126,7 @@
"path" : "email/email", "path" : "email/email",
"style" : "style" :
{ {
"navigationBarTitleText": "修改邮箱", "navigationBarTitleText": "更换邮箱",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }

@ -2,17 +2,8 @@
<view class="page"> <view class="page">
<view class="wrap"> <view class="wrap">
<image class="logo" src="https://eduvessel.com/images/occupationlab/hjyz-logo.png" mode="widthFix"></image> <image class="logo" src="https://eduvessel.com/images/occupationlab/hjyz-logo.png" mode="widthFix"></image>
<template v-if="isLogin"> <button v-if="isBind" class="btn" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber">快捷登录</button>
<button class="btn phone" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber"> <button v-else class="btn" @click="toAccounts">快捷登录</button>
<!-- <image src="@/static/image/phone.png" mode="widthFix"></image> -->
{{ isReg ? '获取手机号' : '绑定手机'}}
</button>
</template>
<template v-else>
<view class="btn wechat" @click="login">
快捷登录
</view>
</template>
<view class="agree"> <view class="agree">
<uni-data-checkbox class="check" multiple v-model="agree" :localdata="agreeData"></uni-data-checkbox> <uni-data-checkbox class="check" multiple v-model="agree" :localdata="agreeData"></uni-data-checkbox>
@ -34,17 +25,16 @@
text: '同意', text: '同意',
value: 1 value: 1
}], }],
isLogin: false, //
isReg: false, //
sessionKey: '', sessionKey: '',
openid: '', openid: '',
unionid: '', unionid: '',
submiting: false submiting: false,
isBind: false,
accounts: [],
} }
}, },
onShow() { onShow() {
// uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjM5NTc2LCJyblN0ciI6IjZXZUtCNTdOMU9ubGhBSG53RmJwMWN0c3VuVWlyR2l5IiwiYWNjb3VudElkIjozOTU3NiwidXNlcklkIjozOTU3NSwic2Nob29sSWQiOjI4NDYsInVzZXJOYW1lIjoiYWMiLCJwbGF0Zm9ybUlkIjoiMSJ9.hYkjwTUdMMYQLXJVRmqnw3tqRvGndNAzUiVh1ClyCec') // uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjM5NTc2LCJyblN0ciI6IjZXZUtCNTdOMU9ubGhBSG53RmJwMWN0c3VuVWlyR2l5IiwiYWNjb3VudElkIjozOTU3NiwidXNlcklkIjozOTU3NSwic2Nob29sSWQiOjI4NDYsInVzZXJOYW1lIjoiYWMiLCJwbGF0Zm9ybUlkIjoiMSJ9.hYkjwTUdMMYQLXJVRmqnw3tqRvGndNAzUiVh1ClyCec')
//
this.checkLogin() this.checkLogin()
}, },
methods: { methods: {
@ -54,71 +44,60 @@
this.toIndex() this.toIndex()
} else { } else {
uni.clearStorageSync() uni.clearStorageSync()
this.isLogin = false
this.isReg = false
this.submiting = false this.submiting = false
this.autoLogin()
} }
}, },
// // openid
login() { autoLogin() {
this.isReg = false uni.login({
if (this.agree.length) { success: async ({ code }) => {
if (this.submiting) return false if (code) {
const that = this this.submiting = true
uni.getUserProfile({
lang: 'zh_CN', //
desc: '登录', try {
success: ({ userInfo }) => { const res = await studentWeChatAppletCallback({
uni.login({ code,
success: async ({ code }) => { avatarUrl: ''
if (code) { })
this.submiting = true const { data } = res
this.submiting = false
// const e = data.sessionKey
try { this.sessionKey = e.session_key
const res = await studentWeChatAppletCallback({ this.openid = e.openid
code, uni.setStorageSync('sessionKey', e.session_key)
avatarUrl: userInfo.avatarUrl uni.setStorageSync('openid', e.openid)
}) //
const { data, status } = res if (data.state === 'login') {
this.submiting = false uni.setStorageSync('token', data.token)
const e = data.sessionKey this.toIndex()
this.sessionKey = e.session_key } else if (data.state === 'bind') {
this.openid = e.openid //
uni.setStorageSync('sessionKey', e.session_key) this.isBind = true
uni.setStorageSync('openid', e.openid) } else if (data.data.userAccounts) {
// //
if (data.state === 'login') { this.accounts = JSON.stringify(data.data.userAccounts)
uni.setStorageSync('token', data.token)
this.toIndex()
} else {
//
this.isLogin = true
this.isReg = true
}
} catch (e) {
this.submiting = false
}
} else {
this.submiting = false
that.$util.errMsg('登录失败!')
}
} }
}) } catch (e) {
}, this.submiting = false
fail(res) { }
that.$util.errMsg('登录授权失败!') } else {
this.submiting = false
that.$util.errMsg('登录失败!')
} }
}) }
} else { })
this.$util.errMsg('请先阅读勾选协议!') },
} async toAccounts() {
uni.setStorageSync('accounts', this.accounts)
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}`)
}, },
// //
async onGetPhoneNumber(e){ async onGetPhoneNumber(e){
if (this.submiting) return false if (this.submiting) return false
const { encryptedData, iv } = e.detail const { encryptedData, iv } = e.detail
const appId = this.isDy ? 'tt2192572fbea04fe601' : uni.getAccountInfoSync().miniProgram.appId const appId = uni.getAccountInfoSync().miniProgram.appId
const pc = new WXBizDataCrypt(appId , this.sessionKey) const pc = new WXBizDataCrypt(appId , this.sessionKey)
const decData = pc.decryptData(encryptedData , iv) const decData = pc.decryptData(encryptedData , iv)
this.submiting = true this.submiting = true
@ -131,9 +110,16 @@
}) })
if (data) { if (data) {
const accounts = data.userAccounts const accounts = data.userAccounts
// if (accounts) {
uni.setStorageSync('accounts', JSON.stringify(accounts)) //
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}&phone=${phone}`) uni.setStorageSync('accounts', JSON.stringify(accounts))
this.$util.to(`/user/selectAccount/selectAccount?openid=${this.openid}&phone=${phone}`)
} else {
uni.setStorageSync('token', data.token)
uni.switchTab({
url: '/pages/index/index'
})
}
} else { } else {
// //
this.$util.to(`/user/reg/reg?openid=${this.openid}&phone=${phone}`) this.$util.to(`/user/reg/reg?openid=${this.openid}&phone=${phone}`)
@ -180,28 +166,9 @@
height: 88rpx; height: 88rpx;
margin-bottom: 50rpx; margin-bottom: 50rpx;
font-size: 32rpx; font-size: 32rpx;
border-radius: 10rpx;
image {
width: 50rpx;
margin-right: 15rpx;
}
}
.wechat {
color: #fff; color: #fff;
background-color: #007EFF; background-color: #007EFF;
} border-radius: 10rpx;
.phone {
color: #007EFF;
border: 1px solid #007EFF;
background-color: #fff;
image {
width: 40rpx;
}
}
.reg {
font-size: 28rpx;
color: #e61717;
text-align: right;
} }
.agree { .agree {
display: flex; display: flex;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -134,6 +134,9 @@ ul {
line-height: 1.4rem; line-height: 1.4rem;
} }
} }
.selected-item-text-overflow {
width: auto !important;
}
.btn-wrap { .btn-wrap {
z-index: 10; z-index: 10;
position: fixed; position: fixed;

@ -1,29 +1,32 @@
<template> <template>
<view class="page"> <view class="page">
<view class="input"> <view class="line">
<uni-easyinput v-model="form.email" placeholder="请填写你的邮箱" :clearable="false" /> <view class="label">手机号</view>
<input type="text" v-model.trim="form.email" placeholder="请填写你的邮箱" />
</view> </view>
<view class="input code-wrap"> <view class="line code-wrap not-bd">
<uni-easyinput class="code" v-model="form.code" placeholder="验证码" :clearable="false" /> <view class="label">验证码</view>
<input class="code" type="number" v-model.trim="form.code" placeholder="请填写验证码" maxlength="6" />
<view class="send-code" @click="sendCode" :disabled="codeDisabled">{{ btnText }}</view> <view class="send-code" @click="sendCode" :disabled="codeDisabled">{{ btnText }}</view>
</view> </view>
<button type="primary" @click="submit">确认</button> <view class="btn" @click="submit">确认</view>
</view> </view>
</template> </template>
<script> <script>
import { updateMyEmail, mailCodeSend } from '@/apis/modules/user.js' import { bindPhoneOrEmail, sendPhoneOrEmailCode } from '@/apis/modules/user.js'
export default { export default {
data() { data() {
return { return {
userId: '', userId: uni.getStorageSync('userId'),
form: { form: {
email: '', email: '',
code: '' code: ''
}, },
emailOpener: '',
codeDisabled: false, codeDisabled: false,
phoneTimer: null, phoneTimer: null,
btnText: '发送验证码', btnText: '获取验证码',
} }
}, },
onShow() { onShow() {
@ -35,11 +38,15 @@
const { email } = this.form const { email } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱') if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱')
mailCodeSend({ sendPhoneOrEmailCode({
userId: this.userId,
email, email,
platformId: 4 types: 1,
}).then(res => { }).then(res => {
this.phoneCountdown() if (res.message.opener) {
this.phoneCountdown()
this.emailOpener = res.message.opener
}
}).catch(res => {}) }).catch(res => {})
}, },
// //
@ -65,10 +72,12 @@
const { email, code } = this.form const { email, code } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!code) return this.$util.errMsg('请输入验证码') if (!code) return this.$util.errMsg('请输入验证码')
updateMyEmail({ bindPhoneOrEmail({
userId: this.userId,
email, email,
types: 1,
code, code,
platformId: 4 opener: this.emailOpener,
}).then(res => { }).then(res => {
this.$util.sucMsg('修改成功!') this.$util.sucMsg('修改成功!')
setTimeout(() => { setTimeout(() => {
@ -82,32 +91,49 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
min-height: 100%;
padding: 20px; padding: 20px;
background-color: #fff; background-color: #fff;
} box-sizing: border-box;
/deep/.input { .line {
margin-bottom: 15px; display: flex;
.is-input-border { align-items: center;
border-color: #dedede !important; padding: 20rpx 0;
margin-bottom: 10rpx;
&:not(.not-bd) {
border-bottom: 1px solid #f3f3f3;
}
}
.label {
width: 200rpx;
font-size: 28rpx;
color: #565656;
}
input {
font-size: 28rpx;
color: #333;
}
.code {
flex: 1;
}
.send-code {
margin-left: 20rpx;
color: #4386ff;
font-size: 24rpx;
line-height: 36px;
}
.btn {
width: 300rpx;
height: 60rpx;
margin: 50rpx auto 0;
font-size: 30rpx;
text-align: center;
color: #fff;
line-height: 60rpx;
background-color: #007EFF;
border-radius: 40rpx;
} }
}
.input {
margin-bottom: 20px;
}
.code-wrap {
display: flex;
}
.code {
flex: 1;
}
.send-code {
width: 100px;
margin-left: 20px;
text-align: center;
color: #4386ff;
font-size: 12px;
line-height: 36px;
border: 1px solid #4386ff;
border-radius: 5px;
} }
</style> </style>

@ -121,7 +121,7 @@
<uni-icons v-if="i" class="del" type="trash" size="20" color="#ccc" @click="delArchive(i)"></uni-icons> <uni-icons v-if="i" class="del" type="trash" size="20" color="#ccc" @click="delArchive(i)"></uni-icons>
</view> </view>
</view> </view>
<view class="fold" v-if="archivesList.length > 1"> <view class="fold" id="fold" v-if="archivesList.length > 1">
<view :class="['fold-inner', { active: showArch }]" @click="showArch = !showArch"> <view :class="['fold-inner', { active: showArch }]" @click="showArch = !showArch">
展开更多 展开更多
<uni-icons class="icon" type="bottom" size="20" color="#007EFF"></uni-icons> <uni-icons class="icon" type="bottom" size="20" color="#007EFF"></uni-icons>
@ -154,7 +154,8 @@
experimentName:'', experimentName:'',
sex: 1, sex: 1,
dateBirth: '', dateBirth: '',
educationDegree: '' educationDegree: '',
userId: '',
}, },
userAccount: { userAccount: {
account: '', account: '',
@ -229,6 +230,7 @@
const { hrUserInfo: u, personalFileList: p } = result const { hrUserInfo: u, personalFileList: p } = result
u.avatar = u.userAvatars || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png' u.avatar = u.userAvatars || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
this.hrUserInfo = u this.hrUserInfo = u
uni.setStorageSync('userId', u.userId)
this.userAccount = result.userAccount this.userAccount = result.userAccount
u.provinceId && this.getCity() u.provinceId && this.getCity()
@ -425,6 +427,13 @@
}) })
if(isEmpty) return this.$util.errMsg('请选择职业') if(isEmpty) return this.$util.errMsg('请选择职业')
this.showArch = true this.showArch = true
this.$nextTick(() => {
uni.pageScrollTo({
duration: 300,
selector: '#fold'
})
})
this.concatArch() this.concatArch()
}, },
delArchive(i) { delArchive(i) {

@ -1,15 +1,18 @@
<template> <template>
<view class="page"> <view class="page">
<view class="input"> <view class="line">
<uni-easyinput type="password" v-model.trim="form.password" placeholder="请输入旧密码"></uni-easyinput> <view class="label">原密码</view>
<input type="password" v-model.trim="form.password" placeholder="请输入密码" />
</view> </view>
<view class="input"> <view class="line">
<uni-easyinput type="password" v-model.trim="form.newPassword" placeholder="请输入新密码"></uni-easyinput> <view class="label">新密码</view>
<input type="password" v-model.trim="form.newPassword" placeholder="请输入新密码" />
</view> </view>
<view class="input"> <view class="line not-bd">
<uni-easyinput type="password" v-model.trim="form.reNewPassword" placeholder="请再次输入新密码"></uni-easyinput> <view class="label">确认新密码</view>
<input type="password" v-model.trim="form.reNewPassword" placeholder="请再次输入新密码" />
</view> </view>
<button type="primary" @click="submit">确认</button> <view class="btn" @click="submit">确认</view>
</view> </view>
</template> </template>
@ -50,13 +53,38 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
min-height: 100%;
padding: 20px; padding: 20px;
background-color: #fff; background-color: #fff;
} box-sizing: border-box;
/deep/.input { .line {
margin-bottom: 15px; display: flex;
.is-input-border { align-items: center;
border-color: #dedede !important; padding: 20rpx 0;
margin-bottom: 10rpx;
&:not(.not-bd) {
border-bottom: 1px solid #f3f3f3;
}
}
.label {
width: 200rpx;
font-size: 28rpx;
color: #565656;
}
input {
font-size: 28rpx;
color: #333;
}
.btn {
width: 300rpx;
height: 60rpx;
margin: 50rpx auto 0;
font-size: 30rpx;
text-align: center;
color: #fff;
line-height: 60rpx;
background-color: #007EFF;
border-radius: 40rpx;
} }
} }
</style> </style>

@ -1,22 +1,24 @@
<template> <template>
<view class="page"> <view class="page">
<view class="input"> <view class="line">
<uni-easyinput type="number" v-model="form.phone" placeholder="请填写你的手机号" maxlength="11" :clearable="false" /> <view class="label">手机号</view>
<input type="number" v-model.trim="form.phone" placeholder="请填写你的手机号" maxlength="11" />
</view> </view>
<view class="input code-wrap"> <view class="line code-wrap not-bd">
<uni-easyinput class="code" type="number" v-model="form.code" placeholder="验证码" maxlength="6" :clearable="false" /> <view class="label">验证码</view>
<input class="code" type="number" v-model.trim="form.code" placeholder="请填写验证码" maxlength="6" />
<view class="send-code" @click="sendCode" :disabled="codeDisabled">{{ btnText }}</view> <view class="send-code" @click="sendCode" :disabled="codeDisabled">{{ btnText }}</view>
</view> </view>
<button type="primary" @click="submit">确认</button> <view class="btn" @click="submit">确认</view>
</view> </view>
</template> </template>
<script> <script>
import { sendPhoneOrEmailCode, changePhoneNumber, checkIfThePhoneNumberExists } from '@/apis/modules/user.js' import { sendPhoneOrEmailCode, bindPhoneOrEmail } from '@/apis/modules/user.js'
export default { export default {
data() { data() {
return { return {
userId: '', userId: uni.getStorageSync('userId'),
form: { form: {
phone: '', phone: '',
code: '' code: ''
@ -24,7 +26,7 @@
codeDisabled: false, codeDisabled: false,
phoneTimer: null, phoneTimer: null,
phoneOpener: '', phoneOpener: '',
btnText: '发送验证码', btnText: '获取验证码',
} }
}, },
onShow() { onShow() {
@ -73,7 +75,13 @@
const { phone, code } = this.form const { phone, code } = this.form
if (!phone) return this.$util.errMsg('请输入手机号') if (!phone) return this.$util.errMsg('请输入手机号')
if (!code) return this.$util.errMsg('请输入验证码') if (!code) return this.$util.errMsg('请输入验证码')
changePhoneNumber(phone, code).then(res => { bindPhoneOrEmail({
userId: this.userId,
phone,
types: 2,
code,
opener: this.phoneOpener
}).then(res => {
this.$util.sucMsg('修改成功!') this.$util.sucMsg('修改成功!')
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
@ -86,32 +94,49 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
min-height: 100%;
padding: 20px; padding: 20px;
background-color: #fff; background-color: #fff;
} box-sizing: border-box;
/deep/.input { .line {
margin-bottom: 15px; display: flex;
.is-input-border { align-items: center;
border-color: #dedede !important; padding: 20rpx 0;
margin-bottom: 10rpx;
&:not(.not-bd) {
border-bottom: 1px solid #f3f3f3;
}
}
.label {
width: 200rpx;
font-size: 28rpx;
color: #565656;
}
input {
font-size: 28rpx;
color: #333;
}
.code {
flex: 1;
}
.send-code {
margin-left: 20rpx;
color: #4386ff;
font-size: 24rpx;
line-height: 36px;
}
.btn {
width: 300rpx;
height: 60rpx;
margin: 50rpx auto 0;
font-size: 30rpx;
text-align: center;
color: #fff;
line-height: 60rpx;
background-color: #007EFF;
border-radius: 40rpx;
} }
}
.input {
margin-bottom: 20px;
}
.code-wrap {
display: flex;
}
.code {
flex: 1;
}
.send-code {
width: 100px;
margin-left: 20px;
text-align: center;
color: #4386ff;
font-size: 12px;
line-height: 36px;
border: 1px solid #4386ff;
border-radius: 5px;
} }
</style> </style>

@ -85,7 +85,7 @@
font-size: 28rpx; font-size: 28rpx;
text-align: left; text-align: left;
color: #333; color: #333;
border-bottom: 1px solid #e0e0e0; border-bottom: 1px solid #f3f3f3;
} }
.btn { .btn {
width: 100%; width: 100%;

@ -41,7 +41,7 @@
const { data } = await weChatToken({ const { data } = await weChatToken({
id: item.id, id: item.id,
openid: this.openid, openid: this.openid,
phone: this.phone, phone: item.phone,
platformId: 1, platformId: 1,
}) })
uni.setStorageSync('token', data.token) uni.setStorageSync('token', data.token)

Loading…
Cancel
Save