|
|
@@ -14,9 +14,17 @@
|
|
|
<image src="/static/images/wxChat.png"></image>
|
|
|
<view>聊一聊</view>
|
|
|
</view>
|
|
|
- <view class="sc-btn flex" @click="toIndex">进入我的微页</view>
|
|
|
+ <block v-if="userInfo.manageSaleNo">
|
|
|
+ <view class="sc-btn flex" @click="toIndex">进入我的微页</view>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <view class="sc-btn flex" style="border-radius: 80rpx 0 0 80rpx;" @click="toIndex">进入微页</view>
|
|
|
+ <view class="sc-btn flex" style="margin-left: 10rpx;border-radius: 0 80rpx 80rpx 0;background-color: #FF7229;" v-if="!userInfo.manageSaleNo" @click="bindSale()">绑定</view>
|
|
|
+ </block>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <update-userinfo :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" :is-update="true" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateMobile="updateMobileInfo" @updateInfo="updateInfo"></update-userinfo>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -30,7 +38,11 @@
|
|
|
return {
|
|
|
userInfo:{},
|
|
|
recommendCard: {},
|
|
|
- loading:true
|
|
|
+ loading:true,
|
|
|
+
|
|
|
+ isShowUpdate: false, //是否显示更新信息弹窗
|
|
|
+ isUpdateInfo: false, //更新用户信息
|
|
|
+ isUpdateMobile: false, //绑定手机号
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -96,7 +108,54 @@
|
|
|
uni.switchTab({
|
|
|
url: '/pages/index/index'
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ bindSale(){
|
|
|
+ let userInfo = req.getStorage('userInfo');
|
|
|
+ console.log('updateInfo userInfo.avatar',userInfo.avatar)
|
|
|
+ if (!userInfo.avatar || userInfo.nickName == '微信用户') {
|
|
|
+ this.isShowUpdate = true
|
|
|
+ this.isUpdateInfo = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(userInfo.avatar&&!userInfo.mobile){
|
|
|
+ this.isShowUpdate = true
|
|
|
+ this.isUpdateMobile = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ title:'提示',
|
|
|
+ content:'是否绑定该顾问?',
|
|
|
+ success: (con) => {
|
|
|
+ if(con.confirm){
|
|
|
+ req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.recommendCard.jobNumber},res=>{
|
|
|
+ req.msg('已绑定专属顾问')
|
|
|
+ let userInfo = req.getStorage('userInfo')
|
|
|
+ userInfo.manageSaleNo = this.recommendCard.jobNumber
|
|
|
+ req.setStorage('userInfo',userInfo)
|
|
|
+ this.userInfo = req.getStorage('userInfo')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showUpdate(){
|
|
|
+ this.isShowUpdate = true;
|
|
|
+ this.isUpdateInfo = true;
|
|
|
+ },
|
|
|
+ closeUpdate(){
|
|
|
+ this.isShowUpdate = false
|
|
|
+ this.isUpdateInfo = false;
|
|
|
+ },
|
|
|
+ updateInfo(e){
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.bindSale()
|
|
|
+ },500)
|
|
|
+ },
|
|
|
+ updateMobileInfo(e){
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.bindSale()
|
|
|
+ },500)
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|