diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue index d2db4e5..dad1dbd 100644 --- a/pages/detail/productsDetail/productsDetail.vue +++ b/pages/detail/productsDetail/productsDetail.vue @@ -74,12 +74,8 @@ - - - {{mobile}} - 是否拨打客服电话 - + + @@ -120,24 +116,24 @@ showUpdate: false, showUpdating: false, showCall: false, - mobile: '', kf_email: '', updateContent: '您暂无权限访问,请升级VIP访问', updatingContent: '升级VIP,正在审核中', - timoutText: 1 + timoutText: 1, + contentCopy: `邮箱已复制,如需联系客服,请发送邮件。` } }, onLoad(option) { this.imgUrl = uni.getStorageSync('img_url') this.id = option.id this.getProductDetail() - this.getCsTel() + this.getKfEmail() }, methods: { //获取客服电话 - getCsTel() { - this.$apiServe.getCsTel().then(res => { - this.mobile = res.data.data.cs_tel + getKfEmail() { + this.$apiServe.getKfEmail().then(res => { + this.kf_email = res.data.data.kf_email }).finally(_ => {}) }, //获取详情信息 @@ -261,30 +257,28 @@ }, // 联系客服模态框 showContact() { - this.showCall = true - }, - confirmCall() { - this.showCall = false - let phone = this.mobile - phone = phone.toString() - uni.makePhoneCall({ - phoneNumber: phone, - success: function() { - console.log('拨打电话成功'); - }, - fail() { - console.log('打电话失败了'); + uni.setClipboardData({ + data: this.kf_email, //要被复制的内容 + success: () => { //复制成功的回调函数 + wx.hideLoading(); + wx.hideToast(); + this.showCall = true } }) }, - cancelCall() { + confirmCopy() { this.showCall = false } - } + }, }