Просмотр исходного кода

Merge branch 'new-dev' of http://39.101.143.165:8090/sxzgd/vue-insagent-app into new-dev

@dongkboy 1 год назад
Родитель
Сommit
7bf79cb4a9
2 измененных файлов с 52 добавлено и 7 удалено
  1. 51 7
      components/common/serviceWidget.vue
  2. 1 0
      pages/carInsure/entry.vue

+ 51 - 7
components/common/serviceWidget.vue

@@ -1,10 +1,14 @@
 <template>
 	<view>
 		<view id="_drag_button" class="drag" :style="'left: ' + left + 'px; top:' + top + 'px;'"
-			@touchmove.stop.prevent="touchmove" @touchend="touchend" @click.stop.prevent="click"
-			:class="{transition: isDock && !isMove }">
-			<image src="/static/img/customerService.png" mode="" style="width: 46px;height: 56px;"></image>
+			@touchmove.stop.prevent="touchmove" @touchend="touchend" :class="{transition: isDock && !isMove }">
+			<image src="/static/img/customerService.png" mode="" style="width: 46px;height: 56px;"
+				@click.stop.prevent="click"></image>
+			<view class="wechat" @click="weChatService" v-if="isDisplay">
+				微信客服
+			</view>
 		</view>
+
 	</view>
 </template>
 <script>
@@ -36,7 +40,9 @@
 				windowHeight: 0,
 				isMove: true,
 				edge: 10,
-				text: '按钮'
+				text: '按钮',
+				supportStaffUrl: '', //企业微信客服地址
+				isDisplay: null, //企业微信客服是否展示
 			}
 		},
 		mounted() {
@@ -80,10 +86,20 @@
 						this.top = this.windowHeight - this.height - this.edge;
 					}
 				}).exec();
-			}, 200)
-
+			}, 200);
+			this.getWechatData()
 		},
 		methods: {
+			//获取企业微信客服地址,是否展示
+			getWechatData(){
+				this.$http.get('/sys/qy/wechat/find/picture').then(res => {
+					this.supportStaffUrl = res.data.supportStaffUrl
+					this.isDisplay = res.data.display
+				})
+			},
+			weChat() {
+				this.$emit('weChatClick');
+			},
 			click() {
 				this.$emit('btnClick');
 			},
@@ -136,13 +152,26 @@
 				}
 
 			},
+			//点击跳转企业微信客服
+			weChatService() {
+				uni.share({
+					provider: "weixin",
+					openCustomerServiceChat: true,
+					customerUrl: this.supportStaffUrl, //企业微信地址
+					corpid: 'wwfe67d19509d43ec5', //企业id
+					success: (res) => {},
+					fail: (err) => {}
+				});
+			},
+
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.drag {
 		display: flex;
+		flex-direction: column;
 		justify-content: center;
 		align-items: center;
 		// background-color: rgba(0, 0, 0, 0.5);
@@ -160,5 +189,20 @@
 		&.transition {
 			transition: left .3s ease, top .3s ease;
 		}
+
+		.wechat {
+			width: 55%;
+			font-size: 30rpx;
+			line-height: 30rpx;
+			margin-top: 30rpx;
+			padding: 5rpx;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			background-color: #07c160;
+			color: #ffffff;
+			box-sizing: border-box;
+			border-radius: 10rpx;
+		}
 	}
 </style>

+ 1 - 0
pages/carInsure/entry.vue

@@ -800,6 +800,7 @@
 					url: '/pages/chat/chat'
 				})
 			},
+
 			toggleSwitch() {
 				this.isActive = !this.isActive;
 			},