Prechádzať zdrojové kódy

首页绑定顾问按钮

xhj 2 rokov pred
rodič
commit
9c1ea0dc59
3 zmenil súbory, kde vykonal 56 pridanie a 1 odobranie
  1. 16 0
      pages/index/index.css
  2. 39 0
      pages/index/index.vue
  3. 1 1
      utils/request.js

+ 16 - 0
pages/index/index.css

@@ -961,4 +961,20 @@ page{background: #fff;}
 
   color: transparent;
 
+}
+
+.bind-btn {
+	position: fixed;
+	right: 0rpx;
+	font-size: 24rpx;
+	color: #fff;
+	border-radius: 100%;
+	background-color: #FF7229;
+	width: 90rpx;
+	height: 90rpx;
+	margin-right: 30rpx;
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
 }

+ 39 - 0
pages/index/index.vue

@@ -296,6 +296,13 @@
 				复制微信号
 			</view>
 		</view>
+		
+		<view class="bind-btn" v-if="userInfo.id&&userInfo.userType!=1&&!userInfo.manageSaleNo" @click="bindSale()" :style="'bottom:'+(recommendCard&&userInfo.id!=recommendCard.userId?'480rpx;':'360rpx;')">
+			<image  style="width: 38rpx;height: 38rpx;" src="/static/images/bind.png" mode="aspectFit"></image>
+			<view class="change-option-text">绑定</view>
+			<!-- 绑定销售员-->
+		</view>
+		
 		<msgNumber :bottom="recommendCard&&userInfo.id!=recommendCard.userId?'350rpx':'230rpx'"></msgNumber>
 		<!-- <view class="chat-fixed" v-if="recommendCard">
 			<view class="chat-box ddflex" @click="jumpSingleChatRoom()">
@@ -1215,6 +1222,38 @@
 				}
 				return true;
 			},
+			
+			bindSale(){
+				let userInfo = req.getStorage('userInfo');
+				console.log('updateInfo userInfo.avatar',userInfo.avatar)
+				if (!userInfo.avatar || userInfo.nickName == '微信用户') {
+					this.isShowUpdate = true
+					this.isUpdateInfo = true
+					this.isUpdateMobile = false
+					return false
+				}
+				if(userInfo.avatar&&!userInfo.mobile){
+					this.isShowUpdate = true
+					this.isUpdateMobile = true
+					this.isUpdateInfo = false
+					return false
+				}
+				uni.showModal({
+					title:'提示',
+					content:`是否绑定${this.recommendCard.realName}为您的专属顾问?`,
+					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')
+							})
+						}
+					}
+				})
+			},
 		},
 		mounted() {
 			const systemInfo = uni.getSystemInfoSync();

+ 1 - 1
utils/request.js

@@ -3,7 +3,7 @@ let WebIM = (wx.WebIM = require("../hxChatSDK/utils/WebIM")["default"]);
 import JSEncrypt from '../utils/jsencrypt.js'
 
 const env = {
-	NODE_ENV: 'pota',
+	NODE_ENV: 'dev',
 	dev: {
 		// apiUrl: 'https://rsapi.zhiqiyun.net'
 		apiUrl: 'https://unwx.e-chinalife.com/hkttest',