Commit d7b0256e by 谢中龙

修改客服聊天

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