Commit 3f63d801531c423235505e422ddf73e701938a2d
1 parent
f5c4b92a
app 打电话,和微信聊天组件
Showing
1 changed file
with
44 additions
and
0 deletions
app.js
| @@ -671,6 +671,10 @@ App({ | @@ -671,6 +671,10 @@ App({ | ||
| 671 | 671 | ||
| 672 | //清空登录时候缓存的值 | 672 | //清空登录时候缓存的值 |
| 673 | onHide: function () { | 673 | onHide: function () { |
| 674 | + | ||
| 675 | + console.log("app onhide"); | ||
| 676 | + console.log(this.globalData.no_clear); | ||
| 677 | + | ||
| 674 | if(!this.globalData.no_clear) { | 678 | if(!this.globalData.no_clear) { |
| 675 | this.globalData.is_test = 0; | 679 | this.globalData.is_test = 0; |
| 676 | this.globalData.guide_id = null; //导购清空 | 680 | this.globalData.guide_id = null; //导购清空 |
| @@ -844,6 +848,46 @@ App({ | @@ -844,6 +848,46 @@ App({ | ||
| 844 | current: b[t.currentTarget.dataset.id], | 848 | current: b[t.currentTarget.dataset.id], |
| 845 | urls: b | 849 | urls: b |
| 846 | }); | 850 | }); |
| 851 | + }, | ||
| 852 | + | ||
| 853 | + con_wx(th){ | ||
| 854 | + var url=th.data.sys_switch.weapp_customertype_url; | ||
| 855 | + var id=th.data.sys_switch.weapp_customertype_appid; | ||
| 856 | + this.globalData.no_clear=1; | ||
| 857 | + wx.openCustomerServiceChat({ | ||
| 858 | + extInfo: {url: url}, | ||
| 859 | + corpId: id, | ||
| 860 | + success(res) {} | ||
| 861 | + }) | ||
| 862 | + }, | ||
| 863 | + | ||
| 864 | + con_Service(){ | ||
| 865 | + var th=this; | ||
| 866 | + var oss= this.globalData.setting; | ||
| 867 | + this.getConfig(function(t) { | ||
| 868 | + if (t.store_tel == undefined) { | ||
| 869 | + th.request.get("/api/weshop/store/get/" + oss.stoid, { | ||
| 870 | + isShowLoading: 1, | ||
| 871 | + data: {}, | ||
| 872 | + success: function(rs) { | ||
| 873 | + th.globalData.config = rs.data.data; | ||
| 874 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | ||
| 875 | + wx.showToast({ | ||
| 876 | + title: "商家未设置电话", | ||
| 877 | + icon: 'none', | ||
| 878 | + duration: 3000 | ||
| 879 | + }) | ||
| 880 | + return false; | ||
| 881 | + } | ||
| 882 | + th.globalData.no_clear=1; | ||
| 883 | + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) | ||
| 884 | + } | ||
| 885 | + }) | ||
| 886 | + } else { | ||
| 887 | + th.globalData.no_clear=1; | ||
| 888 | + wx.makePhoneCall({ phoneNumber: t.store_tel, }) | ||
| 889 | + } | ||
| 890 | + }); | ||
| 847 | } | 891 | } |
| 848 | 892 | ||
| 849 | 893 |