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