Commit 7b02ea399909dcc5efe00f76c8520554d62d203e

Authored by 后端研发-苏泰源
2 parents 2a921062 0e2bcd18

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

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,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <view> 11 <view>
12 <view> 12 <view>
13 {{item.nickname}} 13 {{item.nickname}}
14 - <view style="color: #FF6768;display:block;" wx:if="{{item.is_distribut == 1}}">分销会员</view> 14 + <view style="color: #FF6768;display:block;font-size:26rpx" wx:if="{{item.is_distribut == 1}}">分销会员</view>
15 <view style="color: #FF6768;display:block;" wx:else>普通会员</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>
packageB/pages/zuhegou/index/index.js
@@ -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,91 +1965,107 @@ Page({ @@ -1965,91 +1965,107 @@ 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 delete_num=0;  
1970 - var zhqty_len=0; //几个超量倍增 1968 + var bz_num_ok = 0; //超量倍增是否满足
  1969 + var delete_num = 0;
  1970 + var zhqty_len = 0; //几个超量倍增
1971 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); //看一下是几倍 1971 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); //看一下是几倍
1972 - if(this.data.act.is_bzyh && zhqty_bz.length > 0 ){  
1973 - if(zhqty_bz.length>1){  
1974 - zhqty_len=1;  
1975 - let min_bz_num= Math.min.apply(Math, zhqty_bz.map(function(o) {return o['num']}));  
1976 - let new_arr=zhqty_bz.filter(ii=>{  
1977 - 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;
1978 }) 1983 })
1979 - var vv=new_arr[0];  
1980 - // be=new_arr[0].zhqty;  
1981 - var bz_num=be*new_arr[0].zhqty; //超量倍增  
1982 - var num=min_bz_num-new_arr[0].zhqty; //购买数量减去超量  
1983 - // if(num > 0){  
1984 - bz_num_ok=bz_num-num;  
1985 - if(bz_num_ok <= 0){ 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) {
1986 //超量倍增满足,超量倍增就等于倍数 2009 //超量倍增满足,超量倍增就等于倍数
1987 - bz_num_ok=bz_num;  
1988 - }else{ 2010 + bz_num_ok = bz_num;
  2011 + } else {
1989 //超量倍增不满足,倍数要减去多出得 2012 //超量倍增不满足,倍数要减去多出得
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=be * vv.zhqty ;  
1997 - }  
1998 - bz_num_ok=be * vv.zhqty ; 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;
1999 } 2020 }
2000 - for(let i=0;i<zhqty_bz.length;i++){  
2001 - var vv=zhqty_bz[i];  
2002 - for(let j=0;j<bz_num_ok;j++){  
2003 - let index= no_in_arr.findIndex(i=>{  
2004 - return vv.goods_id===i.goods_id  
2005 - })  
2006 - if(index > -1){  
2007 - delete_num++  
2008 - no_in_arr.splice(index,1)  
2009 - }  
2010 - } 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 + }
2011 } 2030 }
2012 - // }  
2013 - aprice += be * aprice;  
2014 - }else{  
2015 - var vv=zhqty_bz[0];  
2016 - var bz_num=be*vv.zhqty; //超量倍增  
2017 - var num=vv['num']-vv.zhqty; //购买数量减去超量  
2018 - if(num > 0){  
2019 - bz_num_ok=bz_num-num;  
2020 - if(bz_num_ok <= 0){  
2021 - //超量倍增满足,超量倍增就等于倍数  
2022 - bz_num_ok=bz_num;  
2023 - }else{  
2024 - //超量倍增不满足,倍数要减去多出得  
2025 - // be=be-bz_num_ok;  
2026 - if(num % vv.zhqty == 0){  
2027 - be=num/vv.zhqty;  
2028 - // bz_num_ok=num;  
2029 - }else{  
2030 - be = Math.floor(num/vv.zhqty)  
2031 - // bz_num_ok=be * vv.zhqty;  
2032 - }  
2033 - bz_num_ok=be * vv.zhqty; 2031 + }
  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) {
  2039 + //超量倍增满足,超量倍增就等于倍数
  2040 + bz_num_ok = bz_num;
  2041 + } else {
  2042 + //超量倍增不满足,倍数要减去多出得
  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)
2034 } 2048 }
2035 - for(let j=0;j<bz_num_ok;j++){  
2036 - let index= no_in_arr.findIndex(i=>{  
2037 - return vv.goods_id===i.goods_id  
2038 - })  
2039 - if(index > -1){  
2040 - delete_num++  
2041 - no_in_arr.splice(index,1)  
2042 - } 2049 + bz_num_ok = be * vv.zhqty;
  2050 + }
  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)
2043 } 2058 }
2044 - }else{  
2045 - zhqty_len=1;  
2046 } 2059 }
2047 - } 2060 + } else {
  2061 + zhqty_len = 1;
  2062 + }
  2063 + }
