Commit 04352f1ae8ce06ff5685624b6fc015c86b632751
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
81 changed files
with
3466 additions
and
1671 deletions
app.js
... | ... | @@ -135,6 +135,15 @@ App({ |
135 | 135 | } |
136 | 136 | }) |
137 | 137 | } |
138 | + | |
139 | + // else if(app.globalData.user_id){ //-- 启用默认的user_id -- | |
140 | + // app.promiseGet("/api/weshop/users/get/" + app.globalData.setting.stoid + "/" + app.globalData.user_id,{}).then(res=>{ | |
141 | + // if(res.data.code==0){ | |
142 | + // app.globalData.userInfo = res.data.data; | |
143 | + // wx.setStorageSync("userinfo",app.globalData.userInfo); | |
144 | + // } | |
145 | + // }) | |
146 | + // } | |
138 | 147 | } |
139 | 148 | wx.getSystemInfo({ |
140 | 149 | success: (res) => { |
... | ... | @@ -989,7 +998,14 @@ App({ |
989 | 998 | }; |
990 | 999 | }, |
991 | 1000 | }); |
992 | - }; | |
1001 | + } | |
1002 | + else{ | |
1003 | + wx.showModal({ | |
1004 | + content: '商家未设置客服热线', | |
1005 | + showCancel: 0, | |
1006 | + | |
1007 | + }); | |
1008 | + } | |
993 | 1009 | }); |
994 | 1010 | }, |
995 | 1011 | |
... | ... | @@ -1314,7 +1330,6 @@ App({ |
1314 | 1330 | var stoid=this.globalData.setting.stoid; |
1315 | 1331 | var user_id=this.globalData.user_id; |
1316 | 1332 | |
1317 | - | |
1318 | 1333 | this.getConfig2(async function (e){ |
1319 | 1334 | if(e && e.switch_list) conf=JSON.parse(e.switch_list); |
1320 | 1335 | if(conf && conf.express_searchtype==1){ |
... | ... | @@ -1335,7 +1350,59 @@ App({ |
1335 | 1350 | return true; |
1336 | 1351 | } |
1337 | 1352 | return false; |
1353 | + }, | |
1354 | + //---- 判断是不是虚拟商品狗阿米 ----- | |
1355 | + is_virtual(gd){ | |
1356 | + if(gd.is_virtual==2) return true; | |
1357 | + return false; | |
1358 | + }, | |
1338 | 1359 | |
1360 | + /** | |
1361 | + * | |
1362 | + * @param gd 商品 | |
1363 | + * @param act 活动 | |
1364 | + * @param get_type 0默认 1是加和减的时候 | |
1365 | + */ | |
1366 | + get_limit_qty(gd,act,get_type){ | |
1367 | + var islimit=gd.erp_islimit; //是不是限购 | |
1368 | + var limittype=gd.erp_limittype; //不低于0、倍数1 | |
1369 | + var limitqty=gd.erp_limitqty; //起购量 | |
1370 | + | |
1371 | + //-- 如果有活动的时候,就直接返回1 -- | |
1372 | + if(act){ | |
1373 | + return 1; | |
1374 | + //islimit=act.islimit; | |
1375 | + //limittype=act.limittype; | |
1376 | + //limitqty=act.limitqty; | |
1377 | + } | |
1378 | + //-- 不是限购的时候,返回1-- | |
1379 | + if(!islimit) return 1; | |
1380 | + //-- 默认的时候 -- | |
1381 | + if(!get_type) return limitqty; | |
1382 | + //不低于的时候,加减的时候 | |
1383 | + if(!limittype) return 1; | |
1384 | + //倍数,加减的时候 | |
1385 | + return limitqty; | |
1386 | + }, | |
1387 | + | |
1388 | + //获取商品是不是有促销活动 | |
1389 | + async get_has_cx_act(gid){ | |
1390 | + var url = '/api/weshop/activitylist/listGoodActInfo2New'; | |
1391 | + var req_d = { | |
1392 | + "store_id":this.globalData.setting.stoid, | |
1393 | + "goods_id": gid, | |
1394 | + "user_id":this.globalData.user_id, | |
1395 | + } | |
1396 | + var res= await this.promiseGet(url,{data:req_d}); | |
1397 | + var cx_arr=[]; | |
1398 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
1399 | + var arr = res.data.data; | |
1400 | + cx_arr=arr.filter(function (e) { | |
1401 | + return e.s_time < ut.gettimestamp() && [3,5,7,10].indexOf(e.prom_type)>-1; | |
1402 | + }) | |
1403 | + } | |
1404 | + return cx_arr; | |
1339 | 1405 | } |
1340 | 1406 | |
1407 | + | |
1341 | 1408 | }); | ... | ... |
app.json
... | ... | @@ -211,6 +211,7 @@ |
211 | 211 | "pages/user/user_fw/user_fw", |
212 | 212 | "pages/user/cardinfo/cardinfo", |
213 | 213 | "pages/user/nick_avatar/nick_avatar", |
214 | + "pages/user/nick_avatar_add/nick_avatar_add", | |
214 | 215 | "pages/user/slimming/slimming", |
215 | 216 | "pages/user/punchInhistory/punchInhistory", |
216 | 217 | "pages/user/grow_value/grow_value", |
... | ... | @@ -297,6 +298,9 @@ |
297 | 298 | "usingComponents": { |
298 | 299 | "customtabbar": "custom-tab-bar/index" |
299 | 300 | }, |
301 | + "requiredPrivateInfos":[ | |
302 | + "getLocation" | |
303 | + ], | |
300 | 304 | "useExtendedLib": { |
301 | 305 | "weui": true |
302 | 306 | }, | ... | ... |
app.wxss
components/auto_go/auto_go.js
0 → 100644
1 | +Component({ | |
2 | + /*** 页面的初始数据***/ | |
3 | + data: { | |
4 | + msgStatus:false, | |
5 | + countDownNum:3, //默认3秒后跳转 | |
6 | + stop:0 //强行停止的开关 | |
7 | + }, | |
8 | + methods: { | |
9 | + show:function (){ | |
10 | + this.data.stop=0; | |
11 | + this.setData({msgStatus:true,countDownNum:3}) | |
12 | + this.cut_down(); | |
13 | + }, | |
14 | + hide:function (){ | |
15 | + this.setData({msgStatus:false}) | |
16 | + }, | |
17 | + //-- 定时器跳转 -- | |
18 | + cut_down(){ | |
19 | + if(this.data.stop) return false; | |
20 | + if(this.data.countDownNum>0){ | |
21 | + var a=this.data.countDownNum-1; | |
22 | + this.setData({countDownNum:a}) | |
23 | + setTimeout(()=>{ | |
24 | + this.cut_down(); | |
25 | + },1000); | |
26 | + }else{ | |
27 | + if(this.data.stop) return false; | |
28 | + this.hide(); | |
29 | + this.triggerEvent('childFun'); | |
30 | + } | |
31 | + }, | |
32 | + //-- 3秒跳转的自动关闭 -- | |
33 | + stop(){ | |
34 | + this.data.stop=1; | |
35 | + this.hide(); | |
36 | + } | |
37 | + } | |
38 | + | |
39 | + | |
40 | +}) | |
0 | 41 | \ No newline at end of file | ... | ... |
components/auto_go/auto_go.json
0 → 100644
components/auto_go/auto_go.wxml
0 → 100644
1 | +<view class="no-data" wx:if="{{msgStatus == true}}"> | |
2 | + <view class="no-data-title" style="text-align:center;margin-top:100px"> | |
3 | + <view style="color:#444;line-height:30px;">暂无进行中活动</view> | |
4 | + <view style="color:#444;line-height:30px;"> {{countDownNum}} 秒后自动跳到即将开始</view> | |
5 | + </view> | |
6 | +</view> | ... | ... |
components/auto_go/auto_go.wxss
0 → 100644
1 | +@import "../../app.wxss"; | |
2 | + | |
3 | +.no-data .cart-image { | |
4 | + width: 208rpx; | |
5 | + height: 202rpx; | |
6 | +} | |
7 | + | |
8 | +.no-data .no-data-title { | |
9 | + font-size: 28rpx; | |
10 | + color: #b8b8b8; | |
11 | + margin-bottom: 50rpx; | |
12 | +} | |
13 | + | |
14 | +.no-data .lookat { | |
15 | + display: inline-block; | |
16 | + font-size: 28rpx; | |
17 | + border-radius: 10rpx; | |
18 | + background-color: #e83028; | |
19 | + color: white; | |
20 | + padding: 20rpx 50rpx; | |
21 | +} | |
0 | 22 | \ No newline at end of file | ... | ... |
components/com_servicer/com_servicer.wxml
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | <text class="iconfont icon-guan" bindtap="closeCS"></text> |
6 | 6 | </view> |
7 | 7 | <!-- 客服热线 --> |
8 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService"> | |
8 | + <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | |
9 | 9 | <text class="iconfont icon-dianhua"></text>客服热线: |
10 | 10 | <text class="c-red">{{store_tel}}</text> |
11 | 11 | </view> | ... | ... |
components/diy_seckill/diy_seckill.js
... | ... | @@ -35,7 +35,10 @@ Component({ |
35 | 35 | ylp_img: "https://mshopimg.yolipai.net/", |
36 | 36 | imghost: os.imghost, |
37 | 37 | timer: null, |
38 | - user_id:0 | |
38 | + user_id:0, | |
39 | + img_width:100, | |
40 | + img_height:100, | |
41 | + swiperHeight:0 | |
39 | 42 | }, |
40 | 43 | |
41 | 44 | pageLifetimes: { |
... | ... | @@ -44,8 +47,9 @@ Component({ |
44 | 47 | //会员身份变化 |
45 | 48 | var th = this; |
46 | 49 | var g_id = this.data.object; |
50 | + | |
47 | 51 | //只有再会员登陆之后,才重新调用接口 |
48 | - | |
52 | + console.log('秒杀组件------------'); | |
49 | 53 | if(this.data.user_id!=getApp().globalData.user_id){ |
50 | 54 | this.data.user_id=getApp().globalData.user_id |
51 | 55 | this.init(g_id); |
... | ... | @@ -67,6 +71,7 @@ Component({ |
67 | 71 | |
68 | 72 | ready: function () { |
69 | 73 | var g_id = this.data.object; |
74 | + | |
70 | 75 | this.init(g_id); |
71 | 76 | this.data.user_id=getApp().globalData.user_id; |
72 | 77 | }, |
... | ... | @@ -79,7 +84,7 @@ Component({ |
79 | 84 | customMethod: function () { }, |
80 | 85 | init: function (g_id) { |
81 | 86 | var th = this; |
82 | - | |
87 | + this.loadImg(g_id) | |
83 | 88 | getApp().getConfig2(function (e) { |
84 | 89 | var swithc_list = e.switch_list; |
85 | 90 | var sw_arr = JSON.parse(swithc_list); |
... | ... | @@ -109,7 +114,7 @@ Component({ |
109 | 114 | // var gUrl = "/api/ms/flash_sale/getGoodsList?store_id=" + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id="+user_id+"&type=1"; |
110 | 115 | var gUrl = "/api/ms/flash_sale/getGoodsList?store_id=" + os.stoid + "&idlist=" + idlist + "&user_id="+user_id+"&type=1"; |
111 | 116 | app.request.promiseGet(gUrl, {}).then(res => { |
112 | - | |
117 | + | |
113 | 118 | //如果秒杀的数组为空的时候 |
114 | 119 | var goodslist = res.data.data; |
115 | 120 | //就算是添加的活动已经过期,就要用最新的进行中活动 |
... | ... | @@ -131,6 +136,7 @@ Component({ |
131 | 136 | getApp().request.promiseGet("/api/ms/flash_sale/spikepage?page=1&pageSize=9", |
132 | 137 | { isShowLoading: 1, data:req } |
133 | 138 | ).then(res => { |
139 | + | |
134 | 140 | if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { |
135 | 141 | var goodsidlist = res.data.data.pageData; |
136 | 142 | this.set_goods_list(null, goodsidlist); |
... | ... | @@ -194,23 +200,55 @@ Component({ |
194 | 200 | |
195 | 201 | |
196 | 202 | Promise.all(promisies).then(() => { |
197 | - | |
198 | 203 | // 判断活动是否结束 |
204 | + let empty=[] | |
199 | 205 | for(let i in all_array){ |
200 | 206 | let item=all_array[i]; |
201 | 207 | if(newTime > item.end_time) { |
202 | 208 | all_array[i].status = 3; |
203 | - }; | |
204 | - | |
209 | + }; | |
210 | + // let price=all_array[i].price.toFixed(2) | |
211 | + let price=all_array[i].price + '' | |
212 | + if (price && price.indexOf('.') > -1) { | |
213 | + let priceArr = price.split(".") | |
214 | + all_array[i].price_n = priceArr[0] | |
215 | + all_array[i].price_xs = priceArr[1] | |
216 | + }else{ | |
217 | + all_array[i].price_n = price | |
218 | + } | |
219 | + | |
220 | + all_array[i].residue=all_array[i].goods_num*1 - all_array[i].buy_num*1 | |
221 | + if (all_array[i].residue && all_array[i].residue > 0 && all_array[i].status !=2) { | |
222 | + empty.push(all_array[i]) | |
223 | + } | |
224 | + } | |
225 | + | |
226 | + //控制已售罄是否显示 | |
227 | + if (!th.data.object.hide_sold_out_items) { | |
228 | + all_array=empty | |
229 | + } | |
230 | + | |
231 | + | |
232 | + var arr = new Array(); | |
233 | + if (th.data.object.style==7) { | |
234 | + //--三个三个一组--- | |
235 | + for (var i = 0; i < all_array.length; i += 2) { | |
236 | + arr.push(all_array.slice(i, i + 2)); | |
237 | + } | |
238 | + }else{ | |
239 | + //--三个三个一组--- | |
240 | + for (var i = 0; i < all_array.length; i += 3) { | |
241 | + arr.push(all_array.slice(i, i + 3)); | |
242 | + } | |
243 | + } | |
244 | + | |
245 | + | |
246 | + /*--熏染到前台--*/ | |
247 | + th.setData({ goods_array: arr }); | |
248 | + if (th.data.object.style==6) { | |
249 | + th.setSwiper_h() | |
205 | 250 | } |
206 | 251 | |
207 | - var arr = new Array(); | |
208 | - //--三个三个一组--- | |
209 | - for (var i = 0; i < all_array.length; i += 3) { | |
210 | - arr.push(all_array.slice(i, i + 3)); | |
211 | - } | |
212 | - /*--熏染到前台--*/ | |
213 | - th.setData({ goods_array: arr }); | |
214 | 252 | }); |
215 | 253 | |
216 | 254 | |
... | ... | @@ -218,7 +256,30 @@ Component({ |
218 | 256 | th.countDown2(th); |
219 | 257 | }, 1000); |
220 | 258 | }, |
221 | - | |
259 | + setSwiper_h(){ | |
260 | + var th=this | |
261 | + wx.createSelectorQuery().in(this).select('.swiper_h').boundingClientRect(rect => { | |
262 | + if (rect && rect.height) { | |
263 | + var sumHeigth=(rect.height+13)+'px' | |
264 | + th.setData({ | |
265 | + swiperHeight: sumHeigth | |
266 | + }) | |
267 | + } | |
268 | + }).exec(); | |
269 | + // const query = this.createSelectorQuery() | |
270 | + // query.select('.swiper_h').boundingClientRect() | |
271 | + // query.exec( (res)=> { | |
272 | + // console.log(res) | |
273 | + // console.log(res[0].height) | |
274 | + // console.log(res[0].height * data.t.length) | |
275 | + // let sumHeigth = res[0].height * data.t.length; | |
276 | + // console.error('组件高度'); | |
277 | + // console.log(sumHeigth); | |
278 | + // th.setData({ | |
279 | + // swiperHeight: sumHeigth | |
280 | + // }) | |
281 | + // }) | |
282 | + }, | |
222 | 283 | |
223 | 284 | |
224 | 285 | //---小于10的格式化函数---- |
... | ... | @@ -285,7 +346,28 @@ Component({ |
285 | 346 | wx.navigateTo({ |
286 | 347 | url: "/pages/activity/seckill_list/seckill_list" |
287 | 348 | }); |
349 | + }, | |
350 | + //加入购物车 | |
351 | + shoppingCart(){ | |
352 | + console.log('加入购物车'); | |
353 | + }, | |
354 | + loadImg(g_id){ | |
355 | + if (g_id.style==1) { | |
356 | + let w='' | |
357 | + switch (g_id.picture_scale) { | |
358 | + case 1: | |
359 | + w=`width:calc(100%-${g_id.page_margins*2}px);height:calc(100%-${g_id.page_margins*2}px)` | |
360 | + break; | |
361 | + | |
362 | + default: | |
363 | + break; | |
364 | + } | |
365 | + | |
366 | + | |
367 | + | |
368 | + } | |
288 | 369 | } |
370 | + | |
289 | 371 | }, |
290 | 372 | |
291 | 373 | ... | ... |
components/diy_seckill/diy_seckill.wxml
1 | 1 | <block wx:if="{{goods_array.length>0}}"> |
2 | - <!--秒杀--> | |
3 | - <view class='top' bindtap="go_to_skill"> | |
4 | - <view class="flex"> | |
5 | - <view class='t_left'></view> | |
6 | - <view class='t_ms'>秒杀</view> | |
2 | + <!--新版秒杀组件--> | |
3 | + <block wx:if="{{object.column_action_name}}"> | |
4 | + <view class='top' bindtap="go_to_skill" wx:if="{{object.column_title}}" style="{{'background-image:url('+object.column_diy_title+')'+';background-size:100% 70rpx;padding:0rpx;border-bottom:0rpx;' + 'margin-bottom:'+object.product_spacing+'px;'}}"> | |
5 | + <view class="flex" wx:if="{{!object.column_diy_title}}"> | |
6 | + <view class='t_left'></view> | |
7 | + <view class='t_ms n_t_ms' style="font-size: 30rpx;">{{object.column_name}}</view> | |
8 | + </view> | |
9 | + <view class='right_k' wx:if="{{!object.column_diy_title}}"> | |
10 | + 更多<image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
11 | + </view> | |
7 | 12 | </view> |
8 | - <view class='right_k'> | |
9 | - <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
10 | - </view> | |
11 | - </view> | |
13 | + <!-- 大图模式 --> | |
14 | + <block wx:if="{{object.style==1}}"> | |
15 | + <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
16 | + <block wx:for="{{goods_array}}"> | |
17 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> | |
18 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
19 | + <view class="imgBox"> | |
20 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
21 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
22 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
23 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
24 | + </view> | |
12 | 25 | |
13 | - <!--商品展示--> | |
14 | - <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
15 | - <view class='sp' wx:if="{{object.style==1}}"> | |
16 | - <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
17 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
18 | - <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> | |
19 | - <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
20 | - <view class='one'> | |
21 | - <view class='sp_top'> | |
22 | - <view class='po'></view> | |
23 | - <block wx:if="{{aitem.status == 0}}"> | |
24 | - <view class="rob" style="justify-content: flex-start"> | |
25 | - <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
26 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
27 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
28 | + </view> | |
29 | + <block wx:if="{{object.count_down}}"> | |
30 | + <view wx:if="{{aitem.residue==0 || aitem.status==2}}" style="height: 70rpx;line-height: 70rpx;color: #fff;background-color:rgb(166,166,166);text-align: center;"> | |
31 | + 已售罄 | |
32 | + </view> | |
33 | + <view wx:else style="{{'height: 70rpx;padding: 10rpx 30rpx;background:'+ (aitem.status ==0 ? object.scountdown_background_color : (aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color))}}" class="new_item1_time"> | |
34 | + <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> | |
35 | + <view style="text-align: center;"> | |
36 | + <view wx:if="{{aitem.status == 1}}">距结束时间</view> | |
37 | + <view wx:if="{{aitem.status == 0}}">距开始时间</view> | |
38 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
39 | + <!-- <view>30天21:59:40</view> --> | |
40 | + </view> | |
41 | + </view> | |
42 | + </block> | |
43 | + <view class="ellipsis-2n new_item1_goods_name" style="{{(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
44 | + <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
45 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
46 | + <view class="clor7b"> | |
47 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
48 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> | |
49 | + </view> | |
50 | + <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
51 | + <view class="clor" wx:if="{{object.commodity_price}}"> | |
52 | + ¥<text class="pricefs42">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text> | |
53 | + <text style="margin-left: 5rpx;" wx:if="{{object.wholesale_price}}" class="clor7b">¥{{aitem.shop_price}}</text> | |
54 | + </view> | |
55 | + </view> | |
56 | + </view> | |
57 | + <view> | |
58 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" class="imgbox1"></image> | |
59 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
60 | + </view> | |
61 | + </view> | |
62 | + </navigator> | |
63 | + </view> | |
64 | + </block> | |
65 | + </view> | |
66 | + </block> | |
67 | + <!-- 一行两个 --> | |
68 | + <block wx:if="{{object.style==2}}"> | |
69 | + <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
70 | + <block wx:for="{{goods_array}}"> | |
71 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')+ (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}"> | |
72 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
73 | + <view class="imgBox"> | |
74 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
75 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
76 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
77 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
78 | + </view> | |
79 | + | |
80 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
81 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
82 | + </view> | |
83 | + <block wx:if="{{object.count_down}}"> | |
84 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
85 | + <view>已售罄</view> | |
86 | + </view> | |
87 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
88 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
89 | + </view> | |
90 | + </block> | |
91 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
92 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
93 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
94 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | |
95 | + </view> | |
96 | + <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
97 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
98 | + <view style="{{(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
99 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs38">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
100 | + <view wx:if="{{object.wholesale_price}}" class="clor7b">¥{{aitem.shop_price}}</view> | |
101 | + </view> | |
102 | + </view> | |
103 | + <view> | |
104 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width: 60rpx;height: 60rpx;"></image> | |
105 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
106 | + </view> | |
107 | + </view> | |
108 | + </navigator> | |
109 | + </view> | |
110 | + </block> | |
111 | + </view> | |
112 | + </block> | |
113 | + <!-- 一行三个 --> | |
114 | + <block wx:if="{{object.style==3}}"> | |
115 | + <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
116 | + <block wx:for="{{goods_array}}"> | |
117 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/3 - ' + (object.product_spacing*2)/3+'px)')}}"> | |
118 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
119 | + <view class="imgBox"> | |
120 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
121 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
122 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
123 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
124 | + </view> | |
125 | + | |
126 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
127 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
128 | + </view> | |
129 | + <!-- <view class="new_item1_time" wx:if="{{object.count_down}}" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
130 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
131 | + </view> --> | |
132 | + <block wx:if="{{object.count_down}}"> | |
133 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
134 | + <view>已售罄</view> | |
135 | + </view> | |
136 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
137 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
138 | + </view> | |
139 | + </block> | |
140 | + <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
141 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
142 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
143 | + <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | |
144 | + </view> | |
145 | + <view class="new_item1_price clor7b" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
146 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
147 | + <view style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
148 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs28">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
149 | + <view wx:if="{{object.wholesale_price}}">¥{{aitem.shop_price}}</view> | |
150 | + </view> | |
151 | + </view> | |
152 | + <view> | |
153 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width: 50rpx;height: 50rpx;"></image> | |
154 | + <!-- <view style="width: 90rpx;height: 50rpx;line-height: 50rpx;" wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> --> | |
155 | + </view> | |
156 | + </view> | |
157 | + </navigator> | |
158 | + </view> | |
159 | + </block> | |
160 | + </view> | |
161 | + </block> | |
162 | + <!-- 详细列表 --> | |
163 | + <block wx:if="{{object.style==4}}"> | |
164 | + <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') }}"> | |
165 | + <block wx:for="{{goods_array}}"> | |
166 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> | |
167 | + <navigator style="display: flex;" url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
168 | + <view style="width: 33%;"> | |
169 | + <view class="imgBox"> | |
170 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
171 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
172 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
173 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
174 | + </view> | |
175 | + | |
176 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
177 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
178 | + </view> | |
179 | + <!-- <view class="new_item1_time" wx:if="{{object.count_down}}" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
180 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
181 | + </view> --> | |
182 | + <block wx:if="{{object.count_down}}"> | |
183 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
184 | + <view>已售罄</view> | |
185 | + </view> | |
186 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
187 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
26 | 188 | </view> |
27 | 189 | </block> |
28 | - | |
29 | - <!-- <block wx:if="{{aitem.end_time<=newTime}}"> | |
30 | - <view class="rob" style="justify-content: flex-start"> | |
31 | - <span class='s_top_kill gray'>活动已结束</span> | |
32 | - </view> | |
33 | - </block> | |
34 | - <block wx:else> | |
35 | - <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}"> | |
36 | - <view class="rob" style="justify-content: flex-start"> | |
37 | - <span class='s_top_kill'>火热进行</span> | |
38 | - </view> | |
39 | - </block> | |
40 | - <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> | |
41 | - <view class="rob" style="justify-content: flex-start"> | |
42 | - <span class='s_top_kill gray'>已抢光</span> | |
43 | - </view> | |
44 | - </block> | |
45 | - </block> --> | |
46 | - | |
47 | - | |
48 | - <block wx:if="{{aitem.status == 1}}"> | |
49 | - <view class="rob" style="justify-content: flex-start"> | |
50 | - <span class='s_top_kill'>火热进行</span> | |
51 | - </view> | |
52 | - </block> | |
53 | - <block wx:if="{{aitem.status == 2}}"> | |
54 | - <view class="rob" style="justify-content: flex-start"> | |
55 | - <span class='s_top_kill gray'>已抢光</span> | |
56 | - </view> | |
57 | - </block> | |
58 | - <block wx:if="{{aitem.status == 3}}"> | |
59 | - <view class="rob" style="justify-content: flex-start"> | |
60 | - <span class='s_top_kill gray'>活动已结束</span> | |
61 | - </view> | |
62 | - </block> | |
63 | - | |
64 | - | |
65 | - | |
66 | - <view class='clear'></view> | |
67 | - | |
68 | - <view class='s_img'> | |
69 | - <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
70 | - </view> | |
71 | - | |
72 | - <view class='s_foot_kill'> | |
73 | - <text>{{aitem.djs.day}}天</text> | |
74 | - <text>{{aitem.djs.hou}}时</text> | |
75 | - <text>{{aitem.djs.min}}分</text> | |
76 | - <text>{{aitem.djs.sec}}秒</text> | |
77 | - </view> | |
78 | - <view class='clear'></view> | |
79 | - | |
80 | - </view> | |
81 | - | |
82 | - <view class='sp_wz'> | |
83 | - <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> | |
84 | - <view class='sp_jg'>¥{{aitem.price}}</view> | |
85 | - <view wx:if="{{is_retail_price}}"class='sp_jgx ~no_line_x'>¥{{aitem.market_price}}</view> | |
86 | 190 | </view> |
191 | + <view style="{{'width: 67%;display: flex;flex-wrap: wrap;padding-left: 10rpx;' + (object.text_align==2 ? 'justify-content:center;' :'' )}}"> | |
192 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'font-size:28rpx;height:100rpx;'+(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
193 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'font-size:24rpx;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
194 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
195 | + <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | |
196 | + </view> | |
197 | + <view class="new_item1_price clor7b" style="{{'width:100%;' + (object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
198 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
199 | + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
200 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs42">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
201 | + <view wx:if="{{object.wholesale_price}}">¥{{aitem.shop_price}}</view> | |
202 | + </view> | |
203 | + </view> | |
204 | + <view> | |
205 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width:60rpx;height: 60rpx;"></image> | |
206 | + <view style="width: 130rpx;height: 60rpx;line-height: 60rpx;" wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
207 | + </view> | |
208 | + </view> | |
209 | + </view> | |
210 | + </navigator> | |
211 | + </view> | |
212 | + </block> | |
213 | + </view> | |
214 | + </block> | |
215 | + <!-- 一大一小 --> | |
216 | + <block wx:if="{{object.style==5}}"> | |
217 | + <view style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'}}" class="{{'flex2 new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
218 | + <block wx:for="{{goods_array}}"> | |
219 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
220 | + <view wx:if="{{aind==0}}" class="{{'new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px;'}}"> | |
221 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
222 | + <view class="imgBox"> | |
223 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
224 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
225 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
226 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
227 | + </view> | |
87 | 228 | |
229 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
230 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
231 | + </view> | |
232 | + <block wx:if="{{object.count_down}}"> | |
233 | + <view wx:if="{{aitem.residue==0 || aitem.status==2}}" style="height: 70rpx;line-height: 70rpx;color: #fff;background-color:rgb(166,166,166);text-align: center;"> | |
234 | + 已售罄 | |
235 | + </view> | |
236 | + <view wx:else style="{{'height: 70rpx;padding: 10rpx 30rpx;background:'+ (aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}" class="new_item1_time"> | |
237 | + <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> | |
238 | + <view style="text-align: center;"> | |
239 | + <view wx:if="{{aitem.status == 1}}">距结束时间</view> | |
240 | + <view wx:if="{{aitem.status == 0}}">距开始时间</view> | |
241 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
242 | + <!-- <view>30天21:59:40</view> --> | |
243 | + </view> | |
244 | + </view> | |
245 | + </block> | |
246 | + <view class="ellipsis-2n new_item1_goods_name" style="{{(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
247 | + <view class="new_item1_price" style="{{'padding:10rpx 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
248 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
249 | + <view class="clor7b"> | |
250 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
251 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.status==2 ? '0' : aitem.residue}}</text>件</text> | |
252 | + </view> | |
253 | + <view class="flex" style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
254 | + <view class="clor" wx:if="{{object.commodity_price}}"> | |
255 | + ¥<text class="pricefs42">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text> | |
256 | + <text style="margin-left: 5rpx;" wx:if="{{object.wholesale_price}}" class="clor7b">¥{{aitem.shop_price}}</text> | |
257 | + </view> | |
258 | + </view> | |
259 | + </view> | |
260 | + <view> | |
261 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" class="imgbox1"></image> | |
262 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
263 | + </view> | |
264 | + </view> | |
265 | + </navigator> | |
88 | 266 | </view> |
89 | - </navigator> | |
267 | + <view wx:if="{{aind==1}}" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}"> | |
268 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
269 | + <view class="imgBox"> | |
270 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
271 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
272 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
273 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
274 | + </view> | |
275 | + | |
276 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
277 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
278 | + </view> | |
279 | + <block wx:if="{{object.count_down}}"> | |
280 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
281 | + <view>已售罄</view> | |
282 | + </view> | |
283 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
284 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
285 | + </view> | |
286 | + </block> | |
287 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
288 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
289 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
290 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | |
291 | + </view> | |
292 | + <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
293 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
294 | + <view style="{{(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
295 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs38">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
296 | + <view wx:if="{{object.wholesale_price}}" class="clor7b">¥{{aitem.shop_price}}</view> | |
297 | + </view> | |
298 | + </view> | |
299 | + <view> | |
300 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width: 60rpx;height: 60rpx;"></image> | |
301 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
302 | + </view> | |
303 | + </view> | |
304 | + </navigator> | |
305 | + </view> | |
306 | + <view wx:if="{{aind==2}}" class="{{'boxpad new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}"> | |
307 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
308 | + <view class="imgBox"> | |
309 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
310 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
311 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
312 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
313 | + </view> | |
314 | + | |
315 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
316 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
317 | + </view> | |
318 | + <block wx:if="{{object.count_down}}"> | |
319 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
320 | + <view>已售罄</view> | |
321 | + </view> | |
322 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
323 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
324 | + </view> | |
325 | + </block> | |
326 | + <view class="ellipsis-2 new_item1_goods_name" style="{{'height:88rpx;font-size:24rpx; ' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
327 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price pdlf10 clor7b" style="{{'font-size:20rpx;' + 'display:block;'+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
328 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
329 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | |
330 | + </view> | |
331 | + <view class="new_item1_price pdlf10" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
332 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
333 | + <view style="{{(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
334 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs38">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
335 | + <view wx:if="{{object.wholesale_price}}" class="clor7b">¥{{aitem.shop_price}}</view> | |
336 | + </view> | |
337 | + </view> | |
338 | + <view> | |
339 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width: 60rpx;height: 60rpx;"></image> | |
340 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
341 | + </view> | |
342 | + </view> | |
343 | + </navigator> | |
344 | + </view> | |
345 | + </block> | |
90 | 346 | </block> |
91 | - </swiper-item> | |
347 | + </view> | |
348 | + </block> | |
349 | + <!-- 横向滑动 2个--> | |
350 | + <block wx:if="{{object.style==7}}"> | |
351 | + <!-- <swiper indicator-dots circular> --> | |
352 | + <swiper indicator-dots style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(swiperHeight ? ('height:'+swiperHeight+';'):'' )}}" class="{{' new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
353 | + <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;"> | |
354 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad swiper_h new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}"> | |
355 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
356 | + <view class="imgBox"> | |
357 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
358 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
359 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
360 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 ' }}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
361 | + </view> | |
362 | + | |
363 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
364 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image> | |
365 | + </view> | |
366 | + <view class="new_item1_time" wx:if="{{object.count_down}}" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
367 | + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> --> | |
368 | + <!-- <view style="text-align: center;"> | |
369 | + <view>距结束时间</view> --> | |
370 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
371 | + <!-- </view> --> | |
372 | + </view> | |
373 | + <view class="ellipsis-2 new_item1_goods_name" style="{{(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
374 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price" style="{{'display:block;color: rgb(56, 56, 56); '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
375 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
376 | + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text> | |
377 | + </view> | |
378 | + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
379 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
380 | + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
381 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view> | |
382 | + <view wx:if="{{object.wholesale_price}}">¥{{aitem.shop_price}}</view> | |
383 | + </view> | |
384 | + </view> | |
385 | + <view> | |
386 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image> | |
387 | + <view wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> | |
388 | + </view> | |
389 | + </view> | |
390 | + </navigator> | |
391 | + </view> | |
392 | + </swiper-item> | |
393 | + </swiper> | |
394 | + <!-- </swiper> --> | |
395 | + | |
396 | + </block> | |
397 | + <!-- 横向滑动 3个--> | |
398 | + <block wx:if="{{object.style==6}}"> | |
399 | + <!-- <swiper indicator-dots circular> --> | |
400 | + <swiper indicator-dots style="{{'padding-left:'+object.page_margins+'px;padding-right:'+object.page_margins+'px;'+(swiperHeight ? ('height:'+swiperHeight+';'):'' )}}" class="{{' new_item1_box '+ ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}"> | |
401 | + <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;"> | |
402 | + <view wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" class="{{'boxpad swiper_h new_item1 ' + (object.product_style==2 ? ' boxsha ':'') + (object.product_style==3 ? ' aborder ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'') + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/3 - ' + (object.product_spacing*2)/3+'px)')}}"> | |
403 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
404 | + <view class="imgBox"> | |
405 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFill' : 'scaleToFill'}}" class="{{'new_item1_image '+ 'aspect_ratio'+object.picture_scale}}" style="{{'width:'+img_width+';height:'+img_height}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
406 | + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}"> | |
407 | + <!-- <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> --> | |
408 | + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '}}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
409 | + </view> | |
410 | + | |
411 | + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image> | |
412 | + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png?v=1'}}"></image> | |
413 | + </view> | |
414 | + <!-- <view class="new_item1_time" wx:if="{{object.count_down}}" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
415 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
416 | + </view> --> | |
417 | + <block wx:if="{{object.count_down}}"> | |
418 | + <view wx:if="{{aitem.residue==0}}" class="new_item1_time" style="justify-content: center;color: #fff;background-color:rgb(166,166,166);"> | |
419 | + <view>已售罄</view> | |
420 | + </view> | |
421 | + <view wx:else class="new_item1_time" style="{{'justify-content: center;background:'+(aitem.status ==0 ? object.scountdown_background_color : object.countdown_background_color)}}"> | |
422 | + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view> | |
423 | + </view> | |
424 | + </block> | |
425 | + <view class="ellipsis-2 new_item1_goods_name " style="{{'height:88rpx;font-size:24rpx;' + (object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view> | |
426 | + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price clor7b" style="{{'display:block;font-size:20rpx; '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
427 | + <text wx:if="{{object.seconds_num}}">已秒<text class="clor">{{aitem.buy_num}}</text>件</text> | |
428 | + <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text> | |
429 | + </view> | |
430 | + <view class="new_item1_price clor7b" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}"> | |
431 | + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}"> | |
432 | + <view style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}"> | |
433 | + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text class="pricefs28">{{aitem.price_n}}</text><text wx:if="{{aitem.price_xs}}">.{{aitem.price_xs}}</text></view> | |
434 | + <view wx:if="{{object.wholesale_price}}">¥{{aitem.shop_price}}</view> | |
435 | + </view> | |
436 | + </view> | |
437 | + <view> | |
438 | + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png?v=1'}}" style="width: 50rpx;height: 50rpx;"></image> | |
439 | + <!-- <view style="width: 90rpx;height: 50rpx;line-height: 50rpx;" wx:if="{{ 5<=object.purchase_button && object.purchase_button<=8 }}" class="{{'new_item1_but ' + (object.purchase_button==5 ? 'new_item1_but1':'' )+ (object.purchase_button==7 ? 'new_item1_but2':'' )+ (object.purchase_button==8 ? 'new_item1_but3':'' ) }}">{{object.button_content}}</view> --> | |
440 | + </view> | |
441 | + </view> | |
442 | + </navigator> | |
443 | + </view> | |
444 | + </swiper-item> | |
445 | + </swiper> | |
446 | + <!-- </swiper> --> | |
447 | + | |
448 | + </block> | |
449 | + | |
450 | + </block> | |
451 | + <block wx:else> | |
452 | + <!--秒杀--> | |
453 | + <view class='top' bindtap="go_to_skill"> | |
454 | + <view class="flex"> | |
455 | + <view class='t_left'></view> | |
456 | + <view class='t_ms'>秒杀</view> | |
457 | + </view> | |
458 | + <view class='right_k'> | |
459 | + <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
460 | + </view> | |
92 | 461 | </view> |
93 | - </swiper> | |
462 | + <!--商品展示--> | |
463 | + <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
464 | + <view class='sp' wx:if="{{object.style==1}}"> | |
465 | + <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
466 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
467 | + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> | |
468 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
469 | + <view class='one'> | |
470 | + <view class='sp_top'> | |
471 | + <view class='po'></view> | |
472 | + <block wx:if="{{aitem.status == 0}}"> | |
473 | + <view class="rob" style="justify-content: flex-start"> | |
474 | + <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
475 | + </view> | |
476 | + </block> | |
477 | + <block wx:if="{{aitem.status == 1}}"> | |
478 | + <view class="rob" style="justify-content: flex-start"> | |
479 | + <span class='s_top_kill'>火热进行</span> | |
480 | + </view> | |
481 | + </block> | |
482 | + <block wx:if="{{aitem.status == 2}}"> | |
483 | + <view class="rob" style="justify-content: flex-start"> | |
484 | + <span class='s_top_kill gray'>已抢光</span> | |
485 | + </view> | |
486 | + </block> | |
487 | + <block wx:if="{{aitem.status == 3}}"> | |
488 | + <view class="rob" style="justify-content: flex-start"> | |
489 | + <span class='s_top_kill gray'>活动已结束</span> | |
490 | + </view> | |
491 | + </block> | |
94 | 492 | |
95 | 493 | |
96 | - | |
97 | - <view class="sp2" wx:if="{{object.style==2}}"> | |
98 | - <block wx:for="{{goods_array}}"> | |
99 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
100 | - <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> | |
101 | - <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
102 | - <view class='one1'> | |
103 | 494 | |
104 | - <view class="o1_img"> | |
105 | - <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
106 | - </view> | |
495 | + <view class='clear'></view> | |
496 | + | |
497 | + <view class='s_img'> | |
498 | + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
499 | + </view> | |
107 | 500 | |
108 | - <view class="o1_right"> | |
109 | - <view class="sp_wzi ellipsis-2">{{aitem.goods_name}}</view> | |
110 | - <view class="o1_sj_kill"> | |
111 | - <text>{{aitem.djs.day}}</text> 天 | |
112 | - <text>{{aitem.djs.hou}}</text> : | |
113 | - <text>{{aitem.djs.min}}</text> : | |
114 | - <text>{{aitem.djs.sec}}</text> | |
501 | + <view class='s_foot_kill'> | |
502 | + <text>{{aitem.djs.day}}天</text> | |
503 | + <text>{{aitem.djs.hou}}时</text> | |
504 | + <text>{{aitem.djs.min}}分</text> | |
505 | + <text>{{aitem.djs.sec}}秒</text> | |
506 | + </view> | |
507 | + <view class='clear'></view> | |
508 | + | |
509 | + </view> | |
510 | + | |
511 | + <view class='sp_wz'> | |
512 | + <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> | |
513 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
514 | + <view wx:if="{{is_retail_price}}" class='sp_jgx ~no_line_x'>¥{{aitem.market_price}}</view> | |
515 | + </view> | |
115 | 516 | |
116 | 517 | </view> |
117 | - <view class="money"> | |
118 | - <view class='sp_jg'>¥{{aitem.price}}</view> | |
119 | -<!-- <view class='sp_jgx'>¥{{aitem.market_price}}</view>--> | |
518 | + </navigator> | |
519 | + </block> | |
520 | + </swiper-item> | |
521 | + </view> | |
522 | + </swiper> | |
523 | + <view class="sp2" wx:if="{{object.style==2}}"> | |
524 | + <block wx:for="{{goods_array}}"> | |
525 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
526 | + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> --> | |
527 | + <navigator url="{{aitem.goods_type == 1 ? ('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id ) : ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id)}}" class="s1_gk_a1"> | |
528 | + <view class='one1'> | |
529 | + | |
530 | + <view class="o1_img"> | |
531 | + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
120 | 532 | </view> |
121 | - <block wx:if="{{aitem.status == 0}}"> | |
122 | - <view class="rob"> | |
123 | - <view class="wo" style="background-color: #adadad">正在预热</view> | |
533 | + | |
534 | + <view class="o1_right"> | |
535 | + <view class="sp_wzi ellipsis-2">{{aitem.title}}</view> | |
536 | + <view class="o1_sj_kill"> | |
537 | + <text>{{aitem.djs.day}}</text> 天 | |
538 | + <text>{{aitem.djs.hou}}</text> : | |
539 | + <text>{{aitem.djs.min}}</text> : | |
540 | + <text>{{aitem.djs.sec}}</text> | |
541 | + | |
124 | 542 | </view> |
125 | - </block> | |
126 | - | |
127 | - <block wx:if="{{aitem.status == 3}}"> | |
128 | - <view class="rob"> | |
129 | - <view class="wo" style="background-color: #adadad">已结束</view> | |
130 | - </view> | |
131 | - </block> | |
132 | - <block wx:else> | |
133 | - <block wx:if="{{aitem.status == 1}}"> | |
134 | - <view class="rob"> | |
135 | - <view class="wo">我要抢</view> | |
136 | - </view> | |
137 | - </block> | |
138 | - | |
139 | - <block wx:if="{{aitem.status == 2}}"> | |
140 | - <view class="rob"> | |
141 | - <view class="wo" style="background-color: #adadad">已抢光</view> | |
142 | - </view> | |
143 | - </block> | |
144 | - </block> | |
543 | + <view class="money"> | |
544 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
545 | + <!-- <view class='sp_jgx'>¥{{aitem.market_price}}</view>--> | |
546 | + </view> | |
547 | + <block wx:if="{{aitem.status == 0}}"> | |
548 | + <view class="rob"> | |
549 | + <view class="wo" style="background-color: #adadad">正在预热</view> | |
550 | + </view> | |
551 | + </block> | |
552 | + | |
553 | + <block wx:if="{{aitem.status == 3}}"> | |
554 | + <view class="rob"> | |
555 | + <view class="wo" style="background-color: #adadad">已结束</view> | |
556 | + </view> | |
557 | + </block> | |
558 | + <block wx:else> | |
559 | + <block wx:if="{{aitem.status == 1}}"> | |
560 | + <view class="rob"> | |
561 | + <view class="wo">我要抢</view> | |
562 | + </view> | |
563 | + </block> | |
564 | + | |
565 | + <block wx:if="{{aitem.status == 2}}"> | |
566 | + <view class="rob"> | |
567 | + <view class="wo" style="background-color: #adadad">已抢光</view> | |
568 | + </view> | |
569 | + </block> | |
570 | + </block> | |
145 | 571 | |
146 | 572 | |
573 | + </view> | |
147 | 574 | </view> |
148 | - </view> | |
149 | - </navigator> | |
575 | + </navigator> | |
576 | + </block> | |
150 | 577 | </block> |
151 | - </block> | |
152 | - | |
153 | - </view> | |
154 | - <view class='clear'></view> | |
155 | 578 | |
579 | + </view> | |
580 | + <view class='clear'></view> | |
581 | + </block> | |
156 | 582 | </block> |
157 | 583 | \ No newline at end of file | ... | ... |
components/diy_seckill/diy_seckill.wxss
... | ... | @@ -11,7 +11,8 @@ |
11 | 11 | padding:0rpx 20rpx; |
12 | 12 | display: flex; |
13 | 13 | justify-content: space-between; |
14 | - font-size: 32rpx; | |
14 | + /* font-size: 32rpx; */ | |
15 | + font-size: 24rpx; | |
15 | 16 | } |
16 | 17 | |
17 | 18 | .s_it { |
... | ... | @@ -32,19 +33,22 @@ swiper { |
32 | 33 | } |
33 | 34 | |
34 | 35 | .right_k { |
35 | - width: 30rpx; | |
36 | + width: 93rpx; | |
37 | + color: #7b7b7b; | |
36 | 38 | } |
37 | 39 | .right_k image{ |
38 | - width: 30rpx; | |
39 | - height: 30rpx; | |
40 | + width: 20rpx; | |
41 | + height: 20rpx; | |
40 | 42 | } |
41 | 43 | .t_left { |
42 | 44 | width: 10rpx; |
43 | 45 | height: 38rpx; |
44 | - background: #c4182e; | |
46 | + background: #f23030; | |
45 | 47 | margin-right: 10rpx; |
46 | 48 | } |
47 | - | |
49 | +.n_t_ms{ | |
50 | + color:#f23030; | |
51 | +} | |
48 | 52 | |
49 | 53 | .sp { |
50 | 54 | min-height: 300rpx; |
... | ... | @@ -292,9 +296,218 @@ swiper { |
292 | 296 | |
293 | 297 | |
294 | 298 | .ellipsis-2 { |
299 | + | |
300 | + height: 110rpx; | |
295 | 301 | overflow: hidden; |
296 | 302 | text-overflow: ellipsis; |
297 | 303 | display: -webkit-box; |
298 | 304 | -webkit-box-orient: vertical; |
299 | 305 | -webkit-line-clamp: 2; |
300 | -} | |
301 | 306 | \ No newline at end of file |
307 | +} | |
308 | +.ellipsis-2n { | |
309 | + | |
310 | + /* height: 97rpx; */ | |
311 | + overflow: hidden; | |
312 | + text-overflow: ellipsis; | |
313 | + display: -webkit-box; | |
314 | + -webkit-box-orient: vertical; | |
315 | + -webkit-line-clamp: 2; | |
316 | +} | |
317 | +.pdlf10{ | |
318 | + padding: 0 10rpx; | |
319 | +} | |
320 | +.new_item1{ | |
321 | + width: 100%; | |
322 | + overflow: hidden; | |
323 | +} | |
324 | + | |
325 | +.new_item1_image{ | |
326 | + width: 100%; | |
327 | + /* max-width: 100%; | |
328 | + max-height: 100%; */ | |
329 | +} | |
330 | +.new_item1_time{ | |
331 | + height: 60rpx; | |
332 | + background: #f23030; | |
333 | + color: #fff; | |
334 | + /* font-size: 25rpx; */ | |
335 | + font-size: 24rpx; | |
336 | + display: flex; | |
337 | + justify-content: space-between; | |
338 | + align-items: center; | |
339 | + /* padding: 0rpx 30rpx; */ | |
340 | + | |
341 | +} | |
342 | +.new_item1_time image{ | |
343 | + width: 188rpx; | |
344 | + height: 52rpx; | |
345 | +} | |
346 | +.new_item1_goods_name{ | |
347 | + padding: 10rpx 10rpx 0rpx; | |
348 | + /* font-size: 26rpx; */ | |
349 | + font-size: 28rpx; | |
350 | + width: 100%; | |
351 | + box-sizing: border-box; | |
352 | + color: #333333; | |
353 | +} | |
354 | +.new_item1_price{ | |
355 | + display: flex; | |
356 | + /* padding: 0 10rpx; */ | |
357 | + align-items: center; | |
358 | + justify-content: space-between; | |
359 | + /* font-size: 26rpx; */ | |
360 | + font-size: 24rpx; | |
361 | + padding: 0 10rpx 10rpx; | |
362 | +} | |
363 | +.clor{ | |
364 | + /* color: rgba(196, 24, 45, 1); */ | |
365 | + color: #ec0022; | |
366 | +} | |
367 | +.clor7b{ | |
368 | + color: #7b7b7b; | |
369 | +} | |
370 | +.new_item1_but{ | |
371 | + width: 130rpx; | |
372 | + height: 60rpx; | |
373 | + color: #fff; | |
374 | + background-color: #f23030; | |
375 | + line-height: 60rpx; | |
376 | + text-align: center; | |
377 | + border-radius: 15rpx; | |
378 | +} | |
379 | +.new_item1_but1{ | |
380 | + border-radius: 50rpx !important; | |
381 | +} | |
382 | +.new_item1_but2{ | |
383 | + border-radius: 50rpx !important; | |
384 | + background-color: rgba(0, 0, 0, 0) !important; | |
385 | + color: #f23030 !important; | |
386 | + border: 1rpx solid #f23030 !important; | |
387 | +} | |
388 | +.new_item1_but3{ | |
389 | + background-color: rgba(0, 0, 0, 0) !important; | |
390 | + color: #f23030 !important; | |
391 | + border: 1rpx solid #f23030 !important; | |
392 | +} | |
393 | + | |
394 | + | |
395 | + | |
396 | + | |
397 | +.new_item1_box{ | |
398 | + /* padding-top: 17rpx; */ | |
399 | + width: 100%; | |
400 | + box-sizing: border-box; | |
401 | + overflow: hidden; | |
402 | +} | |
403 | + | |
404 | +.aborder{ | |
405 | + border: 1px solid #e8e8e8; | |
406 | +} | |
407 | +.bgf{ | |
408 | + background-color: #fff; | |
409 | +} | |
410 | +.boxsha{ | |
411 | + /* box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25); */ | |
412 | + /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ | |
413 | + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19); | |
414 | +} | |
415 | +.but_radius85{ | |
416 | + border-radius:289rpx; | |
417 | +} | |
418 | +.but_radius5{ | |
419 | + border-radius:8px; | |
420 | +} | |
421 | +.imgBox{ | |
422 | + position: relative; | |
423 | +} | |
424 | +.imgBox_img{ | |
425 | + position: absolute; | |
426 | + left: 0; | |
427 | + top: 0; | |
428 | + width: 74rpx; | |
429 | + height: 70rpx; | |
430 | + | |
431 | +} | |
432 | + | |
433 | +.aspect_ratio1{ | |
434 | + aspect-ratio:1/1; | |
435 | +} | |
436 | +.aspect_ratio2{ | |
437 | + aspect-ratio:16/9; | |
438 | +} | |
439 | +.aspect_ratio3{ | |
440 | + aspect-ratio:3/2; | |
441 | +} | |
442 | +.aspect_ratio4{ | |
443 | + aspect-ratio:3/4; | |
444 | +} | |
445 | +.container1 { | |
446 | + position: relative; | |
447 | + width:100%; | |
448 | + padding-top: 100%; | |
449 | + overflow: hidden; | |
450 | +} | |
451 | +.container2 { | |
452 | + position: relative; | |
453 | + width:100%; | |
454 | + padding-top: 56.25%; | |
455 | + overflow: hidden; | |
456 | +} | |
457 | +.container3 { | |
458 | + position: relative; | |
459 | + width:100%; | |
460 | + padding-top: 66.67%; | |
461 | + overflow: hidden; | |
462 | +} | |
463 | +.container4 { | |
464 | + position: relative; | |
465 | + width:100%; | |
466 | + padding-top: 133.33%; | |
467 | + overflow: hidden; | |
468 | + | |
469 | +} | |
470 | + | |
471 | +.images1 { | |
472 | + display: block; | |
473 | + position: absolute; | |
474 | + width: 100%; | |
475 | + height: 100%; | |
476 | + top: 0; | |
477 | + bottom: 0; | |
478 | + left: 0; | |
479 | + right: 0; | |
480 | + object-fit: cover; | |
481 | + | |
482 | +} | |
483 | + | |
484 | +.flex2{ | |
485 | + display: flex; | |
486 | + /* align-items: center; */ | |
487 | + justify-content: space-between; | |
488 | + flex-wrap: wrap; | |
489 | + box-sizing: border-box; | |
490 | +} | |
491 | +.flex2:after { | |
492 | + content: ""; | |
493 | + width: 30%; | |
494 | + height: 0px; | |
495 | + visibility: hidden; | |
496 | + } | |
497 | + | |
498 | + .boxpad{ | |
499 | + /* padding:11rpx 9rpx; */ | |
500 | + box-sizing: border-box; | |
501 | + } | |
502 | + .pricefs28{ | |
503 | + font-size: 28rpx !important; | |
504 | + } | |
505 | + .pricefs42{ | |
506 | + font-size: 42rpx !important; | |
507 | + } | |
508 | + .pricefs38{ | |
509 | + font-size: 38rpx !important; | |
510 | + } | |
511 | + .imgbox1{ | |
512 | + width: 60rpx; | |
513 | + height: 60rpx; | |
514 | + } | |
302 | 515 | \ No newline at end of file | ... | ... |
components/diy_video/diy_video.wxml
packageA/pages/cart2_ser/cart2_ser.js
... | ... | @@ -634,7 +634,7 @@ Page({ |
634 | 634 | }); |
635 | 635 | setTimeout(function () { |
636 | 636 | wx.reLaunch({ |
637 | - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, | |
637 | + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, | |
638 | 638 | }) |
639 | 639 | }, 1000) |
640 | 640 | |
... | ... | @@ -653,6 +653,7 @@ Page({ |
653 | 653 | |
654 | 654 | } |
655 | 655 | ) |
656 | + | |
656 | 657 | |
657 | 658 | // getApp().request.post("/api/weshop/order/pay/createRechargeOrder", { |
658 | 659 | // data: { | ... | ... |
packageA/pages/goodsInfo/buy_flash_normal.wxml
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
52 | 52 | <block wx:else> |
53 | 53 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
54 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
54 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
55 | 55 | </block> |
56 | 56 | </block> |
57 | 57 | <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -510,16 +510,7 @@ Page({ |
510 | 510 | }); |
511 | 511 | }; |
512 | 512 | // <---- 秒杀 |
513 | - | |
514 | - | |
515 | 513 | |
516 | - | |
517 | - | |
518 | - | |
519 | - | |
520 | - | |
521 | - | |
522 | - | |
523 | 514 | //------是否收藏---------- |
524 | 515 | await getApp().request.promiseGet("/api/weshop/goodscollect/page", { |
525 | 516 | data: { |
... | ... | @@ -1027,21 +1018,15 @@ Page({ |
1027 | 1018 | }); |
1028 | 1019 | is_ok=0; |
1029 | 1020 | return false; |
1030 | - }; | |
1031 | - }; | |
1032 | - | |
1033 | - | |
1034 | - }); | |
1035 | - | |
1036 | - | |
1037 | - | |
1038 | - }; | |
1039 | - }); | |
1021 | + } | |
1022 | + } | |
1023 | + }) | |
1024 | + | |
1025 | + } | |
1026 | + }) | |
1040 | 1027 | |
1041 | - }; | |
1042 | - | |
1043 | - | |
1044 | - }; | |
1028 | + } | |
1029 | + } | |
1045 | 1030 | |
1046 | 1031 | |
1047 | 1032 | if(!is_ok) return false; |
... | ... | @@ -3894,507 +3879,7 @@ Page({ |
3894 | 3879 | }); |
3895 | 3880 | }, |
3896 | 3881 | |
3897 | - | |
3898 | - | |
3899 | - | |
3900 | - | |
3901 | - | |
3902 | - | |
3903 | - //-- 加入购物的函数 -- | |
3904 | - add_cart_func: function (t) { | |
3905 | - var i = getApp().request; | |
3906 | - if (oo.user_id == null) { | |
3907 | - return s.my_warnning("还未登录!", 0, this); | |
3908 | - } | |
3909 | - | |
3910 | - if (!getApp().globalData.userInfo) { | |
3911 | - return s.my_warnning("还未登录!", 0, this); | |
3912 | - } | |
3913 | - | |
3914 | - var e = this, | |
3915 | - th = e, | |
3916 | - a = 0, | |
3917 | - o = this.data.sele_g; | |
3918 | - a = o.goods_id; | |
3919 | - | |
3920 | - //----------添加到购物车时,要判断限购数量,-------- | |
3921 | - e.get_buy_num(o, function (ee) { | |
3922 | - //---判断商品是否超出限购--- | |
3923 | - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
3924 | - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
3925 | - // wx.showModal({ | |
3926 | - // title: '提示', | |
3927 | - // content: '超出活动限购数量' | |
3928 | - // }); | |
3929 | - getApp().my_warnning('超出活动限购数量', 0, self); | |
3930 | - return false; | |
3931 | - } | |
3932 | - } | |
3933 | - //---判断商品是否超出活动限购--- | |
3934 | - if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { | |
3935 | - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
3936 | - // wx.showModal({ | |
3937 | - // title: '提示', | |
3938 | - // content: '超出活动限购数量' | |
3939 | - // }); | |
3940 | - getApp().my_warnning('超出活动限购数量', 0, self); | |
3941 | - return false; | |
3942 | - } | |
3943 | - } | |
3944 | - | |
3945 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
3946 | - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | |
3947 | - th.setData({ | |
3948 | - sto_sele_name: "" | |
3949 | - }); | |
3950 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
3951 | - | |
3952 | - //--------------此时操作的数据------------ | |
3953 | - var newd = { | |
3954 | - goods_id: o.goods_id, | |
3955 | - goods_num: th.data.goodsInputNum, | |
3956 | - pick_id: th.data.sto_sele_id, | |
3957 | - user_id: oo.user_id, | |
3958 | - store_id: th.data.stoid, | |
3959 | - goods_price: o.shop_price, | |
3960 | - member_goods_price: o.shop_price, | |
3961 | - goods_name: o.goods_name, | |
3962 | - goods_sn: o.goods_sn, | |
3963 | - sku: o.sku, | |
3964 | - prom_id: th.data.sele_g.prom_id, | |
3965 | - prom_type: th.data.sele_g.prom_type, | |
3966 | - }; | |
3967 | - | |
3968 | - //---是不是从收藏夹出来的--- | |
3969 | - if (th.data.c_guide_id) { | |
3970 | - newd['guide_id'] = th.data.c_guide_id; | |
3971 | - newd['guide_type'] = 2; | |
3972 | - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; | |
3973 | - } else { | |
3974 | - if (getApp().globalData.guide_id) { | |
3975 | - newd['guide_id'] = getApp().globalData.guide_id; | |
3976 | - newd['guide_type'] = 0; | |
3977 | - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; | |
3978 | - } | |
3979 | - } | |
3980 | - if(getApp().globalData.groupchat_id){ | |
3981 | - newd['groupchat_id'] = getApp().globalData.groupchat_id; | |
3982 | - } | |
3983 | - //让商品带上房间号 | |
3984 | - //让商品带上房间号 | |
3985 | - if (th.data.sys_switch.is_skuroom_id == 1) { | |
3986 | - if (th.data.data.goods_id == getApp().globalData.room_goods_id) { | |
3987 | - newd.room_id = getApp().globalData.room_id; | |
3988 | - } | |
3989 | - } else { | |
3990 | - if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id; | |
3991 | - } | |
3992 | - | |
3993 | - //如果是积分够,is_integral_normal就要有积分购普通购买字段 | |
3994 | - if (o.prom_type == 4) { | |
3995 | - newd.is_integral_normal = 1; | |
3996 | - } | |
3997 | - | |
3998 | - //如果有线下取价 | |
3999 | - if (o.offline_price) { | |
4000 | - newd.offline_price = o.offline_price; | |
4001 | - newd.pricing_type = o.pricing_type; | |
4002 | - } | |
4003 | - | |
4004 | - //-----如果是秒杀,团购,积分购,拼团----- | |
4005 | - if (th.data.prom_type == 1 || th.data.prom_type == 2) { | |
4006 | - | |
4007 | - if (th.data.openSpecModal_flash_normal) { | |
4008 | - | |
4009 | - newd.prom_type = 0; | |
4010 | - newd.prom_id = 0; | |
4011 | - | |
4012 | - //---如果是线下门店销售的时候--- | |
4013 | - if (th.data.sales_rules == 2) { | |
4014 | - var pick = th.get_pick_from_list(th.data.sto_sele_id) | |
4015 | - //---通过接口获取门店的线下库存信息-- | |
4016 | - getApp().request.get("/api/weshop/goods/getWareStorages", { | |
4017 | - data: { | |
4018 | - storageNos: pick.pickup_no, | |
4019 | - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), | |
4020 | - storeId: os.stoid | |
4021 | - }, | |
4022 | - success: function (res) { | |
4023 | - if (res.data.code == 0) { | |
4024 | - if (res.data.data.pageData.length > 0) { | |
4025 | - var CanOutQty = res.data.data.pageData[0].CanOutQty; | |
4026 | - if (CanOutQty < e.data.goodsInputNum) { | |
4027 | - return s.my_warnning("库存不足!", 0, th); | |
4028 | - } | |
4029 | - //在调一次接口,读取商品的预出库的数量,lock | |
4030 | - getApp().request.get("/api/weshop/order/ware/lock/page", { | |
4031 | - data: { | |
4032 | - store_id: os.stoid, | |
4033 | - wareId: th.data.sele_g.goods_id, | |
4034 | - storageId: pick.pickup_id, | |
4035 | - pageSize: 1000 | |
4036 | - }, | |
4037 | - success: function (res_data) { | |
4038 | - if (res_data.data.code == 0 && res_data.data.data.total > 0) { | |
4039 | - | |
4040 | - var lock = 0; | |
4041 | - for (var i in res_data.data.data.pageData) { | |
4042 | - lock += res_data.data.data.pageData[i].outQty; | |
4043 | - } | |
4044 | - | |
4045 | - if (CanOutQty <= lock) { | |
4046 | - return s.my_warnning("库存不足!", 0, th); | |
4047 | - } | |
4048 | - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); | |
4049 | - } else { | |
4050 | - th.add_cart_next(e, t, a, o, newd, CanOutQty); | |
4051 | - } | |
4052 | - } | |
4053 | - }) | |
4054 | - } else { | |
4055 | - return s.my_warnning("库存不足!", 0, th); | |
4056 | - } | |
4057 | - | |
4058 | - } | |
4059 | - } | |
4060 | - }) | |
4061 | - } else { | |
4062 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
4063 | - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
4064 | - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
4065 | - } | |
4066 | - | |
4067 | - return false; | |
4068 | - } | |
4069 | - | |
4070 | - | |
4071 | - newd.goods_price = th.data.prom_price; | |
4072 | - newd.member_goods_price = th.data.prom_price, | |
4073 | - newd.prom_type = th.data.prom_type; | |
4074 | - newd.prom_id = th.data.prom_id; | |
4075 | - | |
4076 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
4077 | - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
4078 | - | |
4079 | - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
4080 | - | |
4081 | - } else if (o.prom_type == 7) { | |
4082 | - | |
4083 | - //判断进行中的活动,是不是要判断线下库存 | |
4084 | - th.check_zh_acting(function (ee) { | |
4085 | - newd.prom_id = 0; | |
4086 | - newd.prom_type = 0; | |
4087 | - if (ee && th.data.sele_g.act) { | |
4088 | - newd.prom_id = th.data.sele_g.act.id; | |
4089 | - newd.prom_type = 7; | |
4090 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
4091 | - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
4092 | - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
4093 | - return false; | |
4094 | - } else { | |
4095 | - //---如果是线下门店销售的时候--- | |
4096 | - if (th.data.sales_rules == 2) { | |
4097 | - var pick = th.get_pick_from_list(th.data.sto_sele_id) | |
4098 | - //---通过接口获取门店的线下库存信息-- | |
4099 | - getApp().request.get("/api/weshop/goods/getWareStorages", { | |
4100 | - data: { | |
4101 | - storageNos: pick.pickup_no, | |
4102 | - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), | |
4103 | - storeId: os.stoid | |
4104 | - }, | |
4105 | - success: function (res) { | |
4106 | - if (res.data.code == 0) { | |
4107 | - if (res.data.data.pageData.length > 0) { | |
4108 | - var CanOutQty = res.data.data.pageData[0].CanOutQty; | |
4109 | - if (CanOutQty < e.data.goodsInputNum) { | |
4110 | - return s.my_warnning("库存不足!", 0, th); | |
4111 | - } | |
4112 | - //在调一次接口,读取商品的预出库的数量,lock | |
4113 | - getApp().request.get("/api/weshop/order/ware/lock/page", { | |
4114 | - data: { | |
4115 | - store_id: os.stoid, | |
4116 | - wareId: th.data.sele_g.goods_id, | |
4117 | - storageId: pick.pickup_id, | |
4118 | - pageSize: 1000 | |
4119 | - }, | |
4120 | - success: function (res_data) { | |
4121 | - if (res_data.data.code == 0 && res_data.data.data.total > 0) { | |
4122 | - | |
4123 | - var lock = 0; | |
4124 | - for (var i in res_data.data.data.pageData) { | |
4125 | - lock += res_data.data.data.pageData[i].outQty; | |
4126 | - } | |
4127 | - | |
4128 | - if (CanOutQty <= lock) { | |
4129 | - return s.my_warnning("库存不足!", 0, th); | |
4130 | - } | |
4131 | - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); | |
4132 | - } else { | |
4133 | - th.add_cart_next(e, t, a, o, newd, CanOutQty); | |
4134 | - } | |
4135 | - } | |
4136 | - }) | |
4137 | - } else { | |
4138 | - return s.my_warnning("库存不足!", 0, th); | |
4139 | - } | |
4140 | - | |
4141 | - } | |
4142 | - } | |
4143 | - }) | |
4144 | - } else { | |
4145 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
4146 | - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
4147 | - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
4148 | - } | |
4149 | - } | |
4150 | - }) | |
4151 | - | |
4152 | - } | |
4153 | - else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 4 || th.data.prom_type == 5 || th.data.prom_type == 10) { | |
4154 | - newd.prom_type = 0; | |
4155 | - newd.prom_id = 0; | |
4156 | - | |
4157 | - if (th.data.prom_type == 10) { | |
4158 | - newd.prom_type = th.data.prom_type; | |
4159 | - newd.prom_id = th.data.prom_id; | |
4160 | - } | |
4161 | - | |
4162 | - //---如果是线下门店销售的时候--- | |
4163 | - if (th.data.sales_rules == 2) { | |
4164 | - var pick = th.get_pick_from_list(th.data.sto_sele_id) | |
4165 | - //---通过接口获取门店的线下库存信息-- | |
4166 | - getApp().request.get("/api/weshop/goods/getWareStorages", { | |
4167 | - data: { | |
4168 | - storageNos: pick.pickup_no, | |
4169 | - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), | |
4170 | - storeId: os.stoid | |
4171 | - }, | |
4172 | - success: function (res) { | |
4173 | - if (res.data.code == 0) { | |
4174 | - if (res.data.data.pageData.length > 0) { | |
4175 | - var CanOutQty = res.data.data.pageData[0].CanOutQty; | |
4176 | - if (CanOutQty < e.data.goodsInputNum) { | |
4177 | - return s.my_warnning("库存不足!", 0, th); | |
4178 | - } | |
4179 | - //在调一次接口,读取商品的预出库的数量,lock | |
4180 | - getApp().request.get("/api/weshop/order/ware/lock/page", { | |
4181 | - data: { | |
4182 | - store_id: os.stoid, | |
4183 | - wareId: th.data.sele_g.goods_id, | |
4184 | - storageId: pick.pickup_id, | |
4185 | - pageSize: 1000 | |
4186 | - }, | |
4187 | - success: function (res_data) { | |
4188 | - if (res_data.data.code == 0 && res_data.data.data.total > 0) { | |
4189 | - | |
4190 | - var lock = 0; | |
4191 | - for (var i in res_data.data.data.pageData) { | |
4192 | - lock += res_data.data.data.pageData[i].outQty; | |
4193 | - } | |
4194 | - | |
4195 | - if (CanOutQty <= lock) { | |
4196 | - return s.my_warnning("库存不足!", 0, th); | |
4197 | - } | |
4198 | - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); | |
4199 | - } else { | |
4200 | - th.add_cart_next(e, t, a, o, newd, CanOutQty); | |
4201 | - } | |
4202 | - } | |
4203 | - }) | |
4204 | - } else { | |
4205 | - return s.my_warnning("库存不足!", 0, th); | |
4206 | - } | |
4207 | - | |
4208 | - } | |
4209 | - } | |
4210 | - }) | |
4211 | - } else { | |
4212 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
4213 | - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
4214 | - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
4215 | - } | |
4216 | - } | |
4217 | - }) | |
4218 | - }, | |
4219 | - | |
4220 | - //---加入购物车的最后一步--- | |
4221 | - add_cart_next(e, t, a, o, newd, CanOutQty) { | |
4222 | - var th = this, i = getApp().request; | |
4223 | - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | |
4224 | - if ((o.prom_type != 1 || o.prom_id <= 0) && ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 ) || th.data.is_normal)) { | |
4225 | - var conf = th.data.bconfig; | |
4226 | - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { | |
4227 | - var s_list = JSON.parse(conf.switch_list); | |
4228 | - var now = ut.gettimestamp(); | |
4229 | - | |
4230 | - | |
4231 | - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/'); | |
4232 | - var end = new Date(str); | |
4233 | - end = Date.parse(end) / 1000; | |
4234 | - | |
4235 | - //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下-- | |
4236 | - if (parseInt(s_list.rank_switch) == 2 && end > now) { | |
4237 | - var card_price = o[getApp().globalData.userInfo['card_field']]; | |
4238 | - //如果会员有等级价 | |
4239 | - if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null | |
4240 | - && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) { | |
4241 | - newd.goods_price = card_price; | |
4242 | - newd.member_goods_price = card_price; | |
4243 | - } | |
4244 | - } | |
4245 | - } | |
4246 | - } | |
4247 | - | |
4248 | - //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); | |
4249 | - if ("add" == t.currentTarget.dataset.action) { | |
4250 | - | |
4251 | - if (th.data.prom_goods) { | |
4252 | - newd.prom_type = 3; | |
4253 | - newd.prom_id = th.data.prom_goods[0].prom_id; | |
4254 | - } | |
4255 | - | |
4256 | - //----先看会员在购物车中是否加入了该商品----- | |
4257 | - i.get("/api/weshop/cart/page", { | |
4258 | - data: { | |
4259 | - store_id: e.data.stoid, | |
4260 | - user_id: oo.user_id, | |
4261 | - goods_id: a, | |
4262 | - pick_id: e.data.sto_sele_id, | |
4263 | - prom_type:(newd.prom_type?newd.prom_type:0), | |
4264 | - state: 0 | |
4265 | - }, | |
4266 | - success: function (re) { | |
4267 | - | |
4268 | - //-------如果购物车中有相关的数据--------- | |
4269 | - if (re.data.data.total > 0) { | |
4270 | - | |
4271 | - var item = re.data.data.pageData[0]; | |
4272 | - | |
4273 | - //判断数量,要看下购物车中有没有该商品 | |
4274 | - if (CanOutQty) { | |
4275 | - if (item.goods_num + th.data.goodsInputNum > CanOutQty) { | |
4276 | - return s.my_warnning("库存不足!", 0, th); | |
4277 | - } | |
4278 | - } else { | |
4279 | - if (item.goods_num + th.data.goodsInputNum > o.store_count) { | |
4280 | - return s.my_warnning("库存不足!", 0, th); | |
4281 | - } | |
4282 | - } | |
4283 | - | |
4284 | - var updata = { | |
4285 | - id: item.id, | |
4286 | - goods_num: e.data.goodsInputNum + item.goods_num, | |
4287 | - goods_price: newd.goods_price, | |
4288 | - member_goods_price: newd.goods_price, | |
4289 | - store_id: th.data.stoid, | |
4290 | - }; | |
4291 | - | |
4292 | - //---是不是从收藏夹出来的--- | |
4293 | - if (th.data.c_guide_id) { | |
4294 | - updata['guide_id'] = th.data.c_guide_id; | |
4295 | - updata['guide_type'] = 3; //加入购物车之后就变成了3 | |
4296 | - } else { | |
4297 | - if (getApp().globalData.guide_id) { | |
4298 | - updata['guide_id'] = getApp().globalData.guide_id; | |
4299 | - updata['guide_type'] = 0; | |
4300 | - } | |
4301 | - } | |
4302 | - if(getApp().globalData.groupchat_id){ | |
4303 | - updata['groupchat_id'] = getApp().globalData.groupchat_id; | |
4304 | - } | |
4305 | - i.put("/api/weshop/cart/update", { | |
4306 | - data: updata, | |
4307 | - success: function (t) { | |
4308 | - getApp().my_warnning('加入购物车成功', 1, th, 450); | |
4309 | - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | |
4310 | - th.setData({ | |
4311 | - cartGoodsNum: c_num | |
4312 | - }); | |
4313 | - th.closeSpecModal(); | |
4314 | - } | |
4315 | - }); | |
4316 | - } else { | |
4317 | - | |
4318 | - | |
4319 | - i.post("/api/weshop/cart/save", { | |
4320 | - data: newd, | |
4321 | - success: function (t) { | |
4322 | - getApp().my_warnning('加入购物车成功', 1, th, 450); | |
4323 | - var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; | |
4324 | - th.setData({ | |
4325 | - cartGoodsNum: c_num | |
4326 | - }); | |
4327 | - th.closeSpecModal(); | |
4328 | - } | |
4329 | - }); | |
4330 | - } | |
4331 | - } | |
4332 | - }); | |
4333 | - | |
4334 | - } | |
4335 | - else { | |
4336 | - | |
4337 | - //这一步主要是要让立即购买 走 购物车的逻辑 参与活动 | |
4338 | - if (newd.prom_type == 10 || newd.prom_type == 7) { | |
4339 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
4340 | - getApp().request.get("/api/weshop/cart/page", { | |
4341 | - data: { | |
4342 | - store_id: e.data.stoid, | |
4343 | - user_id: oo.user_id, | |
4344 | - state: 1 | |
4345 | - }, | |
4346 | - success: function (res) { | |
4347 | - //-------如果购物车中有相关的数据--------- | |
4348 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
4349 | - for (let j in res.data.data.pageData) { | |
4350 | - let item_j = res.data.data.pageData[j]; | |
4351 | - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
4352 | - getApp().request.delete(url, {}); | |
4353 | - } | |
4354 | - } | |
4355 | - newd.state = 1; | |
4356 | - getApp().request.post("/api/weshop/cart/save", { | |
4357 | - data: newd, | |
4358 | - success: function (t) { | |
4359 | - th.closeSpecModal(); | |
4360 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
4361 | - } | |
4362 | - }); | |
4363 | - }, | |
4364 | - }) | |
4365 | - return false; | |
4366 | - } | |
4367 | - | |
4368 | - if (th.data.prom_goods) { | |
4369 | - var prom_d = th.data.prom_goods; | |
4370 | - for (var i in prom_d) { | |
4371 | - //判断活动有俩种条件,0元 1件 | |
4372 | - var condition_t = prom_d[i].prom_type; | |
4373 | - switch (condition_t) { | |
4374 | - case 0: //按钱 | |
4375 | - if (newd.goods_price >= condition_t) { | |
4376 | - newd.prom_type = 3; | |
4377 | - newd.prom_id = prom_d[i].prom_id; | |
4378 | - } | |
4379 | - break | |
4380 | - case 1://按购买数量 | |
4381 | - if (newd.goods_num >= condition_t) { | |
4382 | - newd.prom_type = 3; | |
4383 | - newd.prom_id = prom_d[i].prom_id; | |
4384 | - } | |
4385 | - break; | |
4386 | - } | |
4387 | - } | |
4388 | - | |
4389 | - } | |
4390 | - | |
4391 | - newd['pick_name'] = th.data.sto_sele_name; | |
4392 | - newd['pick_dis'] = th.data.sto_sele_distr; | |
4393 | - th.buyNow(newd); | |
4394 | - } | |
4395 | - }, | |
4396 | - | |
4397 | - | |
3882 | + | |
4398 | 3883 | click_contact:function () { |
4399 | 3884 | getApp().globalData.no_clear=1; |
4400 | 3885 | }, | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxml
... | ... | @@ -638,6 +638,7 @@ |
638 | 638 | |
639 | 639 | <!-- 弹起来,选择规格数量,普通商品购买和秒杀 --> |
640 | 640 | <view hidden="{{!openSpecModal}}"> |
641 | + | |
641 | 642 | <view bindtap="closeSpecModal" class="cover-layer"></view> |
642 | 643 | <view class="spec-model"> |
643 | 644 | <view class="pding"> |
... | ... | @@ -685,7 +686,7 @@ |
685 | 686 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
686 | 687 | <block wx:else> |
687 | 688 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
688 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
689 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
689 | 690 | </block> |
690 | 691 | </block> |
691 | 692 | |
... | ... | @@ -716,7 +717,6 @@ |
716 | 717 | </block> |
717 | 718 | <block wx:else> |
718 | 719 | |
719 | - | |
720 | 720 | <block wx:if="{{only_pk.length && !only_pk.length}}"> |
721 | 721 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> |
722 | 722 | </block> |
... | ... | @@ -724,29 +724,33 @@ |
724 | 724 | <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> |
725 | 725 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
726 | 726 | </block> |
727 | + | |
727 | 728 | <block wx:else> |
728 | 729 | <block wx:if="{{!def_pick_store}}"> |
730 | + | |
729 | 731 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
730 | 732 | </block> |
731 | 733 | <block wx:else> |
732 | - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> | |
733 | - <block wx:if="{{sales_rules==2 && prom_type==0}}"> | |
734 | - <block wx:if="{{!def_pick_store.CanOutQty}}"> | |
735 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
736 | - </block> | |
737 | - <block wx:else> | |
738 | - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view> | |
739 | - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy"> | |
740 | - {{sele_g.offline_price?"券后购买":"立即购买"}} | |
741 | - </view> | |
742 | - </block> | |
743 | - </block> | |
744 | - <!-- 线上销售 --> | |
745 | - <block wx:else> | |
746 | - <block wx:if="{{sele_g.store_count<=0}}"> | |
747 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
748 | - </block> | |
749 | - <block wx:else> | |
734 | + | |
735 | + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 ,因为服务卡项没有线下库存,所以取消--> | |
736 | +<!-- <block wx:if="{{sales_rules>=2 && prom_type==0}}">--> | |
737 | +<!-- <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num}}">--> | |
738 | +<!-- <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>--> | |
739 | +<!-- </block>--> | |
740 | +<!-- <block wx:else>--> | |
741 | +<!-- <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>--> | |
742 | +<!-- <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">--> | |
743 | +<!-- {{sele_g.offline_price?"券后购买":"立即购买"}}--> | |
744 | +<!-- </view>--> | |
745 | +<!-- </block>--> | |
746 | +<!-- </block>--> | |
747 | + | |
748 | + <!-- 线上销售,也没有线上库存 --> | |
749 | +<!-- <block wx:else>--> | |
750 | +<!-- <block wx:if="{{sele_g.store_count<=0}}">--> | |
751 | +<!-- <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>--> | |
752 | +<!-- </block>--> | |
753 | +<!-- <block wx:else>--> | |
750 | 754 | <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32 {{!sto_sele_name?'gray':''}}" |
751 | 755 | data-action="add">加入购物车</view> |
752 | 756 | <!-- 秒杀 --> |
... | ... | @@ -765,8 +769,8 @@ |
765 | 769 | </view> |
766 | 770 | </block> |
767 | 771 | |
768 | - </block> | |
769 | - </block> | |
772 | +<!-- </block>--> | |
773 | +<!-- </block>--> | |
770 | 774 | </block> |
771 | 775 | </block> |
772 | 776 | </block> |
... | ... | @@ -958,7 +962,7 @@ |
958 | 962 | <text class="iconfont icon-guan" bindtap="closeCS"></text> |
959 | 963 | </view> |
960 | 964 | <!-- 客服热线 --> |
961 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService"> | |
965 | + <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | |
962 | 966 | <text class="iconfont icon-dianhua"></text>客服热线: |
963 | 967 | <text class="c-red">{{store_tel}}</text> |
964 | 968 | </view> | ... | ... |
packageA/pages/profile/profile.js
... | ... | @@ -77,7 +77,8 @@ Page({ |
77 | 77 | lat: null, //维度 |
78 | 78 | lon: null, //经度 |
79 | 79 | loading: 0, |
80 | - | |
80 | + oldBirtthDayLength:0, //生日日期个数 | |
81 | + oldbirthday:'',//生日日期 | |
81 | 82 | }, |
82 | 83 | //通过路径跳转到其他页面 |
83 | 84 | goto: function (e) { |
... | ... | @@ -474,7 +475,16 @@ Page({ |
474 | 475 | choice_sort_store: 0 |
475 | 476 | }); |
476 | 477 | }, |
477 | - | |
478 | + // 获取用户头像昵称 | |
479 | + getUserProfile(e) { | |
480 | + var th = this; | |
481 | + var ob={ | |
482 | + nickname:this.data.nickname, | |
483 | + head_pic:this.data.head_pic, | |
484 | + } | |
485 | + getApp().globalData.up_nick_avatar=ob; | |
486 | + getApp().goto('/packageE/pages/user/nick_avatar_add/nick_avatar_add'); | |
487 | + }, | |
478 | 488 | |
479 | 489 | //身份证号严格校验 |
480 | 490 | IdentityIDCard: function (e) { |
... | ... | @@ -783,6 +793,13 @@ Page({ |
783 | 793 | choice_guide = JSON.parse(JSON.stringify(getApp().globalData.choice_guide)); |
784 | 794 | getApp().globalData.choice_guide = null; |
785 | 795 | } |
796 | + //获取头像和昵称 | |
797 | + let nick_obj = wx.getStorageSync('nick_obj') | |
798 | + if (nick_obj && nick_obj.head_pic && nick_obj.nickname) { | |
799 | + this.setData({head_pic: nick_obj.head_pic, nickname: nick_obj.nickname}) | |
800 | + wx.removeStorageSync('nick_obj') | |
801 | + } | |
802 | + | |
786 | 803 | |
787 | 804 | }, |
788 | 805 | getIsBool(){ |
... | ... | @@ -1126,20 +1143,86 @@ Page({ |
1126 | 1143 | let address = this.getInput(e); |
1127 | 1144 | this.data.address = address; |
1128 | 1145 | }, |
1129 | - | |
1146 | + //获取生日 | |
1147 | + getbind(e) { | |
1148 | + console.log("获取生日222222222"); | |
1149 | + console.log(e); | |
1150 | + let b = this.getInput(e); | |
1151 | + let reg=/^[0-9\-]*$/ | |
1152 | + if (!(reg.test(b))){ | |
1153 | + return this.data.oldbirthday | |
1154 | + } | |
1155 | + let length = b.length; | |
1156 | + let oldBirtthDayLength=this.data.oldBirtthDayLength | |
1157 | + if (length > oldBirtthDayLength) { | |
1158 | + if (b.length==4) { | |
1159 | + b+='-' | |
1160 | + } | |
1161 | + if (b.length==7) { | |
1162 | + b+='-' | |
1163 | + } | |
1164 | + // if (b.length==6 && b[5] >1) { | |
1165 | + // console.log(b[5]); | |
1166 | + | |
1167 | + // } | |
1168 | + } | |
1169 | + this.setData({ | |
1170 | + datet: b, | |
1171 | + oldBirtthDayLength:length, | |
1172 | + oldbirthday:b | |
1173 | + }); | |
1174 | + }, | |
1130 | 1175 | //获取生日 |
1131 | 1176 | bindChange: function (e) { |
1177 | + console.log("获取生日11111111"); | |
1178 | + console.log(e); | |
1132 | 1179 | let strBirthday = e.detail.value; |
1133 | 1180 | let age = this.verifyBirthday(strBirthday); |
1134 | 1181 | |
1135 | 1182 | if (age <= 10) { |
1136 | 1183 | app.my_warnning("会员年龄不能小于10岁(含10岁)", 0, this); |
1184 | + this.setData({ | |
1185 | + datet: '', | |
1186 | + }); | |
1137 | 1187 | } else if (age >= 70) { |
1138 | 1188 | app.my_warnning("会员年龄不能超过70岁(含70岁)", 0, this); |
1139 | - } else { | |
1140 | 1189 | this.setData({ |
1141 | - datet: e.detail.value, | |
1142 | - }); | |
1190 | + datet: '', | |
1191 | + }); | |
1192 | + } else { | |
1193 | + let value = e.detail.value | |
1194 | + | |
1195 | + if (value.length==8) { | |
1196 | + value+='01' | |
1197 | + } | |
1198 | + if (value.length==7) { | |
1199 | + value+='-01' | |
1200 | + } | |
1201 | + if (value.length==9) { | |
1202 | + let ov=value[value.length-1] | |
1203 | + let nv=value.slice(0,-1) | |
1204 | + if (ov==0) { | |
1205 | + nv+='01' | |
1206 | + }else{ | |
1207 | + nv+='0'+ov | |
1208 | + } | |
1209 | + value=nv | |
1210 | + } | |
1211 | + // let reg= /^(\d{4})-(\d{2})-(\d{2})$/; | |
1212 | + let reg= /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/ | |
1213 | + console.log('日期验证'); | |
1214 | + console.log(value); | |
1215 | + console.log(reg.test(value)); | |
1216 | + if (reg.test(value)) { | |
1217 | + this.setData({ | |
1218 | + datet: value, | |
1219 | + }); | |
1220 | + }else{ | |
1221 | + app.my_warnning("出生日期格式不对", 0, this); | |
1222 | + this.setData({ | |
1223 | + datet: '', | |
1224 | + }); | |
1225 | + } | |
1143 | 1226 | } |
1144 | 1227 | |
1145 | 1228 | }, |
... | ... | @@ -1304,7 +1387,10 @@ Page({ |
1304 | 1387 | app.my_warnning("请您先阅读和勾选指定的内容", 0, this); |
1305 | 1388 | return false; |
1306 | 1389 | } |
1307 | - | |
1390 | + let uu = getApp().globalData.zc_dd; | |
1391 | + uu.head_pic=this.data.head_pic | |
1392 | + uu.nickname=this.data.nickname | |
1393 | + getApp().globalData.zc_dd=uu | |
1308 | 1394 | var post_data = {...getApp().globalData.zc_dd, ...data}; |
1309 | 1395 | |
1310 | 1396 | delete post_data.sessionKey; | ... | ... |
packageA/pages/profile/profile.wxml
... | ... | @@ -17,8 +17,9 @@ |
17 | 17 | </view> |
18 | 18 | </view> |
19 | 19 | </view> |
20 | + | |
20 | 21 | </view> |
21 | - | |
22 | + <button bindtap="getUserProfile" style="margin-left:10rpx;float:left;width: 50rpx;height:50rpx;font-size:20rpx;background:rgba(217, 81, 99, 0.9);" class="flex-center fs30 confirmtext"><text class="iconfont icon-tongbu"></text></button> | |
22 | 23 | </view> |
23 | 24 | </view> |
24 | 25 | |
... | ... | @@ -50,7 +51,7 @@ |
50 | 51 | <!-- 如果需要接姓名信息 --> |
51 | 52 | <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}"> |
52 | 53 | <view class="user-name-txt">姓名:</view> |
53 | - <input bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/> | |
54 | + <input maxlength="10" bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/> | |
54 | 55 | <block wx:if="{{!user['vipname']}}"> |
55 | 56 | <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view> |
56 | 57 | <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view> |
... | ... | @@ -90,14 +91,16 @@ |
90 | 91 | <view class="shrink0">出生日期:</view> |
91 | 92 | <view class="flex fs28 Birth pdl20 jc_fe"> |
92 | 93 | <view class="user-txt-right pdl20 flex ai-center"> |
93 | - <checkbox-group bindchange="isLunar"> | |
94 | + <input bindinput="getbind" bindblur="bindChange" maxlength="10" type="text" value="{{datet}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入出生日期"></input> | |
95 | + <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> | |
96 | + <!-- <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view> --> | |
97 | + <image src="{{iurl}}/miniapp/images/calendar.png" style="width: 40rpx;height: 40rpx;"></image> | |
98 | + </picker> | |
99 | + <checkbox-group bindchange="isLunar" class="pdl20"> | |
94 | 100 | <label class="flex ai-center"> |
95 | 101 | <checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历 |
96 | 102 | </label> |
97 | 103 | </checkbox-group> |
98 | - <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> | |
99 | - <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view> | |
100 | - </picker> | |
101 | 104 | |
102 | 105 | |
103 | 106 | </view> | ... | ... |
packageA/pages/prom_list/prom_list.js
... | ... | @@ -351,7 +351,7 @@ Page({ |
351 | 351 | |
352 | 352 | //获取统一条形码,普通商品和优惠促销的商品 |
353 | 353 | //默认门店要拿下门店库存 |
354 | - if (that.data.sales_rules >= 2) { | |
354 | + if (!getApp().is_virtual(t.data.data) && !t.data.data.whsle_id && that.data.sales_rules >= 2) { | |
355 | 355 | //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存 |
356 | 356 | getApp().waitfor2(that, "wait_for_user_store", "fir_def_store", function () { |
357 | 357 | |
... | ... | @@ -1622,12 +1622,12 @@ Page({ |
1622 | 1622 | var plist=null; |
1623 | 1623 | var lock=0; |
1624 | 1624 | |
1625 | - //---如果是活动的时候--- | |
1626 | - if(th.data.prom_type==1 || th.data.prom_type==6){ | |
1625 | + //---如果是活动的时候,或者是虚拟商品的时候--- | |
1626 | + if(th.data.prom_type==1 || th.data.prom_type==6 || getApp().is_virtual(goodsinfo)){ | |
1627 | 1627 | func(); return false; |
1628 | 1628 | } |
1629 | 1629 | |
1630 | - if(this.data.sales_rules!=2){ | |
1630 | + if(this.data.sales_rules<2){ | |
1631 | 1631 | func(); |
1632 | 1632 | }else{ |
1633 | 1633 | ... | ... |
packageA/pages/prom_list/prom_list.wxml
... | ... | @@ -113,7 +113,7 @@ |
113 | 113 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
114 | 114 | <block wx:else> |
115 | 115 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> |
116 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}">(库存不足)</view> | |
116 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}">(库存不足)</view> | |
117 | 117 | </block> |
118 | 118 | </block> |
119 | 119 | |
... | ... | @@ -160,9 +160,8 @@ |
160 | 160 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
161 | 161 | </block> |
162 | 162 | <block wx:else> |
163 | - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> | |
163 | + <!-- 如果是线下库存购买的时候, 此时不要计算起订量--> | |
164 | 164 | <block wx:if="{{sales_rules>=2}}"> |
165 | - | |
166 | 165 | <block wx:if="{{!def_pick_store.CanOutQty}}"> |
167 | 166 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
168 | 167 | </block> | ... | ... |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
... | ... | @@ -926,7 +926,7 @@ |
926 | 926 | <text class="iconfont icon-guan" bindtap="closeCS"></text> |
927 | 927 | </view> |
928 | 928 | <!-- 客服热线 --> |
929 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService"> | |
929 | + <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | |
930 | 930 | <text class="iconfont icon-dianhua"></text>客服热线: |
931 | 931 | <text class="c-red">{{store_tel}}</text> |
932 | 932 | </view> | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... | ... | @@ -25,12 +25,14 @@ |
25 | 25 | <block wx:if="{{is_normal==1}}"> |
26 | 26 | <view class="flex"> |
27 | 27 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
28 | - <block wx:if="{{sales_rules>=2}}"> | |
29 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | |
30 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
31 | - </block> | |
32 | - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | |
33 | - </view> | |
28 | + <block wx:if="{{sales_rules>=2}}"> | |
29 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
30 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | |
31 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
32 | + </block> | |
33 | + </block> | |
34 | + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | |
35 | + </view> | |
34 | 36 | </block> |
35 | 37 | <!-- <block wx:if="{{is_normal==0}}"> |
36 | 38 | <view class="flex"> |
... | ... | @@ -70,8 +72,8 @@ |
70 | 72 | </view> |
71 | 73 | </view> |
72 | 74 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
73 | - <view class="no_store" wx:elif="{{is_normal && def_pick_store && def_pick_store.CanOutQty<=0}}">(库存不足)</view> | |
74 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.pickup_name}}">地址:{{def_pick_store.fulladdress}}</view> | |
75 | + <view class="no_store" wx:elif="{{is_normal && def_pick_store && def_pick_store.CanOutQty<=0 && !filters.is_virtual_gd(sele_g.is_virtual) }}">(库存不足)</view> | |
76 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.pickup_name}}">地址:{{def_pick_store.fulladdress}}</view> | |
75 | 77 | </view> |
76 | 78 | <!----商品的属性项目----> |
77 | 79 | <view> |
... | ... | @@ -119,7 +121,7 @@ |
119 | 121 | <view class="count"> |
120 | 122 | <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view> |
121 | 123 | <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}" disabled></input> |
122 | - <view bindtap="" class="sub active">+</view> | |
124 | + <view bindtap="addCartNum" class="sub active">+</view> | |
123 | 125 | </view> |
124 | 126 | </view> |
125 | 127 | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -575,7 +575,9 @@ Page({ |
575 | 575 | var that = this, th = this; |
576 | 576 | getApp().getConfig2(function (e) { |
577 | 577 | var sales_rules = e.sales_rules; |
578 | - if (sales_rules >= 2) { | |
578 | + | |
579 | + //虚拟商品, 代发商品不计算 | |
580 | + if (!that.data.fir_goods.whsle_id && sales_rules >= 2) { | |
579 | 581 | getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () { |
580 | 582 | var lock = 0, plist = null; |
581 | 583 | var gd = that.data.fir_goods; |
... | ... | @@ -1044,7 +1046,7 @@ Page({ |
1044 | 1046 | |
1045 | 1047 | //-- 把商品的赋值 -- |
1046 | 1048 | ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); |
1047 | - if (ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6) | |
1049 | + if (ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 9) | |
1048 | 1050 | ee.check_is_youhui(ee.data.gid); |
1049 | 1051 | |
1050 | 1052 | t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); |
... | ... | @@ -1570,7 +1572,7 @@ Page({ |
1570 | 1572 | // title: '提示', |
1571 | 1573 | // content: '超出商品限购' |
1572 | 1574 | // }); |
1573 | - getApp().my_warnning('超出商品限购', 0, th); | |
1575 | + getApp().my_warnning('超出商品限购', 0, th); | |
1574 | 1576 | return false; |
1575 | 1577 | } |
1576 | 1578 | } |
... | ... | @@ -1581,7 +1583,7 @@ Page({ |
1581 | 1583 | // title: '提示', |
1582 | 1584 | // content: '超出商品活动限购' |
1583 | 1585 | // }); |
1584 | - getApp().my_warnning('超出商品活动限购', 0, th); | |
1586 | + getApp().my_warnning('超出商品活动限购', 0, th); | |
1585 | 1587 | return false; |
1586 | 1588 | } |
1587 | 1589 | } |
... | ... | @@ -1672,7 +1674,7 @@ Page({ |
1672 | 1674 | return false; |
1673 | 1675 | } else { |
1674 | 1676 | //---如果是线下门店销售的时候--- |
1675 | - if (th.data.sales_rules >= 2) { | |
1677 | + if(!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { | |
1676 | 1678 | var pick = th.get_pick_from_list(th.data.sto_sele_id) |
1677 | 1679 | //---通过接口获取门店的线下库存信息-- |
1678 | 1680 | // getApp().request.get("/api/weshop/goods/getWareStorages", { |
... | ... | @@ -1748,45 +1750,9 @@ Page({ |
1748 | 1750 | newd.prom_id = 0; |
1749 | 1751 | |
1750 | 1752 | //---如果是线下门店销售的时候--- |
1751 | - if (th.data.sales_rules >= 2) { | |
1753 | + if(!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { | |
1752 | 1754 | var pick = th.get_pick_from_list(th.data.sto_sele_id) |
1753 | - //---通过接口获取门店的线下库存信息-- | |
1754 | - // getApp().request.get("/api/weshop/goods/getWareStorages", { | |
1755 | - // data: { storageNos: pick.pickup_no, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid }, | |
1756 | - // success: function (res) { | |
1757 | - // if (res.data.code == 0) { | |
1758 | - // if (res.data.data.pageData.length > 0) { | |
1759 | - // var CanOutQty = res.data.data.pageData[0].CanOutQty; | |
1760 | - // if (CanOutQty < e.data.goodsInputNum) { | |
1761 | - // return s.my_warnning("库存不足!", 0, th); | |
1762 | - // } | |
1763 | - // //在调一次接口,读取商品的预出库的数量,lock | |
1764 | - // getApp().request.get("/api/weshop/order/ware/lock/page", { | |
1765 | - // data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, storageId: pick.pickup_id, pageSize: 1000 }, | |
1766 | - // success: function (res_data) { | |
1767 | - // if (res_data.data.code == 0 && res_data.data.data.total > 0) { | |
1768 | - // | |
1769 | - // var lock = 0; | |
1770 | - // for (var i in res_data.data.data.pageData) { | |
1771 | - // lock += res_data.data.data.pageData[i].outQty; | |
1772 | - // } | |
1773 | - // | |
1774 | - // if (CanOutQty <= lock) { | |
1775 | - // return s.my_warnning("库存不足!", 0, th); | |
1776 | - // } | |
1777 | - // th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); | |
1778 | - // } else { | |
1779 | - // th.add_cart_next(e, t, a, o, newd, CanOutQty); | |
1780 | - // } | |
1781 | - // } | |
1782 | - // }) | |
1783 | - // } else { | |
1784 | - // return s.my_warnning("库存不足!", 0, th); | |
1785 | - // } | |
1786 | - // | |
1787 | - // } | |
1788 | - // } | |
1789 | - // }) | |
1755 | + | |
1790 | 1756 | |
1791 | 1757 | |
1792 | 1758 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { |
... | ... | @@ -2188,11 +2154,19 @@ Page({ |
2188 | 2154 | |
2189 | 2155 | //----------增加购买数量----------- |
2190 | 2156 | addCartNum: function (t) { |
2191 | - this.checkCartNum(this.data.goodsInputNum + 1); | |
2157 | + var add_num=1; | |
2158 | + if(this.data.is_normal == 1){ | |
2159 | + add_num=getApp().get_limit_qty(this.data.sele_g,this.data.is_act,1); | |
2160 | + } | |
2161 | + this.checkCartNum(this.data.goodsInputNum + add_num); | |
2192 | 2162 | }, |
2193 | 2163 | //----------减少购买数量----------- |
2194 | 2164 | subCartNum: function (t) { |
2195 | - this.checkCartNum(this.data.goodsInputNum - 1); | |
2165 | + var add_num=1; | |
2166 | + if(this.data.is_normal == 1){ | |
2167 | + add_num=getApp().get_limit_qty(this.data.sele_g,this.data.is_act,1); | |
2168 | + } | |
2169 | + this.checkCartNum(this.data.goodsInputNum - add_num); | |
2196 | 2170 | }, |
2197 | 2171 | //----------输入框输入购买数量----------- |
2198 | 2172 | inputCartNum: function (t) { |
... | ... | @@ -2216,8 +2190,14 @@ Page({ |
2216 | 2190 | //------检查数量是不是超出限购------ |
2217 | 2191 | checkCartNum: function (t) { |
2218 | 2192 | var th = this; |
2193 | + var mo_num=getApp().get_limit_qty(th.data.sele_g,th.data.is_act); | |
2194 | + var steep=getApp().get_limit_qty(th.data.sele_g,th.data.is_act,1); | |
2195 | + | |
2219 | 2196 | this.get_buy_num(this.data.sele_g, async function () { |
2220 | 2197 | |
2198 | + | |
2199 | + var is_show_bs=0; | |
2200 | + var l_num=-1; | |
2221 | 2201 | //--判断商品是否超出限购-- |
2222 | 2202 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
2223 | 2203 | |
... | ... | @@ -2228,10 +2208,11 @@ Page({ |
2228 | 2208 | // title: '超出商品限购', |
2229 | 2209 | // }); |
2230 | 2210 | getApp().my_warnning('超出商品限购', 0, th); |
2231 | - var num = th.data.sele_g.viplimited - gd_buy_num; | |
2232 | - if (num < 0) num = 0; | |
2233 | - th.setData({ goodsInputNum: num }) | |
2234 | - return false; | |
2211 | + l_num = th.data.sele_g.viplimited - gd_buy_num; | |
2212 | + if (l_num < 0) l_num = 0; | |
2213 | + //th.setData({ goodsInputNum: num }) | |
2214 | + //return false; | |
2215 | + is_show_bs=1; | |
2235 | 2216 | } |
2236 | 2217 | } |
2237 | 2218 | |
... | ... | @@ -2269,23 +2250,76 @@ Page({ |
2269 | 2250 | } |
2270 | 2251 | } |
2271 | 2252 | var e = th.data.sele_g.store_count; |
2272 | - var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4 | |
2273 | - if (th.data.sales_rules >= 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2274 | - if (!th.data.def_pick_store) { | |
2275 | - wx.showModal({ title: '请选择门店', }); | |
2276 | - return false; | |
2277 | - } else { | |
2278 | - e = th.data.def_pick_store.CanOutQty; | |
2253 | + var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4 | |
2254 | + if (!th.data.sele_g.whsle_id && | |
2255 | + th.data.sales_rules >= 2 && ( [1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2256 | + | |
2257 | + //-- 如果是虚拟商品,默认给最大值 -- | |
2258 | + if(getApp().is_virtual(th.data.sele_g)){ | |
2259 | + e =100000; | |
2260 | + }else{ | |
2261 | + if (!th.data.def_pick_store) { | |
2262 | + wx.showModal({ title: '请选择门店', }); | |
2263 | + return false; | |
2264 | + } else { | |
2265 | + e = th.data.def_pick_store.CanOutQty; | |
2266 | + } | |
2279 | 2267 | } |
2280 | 2268 | } |
2269 | + | |
2270 | + //-- 限购数量也要进行计算一下 -- | |
2271 | + if(l_num>-1){ | |
2272 | + if(e>l_num) e=l_num; | |
2273 | + } | |
2274 | + | |
2275 | + //提示了一个,就不要提示第二个 | |
2276 | + var is_show_bs=0; | |
2277 | + //--- 促销活动也不控制起订量, 这里很重要的一个控制,起订量的 ---- | |
2278 | + if(th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){ | |
2279 | + if(t<mo_num){ | |
2280 | + t=mo_num; | |
2281 | + if(!is_show_bs){ | |
2282 | + wx.showToast({ | |
2283 | + title: '购买数未达到起订量', | |
2284 | + icon: 'none', | |
2285 | + }); | |
2286 | + } | |
2287 | + is_show_bs=1; | |
2288 | + } | |
2289 | + if(t>mo_num && (t-mo_num)%steep!=0){ | |
2290 | + if(!is_show_bs) { | |
2291 | + wx.showToast({ | |
2292 | + title: '购买数必须是起订量的倍数', | |
2293 | + icon: 'none', | |
2294 | + }); | |
2295 | + } | |
2296 | + t=mo_num+ parseInt((t-mo_num)/steep)*steep+steep; | |
2297 | + is_show_bs=1; | |
2298 | + } | |
2299 | + } | |
2300 | + | |
2281 | 2301 | if (!e) e = 0; |
2282 | 2302 | //库存不足,不增加 |
2283 | 2303 | if (e < t) { |
2284 | - wx.showModal({ title: '库存不足', }); | |
2304 | + if(!is_show_bs) wx.showModal({ title: '库存不足', }); | |
2285 | 2305 | if (e < 0) e = 0; |
2306 | + | |
2307 | + if(th.data.is_normal == 1){ | |
2308 | + if(e<mo_num) e=mo_num; | |
2309 | + if(e>mo_num && (e-mo_num)%steep!=0){ | |
2310 | + e=mo_num+ parseInt((e-mo_num)/steep)*steep; | |
2311 | + } | |
2312 | + } | |
2313 | + | |
2286 | 2314 | th.setData({ goodsInputNum: e }); return false; |
2287 | 2315 | } |
2316 | + | |
2288 | 2317 | t > e || 0 == e ? t = e : t < 1 && (t = 1); |
2318 | + //只有普通商品才有起购数 | |
2319 | + if(th.data.is_normal == 1){ | |
2320 | + if(t<mo_num) t=mo_num; | |
2321 | + } | |
2322 | + | |
2289 | 2323 | th.setData({ goodsInputNum: t }); |
2290 | 2324 | th.is_show_more_buy(); |
2291 | 2325 | |
... | ... | @@ -2306,7 +2340,7 @@ Page({ |
2306 | 2340 | // wx.showModal({ |
2307 | 2341 | // title: '超出商品限购', |
2308 | 2342 | // }); |
2309 | - getApp().my_warnning('超出商品限购', 0, th); | |
2343 | + getApp().my_warnning('超出商品限购', 0, th); | |
2310 | 2344 | var num = th.data.sele_g.viplimited - gd_buy_num; |
2311 | 2345 | if (num < 0) num = 0; |
2312 | 2346 | th.setData({ goodsInputNum: num }) |
... | ... | @@ -2350,14 +2384,22 @@ Page({ |
2350 | 2384 | } |
2351 | 2385 | |
2352 | 2386 | var e = th.data.sele_g.store_count; |
2353 | - var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4 | |
2354 | - if (th.data.sales_rules >= 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2355 | - if (!th.data.def_pick_store) { | |
2356 | - wx.showModal({ title: '请选择门店', }); | |
2357 | - return false; | |
2358 | - } else { | |
2359 | - e = th.data.def_pick_store.CanOutQty; | |
2387 | + var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4 | |
2388 | + if (!th.data.sele_g.whsle_id && | |
2389 | + th.data.sales_rules >= 2 && ([1,2,4,6,8,9].indexOf(p_type)== -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2390 | + | |
2391 | + //-- 如果是虚拟商品,默认给最大值 -- | |
2392 | + if(getApp().is_virtual(th.data.sele_g)){ | |
2393 | + e=100000; | |
2394 | + }else{ | |
2395 | + if (!th.data.def_pick_store) { | |
2396 | + wx.showModal({ title: '请选择门店', }); | |
2397 | + return false; | |
2398 | + } else { | |
2399 | + e = th.data.def_pick_store.CanOutQty; | |
2400 | + } | |
2360 | 2401 | } |
2402 | + | |
2361 | 2403 | } |
2362 | 2404 | if (!e) e = 0; |
2363 | 2405 | //库存不足,不增加 |
... | ... | @@ -2983,7 +3025,7 @@ Page({ |
2983 | 3025 | |
2984 | 3026 | |
2985 | 3027 | //默认门店要拿下门店库存 |
2986 | - if (that.data.sales_rules >= 2 && that.data.def_pick_store) { | |
3028 | + if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) { | |
2987 | 3029 | var lock = 0, plist = null; |
2988 | 3030 | // //先读取门店的lock,采用链式写法,少用await |
2989 | 3031 | // getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { |
... | ... | @@ -3181,11 +3223,18 @@ Page({ |
3181 | 3223 | for (let i in e.data.data.pageData) { |
3182 | 3224 | let item = e.data.data.pageData[i]; |
3183 | 3225 | if (item.category_id > 0) { |
3184 | - his_cate_num = 1; break; | |
3226 | + his_cate_num = 1; | |
3227 | + } | |
3228 | + if(getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2){ | |
3229 | + e.data.data.pageData[i].CanOutQty=100000; | |
3185 | 3230 | } |
3186 | 3231 | } |
3187 | 3232 | e.his_cate_num = his_cate_num; |
3188 | - | |
3233 | + if(th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}' | |
3234 | + && getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2) | |
3235 | + { | |
3236 | + th.setData({'def_pick_store.CanOutQty':100000}) | |
3237 | + } | |
3189 | 3238 | |
3190 | 3239 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
3191 | 3240 | if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) { |
... | ... | @@ -3213,7 +3262,8 @@ Page({ |
3213 | 3262 | th.setData({ all_pick_list: e.data.data.pageData }); |
3214 | 3263 | |
3215 | 3264 | //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- |
3216 | - if (th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 9 && th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) { | |
3265 | + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && | |
3266 | + th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ([1,2,4,6,8,9].indexOf(th.data.prom_type)== -1 || is_normal == 1)) { | |
3217 | 3267 | setTimeout(function () { |
3218 | 3268 | th.deal_pickup_dline(e); |
3219 | 3269 | }, 800) |
... | ... | @@ -3351,6 +3401,7 @@ Page({ |
3351 | 3401 | all_sto: newarr |
3352 | 3402 | }); |
3353 | 3403 | |
3404 | + | |
3354 | 3405 | } else { |
3355 | 3406 | th.setData({ |
3356 | 3407 | is_show_sto_cat: -1, |
... | ... | @@ -3414,8 +3465,6 @@ Page({ |
3414 | 3465 | var g_distr_type = th.data.sele_g.distr_type; |
3415 | 3466 | var lock = []; |
3416 | 3467 | |
3417 | - | |
3418 | - | |
3419 | 3468 | var lock_rq = { |
3420 | 3469 | store_id: os.stoid, |
3421 | 3470 | wareId: th.data.sele_g.goods_id, |
... | ... | @@ -4298,7 +4347,7 @@ Page({ |
4298 | 4347 | // ind == 1 为普通购买 |
4299 | 4348 | openSpecModel_pt: function (e) { |
4300 | 4349 | |
4301 | - this.setData({ open_ind_store: 9, goodsInputNum: 1 }); | |
4350 | + this.setData({ open_ind_store: 9 }); | |
4302 | 4351 | // 判断是否有待支付订单 |
4303 | 4352 | var aid = this.data.group_id; |
4304 | 4353 | var switOn = true; |
... | ... | @@ -4426,7 +4475,8 @@ Page({ |
4426 | 4475 | th.get_sto(); |
4427 | 4476 | th.setData({ |
4428 | 4477 | is_normal: 0, |
4429 | - openSpecModal_pt: 1 | |
4478 | + openSpecModal_pt: 1, | |
4479 | + goodsInputNum:1 | |
4430 | 4480 | }); |
4431 | 4481 | |
4432 | 4482 | } |
... | ... | @@ -4442,9 +4492,7 @@ Page({ |
4442 | 4492 | |
4443 | 4493 | //-----------------拼单生成方法--------------------- |
4444 | 4494 | addCart_pt: function () { |
4445 | - this.setData({ | |
4446 | - openSpecModal_pt: 0, | |
4447 | - }); | |
4495 | + | |
4448 | 4496 | if (this.data.is_normal == 0) { |
4449 | 4497 | //看一下有没有起购数,如果有起购数,要计算起购数 |
4450 | 4498 | // var qnum = parseFloat(th.data.prom_act.minbuynum); |
... | ... | @@ -4472,172 +4520,256 @@ Page({ |
4472 | 4520 | //----------添加到购物车时,要判断限购数量,-------- |
4473 | 4521 | e.get_buy_num(o, async function (ee) { |
4474 | 4522 | |
4475 | - //---判断商品是否超出限购--- | |
4476 | - // if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
4477 | - // if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
4478 | - // wx.showModal({ | |
4479 | - // title: '提示', | |
4480 | - // content: '超出商品限购' | |
4481 | - // }); | |
4482 | - | |
4483 | - // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
4484 | - // if (num < 0) num = 0; | |
4485 | - // th.setData({ goodsInputNum: num }) | |
4486 | - // return false; | |
4487 | - // } | |
4488 | - // } | |
4523 | + //---判断商品是否超出限购--- | |
4524 | + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
4525 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
4526 | + wx.showModal({ | |
4527 | + title: '提示', | |
4528 | + content: '超出商品限购' | |
4529 | + }); | |
4489 | 4530 | |
4490 | - //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- | |
4491 | - // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { | |
4492 | - // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
4493 | - // wx.showModal({ | |
4494 | - // title: '提示', | |
4495 | - // content: '超出商品活动限购' | |
4496 | - // }); | |
4497 | - | |
4498 | - // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
4499 | - // if (num < 0) num = 0; | |
4500 | - // th.setData({ goodsInputNum: num }) | |
4501 | - // return false; | |
4502 | - // } | |
4503 | - // } | |
4531 | + var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
4532 | + if (num < 0) num = 0; | |
4533 | + th.setData({goodsInputNum: num}) | |
4534 | + return false; | |
4535 | + } | |
4536 | + } | |
4504 | 4537 | |
4505 | - var redis_num = 0 | |
4506 | - //不是普通购买的时候 | |
4507 | - // if (th.data.is_normal != 1) { | |
4508 | - // //-------判断活动是否抢光--------- | |
4509 | - // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | |
4510 | - // 1: 1 | |
4511 | - // }).then(res => { | |
4512 | - // redis_num = res.data.data; | |
4513 | - // }) | |
4514 | 4538 | |
4515 | - // if (th.data.goodsInputNum > redis_num) { | |
4516 | - // wx.showModal({ | |
4517 | - // title: '提示', | |
4518 | - // content: '超出商品活动库存' | |
4519 | - // }); | |
4539 | + var redis_num = 0 | |
4520 | 4540 | |
4521 | - // th.setData({ goodsInputNum: redis_num }) | |
4541 | + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | |
4542 | + th.setData({ | |
4543 | + sto_sele_name: "" | |
4544 | + }); | |
4522 | 4545 | |
4523 | - // return false; | |
4524 | - // } | |
4525 | - // } | |
4546 | + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
4547 | + | |
4548 | + //--------------此时操作的数据------------ | |
4549 | + var newd = { | |
4550 | + goods_id: o.goods_id, | |
4551 | + goods_num: th.data.goodsInputNum, | |
4552 | + pick_id: th.data.sto_sele_id, | |
4553 | + user_id: oo.user_id, | |
4554 | + store_id: th.data.stoid, | |
4555 | + goods_price: o.shop_price, | |
4556 | + goods_name: o.goods_name, | |
4557 | + goods_sn: o.goods_sn, | |
4558 | + sku: o.sku, | |
4559 | + }; | |
4526 | 4560 | |
4527 | - // if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
4528 | - // if (th.data.goodsInputNum > o.store_count) { | |
4529 | - // th.setData({ goodsInputNum: o.store_count }) | |
4530 | - // return s.my_warnning("超出商品库存", 0, th); | |
4531 | - // } | |
4561 | + //---是不是从收藏夹出来的--- | |
4562 | + if (th.data.c_guide_id) { | |
4563 | + newd['guide_id'] = th.data.c_guide_id; | |
4564 | + newd['guide_type'] = 2; | |
4532 | 4565 | |
4533 | - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | |
4534 | - th.setData({ | |
4535 | - sto_sele_name: "" | |
4536 | - }); | |
4537 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
4566 | + } else { | |
4567 | + if (getApp().globalData.guide_id) { | |
4568 | + newd['guide_id'] = getApp().globalData.guide_id; | |
4569 | + newd['guide_type'] = 0; | |
4538 | 4570 | |
4539 | - //--------------此时操作的数据------------ | |
4540 | - var newd = { | |
4541 | - goods_id: o.goods_id, | |
4542 | - goods_num: th.data.goodsInputNum, | |
4543 | - pick_id: th.data.sto_sele_id, | |
4544 | - user_id: oo.user_id, | |
4545 | - store_id: th.data.stoid, | |
4546 | - goods_price: o.shop_price, | |
4547 | - goods_name: o.goods_name, | |
4548 | - goods_sn: o.goods_sn, | |
4549 | - sku: o.sku, | |
4550 | - }; | |
4571 | + } | |
4572 | + } | |
4573 | + if (getApp().globalData.groupchat_id) { | |
4574 | + newd['groupchat_id'] = getApp().globalData.groupchat_id; | |
4575 | + } | |
4576 | + //让商品带上房间号 | |
4577 | + if (th.data.sys_switch.is_skuroom_id == 1) { | |
4578 | + if (th.data.data.goods_id == getApp().globalData.room_goods_id) { | |
4579 | + newd.room_id = getApp().globalData.room_id; | |
4580 | + } | |
4581 | + } else { | |
4582 | + if (newd.goods_id == getApp().globalData.room_goods_id) { | |
4583 | + newd.room_id = getApp().globalData.room_id; | |
4584 | + } | |
4585 | + } | |
4551 | 4586 | |
4552 | - //---是不是从收藏夹出来的--- | |
4553 | - if (th.data.c_guide_id) { | |
4554 | - newd['guide_id'] = th.data.c_guide_id; | |
4555 | - newd['guide_type'] = 2; | |
4587 | + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | |
4556 | 4588 | |
4557 | - } else { | |
4558 | - if (getApp().globalData.guide_id) { | |
4559 | - newd['guide_id'] = getApp().globalData.guide_id; | |
4560 | - newd['guide_type'] = 0; | |
4589 | + if (th.data.is_normal == 1) { | |
4590 | + var conf = th.data.bconfig; | |
4591 | + if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { | |
4592 | + var s_list = JSON.parse(conf.switch_list); | |
4561 | 4593 | |
4562 | - } | |
4563 | - } | |
4564 | - if(getApp().globalData.groupchat_id){ | |
4565 | - newd['groupchat_id'] = getApp().globalData.groupchat_id; | |
4566 | - } | |
4567 | - //让商品带上房间号 | |
4568 | - if (th.data.sys_switch.is_skuroom_id == 1) { | |
4569 | - if (th.data.data.goods_id == getApp().globalData.room_goods_id) { | |
4570 | - newd.room_id = getApp().globalData.room_id; | |
4571 | - } | |
4572 | - } else { | |
4573 | - if (newd.goods_id == getApp().globalData.room_goods_id) { | |
4574 | - newd.room_id = getApp().globalData.room_id; | |
4575 | - } | |
4576 | - } | |
4594 | + var now = ut.gettimestamp(); | |
4595 | + | |
4596 | + var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/'); | |
4597 | + var end = new Date(str); | |
4598 | + end = Date.parse(end) / 1000; | |
4599 | + | |
4600 | + //如果后台有开启等级价的功能 | |
4601 | + if (parseInt(s_list.rank_switch) == 2 && end > now) { | |
4602 | + var card_price = o[getApp().globalData.userInfo['card_field']]; | |
4603 | + //如果会员有等级价 | |
4604 | + if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null | |
4605 | + && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) { | |
4606 | + newd.goods_price = card_price; | |
4607 | + } | |
4608 | + } | |
4609 | + } | |
4610 | + | |
4611 | + //---如果是线下门店销售的时候--- | |
4612 | + if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { | |
4613 | + var pick = th.get_pick_from_list(th.data.sto_sele_id) | |
4614 | + | |
4615 | + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { | |
4616 | + if (CanOutQty) { | |
4617 | + | |
4618 | + if (CanOutQty < e.data.goodsInputNum) { | |
4619 | + wx.showToast({ | |
4620 | + title: '库存不足!', | |
4621 | + icon: 'none', | |
4622 | + }); | |
4623 | + return false; | |
4624 | + } | |
4625 | + | |
4626 | + th.by_next_func(newd); | |
4627 | + } else { | |
4628 | + wx.showToast({ | |
4629 | + title: '库存不足!', | |
4630 | + icon: 'none', | |
4631 | + }); | |
4632 | + return false; | |
4633 | + } | |
4634 | + }) | |
4635 | + | |
4636 | + } else { | |
4637 | + if (o.store_count <= 0) { | |
4638 | + wx.showToast({ | |
4639 | + title: '库存已为空!', | |
4640 | + icon: 'none', | |
4641 | + }); | |
4642 | + return false; | |
4643 | + //return s.my_warnning("库存已为空!", 0, th); | |
4644 | + } | |
4645 | + | |
4646 | + if (o.store_count < e.data.goodsInputNum) { | |
4647 | + wx.showToast({ | |
4648 | + title: '库存不足!', | |
4649 | + icon: 'none', | |
4650 | + }); | |
4651 | + return false; | |
4652 | + //return s.my_warnning("库存不足!", 0, th); | |
4653 | + } | |
4577 | 4654 | |
4578 | - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | |
4579 | 4655 | |
4580 | - if (th.data.is_normal == 1) { | |
4581 | - var conf = th.data.bconfig; | |
4582 | - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { | |
4583 | - var s_list = JSON.parse(conf.switch_list); | |
4656 | + th.by_next_func(newd); | |
4657 | + } | |
4658 | + return false; | |
4584 | 4659 | |
4585 | - var now = ut.gettimestamp(); | |
4586 | 4660 | |
4587 | - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/'); | |
4588 | - var end = new Date(str); | |
4589 | - end = Date.parse(end) / 1000; | |
4661 | + } | |
4590 | 4662 | |
4591 | - //如果后台有开启等级价的功能 | |
4592 | - if (parseInt(s_list.rank_switch) == 2 && end > now) { | |
4593 | - var card_price = o[getApp().globalData.userInfo['card_field']]; | |
4594 | - //如果会员有等级价 | |
4595 | - if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null | |
4596 | - && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) { | |
4597 | - newd.goods_price = card_price; | |
4663 | + | |
4664 | + //-----如果是秒杀,团购,积分购,拼团,且不是普通购买----- | |
4665 | + if (th.data.prom_type == 9 && th.data.is_normal != 1) { | |
4666 | + newd.goods_price = th.data.prom_price; | |
4667 | + newd.prom_type = th.data.prom_type; | |
4668 | + newd.prom_id = th.data.prom_id; | |
4669 | + //newd.kt_type = th.data.prom_act.kttype; //开团类型 | |
4670 | + newd.is_pt_tz = 0; | |
4671 | + //th.data.sto_sele_distr=1; //直接用自提的方式提交 | |
4672 | + if (newd.kt_type > 1) { | |
4673 | + newd.is_pt_tz = 1; //开团类型 | |
4674 | + } | |
4675 | + if (newd.kt_type == 3) { | |
4676 | + th.data.sto_sele_distr = 1; | |
4598 | 4677 | } |
4678 | + | |
4599 | 4679 | } |
4600 | - } | |
4601 | - } | |
4602 | 4680 | |
4681 | + // else if (th.data.prom_type == 3) { | |
4682 | + // newd.prom_type = 0; | |
4683 | + // newd.prom_id = 0; | |
4684 | + // } | |
4603 | 4685 | |
4604 | - //-----如果是秒杀,团购,积分购,拼团,且不是普通购买----- | |
4605 | - if (th.data.prom_type == 9 && th.data.is_normal != 1) { | |
4606 | - newd.goods_price = th.data.prom_price; | |
4607 | - newd.prom_type = th.data.prom_type; | |
4608 | - newd.prom_id = th.data.prom_id; | |
4609 | - //newd.kt_type = th.data.prom_act.kttype; //开团类型 | |
4610 | - newd.is_pt_tz = 0; | |
4611 | - //th.data.sto_sele_distr=1; //直接用自提的方式提交 | |
4612 | - if (newd.kt_type > 1) { | |
4613 | - newd.is_pt_tz = 1; //开团类型 | |
4614 | - } | |
4615 | - if (newd.kt_type == 3) { | |
4616 | - th.data.sto_sele_distr = 1; | |
4686 | + th.by_next_func(newd); | |
4617 | 4687 | } |
4618 | 4688 | |
4689 | + | |
4690 | + ) | |
4691 | + }, | |
4692 | + by_next_func(newd){ | |
4693 | + var th=this; | |
4694 | + newd['pick_name'] = th.data.sto_sele_name; | |
4695 | + newd['pick_dis'] = th.data.sto_sele_distr; | |
4696 | + newd['is_normal'] = th.data.is_normal; | |
4697 | + | |
4698 | + if (newd['is_normal']) { | |
4699 | + newd['is_pd_normal'] = 1; | |
4700 | + //判断一下有没有全局优惠活动 | |
4701 | + th.buyNow(newd); | |
4702 | + } | |
4703 | + else { | |
4704 | + // 点击立即参团 | |
4705 | + th.buyNow_pt(newd); | |
4706 | + } | |
4707 | + }, | |
4708 | + | |
4709 | + //统一一下获取线下库存的函数 | |
4710 | + async check_CanOutQty(goodsinfo, item, func) { | |
4711 | + | |
4712 | + var sales_rules = this.data.sales_rules; | |
4713 | + //如果默认是商品 | |
4714 | + if(getApp().is_virtual(goodsinfo)){ | |
4715 | + return func(100000); | |
4716 | + } | |
4717 | + | |
4718 | + var lock_rq = { | |
4719 | + store_id: os.stoid, | |
4720 | + wareId: goodsinfo.goods_id, | |
4721 | + pageSize: 1000 | |
4722 | + }; | |
4723 | + | |
4724 | + if (sales_rules == 2) { | |
4725 | + lock_rq.storageId = item.pickup_id | |
4726 | + } else { | |
4727 | + lock_rq.appoint_pick_keyid = encodeURIComponent(this.data.appoint_pick_keyid) | |
4728 | + } | |
4729 | + | |
4730 | + var lock = 0; | |
4731 | + var CanOutQty = 0; | |
4732 | + var plist = null; | |
4733 | + //先读取门店的lock | |
4734 | + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { | |
4735 | + data: lock_rq | |
4736 | + }).then(res => { | |
4737 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
4738 | + for (var i in res.data.data.pageData) | |
4739 | + lock += res.data.data.pageData[i].outQty; | |
4619 | 4740 | } |
4741 | + }) | |
4620 | 4742 | |
4621 | - // else if (th.data.prom_type == 3) { | |
4622 | - // newd.prom_type = 0; | |
4623 | - // newd.prom_id = 0; | |
4624 | - // } | |
4743 | + var sto_req = { | |
4744 | + wareIds: encodeURIComponent(goodsinfo.erpwareid), | |
4745 | + storeId: os.stoid | |
4746 | + } | |
4747 | + if (sales_rules == 2) { | |
4748 | + sto_req.storageNos = item.pickup_no | |
4749 | + } else { | |
4750 | + sto_req.storageIds = encodeURIComponent(this.data.appoint_pick_keyid) | |
4751 | + } | |
4625 | 4752 | |
4626 | - newd['pick_name'] = th.data.sto_sele_name; | |
4627 | - newd['pick_dis'] = th.data.sto_sele_distr; | |
4628 | - newd['is_normal'] = th.data.is_normal; | |
4629 | 4753 | |
4630 | - if (newd['is_normal']) { | |
4631 | - newd['is_pd_normal'] = 1; | |
4632 | - //判断一下有没有全局优惠活动 | |
4633 | - th.buyNow(newd); | |
4754 | + | |
4755 | + //读取线下的门店库存 | |
4756 | + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { | |
4757 | + data: sto_req | |
4758 | + }).then(res => { | |
4759 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
4760 | + plist = res.data.data.pageData[0]; | |
4634 | 4761 | } |
4635 | - else { | |
4636 | - // 点击立即参团 | |
4637 | - th.buyNow_pt(newd); | |
4638 | - }; | |
4639 | 4762 | }) |
4763 | + | |
4764 | + if (plist && plist.CanOutQty - lock > 0) { | |
4765 | + CanOutQty = plist.CanOutQty - lock; | |
4766 | + } | |
4767 | + | |
4768 | + if (func) func(CanOutQty); | |
4769 | + | |
4640 | 4770 | }, |
4771 | + | |
4772 | + | |
4641 | 4773 | //----------立即购买_pt----------- |
4642 | 4774 | buyNow_pt: function (e) { |
4643 | 4775 | s.set_b_now(e); |
... | ... | @@ -6225,7 +6357,7 @@ Page({ |
6225 | 6357 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; |
6226 | 6358 | var req_d = { |
6227 | 6359 | "store_id": os.stoid, |
6228 | - "goods_id": this.data.gid, | |
6360 | + "goods_id": gid, | |
6229 | 6361 | "user_id": user_id, |
6230 | 6362 | } |
6231 | 6363 | await getApp().request.promiseGet(url, { |
... | ... | @@ -6265,12 +6397,12 @@ Page({ |
6265 | 6397 | } |
6266 | 6398 | } |
6267 | 6399 | |
6268 | - | |
6400 | + var r_data=null; | |
6269 | 6401 | //调用接口判断订单优惠, |
6270 | 6402 | await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromListNew1/" + os.stoid + "/" + gid + "/0" + "/" + user_id, { |
6271 | 6403 | }).then(async res=>{ |
6272 | 6404 | if (res.data.code == 0 && res.data.data) { |
6273 | - var r_data = res.data.data; | |
6405 | + r_data = res.data.data; | |
6274 | 6406 | var max = 0, min = 0; |
6275 | 6407 | //暂时积分够 不和 优惠,阶梯重叠 |
6276 | 6408 | if(th.data.zh_act){ |
... | ... | @@ -6295,42 +6427,6 @@ Page({ |
6295 | 6427 | r_data.promGoodsLists=null; |
6296 | 6428 | } |
6297 | 6429 | |
6298 | - | |
6299 | - if (r_data.ladderLists) { | |
6300 | - var act_id = r_data.ladderLists[0].form_id; | |
6301 | - //-- 判断会员能不能参与阶梯促销 -- | |
6302 | - await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { | |
6303 | - if (res.data.code == 0 && res.data.data) { | |
6304 | - var prom_content = ""; | |
6305 | - | |
6306 | - //暂定优惠促销还不能重叠 | |
6307 | - if(res.data.data.good_object==0 && (r_data.promGoodsLists || th.data.zh_act)){ | |
6308 | - return false; | |
6309 | - } | |
6310 | - | |
6311 | - if(res.data.data.good_object==1){ | |
6312 | - r_data.promGoodsLists=null; | |
6313 | - } | |
6314 | - | |
6315 | - for (let jj in r_data.ladderLists) { | |
6316 | - if (r_data.ladderLists[jj].discount == 10) { | |
6317 | - prom_content += "第" + (parseInt(jj) + 1) + "件原价,"; | |
6318 | - } else { | |
6319 | - prom_content += "第" + (parseInt(jj) + 1) + "件" + r_data.ladderLists[jj].discount + "折,"; | |
6320 | - } | |
6321 | - } | |
6322 | - prom_content = ut.sub_last(prom_content); | |
6323 | - th.data.prom_type = 10; | |
6324 | - th.data.prom_id = act_id; | |
6325 | - th.setData({ | |
6326 | - jieti_prom: prom_content, | |
6327 | - ladder_act_id: act_id | |
6328 | - }) | |
6329 | - } | |
6330 | - }) | |
6331 | - } | |
6332 | - | |
6333 | - | |
6334 | 6430 | //普通购买不在界面显示 |
6335 | 6431 | if(is_nor){ |
6336 | 6432 | th.data.collocationGoods=r_data.collocationPromList; |
... | ... | @@ -6346,8 +6442,49 @@ Page({ |
6346 | 6442 | } |
6347 | 6443 | }) |
6348 | 6444 | |
6445 | + if (r_data && r_data.ladderLists) { | |
6446 | + var act_id = r_data.ladderLists[0].form_id; | |
6447 | + //-- 判断会员能不能参与阶梯促销 -- | |
6448 | + await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { | |
6449 | + if (res.data.code == 0 && res.data.data) { | |
6450 | + var prom_content = ""; | |
6349 | 6451 | |
6452 | + //暂定优惠促销还不能重叠 | |
6453 | + if(res.data.data.good_object==0 && (r_data.promGoodsLists || th.data.zh_act)){ | |
6454 | + return false; | |
6455 | + } | |
6350 | 6456 | |
6457 | + if(res.data.data.good_object==1){ | |
6458 | + r_data.promGoodsLists=null; | |
6459 | + } | |
6460 | + | |
6461 | + for (let jj in r_data.ladderLists) { | |
6462 | + if (r_data.ladderLists[jj].discount == 10) { | |
6463 | + prom_content += "第" + (parseInt(jj) + 1) + "件原价,"; | |
6464 | + } else { | |
6465 | + prom_content += "第" + (parseInt(jj) + 1) + "件" + r_data.ladderLists[jj].discount + "折,"; | |
6466 | + } | |
6467 | + } | |
6468 | + prom_content = ut.sub_last(prom_content); | |
6469 | + th.data.prom_type = 10; | |
6470 | + th.data.prom_id = act_id; | |
6471 | + th.setData({ | |
6472 | + jieti_prom: prom_content, | |
6473 | + ladder_act_id: act_id | |
6474 | + }) | |
6475 | + } | |
6476 | + }) | |
6477 | + } | |
6478 | + | |
6479 | + //-- 如果有促销活动也算是有参与活动,参与活动的也统一不进行计算起订的数量 -- | |
6480 | + this.data.is_act=0; | |
6481 | + if(this.data.zh_act || this.data.prom_goods || this.data.jieti_prom || this.data.collocationGoods ){ | |
6482 | + this.data.is_act=1; | |
6483 | + } | |
6484 | + //-- 更新默认购买的数量 --- | |
6485 | + var mo_num=getApp().get_limit_qty(th.data.sele_g,this.data.is_act); | |
6486 | + this.setData({goodsInputNum:mo_num}) | |
6487 | + this.setData({mo_num:mo_num}) | |
6351 | 6488 | |
6352 | 6489 | }, |
6353 | 6490 | |
... | ... | @@ -6979,65 +7116,6 @@ Page({ |
6979 | 7116 | }); |
6980 | 7117 | }, |
6981 | 7118 | |
6982 | - //统一一下获取线下库存的函数 | |
6983 | - async check_CanOutQty(goodsinfo, item, func) { | |
6984 | - | |
6985 | - var sales_rules = this.data.sales_rules; | |
6986 | - | |
6987 | - var lock_rq = { | |
6988 | - store_id: os.stoid, | |
6989 | - wareId: goodsinfo.goods_id, | |
6990 | - pageSize: 1000 | |
6991 | - }; | |
6992 | - | |
6993 | - if (sales_rules == 2) { | |
6994 | - lock_rq.storageId = item.pickup_id | |
6995 | - } else { | |
6996 | - lock_rq.appoint_pick_keyid = encodeURIComponent(this.data.appoint_pick_keyid) | |
6997 | - } | |
6998 | - | |
6999 | - var lock = 0; | |
7000 | - var CanOutQty = 0; | |
7001 | - var plist = null; | |
7002 | - //先读取门店的lock | |
7003 | - await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { | |
7004 | - data: lock_rq | |
7005 | - }).then(res => { | |
7006 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
7007 | - for (var i in res.data.data.pageData) | |
7008 | - lock += res.data.data.pageData[i].outQty; | |
7009 | - } | |
7010 | - }) | |
7011 | - | |
7012 | - var sto_req = { | |
7013 | - wareIds: encodeURIComponent(goodsinfo.erpwareid), | |
7014 | - storeId: os.stoid | |
7015 | - } | |
7016 | - if (sales_rules == 2) { | |
7017 | - sto_req.storageNos = item.pickup_no | |
7018 | - } else { | |
7019 | - sto_req.storageIds = encodeURIComponent(this.data.appoint_pick_keyid) | |
7020 | - } | |
7021 | - | |
7022 | - | |
7023 | - | |
7024 | - //读取线下的门店库存 | |
7025 | - await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { | |
7026 | - data: sto_req | |
7027 | - }).then(res => { | |
7028 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
7029 | - plist = res.data.data.pageData[0]; | |
7030 | - } | |
7031 | - }) | |
7032 | - | |
7033 | - if (plist && plist.CanOutQty - lock > 0) { | |
7034 | - CanOutQty = plist.CanOutQty - lock; | |
7035 | - } | |
7036 | - | |
7037 | - if (func) func(CanOutQty); | |
7038 | - | |
7039 | - }, | |
7040 | - | |
7041 | 7119 | |
7042 | 7120 | async getUserBuyPromNum(prom_id){ |
7043 | 7121 | var userInfo = getApp().globalData.userInfo; | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... | ... | @@ -436,7 +436,7 @@ |
436 | 436 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
437 | 437 | (配送不匹配) |
438 | 438 | </view> |
439 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}"> | |
439 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
440 | 440 | (库存不足) |
441 | 441 | </view> |
442 | 442 | </block> |
... | ... | @@ -1062,20 +1062,27 @@ |
1062 | 1062 | </view> |
1063 | 1063 | </view> |
1064 | 1064 | <block wx:if="{{prom_type == 0}}"> |
1065 | + 11111111111111 | |
1065 | 1066 | <view class="flex"> |
1066 | 1067 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
1068 | + <!-- 线下门店销售的时候 --> | |
1067 | 1069 | <block wx:if="{{sales_rules>=2}}"> |
1068 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
1069 | - 可售:{{def_pick_store.CanOutQty}} | |
1070 | - </view> | |
1071 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
1070 | + | |
1071 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
1072 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
1073 | + 可售:{{def_pick_store.CanOutQty}} | |
1074 | + </view> | |
1075 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
1076 | + </block> | |
1072 | 1077 | </block> |
1078 | + | |
1073 | 1079 | <block wx:else> |
1074 | 1080 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
1075 | 1081 | </block> |
1076 | 1082 | </view> |
1077 | 1083 | </block> |
1078 | 1084 | <block wx:if="{{prom_type==1}}"> |
1085 | + 555555555555 | |
1079 | 1086 | <view class="flex"> |
1080 | 1087 | <view class="spec-goods-stock" wx:if="{{prom_st>0}}"> |
1081 | 1088 | 已售:{{prom_act.buy_num+prom_act.virtual}} |
... | ... | @@ -1105,7 +1112,7 @@ |
1105 | 1112 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
1106 | 1113 | <block wx:else> |
1107 | 1114 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
1108 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}"> | |
1115 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
1109 | 1116 | (库存不足) |
1110 | 1117 | </view> |
1111 | 1118 | </block> |
... | ... | @@ -1146,6 +1153,7 @@ |
1146 | 1153 | <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text> |
1147 | 1154 | </view> |
1148 | 1155 | </view> |
1156 | + | |
1149 | 1157 | <view class="spec-cart-btns"> |
1150 | 1158 | <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> |
1151 | 1159 | 配送不匹配 |
... | ... | @@ -1178,7 +1186,7 @@ |
1178 | 1186 | <block wx:else> |
1179 | 1187 | <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> |
1180 | 1188 | <block wx:if="{{sales_rules>=2 && prom_type==0}}"> |
1181 | - <block wx:if="{{!def_pick_store.CanOutQty}}"> | |
1189 | + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}"> | |
1182 | 1190 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
1183 | 1191 | 库存不足 |
1184 | 1192 | </view> |
... | ... | @@ -1194,7 +1202,7 @@ |
1194 | 1202 | </block> |
1195 | 1203 | <!-- 线上销售 --> |
1196 | 1204 | <block wx:else> |
1197 | - <block wx:if="{{sele_g.store_count<=0}}"> | |
1205 | + <block wx:if="{{sele_g.store_count<1}}"> | |
1198 | 1206 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
1199 | 1207 | 库存不足 |
1200 | 1208 | </view> | ... | ... |
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
... | ... | @@ -82,7 +82,17 @@ Page({ |
82 | 82 | r.order_status_detail="待支付"; r.pay_btn=1; |
83 | 83 | } |
84 | 84 | if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0) |
85 | - r.order_status_detail = "待发货"; | |
85 | + { | |
86 | + //自提的话 | |
87 | + if (r.exp_type==1) | |
88 | + { | |
89 | + r.order_status_detail = "待自提"; | |
90 | + } | |
91 | + else | |
92 | + { | |
93 | + r.order_status_detail = "待发货"; | |
94 | + } | |
95 | + } | |
86 | 96 | |
87 | 97 | if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 1){ |
88 | 98 | r.order_status_detail = "待收货";r.receive_btn=1; | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -128,8 +128,8 @@ Page({ |
128 | 128 | |
129 | 129 | dis_config:null, |
130 | 130 | bn_use_commission:0, //是不是使用佣金 |
131 | - | |
132 | - same_ok:1 //同城配送按钮控制 | |
131 | + same_ok:1, | |
132 | + appoint_pick_keyid: '', | |
133 | 133 | |
134 | 134 | }, |
135 | 135 | onLoad: function (t) { |
... | ... | @@ -248,7 +248,8 @@ Page({ |
248 | 248 | sales_rules: ee.sales_rules, |
249 | 249 | rank_switch: json_d.rank_switch, |
250 | 250 | is_default_logistics: is_default_logistics, |
251 | - is_same_city: is_same_city | |
251 | + is_same_city: is_same_city, | |
252 | + appoint_pick_keyid: json_d.appoint_pick_keyid | |
252 | 253 | }); |
253 | 254 | |
254 | 255 | var rank_switch = json_d.rank_switch; |
... | ... | @@ -1284,7 +1285,7 @@ Page({ |
1284 | 1285 | if (gg.is_pd_normal) goods.is_pd_normal = 1; |
1285 | 1286 | |
1286 | 1287 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 |
1287 | - if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 8 && th.data.sales_rules == 2) { | |
1288 | + if ([1,2,4,6,8,9].indexOf(goods.prom_type)== -1 && th.data.sales_rules >= 2 && !th.data.bn_goods.whsle_id && !getApp().is_virtual(th.data.bn_goods)) { | |
1288 | 1289 | var isok = 1; |
1289 | 1290 | await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) { |
1290 | 1291 | isok = res; |
... | ... | @@ -1552,7 +1553,7 @@ Page({ |
1552 | 1553 | } |
1553 | 1554 | |
1554 | 1555 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 |
1555 | - if (goods.prom_type == 0 && th.data.sales_rules == 2) { | |
1556 | + if (goods.prom_type == 0 && th.data.sales_rules >= 2 && !g_item.whsle_id && !getApp().is_virtual(g_item)) { | |
1556 | 1557 | var isok = 1; |
1557 | 1558 | await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) { |
1558 | 1559 | isok = res; |
... | ... | @@ -1729,26 +1730,38 @@ Page({ |
1729 | 1730 | }) |
1730 | 1731 | |
1731 | 1732 | }, |
1733 | + | |
1734 | + | |
1735 | + | |
1732 | 1736 | //---确认线下门店的数量足不足--- |
1733 | 1737 | async check_store_num(goods_id, pick, goods_num, func) { |
1734 | 1738 | var lock = 0, pick_no, plist, erpwareid; |
1739 | + | |
1740 | + var lock_rq = { store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000 }; | |
1741 | + if (this.data.sales_rules == 3) { | |
1742 | + lock_rq.appoint_pick_keyid = this.data.appoint_pick_keyid; | |
1743 | + delete lock_rq.storageId | |
1744 | + } | |
1735 | 1745 | //先读取门店的lock |
1736 | 1746 | await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { |
1737 | - data: { store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000 } | |
1747 | + data:lock_rq | |
1738 | 1748 | }).then(res => { |
1739 | 1749 | if (res.data.code == 0 && res.data.data.total > 0) { |
1740 | 1750 | for (var i in res.data.data.pageData) |
1741 | 1751 | lock += res.data.data.pageData[i].outQty; |
1742 | 1752 | } |
1743 | 1753 | }) |
1744 | - //先获取门店的编号 | |
1745 | - await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, { | |
1746 | - data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick } | |
1747 | - }).then(res => { | |
1748 | - if (res.data.code == 0) { | |
1749 | - pick_no = res.data.data.pickup_no; | |
1750 | - } | |
1751 | - }) | |
1754 | + | |
1755 | + if (this.data.sales_rules == 2) { | |
1756 | + //先获取门店的编号 | |
1757 | + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, { | |
1758 | + data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick} | |
1759 | + }).then(res => { | |
1760 | + if (res.data.code == 0) { | |
1761 | + pick_no = res.data.data.pickup_no; | |
1762 | + } | |
1763 | + }) | |
1764 | + } | |
1752 | 1765 | //先获取商品的线下库存 |
1753 | 1766 | await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { |
1754 | 1767 | data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick } |
... | ... | @@ -1757,9 +1770,16 @@ Page({ |
1757 | 1770 | erpwareid = res.data.data.erpwareid; |
1758 | 1771 | } |
1759 | 1772 | }) |
1773 | + | |
1774 | + var sto_rq = { storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000 }; | |
1775 | + if (this.data.sales_rules == 3) { | |
1776 | + sto_rq.storageIds = this.data.appoint_pick_keyid; | |
1777 | + delete sto_rq.storageNos | |
1778 | + } | |
1779 | + | |
1760 | 1780 | //读取线下的门店库存 |
1761 | 1781 | await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { |
1762 | - data: { storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000 } | |
1782 | + data: sto_rq | |
1763 | 1783 | }).then(res => { |
1764 | 1784 | if (res.data.code == 0) { |
1765 | 1785 | plist = res.data.data.pageData[0]; | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
... | ... | @@ -395,6 +395,8 @@ Page({ |
395 | 395 | is_closecoupon: json_d.is_closecoupon, |
396 | 396 | is_newsales_rules: json_d.is_newsales_rules, |
397 | 397 | is_retail_price: json_d.is_retail_price || 0, |
398 | + appoint_pick_keyid: json_d.appoint_pick_keyid | |
399 | + | |
398 | 400 | }); |
399 | 401 | // ee.init(gid); |
400 | 402 | //------几人评价------- |
... | ... | @@ -1992,7 +1994,8 @@ Page({ |
1992 | 1994 | th.setData({ all_pick_list: e.data.data.pageData }); |
1993 | 1995 | |
1994 | 1996 | //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购 预售-- |
1995 | - if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4 && th.data.prom_type != 8) || is_normal == 1)) { | |
1997 | + if(!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id | |
1998 | + && th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ([1,2,4,6,8,9].indexOf(th.data.prom_type)==-1 || is_normal == 1)) { | |
1996 | 1999 | setTimeout(function () { |
1997 | 2000 | th.deal_pickup_dline(e); |
1998 | 2001 | }, 800) |
... | ... | @@ -2199,7 +2202,8 @@ Page({ |
2199 | 2202 | |
2200 | 2203 | //------------处理线下门店库存-------- |
2201 | 2204 | deal_pickup_dline(e) { |
2202 | - var pkno = [], th = this; | |
2205 | + var pkno = [], | |
2206 | + th = this; | |
2203 | 2207 | if (!th.data.sele_g) return false; |
2204 | 2208 | |
2205 | 2209 | if (this.data.def_pick_store) { |
... | ... | @@ -2219,78 +2223,165 @@ Page({ |
2219 | 2223 | |
2220 | 2224 | var g_distr_type = th.data.sele_g.distr_type; |
2221 | 2225 | var lock = []; |
2226 | + | |
2227 | + var lock_rq = { | |
2228 | + store_id: os.stoid, | |
2229 | + wareId: th.data.sele_g.goods_id, | |
2230 | + pageSize: 1000 | |
2231 | + }; | |
2232 | + | |
2233 | + if (th.data.sales_rules == 3) { | |
2234 | + lock_rq.appoint_pick_keyid = th.data.appoint_pick_keyid; | |
2235 | + } | |
2236 | + | |
2222 | 2237 | //先读取门店的lock,采用链式写法,少用await |
2223 | 2238 | getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { |
2224 | - data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, pageSize: 1000 } | |
2239 | + data: lock_rq | |
2225 | 2240 | }).then(res => { |
2226 | 2241 | if (res.data.code == 0 && res.data.data.total > 0) { |
2227 | 2242 | lock = res.data.data.pageData |
2228 | 2243 | } |
2244 | + var sto_rq = { | |
2245 | + wareIds: encodeURIComponent(th.data.sele_g.erpwareid), | |
2246 | + storeId: os.stoid, | |
2247 | + pageSize: 2000 | |
2248 | + } | |
2249 | + | |
2250 | + if (th.data.sales_rules == 3) { | |
2251 | + sto_rq.storageIds = th.data.appoint_pick_keyid; | |
2252 | + } else { | |
2253 | + sto_rq.storageNos = pkno_str; | |
2254 | + } | |
2255 | + | |
2256 | + | |
2229 | 2257 | //---通过接口获取门店的线下库存信息-- |
2230 | 2258 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { |
2231 | - data: { storageNos: pkno_str, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid, pageSize: 2000 } | |
2259 | + data: sto_rq | |
2232 | 2260 | }) |
2233 | 2261 | }).then(res => { |
2234 | 2262 | |
2235 | 2263 | wx.hideLoading(); |
2236 | 2264 | if (res.data.code == 0) { |
2265 | + | |
2237 | 2266 | if (res.data.data.pageData && res.data.data.pageData.length > 0) { |
2238 | - var plist = res.data.data.pageData; | |
2267 | + | |
2239 | 2268 | var def_pick_store = th.data.def_pick_store; |
2240 | - //以原来的数组为外循环,保证距离的顺序 | |
2241 | - for (var kk in o_plist) { | |
2242 | - for (var ii in plist) { | |
2243 | - //线下的门店小心 | |
2244 | - var n_item = plist[ii]; | |
2245 | - if (n_item.StorageNo == o_plist[kk].pickup_no) { | |
2246 | - | |
2247 | - //拿到锁库的数量 | |
2248 | - var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); | |
2249 | - //可出库数大于预出库库存的数量,可以判断为有库存 | |
2250 | - if (n_item.CanOutQty > lock_num) { | |
2251 | - o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; | |
2252 | - new_list.push(o_plist[kk]); | |
2253 | - //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
2254 | - if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2255 | - th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; | |
2256 | - if (def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2257 | - th.setData({ def_pick_store: th.data.fir_def_store }) | |
2258 | - is_find_def_store = 1; | |
2269 | + var plist = res.data.data.pageData; | |
2270 | + if (th.data.sales_rules == 3) { | |
2271 | + var lock_num = 0; | |
2272 | + var Qty = 0; | |
2273 | + //-- 计算锁住的库存 -- | |
2274 | + for (var i in lock) lock_num += lock[i].outQty; | |
2275 | + Qty = plist[0].CanOutQty - lock_num; | |
2276 | + | |
2277 | + if (Qty > 0) { | |
2278 | + for (var kk in o_plist) { | |
2279 | + o_plist[kk].CanOutQty = Qty; | |
2280 | + new_list.push(o_plist[kk]); | |
2281 | + } | |
2282 | + if (th.data.fir_def_store && | |
2283 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || (th.data.def_pick_store && th.data.def_pick_store.distr_type == g_distr_type))) { | |
2284 | + th.data.fir_def_store.Qty=Qty; | |
2285 | + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2286 | + th.setData({ | |
2287 | + def_pick_store: th.data.fir_def_store | |
2288 | + }) | |
2289 | + is_find_def_store = 1; | |
2290 | + } | |
2291 | + | |
2292 | + } else { | |
2293 | + th.setData({ | |
2294 | + all_sto: null, | |
2295 | + only_pk: null, | |
2296 | + def_pickpu_list: null | |
2297 | + }); | |
2298 | + return false; | |
2299 | + } | |
2300 | + | |
2301 | + } else { | |
2302 | + | |
2303 | + | |
2304 | + //以原来的数组为外循环,保证距离的顺序 | |
2305 | + for (var kk in o_plist) { | |
2306 | + for (var ii in plist) { | |
2307 | + //线下的门店小心 | |
2308 | + var n_item = plist[ii]; | |
2309 | + if (n_item.StorageNo == o_plist[kk].pickup_no) { | |
2310 | + | |
2311 | + //拿到锁库的数量 | |
2312 | + var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); | |
2313 | + //可出库数大于预出库库存的数量,可以判断为有库存 | |
2314 | + if (n_item.CanOutQty > lock_num) { | |
2315 | + o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; | |
2316 | + new_list.push(o_plist[kk]); | |
2317 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
2318 | + if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2319 | + th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; | |
2320 | + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2321 | + th.setData({ | |
2322 | + def_pick_store: th.data.fir_def_store | |
2323 | + }) | |
2324 | + is_find_def_store = 1; | |
2325 | + } | |
2259 | 2326 | } |
2327 | + break; | |
2260 | 2328 | } |
2261 | - break; | |
2262 | 2329 | } |
2263 | 2330 | } |
2331 | + | |
2264 | 2332 | } |
2265 | 2333 | |
2266 | 2334 | //数据组装下 |
2267 | - var em = {}; em.data = {}; em.data.data = {}; | |
2335 | + var em = {}; | |
2336 | + em.data = {}; | |
2337 | + em.data.data = {}; | |
2268 | 2338 | em.data.data.total = new_list.length; |
2269 | 2339 | em.data.data.pageData = new_list; |
2270 | 2340 | |
2341 | + | |
2271 | 2342 | //--如果找到默认门店,同时也应该判断配送方式对不对-- |
2272 | - if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2343 | + if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && | |
2344 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2273 | 2345 | th.data.fir_def_store.CanOutQty = 0; |
2274 | 2346 | //--当选择的门店是客户默认的门店的时候-- |
2275 | 2347 | if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { |
2276 | - th.setData({ def_pick_store: th.data.fir_def_store }); | |
2348 | + th.setData({ | |
2349 | + def_pick_store: th.data.fir_def_store | |
2350 | + }); | |
2277 | 2351 | em.data.data.pageData.unshift(th.data.def_pick_store); |
2278 | 2352 | } else { |
2279 | 2353 | em.data.data.pageData.splice(1, 0, th.data.fir_def_store); |
2280 | 2354 | } |
2281 | 2355 | } |
2282 | 2356 | |
2357 | + for (let j = 0; j < em.data.data.pageData.length; j++) { | |
2358 | + var iu = em.data.data.pageData[j]; | |
2359 | + if (iu.CanOutQty <= 0) iu.is_no_qyt = 1; | |
2360 | + | |
2361 | + } | |
2362 | + | |
2283 | 2363 | //---把数组组装进去--- |
2284 | 2364 | th.deal_pickup(em); |
2365 | + | |
2285 | 2366 | } else { |
2286 | - th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
2367 | + th.setData({ | |
2368 | + all_sto: null, | |
2369 | + only_pk: null, | |
2370 | + def_pickpu_list: null | |
2371 | + }) | |
2287 | 2372 | } |
2373 | + | |
2288 | 2374 | } else { |
2289 | - th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
2375 | + th.setData({ | |
2376 | + all_sto: null, | |
2377 | + only_pk: null, | |
2378 | + def_pickpu_list: null | |
2379 | + }) | |
2290 | 2380 | } |
2291 | 2381 | }) |
2292 | 2382 | }, |
2293 | 2383 | |
2384 | + | |
2294 | 2385 | find_lock_num(pick_id, lock) { |
2295 | 2386 | var lock_num = 0; |
2296 | 2387 | if (!lock) return 0; | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
... | ... | @@ -194,7 +194,7 @@ |
194 | 194 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
195 | 195 | (配送不匹配2) |
196 | 196 | </view> |
197 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
197 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}"> | |
198 | 198 | (库存不足) |
199 | 199 | </view> |
200 | 200 | </block> |
... | ... | @@ -630,7 +630,7 @@ |
630 | 630 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
631 | 631 | <block wx:else> |
632 | 632 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配1)</view> |
633 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
633 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
634 | 634 | (库存不足) |
635 | 635 | </view> |
636 | 636 | </block> | ... | ... |
packageC/pages/presell/list/list.wxml
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | </navigator> |
34 | 34 | <view class="kill-cont"> |
35 | 35 | <navigator class="goods-name ellipsis-2" |
36 | - url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">{{item.goods_name}}</navigator> | |
36 | + url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">{{item.goods_name}}</navigator> | |
37 | 37 | <view class="flex-vertical xc-strip-frame"> |
38 | 38 | <view class="xc-strip-blank rel"> |
39 | 39 | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... | ... | @@ -1916,7 +1916,7 @@ Page({ |
1916 | 1916 | th.setData({ all_pick_list: e.data.data.pageData }); |
1917 | 1917 | |
1918 | 1918 | //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- |
1919 | - if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) { | |
1919 | + if (th.data.sales_rules >= 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) { | |
1920 | 1920 | setTimeout(function () { |
1921 | 1921 | th.deal_pickup_dline(e); |
1922 | 1922 | }, 800) |
... | ... | @@ -2121,9 +2121,10 @@ Page({ |
2121 | 2121 | } |
2122 | 2122 | }, |
2123 | 2123 | |
2124 | - //------------处理线下门店库存-------- | |
2124 | + //------------处理线下门店库存-------- | |
2125 | 2125 | deal_pickup_dline(e) { |
2126 | - var pkno = [], th = this; | |
2126 | + var pkno = [], | |
2127 | + th = this; | |
2127 | 2128 | if (!th.data.sele_g) return false; |
2128 | 2129 | |
2129 | 2130 | if (this.data.def_pick_store) { |
... | ... | @@ -2143,78 +2144,166 @@ Page({ |
2143 | 2144 | |
2144 | 2145 | var g_distr_type = th.data.sele_g.distr_type; |
2145 | 2146 | var lock = []; |
2147 | + | |
2148 | + var lock_rq = { | |
2149 | + store_id: os.stoid, | |
2150 | + wareId: th.data.sele_g.goods_id, | |
2151 | + pageSize: 1000 | |
2152 | + }; | |
2153 | + | |
2154 | + if (th.data.sales_rules == 3) { | |
2155 | + lock_rq.appoint_pick_keyid = th.data.appoint_pick_keyid; | |
2156 | + } | |
2157 | + | |
2146 | 2158 | //先读取门店的lock,采用链式写法,少用await |
2147 | 2159 | getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { |
2148 | - data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, pageSize: 1000 } | |
2160 | + data: lock_rq | |
2149 | 2161 | }).then(res => { |
2150 | 2162 | if (res.data.code == 0 && res.data.data.total > 0) { |
2151 | 2163 | lock = res.data.data.pageData |
2152 | 2164 | } |
2165 | + var sto_rq = { | |
2166 | + wareIds: encodeURIComponent(th.data.sele_g.erpwareid), | |
2167 | + storeId: os.stoid, | |
2168 | + pageSize: 2000 | |
2169 | + } | |
2170 | + | |
2171 | + if (th.data.sales_rules == 3) { | |
2172 | + sto_rq.storageIds = th.data.appoint_pick_keyid; | |
2173 | + } else { | |
2174 | + sto_rq.storageNos = pkno_str; | |
2175 | + } | |
2176 | + | |
2177 | + | |
2153 | 2178 | //---通过接口获取门店的线下库存信息-- |
2154 | 2179 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { |
2155 | - data: { storageNos: pkno_str, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid, pageSize: 2000 } | |
2180 | + data: sto_rq | |
2156 | 2181 | }) |
2157 | 2182 | }).then(res => { |
2158 | 2183 | |
2159 | 2184 | wx.hideLoading(); |
2160 | 2185 | if (res.data.code == 0) { |
2186 | + | |
2161 | 2187 | if (res.data.data.pageData && res.data.data.pageData.length > 0) { |
2162 | - var plist = res.data.data.pageData; | |
2188 | + | |
2163 | 2189 | var def_pick_store = th.data.def_pick_store; |
2164 | - //以原来的数组为外循环,保证距离的顺序 | |
2165 | - for (var kk in o_plist) { | |
2166 | - for (var ii in plist) { | |
2167 | - //线下的门店小心 | |
2168 | - var n_item = plist[ii]; | |
2169 | - if (n_item.StorageNo == o_plist[kk].pickup_no) { | |
2170 | - | |
2171 | - //拿到锁库的数量 | |
2172 | - var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); | |
2173 | - //可出库数大于预出库库存的数量,可以判断为有库存 | |
2174 | - if (n_item.CanOutQty > lock_num) { | |
2175 | - o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; | |
2176 | - new_list.push(o_plist[kk]); | |
2177 | - //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
2178 | - if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2179 | - th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; | |
2180 | - if (def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2181 | - th.setData({ def_pick_store: th.data.fir_def_store }) | |
2182 | - is_find_def_store = 1; | |
2190 | + var plist = res.data.data.pageData; | |
2191 | + if (th.data.sales_rules == 3) { | |
2192 | + var lock_num = 0; | |
2193 | + var Qty = 0; | |
2194 | + //-- 计算锁住的库存 -- | |
2195 | + for (var i in lock) lock_num += lock[i].outQty; | |
2196 | + Qty = plist[0].CanOutQty - lock_num; | |
2197 | + | |
2198 | + if (Qty > 0) { | |
2199 | + for (var kk in o_plist) { | |
2200 | + o_plist[kk].CanOutQty = Qty; | |
2201 | + new_list.push(o_plist[kk]); | |
2202 | + } | |
2203 | + if (th.data.fir_def_store && | |
2204 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || (th.data.def_pick_store && th.data.def_pick_store.distr_type == g_distr_type))) { | |
2205 | + th.data.fir_def_store.Qty=Qty; | |
2206 | + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2207 | + th.setData({ | |
2208 | + def_pick_store: th.data.fir_def_store | |
2209 | + }) | |
2210 | + is_find_def_store = 1; | |
2211 | + } | |
2212 | + | |
2213 | + } else { | |
2214 | + th.setData({ | |
2215 | + all_sto: null, | |
2216 | + only_pk: null, | |
2217 | + def_pickpu_list: null | |
2218 | + }); | |
2219 | + return false; | |
2220 | + } | |
2221 | + | |
2222 | + } else { | |
2223 | + | |
2224 | + | |
2225 | + //以原来的数组为外循环,保证距离的顺序 | |
2226 | + for (var kk in o_plist) { | |
2227 | + for (var ii in plist) { | |
2228 | + //线下的门店小心 | |
2229 | + var n_item = plist[ii]; | |
2230 | + if (n_item.StorageNo == o_plist[kk].pickup_no) { | |
2231 | + | |
2232 | + //拿到锁库的数量 | |
2233 | + var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); | |
2234 | + //可出库数大于预出库库存的数量,可以判断为有库存 | |
2235 | + if (n_item.CanOutQty > lock_num) { | |
2236 | + o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; | |
2237 | + new_list.push(o_plist[kk]); | |
2238 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
2239 | + if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2240 | + th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; | |
2241 | + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
2242 | + th.setData({ | |
2243 | + def_pick_store: th.data.fir_def_store | |
2244 | + }) | |
2245 | + is_find_def_store = 1; | |
2246 | + } | |
2183 | 2247 | } |
2248 | + break; | |
2184 | 2249 | } |
2185 | - break; | |
2186 | 2250 | } |
2187 | 2251 | } |
2252 | + | |
2188 | 2253 | } |
2189 | 2254 | |
2190 | 2255 | //数据组装下 |
2191 | - var em = {}; em.data = {}; em.data.data = {}; | |
2256 | + var em = {}; | |
2257 | + em.data = {}; | |
2258 | + em.data.data = {}; | |
2192 | 2259 | em.data.data.total = new_list.length; |
2193 | 2260 | em.data.data.pageData = new_list; |
2194 | 2261 | |
2262 | + | |
2195 | 2263 | //--如果找到默认门店,同时也应该判断配送方式对不对-- |
2196 | - if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2264 | + if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && | |
2265 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
2197 | 2266 | th.data.fir_def_store.CanOutQty = 0; |
2198 | 2267 | //--当选择的门店是客户默认的门店的时候-- |
2199 | 2268 | if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { |
2200 | - th.setData({ def_pick_store: th.data.fir_def_store }); | |
2269 | + th.setData({ | |
2270 | + def_pick_store: th.data.fir_def_store | |
2271 | + }); | |
2201 | 2272 | em.data.data.pageData.unshift(th.data.def_pick_store); |
2202 | 2273 | } else { |
2203 | 2274 | em.data.data.pageData.splice(1, 0, th.data.fir_def_store); |
2204 | 2275 | } |
2205 | 2276 | } |
2206 | 2277 | |
2278 | + for (let j = 0; j < em.data.data.pageData.length; j++) { | |
2279 | + var iu = em.data.data.pageData[j]; | |
2280 | + if (iu.CanOutQty <= 0) iu.is_no_qyt = 1; | |
2281 | + | |
2282 | + } | |
2283 | + | |
2207 | 2284 | //---把数组组装进去--- |
2208 | 2285 | th.deal_pickup(em); |
2286 | + | |
2209 | 2287 | } else { |
2210 | - th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
2288 | + th.setData({ | |
2289 | + all_sto: null, | |
2290 | + only_pk: null, | |
2291 | + def_pickpu_list: null | |
2292 | + }) | |
2211 | 2293 | } |
2294 | + | |
2212 | 2295 | } else { |
2213 | - th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
2296 | + th.setData({ | |
2297 | + all_sto: null, | |
2298 | + only_pk: null, | |
2299 | + def_pickpu_list: null | |
2300 | + }) | |
2214 | 2301 | } |
2215 | 2302 | }) |
2216 | 2303 | }, |
2217 | 2304 | |
2305 | + | |
2306 | + | |
2218 | 2307 | find_lock_num(pick_id, lock) { |
2219 | 2308 | var lock_num = 0; |
2220 | 2309 | if (!lock) return 0; | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.wxml
... | ... | @@ -603,7 +603,7 @@ |
603 | 603 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
604 | 604 | <block wx:else> |
605 | 605 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配1)</view> |
606 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
606 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}"> | |
607 | 607 | (库存不足) |
608 | 608 | </view> |
609 | 609 | </block> | ... | ... |
packageD/pages/AI-test-skin/analyse/analyse.js
... | ... | @@ -26,6 +26,7 @@ Page({ |
26 | 26 | err_map: null, |
27 | 27 | skin_type: 0, |
28 | 28 | ce_user_id:0, |
29 | + img_remark:'' | |
29 | 30 | }, |
30 | 31 | |
31 | 32 | /** |
... | ... | @@ -36,6 +37,7 @@ Page({ |
36 | 37 | var plugin = requirePlugin('mtSkinSdk') |
37 | 38 | plugin.setConfig(pluginGD) |
38 | 39 | } |
40 | + this.setData({img_remark:options.img_remark}) | |
39 | 41 | |
40 | 42 | if(options.ce_user_id) |
41 | 43 | this.data.ce_user_id=options.ce_user_id; |
... | ... | @@ -519,6 +521,7 @@ Page({ |
519 | 521 | resultjson: JSON.stringify(analyse_data), |
520 | 522 | detectjson: JSON.stringify(analyse_info), |
521 | 523 | skin_type: 1, |
524 | + img_remark:th.data.img_remark | |
522 | 525 | } |
523 | 526 | //要保存一下分析的结果 |
524 | 527 | th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) { |
... | ... | @@ -556,6 +559,8 @@ Page({ |
556 | 559 | resultjson: JSON.stringify(res.data.data), |
557 | 560 | detectjson: JSON.stringify(th.data.check_data), |
558 | 561 | skin_type: 0, |
562 | + img_remark:th.data.img_remark | |
563 | + | |
559 | 564 | } |
560 | 565 | |
561 | 566 | var txt=[]; | ... | ... |
packageD/pages/AI-test-skin/history_record/history_record.js
... | ... | @@ -203,6 +203,7 @@ Page({ |
203 | 203 | for (let i = 0; i < data.length; i++) { |
204 | 204 | let history = data[i]; |
205 | 205 | let id = history.id; |
206 | + let img_remark = history.img_remark; | |
206 | 207 | let now = new Date(history['addtime'] * 1000); |
207 | 208 | let year = now.getFullYear(); //年 |
208 | 209 | let month = (now.getMonth() + 1).toString().padStart(2, 0); //月 |
... | ... | @@ -218,10 +219,12 @@ Page({ |
218 | 219 | let obj = { |
219 | 220 | time, |
220 | 221 | id, |
222 | + img_remark, | |
221 | 223 | }; |
222 | 224 | if (arr.length > 0) { |
223 | 225 | let index = arr.findIndex(item => { |
224 | 226 | return item['history_time'] === history_time; |
227 | + | |
225 | 228 | }) |
226 | 229 | if (index > -1) { |
227 | 230 | arr[index]['time_arr'].push(obj); | ... | ... |
packageD/pages/AI-test-skin/history_record/history_record.wxml
... | ... | @@ -14,9 +14,14 @@ |
14 | 14 | <view class="history_list"> |
15 | 15 | <view class="history_list_month" wx:for="{{history}}"> |
16 | 16 | <view style="color:#333;font-size:26rpx;margin-top: 30rpx">{{item.history_time}}</view> |
17 | - <view class="souce" wx:for="{{item.time_arr}}" wx:for-item="subitem" bindtap="go_result" data-id="{{subitem.id}}" wx:for-index="subindex" wx:key="subindex"> | |
17 | + <view wx:for="{{item.time_arr}}" wx:for-item="subitem" bindtap="go_result" data-id="{{subitem.id}}" wx:for-index="subindex" wx:key="subindex"> | |
18 | + | |
19 | + <view class="pdt16 fs28" wx:if="{{subitem.img_remark}}">{{subitem.img_remark}}</view> | |
20 | + <view class="souce"> | |
18 | 21 | <view style="font-weight: 600;">{{subitem.time}}</view> |
19 | 22 | <view style="color: #9b9b9b;" >去查看<text style="font-size: 24rpx;" class="iconfont icon-arrow_right"></text></view> |
23 | + </view> | |
24 | + | |
20 | 25 | </view> |
21 | 26 | </view> |
22 | 27 | </view> | ... | ... |
packageD/pages/AI-test-skin/select_photo/select_photo.js
... | ... | @@ -13,7 +13,8 @@ Page({ |
13 | 13 | iurl: setting.imghost, |
14 | 14 | gl_skin_img: null, |
15 | 15 | skin_type: 0, |
16 | - ce_user_id:0 | |
16 | + ce_user_id:0, | |
17 | + img_remark:'' | |
17 | 18 | }, |
18 | 19 | |
19 | 20 | /** |
... | ... | @@ -40,9 +41,13 @@ Page({ |
40 | 41 | if (e.data.code == 0) { |
41 | 42 | getApp().globalData.face_img = e.data.data.img; |
42 | 43 | getApp().globalData.face_SourceImg = e.data.data.SourceImg; |
43 | - let url = "/packageD/pages/AI-test-skin/analyse/analyse"; //跳到分析页 | |
44 | + var getimg_remark=th.data.img_remark; | |
45 | + | |
46 | + | |
47 | + let url = "/packageD/pages/AI-test-skin/analyse/analyse"; //跳到分析页 | |
48 | + url+="?img_remark="+getimg_remark; | |
44 | 49 | if(th.data.ce_user_id) |
45 | - url+="?ce_user_id="+th.data.ce_user_id; | |
50 | + url+="&ce_user_id="+th.data.ce_user_id; | |
46 | 51 | |
47 | 52 | console.log("select_ph"); |
48 | 53 | console.log(url); |
... | ... | @@ -60,6 +65,20 @@ Page({ |
60 | 65 | }) |
61 | 66 | |
62 | 67 | }, |
68 | + | |
69 | + getInput(e) { | |
70 | + let val = e.detail.value; | |
71 | + if (val) { | |
72 | + this.setData({ | |
73 | + img_remark: e.detail.value, | |
74 | + }); | |
75 | + } else { | |
76 | + this.setData({ | |
77 | + img_remark: '', | |
78 | + }); | |
79 | + } | |
80 | + | |
81 | + }, | |
63 | 82 | //-- 重新从相册中选择图片 -- |
64 | 83 | show_pai_pop: function () { |
65 | 84 | var th = this; | ... | ... |
packageD/pages/AI-test-skin/select_photo/select_photo.wxml
1 | 1 | <view class="content" style="height: 70%;"> |
2 | 2 | <view style="height: 100%;;display:flex;align-items:center;overflow: hidden;"> |
3 | - <image style="width: 100%;border-radius: 3%;" mode="widthFix" src="{{gl_skin_img['path']}}"></image> | |
3 | + <image style="width: 100%;border-radius: 3%;max-height:400px" mode="widthFix" src="{{gl_skin_img['path']}}"></image> | |
4 | 4 | <!-- <image wx:else style="width: 100%;border-radius: 3%;" mode="widthFix" src="{{gl_skin_img['path']}}"></image> --> |
5 | 5 | </view> |
6 | + | |
7 | + <view> | |
8 | + <input class="inputclass" name="img_remark" value="" placeholder="请填写备注" bindinput="getInput"> </input> | |
9 | + </view> | |
10 | + | |
6 | 11 | <view class="foot_btn"> |
7 | 12 | <view class="reset_select" bindtap="takePhoto"> |
8 | 13 | <text class="iconfont icon-zuojiantou" style="font-size: 40rpx"></text> | ... | ... |
packageD/pages/AI-test-skin/select_photo/select_photo.wxss
... | ... | @@ -28,3 +28,13 @@ page { |
28 | 28 | /* margin: 0 auto; */ |
29 | 29 | color: #fff; |
30 | 30 | } |
31 | + | |
32 | +.inputclass{ | |
33 | + width: 540rpx; | |
34 | + height: 55rpx; | |
35 | + line-height: 55rpx; | |
36 | + background-color: rgb(238, 238, 238); | |
37 | + border-radius: 6rpx; | |
38 | + padding-left: 40rpx; | |
39 | + padding-right: 15rpx; | |
40 | +} | |
31 | 41 | \ No newline at end of file | ... | ... |
packageD/pages/shop/order_detail/order_detail.js
... | ... | @@ -46,8 +46,17 @@ Page({ |
46 | 46 | if (r.order_status == 0 && r.pay_status==0 ){ |
47 | 47 | r.order_status_detail="待支付"; r.pay_btn=1; |
48 | 48 | } |
49 | - if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0) | |
50 | - r.order_status_detail = "待发货"; | |
49 | + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0){ | |
50 | + //自提的话 | |
51 | + if (r.exp_type==1) | |
52 | + { | |
53 | + r.order_status_detail = "待自提"; | |
54 | + } | |
55 | + else | |
56 | + { | |
57 | + r.order_status_detail = "待发货"; | |
58 | + } | |
59 | + } | |
51 | 60 | |
52 | 61 | if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 1){ |
53 | 62 | r.order_status_detail = "待收货";r.receive_btn=1; |
... | ... | @@ -107,8 +116,7 @@ Page({ |
107 | 116 | |
108 | 117 | //------------对比一下有没有退款记录------------ |
109 | 118 | await getApp().request.promiseGet("/api/weshop/order/returngoods/page",{ |
110 | - data: { order_id: r.order_id, store_id: os.stoid, | |
111 | - user_id:oo.user_id, pageSize: 20 } | |
119 | + data: { order_id: r.order_id, store_id: os.stoid,pageSize: 20 } | |
112 | 120 | }).then(rs=>{ |
113 | 121 | var ttd=rs; |
114 | 122 | //--看一下订单的总数量-- | ... | ... |
packageD/pages/shop/order_detail/order_detail.wxml
... | ... | @@ -37,13 +37,13 @@ |
37 | 37 | |
38 | 38 | <!-- 不是整单退的时候 --> |
39 | 39 | <block wx:if="{{order.is_all_return!=1 && order.discount<=0 && order.coupon_price<=0 && order.order_prom_amount<=0 && order.discount_amount<=0 && item.prom_type!=5 && !order.is_prom && item.is_whsle_goods!=1}}"> |
40 | - <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}" | |
41 | - data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view> | |
42 | - <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}" | |
40 | + <!-- <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}" | |
41 | + data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view> --> | |
42 | + <view class="return-btn" data-oid="{{item.order_id}}" | |
43 | 43 | data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==2}}">退款中</view> |
44 | - <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}" | |
45 | - data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==3}}">重新退款</view> | |
46 | - <view bindtap="gotoreturn" class="goods-num" data-oid="{{item.order_id}}" | |
44 | + <!-- <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}" | |
45 | + data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==3}}">重新退款</view> --> | |
46 | + <view class="goods-num" data-oid="{{item.order_id}}" | |
47 | 47 | data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==4}}">退款完成</view> |
48 | 48 | </block> |
49 | 49 | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -5,7 +5,7 @@ var regeneratorRuntime = require('../../../../utils/runtime.js'); |
5 | 5 | var util_pay = require("../../../../utils/pay.js"); |
6 | 6 | var zh_calc = require("zh_calculate.js"); |
7 | 7 | var ladder_calc = require("ladder_calculate.js"); |
8 | -// 防抖函数用定时器 | |
8 | +// 防抖函数用定时器 | |
9 | 9 | let timer; |
10 | 10 | Page({ |
11 | 11 | data: { |
... | ... | @@ -137,6 +137,7 @@ Page({ |
137 | 137 | show_duo_gift: 0, |
138 | 138 | send_gf: {}, //多赠品的计算 |
139 | 139 | send_lb: {}, |
140 | + month_lb: {}, //每月礼包数据 | |
140 | 141 | dis_config: null, |
141 | 142 | bn_use_commission: 0, //是不是使用佣金 |
142 | 143 | cart_use_commission: 0, |
... | ... | @@ -198,6 +199,7 @@ Page({ |
198 | 199 | is_by: {}, |
199 | 200 | send_gf: {}, |
200 | 201 | send_lb: {}, |
202 | + month_lb: {}, | |
201 | 203 | }) |
202 | 204 | }, |
203 | 205 | |
... | ... | @@ -1831,6 +1833,7 @@ Page({ |
1831 | 1833 | }, |
1832 | 1834 | |
1833 | 1835 | calc_per: async function (c_arr) { |
1836 | + | |
1834 | 1837 | var send_gf = {}; |
1835 | 1838 | var duo_zp_num_arr = {}; |
1836 | 1839 | var th = this; |
... | ... | @@ -1856,7 +1859,7 @@ Page({ |
1856 | 1859 | for (var ii in ob) { |
1857 | 1860 | var item_map = ob[ii]; |
1858 | 1861 | if (item_map.bs == undefined || item_map.bs == null) { |
1859 | - //等待,获取一下优惠活动的信息 | |
1862 | + //等待,获取一下优惠活动的信息 | |
1860 | 1863 | await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { |
1861 | 1864 | data: { |
1862 | 1865 | price: parseFloat(item_map.price).toFixed(2), prom_id: item_map.prom_id, |
... | ... | @@ -1875,7 +1878,9 @@ Page({ |
1875 | 1878 | item_map.s_coupon_num = get_data.coupon_num; |
1876 | 1879 | item_map.lbtitle = get_data.lbtitle; |
1877 | 1880 | item_map.zxlbtitle = get_data.zxlbtitle; |
1878 | - | |
1881 | + //每月礼包 | |
1882 | + item_map.monthlbtitle = get_data.monthlbtitle; | |
1883 | + //------end------- | |
1879 | 1884 | if (get_data.gift_id && parseInt(get_data.zp_mode) != 1 |
1880 | 1885 | && get_data.zp_num * item_map.bs <= get_data.limit_num |
1881 | 1886 | && get_data.zp_num * item_map.bs <= get_data.gift_storecount |
... | ... | @@ -1901,6 +1906,10 @@ Page({ |
1901 | 1906 | //专享礼包 |
1902 | 1907 | item_map.zx_libao = get_data.zxlibao; |
1903 | 1908 | item_map.zx_lb_num = get_data.zxlb_num; |
1909 | + //每月礼包 | |
1910 | + item_map.monthlibao = get_data.monthlibao; | |
1911 | + item_map.monthlb_num = get_data.monthlb_num; | |
1912 | + //------end------- | |
1904 | 1913 | |
1905 | 1914 | if (parseInt(get_data.zp_mode) == 1) { |
1906 | 1915 | if (!send_gf[pickid]) send_gf[pickid] = []; |
... | ... | @@ -2043,11 +2052,22 @@ Page({ |
2043 | 2052 | cart_item.g_zxlb_num.push({ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num, 'zxlbtitle': item_map.zxlbtitle }) |
2044 | 2053 | } |
2045 | 2054 | } |
2055 | + //每月礼包 | |
2056 | + if (item_map.monthlibao) { | |
2057 | + if (!cart_item.monthlibao) { | |
2058 | + cart_item.monthlibao = item_map.monthlibao + ""; | |
2059 | + cart_item.g_monthlb_num = [{ 'month_id': item_map.monthlibao, "monthnum": item_map.monthlb_num, 'monthlbtitle': item_map.monthlbtitle }]; | |
2060 | + } else { | |
2061 | + cart_item.monthlibao += "," + item_map.monthlibao; | |
2062 | + cart_item.g_monthlb_num.push({ 'month_id': item_map.monthlibao, "monthnum": item_map.monthlb_num, 'monthlbtitle': item_map.monthlbtitle }) | |
2063 | + } | |
2064 | + } | |
2065 | + //------------end-------- | |
2046 | 2066 | } |
2047 | 2067 | } |
2048 | 2068 | } |
2049 | 2069 | |
2050 | - | |
2070 | + | |
2051 | 2071 | var arr = Object.keys(send_gf); |
2052 | 2072 | var arr2 = Object.keys(th.data.send_gf); |
2053 | 2073 | if (arr2.length > 0) return false; |
... | ... | @@ -2062,10 +2082,12 @@ Page({ |
2062 | 2082 | |
2063 | 2083 | |
2064 | 2084 | calclate_lbNum(r_data) { |
2065 | - | |
2085 | + | |
2066 | 2086 | if(!r_data) return false; |
2067 | 2087 | |
2068 | 2088 | let send_lb = this.data.send_lb; |
2089 | + let month_lb = this.data.month_lb; | |
2090 | + | |
2069 | 2091 | //g_lb_num我的礼包 g_zxlb_num专享礼包 |
2070 | 2092 | r_data.forEach(r_d => { |
2071 | 2093 | let arr = []; |
... | ... | @@ -2112,9 +2134,35 @@ Page({ |
2112 | 2134 | send_lb[r_d.pickup_id] = arr; |
2113 | 2135 | } |
2114 | 2136 | } |
2137 | + //每月礼包 | |
2138 | + let monthArr=[] | |
2139 | + if (r_d.g_monthlb_num) { | |
2140 | + let g_lb = r_d.g_monthlb_num; | |
2141 | + for (let i = 0; i < g_lb.length; i++) { | |
2142 | + let item = g_lb[i]; | |
2143 | + let new_lb = g_lb.filter(lb => { | |
2144 | + return item.month_id === lb.month_id; | |
2145 | + }); | |
2146 | + if (new_lb.length == 1) { | |
2147 | + monthArr.push(item); | |
2148 | + } else { | |
2149 | + item.num = new_lb.reduce((pre, next) => { | |
2150 | + return pre + next.num; | |
2151 | + }, 0); | |
2152 | + monthArr.push(item); | |
2153 | + g_lb = g_lb.filter(ii => { | |
2154 | + return ii.month_id !== item.month_id; | |
2155 | + }); | |
2156 | + } | |
2157 | + month_lb[r_d.pickup_id] = monthArr; | |
2158 | + } | |
2159 | + } | |
2160 | + //-----end-------- | |
2161 | + | |
2115 | 2162 | }) |
2116 | 2163 | this.setData({ |
2117 | 2164 | send_lb, |
2165 | + month_lb | |
2118 | 2166 | }) |
2119 | 2167 | |
2120 | 2168 | }, |
... | ... | @@ -3633,6 +3681,15 @@ Page({ |
3633 | 3681 | ob = JSON.stringify(ob); |
3634 | 3682 | th.setData({ [l_txt]: good.zx_libao, [l_txt1]: ob }); |
3635 | 3683 | } |
3684 | + //每月礼包 | |
3685 | + if (good.month_libao) { | |
3686 | + var l_txt = "formData.give_monthlb_id"; | |
3687 | + //这个是json格式的 | |
3688 | + var l_txt1 = "formData.g_monthlb_num"; | |
3689 | + var ob = [{ "num": good.month_lb_num, "l_id": good.month_libao }]; | |
3690 | + ob = JSON.stringify(ob); | |
3691 | + th.setData({ [l_txt]: good.month_libao, [l_txt1]: ob }); | |
3692 | + } | |
3636 | 3693 | |
3637 | 3694 | wx.hideLoading(); |
3638 | 3695 | |
... | ... | @@ -3918,6 +3975,12 @@ Page({ |
3918 | 3975 | order_prom_list.give_zxlb_id = th.data.formData.give_zxlb_id; |
3919 | 3976 | order_prom_list.g_zxlb_num = th.data.formData.g_zxlb_num; |
3920 | 3977 | } |
3978 | + //--- 每月礼包 --- | |
3979 | + if (th.data.formData.give_monthlb_id > 0) { | |
3980 | + order_prom_list.give_monthlb_id = th.data.formData.give_monthlb_id; | |
3981 | + order_prom_list.g_monthlb_num = th.data.formData.g_monthlb_num; | |
3982 | + // order_prom_list.g_monthlb_num = [{ "num": good.month_lb_num, "l_id": th.data.formData.month_libao_id }]; | |
3983 | + } | |
3921 | 3984 | |
3922 | 3985 | item.order_prom_list = order_prom_list; |
3923 | 3986 | |
... | ... | @@ -4000,8 +4063,26 @@ Page({ |
4000 | 4063 | } |
4001 | 4064 | |
4002 | 4065 | |
4066 | + var act=await getApp().get_has_cx_act(th.data.bn_goods.goods_id); | |
4067 | + var mo_num=getApp().get_limit_qty(th.data.bn_goods,act.length); | |
4068 | + var steep=getApp().get_limit_qty(th.data.bn_goods,act.length,1); | |
4069 | + | |
4070 | + if ([0,3,5,7,10].indexOf(goods.prom_type)>-1){ | |
4071 | + if(mo_num>goods.goods_num){ | |
4072 | + getApp().confirmBox(goods.goods_name + "的未达到起订数量"); | |
4073 | + th.data.is_summit_ing = 0; | |
4074 | + return false; | |
4075 | + } | |
4076 | + if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){ | |
4077 | + getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数"); | |
4078 | + th.data.is_summit_ing = 0; | |
4079 | + return false; | |
4080 | + } | |
4081 | + } | |
4082 | + | |
4003 | 4083 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 |
4004 | - if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules >= 2 && !th.data.bn_goods.whsle_id) { | |
4084 | + if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 | |
4085 | + && th.data.sales_rules >= 2 && !th.data.bn_goods.whsle_id && !getApp().is_virtual(th.data.bn_goods)) { | |
4005 | 4086 | var isok = 1; |
4006 | 4087 | await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) { |
4007 | 4088 | isok = res; |
... | ... | @@ -4124,7 +4205,6 @@ Page({ |
4124 | 4205 | |
4125 | 4206 | var order_prom_list_cart = th.data.order_prom_list_cart; |
4126 | 4207 | |
4127 | - | |
4128 | 4208 | //--组装推送数据-- |
4129 | 4209 | for (var i = 0; i < order_prom_list_cart.length; i++) { |
4130 | 4210 | var t_item = order_prom_list_cart[i]; |
... | ... | @@ -4227,6 +4307,23 @@ Page({ |
4227 | 4307 | order_prom_list.g_zxlb_num = JSON.stringify(t_item.g_zxlb_num); |
4228 | 4308 | } |
4229 | 4309 | |
4310 | + //-- 送每月礼包的时候 -- | |
4311 | + if (t_item.monthlibao) { | |
4312 | + order_prom_list.give_monthlb_id = t_item.monthlibao; | |
4313 | + let marr=[]; | |
4314 | + if (t_item.g_monthlb_num && t_item.g_monthlb_num.length>0) { | |
4315 | + t_item.g_monthlb_num.map(ite=>{ | |
4316 | + let obj={ | |
4317 | + num:ite.monthnum, | |
4318 | + l_id:ite.month_id, | |
4319 | + monthlbtitle:ite.monthlbtitle | |
4320 | + } | |
4321 | + marr.push(obj) | |
4322 | + }) | |
4323 | + } | |
4324 | + order_prom_list.g_monthlb_num = JSON.stringify(marr); | |
4325 | + } | |
4326 | + | |
4230 | 4327 | if (Object.keys(order_prom_list).length > 0) { |
4231 | 4328 | if (order_prom_list.discount_amount) |
4232 | 4329 | order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2); |
... | ... | @@ -4347,8 +4444,28 @@ Page({ |
4347 | 4444 | check_map[txt] = 1; |
4348 | 4445 | } |
4349 | 4446 | |
4350 | - //如果不立即购买或者秒杀,如果是线下库存购买的时候 | |
4351 | - if (goods.prom_type == 0 && th.data.sales_rules >= 2) { | |
4447 | + goods.prom_type=parseInt(goods.prom_type+''); | |
4448 | + | |
4449 | + var act=await getApp().get_has_cx_act(g_item.goods_id); | |
4450 | + var mo_num=getApp().get_limit_qty(g_item,act.length); | |
4451 | + var steep=getApp().get_limit_qty(g_item,act.length,1); | |
4452 | + | |
4453 | + if ([0,3,5,7,10].indexOf(goods.prom_type)>-1){ | |
4454 | + if(mo_num>goods.goods_num){ | |
4455 | + getApp().confirmBox(goods.goods_name + "的未达到起订数量"); | |
4456 | + th.data.is_summit_ing = 0; | |
4457 | + return false; | |
4458 | + } | |
4459 | + if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){ | |
4460 | + getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数"); | |
4461 | + th.data.is_summit_ing = 0; | |
4462 | + return false; | |
4463 | + } | |
4464 | + | |
4465 | + } | |
4466 | + | |
4467 | + //如果不立即购买或者秒杀,如果是线下库存购买的时候 | |
4468 | + if ([0,3,5,7,10].indexOf(goods.prom_type)>-1 && th.data.sales_rules >= 2 && !g_item.whsle_id && !getApp().is_virtual(g_item) ) { | |
4352 | 4469 | var isok = 1; |
4353 | 4470 | await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) { |
4354 | 4471 | isok = res; |
... | ... | @@ -4535,10 +4652,10 @@ Page({ |
4535 | 4652 | }) |
4536 | 4653 | // pdata.keyid = th.data.bn_goods.keyid |
4537 | 4654 | } |
4538 | - | |
4655 | + // debugger | |
4539 | 4656 | var str = JSON.stringify(pdata); |
4540 | 4657 | console.log(str,'aaaaaaaaaaaaaaa'); |
4541 | - //return false; | |
4658 | + // return false; | |
4542 | 4659 | |
4543 | 4660 | wx.showLoading({ title: "加载中" }); |
4544 | 4661 | th.setData({ submit: 1, }) |
... | ... | @@ -5819,6 +5936,7 @@ Page({ |
5819 | 5936 | } |
5820 | 5937 | }).then(res => { |
5821 | 5938 | if (res.data.code == 0) { |
5939 | + | |
5822 | 5940 | var get_data = res.data.data; |
5823 | 5941 | arr.is_bz = prom.is_bz; //是不是倍增 |
5824 | 5942 | arr.is_xz_yh = arr.is_xz_yh ? arr.is_xz_yh : prom.is_xz_yh; //是不是优惠 |
... | ... | @@ -5856,6 +5974,11 @@ Page({ |
5856 | 5974 | arr.zxlbtitle = get_data.zxlbtitle; |
5857 | 5975 | arr.zx_libao = get_data.zxlibao; |
5858 | 5976 | arr.zx_lb_num = get_data.zxlb_num; |
5977 | + //立即购买,每月礼包 | |
5978 | + arr.monthlbtitle = get_data.monthlbtitle; | |
5979 | + arr.month_libao = get_data.monthlibao; | |
5980 | + arr.month_lb_num = get_data.monthlb_num; | |
5981 | + //----end------- | |
5859 | 5982 | |
5860 | 5983 | arr.prom_id = prom_id; |
5861 | 5984 | |
... | ... | @@ -6053,6 +6176,7 @@ Page({ |
6053 | 6176 | check_is_youhui: function (r_data, pick_id) { |
6054 | 6177 | let send_lb = this.data.send_lb; |
6055 | 6178 | let lodash = null; |
6179 | + | |
6056 | 6180 | r_data.forEach(item => { |
6057 | 6181 | if (send_lb[pick_id]) { |
6058 | 6182 | for (let i = 0; i < send_lb[pick_id].length; i++) { |
... | ... | @@ -6192,10 +6316,14 @@ Page({ |
6192 | 6316 | let id = e.currentTarget.dataset.id; // 获取礼包id |
6193 | 6317 | let flag = e.currentTarget.dataset.flag; |
6194 | 6318 | let url = ''; |
6195 | - if (flag == 1) { // flag =1 控制跳转到专享礼包 | |
6196 | - url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`; | |
6197 | - } else { | |
6319 | + | |
6320 | + if (flag == 2) { // flag =2 控制跳转到每月礼包 | |
6321 | + // url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`; | |
6322 | + url = `/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo?isBuy=1&id=${id}&is_act=1`; | |
6323 | + }else if (flag == 1) { | |
6198 | 6324 | url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮 |
6325 | + } else { | |
6326 | + url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`; | |
6199 | 6327 | }; |
6200 | 6328 | // console.log('myurl', url); |
6201 | 6329 | getApp().goto(url); | ... | ... |
packageE/pages/cart/cart2/cart2.wxml
... | ... | @@ -209,7 +209,7 @@ |
209 | 209 | <!-- 有送礼包 --> |
210 | 210 | <view wx:if="{{send_lb[item.pickup_id]}}"> |
211 | 211 | <block wx:for="{{send_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> |
212 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails"> | |
212 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.l_id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails"> | |
213 | 213 | <view class="flex ai_c"> |
214 | 214 | <view class="circle1">赠</view>{{send.zxlbtitle?send.zxlbtitle:send.lbtitle}} |
215 | 215 | <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> |
... | ... | @@ -220,6 +220,20 @@ |
220 | 220 | </view> |
221 | 221 | </block> |
222 | 222 | </view> |
223 | + <!-- 每月礼包 --> | |
224 | + <view wx:if="{{month_lb[item.pickup_id]}}"> | |
225 | + <block wx:for="{{month_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send"> | |
226 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.month_id}}" data-flag="2" bindtap="viewLbDetails"> | |
227 | + <view class="flex ai_c"> | |
228 | + <view class="circle1">赠</view>{{send.monthlbtitle}} | |
229 | + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
230 | + </view> | |
231 | + <view class="flex ai_c"> | |
232 | + x{{send.monthnum}}<text class="bg_jj"></text> | |
233 | + </view> | |
234 | + </view> | |
235 | + </block> | |
236 | + </view> | |
223 | 237 | <!-- 赠品的显示 --> |
224 | 238 | <view wx:if="{{send_gf[item.pickup_id]}}"> |
225 | 239 | <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> |
... | ... | @@ -416,7 +430,7 @@ |
416 | 430 | |
417 | 431 | <!-- 有送礼包 --> |
418 | 432 | <view wx:if="{{bn_goods.s_libao}}"> |
419 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{bn_goods.s_libao}}" bindtap="viewLbDetails"> | |
433 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{bn_goods.s_libao}}" data-flag="1" bindtap="viewLbDetails"> | |
420 | 434 | <view class="flex ai_c"> |
421 | 435 | <view class="circle1">赠</view>{{bn_goods.lbtitle}} |
422 | 436 | <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> |
... | ... | @@ -428,7 +442,7 @@ |
428 | 442 | </view> |
429 | 443 | <!-- 有送专享礼包 --> |
430 | 444 | <view wx:if="{{bn_goods.zx_libao}}"> |
431 | - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{bn_goods.zx_libao}}" data-flag="1" bindtap="viewLbDetails"> | |
445 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{bn_goods.zx_libao}}" bindtap="viewLbDetails"> | |
432 | 446 | <view class="flex ai_c"> |
433 | 447 | <view class="circle1">赠</view>{{bn_goods.zxlbtitle}} |
434 | 448 | <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> |
... | ... | @@ -438,6 +452,18 @@ |
438 | 452 | </view> |
439 | 453 | </view> |
440 | 454 | </view> |
455 | + <!-- 有送每月礼包 --> | |
456 | + <view wx:if="{{bn_goods.month_libao}}"> | |
457 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{bn_goods.month_libao}}" data-flag="2" bindtap="viewLbDetails"> | |
458 | + <view class="flex ai_c"> | |
459 | + <view class="circle1">赠</view>{{bn_goods.monthlbtitle}} | |
460 | + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} --> | |
461 | + </view> | |
462 | + <view class="flex ai_c"> | |
463 | + x{{bn_goods.month_lb_num}}<text class="bg_jj"></text> | |
464 | + </view> | |
465 | + </view> | |
466 | + </view> | |
441 | 467 | |
442 | 468 | |
443 | 469 | <!-- 赠品的显示 --> | ... | ... |
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.wxss
... | ... | @@ -92,7 +92,8 @@ |
92 | 92 | .box_ware_img image.data-v-3a5b7e36 { |
93 | 93 | /* width: 185rpx; |
94 | 94 | height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ |
95 | - border: 2rpx solid #999; | |
95 | + border: 2rpx solid #fafaf9; | |
96 | + border-radius: 4rpx; | |
96 | 97 | width: 120rpx; |
97 | 98 | height: 120rpx; |
98 | 99 | background-color: #f8f8f8; | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
... | ... | @@ -214,6 +214,43 @@ Page({ |
214 | 214 | url: '/packageE/pages/togoin/togoin', |
215 | 215 | }) |
216 | 216 | }, |
217 | + getListInfo: function (e) { | |
218 | + var th = this; | |
219 | + getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, { | |
220 | + isShowLoading: true, | |
221 | + data: { | |
222 | + // store_id: a.stoid, //商家ID | |
223 | + // user_id: d.user_id, //用户ID | |
224 | + // page: 1, | |
225 | + // pageSize: 10, | |
226 | + // is_end:0, | |
227 | + // timetype:1, | |
228 | + // id:th.data.params.id | |
229 | + }, | |
230 | + success: function (res) { | |
231 | + if (res.data.code == 0) { | |
232 | + // th.data.curpage++; | |
233 | + // var arr1 = th.data.wareCard; | |
234 | + let obj = res.data.data; | |
235 | + let monthgiftbag={ | |
236 | + remark:obj.remark, | |
237 | + cover_img:obj.imageurl, | |
238 | + giftTitle:obj.act_name, | |
239 | + lbPrice:obj.oldPrice | |
240 | + } | |
241 | + let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | |
242 | + monthgiftbag.remark=remark | |
243 | + th.setData({ | |
244 | + monthgiftbag: monthgiftbag, | |
245 | + }) | |
246 | + }else { | |
247 | + getApp().my_warnning("获取活动失败", 0, th); | |
248 | + } | |
249 | + | |
250 | + } | |
251 | + }) | |
252 | + | |
253 | + }, | |
217 | 254 | getList: function (e) { |
218 | 255 | var th = this; |
219 | 256 | getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { |
... | ... | @@ -367,7 +404,11 @@ Page({ |
367 | 404 | getApp().goto('/packageE/pages/togoin/togoin'); |
368 | 405 | return false; |
369 | 406 | } |
370 | - this.getList(); | |
407 | + if (th.data.params && th.data.params.is_act) { | |
408 | + this.getListInfo() | |
409 | + }else{ | |
410 | + this.getList(); | |
411 | + } | |
371 | 412 | }) |
372 | 413 | |
373 | 414 | setTimeout(()=>{ | ... | ... |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | |
150 | 150 | <view class="foot_empty data-v-3a5b7e36"></view> |
151 | 151 | |
152 | - <block wx:if="{{flag != 1}}"> | |
152 | + <block wx:if="{{flag != 1 && (params && !params.is_act)}}"> | |
153 | 153 | <block wx:if="{{getUserID && monthgiftbag.giftTitle}}"> |
154 | 154 | <block wx:if="{{isStart==1}}"> |
155 | 155 | <view class="foot_button data-v-3a5b7e36"> |
... | ... | @@ -229,7 +229,9 @@ |
229 | 229 | <!-- 弹出框扫描 --> |
230 | 230 | <qr_code id="qc_com"></qr_code> |
231 | 231 | <!-- 制作一个圆球导航 --> |
232 | -<nav_b id="nav_b"></nav_b> | |
232 | +<block wx:if="{{!params || (params && params.is_act !=1)}}"> | |
233 | + <nav_b id="nav_b" ></nav_b> | |
234 | +</block> | |
233 | 235 | |
234 | 236 | <include src="../public/buy_com.wxml"></include> |
235 | 237 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas> | ... | ... |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss
... | ... | @@ -92,7 +92,8 @@ |
92 | 92 | .box_ware_img image.data-v-3a5b7e36 { |
93 | 93 | /* width: 185rpx; |
94 | 94 | height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ |
95 | - border: 2rpx solid #999; | |
95 | + border: 2rpx solid #fafaf9; | |
96 | + border-radius: 4rpx; | |
96 | 97 | width: 120rpx; |
97 | 98 | height: 120rpx; |
98 | 99 | background-color: #f8f8f8; | ... | ... |
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.wxss
... | ... | @@ -92,7 +92,8 @@ |
92 | 92 | .box_ware_img image.data-v-3a5b7e36 { |
93 | 93 | /* width: 185rpx; |
94 | 94 | height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ |
95 | - border: 2rpx solid #999; | |
95 | + border: 2rpx solid #fafaf9; | |
96 | + border-radius: 4rpx; | |
96 | 97 | width: 120rpx; |
97 | 98 | height: 120rpx; |
98 | 99 | background-color: #f8f8f8; | ... | ... |
packageE/pages/user/nick_avatar_add/nick_avatar_add.js
0 → 100644
1 | +// pages/user/userfw/userfw.js | |
2 | +var e = getApp(), os = e.globalData.setting; | |
3 | +var utils = require('../../../../utils/util.js'); | |
4 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
5 | + | |
6 | + | |
7 | +Page({ | |
8 | + /** | |
9 | + * 页面的初始数据 | |
10 | + */ | |
11 | + data: { | |
12 | + defaultAvatar: os.imghost + "/miniapp/images/no-head.jpg", | |
13 | + ob: {}, | |
14 | + load: 0 | |
15 | + }, | |
16 | + | |
17 | + /** | |
18 | + * 生命周期函数--监听页面加载 | |
19 | + */ | |
20 | + onLoad: function (options) { | |
21 | + if(getApp().globalData.up_nick_avatar){ | |
22 | + this.setData({ | |
23 | + ob: JSON.parse(JSON.stringify(getApp().globalData.up_nick_avatar)) | |
24 | + }) | |
25 | + getApp().globalData.up_nick_avatar=null; | |
26 | + } | |
27 | + | |
28 | + }, | |
29 | + /** | |
30 | + * 生命周期函数--监听页面显示 | |
31 | + */ | |
32 | + onShow: async function () { | |
33 | + | |
34 | + }, | |
35 | + | |
36 | + | |
37 | + onChooseAvatar: function (e) { | |
38 | + console.log(e, 1111); | |
39 | + var th = this; | |
40 | + getApp().request.uploadFile(os.url + "/api/weshop/comment/uploadCommentImg", { | |
41 | + filePath: e.detail.avatarUrl, | |
42 | + name: "file", | |
43 | + success: function (t) { | |
44 | + var u = t.data.data; | |
45 | + th.setData({'ob.head_pic': u}) | |
46 | + } | |
47 | + }); | |
48 | + | |
49 | + }, | |
50 | + | |
51 | + get_val: function (e) { | |
52 | + console.log(e, 2222); | |
53 | + this.setData({'ob.nickname': e.detail.value}) | |
54 | + }, | |
55 | + | |
56 | + save_data() { | |
57 | + | |
58 | + var that=this; | |
59 | + setTimeout(()=>{ | |
60 | + if (!this.data.ob.head_pic) { | |
61 | + wx.showToast({ | |
62 | + title: '请选择头像', | |
63 | + icon: 'none', | |
64 | + duration: 2000 | |
65 | + }); | |
66 | + return false; | |
67 | + } | |
68 | + | |
69 | + if (!this.data.ob.nickname) { | |
70 | + wx.showToast({ | |
71 | + title: '请输入昵称', | |
72 | + icon: 'none', | |
73 | + duration: 2000 | |
74 | + }); | |
75 | + return false; | |
76 | + } | |
77 | + | |
78 | + if (this.data.load) return false; | |
79 | + this.setData({load: 1}) | |
80 | + | |
81 | + wx.showLoading(); | |
82 | + | |
83 | + getApp().request.put("/api/weshop/users/update", { | |
84 | + data: { | |
85 | + store_id: os.stoid, | |
86 | + user_id: getApp().globalData.user_id, | |
87 | + nickname: this.data.ob.nickname, | |
88 | + head_pic: this.data.ob.head_pic | |
89 | + | |
90 | + }, | |
91 | + success: function (su) { | |
92 | + | |
93 | + setTimeout(()=>{ | |
94 | + wx.hideLoading(); | |
95 | + if (su.data.code == 0) { | |
96 | + wx.navigateBack({delta: 1}) | |
97 | + }else{ | |
98 | + that.setData({load: 0}) | |
99 | + wx.showToast({ | |
100 | + title: su.data.msg, | |
101 | + icon: 'none', | |
102 | + duration: 2000 | |
103 | + }); | |
104 | + } | |
105 | + },1000) | |
106 | + | |
107 | + | |
108 | + } | |
109 | + }); | |
110 | + },500) | |
111 | + | |
112 | + | |
113 | + }, | |
114 | + save_cell(){ | |
115 | + if (!this.data.ob.head_pic) { | |
116 | + wx.showToast({ | |
117 | + title: '请选择头像', | |
118 | + icon: 'none', | |
119 | + duration: 2000 | |
120 | + }); | |
121 | + return false; | |
122 | + } | |
123 | + if (!this.data.ob.nickname) { | |
124 | + wx.showToast({ | |
125 | + title: '请输入昵称', | |
126 | + icon: 'none', | |
127 | + duration: 2000 | |
128 | + }); | |
129 | + return false; | |
130 | + } | |
131 | + if (this.data.load) return false; | |
132 | + this.setData({load: 1}) | |
133 | + wx.setStorageSync('nick_obj', this.data.ob) | |
134 | + wx.navigateBack() | |
135 | + } | |
136 | + | |
137 | +}) | |
0 | 138 | \ No newline at end of file | ... | ... |
packageE/pages/user/nick_avatar_add/nick_avatar_add.json
0 → 100644
packageE/pages/user/nick_avatar_add/nick_avatar_add.wxml
0 → 100644
1 | +<view class='page_set'> | |
2 | + <view class="item flex jc_sb ai_c"> | |
3 | + <view>头像</view> | |
4 | + <button open-type='chooseAvatar' bind:chooseavatar="onChooseAvatar" class="avatar_btn"> | |
5 | + <image class="head_img" src="{{ob.head_pic || defaultAvatar}} "></image> | |
6 | + </button> | |
7 | + </view> | |
8 | + | |
9 | + <view class="item flex jc_sb ai_c"> | |
10 | + <view>昵称</view> | |
11 | + <view> | |
12 | + <input maxlength="10" class="nick_inp" type="nickname" placeholder="用户昵称" value="{{ob.nickname || ''}}" bind:change='get_val' ></input> | |
13 | + </view> | |
14 | + </view> | |
15 | + | |
16 | + | |
17 | + | |
18 | + <!-- 确认修改按钮 --> | |
19 | + <view class="flex-center confirm"> | |
20 | + <view class="flex-center fs30 confirmtext {{load?'load':''}}" bindtap="save_cell"> | |
21 | + <view>确认</view> | |
22 | + </view> | |
23 | + </view> | |
24 | + | |
25 | +</view> | |
0 | 26 | \ No newline at end of file | ... | ... |
packageE/pages/user/nick_avatar_add/nick_avatar_add.wxss
0 → 100644
1 | +.avatar_btn{ width: 60rpx !important; height: 60rpx !important; border-radius:50%; border: none !important; | |
2 | + margin-left:0 !important;margin-right: 0 !important; } | |
3 | +.head_img{ width: 60rpx; height: 60rpx; border-radius: 50%} | |
4 | + | |
5 | +.page_set{ border-top: 20rpx solid #eee; } | |
6 | +.item{ height: 80rpx; border-bottom: 1rpx solid #eee;padding:0 20rpx} | |
7 | +.nick_inp{ text-align: right; color: #999} | |
8 | + | |
9 | + | |
10 | +.confirm { | |
11 | + width: 100%; | |
12 | + left: 0rpx; | |
13 | + bottom: 0rpx; | |
14 | + height: 130rpx; | |
15 | + background-color: rgb(255, 255, 255); | |
16 | + z-index: 9; | |
17 | + | |
18 | +} | |
19 | + | |
20 | +.confirmtext { | |
21 | + width: 495rpx; | |
22 | + height: 65rpx; | |
23 | + color: rgb(255, 255, 255); | |
24 | + background-color: rgb(214, 1, 33); | |
25 | + border-radius: 35rpx; | |
26 | +} | |
27 | + | |
28 | +.load{ | |
29 | + background-color:#eee !important; | |
30 | +} | |
0 | 31 | \ No newline at end of file | ... | ... |
pages/activity/pind_list/pind_list.js
... | ... | @@ -18,7 +18,9 @@ Page({ |
18 | 18 | iurl: os.imghost, |
19 | 19 | ad_data: null, |
20 | 20 | max_sw_height: 200, |
21 | - is_retail_price:0 | |
21 | + is_retail_price:0, | |
22 | + isget:0, | |
23 | + msgStatus:false | |
22 | 24 | }, |
23 | 25 | |
24 | 26 | //------初始化加载---------- |
... | ... | @@ -81,7 +83,7 @@ Page({ |
81 | 83 | }, |
82 | 84 | |
83 | 85 | onShow: function (t) { |
84 | - getApp().check_can_share(); | |
86 | + getApp().check_can_share(); | |
85 | 87 | this.data.is_timer = 1; |
86 | 88 | this.data.currentPage = 1; |
87 | 89 | this.data.ismore = 1; |
... | ... | @@ -142,14 +144,14 @@ Page({ |
142 | 144 | //读取数据 |
143 | 145 | async requestSalelist() { |
144 | 146 | if (!this.data.ismore) return false; |
145 | - var e = this, | |
146 | - th = e, | |
147 | - i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; | |
148 | - var plist = [], | |
149 | - alllist = th.data.goodlist; | |
147 | + var e = this,th = e; | |
148 | + var i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; | |
149 | + var plist = [],alllist = th.data.goodlist; | |
150 | 150 | if (!alllist) alllist = []; |
151 | + | |
152 | + wx.showLoading(); | |
151 | 153 | await getApp().request.promiseGet(i, { |
152 | - isShowLoading: 1, | |
154 | + isShowLoading: 0, | |
153 | 155 | data: { |
154 | 156 | store_id: os.stoid, |
155 | 157 | is_end: 0, |
... | ... | @@ -161,28 +163,82 @@ Page({ |
161 | 163 | }); |
162 | 164 | |
163 | 165 | if (plist.length <= 0) { |
164 | - getApp().showWarning("没有更多数据"); | |
166 | + | |
167 | + | |
165 | 168 | th.data.ismore = 0; |
166 | - } | |
167 | - //--循环读取接口--- | |
168 | - for (var i = 0; i < plist.length; i++) { | |
169 | - var prom_id = plist[i].id; | |
170 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
171 | - os.stoid + "/6/" + prom_id, {}).then(res => { | |
172 | - if (res.data.code == 0) { | |
173 | - plist[i].status = 1; | |
174 | - if (res.data.data <= 0) plist[i].status = 3; | |
169 | + //没有数据切换 | |
170 | + if (e.data.currentPage == 1 && this.data.type == 1) { | |
171 | + | |
172 | + e.data.currentPage=1; | |
173 | + i = "/api/weshop/teamlist/pageteam/0?page=" + e.data.currentPage; | |
174 | + await getApp().request.promiseGet(i, { | |
175 | + isShowLoading: 0, | |
176 | + data: { | |
177 | + store_id: os.stoid, | |
178 | + is_end: 0, | |
179 | + is_show: 1, | |
180 | + user_id:getApp().globalData.user_id, | |
181 | + } | |
182 | + }).then(res => { | |
183 | + if(ut.ajax_ok(res)){ | |
184 | + th.data.b_plist = res.data.data.pageData; | |
185 | + } | |
186 | + }); | |
187 | + | |
188 | + wx.hideLoading(); | |
189 | + if(th.data.b_plist){ | |
190 | + //组件的id | |
191 | + var auto_go = th.selectComponent("#auto_go"); | |
192 | + auto_go.show(); | |
193 | + | |
194 | + }else{ | |
195 | + getApp().showWarning("没有更多数据"); | |
175 | 196 | } |
176 | - }); | |
177 | - alllist.push(plist[i]); | |
197 | + | |
198 | + // if(plist){ | |
199 | + // setTimeout(function () { | |
200 | + // th.data.ismore = 1; | |
201 | + // th.setData({ | |
202 | + // type: 0 | |
203 | + // }); | |
204 | + // th.requestSalelist(); | |
205 | + // }, 1000); | |
206 | + // } | |
207 | + | |
208 | + } | |
209 | + else{ | |
210 | + wx.hideLoading(); | |
211 | + getApp().showWarning("没有更多数据"); | |
212 | + } | |
213 | + | |
214 | + return false; | |
178 | 215 | } |
179 | - e.data.currentPage++; | |
180 | 216 | |
217 | + if(plist) { | |
218 | + //--循环读取接口--- | |
219 | + for (var i = 0; i < plist.length; i++) { | |
220 | + var prom_id = plist[i].id; | |
221 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
222 | + os.stoid + "/6/" + prom_id, {}).then(res => { | |
223 | + if (res.data.code == 0) { | |
224 | + plist[i].status = 1; | |
225 | + if (res.data.data <= 0) plist[i].status = 3; | |
226 | + } | |
227 | + }); | |
228 | + alllist.push(plist[i]); | |
229 | + } | |
230 | + e.data.currentPage++; | |
231 | + } | |
181 | 232 | th.setData({ |
182 | 233 | goodlist: alllist, |
183 | 234 | isshow: 1, |
184 | - ismore:0, | |
235 | + is_get:1, | |
185 | 236 | }); |
237 | + | |
238 | + setTimeout(()=>{ | |
239 | + wx.hideLoading(); | |
240 | + },500) | |
241 | + | |
186 | 242 | }, |
187 | 243 | |
188 | 244 | onPullDownRefresh: function () { |
... | ... | @@ -205,6 +261,12 @@ Page({ |
205 | 261 | type: a, |
206 | 262 | goodlist: [] |
207 | 263 | }); |
264 | + | |
265 | + if(a==0){ | |
266 | + var auto_go = th.selectComponent("#auto_go"); | |
267 | + auto_go.stop(); | |
268 | + } | |
269 | + | |
208 | 270 | this.reloadGoodList(); |
209 | 271 | }, |
210 | 272 | |
... | ... | @@ -276,7 +338,7 @@ Page({ |
276 | 338 | } |
277 | 339 | }, |
278 | 340 | |
279 | - onShareTimeline() { | |
341 | + onShareTimeline() { | |
280 | 342 | getApp().globalData.no_clear=1; |
281 | 343 | var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; |
282 | 344 | if (!store_name) |
... | ... | @@ -302,4 +364,44 @@ Page({ |
302 | 364 | } |
303 | 365 | }, |
304 | 366 | |
367 | + //-- 自动数数,要进行跳转 --- | |
368 | + async auto_back(){ | |
369 | + | |
370 | + var e=this,th=this; | |
371 | + th.setData({ type: 0 }); | |
372 | + wx.showLoading(); | |
373 | + | |
374 | + var plist=this.data.b_plist; | |
375 | + var alllist = th.data.goodlist; | |
376 | + if (!alllist) alllist = []; | |
377 | + | |
378 | + if(plist) { | |
379 | + //--循环读取接口--- | |
380 | + for (var i = 0; i < plist.length; i++) { | |
381 | + var prom_id = plist[i].id; | |
382 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
383 | + os.stoid + "/6/" + prom_id, {}).then(res => { | |
384 | + if (res.data.code == 0) { | |
385 | + plist[i].status = 1; | |
386 | + if (res.data.data <= 0) plist[i].status = 3; | |
387 | + } | |
388 | + }); | |
389 | + alllist.push(plist[i]); | |
390 | + } | |
391 | + e.data.currentPage++; | |
392 | + } | |
393 | + th.setData({ | |
394 | + goodlist: alllist, | |
395 | + isshow: 1, | |
396 | + is_get:1, | |
397 | + }); | |
398 | + | |
399 | + setTimeout(()=>{ | |
400 | + wx.hideLoading(); | |
401 | + },400) | |
402 | + | |
403 | + | |
404 | + } | |
405 | + | |
406 | + | |
305 | 407 | }); |
306 | 408 | \ No newline at end of file | ... | ... |
pages/activity/pind_list/pind_list.json
pages/activity/pind_list/pind_list.wxml
... | ... | @@ -104,9 +104,10 @@ |
104 | 104 | |
105 | 105 | </view> |
106 | 106 | |
107 | -<view class="no-more" wx:if="{{goodlist.length==0 && !ismore}}">没有相关内容</view> | |
108 | -</view> | |
107 | +<view class="no-more" wx:if="{{goodlist.length==0 && isget}}">没有相关内容</view> | |
108 | +<auto_go id="auto_go" bind:childFun="auto_back"></auto_go> | |
109 | 109 | |
110 | 110 | |
111 | +</view> | |
111 | 112 | |
112 | 113 | <share_box id="share"></share_box> |
113 | 114 | \ No newline at end of file | ... | ... |
pages/activity/seckill_list/seckill_list.js
... | ... | @@ -11,7 +11,7 @@ Page({ |
11 | 11 | killtime: null, |
12 | 12 | currentPage: 1, |
13 | 13 | goodlist: null, |
14 | - type: 1, | |
14 | + type: 1, //1是进行中 0是即将开始 | |
15 | 15 | timer: null, |
16 | 16 | ismore: 1, //是否可以加载更多 |
17 | 17 | isshow: 0, |
... | ... | @@ -167,6 +167,7 @@ Page({ |
167 | 167 | if (!alllist) alllist = []; |
168 | 168 | var user_id = getApp().globalData.user_id; |
169 | 169 | if (!user_id) user_id = user_id; |
170 | + | |
170 | 171 | var req = { |
171 | 172 | store_id: os.stoid, |
172 | 173 | timetype: th.data.type, |
... | ... | @@ -175,27 +176,51 @@ Page({ |
175 | 176 | user_id: user_id |
176 | 177 | }; |
177 | 178 | |
179 | + wx.showLoading(); | |
180 | + | |
178 | 181 | await getApp().request.promiseGet(i, { |
179 | - isShowLoading: 1, | |
182 | + isShowLoading: 0, | |
180 | 183 | data: req |
181 | 184 | }).then(res => { |
182 | 185 | if (ut.ajax_ok(res)) plist = res.data.data.pageData; |
183 | - | |
184 | 186 | }); |
185 | 187 | |
186 | 188 | if (!plist || plist.length <= 0) { |
187 | 189 | |
188 | - getApp().showWarning("没有更多数据"); | |
190 | + wx.hideLoading(); | |
191 | + | |
189 | 192 | th.data.ismore = 0; |
190 | 193 | if (e.data.currentPage == 1 && this.data.type == 1) { |
191 | - setTimeout(function () { | |
192 | - th.data.ismore = 1; | |
193 | - th.setData({ | |
194 | - type: 0 | |
194 | + | |
195 | + //-- 弄到即将开始 -- | |
196 | + req.timetype=0; | |
197 | + await getApp().request.promiseGet(i, { | |
198 | + isShowLoading: 0, | |
199 | + data: req | |
200 | + }).then(res => { | |
201 | + if (ut.ajax_ok(res)) th.data.b_plist = res.data.data.pageData; | |
195 | 202 | }); |
196 | - th.requestSalelist(); | |
197 | - }, 1000); | |
203 | + | |
204 | + wx.hideLoading(); | |
205 | + if(th.data.b_plist){ | |
206 | + //组件的id | |
207 | + var auto_go = th.selectComponent("#auto_go"); | |
208 | + auto_go.show(); | |
209 | + }else{ | |
210 | + getApp().showWarning("没有更多数据"); | |
211 | + } | |
212 | + // setTimeout(function () { | |
213 | + // th.data.ismore = 1; | |
214 | + // th.setData({ | |
215 | + // type: 0 | |
216 | + // }); | |
217 | + // th.requestSalelist(); | |
218 | + // }, 1000); | |
219 | + }else{ | |
220 | + wx.hideLoading(); | |
221 | + getApp().showWarning("没有更多数据"); | |
198 | 222 | } |
223 | + | |
199 | 224 | return false; |
200 | 225 | } |
201 | 226 | |
... | ... | @@ -203,6 +228,14 @@ Page({ |
203 | 228 | for (var i = 0; i < plist.length; i++) { |
204 | 229 | |
205 | 230 | if (plist[i].user_price) plist[i].price = plist[i].user_price; |
231 | + let price=plist[i].price+'' | |
232 | + if (price && price.indexOf('.')>-1) { | |
233 | + let priceArr = price.split(".") | |
234 | + plist[i].price_n = priceArr[0] | |
235 | + plist[i].price_xs = priceArr[1] | |
236 | + }else{ | |
237 | + plist[i].price_n = price | |
238 | + } | |
206 | 239 | var prom_id = plist[i].id; |
207 | 240 | await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + |
208 | 241 | os.stoid + "/1/" + prom_id, {} |
... | ... | @@ -221,6 +254,10 @@ Page({ |
221 | 254 | isshow: 1 |
222 | 255 | }); |
223 | 256 | |
257 | + setTimeout(()=>{ | |
258 | + wx.hideLoading(); | |
259 | + },500) | |
260 | + | |
224 | 261 | |
225 | 262 | |
226 | 263 | }, |
... | ... | @@ -244,6 +281,12 @@ Page({ |
244 | 281 | type: a, |
245 | 282 | goodlist: null |
246 | 283 | }); |
284 | + | |
285 | + if(a==0){ | |
286 | + var auto_go = th.selectComponent("#auto_go"); | |
287 | + auto_go.stop(); | |
288 | + } | |
289 | + | |
247 | 290 | this.reloadGoodList(); |
248 | 291 | }, |
249 | 292 | |
... | ... | @@ -336,4 +379,50 @@ Page({ |
336 | 379 | getApp().goto(url); |
337 | 380 | } |
338 | 381 | }, |
382 | + | |
383 | + async auto_back(){ | |
384 | + | |
385 | + var e=this,th=this; | |
386 | + th.setData({ type: 0 }); | |
387 | + wx.showLoading(); | |
388 | + | |
389 | + var plist=this.data.b_plist; | |
390 | + var alllist = th.data.goodlist; | |
391 | + if (!alllist) alllist = []; | |
392 | + | |
393 | + //--循环读取接口--- | |
394 | + for (var i = 0; i < plist.length; i++) { | |
395 | + | |
396 | + if (plist[i].user_price) plist[i].price = plist[i].user_price; | |
397 | + let price=plist[i].price+'' | |
398 | + if (price && price.indexOf('.')>-1) { | |
399 | + let priceArr = price.split(".") | |
400 | + plist[i].price_n = priceArr[0] | |
401 | + plist[i].price_xs = priceArr[1] | |
402 | + }else{ | |
403 | + plist[i].price_n = price | |
404 | + } | |
405 | + var prom_id = plist[i].id; | |
406 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
407 | + os.stoid + "/1/" + prom_id, {} | |
408 | + ).then(res => { | |
409 | + if (res.data.code == 0) { | |
410 | + plist[i].status = 1; | |
411 | + if (res.data.data <= 0) plist[i].status = 3; | |
412 | + } | |
413 | + }) | |
414 | + alllist.push(plist[i]); | |
415 | + } | |
416 | + e.data.currentPage++; | |
417 | + console.log("秒杀商品列表", alllist); | |
418 | + th.setData({ | |
419 | + goodlist: alllist, | |
420 | + isshow: 1 | |
421 | + }); | |
422 | + | |
423 | + setTimeout(()=>{ | |
424 | + wx.hideLoading(); | |
425 | + },400) | |
426 | + } | |
427 | + | |
339 | 428 | }); |
340 | 429 | \ No newline at end of file | ... | ... |
pages/activity/seckill_list/seckill_list.json
pages/activity/seckill_list/seckill_list.wxml
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | <view class="xc-strip-blank rel"> |
47 | 47 | |
48 | 48 | <view class="flex-vertical rel total"> |
49 | - <view class="t-c abs xc-fill"style="width:{{type==1?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100)>3?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100):'3':'100'}}%;background:{{type==1?'#e4374d':'#059de5'}};"> | |
49 | + <view class="t-c abs xc-fill"style="width:{{type==1?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100)>3?(100-(item.buy_num+item.virtual) /(item.goods_num+item.virtual)*100):'3':'100'}}%;background:{{type==1?'#f23030':'#059de5'}};"> | |
50 | 50 | </view> |
51 | 51 | <text class="fs20 white abs xc-fill-text" style="">剩余{{type==1?filters.toFix(100-(item.buy_num+item.virtual)/(item.goods_num+item.virtual)*100,0):'100'}}%</text> |
52 | 52 | </view> |
... | ... | @@ -68,7 +68,8 @@ |
68 | 68 | </view> |
69 | 69 | <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" > |
70 | 70 | <view class="fs28" style="line-height: 16px;">¥</view> |
71 | - <text>{{item.price}}</text> | |
71 | + <text>{{item.price_n}}</text> | |
72 | + <view class="fs28" style="line-height: 16px;" wx:if="{{item.price_xs}}">.{{item.price_xs}}</view> | |
72 | 73 | <span wx:if="{{is_retail_price}}" class="underline fs20 no_line_x">零售价¥{{item.market_price}}</span> |
73 | 74 | </view> |
74 | 75 | |
... | ... | @@ -99,8 +100,10 @@ |
99 | 100 | </view> |
100 | 101 | </view> |
101 | 102 | |
102 | - | |
103 | 103 | <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view> |
104 | +<auto_go id="auto_go" bind:childFun="auto_back"></auto_go> | |
105 | + | |
106 | + | |
104 | 107 | </view> |
105 | 108 | |
106 | 109 | ... | ... |
pages/activity/seckill_list/seckill_list.wxss
pages/cart/cart/cart.js
... | ... | @@ -1559,9 +1559,9 @@ Page({ |
1559 | 1559 | valueToNum: function (t) { |
1560 | 1560 | if (!this.data.is_load) return false; |
1561 | 1561 | //控制住,避免事件响应冲突,只有input有输入的时候,才刷新 |
1562 | - if (this.data.btn_click) { | |
1563 | - return false; | |
1564 | - } | |
1562 | + // if (this.data.btn_click) { | |
1563 | + // return false; | |
1564 | + // } | |
1565 | 1565 | this.data.btn_click = 1; |
1566 | 1566 | |
1567 | 1567 | var a = t.currentTarget.dataset.item; |
... | ... | @@ -1582,7 +1582,7 @@ Page({ |
1582 | 1582 | }, |
1583 | 1583 | |
1584 | 1584 | //-------------加数量--------------------- |
1585 | - addNum: function (t) { | |
1585 | + addNum:async function (t) { | |
1586 | 1586 | if (!this.data.is_load) return false; |
1587 | 1587 | if (this.data.up_dating == 1) return false; |
1588 | 1588 | this.data.up_dating = 1; |
... | ... | @@ -1594,7 +1594,6 @@ Page({ |
1594 | 1594 | console.log('add+'); |
1595 | 1595 | |
1596 | 1596 | if (this.data.sales_rules < 2 || a.whsle_id || [1, 2, 4, 6, 8, 9].indexOf(a.prom_type) > -1) { |
1597 | - | |
1598 | 1597 | if (a.goods_num > a.store_count) { |
1599 | 1598 | console.log('购买的数量不能-----'); |
1600 | 1599 | // wx.showModal({ |
... | ... | @@ -1612,19 +1611,28 @@ Page({ |
1612 | 1611 | } |
1613 | 1612 | } |
1614 | 1613 | |
1614 | + var add_num=1; | |
1615 | + //调用接口判断是不是促销活动的商品 | |
1616 | + if([0,3,5,7,10].indexOf(a.prom_type) > -1){ | |
1617 | + var cx_arr=await getApp().get_has_cx_act(a.goods_id); | |
1618 | + var steep=getApp().get_limit_qty(a,cx_arr.length,1); | |
1619 | + if(steep>1){ | |
1620 | + add_num=steep; | |
1621 | + } | |
1622 | + } | |
1615 | 1623 | |
1616 | 1624 | var e = { |
1617 | - goods_num: a.goods_num + 1, | |
1625 | + goods_num: a.goods_num + add_num, | |
1618 | 1626 | id: a.id, |
1619 | 1627 | goods_id: a.goods_id, |
1620 | 1628 | store_id: oo.stoid |
1621 | 1629 | }; |
1622 | 1630 | // console.log('goods_num', e.goods_num); |
1623 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
1631 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems,cx_arr); | |
1624 | 1632 | |
1625 | 1633 | }, |
1626 | 1634 | //-------------减数量--------------------- |
1627 | - subNum: function (t) { | |
1635 | + subNum: async function (t) { | |
1628 | 1636 | if (!this.data.is_load) return false; |
1629 | 1637 | if (this.data.up_dating == 1) return false; |
1630 | 1638 | this.data.up_dating = 1; |
... | ... | @@ -1640,16 +1648,28 @@ Page({ |
1640 | 1648 | } |
1641 | 1649 | |
1642 | 1650 | |
1651 | + var add_num=1; | |
1652 | + if([0,3,5,7,10].indexOf(a.prom_type) > -1){ | |
1653 | + var cx_arr=await getApp().get_has_cx_act(a.goods_id); | |
1654 | + var steep = getApp().get_limit_qty(a, cx_arr.length, 1); | |
1655 | + if (steep > 1) { | |
1656 | + add_num = steep; | |
1657 | + } | |
1658 | + } | |
1643 | 1659 | |
1644 | - if (1 != a.goods_num) { | |
1645 | - var e = { | |
1646 | - goods_num: a.goods_num - 1, | |
1647 | - id: a.id, | |
1648 | - goods_id: a.goods_id, | |
1649 | - store_id: oo.stoid | |
1650 | - }; | |
1651 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
1660 | + var e = { | |
1661 | + goods_num: a.goods_num - add_num, | |
1662 | + id: a.id, | |
1663 | + goods_id: a.goods_id, | |
1664 | + store_id: oo.stoid | |
1665 | + }; | |
1666 | + | |
1667 | + if(e.goods_num<=0){ | |
1668 | + this.data.up_dating = 0; | |
1669 | + return false; | |
1652 | 1670 | } |
1671 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
1672 | + | |
1653 | 1673 | }, |
1654 | 1674 | |
1655 | 1675 | |
... | ... | @@ -1754,6 +1774,33 @@ Page({ |
1754 | 1774 | }, |
1755 | 1775 | |
1756 | 1776 | |
1777 | + click_set_limit(gd_info,pitems,item,act){ | |
1778 | + var th=this; | |
1779 | + var mo_num=getApp().get_limit_qty(gd_info,act.length); | |
1780 | + var steep=getApp().get_limit_qty(gd_info,act.length,1); | |
1781 | + if(gd_info.is_integral_normal || gd_info.is_pd_normal || [0,3,5,7,10].indexOf(gd_info.prom_type) > -1){ | |
1782 | + | |
1783 | + var ue = { | |
1784 | + goods_num: gd_info.goods_num,store_id: oo.stoid, | |
1785 | + id: gd_info.id,goods_id: gd_info.goods_id | |
1786 | + }; | |
1787 | + var up_num=0; | |
1788 | + if(mo_num>gd_info.goods_num){ | |
1789 | + up_num=mo_num; | |
1790 | + } | |
1791 | + if(gd_info.goods_num>mo_num && (gd_info.goods_num-mo_num)%steep!=0 && steep>1){ | |
1792 | + up_num=mo_num+ parseInt((gd_info.goods_num-mo_num)/steep)*steep+steep; | |
1793 | + } | |
1794 | + if(up_num){ | |
1795 | + ue.goods_num=up_num; | |
1796 | + th.update_cart(ue, pitems, item); | |
1797 | + var txt1 = "requestData[" + pitems + "].goods[" + item + "].goods_num"; | |
1798 | + th.setData({[txt1]:up_num }) | |
1799 | + } | |
1800 | + } | |
1801 | + }, | |
1802 | + | |
1803 | + | |
1757 | 1804 | //---------------全选,全选的时候要判断是否门店的匹配方式一致-------------- |
1758 | 1805 | checkAll: async function () { |
1759 | 1806 | var e = this, |
... | ... | @@ -1792,11 +1839,19 @@ Page({ |
1792 | 1839 | [txt]: 0, |
1793 | 1840 | }); |
1794 | 1841 | } |
1842 | + | |
1795 | 1843 | var fir = 0; |
1796 | 1844 | for (var j = 0; j < item.length; j++) { |
1797 | 1845 | if (item[j].is_gift) continue; |
1798 | - | |
1799 | 1846 | var obj = JSON.parse(JSON.stringify(item[j])); |
1847 | + | |
1848 | + //-- 判断起购数量 -- | |
1849 | + if(!e.data.checkAllToggle){ | |
1850 | + //判断是不是有促销活动 | |
1851 | + var act=await getApp().get_has_cx_act(obj.goods_id); | |
1852 | + th.click_set_limit(obj,i,j,act); | |
1853 | + } | |
1854 | + | |
1800 | 1855 | //计算之前先移除组合购的计算 |
1801 | 1856 | if (obj.prom_type == 7) |
1802 | 1857 | zh_calc.remove_zhprom(dda, i, obj); |
... | ... | @@ -1884,7 +1939,7 @@ Page({ |
1884 | 1939 | |
1885 | 1940 | // if (!e.data.checkAllToggle) { |
1886 | 1941 | //多门店优惠促销次数控制 |
1887 | - if(dda[i].pro_off){ | |
1942 | + if(dda[i].pro_off || e.data.checkAllToggle){ | |
1888 | 1943 | var txt = "requestData[" + i + "].selected"; |
1889 | 1944 | e.setData({ |
1890 | 1945 | [txt]: 0, |
... | ... | @@ -2037,13 +2092,17 @@ Page({ |
2037 | 2092 | } |
2038 | 2093 | |
2039 | 2094 | let pro_off=false |
2040 | - | |
2041 | 2095 | for (var i = 0; i < item.length; i++) { |
2042 | 2096 | let pro_off1=false |
2043 | 2097 | var txt = "requestData[" + pitems + "].goods[" + i + "].selected"; |
2044 | - | |
2045 | 2098 | var gd_info = item[i]; |
2046 | - if (th.data.sales_rules >= 2 && !gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 && !gd_info.selected) { | |
2099 | + | |
2100 | + if(!sele) { | |
2101 | + var act=await getApp().get_has_cx_act(gd_info.goods_id); | |
2102 | + th.click_set_limit(gd_info,pitems,i,act) | |
2103 | + } | |
2104 | + | |
2105 | + if(!gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 && !gd_info.selected && th.data.sales_rules >= 2 ) { | |
2047 | 2106 | var ob = {}; |
2048 | 2107 | await th.check_down_line_next(gd_info, pitems, i, gd_info.erpwareid, function (res) { |
2049 | 2108 | ob = res; |
... | ... | @@ -2227,45 +2286,56 @@ Page({ |
2227 | 2286 | var gd_info = a; |
2228 | 2287 | |
2229 | 2288 | var erpwareid = gd_info.erpwareid; |
2230 | - if (th.data.sales_rules >= 2 && !gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 && !a.selected) { | |
2231 | - var ob = {}; | |
2232 | - await th.check_down_line_next(gd_info, pitems, item, erpwareid, function (res) { | |
2233 | - ob = res; | |
2234 | - }); | |
2235 | - | |
2236 | - if (ob.code == -1) { | |
2237 | - | |
2238 | - wx.showToast({ | |
2239 | - title: '购买数量超出商品库存', | |
2240 | - icon: 'none', | |
2241 | - }); | |
2242 | 2289 | |
2243 | - return false; | |
2244 | - } else { | |
2245 | - if (th.data.sales_rules == 3) { | |
2246 | - var goods_id = gd_info.goods_id; | |
2247 | - var num = 0; | |
2290 | + //-- 如果是选中的时候 -- | |
2291 | + if(!a.selected){ | |
2292 | + //判断是不是有促销活动 | |
2293 | + var act=await getApp().get_has_cx_act(gd_info.goods_id); | |
2294 | + //-- 专门来设置商品订购数量 -- | |
2295 | + th.click_set_limit(gd_info,pitems,item,act) | |
2296 | + if (th.data.sales_rules >= 2 && !gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 ) { | |
2248 | 2297 | |
2249 | - for (let i = 0; i < th.data.requestData.length; i++) { | |
2250 | - if (pitems == i) continue; | |
2251 | - var it = th.data.requestData[i].goods.find((e) => { | |
2252 | - return e.goods_id == goods_id; | |
2253 | - }) | |
2254 | - if (it && it.selected) num += it.goods_num | |
2255 | - } | |
2298 | + var ob = {}; | |
2299 | + await th.check_down_line_next(gd_info, pitems, item, erpwareid, function (res) { | |
2300 | + ob = res; | |
2301 | + }); | |
2302 | + if (ob.code == -1) { | |
2256 | 2303 | |
2257 | - if (num > ob.CanOutQty) { | |
2258 | 2304 | wx.showToast({ |
2259 | 2305 | title: '购买数量超出商品库存', |
2260 | 2306 | icon: 'none', |
2261 | 2307 | }); |
2262 | 2308 | |
2263 | 2309 | return false; |
2310 | + } else { | |
2311 | + if (th.data.sales_rules == 3) { | |
2312 | + var goods_id = gd_info.goods_id; | |
2313 | + var num = 0; | |
2314 | + | |
2315 | + for (let i = 0; i < th.data.requestData.length; i++) { | |
2316 | + if (pitems == i) continue; | |
2317 | + var it = th.data.requestData[i].goods.find((e) => { | |
2318 | + return e.goods_id == goods_id; | |
2319 | + }) | |
2320 | + if (it && it.selected) num += it.goods_num | |
2321 | + } | |
2322 | + | |
2323 | + if (num > ob.CanOutQty) { | |
2324 | + wx.showToast({ | |
2325 | + title: '购买数量超出商品库存', | |
2326 | + icon: 'none', | |
2327 | + }); | |
2328 | + | |
2329 | + return false; | |
2330 | + } | |
2331 | + } | |
2264 | 2332 | } |
2265 | - } | |
2333 | + | |
2266 | 2334 | } |
2267 | 2335 | |
2268 | 2336 | } |
2337 | + | |
2338 | + | |
2269 | 2339 | let pro_off=false |
2270 | 2340 | //判断多店优惠促销次数控制 |
2271 | 2341 | if (th.data.requestData.length>1) { |
... | ... | @@ -2529,34 +2599,56 @@ Page({ |
2529 | 2599 | }); |
2530 | 2600 | }, |
2531 | 2601 | |
2532 | - //----------------------更新购物数量,加减,调用接口--------------------- | |
2533 | - postCardList: function (t, item, pitem) { | |
2534 | - var e = this, | |
2535 | - th = e, | |
2536 | - user_id = getApp().globalData.user_id; | |
2537 | - | |
2538 | - function normal_check(store_count, goodsinfo, wareIds) { | |
2539 | - //--- 看一下是不是线下库存 --- | |
2540 | - if (th.data.sales_rules >= 2 && !goodsinfo.whsle_id) { | |
2541 | - th.check_down_line(t, pitem, item, wareIds); | |
2542 | - } else { | |
2543 | - if (t.goods_num > store_count) { | |
2544 | - wx.showToast({ | |
2545 | - title: '购买数量超出商品库存', | |
2546 | - icon: 'none', | |
2547 | - }); | |
2548 | - // getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2549 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2550 | - e.setData({ | |
2551 | - [txt]: store_count | |
2552 | - }); | |
2553 | - e.doCheckAll(); | |
2554 | - t.goods_num = store_count; | |
2602 | + //-- 循环汇总其他门店,其他活动有此商品的购买数量的汇总,不包含赠品 -- | |
2603 | + get_goods_other(item, pitem,only){ | |
2604 | + var goods_id = this.data.requestData[pitem].goods[item].goods_id; | |
2605 | + var prom_type = this.data.requestData[pitem].goods[item].prom_type; | |
2606 | + var prom_id = this.data.requestData[pitem].goods[item].prom_id; | |
2607 | + | |
2608 | + var num=0; | |
2609 | + //-- 相同活动的商品汇总,秒杀,团购 -- | |
2610 | + if(only==2){ | |
2611 | + for (let j = 0; j < this.data.requestData.length;j++){ | |
2612 | + if(j!=pitem){ | |
2613 | + var goods=this.data.requestData[j].goods; | |
2614 | + for (let k = 0; k <goods.length ; k++) { | |
2615 | + var m_item=goods[k]; | |
2616 | + if(m_item.goods_id==goods_id && m_item.is_gift==0 | |
2617 | + && m_item.prom_id==prom_id && m_item.prom_type==prom_type ){ | |
2618 | + num+=m_item.goods_num | |
2619 | + } | |
2620 | + } | |
2555 | 2621 | } |
2556 | - e.update_cart(t, pitem, item); | |
2557 | 2622 | } |
2623 | + return num; | |
2624 | + } | |
2625 | + | |
2626 | + for (let i = 0; i < this.data.requestData[pitem].goods.length; i++) { | |
2627 | + var t_item=this.data.requestData[pitem].goods[i] | |
2628 | + if(i!=item && t_item.goods_id==goods_id && t_item.is_gift==0){ | |
2629 | + num+=t_item.goods_num | |
2630 | + } | |
2631 | + } | |
2632 | + if(only) return num; | |
2633 | + for (let j = 0; j < this.data.requestData.length;j++){ | |
2634 | + if(j!=pitem){ | |
2635 | + var goods=this.data.requestData[j].goods; | |
2636 | + for (let k = 0; k <goods.length ; k++) { | |
2637 | + var m_item=goods[k]; | |
2638 | + if(m_item.goods_id==goods_id && m_item.is_gift==0){ | |
2639 | + num+=m_item.goods_num | |
2640 | + } | |
2641 | + } | |
2642 | + } | |
2558 | 2643 | } |
2559 | 2644 | |
2645 | + return num; | |
2646 | + }, | |
2647 | + | |
2648 | + //----------------------更新购物数量,加减,调用接口--------------------- | |
2649 | + postCardList: function (t, item, pitem) { | |
2650 | + var e = this,th = e,user_id = getApp().globalData.user_id; | |
2651 | + | |
2560 | 2652 | // console.log('update'); |
2561 | 2653 | // console.log('9995959595959',t); |
2562 | 2654 | var e = this, th = e; |
... | ... | @@ -2572,7 +2664,8 @@ Page({ |
2572 | 2664 | var promgoodsbuynum = 0; |
2573 | 2665 | var goodsbuynum = 0; |
2574 | 2666 | |
2575 | - //--要获得商品,该用户买了多少件,同步应用-- | |
2667 | + var is_showing=0; | |
2668 | + //--要获得商品,该用户买了多少件,同步应用,用于限购的计算-- | |
2576 | 2669 | await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { |
2577 | 2670 | data: { |
2578 | 2671 | store_id: oo.stoid, |
... | ... | @@ -2592,252 +2685,278 @@ Page({ |
2592 | 2685 | } |
2593 | 2686 | goodsbuynum = buy_num_data.goodsbuynum; |
2594 | 2687 | |
2595 | - | |
2596 | 2688 | }) |
2597 | 2689 | |
2598 | 2690 | //--> by ty |
2599 | 2691 | // var buyed_mum2 = t.goods_num + goodsbuynum; |
2600 | 2692 | var buyed_mum2 = t.goods_num; |
2601 | 2693 | //<-- |
2694 | + // 判断当前预购买的数量是否超过可购买的数量,限购还要考虑到商品的库存 | |
2695 | + if (limit > 0) { | |
2602 | 2696 | |
2603 | - // 判断当前预购买的数量是否超过可购买的数量 | |
2604 | - if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) { | |
2605 | - wx.showToast({ | |
2606 | - title: '购买数量超出商品限购', | |
2607 | - icon: 'none', | |
2608 | - }); | |
2609 | 2697 | //getApp().my_warnning('购买数量超出商品限购', 0, th); |
2610 | 2698 | var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; |
2699 | + limit = limit - goodsbuynum; | |
2700 | + if(limit<0) limit=0; | |
2701 | + | |
2702 | + if(buyed_mum2>limit){ | |
2703 | + wx.showToast({ | |
2704 | + title: '购买数量超出商品限购', | |
2705 | + icon: 'none', | |
2706 | + }); | |
2707 | + is_showing=1; | |
2708 | + } | |
2611 | 2709 | |
2612 | - //--> by ty | |
2613 | - var cbuy = limit - goodsbuynum; | |
2614 | - // var cbuy = limit - buyed_mum2 + 1; | |
2615 | - //<-- | |
2616 | - | |
2617 | - e.setData({ | |
2618 | - // [txt]: cbuy > 0 ? cbuy : 0, | |
2619 | - [txt]: cbuy > 0 ? cbuy : limit, | |
2620 | - }); | |
2621 | - e.doCheckAll(); | |
2622 | - | |
2623 | - t.goods_num = cbuy > 0 ? cbuy : limit, | |
2624 | - // t.goods_num = cbuy > 0 ? cbuy : 0, | |
2625 | - e.update_cart(t, pitem, item); | |
2626 | - return false; | |
2710 | + // e.setData({ | |
2711 | + // // [txt]: cbuy > 0 ? cbuy : 0, | |
2712 | + // [txt]: cbuy > 0 ? cbuy : limit, | |
2713 | + // }); | |
2714 | + //e.doCheckAll(); | |
2715 | + // t.goods_num = cbuy > 0 ? cbuy : limit; | |
2716 | + // | |
2717 | + // if([0,3,5,7,10].indexOf(goodsinfo.prom_type)>-1){ | |
2718 | + // | |
2719 | + // //-- 判断商品是不是 -- | |
2720 | + // var cx_arr=await getApp().get_has_cx_act(goodsinfo.goods_id); | |
2721 | + // var mo_num=getApp().get_limit_qty(goodsinfo,cx_arr.length); | |
2722 | + // var steep=getApp().get_limit_qty(goodsinfo,cx_arr.length,1); | |
2723 | + // | |
2724 | + // if(mo_num>1 && t.goods_num<mo_num){ | |
2725 | + // wx.showToast({ | |
2726 | + // title: '购买数量小于商品的起订量', | |
2727 | + // icon: 'none', | |
2728 | + // }); | |
2729 | + // t.goods_num=0; | |
2730 | + // } | |
2731 | + // | |
2732 | + // if(steep>1 && t.goods_num>mo_num && (t.goods_num-mo_num)%steep!=0 ){ | |
2733 | + // | |
2734 | + // wx.showToast({ | |
2735 | + // title: '购买数量必须是起订量的倍数', | |
2736 | + // icon: 'none', | |
2737 | + // }); | |
2738 | + // | |
2739 | + // t.goods_num=mo_num+parseInt((t.goods_num-mo_num)/steep+'')*steep | |
2740 | + // } | |
2741 | + // } | |
2742 | + // // t.goods_num = cbuy > 0 ? cbuy : 0, | |
2743 | + // e.update_cart(t, pitem, item); | |
2744 | + // return false; | |
2627 | 2745 | } |
2628 | - | |
2746 | + else limit=100000; | |
2629 | 2747 | |
2630 | 2748 | switch (goodsinfo.prom_type) { |
2631 | 2749 | case 1: |
2632 | - //读取秒杀 | |
2633 | - rq.get("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, { | |
2634 | - isShowLoading: 0, | |
2635 | - success: function (res_d) { | |
2636 | - if (res_d.data.code == 0 && res_d.data.data) { | |
2637 | - if (t.goods_num > store_count) { | |
2638 | - // wx.showModal({ | |
2639 | - // title: '提示', | |
2640 | - // content: '购买数量超出商品库存' | |
2641 | - // }); | |
2750 | + //-- 读取秒杀 -- | |
2751 | + var res_d= await getApp().promiseGet("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, {}); | |
2752 | + if (res_d.data.code == 0 && res_d.data.data) { | |
2753 | + | |
2754 | + var cbuy=limit; | |
2755 | + if (t.goods_num> store_count && !is_showing) { | |
2642 | 2756 | wx.showToast({ |
2643 | 2757 | title: '购买数量超出商品库存', |
2644 | 2758 | icon: 'none', |
2645 | 2759 | }); |
2646 | - // getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2647 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2648 | - e.setData({ | |
2649 | - [txt]: store_count | |
2650 | - }); | |
2651 | - e.doCheckAll(); | |
2652 | - | |
2653 | - t.goods_num = store_count; | |
2654 | - e.update_cart(t, pitem, item); | |
2655 | - | |
2656 | - return false; | |
2760 | + is_showing=1; | |
2657 | 2761 | } |
2762 | + //一直都要给一个最小值,和库存比较 | |
2763 | + if(cbuy>store_count) cbuy=store_count; | |
2658 | 2764 | |
2659 | 2765 | var false_data = res_d.data.data; |
2660 | 2766 | //--判断库存-- |
2661 | - if (t.goods_num > false_data.goods_num - false_data.buy_num) { | |
2662 | - // wx.showModal({ | |
2663 | - // title: '提示', | |
2664 | - // content: '购买数量超出活动库存' | |
2665 | - // }); | |
2767 | + if (t.goods_num > false_data.goods_num - false_data.buy_num && !is_showing) { | |
2666 | 2768 | wx.showToast({ |
2667 | 2769 | title: '购买数量超出活动库存', |
2668 | 2770 | icon: 'none', |
2669 | 2771 | }); |
2670 | - // getApp().my_warnning('购买数量超出活动库存', 0, th); | |
2671 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2672 | - e.setData({ | |
2673 | - [txt]: false_data.goods_num - false_data.buy_num | |
2674 | - }); | |
2675 | - e.doCheckAll(); | |
2676 | - | |
2677 | - t.goods_num = false_data.goods_num - false_data.buy_num; | |
2678 | - e.update_cart(t, pitem, item); | |
2679 | - | |
2680 | - return false; | |
2772 | + is_showing=1; | |
2681 | 2773 | } |
2682 | 2774 | |
2775 | + //一直都要给一个最小值,和活动库存比较 | |
2776 | + if(cbuy>false_data.goods_num - false_data.buy_num) | |
2777 | + cbuy=false_data.goods_num - false_data.buy_num; | |
2778 | + | |
2683 | 2779 | //--判断redis数量是否已经超出-- |
2684 | - if (t.goods_num > false_data.redisnum) { | |
2685 | - // wx.showModal({ | |
2686 | - // title: '提示', | |
2687 | - // content: '购买数量超出商品库存' | |
2688 | - // }); | |
2780 | + if (t.goods_num > false_data.redisnum && !is_showing) { | |
2689 | 2781 | wx.showToast({ |
2690 | 2782 | title: '购买数量超出商品库存', |
2691 | 2783 | icon: 'none', |
2692 | 2784 | }); |
2693 | - //getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2694 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2695 | - e.setData({ | |
2696 | - [txt]: false_data.redisnum | |
2697 | - }); | |
2698 | - e.doCheckAll(); | |
2699 | - | |
2700 | - t.goods_num = false_data.redisnum; | |
2701 | - e.update_cart(t, pitem, item); | |
2702 | - return false; | |
2785 | + is_showing=1; | |
2703 | 2786 | } |
2704 | 2787 | |
2788 | + //一直都要给一个最小值,和活动库存比较 | |
2789 | + if(cbuy>false_data.redisnum) cbuy=false_data.redisnum; | |
2790 | + | |
2705 | 2791 | //--活动的限购是不是要判断-- |
2706 | - if (t.goods_num + promgoodsbuynum > false_data.buy_limit && false_data.buy_limit > 0) { | |
2707 | - // wx.showModal({ | |
2708 | - // title: '提示', | |
2709 | - // content: '购买数量超出秒杀限购' | |
2710 | - // }); | |
2711 | - wx.showToast({ | |
2712 | - title: '购买数量超出秒杀限购', | |
2713 | - icon: 'none', | |
2714 | - }); | |
2715 | - // getApp().my_warnning('购买数量超出秒杀限购', 0, th); | |
2716 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2717 | - e.setData({ | |
2718 | - [txt]: false_data.buy_limit | |
2719 | - }); | |
2720 | - e.doCheckAll(); | |
2721 | - t.goods_num = (false_data.buy_limit - promgoodsbuynum) ? false_data.buy_limit - promgoodsbuynum : 0; | |
2722 | - e.update_cart(t, pitem, item); | |
2723 | - return false; | |
2792 | + if(false_data.buy_limit > 0) { | |
2793 | + if(t.goods_num + promgoodsbuynum > false_data.buy_limit && !is_showing){ | |
2794 | + wx.showToast({ | |
2795 | + title: '购买数量超出秒杀限购', | |
2796 | + icon: 'none', | |
2797 | + }); | |
2798 | + } | |
2799 | + var act_limit=false_data.buy_limit-promgoodsbuynum; | |
2800 | + if(!act_limit) act_limit=0; | |
2801 | + if(cbuy>act_limit) cbuy=act_limit; | |
2802 | + | |
2724 | 2803 | } |
2804 | + | |
2805 | + if(t.goods_num>cbuy) t.goods_num=cbuy; | |
2806 | + | |
2725 | 2807 | e.update_cart(t, pitem, item); |
2726 | 2808 | |
2727 | - } else { | |
2728 | - normal_check(store_count, goodsinfo, wareIds); | |
2729 | - } | |
2730 | - } | |
2731 | - }) | |
2732 | - break; | |
2809 | + } else { | |
2810 | + e.normal_check(t, item, pitem,store_count,limit,goodsinfo, wareIds); //普通商品的调用和计算 | |
2811 | + } | |
2812 | + break; | |
2733 | 2813 | case 2: |
2734 | - getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { | |
2814 | + | |
2815 | + //-- 读取团购 -- | |
2816 | + var res= await getApp().promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {}); | |
2735 | 2817 | if (res.data.code == 0 && res.data.data) { |
2736 | - if (t.goods_num > store_count) { | |
2737 | - // wx.showModal({ | |
2738 | - // title: '提示', | |
2739 | - // content: '购买数量超出商品库存' | |
2740 | - // }); | |
2818 | + | |
2819 | + var cbuy=limit; | |
2820 | + if (t.goods_num > store_count && !is_showing) { | |
2741 | 2821 | wx.showToast({ |
2742 | 2822 | title: '购买数量超出商品库存', |
2743 | 2823 | icon: 'none', |
2744 | 2824 | }); |
2745 | - // getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2746 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2747 | - e.setData({ | |
2748 | - [txt]: store_count | |
2749 | - }); | |
2750 | - e.doCheckAll(); | |
2751 | - | |
2752 | - t.goods_num = store_count; | |
2753 | - e.update_cart(t, pitem, item); | |
2754 | - | |
2755 | - return false; | |
2825 | + is_showing=1; | |
2756 | 2826 | } |
2827 | + //一直都要给一个最小值,和库存比较 | |
2828 | + if(cbuy>store_count) cbuy=store_count; | |
2757 | 2829 | |
2758 | 2830 | var gr_data = res.data.data; |
2759 | 2831 | //--判断库存-- |
2760 | - if (t.goods_num > gr_data.goods_num - gr_data.buy_num) { | |
2761 | - // wx.showModal({ | |
2762 | - // title: '提示', | |
2763 | - // content: '购买数量超出活动库存' | |
2764 | - // }); | |
2832 | + if (t.goods_num > gr_data.goods_num - gr_data.buy_num && !is_showing) { | |
2765 | 2833 | wx.showToast({ |
2766 | 2834 | title: '购买数量超出活动库存', |
2767 | 2835 | icon: 'none', |
2768 | 2836 | }); |
2769 | - // getApp().my_warnning('购买数量超出活动库存', 0, th); | |
2770 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2771 | - e.setData({ | |
2772 | - [txt]: gr_data.goods_num - gr_data.buy_num | |
2773 | - }); | |
2774 | - e.doCheckAll(); | |
2775 | - | |
2776 | - t.goods_num = gr_data.goods_num - gr_data.buy_num; | |
2777 | - e.update_cart(t, pitem, item); | |
2778 | - | |
2779 | - return false; | |
2837 | + is_showing=1; | |
2780 | 2838 | } |
2839 | + //一直都要给一个最小值,和库存比较 | |
2840 | + if(cbuy>gr_data.goods_num - gr_data.buy_num ) cbuy=gr_data.goods_num - gr_data.buy_num; | |
2781 | 2841 | |
2782 | 2842 | //--判断redis数量是否已经超出-- |
2783 | - if (t.goods_num > gr_data.redisnum) { | |
2784 | - // wx.showModal({ | |
2785 | - // title: '提示', | |
2786 | - // content: '购买数量超出商品库存' | |
2787 | - // }); | |
2843 | + if (t.goods_num > gr_data.redisnum && !is_showing) { | |
2788 | 2844 | wx.showToast({ |
2789 | 2845 | title: '购买数量超出商品库存', |
2790 | 2846 | icon: 'none', |
2791 | 2847 | }); |
2792 | - // getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2793 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2794 | - e.setData({ | |
2795 | - [txt]: gr_data.redisnum | |
2796 | - }); | |
2797 | - e.doCheckAll(); | |
2798 | - | |
2799 | - t.goods_num = gr_data.redisnum; | |
2800 | - e.update_cart(t, pitem, item); | |
2801 | - return false; | |
2848 | + is_showing=1; | |
2802 | 2849 | } |
2850 | + if(cbuy>gr_data.redisnum) cbuy=gr_data.redisnum; | |
2803 | 2851 | |
2804 | 2852 | //--活动的限购是不是要判断-- |
2805 | - if (t.goods_num + promgoodsbuynum > gr_data.buy_limit && gr_data.buy_limit > 0) { | |
2806 | - // wx.showModal({ | |
2807 | - // title: '提示', | |
2808 | - // content: '购买数量超出团购限购' | |
2809 | - // }); | |
2810 | - wx.showToast({ | |
2811 | - title: '购买数量超出团购限购', | |
2812 | - icon: 'none', | |
2813 | - }); | |
2814 | - // getApp().my_warnning('购买数量超出团购限购', 0, th); | |
2815 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2816 | - e.setData({ | |
2817 | - [txt]: gr_data.buy_limit | |
2818 | - }); | |
2819 | - e.doCheckAll(); | |
2853 | + if (gr_data.buy_limit > 0) { | |
2854 | + if(t.goods_num + promgoodsbuynum > gr_data.buy_limit && !is_showing){ | |
2855 | + wx.showToast({ | |
2856 | + title: '购买数量超出团购限购', | |
2857 | + icon: 'none', | |
2858 | + }); | |
2859 | + is_showing=1; | |
2860 | + } | |
2820 | 2861 | |
2821 | - t.goods_num = (gr_data.buy_limit - promgoodsbuynum) ? gr_data.buy_limit - promgoodsbuynum : 0; | |
2822 | - e.update_cart(t, pitem, item); | |
2823 | - return false; | |
2862 | + var act_limit=gr_data.buy_limit-promgoodsbuynum; | |
2863 | + if(!act_limit) act_limit=0; | |
2864 | + | |
2865 | + if(cbuy>act_limit) cbuy=act_limit; | |
2824 | 2866 | } |
2867 | + | |
2868 | + if(t.goods_num>cbuy) t.goods_num=cbuy; | |
2869 | + | |
2825 | 2870 | e.update_cart(t, pitem, item); |
2826 | 2871 | |
2827 | 2872 | } else { |
2828 | - normal_check(store_count, goodsinfo, wareIds); | |
2873 | + e.normal_check(t, item, pitem,store_count,limit,goodsinfo, wareIds); //普通商品的调用和计算 | |
2829 | 2874 | } |
2830 | - }) | |
2831 | - | |
2832 | - break; | |
2875 | + break; | |
2833 | 2876 | default: |
2834 | - normal_check(store_count, goodsinfo, wareIds); | |
2877 | + e.normal_check(t, item, pitem,store_count,limit,goodsinfo, wareIds); //普通商品的调用和计算 | |
2835 | 2878 | break |
2836 | 2879 | } |
2837 | 2880 | } |
2838 | 2881 | }); |
2839 | 2882 | }, |
2840 | 2883 | |
2884 | + //-- 这个函数在计算的时候,要包含限购的那一部分 -- | |
2885 | + async normal_check(t, item, pitem,store_count,limit,goodsinfo, wareIds){ | |
2886 | + | |
2887 | + var cx_arr=await getApp().get_has_cx_act(goodsinfo.goods_id); | |
2888 | + | |
2889 | + var th=this; | |
2890 | + // getApp().my_warnning('购买数量超出商品库存', 0, th); | |
2891 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
2892 | + | |
2893 | + | |
2894 | + var cQty=store_count; | |
2895 | + //--- 看一下是不是线下库存 --- | |
2896 | + if (th.data.sales_rules >= 2 && !goodsinfo.whsle_id) { | |
2897 | + //th.check_down_line(t, pitem, item, wareIds,limit); | |
2898 | + var ob = {}; | |
2899 | + await th.check_down_line_next(t, pitem, item, wareIds, function (res) { | |
2900 | + ob = res; | |
2901 | + }); | |
2902 | + cQty=ob.CanOutQty; | |
2903 | + } | |
2904 | + | |
2905 | + var is_showing=0; | |
2906 | + var cbuy=limit; | |
2907 | + if (t.goods_num > limit) { | |
2908 | + wx.showToast({ | |
2909 | + title: '购买数量超出商品限购', | |
2910 | + icon: 'none', | |
2911 | + }); | |
2912 | + is_showing=1; | |
2913 | + } | |
2914 | + | |
2915 | + if (t.goods_num > cQty) { | |
2916 | + if(!is_showing){ | |
2917 | + wx.showToast({ | |
2918 | + title: '购买数量超出商品库存', | |
2919 | + icon: 'none', | |
2920 | + }); | |
2921 | + is_showing=1; | |
2922 | + } | |
2923 | + } | |
2924 | + if(cbuy>cQty) cbuy=cQty; | |
2925 | + | |
2926 | + if(t.goods_num>cbuy) t.goods_num=cbuy; | |
2927 | + | |
2928 | + if([0,3,5,7,10].indexOf(goodsinfo.prom_type)>-1){ | |
2929 | + var mo_num=getApp().get_limit_qty(goodsinfo,cx_arr.length); | |
2930 | + var steep=getApp().get_limit_qty(goodsinfo,cx_arr.length,1); | |
2931 | + | |
2932 | + if(mo_num>1 && t.goods_num<mo_num){ | |
2933 | + if(!is_showing) { | |
2934 | + wx.showToast({ | |
2935 | + title: '购买数量小于商品的起订量', | |
2936 | + icon: 'none', | |
2937 | + }); | |
2938 | + } | |
2939 | + t.goods_num=mo_num; | |
2940 | + } | |
2941 | + | |
2942 | + if(steep>1 && t.goods_num>mo_num && (t.goods_num-mo_num)%steep!=0){ | |
2943 | + if(!is_showing) { | |
2944 | + wx.showToast({ | |
2945 | + title: '购买数量必须是起订量的倍数', | |
2946 | + icon: 'none', | |
2947 | + }); | |
2948 | + } | |
2949 | + if(t.goods_num<mo_num) t.goods_num=mo_num; | |
2950 | + else{ | |
2951 | + t.goods_num=mo_num+parseInt((t.goods_num-mo_num)/steep+'')*steep | |
2952 | + } | |
2953 | + } | |
2954 | + } | |
2955 | + | |
2956 | + th.update_cart(t, pitem, item); | |
2957 | + | |
2958 | + }, | |
2959 | + | |
2841 | 2960 | //----------------------更新购物数量,加减,调用接口--------------------- |
2842 | 2961 | postCardList_ser: async function (t, item, pitem) { |
2843 | 2962 | var e = this, |
... | ... | @@ -2974,18 +3093,14 @@ Page({ |
2974 | 3093 | await th.doCheckAll(); |
2975 | 3094 | await th.update_cart_ser(t, pitem, item); |
2976 | 3095 | return false; |
2977 | - }; | |
2978 | - | |
3096 | + } | |
2979 | 3097 | } |
2980 | 3098 | |
2981 | - | |
2982 | 3099 | } |
2983 | 3100 | |
2984 | 3101 | |
2985 | 3102 | await e.doCheckAll(); |
2986 | 3103 | await e.update_cart_ser(t, pitem, item); |
2987 | - | |
2988 | - | |
2989 | 3104 | }, |
2990 | 3105 | |
2991 | 3106 | |
... | ... | @@ -3035,11 +3150,10 @@ Page({ |
3035 | 3150 | promcardbuynum: tt.data.data.promcardbuynum, |
3036 | 3151 | cardbuynum: tt.data.data.cardbuynum, |
3037 | 3152 | }); |
3038 | - }; | |
3153 | + } | |
3039 | 3154 | }); |
3040 | 3155 | |
3041 | 3156 | |
3042 | - | |
3043 | 3157 | var buylimit = 0 |
3044 | 3158 | await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, { |
3045 | 3159 | |
... | ... | @@ -3049,7 +3163,7 @@ Page({ |
3049 | 3163 | th.data.sele_g = res.data.data; |
3050 | 3164 | th.data.sele_g.viplimited = res.data.data.buy_limit; |
3051 | 3165 | buylimit = res.data.data.buy_limit; |
3052 | - }; | |
3166 | + } | |
3053 | 3167 | }); |
3054 | 3168 | |
3055 | 3169 | |
... | ... | @@ -3067,18 +3181,15 @@ Page({ |
3067 | 3181 | }); |
3068 | 3182 | // getApp().my_warnning('超出活动限购', 0, th); |
3069 | 3183 | th.setData({ [txt]: buylimit }); |
3070 | - | |
3071 | 3184 | }; |
3072 | 3185 | |
3073 | 3186 | } |
3074 | 3187 | |
3075 | - | |
3076 | 3188 | th.doCheckAll(); |
3077 | 3189 | th.update_cart_ser(t, pitem, item); |
3078 | 3190 | |
3079 | 3191 | |
3080 | - | |
3081 | - }; | |
3192 | + } | |
3082 | 3193 | }, |
3083 | 3194 | |
3084 | 3195 | |
... | ... | @@ -3111,11 +3222,9 @@ Page({ |
3111 | 3222 | |
3112 | 3223 | var this_obj = this.data.requestData[pitem].goods[item]; |
3113 | 3224 | |
3114 | - if (th.data.sales_rules == 3 && this_obj.selected) { | |
3115 | - | |
3225 | + if (th.data.sales_rules >= 2 && this_obj.selected) { | |
3116 | 3226 | |
3117 | 3227 | var goods_id = this_obj.goods_id; |
3118 | - | |
3119 | 3228 | var num = 0; |
3120 | 3229 | |
3121 | 3230 | for (let i = 0; i < this.data.requestData.length; i++) { |
... | ... | @@ -3136,21 +3245,28 @@ Page({ |
3136 | 3245 | return false; |
3137 | 3246 | } |
3138 | 3247 | |
3139 | - | |
3140 | - | |
3141 | 3248 | } |
3142 | 3249 | } |
3143 | 3250 | |
3144 | 3251 | |
3145 | - | |
3146 | - | |
3147 | 3252 | this.update_cart(t, pitem, item); |
3148 | 3253 | }, |
3149 | 3254 | |
3255 | + | |
3256 | + | |
3150 | 3257 | //---检验线下库存的数量的子函数--- |
3151 | 3258 | async check_down_line_next(t, pitem, item, erpwareid, func) { |
3152 | 3259 | |
3153 | 3260 | var goodsinfo = this.data.requestData[pitem].goods[item]; |
3261 | + if(getApp().is_virtual(goodsinfo)){ | |
3262 | + var ob = {}; | |
3263 | + ob.code = 1; | |
3264 | + ob.CanOutQty = 100000; | |
3265 | + func(ob); | |
3266 | + return false; | |
3267 | + } | |
3268 | + | |
3269 | + | |
3154 | 3270 | var lock = 0, |
3155 | 3271 | pick_no, plist; |
3156 | 3272 | |
... | ... | @@ -3278,7 +3394,6 @@ Page({ |
3278 | 3394 | |
3279 | 3395 | //--------------去结算------------ |
3280 | 3396 | async checkout() { |
3281 | - | |
3282 | 3397 | if (getApp().is_sp_hao()) { |
3283 | 3398 | wx.showToast({ |
3284 | 3399 | title: "视频号不支持购物车购买", |
... | ... | @@ -3370,9 +3485,42 @@ Page({ |
3370 | 3485 | } |
3371 | 3486 | glist += i_arr[j].goods_id + ","; |
3372 | 3487 | ab = 1; |
3373 | - | |
3488 | + | |
3489 | + //-- 获取促销活动是不是有参与 -- | |
3490 | + var act=await getApp().get_has_cx_act(i_arr[j].goods_id); | |
3491 | + //-- 判断商品的起订数量 -- | |
3492 | + var mo_num=getApp().get_limit_qty(i_arr[j],act.length); | |
3493 | + var steep=getApp().get_limit_qty(i_arr[j],act.length,1); | |
3494 | + var py_type= parseInt(i_arr[j].prom_type+''); | |
3495 | + | |
3496 | + if([0,3,5,7,10].indexOf(py_type)>-1){ | |
3497 | + | |
3498 | + if(mo_num>i_arr[j].goods_num){ | |
3499 | + getApp().confirmBox(i_arr[j].goods_name + "的未达到起订数量"); | |
3500 | + wx.hideLoading(); | |
3501 | + return false; | |
3502 | + } | |
3503 | + if(steep>1 && (i_arr[j].goods_num-mo_num)%steep!=0 ){ | |
3504 | + getApp().confirmBox(i_arr[j].goods_name + "的购买的数量不是起订量的倍数"); | |
3505 | + var num=mo_num+ parseInt((i_arr[j].goods_num-mo_num)/steep)*steep+steep; | |
3506 | + var e = { | |
3507 | + goods_num: num, | |
3508 | + id: i_arr[j].id, | |
3509 | + goods_id: i_arr[j].goods_id, | |
3510 | + store_id: oo.stoid | |
3511 | + }; | |
3512 | + | |
3513 | + th.postCardList(e, j, i); | |
3514 | + | |
3515 | + wx.hideLoading(); | |
3516 | + return false; | |
3517 | + } | |
3518 | + | |
3519 | + } | |
3520 | + | |
3521 | + | |
3374 | 3522 | //--普通商品,如果有开启线下库存的功能,要调用线下库存进行计算,赠品不要进行调用线下库存--- |
3375 | - if ((i_arr[j].prom_type == 0 || i_arr[j].prom_type == 3 || i_arr[j].prom_type == 5 || i_arr[j].prom_type == 7 || | |
3523 | + if ((i_arr[j].prom_type == 0 || i_arr[j].prom_type == 3 || i_arr[j].prom_type == 5 || i_arr[j].prom_type == 7 || i_arr[j].prom_type == 10 || | |
3376 | 3524 | i_arr[j].need_downlow_num) && th.data.sales_rules >= 2 && i_arr[j].is_gift != 1 && !i_arr[j].whsle_id) { |
3377 | 3525 | //--获取商品的线下商品ID-- |
3378 | 3526 | |
... | ... | @@ -3480,9 +3628,6 @@ Page({ |
3480 | 3628 | return false |
3481 | 3629 | } |
3482 | 3630 | |
3483 | - | |
3484 | - | |
3485 | - | |
3486 | 3631 | if (checkArr7.length > 0) { |
3487 | 3632 | let checkStr = [] |
3488 | 3633 | checkArr7.map(item => { | ... | ... |
pages/cart/cart/cart.wxml
... | ... | @@ -42,6 +42,7 @@ |
42 | 42 | <!-- 门店底下的商品 --> |
43 | 43 | <view class="store"> |
44 | 44 | <view class="shmd_m"> |
45 | + | |
45 | 46 | <!-- 门店 --> |
46 | 47 | <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" |
47 | 48 | color="red" size="20" type="success"></icon> |
... | ... | @@ -138,6 +139,7 @@ |
138 | 139 | <text wx:if="{{item.content.is_gift==1}}">送赠品|</text> |
139 | 140 | <text wx:if="{{item.content.is_libao==1}}">送礼包|</text> |
140 | 141 | <text wx:if="{{item.content.is_zxlibao==1}}">送专享礼包|</text> |
142 | + <text wx:if="{{item.content.is_monthgiftbag==1}}">送每月礼包|</text> | |
141 | 143 | <text></text> |
142 | 144 | </view> |
143 | 145 | <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> | ... | ... |
pages/cart/cart2_inte/cart2_inte.json
0 → 100644
pages/cart/cart2_inte/cart2_inte.wxss
0 → 100644
pages/giftpack/giftpacklist/giftpacklist.wxss
... | ... | @@ -92,7 +92,8 @@ |
92 | 92 | .box_ware_img image.data-v-3a5b7e36 { |
93 | 93 | /* width: 185rpx; |
94 | 94 | height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ |
95 | - border: 2rpx solid #999; | |
95 | + border: 2rpx solid #fafaf9; | |
96 | + border-radius: 4rpx; | |
96 | 97 | width: 120rpx; |
97 | 98 | height: 120rpx; |
98 | 99 | background-color: #f8f8f8; | ... | ... |
pages/goods/goodsInfo/buy_com_pop.wxml
... | ... | @@ -13,10 +13,14 @@ |
13 | 13 | <view class="flex"> |
14 | 14 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
15 | 15 | <block wx:if="{{sales_rules>=2}}"> |
16 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
17 | - 可售:{{def_pick_store.CanOutQty}} | |
18 | - </view> | |
19 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
16 | + | |
17 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
18 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
19 | + 可售:{{def_pick_store.CanOutQty}} | |
20 | + </view> | |
21 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
22 | + </block> | |
23 | + | |
20 | 24 | </block> |
21 | 25 | <block wx:else> |
22 | 26 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
... | ... | @@ -29,8 +33,8 @@ |
29 | 33 | <!-- 选择门店模块 --> |
30 | 34 | <view class="flex-space-between address ai_end xc-width "> |
31 | 35 | |
32 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
33 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
36 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
37 | + <text class="fs30 xc-black3 shop_name {{def_pick_store.distance!=null?'max':''}} ">{{def_pick_store.pickup_name}}</text> | |
34 | 38 | <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> |
35 | 39 | 距离:{{def_pick_store.distance > 1000 ? filters.toFix(def_pick_store.distance / 1000, 2) + "km" : filters.toFix(def_pick_store.distance, 0) + "m"}} |
36 | 40 | |
... | ... | @@ -53,7 +57,7 @@ |
53 | 57 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
54 | 58 | <block wx:else> |
55 | 59 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
56 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2}}"> | |
60 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2}}"> | |
57 | 61 | (库存不足) |
58 | 62 | </view> |
59 | 63 | </block> |
... | ... | @@ -136,8 +140,8 @@ |
136 | 140 | </view> |
137 | 141 | </block> |
138 | 142 | <block wx:else> |
139 | - <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id}}"> | |
140 | - <view wx:if="{{!def_pick_store.CanOutQty}}" class="spec-cart-btn fs32" data-action="add" | |
143 | + <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id }}"> | |
144 | + <view wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1 }}" class="spec-cart-btn fs32" data-action="add" | |
141 | 145 | style="background-color: #dcdcdc;color: #999">库存不足 |
142 | 146 | </view> |
143 | 147 | <block wx:else> |
... | ... | @@ -152,9 +156,7 @@ |
152 | 156 | </block> |
153 | 157 | </block> |
154 | 158 | |
155 | - | |
156 | - | |
157 | - <block wx:elif="{{data.store_count<=0}}"> | |
159 | + <block wx:elif="{{data.store_count<1}}"> | |
158 | 160 | <view class="spec-cart-btn fs32" data-action="add" |
159 | 161 | style="background-color: #dcdcdc;color: #999">库存不足 |
160 | 162 | </view> | ... | ... |
pages/goods/goodsInfo/buy_integral.wxml
... | ... | @@ -26,9 +26,9 @@ |
26 | 26 | <!-- 选择门店模块 --> |
27 | 27 | <view class="flex-space-between address ai_end xc-width "> |
28 | 28 | |
29 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
30 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
31 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
29 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
30 | + <text class="fs30 xc-black3 shop_name bold {{def_pick_store.distance!=null?'max':''}} ">{{def_pick_store.pickup_name}}</text> | |
31 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | |
32 | 32 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} |
33 | 33 | |
34 | 34 | </view> |
... | ... | @@ -47,11 +47,13 @@ |
47 | 47 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
48 | 48 | <block wx:else> |
49 | 49 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
50 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | |
50 | + <view wx:elif="{{def_pick_store && sales_rules>=2 && prom_type==0}}"> | |
51 | + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}">(库存不足)</block> | |
52 | + </view> | |
51 | 53 | </block> |
52 | 54 | </block> |
53 | 55 | |
54 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
56 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | |
55 | 57 | |
56 | 58 | |
57 | 59 | <!--商品的属性项目--> | ... | ... |
pages/goods/goodsInfo/buy_pt.wxml
... | ... | @@ -25,8 +25,10 @@ |
25 | 25 | <view class="flex"> |
26 | 26 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
27 | 27 | <block wx:if="{{sales_rules>=2}}"> |
28 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | |
29 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
28 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
29 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | |
30 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
31 | + </block> | |
30 | 32 | </block> |
31 | 33 | <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> |
32 | 34 | </view> |
... | ... | @@ -47,11 +49,11 @@ |
47 | 49 | <view style="margin-top: 20rpx"> |
48 | 50 | <view class="flex-space-between address ai_end xc-width "> |
49 | 51 | |
50 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
51 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
52 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
53 | + <text class="fs30 xc-black3 shop_name {{def_pick_store.distance!=null?'max':''}} ">{{def_pick_store.pickup_name}}</text> | |
52 | 54 | |
53 | 55 | |
54 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
56 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | |
55 | 57 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} |
56 | 58 | |
57 | 59 | </view> |
... | ... | @@ -71,7 +73,7 @@ |
71 | 73 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
72 | 74 | <block wx:else> |
73 | 75 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
74 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && is_normal}}">(库存不足)</view> | |
76 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && is_normal}}">(库存不足)</view> | |
75 | 77 | </block> |
76 | 78 | </block> |
77 | 79 | |
... | ... | @@ -176,16 +178,32 @@ |
176 | 178 | <block wx:else> |
177 | 179 | <block wx:if="{{!def_pick_store}}"> |
178 | 180 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
179 | - </block> | |
180 | - <block wx:else> | |
181 | - <block wx:if="{{data.store_count<=0}}"> | |
182 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
183 | - </block> | |
184 | - <block wx:else> | |
185 | - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
186 | - </block> | |
187 | - | |
188 | - </block> | |
181 | + </block> | |
182 | + | |
183 | + <block wx:else> | |
184 | + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> | |
185 | + <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id}}"> | |
186 | + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}"> | |
187 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> | |
188 | + 库存不足 | |
189 | + </view> | |
190 | + </block> | |
191 | + <block wx:else> | |
192 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
193 | + </block> | |
194 | + </block> | |
195 | + <!-- 线上销售 --> | |
196 | + <block wx:else> | |
197 | + <block wx:if="{{sele_g.store_count<1 && is_no_new}}"> | |
198 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> | |
199 | + 库存不足 | |
200 | + </view> | |
201 | + </block> | |
202 | + <block wx:else> | |
203 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
204 | + </block> | |
205 | + </block> | |
206 | + </block> | |
189 | 207 | </block> |
190 | 208 | </block> |
191 | 209 | </block> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -481,7 +481,7 @@ Page({ |
481 | 481 | appoint_pick_keyid: json_d.appoint_pick_keyid |
482 | 482 | |
483 | 483 | }); |
484 | - | |
484 | + | |
485 | 485 | //------几人评价------- |
486 | 486 | //n.init(th, "", "comments"); |
487 | 487 | |
... | ... | @@ -1102,18 +1102,12 @@ Page({ |
1102 | 1102 | }); |
1103 | 1103 | |
1104 | 1104 | |
1105 | + | |
1106 | + | |
1105 | 1107 | //获取统一条形码,普通商品和优惠促销的商品 |
1106 | 1108 | if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7 || ee.data.data.prom_type == 9 || ee.data.data.prom_type == 10) { |
1107 | - //默认门店要拿下门店库存 | |
1108 | - if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { | |
1109 | - //获取门店 | |
1110 | - ee.get_sto(); | |
1111 | - | |
1112 | - } else { | |
1113 | - //获取门店 | |
1114 | - ee.get_sto(); | |
1115 | - } | |
1116 | 1109 | |
1110 | + ee.get_sto(); | |
1117 | 1111 | ee.get_sku(o.stoid, t.data.data, gid); |
1118 | 1112 | ee.check_has_flash(); |
1119 | 1113 | |
... | ... | @@ -1197,6 +1191,7 @@ Page({ |
1197 | 1191 | setTimeout(()=> { |
1198 | 1192 | console.log('cccc'); |
1199 | 1193 | console.log(th.data.prom_type); |
1194 | + | |
1200 | 1195 | },500) |
1201 | 1196 | |
1202 | 1197 | |
... | ... | @@ -1208,11 +1203,8 @@ Page({ |
1208 | 1203 | console.log('aaaaaaaaaa'); |
1209 | 1204 | console.log(this.data.prom_type); |
1210 | 1205 | |
1211 | - this.data.enterAddressPage && (this.data.enterAddressPage = !1); | |
1212 | - | |
1213 | - | |
1214 | - | |
1215 | 1206 | |
1207 | + this.data.enterAddressPage && (this.data.enterAddressPage = !1); | |
1216 | 1208 | |
1217 | 1209 | |
1218 | 1210 | }, |
... | ... | @@ -1778,7 +1770,7 @@ Page({ |
1778 | 1770 | return false; |
1779 | 1771 | } else { |
1780 | 1772 | //---如果是线下门店销售的时候--- |
1781 | - if (th.data.sales_rules >= 2) { | |
1773 | + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { | |
1782 | 1774 | var pick = th.get_pick_from_list(th.data.sto_sele_id) |
1783 | 1775 | |
1784 | 1776 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { |
... | ... | @@ -1942,6 +1934,9 @@ Page({ |
1942 | 1934 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
1943 | 1935 | } |
1944 | 1936 | } |
1937 | + | |
1938 | + | |
1939 | + | |
1945 | 1940 | }) |
1946 | 1941 | }, |
1947 | 1942 | |
... | ... | @@ -2402,11 +2397,30 @@ Page({ |
2402 | 2397 | |
2403 | 2398 | //----------增加购买数量----------- |
2404 | 2399 | addCartNum: function (t) { |
2405 | - this.checkCartNum(this.data.goodsInputNum + 1); | |
2400 | + var add_num=1; | |
2401 | + var p_type=parseInt(this.data.prom_type) | |
2402 | + if([1,2,4,6,8,9].indexOf(p_type)==-1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1){ | |
2403 | + add_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act, 1); | |
2404 | + } | |
2405 | + | |
2406 | + this.checkCartNum(this.data.goodsInputNum + add_num); | |
2406 | 2407 | }, |
2407 | 2408 | //----------减少购买数量----------- |
2408 | 2409 | subCartNum: function (t) { |
2409 | - this.checkCartNum(this.data.goodsInputNum - 1); | |
2410 | + var add_num=1; | |
2411 | + var p_type=parseInt(this.data.prom_type) | |
2412 | + if([1,2,4,6,8,9].indexOf(p_type)==-1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1){ | |
2413 | + add_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act, 1); | |
2414 | + var mo_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act); | |
2415 | + if(this.data.goodsInputNum - add_num<mo_num){ | |
2416 | + wx.showToast({ | |
2417 | + title: '购买数量不能小于起订量', | |
2418 | + icon: 'none', | |
2419 | + }); | |
2420 | + return false; | |
2421 | + } | |
2422 | + } | |
2423 | + this.checkCartNum(this.data.goodsInputNum - add_num); | |
2410 | 2424 | }, |
2411 | 2425 | //----------输入框输入购买数量----------- |
2412 | 2426 | inputCartNum: function (t) { |
... | ... | @@ -2430,8 +2444,14 @@ Page({ |
2430 | 2444 | //------检查数量是不是超出限购------ |
2431 | 2445 | checkCartNum: function (t) { |
2432 | 2446 | var th = this; |
2447 | + | |
2448 | + var mo_num=getApp().get_limit_qty(th.data.sele_g,th.data.is_act); | |
2449 | + var steep=getApp().get_limit_qty(th.data.sele_g,th.data.is_act,1); | |
2433 | 2450 | this.get_buy_num(this.data.sele_g, async function () { |
2434 | 2451 | |
2452 | + var is_show_bs=0; | |
2453 | + var l_num=-1; | |
2454 | + | |
2435 | 2455 | //--判断商品是否超出限购-- |
2436 | 2456 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
2437 | 2457 | |
... | ... | @@ -2442,13 +2462,16 @@ Page({ |
2442 | 2462 | title: '超出商品限购', |
2443 | 2463 | icon: 'none', |
2444 | 2464 | }); |
2465 | + | |
2466 | + is_show_bs=1; | |
2467 | + | |
2445 | 2468 | // s.my_warnning('超出商品限购', 0, th); |
2446 | - var num = th.data.sele_g.viplimited - gd_buy_num; | |
2447 | - if (num < 0) num = 0; | |
2448 | - th.setData({ | |
2449 | - goodsInputNum: num | |
2450 | - }) | |
2451 | - return false; | |
2469 | + l_num = th.data.sele_g.viplimited - gd_buy_num; | |
2470 | + if (l_num < 0) l_num = 0; | |
2471 | + // th.setData({ | |
2472 | + // goodsInputNum: num | |
2473 | + // }) | |
2474 | + // return false; | |
2452 | 2475 | } |
2453 | 2476 | } |
2454 | 2477 | |
... | ... | @@ -2495,34 +2518,94 @@ Page({ |
2495 | 2518 | } |
2496 | 2519 | } |
2497 | 2520 | var e = th.data.sele_g.store_count; |
2498 | - var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4 | |
2499 | - if (th.data.sales_rules >= 2 && (p_type != 1 && p_type != 4 && p_type != 6 && p_type != 2 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2500 | - if (!th.data.def_pick_store) { | |
2501 | - wx.showToast({ | |
2502 | - title: '请选择门店', | |
2503 | - icon: 'none', | |
2504 | - }); | |
2505 | - // wx.showModal({title: '请选择门店',}); | |
2506 | - return false; | |
2507 | - } else { | |
2508 | - e = th.data.def_pick_store.CanOutQty; | |
2521 | + var p_type =parseInt(th.data.prom_type+'') ; //&& p_type!=1 && p_type!=4 | |
2522 | + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2 && | |
2523 | + ([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2524 | + | |
2525 | + //-- 如果是虚拟商品,默认给最大值 -- | |
2526 | + if(getApp().is_virtual(th.data.sele_g)){ | |
2527 | + e = 100000; | |
2528 | + }else{ | |
2529 | + if (!th.data.def_pick_store) { | |
2530 | + wx.showToast({ | |
2531 | + title: '请选择门店', | |
2532 | + icon: 'none', | |
2533 | + }); | |
2534 | + // wx.showModal({title: '请选择门店',}); | |
2535 | + return false; | |
2536 | + } else { | |
2537 | + e = th.data.def_pick_store.CanOutQty; | |
2538 | + } | |
2509 | 2539 | } |
2510 | 2540 | } |
2541 | + | |
2542 | + //-- 限购数量也要进行计算一下 -- | |
2543 | + if(l_num>-1){ | |
2544 | + if(e>l_num) e=l_num; | |
2545 | + } | |
2546 | + | |
2547 | + //--- 促销活动也不控制起订量, 这里很重要的一个控制,起订量的 ---- | |
2548 | + if([0,3,5,7,10].indexOf(p_type)>-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){ | |
2549 | + if(t<mo_num) { | |
2550 | + t=mo_num; | |
2551 | + if(!is_show_bs) { | |
2552 | + wx.showToast({ | |
2553 | + title: '购买数未达到起订量', | |
2554 | + icon: 'none', | |
2555 | + }); | |
2556 | + } | |
2557 | + is_show_bs=1; | |
2558 | + } | |
2559 | + if(t>mo_num && (t-mo_num)%steep!=0){ | |
2560 | + | |
2561 | + if(!is_show_bs){ | |
2562 | + wx.showToast({ | |
2563 | + title: '购买数必须是起订量的倍数', | |
2564 | + icon: 'none', | |
2565 | + }); | |
2566 | + } | |
2567 | + | |
2568 | + t=mo_num+ parseInt((t-mo_num)/steep)*steep+steep; | |
2569 | + is_show_bs=1; | |
2570 | + } | |
2571 | + } | |
2572 | + | |
2511 | 2573 | if (!e) e = 0; |
2512 | 2574 | //库存不足,不增加 |
2513 | 2575 | if (e < t) { |
2514 | - wx.showToast({ | |
2515 | - title: '库存不足', | |
2516 | - icon: 'none', | |
2517 | - }); | |
2576 | + if(!is_show_bs){ | |
2577 | + wx.showToast({ | |
2578 | + title: '库存不足', | |
2579 | + icon: 'none', | |
2580 | + }); | |
2581 | + } | |
2582 | + | |
2518 | 2583 | // wx.showModal({title: '库存不足',}); |
2519 | 2584 | if (e < 0) e = 0; |
2585 | + | |
2586 | + //只有普通商品才有起购数 | |
2587 | + if([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){ | |
2588 | + if(e<mo_num) e=mo_num; | |
2589 | + if(e>mo_num && (e-mo_num)%steep!=0){ | |
2590 | + e=mo_num+ parseInt((e-mo_num)/steep)*steep; | |
2591 | + } | |
2592 | + } | |
2520 | 2593 | th.setData({ |
2521 | 2594 | goodsInputNum: e |
2522 | 2595 | }); |
2523 | 2596 | return false; |
2524 | 2597 | } |
2598 | + | |
2599 | + //var steep=getApp().get_limit_qty(th.data.sele_g,0,1); | |
2525 | 2600 | t > e || 0 == e ? t = e : t < 1 && (t = 1); |
2601 | + | |
2602 | + | |
2603 | + //只有普通商品才有起购数 | |
2604 | + if([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){ | |
2605 | + if(t<mo_num) t=mo_num; | |
2606 | + } | |
2607 | + | |
2608 | + | |
2526 | 2609 | th.setData({ |
2527 | 2610 | goodsInputNum: t |
2528 | 2611 | }); |
... | ... | @@ -2612,15 +2695,22 @@ Page({ |
2612 | 2695 | |
2613 | 2696 | var e = th.data.sele_g.store_count; |
2614 | 2697 | var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4 |
2615 | - if (th.data.sales_rules >= 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2616 | - if (!th.data.def_pick_store) { | |
2617 | - wx.showModal({ | |
2618 | - title: '请选择门店', | |
2619 | - }); | |
2620 | - return false; | |
2621 | - } else { | |
2622 | - e = th.data.def_pick_store.CanOutQty; | |
2623 | - } | |
2698 | + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2 && | |
2699 | + ([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { | |
2700 | + | |
2701 | + if(getApp().is_virtual(th.data.sele_g)){ | |
2702 | + e=100000; | |
2703 | + }else{ | |
2704 | + if (!th.data.def_pick_store) { | |
2705 | + wx.showModal({ | |
2706 | + title: '请选择门店', | |
2707 | + }); | |
2708 | + return false; | |
2709 | + } else { | |
2710 | + e = th.data.def_pick_store.CanOutQty; | |
2711 | + } | |
2712 | + } | |
2713 | + | |
2624 | 2714 | } |
2625 | 2715 | if (!e) e = 0; |
2626 | 2716 | //库存不足,不增加 |
... | ... | @@ -3282,6 +3372,7 @@ Page({ |
3282 | 3372 | //-----------选择属性的按钮事件---------- |
3283 | 3373 | sele_spec: function (e) { |
3284 | 3374 | var that = this; |
3375 | + var th=this; | |
3285 | 3376 | var gid = e.currentTarget.dataset.gid; |
3286 | 3377 | var nor = e.currentTarget.dataset.nor; |
3287 | 3378 | var user_id=getApp().globalData.user_id; |
... | ... | @@ -3306,6 +3397,18 @@ Page({ |
3306 | 3397 | }) |
3307 | 3398 | } |
3308 | 3399 | |
3400 | + //拼团在点击回来的时候,还是只能是立即购买,不能有购物车的情况 | |
3401 | + if(this.data.base_nor_prom_type==6 && parseInt(gid+'')==parseInt(this.data.base_nor_goods_id+'')){ | |
3402 | + this.setData({ | |
3403 | + openSpecModal_pt:1, | |
3404 | + openSpecModal:0, | |
3405 | + sku_g:this.data.sku_g_pt, | |
3406 | + is_normal:1 | |
3407 | + }) | |
3408 | + nor=1; | |
3409 | + } | |
3410 | + | |
3411 | + | |
3309 | 3412 | //that.data.change=1; |
3310 | 3413 | var item = null; |
3311 | 3414 | for (var i in sku_g) { |
... | ... | @@ -3336,10 +3439,12 @@ Page({ |
3336 | 3439 | }); |
3337 | 3440 | |
3338 | 3441 | |
3442 | + | |
3339 | 3443 | if (nor) that.get_sto(1); |
3340 | 3444 | else that.get_sto(); |
3341 | 3445 | |
3342 | - if (!item.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) that.check_is_youhui(gid, that.data.is_normal); | |
3446 | + if (!item.whsle_id && ([1,2,4,6].indexOf(item.prom_type)==-1 || this.data.is_normal==1)) | |
3447 | + that.check_is_youhui(gid, that.data.is_normal,1); | |
3343 | 3448 | |
3344 | 3449 | //默认门店要拿下门店库存 |
3345 | 3450 | if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) { |
... | ... | @@ -3610,11 +3715,19 @@ Page({ |
3610 | 3715 | let item = e.data.data.pageData[i]; |
3611 | 3716 | if (item.category_id > 0) { |
3612 | 3717 | his_cate_num = 1; |
3613 | - break; | |
3718 | + } | |
3719 | + if (getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2){ | |
3720 | + e.data.data.pageData[i].CanOutQty=100000; | |
3614 | 3721 | } |
3615 | 3722 | } |
3723 | + | |
3616 | 3724 | e.his_cate_num = his_cate_num; |
3617 | 3725 | |
3726 | + if(th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}' | |
3727 | + && getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2){ | |
3728 | + th.setData({'def_pick_store.CanOutQty':100000}) | |
3729 | + } | |
3730 | + | |
3618 | 3731 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
3619 | 3732 | if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) { |
3620 | 3733 | th.setData({ |
... | ... | @@ -3641,9 +3754,9 @@ Page({ |
3641 | 3754 | th.setData({ |
3642 | 3755 | all_pick_list: e.data.data.pageData |
3643 | 3756 | }); |
3644 | - | |
3757 | + | |
3645 | 3758 | //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- |
3646 | - if (th.data.sales_rules >= 2 && !th.data.is_newsales_rules && !th.data.sele_g.whsle_id && ([1,2,4,6,8,9].indexOf(th.data.prom_type)==-1 || is_normal == 1)) { | |
3759 | + if (!getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2 && !th.data.is_newsales_rules && !th.data.sele_g.whsle_id && ([1,2,4,6,8,9].indexOf(th.data.prom_type)==-1 || is_normal == 1)) { | |
3647 | 3760 | setTimeout(function () { |
3648 | 3761 | th.deal_pickup_dline(e); |
3649 | 3762 | }, 800) |
... | ... | @@ -3939,7 +4052,7 @@ Page({ |
3939 | 4052 | } |
3940 | 4053 | if (th.data.fir_def_store && |
3941 | 4054 | (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || (th.data.def_pick_store && th.data.def_pick_store.distr_type == g_distr_type))) { |
3942 | - th.data.fir_def_store.Qty; | |
4055 | + th.data.fir_def_store.Qty=Qty; | |
3943 | 4056 | if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) |
3944 | 4057 | th.setData({ |
3945 | 4058 | def_pick_store: th.data.fir_def_store |
... | ... | @@ -4946,7 +5059,6 @@ Page({ |
4946 | 5059 | |
4947 | 5060 | var th = this; |
4948 | 5061 | var ind = parseInt(e.currentTarget.dataset.it); |
4949 | - | |
4950 | 5062 | //如果是拼单活动的普通购买 |
4951 | 5063 | if (ind == 1) { |
4952 | 5064 | |
... | ... | @@ -4959,14 +5071,14 @@ Page({ |
4959 | 5071 | th.get_sto(1); |
4960 | 5072 | th.setData({ |
4961 | 5073 | is_normal: ind, |
4962 | - openSpecModal_pt: 1 | |
5074 | + openSpecModal_pt: 1, | |
4963 | 5075 | }); |
4964 | 5076 | } else { |
4965 | 5077 | th.get_sto(1); |
4966 | 5078 | th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { |
4967 | 5079 | th.setData({ |
4968 | 5080 | is_normal: ind, |
4969 | - openSpecModal_pt: 1 | |
5081 | + openSpecModal_pt: 1, | |
4970 | 5082 | }); |
4971 | 5083 | }); |
4972 | 5084 | } |
... | ... | @@ -4975,6 +5087,10 @@ Page({ |
4975 | 5087 | |
4976 | 5088 | if (th.data.is_normal) { |
4977 | 5089 | th.data.g_buy_num = new Map(); |
5090 | + th.setData({ | |
5091 | + goodsInputNum: mo_num, | |
5092 | + mo_num:mo_num | |
5093 | + }); | |
4978 | 5094 | } |
4979 | 5095 | |
4980 | 5096 | //拼单商品从这里进,先判断有没有买过商品, |
... | ... | @@ -5041,7 +5157,6 @@ Page({ |
5041 | 5157 | getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); |
5042 | 5158 | return false; |
5043 | 5159 | } |
5044 | - | |
5045 | 5160 | } |
5046 | 5161 | |
5047 | 5162 | th.addcart_pt_func(); |
... | ... | @@ -5065,9 +5180,10 @@ Page({ |
5065 | 5180 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
5066 | 5181 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { |
5067 | 5182 | wx.showToast({ |
5068 | - title: '超出商品限购', | |
5069 | - icon: 'none', | |
5183 | + title: '超出商品限购', | |
5184 | + icon: 'none', | |
5070 | 5185 | }); |
5186 | + | |
5071 | 5187 | // s.my_warnning('超出商品限购', 0, th); |
5072 | 5188 | var num = th.data.prom_buy_limit - th.data.prom_buy_num; |
5073 | 5189 | if (num < 0) num = 0; |
... | ... | @@ -5146,9 +5262,10 @@ Page({ |
5146 | 5262 | // return s.my_warnning("商品数量不能为0", 0, th); |
5147 | 5263 | }; |
5148 | 5264 | if (th.data.goodsInputNum > o.store_count) { |
5149 | - th.setData({ | |
5150 | - goodsInputNum: o.store_count | |
5151 | - }) | |
5265 | + | |
5266 | + // th.setData({ | |
5267 | + // goodsInputNum: o.store_count | |
5268 | + // }) | |
5152 | 5269 | wx.showToast({ |
5153 | 5270 | title: '超出商品库存', |
5154 | 5271 | icon: 'none', |
... | ... | @@ -6919,7 +7036,7 @@ Page({ |
6919 | 7036 | var lock = 0; |
6920 | 7037 | |
6921 | 7038 | //---如果是活动的时候,同时不是普通购买--- |
6922 | - if (th.data.sele_g.whsle_id || [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal) { | |
7039 | + if (getApp().is_virtual(th.data.sele_g) || th.data.sele_g.whsle_id || ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal)) { | |
6923 | 7040 | func(); |
6924 | 7041 | return false; |
6925 | 7042 | } |
... | ... | @@ -6954,6 +7071,10 @@ Page({ |
6954 | 7071 | async check_CanOutQty(goodsinfo, item, func) { |
6955 | 7072 | |
6956 | 7073 | var sales_rules = this.data.sales_rules; |
7074 | + //如果默认是商品 | |
7075 | + if(getApp().is_virtual(goodsinfo)){ | |
7076 | + return func(100000); | |
7077 | + } | |
6957 | 7078 | |
6958 | 7079 | var lock_rq = { |
6959 | 7080 | store_id: os.stoid, |
... | ... | @@ -7357,19 +7478,19 @@ Page({ |
7357 | 7478 | }) |
7358 | 7479 | }, |
7359 | 7480 | |
7360 | - //---检查有没有优惠活动--- | |
7361 | - check_is_youhui:async function (gid, is_nor) { | |
7481 | + //---检查有没有优惠活动--- is_nor的普通购买的时候,is_spec是切换规格的时候 | |
7482 | + check_is_youhui:async function (gid, is_nor,is_spec) { | |
7362 | 7483 | var th = this; |
7363 | 7484 | var user_id = getApp().globalData.user_id; |
7364 | 7485 | if (!user_id) user_id = 0; |
7365 | 7486 | |
7366 | 7487 | //普通购买的时候,重新算一下组合购有没有 |
7367 | - if(is_nor){ | |
7488 | + if(is_nor || is_spec){ | |
7368 | 7489 | var arr3=null; |
7369 | 7490 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; |
7370 | 7491 | var req_d = { |
7371 | 7492 | "store_id": os.stoid, |
7372 | - "goods_id": this.data.gid, | |
7493 | + "goods_id": gid, | |
7373 | 7494 | "user_id": user_id, |
7374 | 7495 | } |
7375 | 7496 | await getApp().request.promiseGet(url, { |
... | ... | @@ -7397,20 +7518,28 @@ Page({ |
7397 | 7518 | } |
7398 | 7519 | if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { |
7399 | 7520 | //-- 获取商品列表 -- |
7400 | - th.data.zh_act=e.data.data; | |
7521 | + | |
7522 | + if(is_spec){ | |
7523 | + th.setData({ | |
7524 | + zh_act:e.data.data | |
7525 | + }) | |
7526 | + }else{ | |
7527 | + th.data.zh_act=e.data.data; | |
7528 | + } | |
7529 | + | |
7401 | 7530 | th.getUserBuyPromNum(e.data.data.id) |
7402 | 7531 | } |
7403 | 7532 | } |
7404 | 7533 | }) |
7405 | 7534 | } |
7406 | 7535 | } |
7407 | - | |
7536 | + var r_data=null; | |
7408 | 7537 | |
7409 | 7538 | //调用接口判断订单优惠, |
7410 | 7539 | await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromListNew1/" + os.stoid + "/" + gid + "/0" + "/" + user_id, { |
7411 | 7540 | }).then(async res=>{ |
7412 | 7541 | if (res.data.code == 0 && res.data.data) { |
7413 | - var r_data = res.data.data; | |
7542 | + r_data = res.data.data; | |
7414 | 7543 | var max = 0, min = 0; |
7415 | 7544 | //暂时积分够 不和 优惠,阶梯重叠 |
7416 | 7545 | if(th.data.zh_act){ |
... | ... | @@ -7435,42 +7564,6 @@ Page({ |
7435 | 7564 | r_data.promGoodsLists=null; |
7436 | 7565 | } |
7437 | 7566 | |
7438 | - | |
7439 | - if (r_data.ladderLists) { | |
7440 | - var act_id = r_data.ladderLists[0].form_id; | |
7441 | - //-- 判断会员能不能参与阶梯促销 -- | |
7442 | - await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { | |
7443 | - if (res.data.code == 0 && res.data.data) { | |
7444 | - var prom_content = ""; | |
7445 | - | |
7446 | - //暂定优惠促销还不能重叠 | |
7447 | - if(res.data.data.good_object==0 && (r_data.promGoodsLists || th.data.zh_act)){ | |
7448 | - return false; | |
7449 | - } | |
7450 | - | |
7451 | - if(res.data.data.good_object==1){ | |
7452 | - r_data.promGoodsLists=null; | |
7453 | - } | |
7454 | - | |
7455 | - for (let jj in r_data.ladderLists) { | |
7456 | - if (r_data.ladderLists[jj].discount == 10) { | |
7457 | - prom_content += "第" + (parseInt(jj) + 1) + "件原价,"; | |
7458 | - } else { | |
7459 | - prom_content += "第" + (parseInt(jj) + 1) + "件" + r_data.ladderLists[jj].discount + "折,"; | |
7460 | - } | |
7461 | - } | |
7462 | - prom_content = ut.sub_last(prom_content); | |
7463 | - th.data.prom_type = 10; | |
7464 | - th.data.prom_id = act_id; | |
7465 | - th.setData({ | |
7466 | - jieti_prom: prom_content, | |
7467 | - ladder_act_id: act_id | |
7468 | - }) | |
7469 | - } | |
7470 | - }) | |
7471 | - } | |
7472 | - | |
7473 | - | |
7474 | 7567 | //普通购买不在界面显示 |
7475 | 7568 | if(is_nor){ |
7476 | 7569 | th.data.collocationGoods=r_data.collocationPromList; |
... | ... | @@ -7486,8 +7579,54 @@ Page({ |
7486 | 7579 | } |
7487 | 7580 | }) |
7488 | 7581 | |
7582 | + //-- 如果有阶梯购的时候 -- | |
7583 | + if (r_data && r_data.ladderLists) { | |
7584 | + var act_id = r_data.ladderLists[0].form_id; | |
7585 | + //-- 判断会员能不能参与阶梯促销 -- | |
7586 | + await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { | |
7587 | + if (res.data.code == 0 && res.data.data) { | |
7588 | + var prom_content = ""; | |
7589 | + | |
7590 | + //暂定优惠促销还不能重叠 | |
7591 | + if(res.data.data.good_object==0 && (r_data.promGoodsLists || th.data.zh_act)){ | |
7592 | + return false; | |
7593 | + } | |
7594 | + | |
7595 | + if(res.data.data.good_object==1){ | |
7596 | + r_data.promGoodsLists=null; | |
7597 | + } | |
7598 | + | |
7599 | + for (let jj in r_data.ladderLists) { | |
7600 | + if (r_data.ladderLists[jj].discount == 10) { | |
7601 | + prom_content += "第" + (parseInt(jj) + 1) + "件原价,"; | |
7602 | + } else { | |
7603 | + prom_content += "第" + (parseInt(jj) + 1) + "件" + r_data.ladderLists[jj].discount + "折,"; | |
7604 | + } | |
7605 | + } | |
7606 | + prom_content = ut.sub_last(prom_content); | |
7607 | + th.data.prom_type = 10; | |
7608 | + th.data.prom_id = act_id; | |
7609 | + th.setData({ | |
7610 | + jieti_prom: prom_content, | |
7611 | + ladder_act_id: act_id | |
7612 | + }) | |
7613 | + } | |
7614 | + }) | |
7615 | + } | |
7616 | + | |
7617 | + //-- 如果有促销活动也算是有参与活动,参与活动的也统一不进行计算起订的数量 -- | |
7618 | + this.data.is_act=0; | |
7619 | + if(this.data.zh_act || this.data.prom_goods || this.data.jieti_prom || this.data.collocationGoods ){ | |
7620 | + this.data.is_act=1; | |
7621 | + } | |
7489 | 7622 | |
7623 | + console.log("11111111-gd"); | |
7624 | + console.log(th.data.sele_g); | |
7490 | 7625 | |
7626 | + //-- 更新默认购买的数量 --- | |
7627 | + var mo_num=getApp().get_limit_qty(th.data.sele_g,this.data.is_act); | |
7628 | + this.setData({goodsInputNum:mo_num}) | |
7629 | + this.setData({mo_num:mo_num}) | |
7491 | 7630 | |
7492 | 7631 | }, |
7493 | 7632 | |
... | ... | @@ -7550,9 +7689,8 @@ Page({ |
7550 | 7689 | openSpecModal_inte: 1, |
7551 | 7690 | goodsInputNum: 1 |
7552 | 7691 | }); |
7553 | - | |
7554 | - | |
7555 | 7692 | }, |
7693 | + | |
7556 | 7694 | //-- 积分购普通购买 -- |
7557 | 7695 | go_pay_integral_normal: function () { |
7558 | 7696 | |
... | ... | @@ -7924,7 +8062,10 @@ Page({ |
7924 | 8062 | let id = e.currentTarget.dataset.id; // 获取礼包id |
7925 | 8063 | let flag = e.currentTarget.dataset.flag; |
7926 | 8064 | let url = ''; |
7927 | - if (flag == 1) { // flag =1 控制跳转到专享礼包 | |
8065 | + if (flag == 2) { // flag =1 控制跳转到专享礼包 | |
8066 | + url = `/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo?isBuy=1&id=${id}&is_act=1`; | |
8067 | + // url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`; | |
8068 | + } else if (flag == 1) { // flag =1 控制跳转到专享礼包 | |
7928 | 8069 | url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`; |
7929 | 8070 | } else { |
7930 | 8071 | url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮 |
... | ... | @@ -8068,10 +8209,11 @@ Page({ |
8068 | 8209 | openSpecModel_Nor: function () { |
8069 | 8210 | this.data.g_buy_num = new Map(); |
8070 | 8211 | var th = this; |
8212 | + | |
8071 | 8213 | this.setData({ |
8072 | 8214 | open_ind_store: 5, |
8073 | - goodsInputNum: 1 | |
8074 | 8215 | }); //拼团直接给4 |
8216 | + | |
8075 | 8217 | if (th.data.sku_g_pt) { |
8076 | 8218 | this.get_sto(1) |
8077 | 8219 | this.setData({ | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <wxs module="g_filters" src="g_filter.wxs"></wxs> |
4 | 4 | <wxs module="tool" src="filter.wxs"></wxs> |
5 | 5 | |
6 | -<!-- 商品内容区域,普通商品,秒杀,拼团 --> | |
6 | +<!-- 商品内容区域,普通商品,秒杀,拼团 --> | |
7 | 7 | <block wx:if="{{isshow}}"> |
8 | 8 | <view class="container"> |
9 | 9 | <!-- 拼单规则规则 --> |
... | ... | @@ -97,10 +97,10 @@ |
97 | 97 | <!-- --显示团购价 --> |
98 | 98 | <view class="prom_show rel" wx:if="{{prom_type==2}}"> |
99 | 99 | |
100 | - <view class="abs flex" style="align-items:flex-end;color: #fff; margin-top: 34rpx; margin-left: 10rpx; height: 60rpx">¥{{prom_price}} | |
100 | + <view class="abs flex fs36" style="align-items:flex-end;color: #fff; margin-top: 34rpx; margin-left: 10rpx; height: 60rpx">¥{{prom_price}} | |
101 | 101 | |
102 | - <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_c" style="position: relative;top: -6rpx">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
103 | - <view wx:else class="word-line no_line_x fs24" style="position: relative;top: -6rpx">¥{{filters.toFix(data.shop_price,2)}}</view> | |
102 | + <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_c" style="margin-left: 10rpx;position: relative;top: -6rpx; color:#fff !important">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
103 | + <view wx:else class="word-line no_line_x fs24" style="margin-left: 10rpx;position: relative;top: -6rpx;color:#fff !important">¥{{filters.toFix(data.shop_price,2)}}</view> | |
104 | 104 | </view> |
105 | 105 | |
106 | 106 | <image class="abs" style="width: 120rpx;top: 32rpx; right: 220rpx;" mode="widthFix" src='{{iurl+"/miniapp/images/activity-time.png"}}'></image> |
... | ... | @@ -128,8 +128,8 @@ |
128 | 128 | <view class="fs50 val">{{prom_price}}</view> |
129 | 129 | </view> |
130 | 130 | |
131 | - <view wx:if="{{is_retail_price}}" class="word-line fs20 xc-qtunit-price no_line_c">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
132 | - <view wx:else class="word-line no_line_x fs20 xc-qtunit-price">¥{{filters.toFix(data.shop_price,2)}}</view> | |
131 | + <view wx:if="{{is_retail_price}}" class="word-line fs20 xc-qtunit-price no_line_c" style="color:#fff !important ">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
132 | + <view wx:else class="word-line no_line_x fs20 xc-qtunit-price" style="color:#fff !important ">¥{{filters.toFix(data.shop_price,2)}}</view> | |
133 | 133 | </view> |
134 | 134 | |
135 | 135 | <view class="abs white xc-nanber"> |
... | ... | @@ -535,6 +535,7 @@ |
535 | 535 | |
536 | 536 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.lb_id>0}}" data-id="{{item.lb_id}}" bindtap="viewLbDetails">送{{item.lbtitle}}</view> |
537 | 537 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.zxlb_id>0}}" data-id="{{item.zxlb_id}}" data-flag="1" bindtap="viewLbDetails">送{{item.zxlbtitle}}</view> |
538 | + <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.monthgiftbag_id>0}}" data-id="{{item.monthgiftbag_id}}" data-flag="2" bindtap="viewLbDetails">送{{item.monthgiftbag_title}}</view> | |
538 | 539 | </view> |
539 | 540 | </view> |
540 | 541 | </view> |
... | ... | @@ -684,7 +685,7 @@ |
684 | 685 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
685 | 686 | (配送不匹配) |
686 | 687 | </view> |
687 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 && !sele_g.whsle_id}}"> | |
688 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> | |
688 | 689 | (库存不足) |
689 | 690 | </view> |
690 | 691 | </block> |
... | ... | @@ -1264,12 +1265,19 @@ |
1264 | 1265 | <block wx:if="{{prom_type==0}}"> |
1265 | 1266 | <view class="flex"> |
1266 | 1267 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
1268 | + <!-- 线下门店销售的时候 --> | |
1267 | 1269 | <block wx:if="{{sales_rules>=2}}"> |
1268 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
1269 | - 可售:{{def_pick_store.CanOutQty}} | |
1270 | - </view> | |
1271 | - <view class="spec-goods-stock" wx:else>可售:0</view> | |
1270 | + | |
1271 | + <!-- 如果不是虚拟商品的时候 --> | |
1272 | + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}"> | |
1273 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | |
1274 | + 可售:{{def_pick_store.CanOutQty}} | |
1275 | + </view> | |
1276 | + <view class="spec-goods-stock" wx:else>可售:0</view> | |
1277 | + </block> | |
1278 | + | |
1272 | 1279 | </block> |
1280 | + | |
1273 | 1281 | <block wx:else> |
1274 | 1282 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
1275 | 1283 | </block> |
... | ... | @@ -1314,7 +1322,7 @@ |
1314 | 1322 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
1315 | 1323 | <block wx:else> |
1316 | 1324 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
1317 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 &&!sele_g.whsle_id}}"> | |
1325 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0 &&!sele_g.whsle_id }}"> | |
1318 | 1326 | (库存不足) |
1319 | 1327 | </view> |
1320 | 1328 | </block> |
... | ... | @@ -1361,8 +1369,11 @@ |
1361 | 1369 | <text wx:if="{{hui_condition.gift_id}}">,送赠品</text> |
1362 | 1370 | <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text> |
1363 | 1371 | <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text> |
1372 | + <text wx:if="{{hui_condition.monthgiftbag_id>0}}">,送每月礼包</text> | |
1364 | 1373 | </view> |
1365 | 1374 | </view> |
1375 | + | |
1376 | + <!-- 底部处理按钮 --> | |
1366 | 1377 | <view class="spec-cart-btns"> |
1367 | 1378 | <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> |
1368 | 1379 | 配送不匹配 |
... | ... | @@ -1393,9 +1404,13 @@ |
1393 | 1404 | </view> |
1394 | 1405 | </block> |
1395 | 1406 | <block wx:else> |
1407 | + | |
1408 | + | |
1409 | + | |
1396 | 1410 | <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 --> |
1397 | 1411 | <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> |
1398 | - <block wx:if="{{!def_pick_store.CanOutQty}}"> | |
1412 | + | |
1413 | + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1 }}"> | |
1399 | 1414 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
1400 | 1415 | 库存不足 |
1401 | 1416 | </view> |
... | ... | @@ -1411,7 +1426,7 @@ |
1411 | 1426 | </block> |
1412 | 1427 | <!-- 线上销售 --> |
1413 | 1428 | <block wx:else> |
1414 | - <block wx:if="{{sele_g.store_count<=0 && is_no_new}}"> | |
1429 | + <block wx:if="{{ sele_g.store_count<1 && is_no_new}}"> | |
1415 | 1430 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
1416 | 1431 | 库存不足 |
1417 | 1432 | </view> |
... | ... | @@ -1638,7 +1653,7 @@ |
1638 | 1653 | <view class="flex-vertical-between "> |
1639 | 1654 | <view class="flex xc-ash"> |
1640 | 1655 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
1641 | - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> | |
1656 | + <text class="c-red22" wx:if="{{item.is_no_qyt }}">(库存不足)</text> | |
1642 | 1657 | </view> |
1643 | 1658 | </view> |
1644 | 1659 | <view> | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -481,7 +481,7 @@ |
481 | 481 | <pingd_buy object="{{item.content}}"></pingd_buy> |
482 | 482 | </block> |
483 | 483 | <!--秒杀--> |
484 | - <block wx:if="{{item.ename=='seckill'}}"> | |
484 | + <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | |
485 | 485 | <seckill object="{{item.content}}"></seckill> |
486 | 486 | </block> |
487 | 487 | <!--标题--> | ... | ... |
pages/template/index.wxml
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | <pingd_buy object="{{item.content}}"></pingd_buy> |
39 | 39 | </block> |
40 | 40 | <!--秒杀--> |
41 | - <block wx:if="{{item.ename=='seckill'}}"> | |
41 | + <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | |
42 | 42 | <seckill object="{{item.content}}"></seckill> |
43 | 43 | </block> |
44 | 44 | <!--标题--> | ... | ... |
pages/user/add_address/add_address.wxml
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | |
8 | 8 | <view class="item"> |
9 | 9 | <view class="item-name">收货人</view> |
10 | - <input class="item-input" name="consignee" value="{{address.consignee}}" placeholder="请填写收货人姓名" placeholder-style="color: rgb(199, 199, 199)"></input> | |
10 | + <input maxlength="10" class="item-input" name="consignee" value="{{address.consignee}}" placeholder="请填写收货人姓名" placeholder-style="color: rgb(199, 199, 199)"></input> | |
11 | 11 | </view> |
12 | 12 | <view class="item"> |
13 | 13 | <view class="item-name">手机号码</view> | ... | ... |
pages/user/assistance/giftpacklist.wxss
... | ... | @@ -93,7 +93,8 @@ |
93 | 93 | .box_ware_img image.data-v-3a5b7e36 { |
94 | 94 | /* width: 185rpx; |
95 | 95 | height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ |
96 | - border: 2rpx solid #999; | |
96 | + border: 2rpx solid #fafaf9; | |
97 | + border-radius: 4rpx; | |
97 | 98 | width: 120rpx; |
98 | 99 | height: 120rpx; |
99 | 100 | background-color:#f8f8f8; | ... | ... |
pages/user/index/index.js
... | ... | @@ -105,7 +105,7 @@ Page({ |
105 | 105 | } |
106 | 106 | |
107 | 107 | }else{ |
108 | - app.getUserFir(); | |
108 | + // app.getUserFir(); | |
109 | 109 | } |
110 | 110 | this.init_user_tool() |
111 | 111 | }, |
... | ... | @@ -616,14 +616,22 @@ Page({ |
616 | 616 | |
617 | 617 | //--跳转到预存款页面-- |
618 | 618 | deposit: function () { |
619 | - if (!this.data.userInfo) return false; | |
619 | + if (!this.data.userInfo) | |
620 | + { | |
621 | + this.gobindtel(); | |
622 | + return false; | |
623 | + } | |
620 | 624 | wx.navigateTo({ |
621 | 625 | url: '/packageD/pages/user/deposit/deposit', |
622 | 626 | }) |
623 | 627 | }, |
624 | 628 | //--跳转到余额页面-- |
625 | 629 | balance: function () { |
626 | - if (!this.data.userInfo) return false; | |
630 | + if (!this.data.userInfo) | |
631 | + { | |
632 | + this.gobindtel(); | |
633 | + return false; | |
634 | + }; | |
627 | 635 | wx.navigateTo({ |
628 | 636 | url: '/packageD/pages/user/member/menber', |
629 | 637 | }) |
... | ... | @@ -631,7 +639,11 @@ Page({ |
631 | 639 | //--跳转到优惠券-- |
632 | 640 | coupon: function () { |
633 | 641 | var th = this; |
634 | - if (!this.data.userInfo) return false; | |
642 | + if (!this.data.userInfo) | |
643 | + { | |
644 | + this.gobindtel(); | |
645 | + return false; | |
646 | + }; | |
635 | 647 | // th.sendsm(); |
636 | 648 | wx.navigateTo({ |
637 | 649 | url: '/packageD/pages/user/coupons/coupons', |
... | ... | @@ -639,7 +651,11 @@ Page({ |
639 | 651 | }, |
640 | 652 | //--跳转到积分-- |
641 | 653 | integral: function () { |
642 | - if (!this.data.userInfo) return false; | |
654 | + if (!this.data.userInfo) | |
655 | + { | |
656 | + this.gobindtel(); | |
657 | + return false; | |
658 | + } | |
643 | 659 | wx.navigateTo({ |
644 | 660 | url: '/packageD/pages/user/integral/integral', |
645 | 661 | }) |
... | ... | @@ -652,7 +668,11 @@ Page({ |
652 | 668 | }, |
653 | 669 | |
654 | 670 | go_order: function (e) { |
655 | - if (!this.data.userInfo) return false; | |
671 | + if (!this.data.userInfo) | |
672 | + { | |
673 | + this.gobindtel(); | |
674 | + return false; | |
675 | + }; | |
656 | 676 | var url = e.currentTarget.dataset.url; |
657 | 677 | wx.navigateTo({ |
658 | 678 | url: url, |
... | ... | @@ -991,10 +1011,23 @@ Page({ |
991 | 1011 | //过滤掉分销关闭的 |
992 | 1012 | let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的 |
993 | 1013 | await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => { |
994 | - if (rs.data.code == 0) { | |
995 | - var dis = rs.data.data; | |
1014 | + if (rs.data.code == 0 || !rs.data.data) { | |
1015 | + var is_ok=1; | |
1016 | + | |
1017 | + if(!distribut_end_time){ | |
1018 | + is_ok=0; | |
1019 | + } | |
1020 | + else if(!rs.data.data){ | |
1021 | + is_ok=0; | |
1022 | + }else{ | |
1023 | + var dis=rs.data.data; | |
1024 | + if(!dis || dis.switch == 0){ | |
1025 | + is_ok=0; | |
1026 | + } | |
1027 | + } | |
1028 | + | |
996 | 1029 | for (var i in d_list) { |
997 | - if (d_list[i].name == '我的分销' && (!dis || dis.switch == 0) || (d_list[i].name == '我的分销' && !distribut_end_time)) { | |
1030 | + if (d_list[i].name == '我的分销' && !is_ok) { | |
998 | 1031 | d_list.splice(i, 1); |
999 | 1032 | } |
1000 | 1033 | } | ... | ... |
pages/user/my_service/i_service.wxml
pages/user/my_service/i_service.wxss
... | ... | @@ -25,7 +25,7 @@ page { |
25 | 25 | .rel { |
26 | 26 | background-color: rgb(255, 255, 255); |
27 | 27 | width: 346rpx; |
28 | - height: 430rpx; | |
28 | + min-height: 460rpx; | |
29 | 29 | border-radius: 20rpx; |
30 | 30 | display: inline-block; |
31 | 31 | /* margin-right: 15rpx; */ |
... | ... | @@ -64,10 +64,11 @@ page { |
64 | 64 | .itemName { |
65 | 65 | margin-bottom: 25rpx; |
66 | 66 | color: rgb(48, 48, 48); |
67 | + height: 64rpx; | |
67 | 68 | } |
68 | 69 | |
69 | 70 | .itemName .Name { |
70 | - max-width: 250rpx; | |
71 | + max-width: 290rpx; | |
71 | 72 | text-align: center; |
72 | 73 | } |
73 | 74 | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -80,7 +80,15 @@ Page({ |
80 | 80 | r.order_status_detail="待支付"; r.pay_btn=1; |
81 | 81 | } |
82 | 82 | if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0) |
83 | - r.order_status_detail = "待发货"; | |
83 | + //自提的话 | |
84 | + if (r.exp_type==1) | |
85 | + { | |
86 | + r.order_status_detail = "待自提"; | |
87 | + } | |
88 | + else | |
89 | + { | |
90 | + r.order_status_detail = "待发货"; | |
91 | + } | |
84 | 92 | |
85 | 93 | if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 1){ |
86 | 94 | r.order_status_detail = "待收货";r.receive_btn=1; |
... | ... | @@ -651,7 +659,7 @@ Page({ |
651 | 659 | } |
652 | 660 | |
653 | 661 | //--如果是线下库存的时候-- |
654 | - if(th.data.conf.sales_rules==2 && !gg.whsle_id){ | |
662 | + if(th.data.conf.sales_rules>=2 && !gg.whsle_id){ | |
655 | 663 | var ob={}; |
656 | 664 | await th.check_down_line_next(gg,good.goods_num,order.pickup_id,function(obj){ |
657 | 665 | ob=obj; |
... | ... | @@ -953,8 +961,13 @@ Page({ |
953 | 961 | |
954 | 962 | //---检验线下库存的数量的子函数--- |
955 | 963 | async check_down_line_next(gg,num,pick_id,func){ |
956 | - | |
957 | - var lock=0,pick_no,plist; | |
964 | + //如果默认是商品 | |
965 | + if(getApp().is_virtual(gg)){ | |
966 | + return func(100000); | |
967 | + } | |
968 | + | |
969 | + | |
970 | + var lock=0,pick_no,plist; | |
958 | 971 | var lock_rq={store_id:os.stoid,wareId:gg.goods_id,storageId:pick_id}; |
959 | 972 | if(this.data.sales_rules==3){ |
960 | 973 | log_rq.appoint_pick_keyid=this.data.appoint_pick_keyid; | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -1249,6 +1249,11 @@ Page({ |
1249 | 1249 | //---检验线下库存的数量的子函数--- |
1250 | 1250 | async check_down_line_next(gg, num, pick_id, func) { |
1251 | 1251 | |
1252 | + //如果默认是商品 | |
1253 | + if(getApp().is_virtual(gg)){ | |
1254 | + return func(100000); | |
1255 | + } | |
1256 | + | |
1252 | 1257 | var lock = 0, pick_no, plist; |
1253 | 1258 | var log_rq = { store_id: os.stoid, wareId: gg.goods_id, storageId: pick_id }; |
1254 | 1259 | if (this.data.sales_rules == 3) { |
... | ... | @@ -1667,7 +1672,7 @@ Page({ |
1667 | 1672 | |
1668 | 1673 | |
1669 | 1674 | //判断是不是线下库存的购买, 是不是秒杀活动 |
1670 | - if (th.data.sales_rules >= 2 && !prom && !good.whsle_id) { | |
1675 | + if (!getApp().is_virtual(good) && th.data.sales_rules >= 2 && !prom && !good.whsle_id) { | |
1671 | 1676 | |
1672 | 1677 | //-- 看一下购物车上有多少商品 -- |
1673 | 1678 | var cart_num = 0; |
... | ... | @@ -2467,6 +2472,8 @@ Page({ |
2467 | 2472 | let user_id = oo.user_id; |
2468 | 2473 | let flag = true; |
2469 | 2474 | |
2475 | + let th=this; | |
2476 | + | |
2470 | 2477 | |
2471 | 2478 | // 如果是普通购买或单独购买,不用判断 |
2472 | 2479 | // 如果是秒杀购买:1、判断活动是否变化;2、是否超出限购 | ... | ... |
pages/user/order_list/order_list.wxml
... | ... | @@ -71,8 +71,14 @@ |
71 | 71 | </block> |
72 | 72 | |
73 | 73 | <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> |
74 | - <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> | |
75 | - <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> | |
74 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}"> | |
75 | + <block wx:if="{{item.exp_type==1}}">待自提</block> | |
76 | + <block wx:else>待发货</block> | |
77 | + </view> | |
78 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}"> | |
79 | + <block wx:if="{{item.exp_type==1}}">待自提</block> | |
80 | + <block wx:else>待发货</block> | |
81 | + </view> | |
76 | 82 | <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view> |
77 | 83 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> |
78 | 84 | </view> |
... | ... | @@ -92,8 +98,14 @@ |
92 | 98 | <view wx:if="{{item.is_back ==1 && item.pay_status ==1}}">已退款</view> |
93 | 99 | <view wx:elif="{{item.is_back == 0 && item.pay_status ==1 && item.team_status == 0}}">已支付,待成团</view> |
94 | 100 | <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> |
95 | - <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}">待发货</view> | |
96 | - <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}">待收货</view> | |
101 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}"> | |
102 | + <block wx:if="{{item.exp_type==1}}">待自提</block> | |
103 | + <block wx:else>待发货</block> | |
104 | + </view> | |
105 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}"> | |
106 | + <block wx:if="{{item.exp_type==1}}">待自提</block> | |
107 | + <block wx:else>待发货</block> | |
108 | + </view> | |
97 | 109 | <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view> |
98 | 110 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> |
99 | 111 | </view> |
... | ... | @@ -109,7 +121,10 @@ |
109 | 121 | <view wx:if="{{item.pt_status==1 && item.pt_prom_id>0}}">组团中</view> |
110 | 122 | <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> |
111 | 123 | <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> |
112 | - <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> | |
124 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}"> | |
125 | + <block wx:if="{{item.exp_type==1}}">待自提</block> | |
126 | + <block wx:else>待发货</block> | |
127 | + </view> | |
113 | 128 | <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> |
114 | 129 | <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view> |
115 | 130 | <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> | ... | ... |
pages/user/userinfo/userinfo.js
pages/user/userinfo/userinfo.wxml
... | ... | @@ -170,7 +170,7 @@ |
170 | 170 | <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname"> |
171 | 171 | <view class="user-name-txt">姓名</view> |
172 | 172 | <view class="flex ai_c"> |
173 | - <input bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' /> | |
173 | + <input maxlength="10" bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' /> | |
174 | 174 | <block wx:if="{{!user.vipname}}"> |
175 | 175 | <text class="lb_txt" wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</text> |
176 | 176 | <text class="lb_txt" wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</text> | ... | ... |
utils/filter.wxs
... | ... | @@ -289,4 +289,8 @@ module.exports = { |
289 | 289 | isExpired: filters.isExpired, |
290 | 290 | gettimestamp: filters.gettimestamp, |
291 | 291 | showStartAndEndDate: filters.showStartAndEndDate, |
292 | + is_virtual_gd:function (is_virtual){ | |
293 | + if(is_virtual==2) return true; | |
294 | + return false; | |
295 | + } | |
292 | 296 | } |
293 | 297 | \ No newline at end of file | ... | ... |