Commit 2f4b31f0 authored by mengcuiguang's avatar mengcuiguang

添加在线客服

parent 03d58f77
......@@ -96,12 +96,15 @@
<!-- </scroll-view> -->
<coin-popup :show="showAnimate" @close="showAnimate = false" @paySuccess="paySuccess">
</coin-popup>
<kefu-popup :show="showKefuPop" @close="showKefuPop = false" />
</view>
</template>
<script>
import common from '@/mixins/common';
import kefuPopup from '@/components/kefu-popup/kefu-popup.vue';
import {
getToLocal
......@@ -121,12 +124,16 @@
export default {
name: 'index',
mixins: [common],
mixins: [common],
components: {
kefuPopup
},
data() {
return {
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
showAnimate: false,
showAnimate: false,
showKefuPop: false,
windowHeight: 0,
os: 'android',
versionName: app.globalData.versionName,
......@@ -173,53 +180,9 @@
navigateTo(`/pagesA/vipPay/vipPay`)
},
handlePhone() {
// if (this.corpid != '' && this.curl != '') {
// wx.openCustomerServiceChat({
// extInfo: {
// url: this.curl
// },
// corpId: this.corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
// } else {
// let that = this
// // 联系我们
// this.post({
// url: '/vedio/customerServiceNumbers',
// showLoading: false,
// success: ({
// data
// }) => {
// let datas = data.customerServiceNumbers.split(',')
// that.corpid = datas[0]
// that.curl = datas[1]
// wx.openCustomerServiceChat({
// extInfo: {
// url: that.curl
// },
// corpId: that.corpid,
// success(res) {},
// fail(e) {
// console.log(e)
// }
// })
// }
// });
// }
wx.makePhoneCall({
phoneNumber: '4000969950',
success: function(res) {
console.log('拨打电话成功!');
},
fail: function(res) {
console.log('拨打电话失败!');
}
})
this.showKefuPop = true
},
paySuccess(largeType) {
// largeType=vip 开通vip
......
<template>
<view>
<uni-popup type="bottom" ref="kefuPop" :maskClick="false" :isMaskClick="false">
<view class="container">
<image @click="onClose" style="width: 50rpx; height: 50rpx;margin-left:auto;margin-right: 30rpx;
margin-bottom: 30rpx;" src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_close_white.png"></image>
<view class="content">
<text class="button1" @click="handleBtn1">客服电话</text>
<button class="button2" open-type="im" data-im-id="dy1d1fub8mqd">客服在线</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
EXPRESS_ID
} from "@/utils/adConstant.js"
export default {
name: 'kefuPopup',
props: {
show: {
type: Boolean,
default: false,
}
},
data() {
return {
imId: "dy1d1fub8mqd"
};
},
methods: {
handleShow() {
this.$refs.kefuPop.open('bottom');
},
onClose() {
this.$refs.kefuPop.close('bottom');
this.$emit('close');
},
handleBtn1() {
wx.makePhoneCall({
phoneNumber: '4000969950',
success: function(res) {
console.log('拨打电话成功!');
},
fail: function(res) {
console.log('拨打电话失败!');
}
})
this.onClose()
},
imCallback(e) {
console.log("跳转IM客服成功", e.detail);
this.onClose()
},
onimError(e) {
console.log("拉起IM客服失败", e.detail);
this.onClose()
}
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
} else {
this.$refs.kefuPop.close('bottom');
}
},
immediate: true
}
}
};
</script>
<style lang="scss">
.container {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
}
.content {
border-radius: 20rpx;
background-color: white;
display: flex;
width: 100%;
padding: 30rpx 0;
flex-direction: column;
align-items: center;
.title {
color: black;
font-size: 40rpx;
font-weight: bold;
margin-bottom: 30rpx;
}
.button1 {
width: 600rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin: 20rpx 20rpx;
border-radius: 10rpx;
background-color: orange;
color: white;
font-size: 36rpx;
box-shadow: 0 0 2px 0px rgba(255, 255, 255, 0.1);
}
.button2 {
width: 600rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin: 20rpx 20rpx;
border-radius: 10rpx;
background-color: white;
border: 1px orange solid;
color: orange;
font-size: 36rpx;
box-shadow: 0 0 2px 0px rgba(255, 255, 255, 0.1);
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment