小程序im客服对接

master
mabo 2021-05-26 18:03:15 +08:00
parent f56acf5a76
commit b5722c27b6
4 changed files with 96 additions and 3 deletions

View File

@ -364,6 +364,17 @@
//app
"scrollIndicator": "none"
}
},
{ //
"path": "customerservice/index",
"style": {
"navigationBarTitleText": "客服",
"usingComponents": {
// #ifdef MP-WEIXIN
"chat": "plugin://myPlugin/chat"
// #endif
}
}
}
]

View File

@ -0,0 +1,78 @@
<template>
<view>
<chat></chat>
</view>
</template>
<script>
var chat = requirePlugin('myPlugin')
export default {
data() {
return {
}
},
methods: {
},
onLoad () {
chat.init({
sign: '4a971f4f4ff9637cd9286a0197b0573bf2f65de052c21791f90d4235fca41456e1cc145075567f5f47b8e13c895f3fc8cacec5789f9afee8df670f7cbe5c0f82', //
token: '', //
uid: '', //
title: 'lilishop自营店', //
isRMB: '', //,false
data: { //c1,c2,c3,c4,c5d1,d2,d3,d4,d5,d6
c1: '1',
c2: '2',
c3: '3',
c4: '4',
c5: '5',
d1: '这是描述', //
d2: '122.00', //
d3: '150.00', //
d4: '', //
d5: '', //
d6: '', //id
data: ''//,
},
viewUrl(res){ //web-view
if (res) {
wx.navigateTo({
url: '/pages/webview/index?href=' + res
})
}
},
setTitle(res){ //
if (res) {
wx.setNavigationBarTitle({
title: res
})
}
},
setBarColor(res) { //
if (res) {
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: res
})
}
},
success(res){ //
if (res.data == 'success') {
console.log('success');
}
},
fail(res){ //
if (res.data == 'initError') {
console.log(res.message);
}
},
leave(res){ //
if (res) {
console.log(res);
}
}
})
}
}
</script>

View File

@ -162,10 +162,10 @@
<u-icon size="34" class="red" name="home-fill"></u-icon>
<view class="red icon-btn-name">店铺</view>
</view>
<!-- <view class="icon-btn-item" @click="linkMsgDetail()">
<view class="icon-btn-item" @click="linkMsgDetail()">
<u-icon size="34" name="kefu-ermai"></u-icon>
<view class="icon-btn-name">客服</view>
</view> -->
</view>
<view class="icon-btn-item" @click="reluchToCart()">
<u-icon size="34" name="storeping-cart"></u-icon>
<view class="icon-btn-name">购物车</view>
@ -486,7 +486,11 @@ export default {
this.getGoodsCollectionFun(this.goodsDetail.id);
}
},
linkMsgDetail () {
uni.navigateTo({
url: '/pages/product/customerservice/index'
})
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {