intelligentGroup/components/message.vue

83 lines
1.4 KiB
Vue
Raw Permalink Normal View History

2023-09-08 14:52:40 +08:00
<template>
<view class="message" @click="handleServiceChat">
<view class="info-msg">
<image src="@/static/mmm.png"></image>
<text>客服</text>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
export default {
data() {
return {
data: {}
}
},
computed: {
...mapState(["HomeContent"]),
},
mounted() {},
methods: {
handleServiceChat() {
let that = this
if (!that.HomeContent.qyappid) {
that.$tools.msg("小程序还未配置微信客服")
return
}
wx.openCustomerServiceChat({
extInfo: { //客服链接
url: that.HomeContent.qyserviceurl
},
corpId: that.HomeContent.qyappid, //企业ID
success(res) {}
})
}
}
}
</script>
<style scoped lang="scss">
.message {
position: fixed;
bottom: 50px;
z-index: 9999;
right: 10px;
background: $blue;
width: 45px;
height: 45px;
padding: 2px;
border-radius: 50%;
color: #fff;
font-size: 12px;
.info-msg {
display: flex;
justify-content: center;
align-content: center;
flex-wrap: wrap;
}
icon {
font-size: 18px;
}
image {
width: 22px;
height: 22px;
margin-top: 3px;
}
text {
width: 100%;
display: inline-block;
text-align: center;
}
}
</style>