Commit 82bfcbeacafb31cce597538417ad01d87276a58f

Authored by yvan.ni
2 parents 41cf0207 1e723fe6

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

Showing 56 changed files with 2149 additions and 1111 deletions
... ... @@ -989,7 +989,14 @@ App({
989 989 };
990 990 },
991 991 });
992   - };
  992 + }
  993 + else{
  994 + wx.showModal({
  995 + content: '商家未设置客服热线',
  996 + showCancel: 0,
  997 +
  998 + });
  999 + }
993 1000 });
994 1001 },
995 1002  
... ... @@ -1314,7 +1321,6 @@ App({
1314 1321 var stoid=this.globalData.setting.stoid;
1315 1322 var user_id=this.globalData.user_id;
1316 1323  
1317   -
1318 1324 this.getConfig2(async function (e){
1319 1325 if(e && e.switch_list) conf=JSON.parse(e.switch_list);
1320 1326 if(conf && conf.express_searchtype==1){
... ... @@ -1335,7 +1341,43 @@ App({
1335 1341 return true;
1336 1342 }
1337 1343 return false;
  1344 + },
  1345 + //---- 判断是不是虚拟商品狗阿米 -----
  1346 + is_virtual(gd){
  1347 + if(gd.is_virtual==2) return true;
  1348 + return false;
  1349 + },
  1350 +
  1351 + /**
  1352 + *
  1353 + * @param gd 商品
  1354 + * @param act 活动
  1355 + * @param get_type 0默认 1是加和减的时候
  1356 + */
  1357 + get_limit_qty(gd,act,get_type){
  1358 + var islimit=gd.erp_islimit; //是不是限购
  1359 + var limittype=gd.erp_limittype; //不低于0、倍数1
  1360 + var limitqty=gd.erp_limitqty; //起购量
  1361 +
  1362 + //-- 如果有活动的时候 --
  1363 + if(act){
  1364 + islimit=act.islimit;
  1365 + limittype=act.limittype;
  1366 + limitqty=act.limitqty;
  1367 + }
  1368 +
  1369 + //-- 不是限购的时候,返回1--
  1370 + if(!islimit) return 1;
  1371 + //-- 默认的时候 --
  1372 + if(!get_type) return limitqty;
  1373 + //不低于的时候,加减的时候
  1374 + if(!limittype) return 1;
  1375 + //倍数,加减的时候
  1376 + return limitqty;
1338 1377  
1339 1378 }
1340 1379  
  1380 +
  1381 +
  1382 +
1341 1383 });
... ...
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: {
... ... @@ -45,7 +48,7 @@ Component({
45 48 var th = this;
46 49 var g_id = this.data.object;
47 50 //只有再会员登陆之后,才重新调用接口
48   -
  51 + console.log('秒杀组件------------');
49 52 if(this.data.user_id!=getApp().globalData.user_id){
50 53 this.data.user_id=getApp().globalData.user_id
51 54 this.init(g_id);
... ... @@ -79,7 +82,7 @@ Component({
79 82 customMethod: function () { },
80 83 init: function (g_id) {
81 84 var th = this;
82   -
  85 + this.loadImg(g_id)
83 86 getApp().getConfig2(function (e) {
84 87 var swithc_list = e.switch_list;
85 88 var sw_arr = JSON.parse(swithc_list);
... ... @@ -194,23 +197,35 @@ Component({
194 197  
195 198  
196 199 Promise.all(promisies).then(() => {
197   -
198 200 // 判断活动是否结束
199 201 for(let i in all_array){
200 202 let item=all_array[i];
201 203 if(newTime > item.end_time) {
202 204 all_array[i].status = 3;
203   - };
204   -
  205 + };
  206 + all_array[i].residue=all_array[i].goods_num*1 - all_array[i].buy_num*1
  207 + }
  208 +
  209 + var arr = new Array();
  210 + if (th.data.object.style==6) {
  211 + //--三个三个一组---
  212 + for (var i = 0; i < all_array.length; i += 2) {
  213 + arr.push(all_array.slice(i, i + 2));
  214 + }
  215 +
  216 + }else{
  217 + //--三个三个一组---
  218 + for (var i = 0; i < all_array.length; i += 3) {
  219 + arr.push(all_array.slice(i, i + 3));
  220 + }
  221 + }
  222 +
  223 + /*--熏染到前台--*/
  224 + th.setData({ goods_array: arr });
  225 + if (th.data.object.style==6) {
  226 + th.setSwiper_h()
205 227 }
206 228  
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 229 });
215 230  
216 231  
... ... @@ -218,7 +233,30 @@ Component({
218 233 th.countDown2(th);
219 234 }, 1000);
220 235 },
221   -
  236 + setSwiper_h(){
  237 + var th=this
  238 + wx.createSelectorQuery().in(this).select('.swiper_h').boundingClientRect(rect => {
  239 + if (rect && rect.height) {
  240 + var sumHeigth=(rect.height+13)+'px'
  241 + th.setData({
  242 + swiperHeight: sumHeigth
  243 + })
  244 + }
  245 + }).exec();
  246 + // const query = this.createSelectorQuery()
  247 + // query.select('.swiper_h').boundingClientRect()
  248 + // query.exec( (res)=> {
  249 + // console.log(res)
  250 + // console.log(res[0].height)
  251 + // console.log(res[0].height * data.t.length)
  252 + // let sumHeigth = res[0].height * data.t.length;
  253 + // console.error('组件高度');
  254 + // console.log(sumHeigth);
  255 + // th.setData({
  256 + // swiperHeight: sumHeigth
  257 + // })
  258 + // })
  259 + },
222 260  
223 261  
224 262 //---小于10的格式化函数----
... ... @@ -285,7 +323,28 @@ Component({
285 323 wx.navigateTo({
286 324 url: "/pages/activity/seckill_list/seckill_list"
287 325 });
  326 + },
  327 + //加入购物车
  328 + shoppingCart(){
  329 + console.log('加入购物车');
  330 + },
  331 + loadImg(g_id){
  332 + if (g_id.style==1) {
  333 + let w=''
  334 + switch (g_id.picture_scale) {
  335 + case 1:
  336 + w=`width:calc(100%-${g_id.page_margins*2}px);height:calc(100%-${g_id.page_margins*2}px)`
  337 + break;
  338 +
  339 + default:
  340 + break;
  341 + }
  342 +
  343 +
  344 +
  345 + }
288 346 }
  347 +
289 348 },
290 349  
291 350  
... ...
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+')'}}">
  5 + <view class="flex">
  6 + <view class='t_left'></view>
  7 + <view class='t_ms'>{{object.column_name}}</view>
  8 + </view>
  9 + <view class='right_k'>
  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>
  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.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') + ((object.product_style==1 || object.product_style==3 )? ' bgf ':'')}}" 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>
  25 +
  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'}}"></image>
  28 + </view>
  29 + <view style="height: 70rpx;" class="new_item1_time" wx:if="{{object.count_down}}">
  30 + <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image>
  31 + <view style="text-align: center;">
  32 + <view>距结束时间</view>
  33 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  34 + </view>
  35 + </view>
  36 + <view class="ellipsis-2 new_item1_goods_name" style="{{'padding:10rpx;'+(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view>
  37 + <view class="new_item1_price" style="{{'padding:0 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  38 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  39 + <view class="flex" style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  40 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  41 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  42 + </view>
  43 + <view style="color: rgb(56, 56, 56);">
  44 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  45 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  46 + </view>
  47 + </view>
  48 + <view >
  49 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  50 + <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>
  51 + </view>
  52 + </view>
  53 + </navigator>
  54 + </view>
  55 + </block>
  56 + </view>
  57 + </block>
  58 + <!-- 一行两个 -->
  59 + <block wx:if="{{object.style==2}}">
  60 + <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 ':'')}}">
  61 + <block wx:for="{{goods_array}}">
  62 + <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 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}">
  63 + <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">
  64 + <view class="imgBox">
  65 + <!-- <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> -->
  66 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  67 + <!-- <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> -->
  68 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '+ (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}"data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  69 + </view>
  70 +
  71 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  72 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  73 + </view>
  74 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  75 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  76 + <!-- <view style="text-align: center;">
  77 + <view>距结束时间</view> -->
  78 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  79 + <!-- </view> -->
  80 + </view>
  81 + <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>
  82 + <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;':'')}}">
  83 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  84 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  85 + </view>
  86 + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  87 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  88 + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  89 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  90 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  91 + </view>
  92 + </view>
  93 + <view>
  94 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  95 + <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>
  96 + </view>
  97 + </view>
  98 + </navigator>
  99 + </view>
  100 + </block>
  101 + </view>
  102 + </block>
  103 + <!-- 一行三个 -->
  104 + <block wx:if="{{object.style==3}}">
  105 + <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 ':'')}}">
  106 + <block wx:for="{{goods_array}}">
  107 + <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 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/3 - ' + (object.product_spacing*2)/3+'px)')}}">
  108 + <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">
  109 + <view class="imgBox">
  110 + <!-- <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> -->
  111 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  112 + <!-- <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> -->
  113 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 '+ (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}"data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  114 + </view>
  115 +
  116 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  117 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  118 + </view>
  119 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  120 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  121 + <!-- <view style="text-align: center;">
  122 + <view>距结束时间</view> -->
  123 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  124 + <!-- </view> -->
  125 + </view>
  126 + <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>
  127 + <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;':'')}}">
  128 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  129 + <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text>
  130 + </view>
  131 + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  132 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  133 + <view style="{{'font-size: 24rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  134 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:28rpx;">{{aitem.price}}</text></view>
  135 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  136 + </view>
  137 + </view>
  138 + <view>
  139 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 60rpx;height: 60rpx;"></image>
  140 + <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>
  141 + </view>
  142 + </view>
  143 + </navigator>
  144 + </view>
  145 + </block>
  146 + </view>
  147 + </block>
  148 + <!-- 详细列表 -->
  149 + <block wx:if="{{object.style==4}}">
  150 + <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 ':'')}}">
  151 + <block wx:for="{{goods_array}}">
  152 + <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 ':'')}}" style="{{'border-top-right-radius:0;margin-bottom:'+object.product_spacing+'px;'}}">
  153 + <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">
  154 + <view style="width: 50%;">
  155 + <view class="imgBox">
  156 + <!-- <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> -->
  157 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  158 + <!-- <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> -->
  159 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1'+ (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  160 + </view>
  161 +
  162 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  163 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  164 + </view>
  165 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  166 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  167 + <!-- <view style="text-align: center;">
  168 + <view>距结束时间</view> -->
  169 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  170 + <!-- </view> -->
  171 + </view>
  172 + </view>
  173 + <view style="width: 50%;display: flex;flex-wrap: wrap;padding-left: 10rpx;">
  174 + <view class="ellipsis-2 new_item1_goods_name" style="{{'font-size:28rpx;'+(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view>
  175 + <view wx:if="{{object.seconds_num || object.remaining_inventory}}" class="new_item1_price" style="{{'font-size:28rpx;display:block;color: rgb(56, 56, 56); '+(object.text_align==2 ?'text-align:center;':'')+(object.text_style==2 ? 'font-weight: bold;':'')}}">
  176 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  177 + <text wx:if="{{object.remaining_inventory}}">剩<text class="clor">{{aitem.residue}}</text>件</text>
  178 + </view>
  179 + <view class="new_item1_price" style="{{'width:100%;' + (object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  180 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  181 + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  182 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  183 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  184 + </view>
  185 + </view>
  186 + <view>
  187 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  188 + <view style="width: 120rpx;height: 70rpx;line-height: 70rpx;" 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>
  189 + </view>
  190 + </view>
  191 + </view>
  192 + </navigator>
  193 + </view>
  194 + </block>
  195 + </view>
  196 + </block>
  197 + <!-- 一大一小 -->
  198 + <block wx:if="{{object.style==5}}">
  199 + <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 ':'')}}">
  200 + <block wx:for="{{goods_array}}">
  201 + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
  202 + <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;'}}">
  203 + <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">
  204 + <view class="imgBox">
  205 + <!-- <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> -->
  206 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  207 + <!-- <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> -->
  208 + <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>
  209 + </view>
  210 +
  211 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  212 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  213 + </view>
  214 + <view style="height: 70rpx;" class="new_item1_time" wx:if="{{object.count_down}}">
  215 + <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image>
  216 + <view style="text-align: center;">
  217 + <view>距结束时间</view>
  218 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  219 + </view>
  220 + </view>
  221 + <view class="ellipsis-2 new_item1_goods_name" style="{{'padding:10rpx;'+(object.text_style==2 ? 'font-weight: bold;':'') + (object.text_align==2 ? 'text-align:center;' :'' )}}" wx:if="{{object.trade_name}}">{{aitem.goods_name}}</view>
  222 + <view class="new_item1_price" style="{{'padding:0 10rpx;'+(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  223 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  224 + <view class="flex" style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  225 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  226 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  227 + </view>
  228 + <view style="color: rgb(56, 56, 56);">
  229 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  230 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  231 + </view>
  232 + </view>
  233 + <view>
  234 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  235 + <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>
  236 + </view>
  237 + </view>
  238 + </navigator>
  239 + </view>
  240 + <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 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}">
  241 + <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">
  242 + <view class="imgBox">
  243 + <!-- <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> -->
  244 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  245 + <!-- <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> -->
  246 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 ' + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}"data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  247 + </view>
  248 +
  249 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  250 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  251 + </view>
  252 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  253 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  254 + <!-- <view style="text-align: center;">
  255 + <view>距结束时间</view> -->
  256 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  257 + <!-- </view> -->
  258 + </view>
  259 + <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>
  260 + <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;':'')}}">
  261 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  262 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  263 + </view>
  264 + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  265 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  266 + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  267 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  268 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  269 + </view>
  270 + </view>
  271 + <view>
  272 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  273 + <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>
  274 + </view>
  275 + </view>
  276 + </navigator>
  277 + </view>
  278 + <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 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}">
  279 + <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">
  280 + <view class="imgBox">
  281 + <!-- <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> -->
  282 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  283 + <!-- <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> -->
  284 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 ' + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}"data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  285 + </view>
  286 +
  287 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  288 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  289 + </view>
  290 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  291 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  292 + <!-- <view style="text-align: center;">
  293 + <view>距结束时间</view> -->
  294 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  295 + <!-- </view> -->
  296 + </view>
  297 + <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>
  298 + <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;':'')}}">
  299 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  300 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  301 + </view>
  302 + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  303 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  304 + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  305 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  306 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  307 + </view>
  308 + </view>
  309 + <view>
  310 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  311 + <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>
  312 + </view>
  313 + </view>
  314 + </navigator>
  315 + </view>
  316 + </block>
  317 + </block>
  318 + </view>
  319 + </block>
  320 + <!-- 横向滑动 -->
  321 + <block wx:if="{{object.style==6}}">
  322 + <!-- <swiper indicator-dots circular> -->
  323 + <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 ':'')}}">
  324 + <swiper-item wx:for="{{goods_array}}" class="flex2" style="padding: 5rpx;">
  325 + <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 ':'')}}" style="{{'margin-bottom:'+object.product_spacing+'px; '+('width:calc(100%/2 - ' + object.product_spacing/2+'px)')}}">
  326 + <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">
  327 + <view class="imgBox">
  328 + <!-- <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> -->
  329 + <view class="{{'container'+object.picture_scale}}" style="{{object.picture_fill==1 ? 'background-color: #fff;' : ''}}">
  330 + <!-- <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> -->
  331 + <image mode="{{object.picture_fill==1 ? 'aspectFit' : 'aspectFill'}}" class="{{'new_item1_image images1 ' + (object.chamfer_of_main_drawing==2 ? ' but_radius5 ':'') }}" src="{{imghost+aitem.original_img}}"data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  332 + </view>
  333 +
  334 + <image class="imgBox_img" wx:if="{{object.subscript_style==5}}" src="{{object.subscript_diy_style}}"></image>
  335 + <image class="imgBox_img" wx:if="{{object.subscript_style<=4}}" src="{{imghost+'/miniapp/images/component/j0'+object.subscript_style +'.png'}}"></image>
  336 + </view>
  337 + <view class="new_item1_time" wx:if="{{object.count_down}}" style="justify-content: center;">
  338 + <!-- <image src="{{imghost+'/miniapp/images/component/seckill.png'}}"></image> -->
  339 + <!-- <view style="text-align: center;">
  340 + <view>距结束时间</view> -->
  341 + <view>{{aitem.djs.day}}天{{aitem.djs.hou}}:{{aitem.djs.min}}:{{aitem.djs.sec}}</view>
  342 + <!-- </view> -->
  343 + </view>
  344 + <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>
  345 + <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;':'')}}">
  346 + <text wx:if="{{object.seconds_num}}">已秒 <text class="clor">{{aitem.buy_num}}</text>件</text>
  347 + <text wx:if="{{object.remaining_inventory}}">还剩余<text class="clor">{{aitem.residue}}</text>件</text>
  348 + </view>
  349 + <view class="new_item1_price" style="{{(object.text_align==2 ? 'justify-content:center;flex-direction:column;' :'' )}}">
  350 + <view style="{{(object.text_style==2 ? 'font-weight: bold;':'')}}">
  351 + <view style="{{'font-size: 28rpx; ' +(object.text_align==2 ? 'justify-content:center;' :'' ) }}">
  352 + <view class="clor" style="margin-right: 5rpx;" wx:if="{{object.commodity_price}}">¥<text style="font-size:42rpx;">{{aitem.price}}</text></view>
  353 + <view wx:if="{{object.wholesale_price}}">¥{{aitem.market_price}}</view>
  354 + </view>
  355 + </view>
  356 + <view>
  357 + <image wx:if="{{object.purchase_button<=4}}" src="{{imghost+'/miniapp/images/component/0'+object.purchase_button+'.png'}}" style="width: 100rpx;height: 100rpx;"></image>
  358 + <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>
  359 + </view>
  360 + </view>
  361 + </navigator>
  362 + </view>
  363 + </swiper-item>
  364 + </swiper>
  365 + <!-- </swiper> -->
  366 +
  367 + </block>
  368 +
  369 + </block>
  370 + <block wx:else>
  371 + <!--秒杀-->
  372 + <view class='top' bindtap="go_to_skill">
  373 + <view class="flex">
  374 + <view class='t_left'></view>
  375 + <view class='t_ms'>秒杀</view>
  376 + </view>
  377 + <view class='right_k'>
  378 + <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image>
  379 + </view>
10 380 </view>
11   - </view>
  381 + <!--商品展示-->
  382 + <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}">
  383 + <view class='sp' wx:if="{{object.style==1}}">
  384 + <swiper-item class="s_it" wx:for="{{goods_array}}">
  385 + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
  386 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
  387 + <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">
  388 + <view class='one'>
  389 + <view class='sp_top'>
  390 + <view class='po'></view>
  391 + <block wx:if="{{aitem.status == 0}}">
  392 + <view class="rob" style="justify-content: flex-start">
  393 + <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span>
  394 + </view>
  395 + </block>
  396 + <block wx:if="{{aitem.status == 1}}">
  397 + <view class="rob" style="justify-content: flex-start">
  398 + <span class='s_top_kill'>火热进行</span>
  399 + </view>
  400 + </block>
  401 + <block wx:if="{{aitem.status == 2}}">
  402 + <view class="rob" style="justify-content: flex-start">
  403 + <span class='s_top_kill gray'>已抢光</span>
  404 + </view>
  405 + </block>
  406 + <block wx:if="{{aitem.status == 3}}">
  407 + <view class="rob" style="justify-content: flex-start">
  408 + <span class='s_top_kill gray'>活动已结束</span>
  409 + </view>
  410 + </block>
  411 +
  412 +
12 413  
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>
  414 + <view class='clear'></view>
  415 +
  416 + <view class='s_img'>
  417 + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
26 418 </view>
27   - </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 419  
66   - <view class='clear'></view>
  420 + <view class='s_foot_kill'>
  421 + <text>{{aitem.djs.day}}天</text>
  422 + <text>{{aitem.djs.hou}}时</text>
  423 + <text>{{aitem.djs.min}}分</text>
  424 + <text>{{aitem.djs.sec}}秒</text>
  425 + </view>
  426 + <view class='clear'></view>
67 427  
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 428 </view>
71 429  
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>
  430 + <view class='sp_wz'>
  431 + <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view>
  432 + <view class='sp_jg'>¥{{aitem.price}}</view>
  433 + <view wx:if="{{is_retail_price}}"class='sp_jgx ~no_line_x'>¥{{aitem.market_price}}</view>
77 434 </view>
78   - <view class='clear'></view>
79 435  
80 436 </view>
  437 + </navigator>
  438 + </block>
  439 + </swiper-item>
  440 + </view>
  441 + </swiper>
  442 + <view class="sp2" wx:if="{{object.style==2}}">
  443 + <block wx:for="{{goods_array}}">
  444 + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
  445 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
  446 + <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">
  447 + <view class='one1'>
81 448  
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>
  449 + <view class="o1_img">
  450 + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
86 451 </view>
87 452  
88   - </view>
89   - </navigator>
90   - </block>
91   - </swiper-item>
92   - </view>
93   - </swiper>
94   -
  453 + <view class="o1_right">
  454 + <view class="sp_wzi ellipsis-2">{{aitem.title}}</view>
  455 + <view class="o1_sj_kill">
  456 + <text>{{aitem.djs.day}}</text> 天
  457 + <text>{{aitem.djs.hou}}</text> :
  458 + <text>{{aitem.djs.min}}</text> :
  459 + <text>{{aitem.djs.sec}}</text>
95 460  
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   -
104   - <view class="o1_img">
105   - <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image>
  461 + </view>
  462 + <view class="money">
  463 + <view class='sp_jg'>¥{{aitem.price}}</view>
  464 + <!-- <view class='sp_jgx'>¥{{aitem.market_price}}</view>-->
  465 + </view>
  466 + <block wx:if="{{aitem.status == 0}}">
  467 + <view class="rob">
  468 + <view class="wo" style="background-color: #adadad">正在预热</view>
  469 + </view>
  470 + </block>
  471 +
  472 + <block wx:if="{{aitem.status == 3}}">
  473 + <view class="rob">
  474 + <view class="wo" style="background-color: #adadad">已结束</view>
  475 + </view>
  476 + </block>
  477 + <block wx:else>
  478 + <block wx:if="{{aitem.status == 1}}">
  479 + <view class="rob">
  480 + <view class="wo">我要抢</view>
106 481 </view>
  482 + </block>
107 483  
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>
115   -
116   - </view>
117   - <view class="money">
118   - <view class='sp_jg'>¥{{aitem.price}}</view>
119   -<!-- <view class='sp_jgx'>¥{{aitem.market_price}}</view>-->
120   - </view>
121   - <block wx:if="{{aitem.status == 0}}">
122   - <view class="rob">
123   - <view class="wo" style="background-color: #adadad">正在预热</view>
124   - </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>
  484 + <block wx:if="{{aitem.status == 2}}">
  485 + <view class="rob">
  486 + <view class="wo" style="background-color: #adadad">已抢光</view>
  487 + </view>
  488 + </block>
  489 + </block>
145 490  
146 491  
  492 + </view>
147 493 </view>
148   - </view>
149   - </navigator>
  494 + </navigator>
  495 + </block>
150 496 </block>
151   - </block>
152 497  
153   - </view>
154   - <view class='clear'></view>
  498 + </view>
  499 + <view class='clear'></view>
  500 + </block>
  501 +</block>
155 502  
156   -</block>
157 503 \ No newline at end of file
... ...
components/diy_seckill/diy_seckill.wxss
... ... @@ -292,9 +292,184 @@ swiper {
292 292  
293 293  
294 294 .ellipsis-2 {
  295 + height: 97rpx;
295 296 overflow: hidden;
296 297 text-overflow: ellipsis;
297 298 display: -webkit-box;
298 299 -webkit-box-orient: vertical;
299 300 -webkit-line-clamp: 2;
300   -}
301 301 \ No newline at end of file
  302 +}
  303 +
  304 +
  305 +.new_item1{
  306 + width: 100%;
  307 + overflow: hidden;
  308 +}
  309 +
  310 +.new_item1_image{
  311 + width: 100%;
  312 + /* max-width: 100%;
  313 + max-height: 100%; */
  314 +}
  315 +.new_item1_time{
  316 + height: 60rpx;
  317 + background: rgba(196, 24, 45, 1);
  318 + color: #fff;
  319 + font-size: 25rpx;
  320 + display: flex;
  321 + justify-content: space-between;
  322 + align-items: center;
  323 + padding: 0rpx 30rpx;
  324 +
  325 +}
  326 +.new_item1_time image{
  327 + width: 188rpx;
  328 + height: 52rpx;
  329 +}
  330 +.new_item1_goods_name{
  331 + padding: 10rpx 0rpx;
  332 + font-size: 26rpx;
  333 + width: 100%;
  334 + box-sizing: border-box;
  335 +}
  336 +.new_item1_price{
  337 + display: flex;
  338 + /* padding: 0 10rpx; */
  339 + align-items: center;
  340 + justify-content: space-between;
  341 + font-size: 26rpx;
  342 +}
  343 +.clor{
  344 + color: rgba(196, 24, 45, 1);
  345 +}
  346 +.new_item1_but{
  347 + width: 130rpx;
  348 + height: 60rpx;
  349 + color: #fff;
  350 + background-color: rgba(196,24,45,1);
  351 + line-height: 60rpx;
  352 + text-align: center;
  353 + border-radius: 15rpx;
  354 +}
  355 +.new_item1_but1{
  356 + border-radius: 50rpx !important;
  357 +}
  358 +.new_item1_but2{
  359 + border-radius: 50rpx !important;
  360 + background-color: rgba(0, 0, 0, 0) !important;
  361 + color: rgba(196,24,45,1) !important;
  362 + border: 1rpx solid rgba(196,24,45,1) !important;
  363 +}
  364 +.new_item1_but3{
  365 + background-color: rgba(0, 0, 0, 0) !important;
  366 + color: rgba(196,24,45,1) !important;
  367 + border: 1rpx solid rgba(196,24,45,1) !important;
  368 +}
  369 +
  370 +
  371 +
  372 +
  373 +.new_item1_box{
  374 + padding-top: 17rpx;
  375 + width: 100%;
  376 + box-sizing: border-box;
  377 + overflow: hidden;
  378 +}
  379 +
  380 +.aborder{
  381 + border: 1px solid #e8e8e8;
  382 +}
  383 +.bgf{
  384 + background-color: #fff;
  385 +}
  386 +.boxsha{
  387 + /* box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25); */
  388 + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  389 +}
  390 +.but_radius85{
  391 + border-radius:289rpx;
  392 +}
  393 +.but_radius5{
  394 + border-radius:17px 17px 0 0;
  395 +}
  396 +.imgBox{
  397 + position: relative;
  398 +}
  399 +.imgBox_img{
  400 + position: absolute;
  401 + left: 0;
  402 + top: 22rpx;
  403 + width: 74rpx;
  404 + height: 70rpx;
  405 +
  406 +}
  407 +
  408 +.aspect_ratio1{
  409 + aspect-ratio:1/1;
  410 +}
  411 +.aspect_ratio2{
  412 + aspect-ratio:16/9;
  413 +}
  414 +.aspect_ratio3{
  415 + aspect-ratio:3/2;
  416 +}
  417 +.aspect_ratio4{
  418 + aspect-ratio:3/4;
  419 +}
  420 +.container1 {
  421 + position: relative;
  422 + width:100%;
  423 + padding-top: 100%;
  424 + overflow: hidden;
  425 +}
  426 +.container2 {
  427 + position: relative;
  428 + width:100%;
  429 + padding-top: 56.25%;
  430 + overflow: hidden;
  431 +}
  432 +.container3 {
  433 + position: relative;
  434 + width:100%;
  435 + padding-top: 66.67%;
  436 + overflow: hidden;
  437 +}
  438 +.container4 {
  439 + position: relative;
  440 + width:100%;
  441 + padding-top: 133.33%;
  442 + overflow: hidden;
  443 +
  444 +}
  445 +
  446 +.images1 {
  447 + display: block;
  448 + position: absolute;
  449 + width: 100%;
  450 + height: 100%;
  451 + top: 0;
  452 + bottom: 0;
  453 + left: 0;
  454 + right: 0;
  455 + object-fit: cover;
  456 +
  457 +}
  458 +
  459 +.flex2{
  460 + display: flex;
  461 + /* align-items: center; */
  462 + justify-content: space-between;
  463 + flex-wrap: wrap;
  464 + box-sizing: border-box;
  465 +}
  466 +.flex2:after {
  467 + content: "";
  468 + width: 30%;
  469 + height: 0px;
  470 + visibility: hidden;
  471 + }
  472 +
  473 + .boxpad{
  474 + padding:11rpx 9rpx;
  475 + box-sizing: border-box;
  476 + }
302 477 \ No newline at end of file
... ...
components/diy_video/diy_video.wxml
1 1 <view class="vd_view">
2   - <video class="vd_web" src="{{videoUrl}}"></video>
  2 + <video class="vd_web" poster="{{object.bgsrc}}" src="{{videoUrl}}"></video>
3 3 </view>
4 4 \ No newline at end of file
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -3894,507 +3894,7 @@ Page({
3894 3894 });
3895 3895 },
3896 3896  
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   -
  3897 +
4398 3898 click_contact:function () {
4399 3899 getApp().globalData.no_clear=1;
4400 3900 },
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -958,7 +958,7 @@
958 958 <text class="iconfont icon-guan" bindtap="closeCS"></text>
959 959 </view>
960 960 <!-- 客服热线 -->
961   - <view class="pd20 bdt fs30 btn2" bindtap="contactService">
  961 + <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}">
962 962 <text class="iconfont icon-dianhua"></text>客服热线:
963 963 <text class="c-red">{{store_tel}}</text>
964 964 </view>
... ...
packageA/pages/profile/profile.js
... ... @@ -77,7 +77,7 @@ Page({
77 77 lat: null, //维度
78 78 lon: null, //经度
79 79 loading: 0,
80   -
  80 + oldBirtthDayLength:0, //生日日期个数
81 81 },
82 82 //通过路径跳转到其他页面
83 83 goto: function (e) {
... ... @@ -1126,20 +1126,81 @@ Page({
1126 1126 let address = this.getInput(e);
1127 1127 this.data.address = address;
1128 1128 },
1129   -
  1129 + //获取生日
  1130 + getbind(e) {
  1131 + console.log("获取生日222222222");
  1132 + console.log(e);
  1133 + let b = this.getInput(e);
  1134 + let length = b.length;
  1135 + let oldBirtthDayLength=this.data.oldBirtthDayLength
  1136 + if (length > oldBirtthDayLength) {
  1137 + if (b.length==4) {
  1138 + b+='-'
  1139 + }
  1140 + if (b.length==7) {
  1141 + b+='-'
  1142 + }
  1143 + // if (b.length==6 && b[5] >1) {
  1144 + // console.log(b[5]);
  1145 +
  1146 + // }
  1147 + }
  1148 + this.setData({
  1149 + datet: b,
  1150 + oldBirtthDayLength:length,
  1151 + });
  1152 + },
1130 1153 //获取生日
1131 1154 bindChange: function (e) {
  1155 + console.log("获取生日11111111");
  1156 + console.log(e);
1132 1157 let strBirthday = e.detail.value;
1133 1158 let age = this.verifyBirthday(strBirthday);
1134 1159  
1135 1160 if (age <= 10) {
1136 1161 app.my_warnning("会员年龄不能小于10岁(含10岁)", 0, this);
  1162 + this.setData({
  1163 + datet: '',
  1164 + });
1137 1165 } else if (age >= 70) {
1138 1166 app.my_warnning("会员年龄不能超过70岁(含70岁)", 0, this);
1139   - } else {
1140 1167 this.setData({
1141   - datet: e.detail.value,
1142   - });
  1168 + datet: '',
  1169 + });
  1170 + } else {
  1171 + let value = e.detail.value
  1172 +
  1173 + if (value.length==8) {
  1174 + value+='01'
  1175 + }
  1176 + if (value.length==7) {
  1177 + value+='-01'
  1178 + }
  1179 + if (value.length==9) {
  1180 + let ov=value[value.length-1]
  1181 + let nv=value.slice(0,-1)
  1182 + if (ov==0) {
  1183 + nv+='01'
  1184 + }else{
  1185 + nv+='0'+ov
  1186 + }
  1187 + value=nv
  1188 + }
  1189 + // let reg= /^(\d{4})-(\d{2})-(\d{2})$/;
  1190 + let reg= /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
  1191 + console.log('日期验证');
  1192 + console.log(value);
  1193 + console.log(reg.test(value));
  1194 + if (reg.test(value)) {
  1195 + this.setData({
  1196 + datet: value,
  1197 + });
  1198 + }else{
  1199 + app.my_warnning("出生日期格式不对", 0, this);
  1200 + this.setData({
  1201 + datet: '',
  1202 + });
  1203 + }
1143 1204 }
1144 1205  
1145 1206 },
... ...
packageA/pages/profile/profile.wxml
... ... @@ -90,14 +90,16 @@
90 90 <view class="shrink0">出生日期:</view>
91 91 <view class="flex fs28 Birth pdl20 jc_fe">
92 92 <view class="user-txt-right pdl20 flex ai-center">
93   - <checkbox-group bindchange="isLunar">
  93 + <input bindinput="getbind" bindblur="bindChange" maxlength="10" type="number" value="{{datet}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入出生日期"></input>
  94 + <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
  95 + <!-- <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view> -->
  96 + <image src="{{iurl}}/miniapp/images/calendar.png" style="width: 40rpx;height: 40rpx;"></image>
  97 + </picker>
  98 + <checkbox-group bindchange="isLunar" class="pdl20">
94 99 <label class="flex ai-center">
95 100 <checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历
96 101 </label>
97 102 </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 103  
102 104  
103 105 </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/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/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 (!getApp().is_virtual(that.data.fir_goods) && !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;
... ... @@ -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(!getApp().is_virtual(th.data.sele_g) && !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(!getApp().is_virtual(th.data.sele_g) && !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,20 @@ Page({
2188 2154  
2189 2155 //----------增加购买数量-----------
2190 2156 addCartNum: function (t) {
2191   - this.checkCartNum(this.data.goodsInputNum + 1);
  2157 +
  2158 + var add_num=1;
  2159 + if(this.data.is_normal == 1){
  2160 + add_num=getApp().get_limit_qty(this.data.sele_g,0,1);
  2161 + }
  2162 + this.checkCartNum(this.data.goodsInputNum + add_num);
2192 2163 },
2193 2164 //----------减少购买数量-----------
2194 2165 subCartNum: function (t) {
2195   - this.checkCartNum(this.data.goodsInputNum - 1);
  2166 + var add_num=1;
  2167 + if(this.data.is_normal == 1){
  2168 + add_num=getApp().get_limit_qty(this.data.sele_g,0,1);
  2169 + }
  2170 + this.checkCartNum(this.data.goodsInputNum - add_num);
2196 2171 },
2197 2172 //----------输入框输入购买数量-----------
2198 2173 inputCartNum: function (t) {
... ... @@ -2216,6 +2191,7 @@ Page({
2216 2191 //------检查数量是不是超出限购------
2217 2192 checkCartNum: function (t) {
2218 2193 var th = this;
  2194 + var mo_num=getApp().get_limit_qty(th.data.sele_g);
2219 2195 this.get_buy_num(this.data.sele_g, async function () {
2220 2196  
2221 2197 //--判断商品是否超出限购--
... ... @@ -2269,8 +2245,9 @@ Page({
2269 2245 }
2270 2246 }
2271 2247 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)) {
  2248 + var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4
  2249 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id &&
  2250 + 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)) {
2274 2251 if (!th.data.def_pick_store) {
2275 2252 wx.showModal({ title: '请选择门店', });
2276 2253 return false;
... ... @@ -2283,9 +2260,20 @@ Page({
2283 2260 if (e < t) {
2284 2261 wx.showModal({ title: '库存不足', });
2285 2262 if (e < 0) e = 0;
  2263 +
  2264 + if(th.data.is_normal == 1){
  2265 + if(e<mo_num) e=mo_num;
  2266 + }
  2267 +
2286 2268 th.setData({ goodsInputNum: e }); return false;
2287 2269 }
2288 2270 t > e || 0 == e ? t = e : t < 1 && (t = 1);
  2271 +
  2272 + //只有普通商品才有起购数
  2273 + if(th.data.is_normal == 1){
  2274 + if(t<mo_num) t=mo_num;
  2275 + }
  2276 +
2289 2277 th.setData({ goodsInputNum: t });
2290 2278 th.is_show_more_buy();
2291 2279  
... ... @@ -2350,8 +2338,9 @@ Page({
2350 2338 }
2351 2339  
2352 2340 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)) {
  2341 + var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4
  2342 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id &&
  2343 + 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)) {
2355 2344 if (!th.data.def_pick_store) {
2356 2345 wx.showModal({ title: '请选择门店', });
2357 2346 return false;
... ... @@ -2983,7 +2972,7 @@ Page({
2983 2972  
2984 2973  
2985 2974 //默认门店要拿下门店库存
2986   - if (that.data.sales_rules >= 2 && that.data.def_pick_store) {
  2975 + if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) {
2987 2976 var lock = 0, plist = null;
2988 2977 // //先读取门店的lock,采用链式写法,少用await
2989 2978 // getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
... ... @@ -3213,7 +3202,8 @@ Page({
3213 3202 th.setData({ all_pick_list: e.data.data.pageData });
3214 3203  
3215 3204 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
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)) {
  3205 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id &&
  3206 + 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 3207 setTimeout(function () {
3218 3208 th.deal_pickup_dline(e);
3219 3209 }, 800)
... ... @@ -4298,7 +4288,10 @@ Page({
4298 4288 // ind == 1 为普通购买
4299 4289 openSpecModel_pt: function (e) {
4300 4290  
4301   - this.setData({ open_ind_store: 9, goodsInputNum: 1 });
  4291 +
  4292 + var mo_num=getApp().get_limit_qty(this.data.sele_g);
  4293 +
  4294 + this.setData({ open_ind_store: 9, goodsInputNum: mo_num });
4302 4295 // 判断是否有待支付订单
4303 4296 var aid = this.data.group_id;
4304 4297 var switOn = true;
... ... @@ -4472,172 +4465,252 @@ Page({
4472 4465 //----------添加到购物车时,要判断限购数量,--------
4473 4466 e.get_buy_num(o, async function (ee) {
4474 4467  
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   - // }
  4468 + //---判断商品是否超出限购---
  4469 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  4470 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  4471 + wx.showModal({
  4472 + title: '提示',
  4473 + content: '超出商品限购'
  4474 + });
4489 4475  
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   - // }
  4476 + var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  4477 + if (num < 0) num = 0;
  4478 + th.setData({goodsInputNum: num})
  4479 + return false;
  4480 + }
  4481 + }
4504 4482  
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 4483  
4515   - // if (th.data.goodsInputNum > redis_num) {
4516   - // wx.showModal({
4517   - // title: '提示',
4518   - // content: '超出商品活动库存'
4519   - // });
  4484 + var redis_num = 0
4520 4485  
4521   - // th.setData({ goodsInputNum: redis_num })
  4486 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  4487 + th.setData({
  4488 + sto_sele_name: ""
  4489 + });
4522 4490  
4523   - // return false;
4524   - // }
4525   - // }
  4491 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  4492 +
  4493 + //--------------此时操作的数据------------
  4494 + var newd = {
  4495 + goods_id: o.goods_id,
  4496 + goods_num: th.data.goodsInputNum,
  4497 + pick_id: th.data.sto_sele_id,
  4498 + user_id: oo.user_id,
  4499 + store_id: th.data.stoid,
  4500 + goods_price: o.shop_price,
  4501 + goods_name: o.goods_name,
  4502 + goods_sn: o.goods_sn,
  4503 + sku: o.sku,
  4504 + };
4526 4505  
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   - // }
  4506 + //---是不是从收藏夹出来的---
  4507 + if (th.data.c_guide_id) {
  4508 + newd['guide_id'] = th.data.c_guide_id;
  4509 + newd['guide_type'] = 2;
4532 4510  
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);
  4511 + } else {
  4512 + if (getApp().globalData.guide_id) {
  4513 + newd['guide_id'] = getApp().globalData.guide_id;
  4514 + newd['guide_type'] = 0;
4538 4515  
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   - };
  4516 + }
  4517 + }
  4518 + if (getApp().globalData.groupchat_id) {
  4519 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  4520 + }
  4521 + //让商品带上房间号
  4522 + if (th.data.sys_switch.is_skuroom_id == 1) {
  4523 + if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
  4524 + newd.room_id = getApp().globalData.room_id;
  4525 + }
  4526 + } else {
  4527 + if (newd.goods_id == getApp().globalData.room_goods_id) {
  4528 + newd.room_id = getApp().globalData.room_id;
  4529 + }
  4530 + }
4551 4531  
4552   - //---是不是从收藏夹出来的---
4553   - if (th.data.c_guide_id) {
4554   - newd['guide_id'] = th.data.c_guide_id;
4555   - newd['guide_type'] = 2;
  4532 + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
4556 4533  
4557   - } else {
4558   - if (getApp().globalData.guide_id) {
4559   - newd['guide_id'] = getApp().globalData.guide_id;
4560   - newd['guide_type'] = 0;
  4534 + if (th.data.is_normal == 1) {
  4535 + var conf = th.data.bconfig;
  4536 + if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
  4537 + var s_list = JSON.parse(conf.switch_list);
4561 4538  
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   - }
  4539 + var now = ut.gettimestamp();
  4540 +
  4541 + var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');
  4542 + var end = new Date(str);
  4543 + end = Date.parse(end) / 1000;
  4544 +
  4545 + //如果后台有开启等级价的功能
  4546 + if (parseInt(s_list.rank_switch) == 2 && end > now) {
  4547 + var card_price = o[getApp().globalData.userInfo['card_field']];
  4548 + //如果会员有等级价
  4549 + if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null
  4550 + && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) {
  4551 + newd.goods_price = card_price;
  4552 + }
  4553 + }
  4554 + }
4577 4555  
4578   - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
  4556 + //---如果是线下门店销售的时候---
  4557 + if (!getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) {
  4558 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
4579 4559  
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);
  4560 + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) {
  4561 + if (CanOutQty) {
4584 4562  
4585   - var now = ut.gettimestamp();
  4563 + if (CanOutQty < e.data.goodsInputNum) {
  4564 + wx.showToast({
  4565 + title: '库存不足!',
  4566 + icon: 'none',
  4567 + });
  4568 + return false;
  4569 + }
4586 4570  
4587   - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');
4588   - var end = new Date(str);
4589   - end = Date.parse(end) / 1000;
  4571 + th.by_next_func(newd);
  4572 + } else {
  4573 + wx.showToast({
  4574 + title: '库存不足!',
  4575 + icon: 'none',
  4576 + });
  4577 + return false;
  4578 + }
  4579 + })
4590 4580  
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;
  4581 + } else {
  4582 + if (o.store_count <= 0) {
  4583 + wx.showToast({
  4584 + title: '库存已为空!',
  4585 + icon: 'none',
  4586 + });
  4587 + return false;
  4588 + //return s.my_warnning("库存已为空!", 0, th);
  4589 + }
  4590 +
  4591 + if (o.store_count < e.data.goodsInputNum) {
  4592 + wx.showToast({
  4593 + title: '库存不足!',
  4594 + icon: 'none',
  4595 + });
  4596 + return false;
  4597 + //return s.my_warnning("库存不足!", 0, th);
  4598 + }
  4599 +
  4600 +
  4601 + th.by_next_func(newd);
4598 4602 }
  4603 + return false;
  4604 +
  4605 +
4599 4606 }
4600   - }
4601   - }
4602 4607  
4603 4608  
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; //开团类型
  4609 + //-----如果是秒杀,团购,积分购,拼团,且不是普通购买-----
  4610 + if (th.data.prom_type == 9 && th.data.is_normal != 1) {
  4611 + newd.goods_price = th.data.prom_price;
  4612 + newd.prom_type = th.data.prom_type;
  4613 + newd.prom_id = th.data.prom_id;
  4614 + //newd.kt_type = th.data.prom_act.kttype; //开团类型
  4615 + newd.is_pt_tz = 0;
  4616 + //th.data.sto_sele_distr=1; //直接用自提的方式提交
  4617 + if (newd.kt_type > 1) {
  4618 + newd.is_pt_tz = 1; //开团类型
  4619 + }
  4620 + if (newd.kt_type == 3) {
  4621 + th.data.sto_sele_distr = 1;
  4622 + }
  4623 +
  4624 + }
  4625 +
  4626 + // else if (th.data.prom_type == 3) {
  4627 + // newd.prom_type = 0;
  4628 + // newd.prom_id = 0;
  4629 + // }
  4630 +
  4631 + th.by_next_func(newd);
4614 4632 }
4615   - if (newd.kt_type == 3) {
4616   - th.data.sto_sele_distr = 1;
  4633 +
  4634 +
  4635 + )
  4636 + },
  4637 + by_next_func(newd){
  4638 + var th=this;
  4639 + newd['pick_name'] = th.data.sto_sele_name;
  4640 + newd['pick_dis'] = th.data.sto_sele_distr;
  4641 + newd['is_normal'] = th.data.is_normal;
  4642 +
  4643 + if (newd['is_normal']) {
  4644 + newd['is_pd_normal'] = 1;
  4645 + //判断一下有没有全局优惠活动
  4646 + th.buyNow(newd);
  4647 + }
  4648 + else {
  4649 + // 点击立即参团
  4650 + th.buyNow_pt(newd);
  4651 + }
  4652 + },
  4653 +
  4654 + //统一一下获取线下库存的函数
  4655 + async check_CanOutQty(goodsinfo, item, func) {
  4656 +
  4657 + var sales_rules = this.data.sales_rules;
  4658 +
  4659 + var lock_rq = {
  4660 + store_id: os.stoid,
  4661 + wareId: goodsinfo.goods_id,
  4662 + pageSize: 1000
  4663 + };
  4664 +
  4665 + if (sales_rules == 2) {
  4666 + lock_rq.storageId = item.pickup_id
  4667 + } else {
  4668 + lock_rq.appoint_pick_keyid = encodeURIComponent(this.data.appoint_pick_keyid)
  4669 + }
  4670 +
  4671 + var lock = 0;
  4672 + var CanOutQty = 0;
  4673 + var plist = null;
  4674 + //先读取门店的lock
  4675 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  4676 + data: lock_rq
  4677 + }).then(res => {
  4678 + if (res.data.code == 0 && res.data.data.total > 0) {
  4679 + for (var i in res.data.data.pageData)
  4680 + lock += res.data.data.pageData[i].outQty;
4617 4681 }
  4682 + })
4618 4683  
  4684 + var sto_req = {
  4685 + wareIds: encodeURIComponent(goodsinfo.erpwareid),
  4686 + storeId: os.stoid
  4687 + }
  4688 + if (sales_rules == 2) {
  4689 + sto_req.storageNos = item.pickup_no
  4690 + } else {
  4691 + sto_req.storageIds = encodeURIComponent(this.data.appoint_pick_keyid)
4619 4692 }
4620 4693  
4621   - // else if (th.data.prom_type == 3) {
4622   - // newd.prom_type = 0;
4623   - // newd.prom_id = 0;
4624   - // }
4625 4694  
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 4695  
4630   - if (newd['is_normal']) {
4631   - newd['is_pd_normal'] = 1;
4632   - //判断一下有没有全局优惠活动
4633   - th.buyNow(newd);
  4696 + //读取线下的门店库存
  4697 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  4698 + data: sto_req
  4699 + }).then(res => {
  4700 + if (res.data.code == 0 && res.data.data.total > 0) {
  4701 + plist = res.data.data.pageData[0];
  4702 + }
  4703 + })
  4704 +
  4705 + if (plist && plist.CanOutQty - lock > 0) {
  4706 + CanOutQty = plist.CanOutQty - lock;
4634 4707 }
4635   - else {
4636   - // 点击立即参团
4637   - th.buyNow_pt(newd);
4638   - };
4639   - })
4640   - },
  4708 +
  4709 + if (func) func(CanOutQty);
  4710 +
  4711 + },
  4712 +
  4713 +
4641 4714 //----------立即购买_pt-----------
4642 4715 buyNow_pt: function (e) {
4643 4716 s.set_b_now(e);
... ...
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>
... ... @@ -1064,12 +1064,17 @@
1064 1064 <block wx:if="{{prom_type == 0}}">
1065 1065 <view class="flex">
1066 1066 <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  1067 + <!-- 线下门店销售的时候 -->
1067 1068 <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>
  1069 +
  1070 + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}">
  1071 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">
  1072 + 可售:{{def_pick_store.CanOutQty}}
  1073 + </view>
  1074 + <view class="spec-goods-stock" wx:else>可售:0</view>
  1075 + </block>
1072 1076 </block>
  1077 +
1073 1078 <block wx:else>
1074 1079 <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
1075 1080 </block>
... ... @@ -1105,7 +1110,7 @@
1105 1110 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
1106 1111 <block wx:else>
1107 1112 <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}}">
  1113 + <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 1114 (库存不足)
1110 1115 </view>
1111 1116 </block>
... ... @@ -1177,7 +1182,7 @@
1177 1182 </block>
1178 1183 <block wx:else>
1179 1184 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
1180   - <block wx:if="{{sales_rules>=2 && prom_type==0}}">
  1185 + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}">
1181 1186 <block wx:if="{{!def_pick_store.CanOutQty}}">
1182 1187 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1183 1188 库存不足
... ...
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 && !filters.is_virtual_gd(sele_g.is_virtual) && 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;
... ...
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
... ... @@ -3,6 +3,11 @@
3 3 <image style="width: 100%;border-radius: 3%;" 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;
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -5,7 +5,7 @@ var regeneratorRuntime = require(&#39;../../../../utils/runtime.js&#39;);
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,25 @@ Page({
4000 4063 }
4001 4064  
4002 4065  
  4066 + var mo_num=getApp().get_limit_qty(th.data.bn_goods);
  4067 + var steep=getApp().get_limit_qty(th.data.bn_goods,0,1);
  4068 +
  4069 + if ([0,3,5,7,10].indexOf(goods.prom_type)>=-1){
  4070 + if(mo_num>goods.goods_num){
  4071 + getApp().confirmBox(goods.goods_name + "的未到达起订数量");
  4072 + th.data.is_summit_ing = 0;
  4073 + return false;
  4074 + }
  4075 + if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){
  4076 + getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数");
  4077 + th.data.is_summit_ing = 0;
  4078 + return false;
  4079 + }
  4080 + }
  4081 +
4003 4082 //如果不立即购买或者秒杀,如果是线下库存购买的时候
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) {
  4083 + if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2
  4084 + && th.data.sales_rules >= 2 && !th.data.bn_goods.whsle_id && !getApp().is_virtual(th.data.bn_goods)) {
4005 4085 var isok = 1;
4006 4086 await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) {
4007 4087 isok = res;
... ... @@ -4124,7 +4204,6 @@ Page({
4124 4204  
4125 4205 var order_prom_list_cart = th.data.order_prom_list_cart;
4126 4206  
4127   -
4128 4207 //--组装推送数据--
4129 4208 for (var i = 0; i < order_prom_list_cart.length; i++) {
4130 4209 var t_item = order_prom_list_cart[i];
... ... @@ -4227,6 +4306,23 @@ Page({
4227 4306 order_prom_list.g_zxlb_num = JSON.stringify(t_item.g_zxlb_num);
4228 4307 }
4229 4308  
  4309 + //-- 送每月礼包的时候 --
  4310 + if (t_item.monthlibao) {
  4311 + order_prom_list.give_monthlb_id = t_item.monthlibao;
  4312 + let marr=[];
  4313 + if (t_item.g_monthlb_num && t_item.g_monthlb_num.length>0) {
  4314 + t_item.g_monthlb_num.map(ite=>{
  4315 + let obj={
  4316 + num:ite.monthnum,
  4317 + l_id:ite.month_id,
  4318 + monthlbtitle:ite.monthlbtitle
  4319 + }
  4320 + marr.push(obj)
  4321 + })
  4322 + }
  4323 + order_prom_list.g_monthlb_num = JSON.stringify(marr);
  4324 + }
  4325 +
4230 4326 if (Object.keys(order_prom_list).length > 0) {
4231 4327 if (order_prom_list.discount_amount)
4232 4328 order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2);
... ... @@ -4347,8 +4443,26 @@ Page({
4347 4443 check_map[txt] = 1;
4348 4444 }
4349 4445  
4350   - //如果不立即购买或者秒杀,如果是线下库存购买的时候
4351   - if (goods.prom_type == 0 && th.data.sales_rules >= 2) {
  4446 + goods.prom_type=parseInt(goods.prom_type+'');
  4447 + var mo_num=getApp().get_limit_qty(g_item);
  4448 + var steep=getApp().get_limit_qty(g_item,0,1);
  4449 +
  4450 + if ([0,3,5,7,10].indexOf(goods.prom_type)>=-1){
  4451 + if(mo_num>goods.goods_num){
  4452 + getApp().confirmBox(goods.goods_name + "的未到达起订数量");
  4453 + th.data.is_summit_ing = 0;
  4454 + return false;
  4455 + }
  4456 + if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){
  4457 + getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数");
  4458 + th.data.is_summit_ing = 0;
  4459 + return false;
  4460 + }
  4461 +
  4462 + }
  4463 +
  4464 + //如果不立即购买或者秒杀,如果是线下库存购买的时候
  4465 + 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 4466 var isok = 1;
4353 4467 await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) {
4354 4468 isok = res;
... ... @@ -4535,10 +4649,10 @@ Page({
4535 4649 })
4536 4650 // pdata.keyid = th.data.bn_goods.keyid
4537 4651 }
4538   -
  4652 + // debugger
4539 4653 var str = JSON.stringify(pdata);
4540 4654 console.log(str,'aaaaaaaaaaaaaaa');
4541   - //return false;
  4655 + // return false;
4542 4656  
4543 4657 wx.showLoading({ title: "加载中" });
4544 4658 th.setData({ submit: 1, })
... ... @@ -5819,6 +5933,7 @@ Page({
5819 5933 }
5820 5934 }).then(res => {
5821 5935 if (res.data.code == 0) {
  5936 +
5822 5937 var get_data = res.data.data;
5823 5938 arr.is_bz = prom.is_bz; //是不是倍增
5824 5939 arr.is_xz_yh = arr.is_xz_yh ? arr.is_xz_yh : prom.is_xz_yh; //是不是优惠
... ... @@ -5856,6 +5971,11 @@ Page({
5856 5971 arr.zxlbtitle = get_data.zxlbtitle;
5857 5972 arr.zx_libao = get_data.zxlibao;
5858 5973 arr.zx_lb_num = get_data.zxlb_num;
  5974 + //立即购买,每月礼包
  5975 + arr.monthlbtitle = get_data.monthlbtitle;
  5976 + arr.month_libao = get_data.monthlibao;
  5977 + arr.month_lb_num = get_data.monthlb_num;
  5978 + //----end-------
5859 5979  
5860 5980 arr.prom_id = prom_id;
5861 5981  
... ... @@ -6053,6 +6173,7 @@ Page({
6053 6173 check_is_youhui: function (r_data, pick_id) {
6054 6174 let send_lb = this.data.send_lb;
6055 6175 let lodash = null;
  6176 +
6056 6177 r_data.forEach(item => {
6057 6178 if (send_lb[pick_id]) {
6058 6179 for (let i = 0; i < send_lb[pick_id].length; i++) {
... ... @@ -6192,10 +6313,14 @@ Page({
6192 6313 let id = e.currentTarget.dataset.id; // 获取礼包id
6193 6314 let flag = e.currentTarget.dataset.flag;
6194 6315 let url = '';
6195   - if (flag == 1) { // flag =1 控制跳转到专享礼包
6196   - url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
6197   - } else {
  6316 +
  6317 + if (flag == 2) { // flag =2 控制跳转到每月礼包
  6318 + // url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
  6319 + url = `/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo?isBuy=1&id=${id}&is_act=1`;
  6320 + }else if (flag == 1) {
6198 6321 url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮
  6322 + } else {
  6323 + url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
6199 6324 };
6200 6325 // console.log('myurl', url);
6201 6326 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
... ... @@ -297,7 +297,8 @@ Page({
297 297 page: th.data.curpage,
298 298 pageSize: th.data.pageSize,
299 299 is_end:0,
300   - timetype:1
  300 + timetype:1,
  301 + is_act:0
301 302 },
302 303 success: function (res) {
303 304 if (res.data.code == 0) {
... ...
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;
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -163,6 +163,39 @@ Page({
163 163 if (plist.length <= 0) {
164 164 getApp().showWarning("没有更多数据");
165 165 th.data.ismore = 0;
  166 +
  167 +
  168 +
  169 + //没有数据切换
  170 + if (e.data.currentPage == 1 && this.data.type == 1) {
  171 +
  172 +
  173 + e.data.currentPage=1;
  174 + i = "/api/weshop/teamlist/pageteam/0?page=" + e.data.currentPage;
  175 + await getApp().request.promiseGet(i, {
  176 + isShowLoading: 0,
  177 + data: {
  178 + store_id: os.stoid,
  179 + is_end: 0,
  180 + is_show: 1,
  181 + user_id:getApp().globalData.user_id,
  182 + }
  183 + }).then(res => {
  184 + plist = res.data.data.pageData;
  185 + });
  186 +
  187 + if(plist){
  188 + setTimeout(function () {
  189 + th.data.ismore = 1;
  190 + th.setData({
  191 + type: 0
  192 + });
  193 + th.requestSalelist();
  194 + }, 1000);
  195 + }
  196 +
  197 + }
  198 +
166 199 }
167 200 //--循环读取接口---
168 201 for (var i = 0; i < plist.length; i++) {
... ...
pages/cart/cart/cart.js
... ... @@ -1612,9 +1612,16 @@ Page({
1612 1612 }
1613 1613 }
1614 1614  
  1615 + var add_num=1;
  1616 + var mo_num=getApp().get_limit_qty(a);
  1617 + var steep=getApp().get_limit_qty(a,0,1);
  1618 + if(steep>1){
  1619 + add_num=steep;
  1620 + }
  1621 +
1615 1622  
1616 1623 var e = {
1617   - goods_num: a.goods_num + 1,
  1624 + goods_num: a.goods_num + add_num,
1618 1625 id: a.id,
1619 1626 goods_id: a.goods_id,
1620 1627 store_id: oo.stoid
... ... @@ -1640,16 +1647,26 @@ Page({
1640 1647 }
1641 1648  
1642 1649  
  1650 + var add_num=1;
  1651 + var mo_num=getApp().get_limit_qty(a);
  1652 + var steep=getApp().get_limit_qty(a,0,1);
  1653 + if(steep>1){
  1654 + add_num=steep;
  1655 + }
1643 1656  
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);
  1657 + var e = {
  1658 + goods_num: a.goods_num - add_num,
  1659 + id: a.id,
  1660 + goods_id: a.goods_id,
  1661 + store_id: oo.stoid
  1662 + };
  1663 +
  1664 + if(e.goods_num<=0){
  1665 + this.data.up_dating = 0;
  1666 + return false;
1652 1667 }
  1668 + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  1669 +
1653 1670 },
1654 1671  
1655 1672  
... ... @@ -1668,7 +1685,10 @@ Page({
1668 1685 var e = a;
1669 1686 var th = this;
1670 1687  
1671   - if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) {
  1688 +
  1689 + var mo_num=getApp().get_limit_qty(e);
  1690 +
  1691 + if (a = isNaN(t.detail.value) || t.detail.value < mo_num ? mo_num : parseInt(t.detail.value)) {
1672 1692 var s = {
1673 1693 goods_num: a,
1674 1694 goods_id: e.service_id,
... ... @@ -1754,6 +1774,33 @@ Page({
1754 1774 },
1755 1775  
1756 1776  
  1777 + click_set_limit(gd_info,pitems,item){
  1778 + var th=this;
  1779 + var mo_num=getApp().get_limit_qty(gd_info);
  1780 + var steep=getApp().get_limit_qty(gd_info,0,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,16 @@ 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 + if(!e.data.checkAllToggle){
  1849 + th.click_set_limit(obj,i,j);
  1850 + }
  1851 +
1800 1852 //计算之前先移除组合购的计算
1801 1853 if (obj.prom_type == 7)
1802 1854 zh_calc.remove_zhprom(dda, i, obj);
... ... @@ -1884,7 +1936,7 @@ Page({
1884 1936  
1885 1937 // if (!e.data.checkAllToggle) {
1886 1938 //多门店优惠促销次数控制
1887   - if(dda[i].pro_off){
  1939 + if(dda[i].pro_off || e.data.checkAllToggle){
1888 1940 var txt = "requestData[" + i + "].selected";
1889 1941 e.setData({
1890 1942 [txt]: 0,
... ... @@ -2041,9 +2093,11 @@ Page({
2041 2093 for (var i = 0; i < item.length; i++) {
2042 2094 let pro_off1=false
2043 2095 var txt = "requestData[" + pitems + "].goods[" + i + "].selected";
2044   -
2045 2096 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) {
  2097 +
  2098 + if(!sele) th.click_set_limit(gd_info,pitems,i)
  2099 +
  2100 + if (!getApp().is_virtual(gd_info) && th.data.sales_rules >= 2 && !gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 && !gd_info.selected) {
2047 2101 var ob = {};
2048 2102 await th.check_down_line_next(gd_info, pitems, i, gd_info.erpwareid, function (res) {
2049 2103 ob = res;
... ... @@ -2227,45 +2281,56 @@ Page({
2227 2281 var gd_info = a;
2228 2282  
2229 2283 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 2284  
2236   - if (ob.code == -1) {
2237   -
2238   - wx.showToast({
2239   - title: '购买数量超出商品库存',
2240   - icon: 'none',
2241   - });
  2285 + //-- 如果是选中的时候 --
  2286 + if(!a.selected){
2242 2287  
2243   - return false;
2244   - } else {
2245   - if (th.data.sales_rules == 3) {
2246   - var goods_id = gd_info.goods_id;
2247   - var num = 0;
  2288 + //-- 专门来设置商品订购数量 --
  2289 + th.click_set_limit(gd_info,pitems,item)
  2290 + if (!getApp().is_virtual(gd_info) && th.data.sales_rules >= 2
  2291 + && !gd_info.whsle_id && [1, 2, 4, 6, 8, 9].indexOf(gd_info.prom_type) == -1 ) {
2248 2292  
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   - }
  2293 + var ob = {};
  2294 + await th.check_down_line_next(gd_info, pitems, item, erpwareid, function (res) {
  2295 + ob = res;
  2296 + });
  2297 + if (ob.code == -1) {
2256 2298  
2257   - if (num > ob.CanOutQty) {
2258 2299 wx.showToast({
2259 2300 title: '购买数量超出商品库存',
2260 2301 icon: 'none',
2261 2302 });
2262 2303  
2263 2304 return false;
  2305 + } else {
  2306 + if (th.data.sales_rules == 3) {
  2307 + var goods_id = gd_info.goods_id;
  2308 + var num = 0;
  2309 +
  2310 + for (let i = 0; i < th.data.requestData.length; i++) {
  2311 + if (pitems == i) continue;
  2312 + var it = th.data.requestData[i].goods.find((e) => {
  2313 + return e.goods_id == goods_id;
  2314 + })
  2315 + if (it && it.selected) num += it.goods_num
  2316 + }
  2317 +
  2318 + if (num > ob.CanOutQty) {
  2319 + wx.showToast({
  2320 + title: '购买数量超出商品库存',
  2321 + icon: 'none',
  2322 + });
  2323 +
  2324 + return false;
  2325 + }
  2326 + }
2264 2327 }
2265   - }
  2328 +
2266 2329 }
2267 2330  
2268 2331 }
  2332 +
  2333 +
2269 2334 let pro_off=false
2270 2335 //判断多店优惠促销次数控制
2271 2336 if (th.data.requestData.length>1) {
... ... @@ -2536,8 +2601,34 @@ Page({
2536 2601 user_id = getApp().globalData.user_id;
2537 2602  
2538 2603 function normal_check(store_count, goodsinfo, wareIds) {
  2604 +
  2605 +
  2606 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
  2607 + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
  2608 + //-- 要判断是不是起订量不购 --
  2609 + if([0,3,5,7,10].indexOf(goodsinfo.prom_type)>-1){
  2610 + var mo_num=getApp().get_limit_qty(goodsinfo);
  2611 + var steep=getApp().get_limit_qty(goodsinfo,0,1);
  2612 + if(mo_num>1 && t.goods_num<mo_num){
  2613 + wx.showToast({
  2614 + title: '购买数量小于商品的起订量',
  2615 + icon: 'none',
  2616 + });
  2617 + t.goods_num =0;
  2618 + }
  2619 + if(steep>1 && t.goods_num>mo_num && (t.goods_num-mo_num)%steep!=0 ){
  2620 +
  2621 + wx.showToast({
  2622 + title: '购买数量必须是起订量的倍数',
  2623 + icon: 'none',
  2624 + });
  2625 + t.goods_num =mo_num+parseInt((t.goods_num-mo_num)/steep+'')*steep+steep;
  2626 + }
  2627 + }
  2628 +
  2629 +
2539 2630 //--- 看一下是不是线下库存 ---
2540   - if (th.data.sales_rules >= 2 && !goodsinfo.whsle_id) {
  2631 + if (!getApp().is_virtual(goodsinfo) && th.data.sales_rules >= 2 && !goodsinfo.whsle_id) {
2541 2632 th.check_down_line(t, pitem, item, wareIds);
2542 2633 } else {
2543 2634 if (t.goods_num > store_count) {
... ... @@ -2545,8 +2636,6 @@ Page({
2545 2636 title: '购买数量超出商品库存',
2546 2637 icon: 'none',
2547 2638 });
2548   - // getApp().my_warnning('购买数量超出商品库存', 0, th);
2549   - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2550 2639 e.setData({
2551 2640 [txt]: store_count
2552 2641 });
... ... @@ -2620,7 +2709,29 @@ Page({
2620 2709 });
2621 2710 e.doCheckAll();
2622 2711  
2623   - t.goods_num = cbuy > 0 ? cbuy : limit,
  2712 + t.goods_num = cbuy > 0 ? cbuy : limit;
  2713 +
  2714 + if([0,3,5,7,10].indexOf(goodsinfo.prom_type)>-1){
  2715 + var mo_num=getApp().get_limit_qty(goodsinfo);
  2716 + var steep=getApp().get_limit_qty(goodsinfo,0,1);
  2717 + if(mo_num>1 && t.goods_num<mo_num){
  2718 + wx.showToast({
  2719 + title: '购买数量小于商品的起订量',
  2720 + icon: 'none',
  2721 + });
  2722 + t.goods_num=0;
  2723 +
  2724 + }
  2725 + if(steep>1 && t.goods_num>mo_num && (t.goods_num-mo_num)%steep!=0 ){
  2726 +
  2727 + wx.showToast({
  2728 + title: '购买数量必须是起订量的倍数',
  2729 + icon: 'none',
  2730 + });
  2731 +
  2732 + t.goods_num=mo_num+parseInt((t.goods_num-mo_num)/steep+'')*steep
  2733 + }
  2734 + }
2624 2735 // t.goods_num = cbuy > 0 ? cbuy : 0,
2625 2736 e.update_cart(t, pitem, item);
2626 2737 return false;
... ... @@ -3370,10 +3481,42 @@ Page({
3370 3481 }
3371 3482 glist += i_arr[j].goods_id + ",";
3372 3483 ab = 1;
  3484 +
  3485 + //判断商品的起订数量
  3486 + var mo_num=getApp().get_limit_qty(i_arr[j]);
  3487 + var steep=getApp().get_limit_qty(i_arr[j],0,1);
  3488 + var py_type= parseInt(i_arr[j].prom_type+'');
  3489 +
  3490 + if([0,3,5,7,10].indexOf(py_type)>-1){
  3491 +
  3492 + if(mo_num>i_arr[j].goods_num){
  3493 + getApp().confirmBox(i_arr[j].goods_name + "的未到达起订数量");
  3494 + wx.hideLoading();
  3495 + return false;
  3496 + }
  3497 + if(steep>1 && (i_arr[j].goods_num-mo_num)%steep!=0 ){
  3498 + getApp().confirmBox(i_arr[j].goods_name + "的购买的数量不是起订量的倍数");
  3499 + var num=mo_num+ parseInt((i_arr[j].goods_num-mo_num)/steep)*steep+steep;
  3500 + var e = {
  3501 + goods_num: num,
  3502 + id: i_arr[j].id,
  3503 + goods_id: i_arr[j].goods_id,
  3504 + store_id: oo.stoid
  3505 + };
  3506 +
  3507 + th.postCardList(e, j, i);
  3508 +
  3509 + wx.hideLoading();
  3510 + return false;
  3511 + }
  3512 +
  3513 + }
  3514 +
  3515 +
3373 3516  
3374 3517 //--普通商品,如果有开启线下库存的功能,要调用线下库存进行计算,赠品不要进行调用线下库存---
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 ||
3376   - i_arr[j].need_downlow_num) && th.data.sales_rules >= 2 && i_arr[j].is_gift != 1 && !i_arr[j].whsle_id) {
  3518 + 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 ||
  3519 + i_arr[j].need_downlow_num) && !getApp().is_virtual(i_arr[j]) && th.data.sales_rules >= 2 && i_arr[j].is_gift != 1 && !i_arr[j].whsle_id) {
3377 3520 //--获取商品的线下商品ID--
3378 3521  
3379 3522 var gd = null;
... ...
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
  1 +{
  2 + "usingComponents": {}
  3 +}
0 4 \ No newline at end of file
... ...
pages/cart/cart2_inte/cart2_inte.wxss 0 → 100644
  1 +/* pages/cart/cart2_inte/cart2_inte.wxss */
0 2 \ No newline at end of file
... ...
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 && sales_rules>=2 && !filters.is_virtual_gd(sele_g.is_virtual) }}">
57 61 (库存不足)
58 62 </view>
59 63 </block>
... ... @@ -136,7 +140,7 @@
136 140 </view>
137 141 </block>
138 142 <block wx:else>
139   - <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id}}">
  143 + <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id && !filters.is_virtual_gd(sele_g.is_virtual) }}">
140 144 <view wx:if="{{!def_pick_store.CanOutQty}}" class="spec-cart-btn fs32" data-action="add"
141 145 style="background-color: #dcdcdc;color: #999">库存不足
142 146 </view>
... ... @@ -154,7 +158,7 @@
154 158  
155 159  
156 160  
157   - <block wx:elif="{{data.store_count<=0}}">
  161 + <block wx:elif="{{data.store_count<(mo_num?mo_num:1)}}">
158 162 <view class="spec-cart-btn fs32" data-action="add"
159 163 style="background-color: #dcdcdc;color: #999">库存不足
160 164 </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,11 @@
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 && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}">(库存不足)</view>
51 51 </block>
52 52 </block>
53 53  
54   - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
  54 + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>
55 55  
56 56  
57 57 <!--商品的属性项目-->
... ...
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 && !filters.is_virtual_gd(sele_g.is_virtual) }}">
  186 + <block wx:if="{{!def_pick_store.CanOutQty}}">
  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<=0 && 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  
... ... @@ -558,7 +558,7 @@ Page({
558 558 th = this;
559 559 getApp().getConfig2(function (e) {
560 560 var sales_rules = e.sales_rules;
561   - if (sales_rules >= 2 && [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) == -1 && !th.data.sele_g.whsle_id) {
  561 + if (!getApp().is_virtual(th.data.sele_g) && sales_rules >= 2 && [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) == -1 && !th.data.sele_g.whsle_id) {
562 562 getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () {
563 563 var lock = 0,
564 564 plist = null;
... ... @@ -1102,18 +1102,18 @@ 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 1109  
1112   - } else {
1113   - //获取门店
1114   - ee.get_sto();
1115   - }
1116 1110  
  1111 + //-- 更新默认购买的数量 ---
  1112 + var mo_num=getApp().get_limit_qty(t.data.data);
  1113 + ee.setData({goodsInputNum:mo_num})
  1114 + ee.setData({mo_num:mo_num})
  1115 +
  1116 + ee.get_sto();
1117 1117 ee.get_sku(o.stoid, t.data.data, gid);
1118 1118 ee.check_has_flash();
1119 1119  
... ... @@ -1197,6 +1197,7 @@ Page({
1197 1197 setTimeout(()=> {
1198 1198 console.log('cccc');
1199 1199 console.log(th.data.prom_type);
  1200 +
1200 1201 },500)
1201 1202  
1202 1203  
... ... @@ -1208,11 +1209,8 @@ Page({
1208 1209 console.log('aaaaaaaaaa');
1209 1210 console.log(this.data.prom_type);
1210 1211  
1211   - this.data.enterAddressPage && (this.data.enterAddressPage = !1);
1212   -
1213   -
1214   -
1215 1212  
  1213 + this.data.enterAddressPage && (this.data.enterAddressPage = !1);
1216 1214  
1217 1215  
1218 1216 },
... ... @@ -1680,7 +1678,7 @@ Page({
1680 1678 newd.is_pd_normal = 1;
1681 1679  
1682 1680 //---如果是线下门店销售的时候---
1683   - if (th.data.sales_rules >= 2) {
  1681 + if (!getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2) {
1684 1682 var pick = th.get_pick_from_list(th.data.sto_sele_id)
1685 1683 //---通过接口获取门店的线下库存信息--
1686 1684 th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) {
... ... @@ -1778,7 +1776,7 @@ Page({
1778 1776 return false;
1779 1777 } else {
1780 1778 //---如果是线下门店销售的时候---
1781   - if (th.data.sales_rules >= 2) {
  1779 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && th.data.sales_rules >= 2) {
1782 1780 var pick = th.get_pick_from_list(th.data.sto_sele_id)
1783 1781  
1784 1782 th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) {
... ... @@ -1837,7 +1835,7 @@ Page({
1837 1835 }
1838 1836  
1839 1837 //---如果是线下门店销售的时候---
1840   - if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) {
  1838 + if ( !getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) {
1841 1839 var pick = th.get_pick_from_list(th.data.sto_sele_id)
1842 1840 //---通过接口获取门店的线下库存信息--
1843 1841 // getApp().request.get("/api/weshop/goods/getWareStorages", {
... ... @@ -1942,6 +1940,9 @@ Page({
1942 1940 th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
1943 1941 }
1944 1942 }
  1943 +
  1944 +
  1945 +
1945 1946 })
1946 1947 },
1947 1948  
... ... @@ -2402,11 +2403,24 @@ Page({
2402 2403  
2403 2404 //----------增加购买数量-----------
2404 2405 addCartNum: function (t) {
2405   - this.checkCartNum(this.data.goodsInputNum + 1);
  2406 +
  2407 + var add_num=1;
  2408 + var p_type=parseInt(this.data.prom_type)
  2409 + if([1,2,4,6,8,9].indexOf(p_type)==-1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1){
  2410 + add_num=getApp().get_limit_qty(this.data.sele_g,0,1);
  2411 + }
  2412 +
  2413 + this.checkCartNum(this.data.goodsInputNum + add_num);
2406 2414 },
2407 2415 //----------减少购买数量-----------
2408 2416 subCartNum: function (t) {
2409   - this.checkCartNum(this.data.goodsInputNum - 1);
  2417 +
  2418 + var add_num=1;
  2419 + var p_type=parseInt(this.data.prom_type)
  2420 + if([1,2,4,6,8,9].indexOf(p_type)==-1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1){
  2421 + add_num=getApp().get_limit_qty(this.data.sele_g,0,1);
  2422 + }
  2423 + this.checkCartNum(this.data.goodsInputNum - add_num);
2410 2424 },
2411 2425 //----------输入框输入购买数量-----------
2412 2426 inputCartNum: function (t) {
... ... @@ -2430,6 +2444,8 @@ Page({
2430 2444 //------检查数量是不是超出限购------
2431 2445 checkCartNum: function (t) {
2432 2446 var th = this;
  2447 + var mo_num=getApp().get_limit_qty(th.data.sele_g);
  2448 + var steep=getApp().get_limit_qty(th.data.sele_g,0,1);
2433 2449 this.get_buy_num(this.data.sele_g, async function () {
2434 2450  
2435 2451 //--判断商品是否超出限购--
... ... @@ -2495,8 +2511,9 @@ Page({
2495 2511 }
2496 2512 }
2497 2513 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)) {
  2514 + var p_type =parseInt(th.data.prom_type+'') ; //&& p_type!=1 && p_type!=4
  2515 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && th.data.sales_rules >= 2 &&
  2516 + ([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) {
2500 2517 if (!th.data.def_pick_store) {
2501 2518 wx.showToast({
2502 2519 title: '请选择门店',
... ... @@ -2517,12 +2534,33 @@ Page({
2517 2534 });
2518 2535 // wx.showModal({title: '库存不足',});
2519 2536 if (e < 0) e = 0;
  2537 +
  2538 + //只有普通商品才有起购数
  2539 + if([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){
  2540 + if(e<mo_num) e=mo_num;
  2541 + if(e>mo_num && (e-mo_num)%steep!=0){
  2542 + e=mo_num+ parseInt((e-mo_num)/steep)*steep;
  2543 + }
  2544 + }
2520 2545 th.setData({
2521 2546 goodsInputNum: e
2522 2547 });
2523 2548 return false;
2524 2549 }
  2550 +
  2551 +
  2552 + //var steep=getApp().get_limit_qty(th.data.sele_g,0,1);
  2553 +
  2554 +
2525 2555 t > e || 0 == e ? t = e : t < 1 && (t = 1);
  2556 +
  2557 +
  2558 + //只有普通商品才有起购数
  2559 + if([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1){
  2560 + if(t<mo_num) t=mo_num;
  2561 + }
  2562 +
  2563 +
2526 2564 th.setData({
2527 2565 goodsInputNum: t
2528 2566 });
... ... @@ -2612,7 +2650,8 @@ Page({
2612 2650  
2613 2651 var e = th.data.sele_g.store_count;
2614 2652 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)) {
  2653 + if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && th.data.sales_rules >= 2 &&
  2654 + ([1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) {
2616 2655 if (!th.data.def_pick_store) {
2617 2656 wx.showModal({
2618 2657 title: '请选择门店',
... ... @@ -3342,7 +3381,7 @@ Page({
3342 3381 if (!item.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) that.check_is_youhui(gid, that.data.is_normal);
3343 3382  
3344 3383 //默认门店要拿下门店库存
3345   - 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) {
  3384 + if (!getApp().is_virtual(th.data.sele_g) && 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) {
3346 3385 var lock = 0,
3347 3386 plist = null;
3348 3387  
... ... @@ -3641,9 +3680,9 @@ Page({
3641 3680 th.setData({
3642 3681 all_pick_list: e.data.data.pageData
3643 3682 });
3644   -
  3683 +
3645 3684 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
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)) {
  3685 + 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 3686 setTimeout(function () {
3648 3687 th.deal_pickup_dline(e);
3649 3688 }, 800)
... ... @@ -3939,7 +3978,7 @@ Page({
3939 3978 }
3940 3979 if (th.data.fir_def_store &&
3941 3980 (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;
  3981 + th.data.fir_def_store.Qty=Qty;
3943 3982 if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id)
3944 3983 th.setData({
3945 3984 def_pick_store: th.data.fir_def_store
... ... @@ -4946,6 +4985,7 @@ Page({
4946 4985  
4947 4986 var th = this;
4948 4987 var ind = parseInt(e.currentTarget.dataset.it);
  4988 + var mo_num=getApp().get_limit_qty(this.data.sele_g);
4949 4989  
4950 4990 //如果是拼单活动的普通购买
4951 4991 if (ind == 1) {
... ... @@ -4959,14 +4999,19 @@ Page({
4959 4999 th.get_sto(1);
4960 5000 th.setData({
4961 5001 is_normal: ind,
4962   - openSpecModal_pt: 1
  5002 + openSpecModal_pt: 1,
  5003 + goodsInputNum: mo_num,
  5004 + mo_num:mo_num
  5005 +
4963 5006 });
4964 5007 } else {
4965 5008 th.get_sto(1);
4966 5009 th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () {
4967 5010 th.setData({
4968 5011 is_normal: ind,
4969   - openSpecModal_pt: 1
  5012 + openSpecModal_pt: 1,
  5013 + goodsInputNum: mo_num,
  5014 + mo_num:mo_num
4970 5015 });
4971 5016 });
4972 5017 }
... ... @@ -4975,6 +5020,10 @@ Page({
4975 5020  
4976 5021 if (th.data.is_normal) {
4977 5022 th.data.g_buy_num = new Map();
  5023 + th.setData({
  5024 + goodsInputNum: mo_num,
  5025 + mo_num:mo_num
  5026 + });
4978 5027 }
4979 5028  
4980 5029 //拼单商品从这里进,先判断有没有买过商品,
... ... @@ -5041,7 +5090,6 @@ Page({
5041 5090 getApp().confirmBox("拼团商品至少要买" + qnum + "件!");
5042 5091 return false;
5043 5092 }
5044   -
5045 5093 }
5046 5094  
5047 5095 th.addcart_pt_func();
... ... @@ -6919,7 +6967,7 @@ Page({
6919 6967 var lock = 0;
6920 6968  
6921 6969 //---如果是活动的时候,同时不是普通购买---
6922   - if (th.data.sele_g.whsle_id || [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal) {
  6970 + 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 6971 func();
6924 6972 return false;
6925 6973 }
... ... @@ -7924,7 +7972,10 @@ Page({
7924 7972 let id = e.currentTarget.dataset.id; // 获取礼包id
7925 7973 let flag = e.currentTarget.dataset.flag;
7926 7974 let url = '';
7927   - if (flag == 1) { // flag =1 控制跳转到专享礼包
  7975 + if (flag == 2) { // flag =1 控制跳转到专享礼包
  7976 + url = `/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo?isBuy=1&id=${id}&is_act=1`;
  7977 + // url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
  7978 + } else if (flag == 1) { // flag =1 控制跳转到专享礼包
7928 7979 url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
7929 7980 } else {
7930 7981 url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮
... ... @@ -8068,10 +8119,14 @@ Page({
8068 8119 openSpecModel_Nor: function () {
8069 8120 this.data.g_buy_num = new Map();
8070 8121 var th = this;
  8122 + var mo_num=getApp().get_limit_qty(this.data.sele_g);
  8123 +
8071 8124 this.setData({
8072 8125 open_ind_store: 5,
8073   - goodsInputNum: 1
  8126 + goodsInputNum: mo_num,
  8127 + mo_num:mo_num
8074 8128 }); //拼团直接给4
  8129 +
8075 8130 if (th.data.sku_g_pt) {
8076 8131 this.get_sto(1)
8077 8132 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 <!-- 拼单规则规则 -->
... ... @@ -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 && !filters.is_virtual_gd(sele_g.is_virtual) && 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 && !filters.is_virtual_gd(sele_g)}}">
1318 1326 (库存不足)
1319 1327 </view>
1320 1328 </block>
... ... @@ -1361,6 +1369,7 @@
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>
1366 1375 <view class="spec-cart-btns">
... ... @@ -1394,8 +1403,8 @@
1394 1403 </block>
1395 1404 <block wx:else>
1396 1405 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
1397   - <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}">
1398   - <block wx:if="{{!def_pick_store.CanOutQty}}">
  1406 + <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id && !filters.is_virtual_gd(sele_g.is_virtual) }}">
  1407 + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num }}">
1399 1408 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1400 1409 库存不足
1401 1410 </view>
... ... @@ -1411,7 +1420,7 @@
1411 1420 </block>
1412 1421 <!-- 线上销售 -->
1413 1422 <block wx:else>
1414   - <block wx:if="{{sele_g.store_count<=0 && is_no_new}}">
  1423 + <block wx:if="{{(sele_g.store_count<=0 || sele_g.store_count<mo_num ) && is_no_new}}">
1415 1424 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1416 1425 库存不足
1417 1426 </view>
... ... @@ -1610,7 +1619,7 @@
1610 1619 <view class="flex-vertical-between butttem5">
1611 1620 <view class="flex xc-ash">
1612 1621 <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
1613   - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text>
  1622 + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual)}}">(库存不足)</text>
1614 1623 </view>
1615 1624 </view>
1616 1625 <view>
... ... @@ -1638,7 +1647,7 @@
1638 1647 <view class="flex-vertical-between ">
1639 1648 <view class="flex xc-ash">
1640 1649 <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
1641   - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text>
  1650 + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual) }}">(库存不足)</text>
1642 1651 </view>
1643 1652 </view>
1644 1653 <view>
... ... @@ -1668,7 +1677,7 @@
1668 1677 <view class="flex-vertical-between ">
1669 1678 <view class="flex xc-ash">
1670 1679 <view class="fs28 xc-black3 address_name">{{item.pickup_name}}
1671   - <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text>
  1680 + <text class="c-red22" wx:if="{{item.is_no_qyt && !filters.is_virtual_gd(sele_g.is_virtual)}}">(库存不足)</text>
1672 1681 </view>
1673 1682 </view>
1674 1683 <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/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
... ... @@ -991,10 +991,23 @@ Page({
991 991 //过滤掉分销关闭的
992 992 let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的
993 993 await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => {
994   - if (rs.data.code == 0) {
995   - var dis = rs.data.data;
  994 + if (rs.data.code == 0 || !rs.data.data) {
  995 + var is_ok=1;
  996 +
  997 + if(!distribut_end_time){
  998 + is_ok=0;
  999 + }
  1000 + else if(!rs.data.data){
  1001 + is_ok=0;
  1002 + }else{
  1003 + var dis=rs.data.data;
  1004 + if(!dis || dis.switch == 0){
  1005 + is_ok=0;
  1006 + }
  1007 + }
  1008 +
996 1009 for (var i in d_list) {
997   - if (d_list[i].name == '我的分销' && (!dis || dis.switch == 0) || (d_list[i].name == '我的分销' && !distribut_end_time)) {
  1010 + if (d_list[i].name == '我的分销' && !is_ok) {
998 1011 d_list.splice(i, 1);
999 1012 }
1000 1013 }
... ...
pages/user/my_service/i_service.wxml
... ... @@ -34,7 +34,7 @@
34 34 </view>
35 35  
36 36 <view class="flex-center itemName">
37   - <view class="fs32 Name ellipsis-1">{{item.ServiceName}}</view>
  37 + <view class="fs30 Name ellipsis-2">{{item.ServiceName}}</view>
38 38 </view>
39 39  
40 40 <view class="flex-center fs24 itemCount">
... ...
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;
... ...
pages/user/order_list/order_list.js
... ... @@ -1041,7 +1041,7 @@ Page({
1041 1041 }
1042 1042  
1043 1043 //--如果是线下库存的时候--
1044   - if (th.data.conf.sales_rules >= 2 && !gg.whsle_id) {
  1044 + if (!getApp().is_virtual(gg) && th.data.conf.sales_rules >= 2 && !gg.whsle_id) {
1045 1045 var ob = {};
1046 1046 await th.check_down_line_next(gg, good.goods_num, order.pickup_id, function (obj) {
1047 1047 ob = obj;
... ... @@ -1667,7 +1667,7 @@ Page({
1667 1667  
1668 1668  
1669 1669 //判断是不是线下库存的购买, 是不是秒杀活动
1670   - if (th.data.sales_rules >= 2 && !prom && !good.whsle_id) {
  1670 + if (!getApp().is_virtual(good) && th.data.sales_rules >= 2 && !prom && !good.whsle_id) {
1671 1671  
1672 1672 //-- 看一下购物车上有多少商品 --
1673 1673 var cart_num = 0;
... ...
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>
... ...
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
... ...