Commit 755e834f1a7cfc47192d5595a612fd4a873cf965
1 parent
337f6685
支付的带参数
Showing
4 changed files
with
52 additions
and
15 deletions
app.js
... | ... | @@ -51,7 +51,7 @@ App({ |
51 | 51 | config: null, //门店参数 |
52 | 52 | config2: null, //门店配置 |
53 | 53 | code: null, |
54 | - user_id: null,//5682094,6520044,6520119 qa 4687 6519901 zs 10153869 | |
54 | + user_id:null,//5682094,6520044,6520119 qa 4687 6519901 zs 10153869 | |
55 | 55 | buy_now: null, |
56 | 56 | picklist: null, //门店列表 |
57 | 57 | wuliuprice: null, //物流价格表 |
... | ... | @@ -73,15 +73,17 @@ App({ |
73 | 73 | }, |
74 | 74 | auth: o, |
75 | 75 | request: a, |
76 | - onLaunch: function () { | |
76 | + onLaunch: function (option) { | |
77 | 77 | //初始化美图测肤插件 |
78 | 78 | // var plugin = requirePlugin('mtSkinSdk'); |
79 | 79 | // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取 |
80 | 80 | // plugin.setConfig(pluginGD) |
81 | - | |
81 | + if(option) this.globalData.scene=option.scene; | |
82 | 82 | wx.hideTabBar(); |
83 | 83 | this.initExt(); |
84 | 84 | |
85 | + | |
86 | + | |
85 | 87 | //检查更新 |
86 | 88 | this.checkUpdateVersion(); |
87 | 89 | |
... | ... | @@ -690,6 +692,7 @@ App({ |
690 | 692 | th.globalData.dis_buy_obj = null; //等级卡的购买记录 |
691 | 693 | th.globalData.storeFooter = null; //底部的导航 |
692 | 694 | th.globalData.full_screen = null; //全屏 |
695 | + th.globalData.scene=null | |
693 | 696 | } else { |
694 | 697 | th.globalData.no_clear = 0; |
695 | 698 | } |
... | ... | @@ -851,21 +854,23 @@ App({ |
851 | 854 | }); |
852 | 855 | }, |
853 | 856 | |
854 | - con_wx(th) { | |
855 | - var url = th.data.sys_switch.weapp_customertype_url; | |
856 | - var id = th.data.sys_switch.weapp_customertype_appid; | |
857 | - this.globalData.no_clear = 1; | |
857 | + | |
858 | + | |
859 | + //联系客服的3个函数 | |
860 | + con_wx(th){ | |
861 | + var url=th.data.sys_switch.weapp_customertype_url; | |
862 | + var id=th.data.sys_switch.weapp_customertype_appid; | |
863 | + this.globalData.no_clear=1; | |
858 | 864 | wx.openCustomerServiceChat({ |
859 | 865 | extInfo: { url: url }, |
860 | 866 | corpId: id, |
861 | 867 | success(res) { } |
862 | 868 | }) |
863 | 869 | }, |
864 | - | |
865 | - con_Service() { | |
866 | - var th = this; | |
867 | - var oss = this.globalData.setting; | |
868 | - this.getConfig(function (t) { | |
870 | + con_Service(){ | |
871 | + var th=this; | |
872 | + var oss= this.globalData.setting; | |
873 | + this.getConfig(function(t) { | |
869 | 874 | if (t.store_tel == undefined) { |
870 | 875 | th.request.get("/api/weshop/store/get/" + oss.stoid, { |
871 | 876 | isShowLoading: 1, |
... | ... | @@ -935,8 +940,28 @@ App({ |
935 | 940 | check_can_share() { |
936 | 941 | if (!this.globalData.user_id) wx.hideShareMenu(); |
937 | 942 | else wx.showShareMenu(); |
938 | - } | |
943 | + }, | |
939 | 944 | |
945 | + //--- 判断是不是皮肤的商品的公共函数 --- | |
946 | + check_skin_face(options,type,goods_id){ | |
947 | + if(options.skinface_id){ | |
948 | + this.globalData.skinface_id=options.skinface_id; | |
949 | + var stoid=this.globalData.setting.stoid; | |
950 | + var user_id=this.globalData.user_id; | |
951 | + if(!user_id) return false; | |
952 | + //点击量的 | |
953 | + this.request.promisePost("/api/weshop/face/skinGoodsBrowse/save",{ | |
954 | + data:{ | |
955 | + store_id:stoid, | |
956 | + goods_id:goods_id, | |
957 | + user_id:user_id, | |
958 | + addtime:ut.gettimestamp(), | |
959 | + skinface_id:options.skinface_id, | |
960 | + goods_type:type | |
961 | + } | |
962 | + }).then(res=>{}) | |
963 | + } | |
964 | + } | |
940 | 965 | |
941 | 966 | |
942 | 967 | ... | ... |
utils/pay.js
utils/pay2.js
utils/request.js
... | ... | @@ -244,13 +244,19 @@ module.exports = { |
244 | 244 | promisePut:function(url,data){ |
245 | 245 | var th=this; |
246 | 246 | if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; |
247 | + var post_data=data.data; | |
248 | + var header={"content-type": "application/x-www-form-urlencoded" }; | |
249 | + if(data.is_json){ | |
250 | + header={ 'content-type': 'application/json'}; | |
251 | + post_data=JSON.stringify(post_data); | |
252 | + }; | |
247 | 253 | return new Promise((resolve, reject) => { |
248 | 254 | data.isShowLoading && th.showLoading(); |
249 | 255 | wx.request({ |
250 | 256 | url, |
251 | 257 | method: 'PUT', |
252 | - header: {"content-type": "application/x-www-form-urlencoded" }, | |
253 | - data:data.data, | |
258 | + header: header, | |
259 | + data:post_data, | |
254 | 260 | success(res) { |
255 | 261 | data.isShowLoading && th.hideLoading(); |
256 | 262 | resolve(res); | ... | ... |