同步
This commit is contained in:
@@ -65,6 +65,10 @@
|
||||
<view class="nav-icon"><image class="nav-icon-src" src="@/static/icons/user_nav_03.png"></image>实名认证</view>
|
||||
<u-icon name="arrow-right" color="#cacaca" size="34rpx" bold></u-icon>
|
||||
</view>
|
||||
<view class="nav-flex" @click="onParent">
|
||||
<view class="nav-icon"><image class="nav-icon-src" src="@/static/icons/user_nav_07.png"></image>推荐人</view>
|
||||
<u-icon name="arrow-right" color="#cacaca" size="34rpx" bold></u-icon>
|
||||
</view>
|
||||
<view class="nav-flex" @click="onNav('WeChat')">
|
||||
<view class="nav-icon"><image class="nav-icon-src" src="@/static/icons/user_nav_06.png"></image>关注公众号</view>
|
||||
<u-icon name="arrow-right" color="#cacaca" size="34rpx" bold></u-icon>
|
||||
@@ -74,11 +78,58 @@
|
||||
<view class="nav-icon"><image class="nav-icon-src" src="@/static/icons/user_nav_05.png"></image>设置</view>
|
||||
<u-icon name="arrow-right" color="#cacaca" size="34rpx" bold></u-icon>
|
||||
</view>
|
||||
<!-- 绑定分享关系 -->
|
||||
<u-modal
|
||||
:show="showBind"
|
||||
confirmColor="#446EFE"
|
||||
:showCancelButton="true"
|
||||
:confirmText="isInvitation ? '校验邀请码': '绑定关系'"
|
||||
@cancel="()=> {
|
||||
this.showBind = false
|
||||
this.isInvitation = true
|
||||
this.invitation = ''
|
||||
}"
|
||||
@confirm="onBind"
|
||||
>
|
||||
<slot>
|
||||
<view class="bind-view" v-if="isInvitation">
|
||||
<view class="bind-title">绑定推荐人</view>
|
||||
<view class="bind-subtitle">选择通过那种方式绑定推荐人</view>
|
||||
<view class="bind-type">
|
||||
<u-radio-group
|
||||
class="bind-type-radios"
|
||||
v-model="bindTypeVal"
|
||||
placement="row"
|
||||
>
|
||||
<u-radio
|
||||
:customStyle="{marginLeft: '4px', marginRight: '4px'}"
|
||||
v-for="(item, index) in bindTypeArr"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
/>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="bind-input">
|
||||
<input type="text" v-model="invitation" :placeholder="bindTypeVal == 'mobile'? '输入推荐人手机号' : '输入推荐人邀请码'">
|
||||
</view>
|
||||
</view>
|
||||
<view class="bind-user" v-else>
|
||||
<view class="bind-title">推荐人</view>
|
||||
<view class="bind-subtitle">请确认绑定推荐人关系用户信息</view>
|
||||
<view class="bind-acitve">
|
||||
<image :src="invitationUser.avatar || require('@/static/imgs/default-active.png')" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="bind-nickname">{{invitationUser.nickname}}</view>
|
||||
<view class="bind-username">{{invitationUser.username}}</view>
|
||||
</view>
|
||||
</slot>
|
||||
</u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { info } from '@/apis/interfaces/user.js'
|
||||
import { info,relationsVerify, relationsBind } from '@/apis/interfaces/user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -86,7 +137,22 @@
|
||||
nickname : '',
|
||||
identity : '',
|
||||
avatar : '',
|
||||
certification : ''
|
||||
certification : '',
|
||||
// 绑定关系
|
||||
bindTypeArr : [
|
||||
{ name: '手机号', value: 'mobile'},
|
||||
{ name: '邀请码', value: 'verify'},
|
||||
],
|
||||
bindTypeVal : 'mobile',
|
||||
showBind : false,
|
||||
isInvitation : true,
|
||||
parent : '',
|
||||
invitationUser : {
|
||||
avatar : '',
|
||||
nickname: '',
|
||||
username: ''
|
||||
},
|
||||
invitation : '',
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -100,11 +166,12 @@
|
||||
title: '加载中...'
|
||||
})
|
||||
info().then(res => {
|
||||
let { nickname, identity, avatar, certification } = res
|
||||
let { nickname, identity, avatar, certification, parent } = res
|
||||
this.nickname = nickname
|
||||
this.identity = identity
|
||||
this.avatar = avatar
|
||||
this.certification = certification
|
||||
this.parent = parent
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
@@ -117,6 +184,66 @@
|
||||
onNav(name){
|
||||
this.$Router.push({name})
|
||||
},
|
||||
// 推荐关系
|
||||
onParent(){
|
||||
if(this.parent == ''){
|
||||
this.showBind = true
|
||||
return
|
||||
}
|
||||
uni.showModal({
|
||||
title : '我的推荐人',
|
||||
content : this.parent.nickname,
|
||||
confirmText : '关闭',
|
||||
cancelText : '联系TA',
|
||||
success : modalRes => {
|
||||
if(modalRes.cancel){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.parent.username
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 绑定邀请码
|
||||
onBind(){
|
||||
// 检验邀请码
|
||||
if(this.isInvitation){
|
||||
if(this.invitation === ''){
|
||||
uni.showToast({
|
||||
title: '请输入邀请码',
|
||||
icon : 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
relationsVerify(this.invitation, this.bindTypeVal).then(res => {
|
||||
this.invitationUser = res
|
||||
this.isInvitation = false
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
return
|
||||
}
|
||||
// 绑定关系
|
||||
relationsBind(this.invitation, this.bindTypeVal).then(res => {
|
||||
this.showBind = false
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '关系绑定成功',
|
||||
showCancel : false,
|
||||
success : res => {
|
||||
this.getUserInfo()
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 分享码
|
||||
onUserCode(){
|
||||
if(this.identity.order > 1){
|
||||
@@ -266,4 +393,84 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// 邀请码
|
||||
.bind-view{
|
||||
padding: 15rpx 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.bind-title{
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.bind-type{
|
||||
margin-top: 30rpx;
|
||||
.bind-type-radios{
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.bind-subtitle{
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
padding-top: 15rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.bind-input{
|
||||
padding-top: 30rpx;
|
||||
input{
|
||||
background: #f8f8f8;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 30rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 确认绑定用户关系
|
||||
.bind-user{
|
||||
padding: 15rpx 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.bind-title{
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.bind-subtitle{
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
padding-top: 15rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.bind-acitve{
|
||||
text-align: center;
|
||||
padding-top: 30rpx;
|
||||
image{
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
background: #f8f8f8;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bind-nickname{
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
line-height: 40rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.bind-username{
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user