Commit 1b18333f867fa8294f3e860c7b0fb32925c6543f

Authored by yvan.ni
1 parent 4bceb6a4

订单详情待支付的优化

pages/user/order_detail/order_detail.js
... ... @@ -844,6 +844,28 @@ Page({
844 844 }
845 845 }
846 846  
  847 + //阶梯促销获取取价规则
  848 + if(gg.prom_type==10){
  849 + var prom_ld=null;
  850 + //-- 获取阶梯规则 --
  851 + var url1 = "/api/weshop/prom/ladderList/list";
  852 + var req_data = {
  853 + store_id: os.stoid,
  854 + form_id: gg.prom_id,
  855 + }
  856 + await getApp().request.promiseGet(url1, {
  857 + data: req_data
  858 + }).then(rs1 => {
  859 + if (rs1.data.code == 0 && rs1.data.data && rs1.data.data.length ) {
  860 + prom_ld = rs1.data.data[0];
  861 + }
  862 + })
  863 +
  864 + if(prom_ld){
  865 + gg.discount_field=prom_ld.discount_field;
  866 + }
  867 + }
  868 +
847 869 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)
848 870 && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
849 871 var prom = null;
... ... @@ -1122,7 +1144,7 @@ Page({
1122 1144 if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) {
1123 1145  
1124 1146 //-- 优惠促销的时候控制取价规则 --
1125   - if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ) {
  1147 + if((gg.prom_type!=3 && gg.prom_type!=10) || gg.discount_field==undefined || gg.discount_field==0 ) {
1126 1148 if (card_field && gg[card_field] > 0) {
1127 1149 if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
1128 1150 if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
... ... @@ -1132,7 +1154,7 @@ Page({
1132 1154 if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
1133 1155 }
1134 1156 }else{
1135   - if(good.prom_type==3){
  1157 + if(good.prom_type==3 && good.prom_type==10){
1136 1158 switch (gg.discount_field){
1137 1159 case 1:
1138 1160 if (good.goods_price != gg.shop_price) isok = 0;
... ...
pages/user/order_list/order_list.js
... ... @@ -1125,6 +1125,7 @@ Page({
1125 1125 })
1126 1126  
1127 1127  
  1128 + //优惠促销获取取价规则
1128 1129 if(gg.prom_type==3){
1129 1130 var prom_pc=null;
1130 1131 await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => {
... ... @@ -1136,6 +1137,27 @@ Page({
1136 1137 }
1137 1138 }
1138 1139  
  1140 + //阶梯促销获取取价规则
  1141 + if(gg.prom_type==10){
  1142 + var prom_ld=null;
  1143 + //-- 获取阶梯规则 --
  1144 + var url1 = "/api/weshop/prom/ladderList/list";
  1145 + var req_data = {
  1146 + store_id: os.stoid,
  1147 + form_id: gg.prom_id,
  1148 + }
  1149 + await getApp().request.promiseGet(url1, {
  1150 + data: req_data
  1151 + }).then(rs1 => {
  1152 + if (rs1.data.code == 0 && rs1.data.data && rs1.data.data.length ) {
  1153 + prom_ld = rs1.data.data[0];
  1154 + }
  1155 + })
  1156 +
  1157 + if(prom_ld){
  1158 + gg.discount_field=prom_ld.discount_field;
  1159 + }
  1160 + }
1139 1161  
1140 1162 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)
1141 1163 && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
... ... @@ -1417,7 +1439,7 @@ Page({
1417 1439  
1418 1440  
1419 1441 //-- 优惠促销的时候控制取价规则 --
1420   - if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ){
  1442 + if( (gg.prom_type!=3 && gg.prom_type!=10 ) || gg.discount_field==undefined || gg.discount_field==0 ){
1421 1443 if (card_field && gg[card_field] > 0) {
1422 1444 if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
1423 1445 if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
... ... @@ -1428,7 +1450,7 @@ Page({
1428 1450 }
1429 1451 }else{
1430 1452  
1431   - if(good.prom_type==3){
  1453 + if(good.prom_type==3 || good.prom_type==10 ){
1432 1454 switch (gg.discount_field){
1433 1455 case 1:
1434 1456 if (good.goods_price != gg.shop_price) isok = 0;
... ...