|
|
|
@ -23,11 +23,12 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 选择角色 --> |
|
|
|
|
<uni-popup ref="popup" :is-mask-click="false"> |
|
|
|
|
<view class="type-wrap"> |
|
|
|
|
<view class="title-wrap"> |
|
|
|
|
<view class="title">请选择注册类型</view> |
|
|
|
|
<uni-icons class="close" type="closeempty" size="20" color="#333"></uni-icons> |
|
|
|
|
<!-- <uni-icons class="close" type="closeempty" size="20" color="#333"></uni-icons> --> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="types"> |
|
|
|
@ -52,15 +53,29 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
|
|
<!-- 上传头像 --> |
|
|
|
|
<uni-popup ref="uploadAvatarPop" background-color="#fff" type="bottom" :mask-click="false"> |
|
|
|
|
<view class="avatar-wrap"> |
|
|
|
|
<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> |
|
|
|
|
<image class="avatar" :src="avatar ? avatar : Common.avatar" mode=""></image> |
|
|
|
|
</button> |
|
|
|
|
<view class="text">请选择头像</view> |
|
|
|
|
<view class="btn" @click="showPlatform">下一步</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { login, userBinding, getSessionKey, kindergartenWeChatApplication, saveCertification, loginWithPhoneNumber } from '@/apis/modules/user.js' |
|
|
|
|
import { login, userBinding, getSessionKey, kindergartenWeChatApplication, saveCertification, loginWithPhoneNumber, updateAvatars } from '@/apis/modules/user.js' |
|
|
|
|
import WXBizDataCrypt from '@/libs/WXBizDataCrypt' |
|
|
|
|
import OSS from '@/libs/Oss/upload' |
|
|
|
|
import Common from '@/config/common' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
Common, |
|
|
|
|
agree: [], |
|
|
|
|
agreeData: [{ |
|
|
|
|
text: '同意', |
|
|
|
@ -74,7 +89,9 @@ |
|
|
|
|
code: '', |
|
|
|
|
phone: '', |
|
|
|
|
submiting: false, |
|
|
|
|
teamName: '' |
|
|
|
|
teamName: '', |
|
|
|
|
// avatar: Common.avatar, |
|
|
|
|
avatar: '', |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
@ -174,8 +191,8 @@ |
|
|
|
|
uni.setStorageSync('openId', res.data.openId) |
|
|
|
|
// uni.setStorageSync('teamId', data.teamId) |
|
|
|
|
} else { |
|
|
|
|
this.$refs.uploadAvatarPop.open() |
|
|
|
|
this.submiting = false |
|
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
|
} |
|
|
|
|
} else { // 登录绑定手机号 |
|
|
|
|
userBinding({ |
|
|
|
@ -240,6 +257,16 @@ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.handleTab(platformId) |
|
|
|
|
|
|
|
|
|
// 有上传头像则调上传头像接口 |
|
|
|
|
if (this.avatar) { |
|
|
|
|
await updateAvatars({ |
|
|
|
|
url: this.avatar, |
|
|
|
|
userName: '', |
|
|
|
|
openId: data.openId, |
|
|
|
|
platformId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.toIndex() |
|
|
|
|
} catch(e) { |
|
|
|
|
this.submiting = false |
|
|
|
@ -260,7 +287,18 @@ |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '../index/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 上传头像回调 |
|
|
|
|
onChooseAvatar(e) { |
|
|
|
|
OSS(e.detail.avatarUrl, async ({ url }) => { |
|
|
|
|
this.avatar = url |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 弹出选择角色弹框 |
|
|
|
|
showPlatform() { |
|
|
|
|
this.$refs.uploadAvatarPop.close() |
|
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
@ -414,4 +452,41 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.avatar-wrap { |
|
|
|
|
padding: 30rpx 0; |
|
|
|
|
.avatar-btn { |
|
|
|
|
padding: 0; |
|
|
|
|
line-height: 0; |
|
|
|
|
border: 0 !important; |
|
|
|
|
background-color: transparent; |
|
|
|
|
outline: none; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
&:after { |
|
|
|
|
display: none; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.avatar { |
|
|
|
|
width: 120rpx; |
|
|
|
|
height: 120rpx; |
|
|
|
|
border: 0; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
} |
|
|
|
|
.text { |
|
|
|
|
margin-top: 10rpx; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
text-align: center; |
|
|
|
|
color: #7d7d7d; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.btn { |
|
|
|
|
width: 300rpx; |
|
|
|
|
padding: 20rpx 0; |
|
|
|
|
margin: 30rpx auto 0; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #fff; |
|
|
|
|
text-align: center; |
|
|
|
|
background-color: $uni-primary; |
|
|
|
|
border-radius: 20px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|