2048 } 2064 }
2049 - if(!zhqty_len){ 2065 + if (!zhqty_len) {
2050 //多个超量就不用pop了 2066 //多个超量就不用pop了
2051 aprice += be * aprice; 2067 aprice += be * aprice;
2052 - let pop_num=be * this.data.act.zhbuyqty - delete_num; 2068 + let pop_num = be * this.data.act.zhbuyqty - delete_num;
2053 for (var m = 0; m < pop_num; m++) { 2069 for (var m = 0; m < pop_num; m++) {
2054 no_in_arr.pop(); 2070 no_in_arr.pop();
2055 } 2071 }
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/presell/goodsInfo/goodsInfo.js
@@ -420,13 +420,14 @@ Page({ @@ -420,13 +420,14 @@ Page({
420 }) 420 })
421 } 421 }
422 }); 422 });
  423 +
  424 +
423 //更新点击量 425 //更新点击量
424 getApp().request.put("/api/weshop/goods/updateClick", { 426 getApp().request.put("/api/weshop/goods/updateClick", {
425 data: { store_id: os.stoid, goods_id: gid } 427 data: { store_id: os.stoid, goods_id: gid }
426 }) 428 })
427 }, 429 },
428 430
429 -  
430 //--- 设置一下默认库存的数量 ---- 431 //--- 设置一下默认库存的数量 ----
431 set_def_storage(ee) { 432 set_def_storage(ee) {
432 var that = this, th = this; 433 var that = this, th = this;
@@ -799,6 +800,7 @@ Page({ @@ -799,6 +800,7 @@ Page({
799 800
800 } 801 }
801 else { 802 else {
  803 + console.log('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
802 wx.showModal({ 804 wx.showModal({
803 title: t.data.msg, 805 title: t.data.msg,
804 showCancel: !1, 806 showCancel: !1,
packageC/pages/presell/list/list.wxml
@@ -78,7 +78,8 @@ @@ -78,7 +78,8 @@
78 <view class="no-more" wx:elif="{{no_more}}">-- 没有更多 --</view> 78 <view class="no-more" wx:elif="{{no_more}}">-- 没有更多 --</view>
79 <view style="height:10rpx"></view> 79 <view style="height:10rpx"></view>
80 80
81 - <!-- 底部按钮 --> 81 + <!-- 底部按钮 暂时隐藏-->
  82 + <!--
82 <view class="kill-time xc-seckill-bottom"> 83 <view class="kill-time xc-seckill-bottom">
83 <view class="theader" > 84 <view class="theader" >
84 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> 85 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}">
@@ -93,7 +94,7 @@ @@ -93,7 +94,7 @@
93 94
94 </view> 95 </view>
95 </view> 96 </view>
96 - 97 +-->
97 98
98 </view> 99 </view>
99 100
pages/cart/cart/zh_calculate.js
@@ -238,35 +238,54 @@ module.exports = { @@ -238,35 +238,54 @@ module.exports = {
238 var be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍 238 var be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍
239 if (act.is_bzyh && zhqty_bz.length > 0) { 239 if (act.is_bzyh && zhqty_bz.length > 0) {
240 if (zhqty_bz.length > 1) { 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 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;
247 }) 250 })
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; 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 + }
257 } else { 264 } else {
258 - //超量倍增不满足,倍数要减去多出得  
259 - // be=be-bz_num_ok;  
260 - if (num % vv.zhqty == 0) {  
261 - be = num / vv.zhqty;  
262 - bz_num_ok = num; 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) {
  276 + //超量倍增满足,超量倍增就等于倍数
  277 + bz_num_ok = bz_num;
263 } else { 278 } else {
264 - be = Math.floor(num / vv.zhqty)  
265 - bz_num_ok = num - (be * vv.zhqty); 279 + //超量倍增不满足,倍数要减去多出得
  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;
266 } 287 }
267 - }  
268 - for (let i = 0; i < zhqty_bz.length; i++) {  
269 - var vv = zhqty_bz[i]; 288 +
270 for (let j = 0; j < bz_num_ok; j++) { 289 for (let j = 0; j < bz_num_ok; j++) {
271 let index = no_in_arr.findIndex(i => { 290 let index = no_in_arr.findIndex(i => {
272 return vv.goods_id === i.goods_id 291 return vv.goods_id === i.goods_id
@@ -277,9 +296,7 @@ module.exports = { @@ -277,9 +296,7 @@ module.exports = {
277 } 296 }
278 } 297 }
279 } 298 }
280 - // }  
281 - aprice += be * aprice;  
282 - } else { 299 + } else {
283 var vv = zhqty_bz[0]; 300 var vv = zhqty_bz[0];
284 var bz_num = be * vv.zhqty; //超量倍增 301 var bz_num = be * vv.zhqty; //超量倍增
285 var num = vv['num'] - vv.zhqty; //购买数量减去超量 302 var num = vv['num'] - vv.zhqty; //购买数量减去超量
@@ -293,11 +310,12 @@ module.exports = { @@ -293,11 +310,12 @@ module.exports = {
293 // be=be-bz_num_ok; 310 // be=be-bz_num_ok;
294 if (num % vv.zhqty == 0) { 311 if (num % vv.zhqty == 0) {
295 be = num / vv.zhqty; 312 be = num / vv.zhqty;
296 - bz_num_ok = num; 313 + // bz_num_ok = num;
297 } else { 314 } else {
298 be = Math.floor(num / vv.zhqty) 315 be = Math.floor(num / vv.zhqty)
299 - bz_num_ok = num - (be * vv.zhqty); 316 + // bz_num_ok = num - (be * vv.zhqty);
300 } 317 }
  318 + bz_num_ok = be * vv.zhqty;
301 } 319 }
302 // be=vv.num; 320 // be=vv.num;
303 for (let j = 0; j < bz_num_ok; j++) { 321 for (let j = 0; j < bz_num_ok; j++) {
pages/cart/cart2/zh_calculate.js
@@ -151,49 +151,65 @@ module.exports = { @@ -151,49 +151,65 @@ module.exports = {
151 let be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍 151 let be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍
152 if (act.is_bzyh && zhqty_bz.length > 0) { 152 if (act.is_bzyh && zhqty_bz.length > 0) {
153 if (zhqty_bz.length > 1) { 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 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;
160 }) 163 })
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) {  
168 - //超量倍增满足,超量倍增就等于倍数  
169 - bz_num_ok = bz_num; 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 + }
170 } else { 177 } else {
171 - //超量倍增不满足,倍数要减去多出得  
172 - // be=be-bz_num_ok;  
173 - if (num % vv.zhqty == 0) {  
174 - be = num / vv.zhqty;  
175 - bz_num_ok = num; 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;
176 } else { 191 } else {
177 - be = Math.floor(num / vv.zhqty)  
178 - bz_num_ok = num - (be * vv.zhqty); 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;
179 } 200 }
180 - }  
181 - for (let i = 0; i < zhqty_bz.length; i++) {  
182 - var vv = zhqty_bz[i]; 201 +
183 for (let j = 0; j < bz_num_ok; j++) { 202 for (let j = 0; j < bz_num_ok; j++) {
184 let index = no_in_arr.findIndex(i => { 203 let index = no_in_arr.findIndex(i => {
185 return vv.goods_id === i.goods_id 204 return vv.goods_id === i.goods_id
186 }) 205 })
187 - if(index > -1){ 206 + if (index > -1) {
188 delete_num++ 207 delete_num++
189 no_in_arr.splice(index, 1) 208 no_in_arr.splice(index, 1)
190 } 209 }
191 -  
192 } 210 }
193 } 211 }
194 - // }  
195 - aprice += be * aprice;  
196 - } else { 212 + } else {
197 var vv = zhqty_bz[0]; 213 var vv = zhqty_bz[0];
198 var bz_num = be * vv.zhqty; //超量倍增 214 var bz_num = be * vv.zhqty; //超量倍增
199 var num = vv['num'] - vv.zhqty; //购买数量减去超量 215 var num = vv['num'] - vv.zhqty; //购买数量减去超量
@@ -207,11 +223,12 @@ module.exports = { @@ -207,11 +223,12 @@ module.exports = {
207 // be=be-bz_num_ok; 223 // be=be-bz_num_ok;
208 if (num % vv.zhqty == 0) { 224 if (num % vv.zhqty == 0) {
209 be = num / vv.zhqty; 225 be = num / vv.zhqty;
210 - bz_num_ok = num; 226 + // bz_num_ok = num;
211 } else { 227 } else {
212 be = Math.floor(num / vv.zhqty) 228 be = Math.floor(num / vv.zhqty)
213 - bz_num_ok = num - (be * vv.zhqty); 229 + // bz_num_ok = num - (be * vv.zhqty);
214 } 230 }
  231 + bz_num_ok = be * vv.zhqty;
215 } 232 }
216 // be=vv.num; 233 // be=vv.num;
217 for (let j = 0; j < bz_num_ok; j++) { 234 for (let j = 0; j < bz_num_ok; j++) {
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;
pages/goods/search/g_filter.wxs
@@ -84,7 +84,8 @@ var g_filters = { @@ -84,7 +84,8 @@ var g_filters = {
84 84
85 get_goods_url:function(item){ 85 get_goods_url:function(item){
86 86
87 - var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id 87 + var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id
  88 + // 预售活动
88 if(item.prom_type==8){ 89 if(item.prom_type==8){
89 url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id 90 url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id
90 } 91 }
pages/team/team_success/team_success.js
@@ -183,6 +183,14 @@ Page({ @@ -183,6 +183,14 @@ Page({
183 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, {
184 data: { } 184 data: { }
185 }).then(res => { 185 }).then(res => {
  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 +
186 if (nt >= teamlist.start_time) teamlist.status = 1; 194 if (nt >= teamlist.start_time) teamlist.status = 1;
187 goods_id = res.data.data.goods_id; 195 goods_id = res.data.data.goods_id;
188 id = res.data.data.id; 196 id = res.data.data.id;
@@ -200,10 +208,9 @@ Page({ @@ -200,10 +208,9 @@ Page({
200 }) 208 })
201 max_num=max; 209 max_num=max;
202 min_price=pri; 210 min_price=pri;
203 -  
204 } 211 }
205 212
206 - 213 + }
207 //获取商品信息 214 //获取商品信息
208 getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { 215 getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
209 }).then(res => { 216 }).then(res => {
pages/user/order_detail/order_detail.js
@@ -334,8 +334,11 @@ Page({ @@ -334,8 +334,11 @@ Page({
334 334
335 //--------立即支付---------- 335 //--------立即支付----------
336 async jumpToCart4(e) { 336 async jumpToCart4(e) {
337 -  
338 - var th=this; 337 +
  338 + if(this.data.paying) return false;
  339 + this.setData({paying:1});
  340 +
  341 + var th=this;
339 if(this.data.optionIsGoup) 342 if(this.data.optionIsGoup)
340 wx.navigateTo({ 343 wx.navigateTo({
341 url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true" 344 url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true"
@@ -353,6 +356,7 @@ Page({ @@ -353,6 +356,7 @@ Page({
353 title: '提示', 356 title: '提示',
354 content: '线下取价功能已经关闭或者过期!' 357 content: '线下取价功能已经关闭或者过期!'
355 }); 358 });
  359 + th.setData({paying:0});
356 return false; 360 return false;
357 } 361 }
358 362
@@ -385,9 +389,10 @@ Page({ @@ -385,9 +389,10 @@ Page({
385 var buyed_mum2=goodsbuynum+good.goods_num; 389 var buyed_mum2=goodsbuynum+good.goods_num;
386 if (buyed_mum2 > limit && limit > 0) { 390 if (buyed_mum2 > limit && limit > 0) {
387 391
388 - var content=gg.goods_name+'购买数量超出商品限购,请取消订单';  
389 - th.toast(content);  
390 - return false; 392 + var content=gg.goods_name+'购买数量超出商品限购,请取消订单';
  393 + th.toast(content);
  394 + th.setData({paying:0});
  395 + return false;
391 } 396 }
392 //当是组合优惠的时候 397 //当是组合优惠的时候
393 if(good.prom_type==7){ 398 if(good.prom_type==7){
@@ -421,7 +426,8 @@ Page({ @@ -421,7 +426,8 @@ Page({
421 if (!isok){ 426 if (!isok){
422 var content=gg.goods_name+'活动已经结束,请取消订单'; 427 var content=gg.goods_name+'活动已经结束,请取消订单';
423 th.toast(content); 428 th.toast(content);
424 - return false; 429 + th.setData({paying:0});
  430 + return false;
425 } 431 }
426 432
427 var url1 = "/api/weshop/prom/zhbuyGoods/page"; 433 var url1 = "/api/weshop/prom/zhbuyGoods/page";
@@ -450,6 +456,7 @@ Page({ @@ -450,6 +456,7 @@ Page({
450 456
451 var content= good['goods_name']+"超出活动限购\n"; 457 var content= good['goods_name']+"超出活动限购\n";
452 th.toast(content); 458 th.toast(content);
  459 + th.setData({paying:0});
453 return false; 460 return false;
454 } 461 }
455 } 462 }
@@ -493,6 +500,7 @@ Page({ @@ -493,6 +500,7 @@ Page({
493 500
494 var content = good.goods_name + '未找到活动,请取消订单重新购买' 501 var content = good.goods_name + '未找到活动,请取消订单重新购买'
495 th.toast(content); 502 th.toast(content);
  503 + th.setData({paying:0});
496 p_ok = 0; 504 p_ok = 0;
497 } 505 }
498 }) 506 })
@@ -522,7 +530,9 @@ Page({ @@ -522,7 +530,9 @@ Page({
522 }) 530 })
523 531
524 } 532 }
525 - if (!p_ok) return false; 533 + if (!p_ok){
  534 + th.setData({paying:0});return false;
  535 + }
526 } 536 }
527 537
528 //商品的普通购买 ,不要进行判断 538 //商品的普通购买 ,不要进行判断
@@ -530,7 +540,8 @@ Page({ @@ -530,7 +540,8 @@ Page({
530 if(gg.prom_type!=good.prom_type && gg.prom_type>0) { 540 if(gg.prom_type!=good.prom_type && gg.prom_type>0) {
531 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; 541 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
532 th.toast(content); 542 th.toast(content);
533 - return false; 543 + th.setData({paying:0});
  544 + return false;
534 } 545 }
535 }else{ 546 }else{
536 if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4) 547 if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4)
@@ -581,9 +592,10 @@ Page({ @@ -581,9 +592,10 @@ Page({
581 var t_now=ut.gettimestamp(); 592 var t_now=ut.gettimestamp();
582 if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){ 593 if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){
583 594
584 - var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';  
585 - th.toast(content);  
586 - return false; 595 + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
  596 + th.toast(content);
  597 + th.setData({paying:0});
  598 + return false;
587 } 599 }
588 } 600 }
589 }else{ 601 }else{
@@ -602,7 +614,9 @@ Page({ @@ -602,7 +614,9 @@ Page({
602 } 614 }
603 } 615 }
604 }) 616 })
605 - if(!t_ok) return false; 617 + if(!t_ok) {
  618 + th.setData({paying:0});return false;
  619 + }
606 } 620 }
607 621
608 //-- 如果有参加线下取价 -- 622 //-- 如果有参加线下取价 --
@@ -626,7 +640,8 @@ Page({ @@ -626,7 +640,8 @@ Page({
626 640
627 var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买22'; 641 var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买22';
628 th.toast(content); 642 th.toast(content);
629 - return false; 643 + th.setData({paying:0});
  644 + return false;
630 } 645 }
631 } 646 }
632 647
@@ -637,17 +652,18 @@ Page({ @@ -637,17 +652,18 @@ Page({
637 ob=obj; 652 ob=obj;
638 }) 653 })
639 if(ob.code==-1){ 654 if(ob.code==-1){
640 -  
641 var content=gg.goods_name+'门店库存不足,请取消订单'; 655 var content=gg.goods_name+'门店库存不足,请取消订单';
642 th.toast(content); 656 th.toast(content);
643 - return false; 657 + th.setData({paying:0});
  658 + return false;
644 } 659 }
645 660
646 }else{ 661 }else{
647 if(good.goods_num>store_count){ 662 if(good.goods_num>store_count){
648 663
649 - var content=gg.goods_name+'商品的库存不足,请取消订单';  
650 - th.toast(content); 664 + var content=gg.goods_name+'商品的库存不足,请取消订单';
  665 + th.toast(content);
  666 + th.setData({paying:0});
651 return false; 667 return false;
652 } 668 }
653 669
@@ -703,41 +719,46 @@ Page({ @@ -703,41 +719,46 @@ Page({
703 719
704 var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买'; 720 var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买';
705 th.toast(content); 721 th.toast(content);
  722 + th.setData({paying:0});
706 return false; 723 return false;
707 } 724 }
708 725
709 buyed_mum2=promgoodsbuynum+good.goods_num; 726 buyed_mum2=promgoodsbuynum+good.goods_num;
710 if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) { 727 if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) {
711 -  
712 - var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买';  
713 - th.toast(content);  
714 - return false; 728 + var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买';
  729 + th.toast(content);
  730 + th.setData({paying:0});
  731 + return false;
715 } 732 }
716 //看一下会员的秒杀价格是不是发生了变化 733 //看一下会员的秒杀价格是不是发生了变化
717 if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){ 734 if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){
718 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; 735 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
719 th.toast(content); 736 th.toast(content);
  737 + th.setData({paying:0});
720 return false; 738 return false;
721 } 739 }
722 740
723 //看一下会员的团购价格是不是发生了变化 741 //看一下会员的团购价格是不是发生了变化
724 if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ 742 if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){
725 - var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';  
726 - th.toast(content); 743 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  744 + th.toast(content);
  745 + th.setData({paying:0});
727 return false; 746 return false;
728 } 747 }
729 748
730 if(goodsinfo.prom_type==4){ 749 if(goodsinfo.prom_type==4){
731 if (good.goods_num > prom.limitqty-prom.buy_num) { 750 if (good.goods_num > prom.limitqty-prom.buy_num) {
732 751
733 - var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单';  
734 - th.toast(content);  
735 - return false; 752 + var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单';
  753 + th.toast(content);
  754 + th.setData({paying:0});
  755 + return false;
736 } 756 }
737 }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { 757 }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) {
738 if(order.add_time+5*60<ut.gettimestamp()) { 758 if(order.add_time+5*60<ut.gettimestamp()) {
739 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; 759 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单';
740 th.toast(content); 760 th.toast(content);
  761 + th.setData({paying:0});
741 return false; 762 return false;
742 } 763 }
743 } 764 }
@@ -751,7 +772,9 @@ Page({ @@ -751,7 +772,9 @@ Page({
751 wlist=ut.sub_last(wlist); 772 wlist=ut.sub_last(wlist);
752 var keyid=order.pickup_id; 773 var keyid=order.pickup_id;
753 var user_info=getApp().globalData.userInfo; 774 var user_info=getApp().globalData.userInfo;
754 - if(!keyid) return false; 775 + if(!keyid) {
  776 + th.setData({paying:0});return false;
  777 + }
755 var offarr=null; 778 var offarr=null;
756 await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", { 779 await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", {
757 data:{ 780 data:{
@@ -776,8 +799,9 @@ Page({ @@ -776,8 +799,9 @@ Page({
776 if(newarr[good.erpwareid] && 799 if(newarr[good.erpwareid] &&
777 parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){ 800 parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){
778 801
779 - var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买';  
780 - th.toast(content); 802 + var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买';
  803 + th.toast(content);
  804 + th.setData({paying:0});
781 return false; 805 return false;
782 } 806 }
783 } 807 }
@@ -792,9 +816,12 @@ Page({ @@ -792,9 +816,12 @@ Page({
792 }, 1);--*/ 816 }, 1);--*/
793 817
794 py.pay(this.data.order.order_sn, function() { 818 py.pay(this.data.order.order_sn, function() {
  819 + th.setData({paying:0});
795 wx.showToast({title: '支付成功'}) 820 wx.showToast({title: '支付成功'})
796 wx.navigateBack(); 821 wx.navigateBack();
797 - },null,os.stoid,1); 822 + },function () {
  823 + th.setData({paying:0});
  824 + },os.stoid,1);
798 825
799 826
800 }, 827 },
pages/user/order_detail/order_detail.wxml
@@ -150,7 +150,10 @@ @@ -150,7 +150,10 @@
150 <view class="btn-wrap"> 150 <view class="btn-wrap">
151 151
152 <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0 && order.pt_status==2 }}">支付尾款</view> 152 <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0 && order.pt_status==2 }}">支付尾款</view>
153 - <view bindtap="jumpToCart4" class="tips-btn" hidden="{{!order.pay_btn}}">立即付款</view> 153 + <view bindtap="jumpToCart4" class="tips-btn" hidden="{{!order.pay_btn}}">
  154 + <text wx:if="{{paying}}">支付中</text>
  155 + <text wx:else>立即付款</text>
  156 + </view>
154 157
155 <block wx:if="{{!(order.has_rt || order.return_btn==2 || order.return_btn==4)}}"> 158 <block wx:if="{{!(order.has_rt || order.return_btn==2 || order.return_btn==4)}}">
156 <navigator bindtap="confirmOrder" class="tips-btn" hidden="{{!order.receive_btn}}">收货确认</navigator> 159 <navigator bindtap="confirmOrder" class="tips-btn" hidden="{{!order.receive_btn}}">收货确认</navigator>
pages/user/order_list/order_list.js
@@ -509,6 +509,9 @@ Page({ @@ -509,6 +509,9 @@ Page({
509 /*----------跳转支付-----------*/ 509 /*----------跳转支付-----------*/
510 async jumpToCart4(t) { 510 async jumpToCart4(t) {
511 511
  512 + if(this.data.paying) return false;
  513 + this.setData({paying:1});
  514 +
512 var o_index = t.currentTarget.dataset.idx; 515 var o_index = t.currentTarget.dataset.idx;
513 var e = this.data.orderList[o_index]; 516 var e = this.data.orderList[o_index];
514 var th = this; 517 var th = this;
@@ -530,6 +533,7 @@ Page({ @@ -530,6 +533,7 @@ Page({
530 533
531 if (knum <= 0) { 534 if (knum <= 0) {
532 getApp().confirmBox("库存为0,支付失败"); 535 getApp().confirmBox("库存为0,支付失败");
  536 + th.setData({paying:0});
533 return false; 537 return false;
534 } 538 }
535 539
@@ -544,6 +548,7 @@ Page({ @@ -544,6 +548,7 @@ Page({
544 title: '提示', 548 title: '提示',
545 content: '线下取价功能已经关闭或者过期!' 549 content: '线下取价功能已经关闭或者过期!'
546 }); 550 });
  551 + th.setData({paying:0});
547 return false; 552 return false;
548 } 553 }
549 554
@@ -577,6 +582,7 @@ Page({ @@ -577,6 +582,7 @@ Page({
577 if (buyed_mum2 > limit && limit > 0) { 582 if (buyed_mum2 > limit && limit > 0) {
578 var content = gg.goods_name + '购买数量超出商品限购,请取消订单'; 583 var content = gg.goods_name + '购买数量超出商品限购,请取消订单';
579 th.toast(content); 584 th.toast(content);
  585 + th.setData({paying:0});
580 return false; 586 return false;
581 } 587 }
582 //当是组合优惠的时候 588 //当是组合优惠的时候
@@ -611,6 +617,7 @@ Page({ @@ -611,6 +617,7 @@ Page({
611 if (!isok) { 617 if (!isok) {
612 var content = gg.goods_name + '活动已经结束,请取消订单'; 618 var content = gg.goods_name + '活动已经结束,请取消订单';
613 th.toast(content); 619 th.toast(content);
  620 + th.setData({paying:0});
614 return false; 621 return false;
615 } 622 }
616 623
@@ -637,6 +644,7 @@ Page({ @@ -637,6 +644,7 @@ Page({
637 if (good.goods_num + promgoodsbuynum > good['buyqty']) { 644 if (good.goods_num + promgoodsbuynum > good['buyqty']) {
638 var content = good['goods_name'] + "超出活动限购\n"; 645 var content = good['goods_name'] + "超出活动限购\n";
639 th.toast(content); 646 th.toast(content);
  647 + th.setData({paying:0});
640 return false; 648 return false;
641 } 649 }
642 } 650 }
@@ -674,12 +682,14 @@ Page({ @@ -674,12 +682,14 @@ Page({
674 if(good.goods_num>presellList.presell_sumqty-presellList.buy_goodnum){ 682 if(good.goods_num>presellList.presell_sumqty-presellList.buy_goodnum){
675 var content = good.goods_name + '购买数量超出商品库存,请取消订单'; 683 var content = good.goods_name + '购买数量超出商品库存,请取消订单';
676 th.toast(content); 684 th.toast(content);
  685 + th.setData({paying:0});
677 return false; 686 return false;
678 } 687 }
679 var buyed_mum3 = promgoodsbuynum + good.goods_num; 688 var buyed_mum3 = promgoodsbuynum + good.goods_num;
680 if (buyed_mum3 > presellList.vip_butyqty && presellList.vip_butyqty > 0) { 689 if (buyed_mum3 > presellList.vip_butyqty && presellList.vip_butyqty > 0) {
681 var content = good.goods_name + '购买数量超出商品限购,请取消订单'; 690 var content = good.goods_name + '购买数量超出商品限购,请取消订单';
682 th.toast(content); 691 th.toast(content);
  692 + th.setData({paying:0});
683 return false; 693 return false;
684 } 694 }
685 695
@@ -753,7 +763,10 @@ Page({ @@ -753,7 +763,10 @@ Page({
753 }) 763 })
754 764
755 } 765 }
756 - if (!p_ok) return false; 766 + if (!p_ok){
  767 + th.setData({paying:0});
  768 + return false;
  769 + }
757 } 770 }
758 771
759 //商品的普通购买 ,不要进行判断 772 //商品的普通购买 ,不要进行判断
@@ -762,6 +775,7 @@ Page({ @@ -762,6 +775,7 @@ Page({
762 if (gg.prom_type != good.prom_type && gg.prom_type>0) { 775 if (gg.prom_type != good.prom_type && gg.prom_type>0) {
763 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; 776 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买';
764 th.toast(content); 777 th.toast(content);
  778 + th.setData({paying:0});
765 return false; 779 return false;
766 } 780 }
767 781
@@ -814,6 +828,7 @@ Page({ @@ -814,6 +828,7 @@ Page({
814 828
815 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; 829 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买';
816 th.toast(content); 830 th.toast(content);
  831 + th.setData({paying:0});
817 return false; 832 return false;
818 } 833 }
819 } 834 }
@@ -832,7 +847,9 @@ Page({ @@ -832,7 +847,9 @@ Page({
832 } 847 }
833 } 848 }
834 }) 849 })
835 - if (!t_ok) return false; 850 + if (!t_ok){
  851 + th.setData({paying:0}); return false;
  852 + }
836 } 853 }
837 //-- 如果有参加线下取价 -- 854 //-- 如果有参加线下取价 --
838 if (good.offline_cut > 0) wlist += encodeURIComponent(gg.erpwareid) + ","; 855 if (good.offline_cut > 0) wlist += encodeURIComponent(gg.erpwareid) + ",";
@@ -856,6 +873,7 @@ Page({ @@ -856,6 +873,7 @@ Page({
856 873
857 var content = gg.goods_name + '商品的价格发生了变化,请取消订单重新购买1' 874 var content = gg.goods_name + '商品的价格发生了变化,请取消订单重新购买1'
858 th.toast(content); 875 th.toast(content);
  876 + th.setData({paying:0});
859 return false; 877 return false;
860 } 878 }
861 } 879 }
@@ -870,6 +888,7 @@ Page({ @@ -870,6 +888,7 @@ Page({
870 888
871 var content = gg.goods_name + '门店库存不足,请取消订单'; 889 var content = gg.goods_name + '门店库存不足,请取消订单';
872 th.toast(content); 890 th.toast(content);
  891 + th.setData({paying:0});
873 return false; 892 return false;
874 } 893 }
875 894
@@ -878,6 +897,7 @@ Page({ @@ -878,6 +897,7 @@ Page({
878 897
879 var content = gg.goods_name + '商品的库存不足,请取消订单'; 898 var content = gg.goods_name + '商品的库存不足,请取消订单';
880 th.toast(content); 899 th.toast(content);
  900 + th.setData({paying:0});
881 return false; 901 return false;
882 } 902 }
883 903
@@ -929,6 +949,7 @@ Page({ @@ -929,6 +949,7 @@ Page({
929 if (prom.is_end == 1 && prom.end_time < now) { 949 if (prom.is_end == 1 && prom.end_time < now) {
930 var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' 950 var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单'
931 th.toast(content); 951 th.toast(content);
  952 + th.setData({paying:0});
932 return false; 953 return false;
933 } 954 }
934 955
@@ -937,6 +958,7 @@ Page({ @@ -937,6 +958,7 @@ Page({
937 958
938 var content = goodsinfo.goods_name + '购买数量超出商品活动限购,请取消订单' 959 var content = goodsinfo.goods_name + '购买数量超出商品活动限购,请取消订单'
939 th.toast(content); 960 th.toast(content);
  961 + th.setData({paying:0});
940 return false; 962 return false;
941 } 963 }
942 964
@@ -944,6 +966,7 @@ Page({ @@ -944,6 +966,7 @@ Page({
944 if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){ 966 if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){
945 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; 967 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
946 th.toast(content); 968 th.toast(content);
  969 + th.setData({paying:0});
947 return false; 970 return false;
948 } 971 }
949 972
@@ -951,6 +974,7 @@ Page({ @@ -951,6 +974,7 @@ Page({
951 if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ 974 if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){
952 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; 975 var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
953 th.toast(content); 976 th.toast(content);
  977 + th.setData({paying:0});
954 return false; 978 return false;
955 } 979 }
956 980
@@ -959,12 +983,14 @@ Page({ @@ -959,12 +983,14 @@ Page({
959 983
960 var content = goodsinfo.goods_name + '购买数量超出商品活动库存,请取消订单' 984 var content = goodsinfo.goods_name + '购买数量超出商品活动库存,请取消订单'
961 th.toast(content); 985 th.toast(content);
  986 + th.setData({paying:0});
962 return false; 987 return false;
963 } 988 }
964 } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { 989 } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) {
965 if(order.add_time+5*60<ut.gettimestamp()) { 990 if(order.add_time+5*60<ut.gettimestamp()) {
966 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; 991 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单';
967 th.toast(content); 992 th.toast(content);
  993 + th.setData({paying:0});
968 return false; 994 return false;
969 } 995 }
970 } 996 }
@@ -977,7 +1003,9 @@ Page({ @@ -977,7 +1003,9 @@ Page({
977 wlist = ut.sub_last(wlist); 1003 wlist = ut.sub_last(wlist);
978 var keyid = order.pickup_id; 1004 var keyid = order.pickup_id;
979 var user_info = getApp().globalData.userInfo; 1005 var user_info = getApp().globalData.userInfo;
980 - if (!keyid) return false; 1006 + if (!keyid){
  1007 + th.setData({paying:0});return false;
  1008 + }
981 var offarr = null; 1009 var offarr = null;
982 await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", { 1010 await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", {
983 data: { 1011 data: {
@@ -1005,6 +1033,7 @@ Page({ @@ -1005,6 +1033,7 @@ Page({
1005 1033
1006 var content = good.goods_name + '商品的价格发生了变化,请取消订单重新购买'; 1034 var content = good.goods_name + '商品的价格发生了变化,请取消订单重新购买';
1007 th.toast(content); 1035 th.toast(content);
  1036 + th.setData({paying:0});
1008 return false; 1037 return false;
1009 } 1038 }
1010 } 1039 }
@@ -1024,13 +1053,15 @@ Page({ @@ -1024,13 +1053,15 @@ Page({
1024 getApp().request.post("/api/weshop/order/pay/createOrder", { 1053 getApp().request.post("/api/weshop/order/pay/createOrder", {
1025 data: dd, 1054 data: dd,
1026 success: function(t) { 1055 success: function(t) {
1027 - if (t.data.code == 0) { 1056 + th.setData({paying:0});
  1057 + if (t.data.code == 0) {
1028 th.onload(); 1058 th.onload();
1029 } else { 1059 } else {
1030 getApp().confirmBox(t.data.msg + "请您取消该订单"); 1060 getApp().confirmBox(t.data.msg + "请您取消该订单");
1031 } 1061 }
1032 } 1062 }
1033 }) 1063 })
  1064 +
1034 return false; 1065 return false;
1035 } 1066 }
1036 1067
@@ -1042,10 +1073,13 @@ Page({ @@ -1042,10 +1073,13 @@ Page({
1042 });--*/ 1073 });--*/
1043 1074
1044 t.pay(e.order_sn, function() { 1075 t.pay(e.order_sn, function() {
  1076 + th.setData({paying:0});
1045 wx.showToast({title: '支付成功'}) 1077 wx.showToast({title: '支付成功'})
1046 th.data.orderList.splice(o_index,1); 1078 th.data.orderList.splice(o_index,1);
1047 th.setData({orderList:th.data.orderList}); 1079 th.setData({orderList:th.data.orderList});
1048 - },null,os.stoid,1); 1080 + },function () {
  1081 + th.setData({paying:0});
  1082 + },os.stoid,1);
1049 1083
1050 1084
1051 }, 1085 },
pages/user/order_list/order_list.wxml
@@ -260,7 +260,10 @@ @@ -260,7 +260,10 @@
260 260
261 261
262 <navigator class="commodity_To_evaluate flex-level comment_go" url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> 262 <navigator class="commodity_To_evaluate flex-level comment_go" url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator>
263 - <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="jumpToCart4" data-idx="{{index}}" wx:if="{{(item.order_status==0&&item.pay_status==0)}}">立即支付</navigator> 263 + <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="jumpToCart4" data-idx="{{index}}" wx:if="{{(item.order_status==0&&item.pay_status==0)}}">
  264 + <text wx:if="{{paying}}">支付中</text>
  265 + <text wx:else>立即支付</text>
  266 + </navigator>
264 267
265 <!-- 积分购 拼团 搭配购没有有再来一单 --> 268 <!-- 积分购 拼团 搭配购没有有再来一单 -->
266 <block wx:if="{{(item.pay_status==1 || item.order_status==3) && !item.presell && item.pt_prom_id<=0 && item.integral<=0 && item.order_goods[0].prom_type!=5 && !(item.order_goods[0].prom_type==9)}}"> 269 <block wx:if="{{(item.pay_status==1 || item.order_status==3) && !item.presell && item.pt_prom_id<=0 && item.integral<=0 && item.order_goods[0].prom_type!=5 && !(item.order_goods[0].prom_type==9)}}">