From 73aeef6fa9dd9fc5d6cc819ea982191506e77145 Mon Sep 17 00:00:00 2001 From: mice2333 Date: Mon, 27 Sep 2021 11:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=81=97=E6=BC=8F=E4=BF=AE=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/make_order/make_order/make_order.js | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pages/make_order/make_order/make_order.js b/pages/make_order/make_order/make_order.js index 139d5a2..24c2d74 100644 --- a/pages/make_order/make_order/make_order.js +++ b/pages/make_order/make_order/make_order.js @@ -175,16 +175,22 @@ Page({ }, // 使用最大减免优惠券 -getRecommendCoupons(drama_id,tid){ - http('/api/v1/coupon-list', "post", {drama_id,tid,mode:1}).then(Response => { + getRecommendCoupons(drama_id, tid) { + http('/api/v1/coupon-list', "post", { + drama_id, + tid, + mode: 1 + }).then(Response => { if (Response.coupon_list.length > 0) { let coupon_list = Response.coupon_list - - // 去除日期格式 + + // 选出status == 1 ; 去除日期格式 let a = [] coupon_list.forEach((item) => { - item.end_date = item.end_date.replace(/[\u4e00-\u9fa5]/g, '') - a.push(item) + if (item.status == 1) { + item.end_date = item.end_date.replace(/[\u4e00-\u9fa5]/g, '') + a.push(item) + } }) coupon_list = a @@ -209,7 +215,7 @@ getRecommendCoupons(drama_id,tid){ }) return l; } - + let recommendCoupons = couponSort(couponSort(couponSort(coupon_list, "subtract"), 'full'), 'end_date', 'asc') if (recommendCoupons && recommendCoupons.length > 0) { this.setData({ @@ -218,7 +224,7 @@ getRecommendCoupons(drama_id,tid){ } } }) -}, + }, /** @@ -235,8 +241,8 @@ getRecommendCoupons(drama_id,tid){ tprice += _info.ticket_info[i].price * _info.ticket_info[i].tkt_num } - this.getRecommendCoupons(options.drama_id,options.tid) - + this.getRecommendCoupons(options.drama_id, options.tid) + this.setData({ _info, tprice,