baijunde 1 год назад
Родитель
Сommit
761eb1937d
2 измененных файлов с 42 добавлено и 4 удалено
  1. 25 3
      components/common/serviceWidget.vue
  2. 17 1
      pages/carInsure/entry.vue

+ 25 - 3
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"
+			@touchmove.stop.prevent="touchmove" @touchend="touchend"
 			:class="{transition: isDock && !isMove }">
-			<image src="/static/img/customerService.png" mode="" style="width: 46px;height: 56px;"></image>
+			<image src="/static/img/customerService.png" mode="" style="width: 46px;height: 56px;"  @click.stop.prevent="click"></image>
+			<view class="wechat" @click="weChat">
+				微信客服
+			</view>
 		</view>
+		
 	</view>
 </template>
 <script>
@@ -84,6 +88,9 @@
 
 		},
 		methods: {
+			weChat(){
+				this.$emit('weChatClick');
+			},
 			click() {
 				this.$emit('btnClick');
 			},
@@ -140,9 +147,10 @@
 	}
 </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 +168,19 @@
 		&.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>

+ 17 - 1
pages/carInsure/entry.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="page">
-		<service-widget @btnClick="btn_click"></service-widget>
+		<service-widget @btnClick="btn_click" @weChatClick="weChatService"></service-widget>
 		<view class="banner mb-3" v-if="insuranceType==1">
 			<image src="/static/image/car-insure/carban.png" mode=""></image>
 		</view>
@@ -714,6 +714,22 @@
 					url: '/pages/chat/chat'
 				})
 			},
+			weChatService(){
+					this.$http.get('/sys/qy/wechat/find/picture').then(res => {
+						 uni.share({
+						 	provider: "weixin",
+						 	openCustomerServiceChat: true,
+						 	customerUrl: res.data.supportStaffUrl, //企业微信地址
+						 	corpid: 'wwfe67d19509d43ec5', //企业id
+						 	success: (res) => {
+						 	},
+						 	fail: (err) => {
+						 	}
+						 });
+
+
+					})
+			},
 			toggleSwitch() {
 				this.isActive = !this.isActive;
 			},