Commit 2d2e3e4ab6eabe014cd8141e10246ae4ad703864
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
8 changed files
with
78 additions
and
25 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 | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
... | ... | @@ -140,6 +140,8 @@ Page({ |
140 | 140 | var th = this; |
141 | 141 | var index = e.currentTarget.dataset.index; //活动id |
142 | 142 | var sele_g=th.data.wareCard[index]; |
143 | + this.data.payMoney=sele_g.payMoney; | |
144 | + | |
143 | 145 | th.setData({sele_g:sele_g,buyType:2,}) |
144 | 146 | if(sele_g.is_pickup){ |
145 | 147 | if(sele_g.pickup_list && th.data.def_pick_store){ | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
... | ... | @@ -138,6 +138,7 @@ Page({ |
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | |
141 | + this.data.payMoney=th.data.sele_g.payMoney; | |
141 | 142 | th.setData({ buyType:2 }) |
142 | 143 | if(th.data.sele_g.is_pickup){ |
143 | 144 | th.setData({ |
... | ... | @@ -260,6 +261,19 @@ Page({ |
260 | 261 | break; |
261 | 262 | } |
262 | 263 | } |
264 | + | |
265 | + if(res.data.data.pickup_id){ | |
266 | + getApp().request.get("/api/weshop/pickup/get/"+os.stoid+"/"+res.data.data.pickup_id,{ | |
267 | + success: function (res) { | |
268 | + if(res.data.code==0){ | |
269 | + th.setData({pick_up:res.data.data}); | |
270 | + } | |
271 | + } | |
272 | + }); | |
273 | + | |
274 | + } | |
275 | + | |
276 | + | |
263 | 277 | } else { |
264 | 278 | getApp().my_warnning(res.data.msg, 0, th); |
265 | 279 | return false; | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
... | ... | @@ -3,6 +3,11 @@ |
3 | 3 | <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> |
4 | 4 | </view> |
5 | 5 | <view class="box_title data-v-3a5b7e36" > |
6 | + | |
7 | + <view class="flex ai_c fs28" style="margin-bottom: 20rpx" wx:if="{{isBuy==0 && pick_up}}"> | |
8 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>{{pick_up.pickup_name}} | |
9 | + </view> | |
10 | + | |
6 | 11 | <view class="top_title data-v-3a5b7e36"> |
7 | 12 | <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> |
8 | 13 | </view> |
... | ... | @@ -95,19 +100,14 @@ |
95 | 100 | </text> |
96 | 101 | </block> |
97 | 102 | </view> |
103 | + | |
98 | 104 | <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}"> |
99 | 105 | <!-- <block wx:if="{{c_state==0}}"> --> |
106 | + | |
100 | 107 | <block wx:if="{{isBuy==0&item.lbType==1}}"> |
101 | 108 | <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image> |
102 | 109 | </block> |
103 | - <!-- </block> --> | |
104 | - <!-- | |
105 | - <block wx:else> | |
106 | - <block wx:if="{{isBuy==0&item.lbType==1}}"> | |
107 | - <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | |
108 | - </block> | |
109 | - </block>--> | |
110 | - | |
110 | + | |
111 | 111 | <block wx:if="{{isBuy==0&item.lbType==2}}"> |
112 | 112 | <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image> |
113 | 113 | </block> | ... | ... |
pages/giftpack/public/buy_com.js
... | ... | @@ -484,6 +484,7 @@ module.exports = { |
484 | 484 | }, |
485 | 485 | |
486 | 486 | check_def_pk:function (th) { |
487 | + th.data.def_pick_store.is_no_dis=0; | |
487 | 488 | var def_pick_store=th.data.def_pick_store |
488 | 489 | var sele_g=th.data.sele_g; |
489 | 490 | var arr=sele_g.pickup_list.split(','); |
... | ... | @@ -494,9 +495,8 @@ module.exports = { |
494 | 495 | |
495 | 496 | if(idx==-1){ |
496 | 497 | def_pick_store.is_no_dis=1; |
497 | - th.setData({def_pick_store}) | |
498 | 498 | } |
499 | - | |
499 | + th.setData({def_pick_store}) | |
500 | 500 | |
501 | 501 | } |
502 | 502 | ... | ... |
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); | ... | ... |