Commit d7b0256e by 谢中龙

修改客服聊天

parent 1555f235
......@@ -43,11 +43,15 @@ App({
// console.log(err);
}
// this.loginSilently();
this.loginSilently();
},
loginSilently() {
var _this = this;
if(wx.getStorageSync('_baseUserInfo')){
return ;
}
wx.login({
success: (res) => {
wx.setStorageSync('_loginCode', res.code);
......
......@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播
......@@ -25,7 +25,7 @@ const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 1001
const BRANCH_ID = 1002
const isMall = true
// const needMock = '' //
......
......@@ -169,17 +169,39 @@ wxService.page({
this.data.productId = this.options.id;
}
this.setData({
udesk: {
nick_name: app.globalData.userInfo ? app.globalData.userInfo.memberId : '',
avatar: app.globalData.userInfo ? app.globalData.userInfo.avatarUrl : ''
}
})
this.getProInfo()
this.getOpenStatus()
this.data.currentShareContent = null
this.data.currentShareContent = null;
this.setUDeskInfo();
},
//设置uDeskinfo
setUDeskInfo(){
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
if(baseUserInfo){
let cellphones = [];
this.data.udesk.nick_name = baseUserInfo.member.name;
this.data.udesk.avatar = app.globalData.userInfo.avatarUrl;
let customer_info = {
cellphones : [],
};
customer_info.cellphones = [["",baseUserInfo.member.mobile]];
this.data.udesk.customer_info = JSON.stringify(customer_info);
this.setData({
udesk : this.data.udesk
});
}
else{
this.setData({
udesk: {
nick_name: app.globalData.userInfo ? app.globalData.userInfo.memberId : '',
avatar: app.globalData.userInfo ? app.globalData.userInfo.avatarUrl : '',
cellphones : [],
}
})
}
},
//获取商品详情
......
......@@ -130,8 +130,11 @@
report-submit
name='home'
>
<button class="get-formId--btn footer-icon" open-type="contact" session-from="udesk|{{udesk.nick_name}}|{{udesk.avatar}}"
send-message-title="{{productInfo.productName}}" show-message-card="true" send-message-img="{{productInfo.indexUrl}}">
<button class="get-formId--btn footer-icon" open-type="contact"
session-from="udesk|{{udesk.nick_name}}|{{udesk.avatar}}|customer^{{udesk.customer_info}}"
send-message-title="{{productInfo.productName}}"
show-message-card="true"
send-message-img="{{productInfo.indexUrl}}">
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-kefu.png" mode="widthFix"></image>
<view class="tab-text">客服</view>
</button>
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxc3b64b09b1d3dfc2",
"appid": "wxac09792264c49b5c",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......@@ -266,10 +266,10 @@
"scene": null
},
{
"id": 34,
"id": 33,
"name": "支付状态",
"pathName": "subPackage/page/pages/paymentStatus/paymentStatus",
"query": "status=F&amount=333",
"query": "status=S&amount=333",
"scene": null
},
{
......@@ -664,6 +664,7 @@
"id": -1,
"name": "领券中心",
"pathName": "subPackage/page/pages/couponCenter/couponCenter",
"query": "",
"scene": null
}
]
......
......@@ -46,7 +46,7 @@ wxService.page({
}, () => {
// 当前用户是否关注公众号
this.getMemberSubscribe()
this.loginUpdateStroage() // 登录更新plus缓存
// this.loginUpdateStroage() // 登录更新plus缓存
})
// 动态设置title
......@@ -86,13 +86,15 @@ wxService.page({
getMemberSubscribe() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const { openid } = baseUserInfo.member
wxService.post(`/member/subscribe?openid=${openid}`).then(res => {
const { result, data } = res.data
if (result == 0) {
// 0 未关注 1 已关注
this.setData({
isSubscribe: data == 0 ? false : true
})
wxService.get(`/member/subscribe?openid=${openid}`).then(res => {
if(res){
const { result, data } = res.data
if (result == 0) {
// 0 未关注 1 已关注
this.setData({
isSubscribe: data == 0 ? false : true
})
}
}
})
},
......
......@@ -595,6 +595,7 @@ class WXService extends Http {
page(config) {
const _self = this
// 当前是否有用户信息
config.data.currentHasUserInfo = false;
//当前用户是否有手机号
......@@ -624,6 +625,8 @@ class WXService extends Http {
//默认
config.data.loading = true;
config.data.udesk = {};
const CONFIG_PAPGE = {
onLoad: function (...args) {
const page = this
......@@ -688,6 +691,7 @@ class WXService extends Http {
//调用接口
_self.getTentacleContentByTentacleId(id);
}
config.onLoad && config.onLoad.apply(page, args);
},
/**
......
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