Commit 4fda5f9fbd8fb3ea42ae20dc54f497830e655741

Authored by 前端开发-罗建龙
1 parent f42cc048

优化

packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
@@ -271,7 +271,8 @@ Page({ @@ -271,7 +271,8 @@ Page({
271 user_id: th.data.getUserID, //用户ID 271 user_id: th.data.getUserID, //用户ID
272 page: th.data.curpage, 272 page: th.data.curpage,
273 pageSize: th.data.pageSize, 273 pageSize: th.data.pageSize,
274 - is_end:0 274 + is_end:0,
  275 + timetype:1
275 }, 276 },
276 success: function (res) { 277 success: function (res) {
277 if (res.data.code == 0) { 278 if (res.data.code == 0) {
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml
@@ -49,12 +49,14 @@ @@ -49,12 +49,14 @@
49 <view class="content_ware_price no_line_c"> 49 <view class="content_ware_price no_line_c">
50 <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text> 50 <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text>
51 </view> 51 </view>
52 - <view wx:if="{{items.is_show && now < items.starTime1 }}" class="content_ware_time">  
53 - <text class="ellipsis-1">{{"活动开始时间:"+items.starTime}}</text>  
54 - </view>  
55 - <view wx:else class="content_ware_time">  
56 - <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text>  
57 - </view> 52 + <block wx:if="{{items.is_show}}">
  53 + <view wx:if="{{ now < items.starTime1 }}" class="content_ware_time">
  54 + <text class="ellipsis-1">{{"活动开始时间:"+items.starTime}}</text>
  55 + </view>
  56 + <view wx:else class="content_ware_time">
  57 + <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text>
  58 + </view>
  59 + </block>
58 </view> 60 </view>
59 </view> 61 </view>
60 <view class="content_box_button"> 62 <view class="content_box_button">
pages/cart/cart/cart.js
@@ -2143,19 +2143,26 @@ Page({ @@ -2143,19 +2143,26 @@ Page({
2143 } 2143 }
2144 }) 2144 })
2145 let user_pre_buynum = await this.getUserBuyPromNum_pre(a.prom_id) 2145 let user_pre_buynum = await this.getUserBuyPromNum_pre(a.prom_id)
2146 - let action_num=user_pre_buynum+1;  
2147 - arr_pro.map(item=>{  
2148 - item.goods.map(ite=>{  
2149 - if(ite.prom_type==3 && ite.prom_id==a.prom_id && !ite.is_gift && ite.selected){  
2150 - action_num+=1;  
2151 - }  
2152 - })  
2153 - })  
2154 - if (prom && action_num>prom.limit_num) {  
2155 - return true  
2156 - }else{ 2146 +
  2147 + if(user_pre_buynum>=prom.limit_num){
2157 return false 2148 return false
  2149 + }else{
  2150 + let action_num=user_pre_buynum+1;
  2151 + arr_pro.map(item=>{
  2152 + item.goods.map(ite=>{
  2153 + if(ite.prom_type==3 && ite.prom_id==a.prom_id && !ite.is_gift && ite.selected){
  2154 + action_num+=1;
  2155 + }
  2156 + })
  2157 + })
  2158 + if (prom && action_num>prom.limit_num) {
  2159 + return true
  2160 + }else{
  2161 + return false
  2162 + }
2158 } 2163 }
  2164 +
  2165 +
2159 }, 2166 },
2160 2167
2161 2168
@@ -3426,25 +3433,46 @@ Page({ @@ -3426,25 +3433,46 @@ Page({
3426 3433
3427 //多门店优惠促销次数控制 3434 //多门店优惠促销次数控制
3428 if (this.data.requestData.length>1) { 3435 if (this.data.requestData.length>1) {
3429 - let checkarr3=Object.keys(checkObj3)  
3430 - if (checkarr3 && checkarr3.length>0) {  
3431 - for (let x = 0; x < checkarr3.length; x++) {  
3432 - let prom=null  
3433 - let key=checkarr3[x]  
3434 - await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + key, {}).then(res => {  
3435 - if (res.data.code == 0) {  
3436 - prom = res.data.data;  
3437 - }  
3438 - })  
3439 - if (prom && prom.limit_num) {  
3440 - let user_pre_buynum = await this.getUserBuyPromNum_pre(key)  
3441 - user_pre_buynum += checkObj3[key]  
3442 - if (user_pre_buynum>prom.limit_num) {  
3443 - checkObj3_off=true 3436 + let pro_stord_id=''
  3437 + let pro_stord_off=false
  3438 + this.data.requestData.map(ritem=>{
  3439 + ritem.goods.map(gitem=>{
  3440 + if (gitem.selected && gitem.prom_type==3) {
  3441 + if (pro_stord_id) {
  3442 + if (gitem.pick_id !=pro_stord_id) {
  3443 + pro_stord_off=true
  3444 + }
  3445 + }else{
  3446 + pro_stord_id=gitem.pick_id
3444 } 3447 }
3445 } 3448 }
  3449 + })
  3450 + })
  3451 + if(pro_stord_off){
  3452 + let checkarr3=Object.keys(checkObj3)
  3453 + if (checkarr3 && checkarr3.length>0) {
  3454 + for (let x = 0; x < checkarr3.length; x++) {
  3455 + let prom=null
  3456 + let key=checkarr3[x]
  3457 + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + key, {}).then(res => {
  3458 + if (res.data.code == 0) {
  3459 + prom = res.data.data;
  3460 + }
  3461 + })
  3462 +
  3463 + if (prom && prom.limit_num) {
  3464 + let user_pre_buynum = await this.getUserBuyPromNum_pre(key)
  3465 + if(user_pre_buynum < prom.limit_num ){
  3466 + user_pre_buynum += checkObj3[key]
  3467 + if (user_pre_buynum>prom.limit_num) {
  3468 + checkObj3_off=true
  3469 + }
  3470 + }
  3471 +
  3472 + }
  3473 + }
3446 } 3474 }
3447 - } 3475 + }
3448 } 3476 }
3449 if (checkObj3_off) { 3477 if (checkObj3_off) {
3450 t.my_warnning("已超出优惠促销次数", 0, th); 3478 t.my_warnning("已超出优惠促销次数", 0, th);
pages/user/index/index.js
@@ -776,8 +776,11 @@ Page({ @@ -776,8 +776,11 @@ Page({
776 776
777 //跳转到链接 777 //跳转到链接
778 goto: function (e) { 778 goto: function (e) {
779 - var url = e.currentTarget.dataset.url;  
780 - getApp().goto(url); 779 + console.log(e);
  780 + console.log('跳转');
  781 + var url = e.currentTarget.dataset.url;
  782 + wx.navigateTo({ url: url })
  783 + // getApp().goto(url);
781 }, 784 },
782 785
783 //---------联系客服------------ 786 //---------联系客服------------