|
|
@@ -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>
|