Merged
Merge Request #936 · created by 后端研发-苏明海


Dev


From dev into test

Merged by 后端研发-苏明海

1 participants






app.js
@@ -50,7 +50,7 @@ App({ @@ -50,7 +50,7 @@ App({
50 config: null, //门店参数 50 config: null, //门店参数
51 config2: null, //门店配置 51 config2: null, //门店配置
52 code: null, 52 code: null,
53 - user_id:null,// 6519870,//5682094, 53 + user_id:null,//1564704,// 10153869,// 6453964,//5682094,
54 buy_now:null, 54 buy_now:null,
55 picklist:null, //门店列表 55 picklist:null, //门店列表
56 wuliuprice: null, //物流价格表 56 wuliuprice: null, //物流价格表
@@ -78,6 +78,10 @@ App({ @@ -78,6 +78,10 @@ App({
78 onLaunch: function() { 78 onLaunch: function() {
79 wx.hideTabBar(); 79 wx.hideTabBar();
80 this.initExt(); 80 this.initExt();
  81 +
  82 + //检查更新
  83 + this.checkUpdateVersion();
  84 +
81 var t = this.globalData.setting; 85 var t = this.globalData.setting;
82 //console.log(t) 86 //console.log(t)
83 t.resourceUrl = t.url + "/template/mobile/rainbow"; 87 t.resourceUrl = t.url + "/template/mobile/rainbow";
@@ -665,6 +669,7 @@ App({ @@ -665,6 +669,7 @@ App({
665 this.globalData.dis_buy_obj=null; //等级卡的购买记录 669 this.globalData.dis_buy_obj=null; //等级卡的购买记录
666 this.globalData.storeFooter=null; //底部的导航 670 this.globalData.storeFooter=null; //底部的导航
667 this.globalData.full_screen=null; //全屏 671 this.globalData.full_screen=null; //全屏
  672 +
668 }, 673 },
669 674
670 clear_word:function (word) { 675 clear_word:function (word) {
@@ -767,6 +772,42 @@ App({ @@ -767,6 +772,42 @@ App({
767 }, 772 },
768 773
769 774
  775 + checkUpdateVersion() {
  776 + //判断微信版本是否 兼容小程序更新机制API的使用
  777 + if (wx.canIUse('getUpdateManager')) {
  778 + //创建 UpdateManager 实例
  779 + const updateManager = wx.getUpdateManager();
  780 + console.log('是否进入模拟更新');
  781 + //检测版本更新
  782 + updateManager.onCheckForUpdate(function(res) {
  783 + console.log('是否获取版本');
  784 + // 请求完新版本信息的回调
  785 + if (res.hasUpdate) {
  786 + //监听小程序有版本更新事件
  787 + updateManager.onUpdateReady(function() {
  788 +
  789 + //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作)
  790 + updateManager.applyUpdate();
  791 + })
  792 + updateManager.onUpdateFailed(function() {
  793 + // 新版本下载失败
  794 + wx.showModal({
  795 + title: '已经有新版本喽~',
  796 + content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开哦~',
  797 + })
  798 + })
  799 + }
  800 + })
  801 + } else {
  802 + //TODO 此时微信版本太低(一般而言版本都是支持的)
  803 + wx.showModal({
  804 + title: '溫馨提示',
  805 + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  806 + })
  807 + }
  808 + },
  809 +
  810 +
770 811
771 812
772 813
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -816,7 +816,7 @@ swiper { @@ -816,7 +816,7 @@ swiper {
816 background-color: rgba(0, 0, 0, 0.5); 816 background-color: rgba(0, 0, 0, 0.5);
817 } 817 }
818 818
819 -.t_red{ color:red;} 819 +.t_red{ color:red !important;}
820 820
821 .sp .sp_top .s_img image.zs_t3_3l{ 821 .sp .sp_top .s_img image.zs_t3_3l{
822 width: 56rpx; 822 width: 56rpx;
packageA/pages/checkin/checkin.wxml
@@ -91,41 +91,40 @@ @@ -91,41 +91,40 @@
91 </view> 91 </view>
92 92
93 <view class="jfbuy-container"> 93 <view class="jfbuy-container">
94 - <view class="jfbuy flex">  
95 - <!-- <image class="jfbuy-img" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/liwu.png"></image> -->  
96 - <!-- <view class="right">  
97 - <view>  
98 - <view class="t1">小积分大作为</view>  
99 - <view class="t2">积分抵用现金,积少成多</view>  
100 - </view>  
101 - <view class="t-c">  
102 - <view class="btn-buy" bindtap="goto" data-url="/packageA/pages/jfbuy/jfbuy">去购物 Go!</view>  
103 - </view>  
104 - </view> -->  
105 - <block wx:if="{{ad_data}}">  
106 - <swiper class="swiper" circular="true" autoplay="true" indicator-dots="true" interval="2500" style="height:240rpx;width: 670rpx;">  
107 - <block wx:for="{{ad_data}}">  
108 94
109 - <navigator url="{{item.ad_weapplink}}" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">  
110 - <swiper-item>  
111 - <image src="{{item.ad_code}}" style="width: 100%;height: 240rpx;" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true" />  
112 - </swiper-item>  
113 - </navigator> 95 + <block wx:if="{{ad_data}}">
  96 + <swiper class="swiper" circular="true" autoplay="true" indicator-dots="true" interval="2500">
  97 + <block wx:for="{{ad_data}}">
  98 + <navigator url="{{item.ad_weapplink}}" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
  99 + <swiper-item>
  100 + <image src="{{item.ad_code}}" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true" />
  101 + </swiper-item>
  102 + </navigator>
114 103
115 - <view data-url="{{item.ad_weapplink}}" wx:else bindtap="go_url">  
116 - <swiper-item>  
117 - <image src="{{item.ad_code}}" style="width: 100%;height: 240rpx;" class="slide-image" mode="widthFix" lazy-load="true" />  
118 - </swiper-item>  
119 - </view> 104 + <view data-url="{{item.ad_weapplink}}" wx:else bindtap="go_url">
  105 + <swiper-item>
  106 + <image src="{{item.ad_code}}" class="slide-image" mode="widthFix" lazy-load="true" />
  107 + </swiper-item>
  108 + </view>
  109 + </block>
  110 + </swiper>
  111 + </block>
  112 + <block wx:else>
  113 + <view class="jfbuy flex">
120 114
121 - </block>  
122 - </swiper> 115 + <image class="jfbuy-img" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/liwu.png"></image>
  116 + <view class="right">
  117 + <view>
  118 + <view class="t1">小积分大作为</view>
  119 + <view class="t2">积分抵用现金,积少成多</view>
  120 + </view>
  121 + <view class="t-c">
  122 + <view class="btn-buy" bindtap="goto" data-url="/packageA/pages/jfbuy/jfbuy">去购物 Go!</view>
  123 + </view>
  124 + </view>
  125 + </view>
123 126
124 - </block>  
125 - <block wx:else>  
126 - <image class="xc-top-img" src="{{url}}/miniapp/images/seckill_top_img.jpg"></image>  
127 - </block>  
128 - </view> 127 + </block>
129 </view> 128 </view>
130 129
131 <view class="popup-container" wx:if="{{isShowRules}}"> 130 <view class="popup-container" wx:if="{{isShowRules}}">
packageA/pages/distribution/myteam/myteam.wxml
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 <view> 11 <view>
12 <view> 12 <view>
13 {{item.nickname}} 13 {{item.nickname}}
14 - <view style="color: #FF6768;display:inline;" wx:if="{{item.is_distribut == 1}}">分销会员</view>  
15 - <view style="color: #FF6768;display:inline;" wx:else>普通会员</view> 14 + <view style="color: #FF6768;display:block;" wx:if="{{item.is_distribut == 1}}">分销会员</view>
  15 + <view style="color: #FF6768;display:block;" wx:else>普通会员</view>
16 </view> 16 </view>
17 <view class="fs24 c-a">{{filter.format_time(item.reg_time)}}</view> 17 <view class="fs24 c-a">{{filter.format_time(item.reg_time)}}</view>
18 </view> 18 </view>
packageA/pages/quan_pro/quan_pro.wxml
@@ -16,9 +16,9 @@ @@ -16,9 +16,9 @@
16 <view class="fs30 flex" wx:if="{{q_data}}" style="height: 100rpx;justify-content: space-between;"> 16 <view class="fs30 flex" wx:if="{{q_data}}" style="height: 100rpx;justify-content: space-between;">
17 <view class="flex ai-center"> 17 <view class="flex ai-center">
18 <view class="t_circle"></view> 18 <view class="t_circle"></view>
19 - <view> 19 + <view class="ellipsis-2" style="width: 400rpx;">
20 <text wx:if="{{q_data.useobjecttype==0}}">全场通用</text> 20 <text wx:if="{{q_data.useobjecttype==0}}">全场通用</text>
21 - <text wx:else>仅限{{q_data.useobjectname}}使用</text> 21 + <text wx:else >仅限{{q_data.useobjectname}}使用</text>
22 </view> 22 </view>
23 </view> 23 </view>
24 <view> 24 <view>
@@ -26,7 +26,9 @@ @@ -26,7 +26,9 @@
26 <view class="fs28">满{{filters.toFix(q_data.condition,2)}}可用</view> 26 <view class="fs28">满{{filters.toFix(q_data.condition,2)}}可用</view>
27 </view> 27 </view>
28 </view> 28 </view>
29 - <text class="ellipsis-3 fs30">{{q_data.coupon_remark}}</text> 29 + <view class="coupon_remark">
  30 + <text class="ellipsis-2 fs26" style="height: 100%;">{{q_data.coupon_remark}}</text>
  31 + </view>
30 </view> 32 </view>
31 33
32 <block wx:if="{{ q_data}}"> 34 <block wx:if="{{ q_data}}">
packageA/pages/quan_pro/quan_pro.wxss
@@ -10,7 +10,7 @@ page{background-color: #f8f8f8;} @@ -10,7 +10,7 @@ page{background-color: #f8f8f8;}
10 .q_content{ position: absolute;top: 0; left: 0; width: calc(100% - 40rpx); height: 450rpx;padding: 0 20rpx; } 10 .q_content{ position: absolute;top: 0; left: 0; width: calc(100% - 40rpx); height: 450rpx;padding: 0 20rpx; }
11 .upper{ height:330rpx;} 11 .upper{ height:330rpx;}
12 .lower{ height: 120rpx; line-height: 170rpx;color:#7a668f} 12 .lower{ height: 120rpx; line-height: 170rpx;color:#7a668f}
13 -.quan_box {display: flex;flex-direction: column;justify-content: flex-start; box-sizing: border-box;} 13 +.quan_box {display: flex;flex-direction: column; box-sizing: border-box;}
14 .upper .left{ margin-left:30rpx; margin-top: 30rpx } 14 .upper .left{ margin-left:30rpx; margin-top: 30rpx }
15 .t_circle{ width: 10rpx; height: 10rpx; border-radius: 50%; background-color: #fff; margin-right: 8rpx} 15 .t_circle{ width: 10rpx; height: 10rpx; border-radius: 50%; background-color: #fff; margin-right: 8rpx}
16 16
@@ -27,3 +27,5 @@ page{background-color: #f8f8f8;} @@ -27,3 +27,5 @@ page{background-color: #f8f8f8;}
27 } 27 }
28 28
29 .btn.gray{background-color: #dcdcdc; color: #adb3be;} 29 .btn.gray{background-color: #dcdcdc; color: #adb3be;}
  30 +.coupon_remark{padding: 30rpx 0 10rpx 0; box-sizing: border-box; overflow: hidden;}
  31 +
packageB/pages/evaluate/evaluate.js
@@ -140,6 +140,7 @@ Page({ @@ -140,6 +140,7 @@ Page({
140 getApp().request.promiseGet(url, { 140 getApp().request.promiseGet(url, {
141 data: { 141 data: {
142 number: th.data.number, 142 number: th.data.number,
  143 + fromtype:th.data.ftype,
143 storeId: a.stoid 144 storeId: a.stoid
144 } 145 }
145 }).then(res => { 146 }).then(res => {
@@ -239,7 +240,7 @@ Page({ @@ -239,7 +240,7 @@ Page({
239 240
240 if(options.fromtype){ 241 if(options.fromtype){
241 this.setData({ftype:parseInt(options.fromtype)}) ; 242 this.setData({ftype:parseInt(options.fromtype)}) ;
242 - if(options.fromtype==4) th.judge_act(); 243 + if(options.fromtype==4 || options.fromtype==1 ) th.judge_act();
243 } 244 }
244 //th.query_bea(); 245 //th.query_bea();
245 246
@@ -288,7 +289,7 @@ Page({ @@ -288,7 +289,7 @@ Page({
288 289
289 var ty=this.data.ftype?this.data.ftype:2; 290 var ty=this.data.ftype?this.data.ftype:2;
290 wx.redirectTo({ 291 wx.redirectTo({
291 - url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number 292 + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number+"&isdg=1"
292 }); 293 });
293 294
294 }, 295 },
@@ -305,7 +306,8 @@ Page({ @@ -305,7 +306,8 @@ Page({
305 orderNumber: th.data.number, 306 orderNumber: th.data.number,
306 orderType: ty, 307 orderType: ty,
307 storeId: a.stoid, 308 storeId: a.stoid,
308 - userId: d.user_id 309 + userId: d.user_id,
  310 + isdg:1//是否是导购评价
309 } 311 }
310 }).then(res => { 312 }).then(res => {
311 if (res.data.code == 0) { 313 if (res.data.code == 0) {
@@ -329,7 +331,8 @@ Page({ @@ -329,7 +331,8 @@ Page({
329 var th=this; 331 var th=this;
330 var chekc_data={}; 332 var chekc_data={};
331 chekc_data['storeId'] = a.stoid; 333 chekc_data['storeId'] = a.stoid;
332 - chekc_data['number'] =this.data.number; 334 + chekc_data['number'] =this.data.number;
  335 + chekc_data['fromtype'] =this.data.ftype;
333 getApp().request.get("/api/weshop/evaluation/evaluate/check",{ 336 getApp().request.get("/api/weshop/evaluation/evaluate/check",{
334 data:chekc_data, 337 data:chekc_data,
335 success:function(res){ 338 success:function(res){
packageB/pages/evaluate/evaluate.wxml
@@ -102,7 +102,9 @@ @@ -102,7 +102,9 @@
102 <view>查看已评价的订单</view> 102 <view>查看已评价的订单</view>
103 </view> 103 </view>
104 </block> 104 </block>
105 - 105 +<view wx:if="{{is_act==1}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb">
  106 + <view>点击领取礼品</view>
  107 + </view>
106 <!-- 显示来个图标 --> 108 <!-- 显示来个图标 -->
107 <view class="show_icon" style="margin-top: 60rpx;"> 109 <view class="show_icon" style="margin-top: 60rpx;">
108 <view class="icon_item" bindtap="goto" data-url="/pages/index/index/index"> 110 <view class="icon_item" bindtap="goto" data-url="/pages/index/index/index">
@@ -117,12 +119,13 @@ @@ -117,12 +119,13 @@
117 <view>领券</view> 119 <view>领券</view>
118 </view> 120 </view>
119 </view> 121 </view>
  122 +
  123 +
  124 +
120 </view> 125 </view>
121 126
122 <view style="height: 60rpx;"></view> 127 <view style="height: 60rpx;"></view>
123 - <view wx:if="{{is_act==1}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb">  
124 - <view>点击领取礼品</view>  
125 - </view> 128 +
126 </view> 129 </view>
127 <warn id="warn"></warn> 130 <warn id="warn"></warn>
128 </block> 131 </block>
packageB/pages/zuhegou/index/index.js
@@ -1017,12 +1017,12 @@ Page({ @@ -1017,12 +1017,12 @@ Page({
1017 if (th.data.c_guide_id) { 1017 if (th.data.c_guide_id) {
1018 newd['guide_id'] = th.data.c_guide_id; 1018 newd['guide_id'] = th.data.c_guide_id;
1019 newd['guide_type'] = 2; 1019 newd['guide_type'] = 2;
1020 - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; 1020 + newd['guide_type'] = 3;
1021 } else { 1021 } else {
1022 if (getApp().globalData.guide_id) { 1022 if (getApp().globalData.guide_id) {
1023 newd['guide_id'] = getApp().globalData.guide_id; 1023 newd['guide_id'] = getApp().globalData.guide_id;
1024 newd['guide_type'] = 0; 1024 newd['guide_type'] = 0;
1025 - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; 1025 + newd['guide_type'] = 1;
1026 } 1026 }
1027 } 1027 }
1028 1028
@@ -1914,7 +1914,7 @@ Page({ @@ -1914,7 +1914,7 @@ Page({
1914 var need_to_buy = 0; 1914 var need_to_buy = 0;
1915 var data = this.data.list; 1915 var data = this.data.list;
1916 var all_zhqty = 0; //所有商品要求起购数之后 1916 var all_zhqty = 0; //所有商品要求起购数之后
1917 - var zhqty_bz=[]; //超量 1917 + var zhqty_bz = []; //超量
1918 var no_in_arr = []; 1918 var no_in_arr = [];
1919 for (var i in data) { 1919 for (var i in data) {
1920 var item = data[i]; 1920 var item = data[i];
@@ -1965,72 +1965,111 @@ Page({ @@ -1965,72 +1965,111 @@ Page({
1965 1965
1966 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增 1966 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
1967 if (this.data.act.is_bz && no_in_arr.length >= this.data.act.zhbuyqty) { 1967 if (this.data.act.is_bz && no_in_arr.length >= this.data.act.zhbuyqty) {
1968 - var bz_num_ok=0; //超量倍增是否满足  
1969 - var zhqty_len=0; //几个超量倍增 1968 + var bz_num_ok = 0; //超量倍增是否满足
  1969 + var delete_num = 0;
  1970 + var zhqty_len = 0; //几个超量倍增
1970 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); //看一下是几倍 1971 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); //看一下是几倍
1971 - if(this.data.act.is_bzyh && zhqty_bz.length > 0 ){  
1972 - if(zhqty_bz.length>1){  
1973 - zhqty_len=1;  
1974 - let min_bz_num= Math.min.apply(Math, zhqty_bz.map(function(o) {return o['num']}));  
1975 - let new_arr=zhqty_bz.filter(ii=>{  
1976 - return ii['num']==min_bz_num 1972 + if (this.data.act.is_bzyh && zhqty_bz.length > 0) {
  1973 + if (zhqty_bz.length > 1) {
  1974 + let zhqty_bz_arr = [];
  1975 + let zhqty_bz_flag = zhqty_bz.every((item1, i) => {
  1976 + var bz_num = be * item1['zhqty']; //超量倍增
  1977 + var num = item1['num'] - item1['zhqty']; //购买数量减去超量
  1978 + if (bz_num > num) {
  1979 + zhqty_bz_arr.push(item1);
  1980 + zhqty_bz.splice(i, 1)
  1981 + }
  1982 + return bz_num <= num;
1977 }) 1983 })
1978 - // var vv=new_arr[0];  
1979 - var bz_num=be*new_arr[0].zhqty; //超量倍增  
1980 - var num=min_bz_num-new_arr[0].zhqty; //购买数量减去超量  
1981 - bz_num_ok=bz_num-num;  
1982 - if(bz_num_ok <= 0){  
1983 - //超量倍增满足,超量倍增就等于倍数  
1984 - bz_num_ok=bz_num;  
1985 - }else{  
1986 - //超量倍增不满足,倍数要减去多出得  
1987 - be=be-bz_num_ok;  
1988 - bz_num_ok=num;  
1989 - }  
1990 - for(let i=0;i<zhqty_bz.length;i++){  
1991 - var vv=zhqty_bz[i];  
1992 - for(let j=0;j<bz_num_ok;j++){  
1993 - let index= no_in_arr.findIndex(i=>{  
1994 - return vv.goods_id===i.goods_id  
1995 - })  
1996 - no_in_arr.splice(index,1)  
1997 - } 1984 + if (zhqty_bz_flag) {
  1985 + for (let i = 0; i < zhqty_bz.length; i++) {
  1986 + var vv = zhqty_bz[i];
  1987 + for (let j = 0; j < be * vv['zhqty']; j++) {
  1988 + let index = no_in_arr.findIndex(i => {
  1989 + return vv.goods_id === i.goods_id
  1990 + })
  1991 + if (index > -1) {
  1992 + delete_num++
  1993 + no_in_arr.splice(index, 1)
  1994 + }
  1995 + }
  1996 + }
  1997 + } else {
  1998 + let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
  1999 + return o['num']
  2000 + }));
  2001 + let new_arr = zhqty_bz_arr.filter(ii => {
  2002 + return ii['num'] == min_bz_num
  2003 + })
  2004 + var vv = new_arr[0];
  2005 + var bz_num = be * new_arr[0].zhqty; //超量倍增
  2006 + var num = min_bz_num - new_arr[0].zhqty; //购买数量减去超量
  2007 + bz_num_ok = bz_num - num;
  2008 + if (bz_num_ok <= 0) {
  2009 + //超量倍增满足,超量倍增就等于倍数
  2010 + bz_num_ok = bz_num;
  2011 + } else {
  2012 + //超量倍增不满足,倍数要减去多出得
  2013 + // be=be-bz_num_ok;
  2014 + if (num % vv.zhqty == 0) {
  2015 + be = num / vv.zhqty;
  2016 + } else {
  2017 + be = Math.floor(num / vv.zhqty)
  2018 + }
  2019 + bz_num_ok = be * vv.zhqty;
  2020 + }
  2021 +
  2022 + for (let j = 0; j < bz_num_ok; j++) {
  2023 + let index = no_in_arr.findIndex(i => {
  2024 + return vv.goods_id === i.goods_id
  2025 + })
  2026 + if (index > -1) {
  2027 + delete_num++
  2028 + no_in_arr.splice(index, 1)
  2029 + }
  2030 + }
1998 } 2031 }
1999 - aprice += be * aprice;  
2000 - }else{  
2001 - var vv=zhqty_bz[0];  
2002 - var bz_num=be*vv.zhqty; //超量倍增  
2003 - var num=vv['num']-vv.zhqty; //购买数量减去超量  
2004 - bz_num_ok=bz_num-num;  
2005 - if(bz_num_ok <= 0){ 2032 + } else {
  2033 + var vv = zhqty_bz[0];
  2034 + var bz_num = be * vv.zhqty; //超量倍增
  2035 + var num = vv['num'] - vv.zhqty; //购买数量减去超量
  2036 + if (num > 0) {
  2037 + bz_num_ok = bz_num - num;
  2038 + if (bz_num_ok <= 0) {
2006 //超量倍增满足,超量倍增就等于倍数 2039 //超量倍增满足,超量倍增就等于倍数
2007 - bz_num_ok=bz_num;  
2008 - }else{ 2040 + bz_num_ok = bz_num;
  2041 + } else {
2009 //超量倍增不满足,倍数要减去多出得 2042 //超量倍增不满足,倍数要减去多出得
2010 - be=be-bz_num_ok;  
2011 - bz_num_ok=num; 2043 + // be=be-bz_num_ok;
  2044 + if (num % vv.zhqty == 0) {
  2045 + be = num / vv.zhqty;
  2046 + } else {
  2047 + be = Math.floor(num / vv.zhqty)
  2048 + }
  2049 + bz_num_ok = be * vv.zhqty;
2012 } 2050 }
2013 - for(let j=0;j<bz_num_ok;j++){  
2014 - let index= no_in_arr.findIndex(i=>{  
2015 - return vv.goods_id===i.goods_id  
2016 - })  
2017 - no_in_arr.splice(index,1)  
2018 - }  
2019 - } 2051 + for (let j = 0; j < bz_num_ok; j++) {
  2052 + let index = no_in_arr.findIndex(i => {
  2053 + return vv.goods_id === i.goods_id
  2054 + })
  2055 + if (index > -1) {
  2056 + delete_num++
  2057 + no_in_arr.splice(index, 1)
  2058 + }
  2059 + }
  2060 + } else {
  2061 + zhqty_len = 1;
  2062 + }
  2063 + }
2020 } 2064 }
2021 - if(!zhqty_len){ 2065 + if (!zhqty_len) {
2022 //多个超量就不用pop了 2066 //多个超量就不用pop了
2023 aprice += be * aprice; 2067 aprice += be * aprice;
2024 - let pop_num=be * this.data.act.zhbuyqty - bz_num_ok; 2068 + let pop_num = be * this.data.act.zhbuyqty - delete_num;
2025 for (var m = 0; m < pop_num; m++) { 2069 for (var m = 0; m < pop_num; m++) {
2026 no_in_arr.pop(); 2070 no_in_arr.pop();
2027 } 2071 }
2028 } 2072 }
2029 - // var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty);  
2030 - // aprice += be * aprice;  
2031 - // for (var m = 0; m < be * this.data.act.zhbuyqty; m++) {  
2032 - // no_in_arr.pop();  
2033 - // }  
2034 } 2073 }
2035 2074
2036 //算一下剩余的钱 2075 //算一下剩余的钱
packageB/pages/zuhegou/list/list.js
@@ -137,7 +137,7 @@ Page({ @@ -137,7 +137,7 @@ Page({
137 isShowLoading:1, 137 isShowLoading:1,
138 data:{ 138 data:{
139 store_id: os.stoid, 139 store_id: os.stoid,
140 - user_id: getApp().globalData.user_id 140 + user_id: getApp().globalData.user_id,
141 } 141 }
142 }) 142 })
143 if(res.code==0 && res.data.pageData.length>0){ 143 if(res.code==0 && res.data.pageData.length>0){
packageC/pages/group_list/group_list.wxml
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 </view> 21 </view>
22 <view class="flex jc_sb ai-center c-7b"> 22 <view class="flex jc_sb ai-center c-7b">
23 <view class="fs24"> 23 <view class="fs24">
24 - <view>已售{{item.buy_num+item.virtual_num}}件</view> 24 +
  25 + <view>已售<block wx:if="{{type == 1}}">{{item.buy_num+item.virtual_num}}</block><block wx:else>0</block>件</view>
  26 +
25 <view class=""><text class="iconfont icon-shizhong fs24"></text>{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒</view> 27 <view class=""><text class="iconfont icon-shizhong fs24"></text>{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒</view>
26 </view> 28 </view>
27 29
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -286,7 +286,7 @@ Page({ @@ -286,7 +286,7 @@ Page({
286 //------初始化加载---------- 286 //------初始化加载----------
287 onLoad: function (t) { 287 onLoad: function (t) {
288 288
289 - 289 + // console.log('onload');
290 if(t && t.group_id) { 290 if(t && t.group_id) {
291 this.data.group_id = t.group_id; 291 this.data.group_id = t.group_id;
292 }; 292 };
@@ -317,6 +317,7 @@ Page({ @@ -317,6 +317,7 @@ Page({
317 317
318 //---获取手机地址坐标-- 318 //---获取手机地址坐标--
319 //--如果tg_id是空的话,分享回来-- 319 //--如果tg_id是空的话,分享回来--
  320 + // console.log('扫描海报gid');
320 if (gid == undefined || gid == null || gid == "") { 321 if (gid == undefined || gid == null || gid == "") {
321 var gid_str = decodeURIComponent(t.scene); 322 var gid_str = decodeURIComponent(t.scene);
322 gid_str = gid_str.split("_"); 323 gid_str = gid_str.split("_");
@@ -326,6 +327,11 @@ Page({ @@ -326,6 +327,11 @@ Page({
326 gid=fir_arr[0]; 327 gid=fir_arr[0];
327 prom_type=fir_arr[1]; 328 prom_type=fir_arr[1];
328 prom_id=fir_arr[2]; 329 prom_id=fir_arr[2];
  330 + // this.setData({
  331 + // prom_type: prom_type,
  332 + // prom_id: prom_id,
  333 + // group_id: fir_arr[2],
  334 + // });
329 this.data.prom_type=prom_type; 335 this.data.prom_type=prom_type;
330 this.data.prom_id=prom_id; 336 this.data.prom_id=prom_id;
331 this.data.group_id = fir_arr[2]; 337 this.data.group_id = fir_arr[2];
@@ -745,7 +751,7 @@ Page({ @@ -745,7 +751,7 @@ Page({
745 751
746 //---展示--- 752 //---展示---
747 onShow: async function () { 753 onShow: async function () {
748 - 754 + // console.log('onshow');
749 var goods_list = null, th = this, that = this; 755 var goods_list = null, th = this, that = this;
750 var show_prew_img = this.data.show_prew_img 756 var show_prew_img = this.data.show_prew_img
751 if (show_prew_img) { 757 if (show_prew_img) {
@@ -763,8 +769,9 @@ Page({ @@ -763,8 +769,9 @@ Page({
763 id: this.data.group_id, 769 id: this.data.group_id,
764 } 770 }
765 }).then(res => { 771 }).then(res => {
  772 + // console.log()
  773 + // console.log('判断活动是否暂停=======》', res.data.data);
766 if (res.data.code == 0) { 774 if (res.data.code == 0) {
767 - // console.log('成团信息=======》', res.data.data);  
768 if(res.data.data.pageData && res.data.data.pageData.length == 0) { 775 if(res.data.data.pageData && res.data.data.pageData.length == 0) {
769 let obj = { 776 let obj = {
770 day: '00', 777 day: '00',
@@ -797,6 +804,7 @@ Page({ @@ -797,6 +804,7 @@ Page({
797 804
798 805
799 }); 806 });
  807 +
800 // 活动暂停显示空白 808 // 活动暂停显示空白
801 if (this.data.isTimeUp) { 809 if (this.data.isTimeUp) {
802 wx.showModal({ 810 wx.showModal({
packageC/pages/presell/list/list.wxml
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 27
28 <view class="kill-list seckill_list"> 28 <view class="kill-list seckill_list">
29 <view class="kill-item" wx:for="{{goodlist}}"> 29 <view class="kill-item" wx:for="{{goodlist}}">
30 - <navigator class="kill-pic rel" url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}"> 30 + <navigator class="kill-pic rel" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">
31 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" 31 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}"
32 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> 32 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
33 </navigator> 33 </navigator>
@@ -38,12 +38,12 @@ @@ -38,12 +38,12 @@
38 <view class="xc-strip-blank rel"> 38 <view class="xc-strip-blank rel">
39 39
40 <view class="flex-vertical rel total" style="background-color: {{type == 0 ? '#059de5' : ''}};"> 40 <view class="flex-vertical rel total" style="background-color: {{type == 0 ? '#059de5' : ''}};">
41 - <view class="t-c abs xc-fill" style="width:{{215*(item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)}}rpx;background:#e4374d;"></view>  
42 - <text class="fs20 white abs xc-fill-text">已预售{{filters.toFix((item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)*100,0)}}%</text> 41 + <view class="t-c abs xc-fill" ></view>
  42 + <text class="fs20 white abs xc-fill-text">已预售0%</text>
43 </view> 43 </view>
44 44
45 </view> 45 </view>
46 - <view class=" ml10 fs20">库存还剩{{item.presell_sumqty-item.buy_goodnum}}件</view> 46 + <view class=" ml10 fs20">库存还剩{{item.presell_sumqty+item.virtual_qty}}件</view>
47 </view> 47 </view>
48 48
49 <view class="goods-num"> 49 <view class="goods-num">
packageC/pages/presell/pregoodsInfo/goodsInfo.wxml
@@ -134,13 +134,13 @@ @@ -134,13 +134,13 @@
134 <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> 134 <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view>
135 <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> 135 <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view>
136 <view class="stock" wx:else>限购:不限</view> 136 <view class="stock" wx:else>限购:不限</view>
137 - <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> 137 + <view class="sales">已购:0件</view>
138 </block> 138 </block>
139 <block wx:else> 139 <block wx:else>
140 <view class="stock">总数量:{{presellList.presell_sumqty}}件</view> 140 <view class="stock">总数量:{{presellList.presell_sumqty}}件</view>
141 <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> 141 <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view>
142 <view class="stock" wx:else>限购:不限</view> 142 <view class="stock" wx:else>限购:不限</view>
143 - <view class="sales">已购:{{presellList.buy_goodnum}}件</view> 143 + <view class="sales">已购:0件</view>
144 </block> 144 </block>
145 </view> 145 </view>
146 </view> 146 </view>
pages/activity/pind_list/pind_list.js
@@ -27,9 +27,6 @@ Page({ @@ -27,9 +27,6 @@ Page({
27 }) 27 })
28 var first_leader = t.first_leader; 28 var first_leader = t.first_leader;
29 var th = this; 29 var th = this;
30 -  
31 - console.log("------------");  
32 - console.log(first_leader);  
33 getApp().getConfig(); 30 getApp().getConfig();
34 31
35 if (first_leader) { 32 if (first_leader) {
@@ -64,23 +61,28 @@ Page({ @@ -64,23 +61,28 @@ Page({
64 }); 61 });
65 } 62 }
66 }) 63 })
67 - 64 + // var user_id=getApp().globalData.user_id;
  65 + // if(!user_id) user_id=0;
  66 + // this.setData({
  67 + // user_id,
  68 + // })
  69 + this.requestSalelist();
68 }, 70 },
69 71
70 onShow: function (t) { 72 onShow: function (t) {
71 -  
72 this.data.is_timer = 1; 73 this.data.is_timer = 1;
73 this.data.currentPage = 1; 74 this.data.currentPage = 1;
74 this.data.ismore = 1; 75 this.data.ismore = 1;
75 var th = this; 76 var th = this;
76 - var userInfo = wx.getStorageSync('userinfo');  
77 - console.log(userInfo,30000);  
78 - if (userInfo && th.data.goodlist.length==0) {  
79 - //调用列表  
80 - this.requestSalelist(userInfo.user_id);  
81 - } else {  
82 - getApp().goto("/pages/togoin/togoin");  
83 - } 77 + // var userInfo = wx.getStorageSync('userinfo');
  78 + // if (userInfo) {
  79 + // //调用列表
  80 + // this.requestSalelist(userInfo.user_id);
  81 + // } else {
  82 + // getApp().goto("/pages/togoin/togoin");
  83 + // }
  84 +
  85 +
84 //设置全局定时器 86 //设置全局定时器
85 th.data.timer = setInterval(function () { 87 th.data.timer = setInterval(function () {
86 th.countDown(); 88 th.countDown();
@@ -134,12 +136,12 @@ Page({ @@ -134,12 +136,12 @@ Page({
134 }, 136 },
135 137
136 //读取数据 138 //读取数据
137 - async requestSalelist(user_id) { 139 + async requestSalelist() {
138 if (!this.data.ismore) return false; 140 if (!this.data.ismore) return false;
139 var e = this, 141 var e = this,
140 th = e, 142 th = e,
141 i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; 143 i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage;
142 - var plist = null, 144 + var plist = [],
143 alllist = th.data.goodlist; 145 alllist = th.data.goodlist;
144 if (!alllist) alllist = []; 146 if (!alllist) alllist = [];
145 await getApp().request.promiseGet(i, { 147 await getApp().request.promiseGet(i, {
@@ -148,7 +150,7 @@ Page({ @@ -148,7 +150,7 @@ Page({
148 store_id: os.stoid, 150 store_id: os.stoid,
149 is_end: 0, 151 is_end: 0,
150 is_show: 1, 152 is_show: 1,
151 - user_id, 153 + user_id:getApp().globalData.user_id,
152 } 154 }
153 }).then(res => { 155 }).then(res => {
154 plist = res.data.data.pageData; 156 plist = res.data.data.pageData;
@@ -183,7 +185,7 @@ Page({ @@ -183,7 +185,7 @@ Page({
183 this.reloadGoodList(); 185 this.reloadGoodList();
184 }, 186 },
185 reloadGoodList: function () { 187 reloadGoodList: function () {
186 - this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist(); 188 + this.data.goodlist = [], this.data.currentPage = 1, this.requestSalelist();
187 }, 189 },
188 onReachBottom: function () { 190 onReachBottom: function () {
189 this.requestSalelist(); 191 this.requestSalelist();
pages/activity/seckill_list/seckill_list.js
1 -var e = getApp(), i = e.request, a = e.globalData.setting,os=a,ut = require("../../../utils/util.js"); 1 +var e = getApp(),
  2 + i = e.request,
  3 + a = e.globalData.setting,
  4 + os = a,
  5 + ut = require("../../../utils/util.js");
2 var regeneratorRuntime = require('../../../utils/runtime.js'); 6 var regeneratorRuntime = require('../../../utils/runtime.js');
3 7
4 Page({ 8 Page({
5 - data: {  
6 - url: a.imghost,  
7 - killtime: null,  
8 - currentPage: 1,  
9 - goodlist: null,  
10 - type:1,  
11 - timer:null,  
12 - ismore:1, //是否可以加载更多  
13 - isshow:0,  
14 - ad_data:null,  
15 - max_sw_height:200,  
16 - },  
17 -  
18 - //------初始化加载----------  
19 - onLoad: function(t) {  
20 - wx.setNavigationBarTitle({ title: "商品秒杀",})  
21 - var first_leader = t.first_leader;  
22 - var type=t.type;  
23 - if(type!=undefined){  
24 - this.setData({type:type});  
25 - } 9 + data: {
  10 + url: a.imghost,
  11 + killtime: null,
  12 + currentPage: 1,
  13 + goodlist: null,
  14 + type: 1,
  15 + timer: null,
  16 + ismore: 1, //是否可以加载更多
  17 + isshow: 0,
  18 + ad_data: null,
  19 + max_sw_height: 200,
  20 + },
  21 +
  22 + //------初始化加载----------
  23 + onLoad: function (t) {
  24 + wx.setNavigationBarTitle({
  25 + title: "商品秒杀",
  26 + })
  27 + var first_leader = t.first_leader;
  28 + var type = t.type;
  29 + if (type != undefined) {
  30 + this.setData({
  31 + type: type
  32 + });
  33 + }
26 34
27 - var th=this; 35 + var th = this;
  36 + console.log("------------");
  37 + console.log(first_leader);
  38 + getApp().getConfig();
28 39
29 - console.log("------------");  
30 - console.log(first_leader);  
31 - getApp().getConfig(); 40 + if (first_leader) {
  41 + getApp().globalData.first_leader = first_leader;
  42 + //调用接口判断是不是会员
  43 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  44 + if (res.data.code == 0) {
  45 + getApp().globalData.guide_id = res.data.data.id;
  46 + }
  47 + })
  48 + }
32 49
33 - if (first_leader) {  
34 - getApp().globalData.first_leader = first_leader;  
35 - //调用接口判断是不是会员  
36 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {  
37 - if (res.data.code == 0) {  
38 - getApp().globalData.guide_id = res.data.data.id;  
39 - }  
40 - }) 50 + getApp().request.promiseGet("/api/weshop/ad/page?pid=701&store_id=" + os.stoid, {
  51 + data: {
  52 + enabled: 1
  53 + }
  54 + }).then(res => {
  55 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
  56 + var a = res.data.data.pageData;
  57 + var narr = [];
  58 + for (var i in a) {
  59 + var tt = {
  60 + 'ad_code': os.imghost + a[i].ad_code,
  61 + 'media_link': '',
  62 + 'ad_weapplink': a[i].ad_weapplink
  63 + };
  64 + narr.push(tt);
41 } 65 }
42 -  
43 - getApp().request.promiseGet("/api/weshop/ad/page?pid=701&store_id=" + os.stoid, {  
44 - data: {  
45 - enabled: 1  
46 - }  
47 - }).then(res => {  
48 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
49 - var a = res.data.data.pageData;  
50 - var narr=[];  
51 - for(var i in a){  
52 - var tt = {  
53 - 'ad_code': os.imghost + a[i].ad_code,  
54 - 'media_link': '',  
55 - 'ad_weapplink':a[i].ad_weapplink  
56 - };  
57 - narr.push(tt);  
58 - }  
59 - th.setData({ad_data:narr});  
60 - }  
61 - })  
62 -  
63 - },  
64 -  
65 -  
66 - onShow: function(t) {  
67 - this.data.ismore=1;  
68 - this.data.is_timer=1;  
69 - this.data.currentPage=1;  
70 - var th=this;th.setData({goodlist:null,})  
71 - this.requestSalelist();  
72 - //设置全局定时器  
73 - th.data.timer=setInterval(function () {  
74 - th.countDown();  
75 - },1000);  
76 - },  
77 - onHide:function(){  
78 - //--清理定时器--  
79 - clearInterval(this.data.timer);  
80 - this.setData({isshow:0});  
81 - },  
82 - //---小于10的格式化函数----  
83 - timeFormat(param) {  
84 - return param < 10 ? '0' + param : param;  
85 - }, 66 + th.setData({
  67 + ad_data: narr
  68 + });
  69 + }
  70 + })
  71 + this.requestSalelist();
  72 + },
  73 +
  74 +
  75 + onShow: function (t) {
  76 + this.data.is_timer = 1;
  77 + this.data.currentPage = 1;
  78 + var th = this;
  79 + //设置全局定时器
  80 + th.data.timer = setInterval(function () {
  81 + th.countDown();
  82 + }, 1000);
  83 + },
  84 + onHide: function () {
  85 + //--清理定时器--
  86 + clearInterval(this.data.timer);
  87 + this.setData({
  88 + isshow: 0
  89 + });
  90 + },
  91 + //---小于10的格式化函数----
  92 + timeFormat(param) {
  93 + return param < 10 ? '0' + param : param;
  94 + },
86 95
87 //----倒计时函数----- 96 //----倒计时函数-----
88 - countDown() {  
89 - if(!this.data.is_timer) return false;  
90 - var th=this; 97 + countDown() {
  98 + if (!this.data.is_timer) return false;
  99 + var th = this;
91 // 获取当前时间,同时得到活动结束时间数组 100 // 获取当前时间,同时得到活动结束时间数组
92 - let newTime =ut.gettimestamp(); 101 + let newTime = ut.gettimestamp();
93 var endTimeList = this.data.goodlist; 102 var endTimeList = this.data.goodlist;
94 - if(endTimeList==null) return null 103 + if (endTimeList == null) return null
95 // 对结束时间进行处理渲染到页面 104 // 对结束时间进行处理渲染到页面
96 - for (var i = 0; i < endTimeList.length;i++){  
97 - var o = endTimeList[i];  
98 - var endTime = o.end_time;  
99 - if(th.data.type==0) endTime = o.start_time;  
100 - let obj = null;  
101 - // 如果活动未结束,对时间进行处理  
102 - if (endTime - newTime > 0){  
103 - let time = (endTime - newTime);  
104 - // 获取天、时、分、秒  
105 - let day = parseInt(time / (60 * 60 * 24));  
106 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
107 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
108 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
109 - obj = {  
110 - day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1  
111 - }  
112 - }else{  
113 - //活动已结束,全部设置为'00'  
114 - obj = { day: '00', hou: '00', min: '00', sec: '00' }  
115 - }  
116 - var txt ="goodlist["+i+"].djs";  
117 - th.setData({ [txt]: obj}); 105 + for (var i = 0; i < endTimeList.length; i++) {
  106 + var o = endTimeList[i];
  107 + var endTime = o.end_time;
  108 + if (th.data.type == 0) endTime = o.start_time;
  109 + let obj = null;
  110 + // 如果活动未结束,对时间进行处理
  111 + if (endTime - newTime > 0) {
  112 + let time = (endTime - newTime);
  113 + // 获取天、时、分、秒
  114 + let day = parseInt(time / (60 * 60 * 24));
  115 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  116 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  117 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  118 + obj = {
  119 + day: this.timeFormat(day),
  120 + hou: this.timeFormat(hou),
  121 + min: this.timeFormat(min),
  122 + sec: this.timeFormat(sec),
  123 + hide: 1
118 } 124 }
119 - },  
120 -  
121 - async requestSalelist() {  
122 - //--没有更多就不调用--  
123 - if(!this.data.ismore) return false;  
124 - var e = this,th=e, i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;  
125 - var plist=null,alllist=th.data.goodlist;  
126 - if(!alllist) alllist=[];  
127 - var user_id=getApp().globalData.user_id;  
128 - if(!user_id) user_id=user_id;  
129 - var req={store_id:os.stoid,timetype:th.data.type,is_end:0,is_show:1,user_id:user_id};  
130 -  
131 - await getApp().request.promiseGet(i,  
132 - {isShowLoading:1,data:req}  
133 - ).then(res=>{  
134 - if(ut.ajax_ok(res)) plist=res.data.data.pageData; 125 + } else {
  126 + //活动已结束,全部设置为'00'
  127 + obj = {
  128 + day: '00',
  129 + hou: '00',
  130 + min: '00',
  131 + sec: '00'
  132 + }
  133 + }
  134 + var txt = "goodlist[" + i + "].djs";
  135 + th.setData({
  136 + [txt]: obj
  137 + });
  138 + }
  139 + },
135 140
136 - }); 141 + async requestSalelist() {
  142 + //--没有更多就不调用--
  143 + if (!this.data.ismore) return false;
  144 + var e = this,
  145 + th = e,
  146 + i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;
  147 + var plist = [],
  148 + alllist = th.data.goodlist;
  149 + if (!alllist) alllist = [];
  150 + var user_id = getApp().globalData.user_id;
  151 + if (!user_id) user_id = user_id;
  152 + var req = {
  153 + store_id: os.stoid,
  154 + timetype: th.data.type,
  155 + is_end: 0,
  156 + is_show: 1,
  157 + user_id: user_id
  158 + };
137 159
138 - if(plist.length<=0){  
139 -  
140 - getApp().showWarning("没有更多数据");  
141 - th.data.ismore=0;  
142 - if(e.data.currentPage==1 && this.data.type==1){  
143 - setTimeout(function () {  
144 - th.data.ismore=1;  
145 - th.setData({type:0});  
146 - th.requestSalelist();  
147 - },1000);  
148 - }  
149 - return false;  
150 - } 160 + await getApp().request.promiseGet(i, {
  161 + isShowLoading: 1,
  162 + data: req
  163 + }).then(res => {
  164 + if (ut.ajax_ok(res)) plist = res.data.data.pageData;
151 165
152 - //--循环读取接口---  
153 - for(var i=0;i<plist.length;i++) {  
154 -  
155 - if( plist[i].user_price) plist[i].price= plist[i].user_price;  
156 - var prom_id = plist[i].id;  
157 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
158 - os.stoid + "/1/" + prom_id, {}  
159 - ).then(res=>{  
160 - if(res.data.code==0){  
161 - plist[i].status=1;  
162 - if(res.data.data<=0) plist[i].status=3;  
163 - }  
164 - })  
165 - alllist.push(plist[i]);  
166 - }  
167 - e.data.currentPage++;  
168 - console.log("秒杀商品列表", alllist);  
169 - th.setData({goodlist:alllist,isshow:1});  
170 -  
171 - },  
172 - onPullDownRefresh: function() {  
173 - this.reloadGoodList();  
174 - },  
175 - reloadGoodList: function() {  
176 - this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist();  
177 - },  
178 -  
179 - onReachBottom: function() {  
180 - this.requestSalelist();  
181 - },  
182 -  
183 - //点击tab事件  
184 - tip:function(e){  
185 - var a=e.currentTarget.dataset.ty,th=this;th.data.ismore=1;  
186 - this.setData({type:a,goodlist:null});  
187 - this.reloadGoodList();  
188 - },  
189 -  
190 -  
191 - //---------分享配置--------  
192 - onShareAppMessage: function (e) {  
193 - var curPage=this;  
194 - var pagePath = curPage.route; //当前页面url  
195 - if (pagePath.indexOf('/') != 0) {  
196 - pagePath = '/' + pagePath;  
197 - }  
198 - if(getApp().globalData.user_id){ 166 + });
199 167
200 - if(pagePath.indexOf("?")>0){  
201 - pagePath+="&first_leader="+getApp().globalData.user_id;  
202 - }else{  
203 - pagePath+="?first_leader="+getApp().globalData.user_id;  
204 - }  
205 - } 168 + if (!plist || plist.length <= 0) {
206 169
207 - console.log("11"+pagePath);  
208 - return {  
209 - title: "限时秒杀",  
210 - path:pagePath, 170 + getApp().showWarning("没有更多数据");
  171 + th.data.ismore = 0;
  172 + if (e.data.currentPage == 1 && this.data.type == 1) {
  173 + setTimeout(function () {
  174 + th.data.ismore = 1;
  175 + th.setData({
  176 + type: 0
  177 + });
  178 + th.requestSalelist();
  179 + }, 1000);
  180 + }
  181 + return false;
  182 + }
  183 +
  184 + //--循环读取接口---
  185 + for (var i = 0; i < plist.length; i++) {
  186 +
  187 + if (plist[i].user_price) plist[i].price = plist[i].user_price;
  188 + var prom_id = plist[i].id;
  189 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  190 + os.stoid + "/1/" + prom_id, {}
  191 + ).then(res => {
  192 + if (res.data.code == 0) {
  193 + plist[i].status = 1;
  194 + if (res.data.data <= 0) plist[i].status = 3;
211 } 195 }
212 - },  
213 -  
214 - //图片失败,默认图片  
215 - bind_bnerr2: function (e) {  
216 - var _errImg = e.target.dataset.errorimg;  
217 - var val = e.target.dataset.val;  
218 - if(val!=undefined && val!=null && val!='null' ){  
219 - var _errObj = {};  
220 - _errObj[_errImg] = "/public/images/default_goods_image_240.gif";  
221 - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;  
222 - }  
223 - },  
224 -  
225 - onShareTimeline() {  
226 - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';  
227 - if(!store_name)  
228 - store_name=getApp().globalData.setting.appName;  
229 - return {  
230 - title: '秒杀活动-' + store_name,  
231 - }  
232 - },  
233 -  
234 - imageLoad:function(e){  
235 - var imgwidth = e.detail.width;  
236 - var imgheight = e.detail.height;  
237 - //宽高比  
238 - var ratio = imgwidth / imgheight;  
239 - //计算的高度值  
240 - var viewHeight = 750 / ratio;  
241 - var hei=this.data.max_sw_height;  
242 -  
243 - if (hei< viewHeight) {  
244 - this.setData({ max_sw_height: viewHeight });  
245 - }  
246 - },  
247 - go_url(e){  
248 - let url=e.currentTarget.dataset.url;  
249 - if(url){  
250 - getApp().goto(url); 196 + })
  197 + alllist.push(plist[i]);
  198 + }
  199 + e.data.currentPage++;
  200 + console.log("秒杀商品列表", alllist);
  201 + th.setData({
  202 + goodlist: alllist,
  203 + isshow: 1
  204 + });
  205 +
  206 +
  207 +
  208 + },
  209 + onPullDownRefresh: function () {
  210 + this.reloadGoodList();
  211 + },
  212 + reloadGoodList: function () {
  213 + this.data.goodlist = [], this.data.currentPage = 1, this.requestSalelist();
  214 + },
  215 +
  216 + onReachBottom: function () {
  217 + this.requestSalelist();
  218 + },
  219 +
  220 + //点击tab事件
  221 + tip: function (e) {
  222 + var a = e.currentTarget.dataset.ty,
  223 + th = this;
  224 + th.data.ismore = 1;
  225 + this.setData({
  226 + type: a,
  227 + goodlist: null
  228 + });
  229 + this.reloadGoodList();
  230 + },
  231 +
  232 +
  233 + //---------分享配置--------
  234 + onShareAppMessage: function (e) {
  235 + var curPage = this;
  236 + var pagePath = curPage.route; //当前页面url
  237 + if (pagePath.indexOf('/') != 0) {
  238 + pagePath = '/' + pagePath;
  239 + }
  240 + if (getApp().globalData.user_id) {
  241 +
  242 + if (pagePath.indexOf("?") > 0) {
  243 + pagePath += "&first_leader=" + getApp().globalData.user_id;
  244 + } else {
  245 + pagePath += "?first_leader=" + getApp().globalData.user_id;
251 } 246 }
252 - }, 247 + }
  248 +
  249 + console.log("11" + pagePath);
  250 + return {
  251 + title: "限时秒杀",
  252 + path: pagePath,
  253 + }
  254 + },
  255 +
  256 + //图片失败,默认图片
  257 + bind_bnerr2: function (e) {
  258 + var _errImg = e.target.dataset.errorimg;
  259 + var val = e.target.dataset.val;
  260 + if (val != undefined && val != null && val != 'null') {
  261 + var _errObj = {};
  262 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  263 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  264 + }
  265 + },
  266 +
  267 + onShareTimeline() {
  268 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  269 + if (!store_name)
  270 + store_name = getApp().globalData.setting.appName;
  271 + return {
  272 + title: '秒杀活动-' + store_name,
  273 + }
  274 + },
  275 +
  276 + imageLoad: function (e) {
  277 + var imgwidth = e.detail.width;
  278 + var imgheight = e.detail.height;
  279 + //宽高比
  280 + var ratio = imgwidth / imgheight;
  281 + //计算的高度值
  282 + var viewHeight = 750 / ratio;
  283 + var hei = this.data.max_sw_height;
253 284
254 -}); 285 + if (hei < viewHeight) {
  286 + this.setData({
  287 + max_sw_height: viewHeight
  288 + });
  289 + }
  290 + },
  291 + go_url(e) {
  292 + let url = e.currentTarget.dataset.url;
  293 + if (url) {
  294 + getApp().goto(url);
  295 + }
  296 + },
  297 +});
255 \ No newline at end of file 298 \ No newline at end of file
pages/cart/cart/cart.wxml
@@ -39,9 +39,9 @@ @@ -39,9 +39,9 @@
39 <!-- 购物车商品框架 --> 39 <!-- 购物车商品框架 -->
40 <view class="login-in"> 40 <view class="login-in">
41 <!-- 编辑 --> 41 <!-- 编辑 -->
42 - <view class="padding flex-vertical-between fs30 Storenum store" style="{{total_fee > 0 && freight_free - total_fee > 0 ? 'justify-content:space-between':'justify-content: flex-end;'}}">  
43 - <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free">  
44 - <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text> 42 + <view class="padding flex-vertical-between fs30 Storenum store" style="justify-content:space-between">
  43 + <view wx:if="{{freight_free}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free">
  44 + <text>全场满{{freight_free}}元可享包邮({{weight_free}}kg内)</text>
45 </view> 45 </view>
46 <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view> 46 <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view>
47 <view wx:else bindtap="edit_cart" data-type="0">完成</view> 47 <view wx:else bindtap="edit_cart" data-type="0">完成</view>
pages/cart/cart/zh_calculate.js
@@ -232,62 +232,110 @@ module.exports = { @@ -232,62 +232,110 @@ module.exports = {
232 } 232 }
233 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增 233 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
234 if (act.is_bz && no_in_arr.length >= act.zhbuyqty) { 234 if (act.is_bz && no_in_arr.length >= act.zhbuyqty) {
235 - var bz_num_ok=0; //超量倍增是否满  
236 - var zhqty_len=0; //几个超量倍增  
237 - var be = parseInt(no_in_arr.length / act.zhbuyqty);//看一下是几倍 235 + var bz_num_ok = 0; //超量倍增是否满
  236 + var delete_num = 0;
  237 + var zhqty_len = 0; //几个超量倍增
  238 + var be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍
238 if (act.is_bzyh && zhqty_bz.length > 0) { 239 if (act.is_bzyh && zhqty_bz.length > 0) {
239 - if(zhqty_bz.length>1){  
240 - zhqty_len=1;  
241 - let min_bz_num= Math.min.apply(Math, zhqty_bz.map(function(o) {return o['num']}));  
242 - let new_arr=zhqty_bz.filter(ii=>{  
243 - return ii['num']==min_bz_num 240 + if (zhqty_bz.length > 1) {
  241 + let zhqty_bz_arr = [];
  242 + let zhqty_bz_flag = zhqty_bz.every((item1, i) => {
  243 + var bz_num = be * item1['zhqty']; //超量倍增
  244 + var num = item1['num'] - item1['zhqty']; //购买数量减去超量
  245 + if (bz_num > num) {
  246 + zhqty_bz_arr.push(item1);
  247 + zhqty_bz.splice(i, 1)
  248 + }
  249 + return bz_num <= num;
244 }) 250 })
245 - // var vv=new_arr[0];  
246 - var bz_num=be*new_arr[0].zhqty; //超量倍增  
247 - var num=min_bz_num-new_arr[0].zhqty; //购买数量减去超量  
248 - bz_num_ok=bz_num-num;  
249 - if(bz_num_ok <= 0){ 251 + if (zhqty_bz_flag) {
  252 + for (let i = 0; i < zhqty_bz.length; i++) {
  253 + var vv = zhqty_bz[i];
  254 + for (let j = 0; j < be * vv['zhqty']; j++) {
  255 + let index = no_in_arr.findIndex(i => {
  256 + return vv.goods_id === i.goods_id
  257 + })
  258 + if (index > -1) {
  259 + delete_num++
  260 + no_in_arr.splice(index, 1)
  261 + }
  262 + }
  263 + }
  264 + } else {
  265 + let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
  266 + return o['num']
  267 + }));
  268 + let new_arr = zhqty_bz_arr.filter(ii => {
  269 + return ii['num'] == min_bz_num
  270 + })
  271 + var vv = new_arr[0];
  272 + var bz_num = be * new_arr[0].zhqty; //超量倍增
  273 + var num = min_bz_num - new_arr[0].zhqty; //购买数量减去超量
  274 + bz_num_ok = bz_num - num;
  275 + if (bz_num_ok <= 0) {
250 //超量倍增满足,超量倍增就等于倍数 276 //超量倍增满足,超量倍增就等于倍数
251 - bz_num_ok=bz_num;  
252 - }else{ 277 + bz_num_ok = bz_num;
  278 + } else {
253 //超量倍增不满足,倍数要减去多出得 279 //超量倍增不满足,倍数要减去多出得
254 - be=be-bz_num_ok;  
255 - bz_num_ok=num;  
256 - }  
257 - for(let i=0;i<zhqty_bz.length;i++){  
258 - var vv=zhqty_bz[i];  
259 - for(let j=0;j<bz_num_ok;j++){  
260 - let index= no_in_arr.findIndex(i=>{  
261 - return vv.goods_id===i.goods_id  
262 - })  
263 - no_in_arr.splice(index,1)  
264 - } 280 + // be=be-bz_num_ok;
  281 + if (num % vv.zhqty == 0) {
  282 + be = num / vv.zhqty;
  283 + } else {
  284 + be = Math.floor(num / vv.zhqty)
  285 + }
  286 + bz_num_ok = be * vv.zhqty;
  287 + }
  288 +
  289 + for (let j = 0; j < bz_num_ok; j++) {
  290 + let index = no_in_arr.findIndex(i => {
  291 + return vv.goods_id === i.goods_id
  292 + })
  293 + if (index > -1) {
  294 + delete_num++
  295 + no_in_arr.splice(index, 1)
  296 + }
  297 + }
265 } 298 }
266 - aprice += be * aprice;  
267 - }else{  
268 - var vv=zhqty_bz[0];  
269 - var bz_num=be*vv.zhqty; //超量倍增  
270 - var num=vv['num']-vv.zhqty; //购买数量减去超量  
271 - bz_num_ok=bz_num-num;  
272 - if(bz_num_ok <= 0){  
273 - //超量倍增满足,超量倍增就等于倍数  
274 - bz_num_ok=bz_num;  
275 - }else{  
276 - //超量倍增不满足,倍数要减去多出得  
277 - be=be-bz_num_ok;  
278 - bz_num_ok=num; 299 + } else {
  300 + var vv = zhqty_bz[0];
  301 + var bz_num = be * vv.zhqty; //超量倍增
  302 + var num = vv['num'] - vv.zhqty; //购买数量减去超量
  303 + if (num > 0) {
  304 + bz_num_ok = bz_num - num;
  305 + if (bz_num_ok <= 0) {
  306 + //超量倍增满足,超量倍增就等于倍数
  307 + bz_num_ok = bz_num;
  308 + } else {
  309 + //超量倍增不满足,倍数要减去多出得
  310 + // be=be-bz_num_ok;
  311 + if (num % vv.zhqty == 0) {
  312 + be = num / vv.zhqty;
  313 + // bz_num_ok = num;
  314 + } else {
  315 + be = Math.floor(num / vv.zhqty)
  316 + // bz_num_ok = num - (be * vv.zhqty);
  317 + }
  318 + bz_num_ok = be * vv.zhqty;
  319 + }
  320 + // be=vv.num;
  321 + for (let j = 0; j < bz_num_ok; j++) {
  322 + let index = no_in_arr.findIndex(i => {
  323 + return vv.goods_id === i.goods_id
  324 + })
  325 + if (index > -1) {
  326 + delete_num++
  327 + no_in_arr.splice(index, 1)
279 } 328 }
280 - for(let j=0;j<bz_num_ok;j++){  
281 - let index= no_in_arr.findIndex(i=>{  
282 - return vv.goods_id===i.goods_id  
283 - })  
284 - no_in_arr.splice(index,1)  
285 - }  
286 - } 329 + }
  330 + } else {
  331 + zhqty_len = 1;
  332 + }
  333 + }
287 } 334 }
  335 +
288 if (!zhqty_len) { 336 if (!zhqty_len) {
289 aprice += be * act.zhprice; 337 aprice += be * act.zhprice;
290 - let pop_num=be * act.zhbuyqty - bz_num_ok; 338 + let pop_num = be * act.zhbuyqty - delete_num;
291 for (var m = 0; m < pop_num; m++) { 339 for (var m = 0; m < pop_num; m++) {
292 no_in_arr.pop(); 340 no_in_arr.pop();
293 } 341 }
pages/cart/cart2/cart2.js
@@ -1542,7 +1542,7 @@ Page({ @@ -1542,7 +1542,7 @@ Page({
1542 cart_item.shipping_price = 0; 1542 cart_item.shipping_price = 0;
1543 1543
1544 //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- 1544 //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额--
1545 - if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) && out_of_weight > 0) { 1545 + if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) && out_of_weight >= 0) {
1546 //如果有设置不包邮区域的时候 1546 //如果有设置不包邮区域的时候
1547 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { 1547 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1548 if (th.check_by_area(by_qc.region_list)) { 1548 if (th.check_by_area(by_qc.region_list)) {
@@ -2481,8 +2481,8 @@ Page({ @@ -2481,8 +2481,8 @@ Page({
2481 //调用接口判断是不是会员 2481 //调用接口判断是不是会员
2482 await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { 2482 await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
2483 if (res.data.code == 0) { 2483 if (res.data.code == 0) {
2484 - g_goods.guide_name = is_vip.salesman;  
2485 - g_goods.guide_sn = is_vip.salesman_no; 2484 + g_goods.guide_name = res.data.salesman;
  2485 + g_goods.guide_sn = res.data.salesman_no;
2486 } 2486 }
2487 }) 2487 })
2488 } 2488 }
@@ -3037,7 +3037,7 @@ Page({ @@ -3037,7 +3037,7 @@ Page({
3037 var price = 0, th = this; 3037 var price = 0, th = this;
3038 price += parseFloat(o_shipping_price); 3038 price += parseFloat(o_shipping_price);
3039 //如果是包邮 3039 //如果是包邮
3040 - if (freight_free > 0 && o_price >= freight_free && out_of_weight>0) { 3040 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0) {
3041 return 0; 3041 return 0;
3042 } 3042 }
3043 if (user_addr == null) { 3043 if (user_addr == null) {
@@ -3067,8 +3067,13 @@ Page({ @@ -3067,8 +3067,13 @@ Page({
3067 if(out_of_weight < 0){ 3067 if(out_of_weight < 0){
3068 fw_price = parseFloat(item['money']); 3068 fw_price = parseFloat(item['money']);
3069 var out_of_weight = Math.abs(out_of_weight); 3069 var out_of_weight = Math.abs(out_of_weight);
3070 - var n = Math.ceil(out_of_weight / item['second_weight'])  
3071 - fw_price = fw_price + n * parseFloat(item['add_money']); 3070 + // var n = Math.ceil(out_of_weight / item['second_weight'])
  3071 + // fw_price = fw_price + n * parseFloat(item['add_money']);
  3072 + if (out_of_weight > item['first_weight']) {
  3073 + var fw = out_of_weight - item['first_weight'];
  3074 + var n = Math.ceil(fw / item['second_weight'])
  3075 + fw_price = fw_price + n * parseFloat(item['add_money']);
  3076 + }
3072 } 3077 }
3073 //------按件数---------- 3078 //------按件数----------
3074 if (goods_piece > 0 && item['piecemoney']) { 3079 if (goods_piece > 0 && item['piecemoney']) {
pages/cart/cart2/zh_calculate.js
@@ -18,7 +18,7 @@ module.exports = { @@ -18,7 +18,7 @@ module.exports = {
18 let act_item = zh_prom_goods[i]; 18 let act_item = zh_prom_goods[i];
19 let act_goos = act_item.gdlist; 19 let act_goos = act_item.gdlist;
20 let act = act_item.act; 20 let act = act_item.act;
21 - if(!act) continue; 21 + if (!act) continue;
22 22
23 let all_num = 0; //商品数量之和 23 let all_num = 0; //商品数量之和
24 let all_price0 = 0; //商品数量之和 24 let all_price0 = 0; //商品数量之和
@@ -42,7 +42,7 @@ module.exports = { @@ -42,7 +42,7 @@ module.exports = {
42 for (let j in act_goos) { 42 for (let j in act_goos) {
43 let item = act_goos[j]; 43 let item = act_goos[j];
44 let item_j = goods.find(function (ele) { 44 let item_j = goods.find(function (ele) {
45 - console.log('ele',ele); 45 + console.log('ele', ele);
46 return ele.goods_id == act_goos[j].goods_id; 46 return ele.goods_id == act_goos[j].goods_id;
47 }) 47 })
48 //-- 如果有找到的话 -- 48 //-- 如果有找到的话 --
@@ -132,6 +132,7 @@ module.exports = { @@ -132,6 +132,7 @@ module.exports = {
132 } 132 }
133 } 133 }
134 } 134 }
  135 +
135 function sortData(a, b) { 136 function sortData(a, b) {
136 return a.price - b.price 137 return a.price - b.price
137 } 138 }
@@ -144,67 +145,114 @@ module.exports = { @@ -144,67 +145,114 @@ module.exports = {
144 } 145 }
145 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增 146 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
146 if (act.is_bz && no_in_arr.length >= act.zhbuyqty) { 147 if (act.is_bz && no_in_arr.length >= act.zhbuyqty) {
147 - var bz_num_ok=0; //超量倍增是否满足  
148 - var zhqty_len=0; //几个超量倍增  
149 - let be = parseInt(no_in_arr.length / act.zhbuyqty);//看一下是几倍  
150 - if (act.is_bzyh && zhqty_bz.length > 0) {  
151 - if(zhqty_bz.length>1){  
152 - zhqty_len=1;  
153 - let min_bz_num= Math.min.apply(Math, zhqty_bz.map(function(o) {return o['num']}));  
154 - let new_arr=zhqty_bz.filter(ii=>{  
155 - return ii['num']==min_bz_num 148 + var bz_num_ok = 0; //超量倍增是否满足
  149 + var zhqty_len = 0; //几个超量倍增
  150 + var delete_num=0;
  151 + let be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍
  152 + if (act.is_bzyh && zhqty_bz.length > 0) {
  153 + if (zhqty_bz.length > 1) {
  154 + let zhqty_bz_arr = [];
  155 + let zhqty_bz_flag = zhqty_bz.every((item1, i) => {
  156 + var bz_num = be * item1['zhqty']; //超量倍增
  157 + var num = item1['num'] - item1['zhqty']; //购买数量减去超量
  158 + if (bz_num > num) {
  159 + zhqty_bz_arr.push(item1);
  160 + zhqty_bz.splice(i, 1)
  161 + }
  162 + return bz_num <= num;
156 }) 163 })
157 - // var vv=new_arr[0];  
158 - var bz_num=be*new_arr[0].zhqty; //超量倍增  
159 - var num=min_bz_num-new_arr[0].zhqty; //购买数量减去超量  
160 - bz_num_ok=bz_num-num;  
161 - if(bz_num_ok <= 0){  
162 - //超量倍增满足,超量倍增就等于倍数  
163 - bz_num_ok=bz_num;  
164 - }else{  
165 - //超量倍增不满足,倍数要减去多出得  
166 - be=be-bz_num_ok;  
167 - bz_num_ok=num;  
168 - }  
169 - for(let i=0;i<zhqty_bz.length;i++){  
170 - var vv=zhqty_bz[i];  
171 - for(let j=0;j<bz_num_ok;j++){  
172 - let index= no_in_arr.findIndex(i=>{  
173 - return vv.goods_id===i.goods_id  
174 - })  
175 - no_in_arr.splice(index,1)  
176 - } 164 + if (zhqty_bz_flag) {
  165 + for (let i = 0; i < zhqty_bz.length; i++) {
  166 + var vv = zhqty_bz[i];
  167 + for (let j = 0; j < be * vv['zhqty']; j++) {
  168 + let index = no_in_arr.findIndex(i => {
  169 + return vv.goods_id === i.goods_id
  170 + })
  171 + if (index > -1) {
  172 + delete_num++
  173 + no_in_arr.splice(index, 1)
  174 + }
  175 + }
  176 + }
  177 + } else {
  178 + let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
  179 + return o['num']
  180 + }));
  181 + let new_arr = zhqty_bz_arr.filter(ii => {
  182 + return ii['num'] == min_bz_num
  183 + })
  184 + var vv = new_arr[0];
  185 + var bz_num = be * new_arr[0].zhqty; //超量倍增
  186 + var num = min_bz_num - new_arr[0].zhqty; //购买数量减去超量
  187 + bz_num_ok = bz_num - num;
  188 + if (bz_num_ok <= 0) {
  189 + //超量倍增满足,超量倍增就等于倍数
  190 + bz_num_ok = bz_num;
  191 + } else {
  192 + //超量倍增不满足,倍数要减去多出得
  193 + // be=be-bz_num_ok;
  194 + if (num % vv.zhqty == 0) {
  195 + be = num / vv.zhqty;
  196 + } else {
  197 + be = Math.floor(num / vv.zhqty)
  198 + }
  199 + bz_num_ok = be * vv.zhqty;
  200 + }
  201 +
  202 + for (let j = 0; j < bz_num_ok; j++) {
  203 + let index = no_in_arr.findIndex(i => {
  204 + return vv.goods_id === i.goods_id
  205 + })
  206 + if (index > -1) {
  207 + delete_num++
  208 + no_in_arr.splice(index, 1)
  209 + }
  210 + }
177 } 211 }
178 - aprice += be * aprice;  
179 - }else{  
180 - var vv=zhqty_bz[0];  
181 - var bz_num=be*vv.zhqty; //超量倍增  
182 - var num=vv['num']-vv.zhqty; //购买数量减去超量  
183 - bz_num_ok=bz_num-num;  
184 - if(bz_num_ok <= 0){ 212 + } else {
  213 + var vv = zhqty_bz[0];
  214 + var bz_num = be * vv.zhqty; //超量倍增
  215 + var num = vv['num'] - vv.zhqty; //购买数量减去超量
  216 + if (num > 0) {
  217 + bz_num_ok = bz_num - num;
  218 + if (bz_num_ok <= 0) {
185 //超量倍增满足,超量倍增就等于倍数 219 //超量倍增满足,超量倍增就等于倍数
186 - bz_num_ok=bz_num;  
187 - }else{ 220 + bz_num_ok = bz_num;
  221 + } else {
188 //超量倍增不满足,倍数要减去多出得 222 //超量倍增不满足,倍数要减去多出得
189 - be=be-bz_num_ok;  
190 - bz_num_ok=num; 223 + // be=be-bz_num_ok;
  224 + if (num % vv.zhqty == 0) {
  225 + be = num / vv.zhqty;
  226 + // bz_num_ok = num;
  227 + } else {
  228 + be = Math.floor(num / vv.zhqty)
  229 + // bz_num_ok = num - (be * vv.zhqty);
  230 + }
  231 + bz_num_ok = be * vv.zhqty;
  232 + }
  233 + // be=vv.num;
  234 + for (let j = 0; j < bz_num_ok; j++) {
  235 + let index = no_in_arr.findIndex(i => {
  236 + return vv.goods_id === i.goods_id
  237 + })
  238 + if(index > -1){
  239 + delete_num++
  240 + no_in_arr.splice(index, 1)
  241 + }
191 } 242 }
192 - for(let j=0;j<bz_num_ok;j++){  
193 - let index= no_in_arr.findIndex(i=>{  
194 - return vv.goods_id===i.goods_id  
195 - })  
196 - no_in_arr.splice(index,1)  
197 - }  
198 - }  
199 - }  
200 - if (!zhqty_len) { 243 + } else {
  244 + zhqty_len = 1;
  245 + }
  246 + }
  247 + }
  248 + if (!zhqty_len) {
201 aprice += be * act.zhprice; 249 aprice += be * act.zhprice;
202 - let pop_num=be * act.zhbuyqty - bz_num_ok;  
203 - for (var m = 0; m < pop_num; m++) {  
204 - no_in_arr.pop();  
205 - }  
206 - }  
207 - 250 + let pop_num = be * act.zhbuyqty - delete_num;
  251 + for (var m = 0; m < pop_num; m++) {
  252 + no_in_arr.pop();
  253 + }
  254 + }
  255 +
208 } 256 }
209 257
210 let goods_map = {}; 258 let goods_map = {};
pages/giftpack/birthdaygift/birthdaygift.wxss
@@ -275,7 +275,7 @@ @@ -275,7 +275,7 @@
275 } 275 }
276 .button { 276 .button {
277 margin: 0 30rpx; 277 margin: 0 30rpx;
278 - background:var(--bg-color); 278 + background:#61d3dd;
279 border-radius: 50rpx; 279 border-radius: 50rpx;
280 line-height: 80rpx; 280 line-height: 80rpx;
281 height: 80rpx; 281 height: 80rpx;
@@ -301,14 +301,14 @@ @@ -301,14 +301,14 @@
301 text-align: center; 301 text-align: center;
302 -webkit-box-pack: center; 302 -webkit-box-pack: center;
303 -webkit-justify-content: center; 303 -webkit-justify-content: center;
304 - justify-content: center; 304 + justify-content: center;
305 position: fixed; 305 position: fixed;
306 bottom: 0; 306 bottom: 0;
307 left: 0; 307 left: 0;
308 width: 100%; 308 width: 100%;
309 } 309 }
310 .foot_button_buy { 310 .foot_button_buy {
311 - background:var(--color); 311 + background:#61d3dd;
312 color: #FFFFFF; 312 color: #FFFFFF;
313 width: 400rpx; 313 width: 400rpx;
314 height: 70rpx; 314 height: 70rpx;
pages/giftpack/evaluategift/evaluategift.js
@@ -31,6 +31,7 @@ Page({ @@ -31,6 +31,7 @@ Page({
31 orderNumber: "", //订单号 31 orderNumber: "", //订单号
32 orderGoodsId: "", //商品id 32 orderGoodsId: "", //商品id
33 orderType:1, 33 orderType:1,
  34 + isdg:0,
34 35
35 weappurltitle:"进入商城购物", 36 weappurltitle:"进入商城购物",
36 weappurl:"/pages/index/index/index", 37 weappurl:"/pages/index/index/index",
@@ -52,7 +53,8 @@ Page({ @@ -52,7 +53,8 @@ Page({
52 "orderNumber": th.data.orderNumber, 53 "orderNumber": th.data.orderNumber,
53 "orderType": th.data.orderType, 54 "orderType": th.data.orderType,
54 "orderGoodsId": th.data.orderGoodsId, 55 "orderGoodsId": th.data.orderGoodsId,
55 - "gifbagid": th.data.giftBagId 56 + "gifbagid": th.data.giftBagId,
  57 + "isdg": th.data.isdg
56 } 58 }
57 }).then(res => { 59 }).then(res => {
58 if (res.data.code == 0) { 60 if (res.data.code == 0) {
@@ -133,12 +135,18 @@ Page({ @@ -133,12 +135,18 @@ Page({
133 }, 135 },
134 onLoad: function(options) { 136 onLoad: function(options) {
135 137
  138 + var getisdg=0;
  139 + if (options.isdg)
  140 + {
  141 + getisdg=options.isdg;
  142 + }
136 var th = this; 143 var th = this;
137 th.setData({ 144 th.setData({
138 getActId: options.actId, 145 getActId: options.actId,
139 orderNumber: options.orderNumber, 146 orderNumber: options.orderNumber,
140 orderGoodsId: options.orderGoodsId, 147 orderGoodsId: options.orderGoodsId,
141 - giftBagId: options.giftBagId 148 + giftBagId: options.giftBagId,
  149 + isdg: getisdg
142 }) 150 })
143 151
144 var orderType = options.orderType; 152 var orderType = options.orderType;
pages/goods/goodsInfo/buy_integral.wxml
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 17
18 18
19 <view class="flex"> 19 <view class="flex">
20 - <view class="spec-goods-stock">已售:{{prom_act.buy_num}}</view> 20 + <view class="spec-goods-stock">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
21 <view class="spec-goods-stock">可售:{{prom_act.limitqty-prom_act.buy_num}}</view> 21 <view class="spec-goods-stock">可售:{{prom_act.limitqty-prom_act.buy_num}}</view>
22 </view> 22 </view>
23 23
pages/goods/goodsInfo/goodsInfo.js
@@ -706,6 +706,7 @@ Page({ @@ -706,6 +706,7 @@ Page({
706 //---展示--- 706 //---展示---
707 onShow: function () { 707 onShow: function () {
708 var goods_list = null, th = this, that = this; 708 var goods_list = null, th = this, that = this;
  709 + this.data.is_go_to_team_show=0;
709 var show_prew_img = this.data.show_prew_img 710 var show_prew_img = this.data.show_prew_img
710 if (show_prew_img) { 711 if (show_prew_img) {
711 show_prew_img = 0; 712 show_prew_img = 0;
@@ -3439,7 +3440,7 @@ Page({ @@ -3439,7 +3440,7 @@ Page({
3439 return false 3440 return false
3440 } 3441 }
3441 3442
3442 - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ 3443 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2",{
3443 data:{ 3444 data:{
3444 store_id: os.stoid, 3445 store_id: os.stoid,
3445 is_end: 0, 3446 is_end: 0,
pages/goods/goodsInfo/goodsInfo.wxml
@@ -276,7 +276,7 @@ @@ -276,7 +276,7 @@
276 <view class="goods-name elli">{{data.goods_name}}</view> 276 <view class="goods-name elli">{{data.goods_name}}</view>
277 </view> 277 </view>
278 <view class="goods-num"> 278 <view class="goods-num">
279 - <view class="sales">销量:{{prom_act.buy_num}}件</view> 279 + <view class="sales">销量:{{prom_act.buy_num+prom_act.virtual}}件</view>
280 <view class="stock"> 280 <view class="stock">
281 折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折 281 折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折
282 </view> 282 </view>
pages/goods/goodsInfo/goodsInfo.wxss
@@ -3930,3 +3930,7 @@ button.custom-service::after { @@ -3930,3 +3930,7 @@ button.custom-service::after {
3930 overflow: hidden; 3930 overflow: hidden;
3931 flex-shrink: 0; 3931 flex-shrink: 0;
3932 } 3932 }
  3933 +.avatar-container image {
  3934 + width: 100%;
  3935 + height: 100%;
  3936 +}
pages/team/team_show/team_show.js
@@ -433,11 +433,36 @@ Page({ @@ -433,11 +433,36 @@ Page({
433 //获取活动表的信息根据活动team_id 433 //获取活动表的信息根据活动team_id
434 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, { 434 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, {
435 data: {} 435 data: {}
436 - }).then(res => { 436 + }).then(async res => {
  437 + var flag=null;
437 if (res.data.code == 0) { 438 if (res.data.code == 0) {
438 teamlist = res.data.data; 439 teamlist = res.data.data;
439 goods_id = res.data.data.goods_id; 440 goods_id = res.data.data.goods_id;
440 441
  442 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{
  443 + data:{
  444 + store_id: os.stoid,
  445 + is_end: 0,
  446 + is_show: 1,
  447 + user_id: getApp().globalData.user_id,
  448 + pageSize:1000
  449 + }
  450 + }).then(res=>{
  451 + let pd_list=res.data.data.pageData;
  452 + if(res.data.code==0 && pd_list.length>0){
  453 + flag =pd_list.some(pd=>{
  454 + return pd.goods_id==teamlist['goods_id']
  455 + })
  456 + }
  457 + })
  458 + if(!flag){
  459 + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000});
  460 + // setTimeout(function () {
  461 + ut.wx_back();
  462 + // }, 2000)
  463 + return false;
  464 + }
  465 +
441 //----------查看阶梯团------------ 466 //----------查看阶梯团------------
442 if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) { 467 if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) {
443 var ct_rylist = JSON.parse(teamlist.ct_rylist); 468 var ct_rylist = JSON.parse(teamlist.ct_rylist);
pages/team/team_success/team_success.js
@@ -47,9 +47,8 @@ Page({ @@ -47,9 +47,8 @@ Page({
47 }, 47 },
48 onLoad: function (t) { 48 onLoad: function (t) {
49 wx.setNavigationBarTitle({ title: "拼团订单",}) 49 wx.setNavigationBarTitle({ title: "拼团订单",})
50 -  
51 var that=this; 50 var that=this;
52 - var th=this; 51 + var th=this;
53 //获取用户设备信息,屏幕宽度 52 //获取用户设备信息,屏幕宽度
54 wx.getSystemInfo({ 53 wx.getSystemInfo({
55 success: res => { 54 success: res => {
@@ -184,14 +183,15 @@ Page({ @@ -184,14 +183,15 @@ Page({
184 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { 183 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, {
185 data: { } 184 data: { }
186 }).then(res => { 185 }).then(res => {
187 - if (res.data.code==0){  
188 - teamlist = res.data.data;  
189 - this.setData({teamlist: teamlist});  
190 - //获取当前时间,并且判断剩余时间  
191 - var nt = ut.gettimestamp();  
192 - teamlist.status = 0; 186 + if(res.data.code==0){
  187 + teamlist=res.data.data;
  188 + this.setData({
  189 + teamlist:teamlist
  190 + });
  191 + var nt =ut.gettimestamp();
  192 + teamlist.status=0;
  193 +
193 if (nt >= teamlist.start_time) teamlist.status = 1; 194 if (nt >= teamlist.start_time) teamlist.status = 1;
194 -  
195 goods_id = res.data.data.goods_id; 195 goods_id = res.data.data.goods_id;
196 id = res.data.data.id; 196 id = res.data.data.id;
197 share_img = ee.data.imageurl + res.data.data.share_imgurl; 197 share_img = ee.data.imageurl + res.data.data.share_imgurl;
@@ -208,25 +208,20 @@ Page({ @@ -208,25 +208,20 @@ Page({
208 }) 208 })
209 max_num=max; 209 max_num=max;
210 min_price=pri; 210 min_price=pri;
211 -  
212 } 211 }
213 212
214 - 213 + }
215 //获取商品信息 214 //获取商品信息
216 getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { 215 getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
217 }).then(res => { 216 }).then(res => {
218 //商品地址 217 //商品地址
219 original_img = ee.data.imageurl+ res.data.data.original_img, 218 original_img = ee.data.imageurl+ res.data.data.original_img,
220 goods = res.data.data 219 goods = res.data.data
221 -  
222 ee.setData({goods: goods,image: original_img,}) 220 ee.setData({goods: goods,image: original_img,})
223 -  
224 }) 221 })
225 222
226 - }  
227 }) 223 })
228 224
229 -  
230 //只装5个 225 //只装5个
231 var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; 226 var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num;
232 if(max_num){ 227 if(max_num){
@@ -833,7 +828,7 @@ Page({ @@ -833,7 +828,7 @@ Page({
833 if(th.data.teamlist.share_title){ 828 if(th.data.teamlist.share_title){
834 share_title=th.data.teamlist.share_title; 829 share_title=th.data.teamlist.share_title;
835 } 830 }
836 - 831 + console.log(url,3000);
837 return { 832 return {
838 path:url, 833 path:url,
839 title: share_title, 834 title: share_title,
pages/user/my_service/beauty_deta.js
@@ -238,6 +238,7 @@ Page({ @@ -238,6 +238,7 @@ Page({
238 238
239 var itemId = th.data.itemId; //服务id 239 var itemId = th.data.itemId; //服务id
240 var projectId = th.data.projectId; //项目id 240 var projectId = th.data.projectId; //项目id
  241 + var number = th.data.number; //预约单号
241 var url = "/api/weshop/marketing/reservation/staff/seven/time/listnew"; //接口地址 242 var url = "/api/weshop/marketing/reservation/staff/seven/time/listnew"; //接口地址
242 getApp().request.promiseGet(url, { 243 getApp().request.promiseGet(url, {
243 data: { 244 data: {
@@ -245,7 +246,8 @@ Page({ @@ -245,7 +246,8 @@ Page({
245 beauticianId: beautician_id, 246 beauticianId: beautician_id,
246 serviceId: itemId, 247 serviceId: itemId,
247 storeId: a.stoid, 248 storeId: a.stoid,
248 - storageId:storageId 249 + storageId:storageId,
  250 + number: number
249 } 251 }
250 }).then(res => { 252 }).then(res => {
251 if (res.data.code == 0) { 253 if (res.data.code == 0) {
@@ -291,7 +293,7 @@ Page({ @@ -291,7 +293,7 @@ Page({
291 var date_id = th.data.date_id; //日期下标 293 var date_id = th.data.date_id; //日期下标
292 var SeekTime = th.data.aweeks[date_id].time; 294 var SeekTime = th.data.aweeks[date_id].time;
293 var val = th.data.aweeks[date_id].val; 295 var val = th.data.aweeks[date_id].val;
294 - 296 + var number = th.data.number; //预约单号
295 var url = "/api/weshop/marketing/reservation/staff/time/listnew"; 297 var url = "/api/weshop/marketing/reservation/staff/time/listnew";
296 getApp().request.promiseGet(url, { 298 getApp().request.promiseGet(url, {
297 data: { 299 data: {
@@ -301,6 +303,7 @@ Page({ @@ -301,6 +303,7 @@ Page({
301 serviceId: th.data.itemId, 303 serviceId: th.data.itemId,
302 seekTime: SeekTime, 304 seekTime: SeekTime,
303 storeId: a.stoid, 305 storeId: a.stoid,
  306 + number:number,
304 } 307 }
305 }).then(res => { 308 }).then(res => {
306 if (res.data.code == 0) { 309 if (res.data.code == 0) {