Commit 3404e6ce25c6197c0b185e8ad4efc5b2ec8db8a2
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
15 changed files
with
135 additions
and
293 deletions
app.js
... | ... | @@ -72,7 +72,7 @@ App({ |
72 | 72 | |
73 | 73 | room_id:null, //直播间分享的房间ID |
74 | 74 | room_goods_id:null, //直播间分享的商品ID |
75 | - | |
75 | + | |
76 | 76 | }, |
77 | 77 | auth: o, |
78 | 78 | request: a, |
... | ... | @@ -106,7 +106,12 @@ App({ |
106 | 106 | app.globalData.user_id= user.user_id; |
107 | 107 | } |
108 | 108 | wx.setStorageSync("userinfo",user); |
109 | - } | |
109 | + }else{ | |
110 | + user=null; | |
111 | + app.globalData.userInfo=null; | |
112 | + app.globalData.user_id= 0; | |
113 | + wx.setStorageSync("userinfo",null); | |
114 | + } | |
110 | 115 | }) |
111 | 116 | } |
112 | 117 | } |
... | ... | @@ -246,6 +251,7 @@ App({ |
246 | 251 | |
247 | 252 | //----------------获取商家开启的物流-------------------- |
248 | 253 | getwuliu: function (t, o){ |
254 | + this.globalData.wuliu=null; | |
249 | 255 | var th = this, st = this.globalData.setting; |
250 | 256 | this.globalData.wuliu && !o ? |
251 | 257 | "function" == typeof t && t(this.globalData.wuliu) : a.get("/api/weshop/storeshipping/list", { |
... | ... | @@ -612,9 +618,7 @@ App({ |
612 | 618 | this.globalData.config2=null; //清除config2的缓存 |
613 | 619 | this.globalData.config=null; //清除config的缓存 |
614 | 620 | this.globalData.gr_index=0; //商品分组的序列 |
615 | - for(var i = 1; i < 50; i++) { | |
616 | - clearInterval(i); | |
617 | - } | |
621 | + | |
618 | 622 | }, |
619 | 623 | |
620 | 624 | clear_word:function (word) { |
... | ... | @@ -716,7 +720,7 @@ App({ |
716 | 720 | }); |
717 | 721 | }, |
718 | 722 | |
719 | - | |
723 | + | |
720 | 724 | |
721 | 725 | |
722 | 726 | }); | ... | ... |
components/full_screen/filter.wxs deleted
components/full_screen/full_screen.js deleted
1 | -// components/userqy_pop_up/userqy_pop_up.js | |
2 | -var o = getApp().globalData.setting | |
3 | -Component({ | |
4 | - /** | |
5 | - * 页面的初始数据 | |
6 | - */ | |
7 | - data: { | |
8 | - control: 1, | |
9 | - is_full_screen_show:0, //全屏显示 | |
10 | - sec_show:3, //倒计时的秒数 | |
11 | - full_ad:null, //全屏广告 | |
12 | - url:o.imghost, | |
13 | - full_screen:0, | |
14 | - is_full_screen_men:1, | |
15 | - hidden:0, | |
16 | - }, | |
17 | - | |
18 | - pageLifetimes:{ | |
19 | - hide: function() { | |
20 | - // 页面被隐藏 | |
21 | - clearInterval(this.data.full_screen); | |
22 | - }, | |
23 | - }, | |
24 | - | |
25 | - ready: function () {}, | |
26 | - properties: {}, | |
27 | - methods: { | |
28 | - close_full_screen(){ | |
29 | - this.setData({is_full_screen_show:0,sec_show:0}); | |
30 | - }, | |
31 | - //-- 跳转到满屏广告的链接 -- | |
32 | - go_full_ad(){ | |
33 | - if(!this.data.full_ad) return false; | |
34 | - if(!this.data.full_ad.ad_weapplink) return false; | |
35 | - getApp().goto(this.data.full_ad.ad_weapplink); | |
36 | - }, | |
37 | - get_the_full_screen(){ | |
38 | - if(this.data.full_ad) { | |
39 | - return false; | |
40 | - } | |
41 | - var th=this; | |
42 | - //获取全屏的广告 | |
43 | - getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ | |
44 | - data: { enabled: 1 } | |
45 | - }).then(res=>{ | |
46 | - //判断是不是有全屏广告 | |
47 | - if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | |
48 | - th.setData({ | |
49 | - is_full_screen_show:1, | |
50 | - full_ad:res.data.data.pageData[0], | |
51 | - }) | |
52 | - //--定时关闭-- | |
53 | - th.data.full_screen=setInterval(function(){ | |
54 | - if(!th.data.sec_show) { | |
55 | - clearInterval(th.data.full_screen); | |
56 | - th.close_full_screen(); | |
57 | - return false; | |
58 | - } | |
59 | - th.data.sec_show--; | |
60 | - th.setData({sec_show:th.data.sec_show}); | |
61 | - },1000) | |
62 | - | |
63 | - } | |
64 | - }) | |
65 | - } | |
66 | - }, | |
67 | - | |
68 | -}) | |
69 | 0 | \ No newline at end of file |
components/full_screen/full_screen.json deleted
components/full_screen/full_screen.wxml deleted
components/full_screen/full_screen.wxss deleted
1 | -.full_screen{ | |
2 | - position: fixed;left: 0;top: 0; | |
3 | - z-index: 1000000000000; | |
4 | - background-color: rgba(0,0,0,0.4); | |
5 | - width: 100%; | |
6 | - height: 100%; | |
7 | - background-position: center; | |
8 | - background-size: 100% 100%; | |
9 | - background-repeat: no-repeat; | |
10 | -} | |
11 | -.skip_box{ | |
12 | - float: right; margin-top: 10rpx; margin-right: 10rpx; | |
13 | - background-color: gainsboro; width: 120rpx; | |
14 | - height: 48rpx; font-size: 28rpx; line-height: 48rpx; | |
15 | - text-align: center; border-radius: 20rpx; | |
16 | - } | |
17 | 0 | \ No newline at end of file |
packageA/pages/jfbuy/jfbuy.wxml
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> |
52 | 52 | </view> |
53 | 53 | <view class="pdt14 fs22 gray flex jc_sb"> |
54 | - <view>零售价:¥{{item.shop_price}}</view> | |
54 | + <view>零售价:¥{{item.market_price}}</view> | |
55 | 55 | <view>销量:{{item.sales_sum}}</view> |
56 | 56 | </view> |
57 | 57 | </view> | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -501,9 +501,9 @@ Page({ |
501 | 501 | |
502 | 502 | var narr = new Array(); narr.push(item); |
503 | 503 | |
504 | - //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号----------------- | |
504 | + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号,计算默认的物流,不管是不是自提都算一下----------------- | |
505 | 505 | var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; |
506 | - if(e_t==0 && def_exp_code){ | |
506 | + if(def_exp_code){ | |
507 | 507 | for(var k=0;k<th.data.wu_arr.length;k++){ |
508 | 508 | var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; } |
509 | 509 | } | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -146,7 +146,8 @@ |
146 | 146 | <icon color="#f23030" size="16" type="info"></icon> |
147 | 147 | {{order.store_prom}} |
148 | 148 | </view> |
149 | - | |
149 | + | |
150 | + <!-- 当是物流很多单的时候 --> | |
150 | 151 | <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}"> |
151 | 152 | <view class="flex-vertical" > |
152 | 153 | <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' |
... | ... | @@ -177,10 +178,10 @@ |
177 | 178 | class="yu_er">快递邮寄</view> |
178 | 179 | </view> |
179 | 180 | </view> |
180 | - <!-- 当是物流很多单的时候 --> | |
181 | + | |
181 | 182 | |
182 | 183 | <!-- 点击显示物流选择,如果是默认使用的情况不成立 --> |
183 | - <view wx:if="{{!is_default_logistics}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;"> | |
184 | + <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;"> | |
184 | 185 | <view>{{wu_arr[item.wind].name}}</view> |
185 | 186 | <view class="xc-right"></view> |
186 | 187 | </view> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -399,7 +399,7 @@ Page({ |
399 | 399 | //--- 判断是等级会员,且在有效期范围内 --- |
400 | 400 | if(user.card_field && now<end){ |
401 | 401 | var card_name=ob.name_map.get(user.card_field); |
402 | - if(card_name.length>6) card_name=card_name.substring(0,6); | |
402 | + //if(card_name.length>6) card_name=card_name.substring(0,6); | |
403 | 403 | |
404 | 404 | var is_near_date=0; |
405 | 405 | if(end-now<60*60*30*24) is_near_date=1; //如果小于30天 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -199,53 +199,17 @@ |
199 | 199 | </view> |
200 | 200 | </view> |
201 | 201 | |
202 | - <!-- <view class="pt_fir se1"> | |
203 | - <view class="pt_hb"> | |
204 | - 拼团玩法 | |
205 | - <view class="ptgz_an xq flex" bindtap="show_pt_xx">查看详细 | |
206 | - <view class="bg_right arrow-two"></view> | |
207 | - </view> | |
208 | - </view> | |
209 | - <view class="flex-level" style='height:198rpx; width:100%;'> | |
210 | - <view class="flex-vertical-between rel" style='width:94%;margin-left:10rpx;'> | |
211 | - | |
212 | - <view class="xc-item t-c"> | |
213 | - <view class="circle yuan t-c circle-color">1</view> | |
214 | - <view class="word">选择商品完成下单</view> | |
215 | - </view> | |
216 | - <view class="abs link {{color_type==0?'link-color-red':'link-color'}}"></view> | |
217 | - | |
218 | - <view class="xc-item t-c"> | |
219 | - <view class="circle yuan t-c circle-color">2</view> | |
220 | - <view class="word">支付开团或参团</view> | |
221 | - </view> | |
222 | - <view class="abs link1 {{color_type_one==0?'link-color-red':'link-color'}}"></view> | |
223 | - | |
224 | - <view class="xc-item t-c"> | |
225 | - <view class="circle yuan t-c circle-color">3</view> | |
226 | - <view class="word">邀请好友参团支付</view> | |
227 | - </view> | |
228 | - <view class="abs link2 {{color_type_two==0?'link-color-red':'link-color'}}"></view> | |
229 | 202 | |
230 | - | |
231 | - <view class="xc-item t-c"> | |
232 | - <view class="circle yuan t-c circle-color1">4</view> | |
233 | - <view class="word">人满发货失败退款</view> | |
234 | - </view> | |
235 | - </view> | |
236 | - </view> | |
237 | - </view> --> | |
238 | 203 | </view> |
239 | 204 | |
240 | 205 | <!-- 积分购 --> |
241 | 206 | <view wx:if="{{prom_type==4}}"> |
242 | 207 | <view class="goods-price"> |
243 | 208 | <!-- 价格显示 --> |
244 | - <view class="co-red flex ai_c jc_sb"> | |
245 | - <view class="market-price" style="overflow: hidden; height: 66rpx;display: flex;"> | |
209 | + <view class="co-red flex jc_sb ai-center"> | |
210 | + <view class="market-price" style="overflow: hidden; height: 66rpx;display: flex; align-items: flex-end;"> | |
246 | 211 | <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image> |
247 | - <block wx:if="{{prom_integral}}">{{prom_integral}} | |
248 | - <text class="rel_txt">积分</text></block> | |
212 | + <block wx:if="{{prom_integral}}"><text style="position: relative;top:10rpx">{{prom_integral}}</text><text class="rel_txt">积分</text></block> | |
249 | 213 | <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text> |
250 | 214 | <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text> |
251 | 215 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> |
... | ... | @@ -253,13 +217,6 @@ |
253 | 217 | </view> |
254 | 218 | |
255 | 219 | <!-- 这个是分享按钮 --> |
256 | - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum"> --> | |
257 | - <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="clickShare"> | |
258 | - <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> | |
259 | - <view class="share-font">分享</view> | |
260 | - </view> --> | |
261 | - | |
262 | - <!-- 这个是分享按钮 --> | |
263 | 220 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
264 | 221 | <view class="xc-share-frame t-c" bindtap="clickShare"> |
265 | 222 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
... | ... | @@ -2789,9 +2789,10 @@ button.custom-service::after{ |
2789 | 2789 | } */ |
2790 | 2790 | |
2791 | 2791 | .goods-price .rel_txt{ |
2792 | - position: relative; top: 32rpx; font-size: 30rpx; | |
2792 | + /* position: relative; top: 32rpx; */ | |
2793 | + font-size: 30rpx; | |
2793 | 2794 | } |
2794 | -.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 12rpx;} | |
2795 | +.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 8rpx;} | |
2795 | 2796 | |
2796 | 2797 | .btn-close { |
2797 | 2798 | /* background-color: rgba(0,0,0,.5); */ | ... | ... |
pages/index/index/index.json
... | ... | @@ -18,7 +18,6 @@ |
18 | 18 | "mvideo": "/components/diy_video/diy_video", |
19 | 19 | "service": "/components/diy_service/diy_service", |
20 | 20 | "scan": "/components/diy_scan/diy_scan", |
21 | - "full_screen": "/components/full_screen/full_screen", | |
22 | 21 | "store_select": "/components/diy_store_select/diy_store_select" |
23 | 22 | }, |
24 | 23 | "enablePullDownRefresh": false | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -370,10 +370,9 @@ Page({ |
370 | 370 | |
371 | 371 | var buyed_mum2=goodsbuynum+good.goods_num; |
372 | 372 | if (buyed_mum2 > limit && limit > 0) { |
373 | - wx.showModal({ | |
374 | - title: '提示', | |
375 | - content: gg.goods_name+'购买数量超出商品限购' | |
376 | - }); | |
373 | + | |
374 | + var content=gg.goods_name+'购买数量超出商品限购,请取消订单'; | |
375 | + th.toast(content); | |
377 | 376 | return false; |
378 | 377 | } |
379 | 378 | |
... | ... | @@ -384,24 +383,21 @@ Page({ |
384 | 383 | if(res.data.code==0){ |
385 | 384 | var r_data=res.data.data; |
386 | 385 | if(!r_data.collocationPromList && good.prom_type==5){ |
387 | - wx.showModal({ | |
388 | - title: '提示', | |
389 | - content: good.goods_name+'未找到活动' | |
390 | - }); | |
386 | + | |
387 | + var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
388 | + th.toast(content); | |
391 | 389 | p_ok=0; |
392 | 390 | } |
393 | 391 | if(!r_data.promGoodsLists && good.prom_type==3){ |
394 | - wx.showModal({ | |
395 | - title: '提示', | |
396 | - content: good.goods_name+'未找到活动' | |
397 | - }); | |
392 | + | |
393 | + var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
394 | + th.toast(content); | |
398 | 395 | p_ok=0; |
399 | 396 | } |
400 | 397 | }else{ |
401 | - wx.showModal({ | |
402 | - title: '提示', | |
403 | - content: good.goods_name+'未找到活动' | |
404 | - }); | |
398 | + | |
399 | + var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
400 | + th.toast(content); | |
405 | 401 | p_ok=0; |
406 | 402 | } |
407 | 403 | }) |
... | ... | @@ -411,10 +407,9 @@ Page({ |
411 | 407 | //商品的普通购买 ,不要进行判断 |
412 | 408 | if((good.prom_type==1 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ |
413 | 409 | if(gg.prom_type!=good.prom_type) { |
414 | - wx.showModal({ | |
415 | - title: '提示', | |
416 | - content: gg.goods_name+'商品的活动发生了变化' | |
417 | - }); | |
410 | + | |
411 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
412 | + th.toast(content); | |
418 | 413 | return false; |
419 | 414 | } |
420 | 415 | }else{ |
... | ... | @@ -453,27 +448,25 @@ Page({ |
453 | 448 | if(prom){ |
454 | 449 | var t_now=ut.gettimestamp(); |
455 | 450 | if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){ |
456 | - wx.showModal({ | |
457 | - title: '提示', | |
458 | - content: gg.goods_name+'商品的活动发生了变化' | |
459 | - }); | |
451 | + | |
452 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
453 | + th.toast(content); | |
460 | 454 | return false; |
461 | 455 | } |
462 | 456 | } |
463 | 457 | } |
464 | 458 | else{ |
465 | 459 | //不是赠品的时候 |
466 | - if(!good.is_gift){ | |
460 | + if(!good.is_gift && good.prom_type!=3){ | |
467 | 461 | var t_ok=1; |
468 | 462 | await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { |
469 | 463 | if(res.data.code==0){ |
470 | 464 | var r_data=res.data.data; |
471 | 465 | //-- 参加了全局的优惠活动 -- |
472 | 466 | if(r_data.promGoodsLists){ |
473 | - wx.showModal({ | |
474 | - title: '提示', | |
475 | - content: gg.goods_name+'商品的活动发生了变化' | |
476 | - }); | |
467 | + | |
468 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
469 | + th.toast(content); | |
477 | 470 | t_ok=0; |
478 | 471 | } |
479 | 472 | } |
... | ... | @@ -499,10 +492,9 @@ Page({ |
499 | 492 | } |
500 | 493 | var is_h=0; |
501 | 494 | if (!isok) { |
502 | - wx.showModal({ | |
503 | - title: '提示', | |
504 | - content: gg.goods_name + '商品的价格发生了变化' | |
505 | - }); | |
495 | + | |
496 | + var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
497 | + th.toast(content); | |
506 | 498 | return false; |
507 | 499 | } |
508 | 500 | } |
... | ... | @@ -514,19 +506,17 @@ Page({ |
514 | 506 | ob=obj; |
515 | 507 | }) |
516 | 508 | if(ob.code==-1){ |
517 | - wx.showModal({ | |
518 | - title: '提示', | |
519 | - content: gg.goods_name+'门店库存不足' | |
520 | - }); | |
509 | + | |
510 | + var content=gg.goods_name+'门店库存不足,请取消订单'; | |
511 | + th.toast(content); | |
521 | 512 | return false; |
522 | 513 | } |
523 | 514 | |
524 | 515 | }else{ |
525 | 516 | if(good.goods_num>store_count){ |
526 | - wx.showModal({ | |
527 | - title: '提示', | |
528 | - content: gg.goods_name+'商品的库存不足' | |
529 | - }); | |
517 | + | |
518 | + var content=gg.goods_name+'商品的库存不足,请取消订单'; | |
519 | + th.toast(content); | |
530 | 520 | return false; |
531 | 521 | } |
532 | 522 | |
... | ... | @@ -567,28 +557,25 @@ Page({ |
567 | 557 | if(prom){ |
568 | 558 | var now=ut.gettimestamp(); |
569 | 559 | if(prom.is_end==1 && prom.end_time<now){ |
570 | - wx.showModal({ | |
571 | - title: '提示', | |
572 | - content: goodsinfo.goods_name+'商品的活动已经结束' | |
573 | - }); | |
560 | + | |
561 | + var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买'; | |
562 | + th.toast(content); | |
574 | 563 | return false; |
575 | 564 | } |
576 | 565 | |
577 | 566 | buyed_mum2=promgoodsbuynum+good.goods_num; |
578 | 567 | if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) { |
579 | - wx.showModal({ | |
580 | - title: '提示', | |
581 | - content: goodsinfo.goods_name+'购买数量超出商品活动限购' | |
582 | - }); | |
568 | + | |
569 | + var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买'; | |
570 | + th.toast(content); | |
583 | 571 | return false; |
584 | 572 | } |
585 | 573 | |
586 | 574 | if(goodsinfo.prom_type==4){ |
587 | 575 | if (good.goods_num > prom.limitqty-prom.buy_num) { |
588 | - wx.showModal({ | |
589 | - title: '提示', | |
590 | - content: goodsinfo.goods_name+'购买数量超出商品活动库存' | |
591 | - }); | |
576 | + | |
577 | + var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单'; | |
578 | + th.toast(content); | |
592 | 579 | return false; |
593 | 580 | } |
594 | 581 | }else{ |
... | ... | @@ -601,9 +588,9 @@ Page({ |
601 | 588 | }); |
602 | 589 | |
603 | 590 | if (good.goods_num > redis_num) { |
604 | - wx.showModal({ | |
605 | - title: gg.goods_name+'超出商品活动库存', | |
606 | - }); | |
591 | + | |
592 | + var content=gg.goods_name+'超出商品活动库存,请取消订单'; | |
593 | + th.toast(content); | |
607 | 594 | return false; |
608 | 595 | } |
609 | 596 | } |
... | ... | @@ -641,10 +628,9 @@ Page({ |
641 | 628 | //判断线下取价是不是一样 |
642 | 629 | if(newarr[good.erpwareid] && |
643 | 630 | parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){ |
644 | - wx.showModal({ | |
645 | - title: '提示', | |
646 | - content: good.goods_name + '商品的价格发生了变化' | |
647 | - }); | |
631 | + | |
632 | + var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
633 | + th.toast(content); | |
648 | 634 | return false; |
649 | 635 | } |
650 | 636 | } |
... | ... | @@ -1286,6 +1272,14 @@ Page({ |
1286 | 1272 | } |
1287 | 1273 | |
1288 | 1274 | } |
1275 | + }, | |
1276 | + | |
1277 | + toast(msg){ | |
1278 | + wx.showToast({ | |
1279 | + title: msg, | |
1280 | + icon: 'none', | |
1281 | + duration: 3000 | |
1282 | + }) | |
1289 | 1283 | } |
1290 | 1284 | |
1291 | 1285 | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -487,10 +487,9 @@ Page({ |
487 | 487 | |
488 | 488 | var buyed_mum2=goodsbuynum+good.goods_num; |
489 | 489 | if (buyed_mum2 > limit && limit > 0) { |
490 | - wx.showModal({ | |
491 | - title: '提示', | |
492 | - content: gg.goods_name+'购买数量超出商品限购' | |
493 | - }); | |
490 | + | |
491 | + var content=gg.goods_name+'购买数量超出商品限购,请取消订单'; | |
492 | + th.toast(content); | |
494 | 493 | return false; |
495 | 494 | } |
496 | 495 | |
... | ... | @@ -500,25 +499,23 @@ Page({ |
500 | 499 | await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { |
501 | 500 | if(res.data.code==0){ |
502 | 501 | var r_data=res.data.data; |
503 | - if(!r_data.collocationPromList && good.prom_type==5){ | |
504 | - wx.showModal({ | |
505 | - title: '提示', | |
506 | - content: good.goods_name+'未找到活动' | |
507 | - }); | |
502 | + if(!r_data.collocationPromList && good.prom_type==5){ | |
503 | + | |
504 | + var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
505 | + th.toast(content) | |
506 | + | |
508 | 507 | p_ok=0; |
509 | 508 | } |
510 | 509 | if(!r_data.promGoodsLists && good.prom_type==3){ |
511 | - wx.showModal({ | |
512 | - title: '提示', | |
513 | - content: good.goods_name+'未找到活动' | |
514 | - }); | |
510 | + | |
511 | + var content=good.goods_name+'未找到活动,请取消订单重新购买'; | |
512 | + th.toast(content); | |
515 | 513 | p_ok=0; |
516 | 514 | } |
517 | 515 | }else{ |
518 | - wx.showModal({ | |
519 | - title: '提示', | |
520 | - content: good.goods_name+'未找到活动' | |
521 | - }); | |
516 | + | |
517 | + var content=good.goods_name+'未找到活动,请取消订单重新购买' | |
518 | + th.toast(content); | |
522 | 519 | p_ok=0; |
523 | 520 | } |
524 | 521 | }) |
... | ... | @@ -528,11 +525,9 @@ Page({ |
528 | 525 | //商品的普通购买 ,不要进行判断 |
529 | 526 | if((good.prom_type==1 || good.prom_type==6 || good.prom_type==4 ) |
530 | 527 | && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ |
531 | - if(gg.prom_type!=good.prom_type) { | |
532 | - wx.showModal({ | |
533 | - title: '提示', | |
534 | - content: gg.goods_name+'商品的活动发生了变化' | |
535 | - }); | |
528 | + if(gg.prom_type!=good.prom_type) { | |
529 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
530 | + th.toast(content); | |
536 | 531 | return false; |
537 | 532 | } |
538 | 533 | |
... | ... | @@ -572,26 +567,23 @@ Page({ |
572 | 567 | if(prom){ |
573 | 568 | var t_now=ut.gettimestamp(); |
574 | 569 | if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){ |
575 | - wx.showModal({ | |
576 | - title: '提示', | |
577 | - content: gg.goods_name+'商品的活动发生了变化' | |
578 | - }); | |
570 | + | |
571 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
572 | + th.toast(content); | |
579 | 573 | return false; |
580 | 574 | } |
581 | 575 | } |
582 | 576 | } |
583 | 577 | else{ |
584 | - if(!good.is_gift ){ | |
578 | + if(!good.is_gift && good.prom_type!=3 ){ | |
585 | 579 | var t_ok=1; |
586 | 580 | await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { |
587 | 581 | if(res.data.code==0){ |
588 | 582 | var r_data=res.data.data; |
589 | 583 | //-- 参加了全局的优惠活动 -- |
590 | - if(r_data.promGoodsLists){ | |
591 | - wx.showModal({ | |
592 | - title: '提示', | |
593 | - content: gg.goods_name+'商品的活动发生了变化' | |
594 | - }); | |
584 | + if(r_data.promGoodsLists){ | |
585 | + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; | |
586 | + th.toast(content); | |
595 | 587 | t_ok=0; |
596 | 588 | } |
597 | 589 | } |
... | ... | @@ -617,10 +609,9 @@ Page({ |
617 | 609 | } |
618 | 610 | var is_h=0; |
619 | 611 | if (!isok) { |
620 | - wx.showModal({ | |
621 | - title: '提示', | |
622 | - content: gg.goods_name + '商品的价格发生了变化' | |
623 | - }); | |
612 | + | |
613 | + var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买' | |
614 | + th.toast(content); | |
624 | 615 | return false; |
625 | 616 | } |
626 | 617 | } |
... | ... | @@ -632,19 +623,17 @@ Page({ |
632 | 623 | ob=obj; |
633 | 624 | }) |
634 | 625 | if(ob.code==-1){ |
635 | - wx.showModal({ | |
636 | - title: '提示', | |
637 | - content: gg.goods_name+'门店库存不足' | |
638 | - }); | |
626 | + | |
627 | + var content=gg.goods_name+'门店库存不足,请取消订单'; | |
628 | + th.toast(content); | |
639 | 629 | return false; |
640 | 630 | } |
641 | 631 | |
642 | 632 | }else{ |
643 | 633 | if(good.goods_num>store_count){ |
644 | - wx.showModal({ | |
645 | - title: '提示', | |
646 | - content: gg.goods_name+'商品的库存不足' | |
647 | - }); | |
634 | + | |
635 | + var content=gg.goods_name+'商品的库存不足,请取消订单'; | |
636 | + th.toast(content); | |
648 | 637 | return false; |
649 | 638 | } |
650 | 639 | |
... | ... | @@ -685,28 +674,25 @@ Page({ |
685 | 674 | if(prom){ |
686 | 675 | var now=ut.gettimestamp(); |
687 | 676 | if(prom.is_end==1 && prom.end_time<now){ |
688 | - wx.showModal({ | |
689 | - title: '提示', | |
690 | - content: goodsinfo.goods_name+'商品的活动已经结束' | |
691 | - }); | |
677 | + | |
678 | + var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单' | |
679 | + th.toast(content); | |
692 | 680 | return false; |
693 | 681 | } |
694 | 682 | |
695 | 683 | buyed_mum2=promgoodsbuynum+good.goods_num; |
696 | 684 | if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) { |
697 | - wx.showModal({ | |
698 | - title: '提示', | |
699 | - content: goodsinfo.goods_name+'购买数量超出商品活动限购' | |
700 | - }); | |
685 | + | |
686 | + var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单' | |
687 | + th.toast(content); | |
701 | 688 | return false; |
702 | 689 | } |
703 | 690 | |
704 | 691 | if(goodsinfo.prom_type==4){ |
705 | 692 | if (good.goods_num > prom.limitqty-prom.buy_num) { |
706 | - wx.showModal({ | |
707 | - title: '提示', | |
708 | - content: goodsinfo.goods_name+'购买数量超出商品活动库存' | |
709 | - }); | |
693 | + | |
694 | + var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单' | |
695 | + th.toast(content); | |
710 | 696 | return false; |
711 | 697 | } |
712 | 698 | }else{ |
... | ... | @@ -719,9 +705,9 @@ Page({ |
719 | 705 | }); |
720 | 706 | |
721 | 707 | if (good.goods_num > redis_num) { |
722 | - wx.showModal({ | |
723 | - title: gg.goods_name+'超出商品活动库存', | |
724 | - }); | |
708 | + | |
709 | + var content=gg.goods_name+'超出商品活动库存,请取消订单'; | |
710 | + th.toast(content); | |
725 | 711 | return false; |
726 | 712 | } |
727 | 713 | } |
... | ... | @@ -749,7 +735,7 @@ Page({ |
749 | 735 | } |
750 | 736 | }) |
751 | 737 | if(!offarr && offarr.length<=0){ |
752 | - wx.showModal({ title: '获取线下取价失败',}); | |
738 | + th.toast('获取线下取价失败'); | |
753 | 739 | } |
754 | 740 | var newarr=ut.convert_arr_key(offarr,'WareId'); |
755 | 741 | //-- 循环判断线下的价格 -- |
... | ... | @@ -758,10 +744,9 @@ Page({ |
758 | 744 | //判断线下取价是不是一样 |
759 | 745 | if(newarr[good.erpwareid] && |
760 | 746 | parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){ |
761 | - wx.showModal({ | |
762 | - title: '提示', | |
763 | - content: good.goods_name + '商品的价格发生了变化' | |
764 | - }); | |
747 | + | |
748 | + var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买'; | |
749 | + th.toast(content); | |
765 | 750 | return false; |
766 | 751 | } |
767 | 752 | } |
... | ... | @@ -1583,6 +1568,14 @@ Page({ |
1583 | 1568 | // clock += ss; |
1584 | 1569 | return clock; |
1585 | 1570 | }, |
1571 | + | |
1572 | + toast(msg){ | |
1573 | + wx.showToast({ | |
1574 | + title: msg, | |
1575 | + icon: 'none', | |
1576 | + duration: 3000 | |
1577 | + }) | |
1578 | + } | |
1586 | 1579 | |
1587 | 1580 | |
1588 | 1581 | }); |
1589 | 1582 | \ No newline at end of file | ... | ... |