Commit e596c6942627b29c8fc2f0c72c895b1adbaeabf7

Authored by 后端研发-苏泰源
2 parents 00cc3dc3 a57894a1

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

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/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
@@ -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
@@ -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: 20rpx 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
@@ -1966,6 +1966,7 @@ Page({ @@ -1966,6 +1966,7 @@ Page({
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; //超量倍增是否满足 1968 var bz_num_ok=0; //超量倍增是否满足
  1969 + var delete_num=0;
1969 var zhqty_len=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(this.data.act.is_bzyh && zhqty_bz.length > 0 ){
@@ -1975,62 +1976,83 @@ Page({ @@ -1975,62 +1976,83 @@ Page({
1975 let new_arr=zhqty_bz.filter(ii=>{ 1976 let new_arr=zhqty_bz.filter(ii=>{
1976 return ii['num']==min_bz_num 1977 return ii['num']==min_bz_num
1977 }) 1978 })
1978 - // var vv=new_arr[0]; 1979 + var vv=new_arr[0];
  1980 + // be=new_arr[0].zhqty;
1979 var bz_num=be*new_arr[0].zhqty; //超量倍增 1981 var bz_num=be*new_arr[0].zhqty; //超量倍增
1980 var num=min_bz_num-new_arr[0].zhqty; //购买数量减去超量 1982 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 - }  
1998 - }  
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; //购买数量减去超量 1983 + // if(num > 0){
2004 bz_num_ok=bz_num-num; 1984 bz_num_ok=bz_num-num;
2005 if(bz_num_ok <= 0){ 1985 if(bz_num_ok <= 0){
2006 //超量倍增满足,超量倍增就等于倍数 1986 //超量倍增满足,超量倍增就等于倍数
2007 bz_num_ok=bz_num; 1987 bz_num_ok=bz_num;
2008 }else{ 1988 }else{
2009 //超量倍增不满足,倍数要减去多出得 1989 //超量倍增不满足,倍数要减去多出得
2010 - be=be-bz_num_ok;  
2011 - bz_num_ok=num; 1990 + // be=be-bz_num_ok;
  1991 + if(num % vv.zhqty == 0){
  1992 + be=num/vv.zhqty;
  1993 + bz_num_ok=num;
  1994 + }else{
  1995 + be = Math.floor(num/vv.zhqty)
  1996 + bz_num_ok=num - (be * vv.zhqty);
  1997 + }
  1998 + }
  1999 + for(let i=0;i<zhqty_bz.length;i++){
  2000 + var vv=zhqty_bz[i];
  2001 + for(let j=0;j<bz_num_ok;j++){
  2002 + let index= no_in_arr.findIndex(i=>{
  2003 + return vv.goods_id===i.goods_id
  2004 + })
  2005 + if(index > -1){
  2006 + delete_num++
  2007 + no_in_arr.splice(index,1)
  2008 + }
  2009 + }
  2010 + }
  2011 + // }
  2012 + aprice += be * aprice;
  2013 + }else{
  2014 + var vv=zhqty_bz[0];
  2015 + var bz_num=be*vv.zhqty; //超量倍增
  2016 + var num=vv['num']-vv.zhqty; //购买数量减去超量
  2017 + if(num > 0){
  2018 + bz_num_ok=bz_num-num;
  2019 + if(bz_num_ok <= 0){
  2020 + //超量倍增满足,超量倍增就等于倍数
  2021 + bz_num_ok=bz_num;
  2022 + }else{
  2023 + //超量倍增不满足,倍数要减去多出得
  2024 + // be=be-bz_num_ok;
  2025 + if(num % vv.zhqty == 0){
  2026 + be=num/vv.zhqty;
  2027 + bz_num_ok=num;
  2028 + }else{
  2029 + be = Math.floor(num/vv.zhqty)
  2030 + bz_num_ok=num - (be * vv.zhqty);
  2031 + }
  2032 + }
  2033 + // be=vv.num;
  2034 + for(let j=0;j<bz_num_ok;j++){
  2035 + let index= no_in_arr.findIndex(i=>{
  2036 + return vv.goods_id===i.goods_id
  2037 + })
  2038 + if(index > -1){
  2039 + delete_num++
  2040 + no_in_arr.splice(index,1)
  2041 + }
  2042 + }
  2043 + }else{
  2044 + zhqty_len=1;
2012 } 2045 }
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 } 2046 }
2020 } 2047 }
2021 if(!zhqty_len){ 2048 if(!zhqty_len){
2022 //多个超量就不用pop了 2049 //多个超量就不用pop了
2023 aprice += be * aprice; 2050 aprice += be * aprice;
2024 - let pop_num=be * this.data.act.zhbuyqty - bz_num_ok; 2051 + let pop_num=be * this.data.act.zhbuyqty - delete_num;
2025 for (var m = 0; m < pop_num; m++) { 2052 for (var m = 0; m < pop_num; m++) {
2026 no_in_arr.pop(); 2053 no_in_arr.pop();
2027 } 2054 }
2028 } 2055 }
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 } 2056 }
2035 2057
2036 //算一下剩余的钱 2058 //算一下剩余的钱
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) {
@@ -68,13 +65,11 @@ Page({ @@ -68,13 +65,11 @@ Page({
68 }, 65 },
69 66
70 onShow: function (t) { 67 onShow: function (t) {
71 -  
72 this.data.is_timer = 1; 68 this.data.is_timer = 1;
73 this.data.currentPage = 1; 69 this.data.currentPage = 1;
74 this.data.ismore = 1; 70 this.data.ismore = 1;
75 var th = this; 71 var th = this;
76 var userInfo = wx.getStorageSync('userinfo'); 72 var userInfo = wx.getStorageSync('userinfo');
77 - console.log(userInfo,30000);  
78 if (userInfo && th.data.goodlist.length==0) { 73 if (userInfo && th.data.goodlist.length==0) {
79 //调用列表 74 //调用列表
80 this.requestSalelist(userInfo.user_id); 75 this.requestSalelist(userInfo.user_id);
@@ -139,7 +134,7 @@ Page({ @@ -139,7 +134,7 @@ Page({
139 var e = this, 134 var e = this,
140 th = e, 135 th = e,
141 i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; 136 i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage;
142 - var plist = null, 137 + var plist = [],
143 alllist = th.data.goodlist; 138 alllist = th.data.goodlist;
144 if (!alllist) alllist = []; 139 if (!alllist) alllist = [];
145 await getApp().request.promiseGet(i, { 140 await getApp().request.promiseGet(i, {
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.ismore = 1;
  77 + this.data.is_timer = 1;
  78 + this.data.currentPage = 1;
  79 + var th = this;
  80 + //设置全局定时器
  81 + th.data.timer = setInterval(function () {
  82 + th.countDown();
  83 + }, 1000);
  84 + },
  85 + onHide: function () {
  86 + //--清理定时器--
  87 + clearInterval(this.data.timer);
  88 + this.setData({
  89 + isshow: 0
  90 + });
  91 + },
  92 + //---小于10的格式化函数----
  93 + timeFormat(param) {
  94 + return param < 10 ? '0' + param : param;
  95 + },
86 96
87 //----倒计时函数----- 97 //----倒计时函数-----
88 - countDown() {  
89 - if(!this.data.is_timer) return false;  
90 - var th=this; 98 + countDown() {
  99 + if (!this.data.is_timer) return false;
  100 + var th = this;
91 // 获取当前时间,同时得到活动结束时间数组 101 // 获取当前时间,同时得到活动结束时间数组
92 - let newTime =ut.gettimestamp(); 102 + let newTime = ut.gettimestamp();
93 var endTimeList = this.data.goodlist; 103 var endTimeList = this.data.goodlist;
94 - if(endTimeList==null) return null 104 + if (endTimeList == null) return null
95 // 对结束时间进行处理渲染到页面 105 // 对结束时间进行处理渲染到页面
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}); 106 + for (var i = 0; i < endTimeList.length; i++) {
  107 + var o = endTimeList[i];
  108 + var endTime = o.end_time;
  109 + if (th.data.type == 0) endTime = o.start_time;
  110 + let obj = null;
  111 + // 如果活动未结束,对时间进行处理
  112 + if (endTime - newTime > 0) {
  113 + let time = (endTime - newTime);
  114 + // 获取天、时、分、秒
  115 + let day = parseInt(time / (60 * 60 * 24));
  116 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  117 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  118 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  119 + obj = {
  120 + day: this.timeFormat(day),
  121 + hou: this.timeFormat(hou),
  122 + min: this.timeFormat(min),
  123 + sec: this.timeFormat(sec),
  124 + hide: 1
118 } 125 }
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; 126 + } else {
  127 + //活动已结束,全部设置为'00'
  128 + obj = {
  129 + day: '00',
  130 + hou: '00',
  131 + min: '00',
  132 + sec: '00'
  133 + }
  134 + }
  135 + var txt = "goodlist[" + i + "].djs";
  136 + th.setData({
  137 + [txt]: obj
  138 + });
  139 + }
  140 + },
135 141
136 - }); 142 + async requestSalelist() {
  143 + //--没有更多就不调用--
  144 + if (!this.data.ismore) return false;
  145 + var e = this,
  146 + th = e,
  147 + i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;
  148 + var plist = [],
  149 + alllist = th.data.goodlist;
  150 + if (!alllist) alllist = [];
  151 + var user_id = getApp().globalData.user_id;
  152 + if (!user_id) user_id = user_id;
  153 + var req = {
  154 + store_id: os.stoid,
  155 + timetype: th.data.type,
  156 + is_end: 0,
  157 + is_show: 1,
  158 + user_id: user_id
  159 + };
137 160
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 - } 161 + await getApp().request.promiseGet(i, {
  162 + isShowLoading: 1,
  163 + data: req
  164 + }).then(res => {
  165 + if (ut.ajax_ok(res)) plist = res.data.data.pageData;
151 166
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){ 167 + });
199 168
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 - } 169 + if (!plist || plist.length <= 0) {
206 170
207 - console.log("11"+pagePath);  
208 - return {  
209 - title: "限时秒杀",  
210 - path:pagePath, 171 + getApp().showWarning("没有更多数据");
  172 + th.data.ismore = 0;
  173 + if (e.data.currentPage == 1 && this.data.type == 1) {
  174 + setTimeout(function () {
  175 + th.data.ismore = 1;
  176 + th.setData({
  177 + type: 0
  178 + });
  179 + th.requestSalelist();
  180 + }, 1000);
  181 + }
  182 + return false;
  183 + }
  184 +
  185 + //--循环读取接口---
  186 + for (var i = 0; i < plist.length; i++) {
  187 +
  188 + if (plist[i].user_price) plist[i].price = plist[i].user_price;
  189 + var prom_id = plist[i].id;
  190 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  191 + os.stoid + "/1/" + prom_id, {}
  192 + ).then(res => {
  193 + if (res.data.code == 0) {
  194 + plist[i].status = 1;
  195 + if (res.data.data <= 0) plist[i].status = 3;
211 } 196 }
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); 197 + })
  198 + alllist.push(plist[i]);
  199 + }
  200 + e.data.currentPage++;
  201 + console.log("秒杀商品列表", alllist);
  202 + th.setData({
  203 + goodlist: alllist,
  204 + isshow: 1
  205 + });
  206 +
  207 +
  208 +
  209 + },
  210 + onPullDownRefresh: function () {
  211 + this.reloadGoodList();
  212 + },
  213 + reloadGoodList: function () {
  214 + this.data.goodlist = [], this.data.currentPage = 1, this.requestSalelist();
  215 + },
  216 +
  217 + onReachBottom: function () {
  218 + this.requestSalelist();
  219 + },
  220 +
  221 + //点击tab事件
  222 + tip: function (e) {
  223 + var a = e.currentTarget.dataset.ty,
  224 + th = this;
  225 + th.data.ismore = 1;
  226 + this.setData({
  227 + type: a,
  228 + goodlist: null
  229 + });
  230 + this.reloadGoodList();
  231 + },
  232 +
  233 +
  234 + //---------分享配置--------
  235 + onShareAppMessage: function (e) {
  236 + var curPage = this;
  237 + var pagePath = curPage.route; //当前页面url
  238 + if (pagePath.indexOf('/') != 0) {
  239 + pagePath = '/' + pagePath;
  240 + }
  241 + if (getApp().globalData.user_id) {
  242 +
  243 + if (pagePath.indexOf("?") > 0) {
  244 + pagePath += "&first_leader=" + getApp().globalData.user_id;
  245 + } else {
  246 + pagePath += "?first_leader=" + getApp().globalData.user_id;
251 } 247 }
252 - }, 248 + }
  249 +
  250 + console.log("11" + pagePath);
  251 + return {
  252 + title: "限时秒杀",
  253 + path: pagePath,
  254 + }
  255 + },
  256 +
  257 + //图片失败,默认图片
  258 + bind_bnerr2: function (e) {
  259 + var _errImg = e.target.dataset.errorimg;
  260 + var val = e.target.dataset.val;
  261 + if (val != undefined && val != null && val != 'null') {
  262 + var _errObj = {};
  263 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  264 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  265 + }
  266 + },
  267 +
  268 + onShareTimeline() {
  269 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  270 + if (!store_name)
  271 + store_name = getApp().globalData.setting.appName;
  272 + return {
  273 + title: '秒杀活动-' + store_name,
  274 + }
  275 + },
  276 +
  277 + imageLoad: function (e) {
  278 + var imgwidth = e.detail.width;
  279 + var imgheight = e.detail.height;
  280 + //宽高比
  281 + var ratio = imgwidth / imgheight;
  282 + //计算的高度值
  283 + var viewHeight = 750 / ratio;
  284 + var hei = this.data.max_sw_height;
253 285
254 -}); 286 + if (hei < viewHeight) {
  287 + this.setData({
  288 + max_sw_height: viewHeight
  289 + });
  290 + }
  291 + },
  292 + go_url(e) {
  293 + let url = e.currentTarget.dataset.url;
  294 + if (url) {
  295 + getApp().goto(url);
  296 + }
  297 + },
  298 +});
255 \ No newline at end of file 299 \ 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,92 @@ module.exports = { @@ -232,62 +232,92 @@ 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 + zhqty_len = 1;
  242 + let min_bz_num = Math.min.apply(Math, zhqty_bz.map(function (o) {
  243 + return o['num']
  244 + }));
  245 + let new_arr = zhqty_bz.filter(ii => {
  246 + return ii['num'] == min_bz_num
244 }) 247 })
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){  
250 - //超量倍增满足,超量倍增就等于倍数  
251 - bz_num_ok=bz_num;  
252 - }else{  
253 - //超量倍增不满足,倍数要减去多出得  
254 - be=be-bz_num_ok;  
255 - bz_num_ok=num; 248 + var vv = new_arr[0];
  249 + // be=new_arr[0].zhqty;
  250 + var bz_num = be * new_arr[0].zhqty; //超量倍增
  251 + var num = min_bz_num - new_arr[0].zhqty; //购买数量减去超量
  252 + // if(num > 0){
  253 + bz_num_ok = bz_num - num;
  254 + if (bz_num_ok <= 0) {
  255 + //超量倍增满足,超量倍增就等于倍数
  256 + bz_num_ok = bz_num;
  257 + } else {
  258 + //超量倍增不满足,倍数要减去多出得
  259 + // be=be-bz_num_ok;
  260 + if (num % vv.zhqty == 0) {
  261 + be = num / vv.zhqty;
  262 + bz_num_ok = num;
  263 + } else {
  264 + be = Math.floor(num / vv.zhqty)
  265 + bz_num_ok = num - (be * vv.zhqty);
  266 + }
256 } 267 }
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 - } 268 + for (let i = 0; i < zhqty_bz.length; i++) {
  269 + var vv = zhqty_bz[i];
  270 + for (let j = 0; j < bz_num_ok; j++) {
  271 + let index = no_in_arr.findIndex(i => {
  272 + return vv.goods_id === i.goods_id
  273 + })
  274 + if (index > -1) {
  275 + delete_num++
  276 + no_in_arr.splice(index, 1)
  277 + }
  278 + }
265 } 279 }
  280 + // }
