Commit 4aa2743b authored by Damon's avatar Damon

Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0

parents a7a9e9a4 19fd5136
let commonApiFun = function(vm) {
const globalUrl = process.uniEnv || {}
let uCenterApiUrl = globalUrl.uCenterUrl
let apiUrl = globalUrl.apiUrl
let loginWechatAuth = async (params = {}) =>
await vm.$u.post('/wxapp/unify/authorization', params)
let payOrder = async (params = {}) => await vm.$u.post('/pay/order', params)
let payQuery = async (params = {}) => await vm.$u.get('/pay/query', params)
let getQiNiuToken = async (params = {}) =>
await vm.$u.post(uCenterApiUrl + 'v1/tokens', params)
await vm.$u.get(apiUrl + '/rest/file/token/get', params)
const commonApi = {
loginWechatAuth,
payOrder,
......
......@@ -46,7 +46,7 @@ function getPhoto(type, token) {
}
let sourceType = type == 1 ? ['album'] : ['album', 'camera']
uni.chooseImage({
count: 6, //默认9
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, //从相册选择
success: function(res) {
......@@ -87,7 +87,7 @@ function upload(filePath, token) {
},
complete: (res) => {
if (res.statusCode === 200) {
resolve(JSON.parse(res.data).key)
resolve(JSON.parse(res.data).key || JSON.parse(res.data).src)
} else {
reject(res.errMsg)
}
......
......@@ -58,7 +58,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="42rpx"
:src="questionIcon"
></u-image>
</u-cell-item>
......@@ -71,7 +71,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="36rpx"
:src="serviceIcon"
></u-image>
</u-cell-item>
......@@ -84,7 +84,7 @@
<u-image
slot="icon"
width="36rpx"
height="40rpx"
height="34rpx"
:src="settingIcon"
></u-image>
</u-cell-item>
......
......@@ -32,6 +32,7 @@
binderror=""
bindload=""
@click="getBack"
style="margin-top: 30rpx"
/>
</view>
</view>
......
......@@ -29,12 +29,21 @@ export default {
return {
student: {
workUnit: '',
isNotSet: null,
},
}
},
computed: {},
onLoad() {
this.student = getApp().globalData.student
if (this.student.workUnit == '' || !this.student.workUnit) {
this.isNotSet = true
}
},
onUnload() {
if (this.isNotSet) {
this.student.workUnit = ''
}
},
methods: {
submit() {
......@@ -47,6 +56,7 @@ export default {
workUnit: this.student.workUnit,
})
.then((res) => {
this.isNotSet = false
this.$u.toast('保存成功')
setTimeout(() => {
this.$u.route({
......
......@@ -24,7 +24,12 @@
></u-image>
</view>
</u-cell-item>
<u-cell-item title="证件照" @click="changeCertPhoto">
<u-cell-item
title="证件照"
@click="changeCertPhoto"
:arrow="false"
:hover-class="none"
>
<view slot="right-icon">
<u-image
v-if="isupLoadCertPhoto"
......@@ -32,7 +37,7 @@
height="120rpx"
:src="headCertPhoto"
></u-image>
<text v-else style="color:blue;">未上传</text>
<text v-else style="color:#2953FF">去上传</text>
</view>
</u-cell-item>
<u-cell-item title="手机号" :arrow="false" :hover-class="none">
......@@ -43,7 +48,8 @@
open-type="getPhoneNumber"
@getphonenumber="getPhonenumber"
>
{{ getMobile }}
<text v-if="getMobile">{{ getMobile }}</text>
<text v-else class="empty-value">去绑定</text>
</button>
</view>
</u-cell-item>
......@@ -51,12 +57,18 @@
title="实名认证"
title-style="{'font':'bold','font-size':'40rpx'}"
:value="getCertifyStatus"
:value-style="{
color: getCertifyStatus == '去认证' ? '#2953FF' : '#191C27',
}"
@click="goCertify"
>
</u-cell-item>
<u-cell-item
title="工作单位"
:value="getCompany"
:value-style="{
color: getCompany == '去填写' ? '#2953FF' : '#191C27',
}"
@click="goCompany"
></u-cell-item>
</u-cell-group>
......@@ -91,29 +103,32 @@ export default {
return (this.student && this.student.identityNumber) || false
},
getMobile() {
return (this.student && this.student.phoneNumber) || ''
return (
(this.student &&
this.student.phoneNumber &&
this.student.phoneNumber.length > 5 &&
this.student.phoneNumber) ||
false
)
},
getCompany() {
return (this.student && this.student.workUnit) || ''
return (this.student && this.student.workUnit) || '去填写'
},
getCertifyStatus() {
return this.student && !this.student.isCertify ? '去认证' : '已认证'
return this.student && this.student.isCertify ? '已认证' : '去认证'
},
},
onLoad() {
this.$u.api.getQiNiuToken({ type: 'image' }).catch((data) => {
if (data.errMsg == 'request:ok') {
this.$u.api
.getQiNiuToken({ bucketName: 'banshou-userprofile' })
.then((res) => {
this.token = data.data.token //token为七牛云的token一般由后台接口提供
getApp().globalData.qiNiuToken = data.data.token
} else {
this.$u.toast('获取token失败')
}
})
})
this.$u.api.getUserInfo().then((res) => {
if (res && res.identityNumber) {
res.isCertify = true
this.student.isCertify = true
}
this.student = res
})
},
......@@ -268,8 +283,11 @@ page {
.mobile-button {
width: 115px;
height: 55rpx;
background: none;
font-size: 28rpx;
text-align: right;
padding-right: 0;
}
button::after {
border: none;
......@@ -290,7 +308,7 @@ button::after {
border-top-width: 0;
}
.content ::v-deep .u-cell__value {
color: #191c27;
.empty-value {
color: #2953ff;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment