diff --git a/app.js b/app.js index 3964fe1..903a38d 100644 --- a/app.js +++ b/app.js @@ -671,6 +671,10 @@ App({ //清空登录时候缓存的值 onHide: function () { + + console.log("app onhide"); + console.log(this.globalData.no_clear); + if(!this.globalData.no_clear) { this.globalData.is_test = 0; this.globalData.guide_id = null; //导购清空 @@ -844,6 +848,46 @@ App({ current: b[t.currentTarget.dataset.id], urls: b }); + }, + + con_wx(th){ + var url=th.data.sys_switch.weapp_customertype_url; + var id=th.data.sys_switch.weapp_customertype_appid; + this.globalData.no_clear=1; + wx.openCustomerServiceChat({ + extInfo: {url: url}, + corpId: id, + success(res) {} + }) + }, + + con_Service(){ + var th=this; + var oss= this.globalData.setting; + this.getConfig(function(t) { + if (t.store_tel == undefined) { + th.request.get("/api/weshop/store/get/" + oss.stoid, { + isShowLoading: 1, + data: {}, + success: function(rs) { + th.globalData.config = rs.data.data; + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { + wx.showToast({ + title: "商家未设置电话", + icon: 'none', + duration: 3000 + }) + return false; + } + th.globalData.no_clear=1; + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) + } + }) + } else { + th.globalData.no_clear=1; + wx.makePhoneCall({ phoneNumber: t.store_tel, }) + } + }); }