yujialong 22 hours 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 request from '@/apis/request.js'
const { get, post } = request
const { get, post, put } = request
export const studentWeChatAppletCallback = (data) => {
return post('users/users/user/studentWeChatAppletCallback', data)
@ -58,6 +58,9 @@ export const userBinding = (data) => {
export const sendPhoneOrEmailCode = (data) => {
return post('users/users/userAccount/sendPhoneOrEmailCode', data)
}
export const bindPhoneOrEmail = (data) => {
return post('users/users/userAccount/bindPhoneOrEmail', data)
}
export const 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)
}
export const mailCodeSend = (data) => {
return post('nakadai/nakadai/partner-team/mailCodeSend', data)
}
export const changeAccount = 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 => {
return post(`users/users/applets/mine/checkIfAnAccountExists?account=${account}`)
}

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

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

@ -77,7 +77,7 @@
<view v-for="(item, i) in practices" :key="i" class="item" @click="toPrac(item)">
<view class="c-name">{{ item.projectName }}</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="btn">练习情况</view>
</view>

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

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

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

@ -1,29 +1,32 @@
<template>
<view class="page">
<view class="input">
<uni-easyinput v-model="form.email" placeholder="请填写你的邮箱" :clearable="false" />
<view class="line">
<view class="label">手机号</view>
<input type="text" v-model.trim="form.email" placeholder="请填写你的邮箱" />
</view>
<view class="input code-wrap">
<uni-easyinput class="code" v-model="form.code" placeholder="验证码" :clearable="false" />
<view class="line code-wrap not-bd">
<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>
<button type="primary" @click="submit">确认</button>
<view class="btn" @click="submit">确认</view>
</view>
</template>
<script>
import { updateMyEmail, mailCodeSend } from '@/apis/modules/user.js'
import { bindPhoneOrEmail, sendPhoneOrEmailCode } from '@/apis/modules/user.js'
export default {
data() {
return {
userId: '',
userId: uni.getStorageSync('userId'),
form: {
email: '',
code: ''
},
emailOpener: '',
codeDisabled: false,
phoneTimer: null,
btnText: '发送验证码',
btnText: '获取验证码',
}
},
onShow() {
@ -35,11 +38,15 @@
const { email } = this.form
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('请输入正确的请输入邮箱')
mailCodeSend({
sendPhoneOrEmailCode({
userId: this.userId,
email,
platformId: 4
types: 1,
}).then(res => {
this.phoneCountdown()
if (res.message.opener) {
this.phoneCountdown()
this.emailOpener = res.message.opener
}
}).catch(res => {})
},
//
@ -65,10 +72,12 @@
const { email, code } = this.form
if (!email) return this.$util.errMsg('请输入邮箱')
if (!code) return this.$util.errMsg('请输入验证码')
updateMyEmail({
bindPhoneOrEmail({
userId: this.userId,
email,
types: 1,
code,
platformId: 4
opener: this.emailOpener,
}).then(res => {
this.$util.sucMsg('修改成功!')
setTimeout(() => {
@ -82,32 +91,49 @@
<style scoped lang="scss">
.page {
min-height: 100%;
padding: 20px;
background-color: #fff;
}
/deep/.input {
margin-bottom: 15px;
.is-input-border {
border-color: #dedede !important;
box-sizing: border-box;
.line {
display: flex;
align-items: center;
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>

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

@ -1,15 +1,18 @@
<template>
<view class="page">
<view class="input">
<uni-easyinput type="password" v-model.trim="form.password" placeholder="请输入旧密码"></uni-easyinput>
<view class="line">
<view class="label">原密码</view>
<input type="password" v-model.trim="form.password" placeholder="请输入密码" />
</view>
<view class="input">
<uni-easyinput type="password" v-model.trim="form.newPassword" placeholder="请输入新密码"></uni-easyinput>
<view class="line">
<view class="label">新密码</view>
<input type="password" v-model.trim="form.newPassword" placeholder="请输入新密码" />
</view>
<view class="input">
<uni-easyinput type="password" v-model.trim="form.reNewPassword" placeholder="请再次输入新密码"></uni-easyinput>
<view class="line not-bd">
<view class="label">确认新密码</view>
<input type="password" v-model.trim="form.reNewPassword" placeholder="请再次输入新密码" />
</view>
<button type="primary" @click="submit">确认</button>
<view class="btn" @click="submit">确认</view>
</view>
</template>
@ -50,13 +53,38 @@
<style scoped lang="scss">
.page {
min-height: 100%;
padding: 20px;
background-color: #fff;
}
/deep/.input {
margin-bottom: 15px;
.is-input-border {
border-color: #dedede !important;
box-sizing: border-box;
.line {
display: flex;
align-items: center;
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>

@ -1,22 +1,24 @@
<template>
<view class="page">
<view class="input">
<uni-easyinput type="number" v-model="form.phone" placeholder="请填写你的手机号" maxlength="11" :clearable="false" />
<view class="line">
<view class="label">手机号</view>
<input type="number" v-model.trim="form.phone" placeholder="请填写你的手机号" maxlength="11" />
</view>
<view class="input code-wrap">
<uni-easyinput class="code" type="number" v-model="form.code" placeholder="验证码" maxlength="6" :clearable="false" />
<view class="line code-wrap not-bd">
<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>
<button type="primary" @click="submit">确认</button>
<view class="btn" @click="submit">确认</view>
</view>
</template>
<script>
import { sendPhoneOrEmailCode, changePhoneNumber, checkIfThePhoneNumberExists } from '@/apis/modules/user.js'
import { sendPhoneOrEmailCode, bindPhoneOrEmail } from '@/apis/modules/user.js'
export default {
data() {
return {
userId: '',
userId: uni.getStorageSync('userId'),
form: {
phone: '',
code: ''
@ -24,7 +26,7 @@
codeDisabled: false,
phoneTimer: null,
phoneOpener: '',
btnText: '发送验证码',
btnText: '获取验证码',
}
},
onShow() {
@ -73,7 +75,13 @@
const { phone, code } = this.form
if (!phone) 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('修改成功!')
setTimeout(() => {
uni.navigateBack()
@ -86,32 +94,49 @@
<style scoped lang="scss">
.page {
min-height: 100%;
padding: 20px;
background-color: #fff;
}
/deep/.input {
margin-bottom: 15px;
.is-input-border {
border-color: #dedede !important;
box-sizing: border-box;
.line {
display: flex;
align-items: center;
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>

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

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

Loading…
Cancel
Save