From 1b18333f867fa8294f3e860c7b0fb32925c6543f Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 17 Jan 2024 16:43:08 +0800 Subject: [PATCH] 订单详情待支付的优化 --- pages/user/order_detail/order_detail.js | 26 ++++++++++++++++++++++++-- pages/user/order_list/order_list.js | 26 ++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index f9a41e7..8d94c45 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -844,6 +844,28 @@ Page({ } } + //阶梯促销获取取价规则 + if(gg.prom_type==10){ + var prom_ld=null; + //-- 获取阶梯规则 -- + var url1 = "/api/weshop/prom/ladderList/list"; + var req_data = { + store_id: os.stoid, + form_id: gg.prom_id, + } + await getApp().request.promiseGet(url1, { + data: req_data + }).then(rs1 => { + if (rs1.data.code == 0 && rs1.data.data && rs1.data.data.length ) { + prom_ld = rs1.data.data[0]; + } + }) + + if(prom_ld){ + gg.discount_field=prom_ld.discount_field; + } + } + if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { var prom = null; @@ -1122,7 +1144,7 @@ Page({ if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { //-- 优惠促销的时候控制取价规则 -- - if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ) { + if((gg.prom_type!=3 && gg.prom_type!=10) || gg.discount_field==undefined || gg.discount_field==0 ) { if (card_field && gg[card_field] > 0) { if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 @@ -1132,7 +1154,7 @@ Page({ if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 } }else{ - if(good.prom_type==3){ + if(good.prom_type==3 && good.prom_type==10){ switch (gg.discount_field){ case 1: if (good.goods_price != gg.shop_price) isok = 0; diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index d0750bd..5226c44 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -1125,6 +1125,7 @@ Page({ }) + //优惠促销获取取价规则 if(gg.prom_type==3){ var prom_pc=null; await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { @@ -1136,6 +1137,27 @@ Page({ } } + //阶梯促销获取取价规则 + if(gg.prom_type==10){ + var prom_ld=null; + //-- 获取阶梯规则 -- + var url1 = "/api/weshop/prom/ladderList/list"; + var req_data = { + store_id: os.stoid, + form_id: gg.prom_id, + } + await getApp().request.promiseGet(url1, { + data: req_data + }).then(rs1 => { + if (rs1.data.code == 0 && rs1.data.data && rs1.data.data.length ) { + prom_ld = rs1.data.data[0]; + } + }) + + if(prom_ld){ + gg.discount_field=prom_ld.discount_field; + } + } if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { @@ -1417,7 +1439,7 @@ Page({ //-- 优惠促销的时候控制取价规则 -- - if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ){ + if( (gg.prom_type!=3 && gg.prom_type!=10 ) || gg.discount_field==undefined || gg.discount_field==0 ){ if (card_field && gg[card_field] > 0) { if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 @@ -1428,7 +1450,7 @@ Page({ } }else{ - if(good.prom_type==3){ + if(good.prom_type==3 || good.prom_type==10 ){ switch (gg.discount_field){ case 1: if (good.goods_price != gg.shop_price) isok = 0; -- libgit2 0.21.4