266 aprice += be * aprice; 281 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; 282 + } else {
  283 + var vv = zhqty_bz[0];
  284 + var bz_num = be * vv.zhqty; //超量倍增
  285 + var num = vv['num'] - vv.zhqty; //购买数量减去超量
  286 + if (num > 0) {
  287 + bz_num_ok = bz_num - num;
  288 + if (bz_num_ok <= 0) {
  289 + //超量倍增满足,超量倍增就等于倍数
  290 + bz_num_ok = bz_num;
  291 + } else {
  292 + //超量倍增不满足,倍数要减去多出得
  293 + // be=be-bz_num_ok;
  294 + if (num % vv.zhqty == 0) {
  295 + be = num / vv.zhqty;
  296 + bz_num_ok = num;
  297 + } else {
  298 + be = Math.floor(num / vv.zhqty)
  299 + bz_num_ok = num - (be * vv.zhqty);
  300 + }
  301 + }
  302 + // be=vv.num;
  303 + for (let j = 0; j < bz_num_ok; j++) {
  304 + let index = no_in_arr.findIndex(i => {
  305 + return vv.goods_id === i.goods_id
  306 + })
  307 + if (index > -1) {
  308 + delete_num++
  309 + no_in_arr.splice(index, 1)
279 } 310 }
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 - } 311 + }
  312 + } else {
  313 + zhqty_len = 1;
  314 + }
  315 + }
287 } 316 }
  317 +
288 if (!zhqty_len) { 318 if (!zhqty_len) {
289 aprice += be * act.zhprice; 319 aprice += be * act.zhprice;
290 - let pop_num=be * act.zhbuyqty - bz_num_ok; 320 + let pop_num = be * act.zhbuyqty - delete_num;
291 for (var m = 0; m < pop_num; m++) { 321 for (var m = 0; m < pop_num; m++) {
292 no_in_arr.pop(); 322 no_in_arr.pop();
293 } 323 }
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,97 @@ module.exports = { @@ -144,67 +145,97 @@ 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 + zhqty_len = 1;
  155 + let min_bz_num = Math.min.apply(Math, zhqty_bz.map(function (o) {
  156 + return o['num']
  157 + }));
  158 + let new_arr = zhqty_bz.filter(ii => {
  159 + return ii['num'] == min_bz_num
156 }) 160 })
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){ 161 + var vv = new_arr[0];
  162 + // be=new_arr[0].zhqty;
  163 + var bz_num = be * new_arr[0].zhqty; //超量倍增
  164 + var num = min_bz_num - new_arr[0].zhqty; //购买数量减去超量
  165 + // if(num > 0){
  166 + bz_num_ok = bz_num - num;
  167 + if (bz_num_ok <= 0) {
162 //超量倍增满足,超量倍增就等于倍数 168 //超量倍增满足,超量倍增就等于倍数
163 - bz_num_ok=bz_num;  
164 - }else{ 169 + bz_num_ok = bz_num;
  170 + } else {
165 //超量倍增不满足,倍数要减去多出得 171 //超量倍增不满足,倍数要减去多出得
166 - be=be-bz_num_ok;  
167 - bz_num_ok=num; 172 + // be=be-bz_num_ok;
  173 + if (num % vv.zhqty == 0) {
  174 + be = num / vv.zhqty;
  175 + bz_num_ok = num;
  176 + } else {
  177 + be = Math.floor(num / vv.zhqty)
  178 + bz_num_ok = num - (be * vv.zhqty);
  179 + }
168 } 180 }
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 - } 181 + for (let i = 0; i < zhqty_bz.length; i++) {
  182 + var vv = zhqty_bz[i];
  183 + for (let j = 0; j < bz_num_ok; j++) {
  184 + let index = no_in_arr.findIndex(i => {
  185 + return vv.goods_id === i.goods_id
  186 + })
  187 + if(index > -1){
  188 + delete_num++
  189 + no_in_arr.splice(index, 1)
  190 + }
  191 +
  192 + }
177 } 193 }
  194 + // }
178 aprice += be * aprice; 195 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){ 196 + } else {
  197 + var vv = zhqty_bz[0];
  198 + var bz_num = be * vv.zhqty; //超量倍增
  199 + var num = vv['num'] - vv.zhqty; //购买数量减去超量
  200 + if (num > 0) {
  201 + bz_num_ok = bz_num - num;
  202 + if (bz_num_ok <= 0) {
185 //超量倍增满足,超量倍增就等于倍数 203 //超量倍增满足,超量倍增就等于倍数
186 - bz_num_ok=bz_num;  
187 - }else{ 204 + bz_num_ok = bz_num;
  205 + } else {
188 //超量倍增不满足,倍数要减去多出得 206 //超量倍增不满足,倍数要减去多出得
189 - be=be-bz_num_ok;  
190 - bz_num_ok=num; 207 + // be=be-bz_num_ok;
  208 + if (num % vv.zhqty == 0) {
  209 + be = num / vv.zhqty;
  210 + bz_num_ok = num;
  211 + } else {
  212 + be = Math.floor(num / vv.zhqty)
  213 + bz_num_ok = num - (be * vv.zhqty);
  214 + }
  215 + }
  216 + // be=vv.num;
  217 + for (let j = 0; j < bz_num_ok; j++) {
  218 + let index = no_in_arr.findIndex(i => {
  219 + return vv.goods_id === i.goods_id
  220 + })
  221 + if(index > -1){
  222 + delete_num++
  223 + no_in_arr.splice(index, 1)
  224 + }
191 } 225 }
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) { 226 + } else {
  227 + zhqty_len = 1;
  228 + }
  229 + }
  230 + }
  231 + if (!zhqty_len) {
201 aprice += be * act.zhprice; 232 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 - 233 + let pop_num = be * act.zhbuyqty - delete_num;
  234 + for (var m = 0; m < pop_num; m++) {
  235 + no_in_arr.pop();
  236 + }
  237 + }
  238 +
208 } 239 }
209 240
210 let goods_map = {}; 241 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.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_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 => {
@@ -183,13 +182,38 @@ Page({ @@ -183,13 +182,38 @@ Page({
183 //获取活动表的信息根据活动pt_prom_id 182 //获取活动表的信息根据活动pt_prom_id
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(async res => {
  186 + var flag=null;
187 if (res.data.code==0){ 187 if (res.data.code==0){
188 teamlist = res.data.data; 188 teamlist = res.data.data;
189 this.setData({teamlist: teamlist}); 189 this.setData({teamlist: teamlist});
190 //获取当前时间,并且判断剩余时间 190 //获取当前时间,并且判断剩余时间
191 var nt = ut.gettimestamp(); 191 var nt = ut.gettimestamp();
192 teamlist.status = 0; 192 teamlist.status = 0;
  193 +
  194 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{
  195 + data:{
  196 + store_id: os.stoid,
  197 + is_end: 0,
  198 + is_show: 1,
  199 + user_id: getApp().globalData.user_id,
  200 + pageSize:1000
  201 + }
  202 + }).then(res=>{
  203 + let pd_list=res.data.data.pageData;
  204 + if(res.data.code==0 && pd_list.length>0){
  205 + flag =pd_list.some(pd=>{
  206 + return pd.goods_id==teamlist['goods_id']
  207 + })
  208 + }
  209 + })
  210 + if(!flag){
  211 + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000});
  212 + setTimeout(function () {
  213 + ut.wx_back();
  214 + }, 2000)
  215 + return false;
  216 + }
193 if (nt >= teamlist.start_time) teamlist.status = 1; 217 if (nt >= teamlist.start_time) teamlist.status = 1;
194 218
195 goods_id = res.data.data.goods_id; 219 goods_id = res.data.data.goods_id;
@@ -226,7 +250,6 @@ Page({ @@ -226,7 +250,6 @@ Page({
226 } 250 }
227 }) 251 })
228 252
229 -  
230 //只装5个 253 //只装5个
231 var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; 254 var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num;
232 if(max_num){ 255 if(max_num){
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) {