Commit ba3d4e4e6762fd6b23339c3bcfd921edd33bc5a3

Authored by yvan.ni
1 parent 5eb61220

订单促销的优化

packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -80,6 +80,13 @@ Page({
80 80 bconfig: null,
81 81 showFold:true,
82 82 template_id:[],
  83 +
  84 + //-- 订单促销判断积累 ---2024-2-20
  85 + order_prom_map_ck: {},
  86 + //能不能使用订单促销
  87 + can_use_ord_prom:{},
  88 + //存储订单促销的取价,按照门店进行索引
  89 + show_ord_prom:{},
83 90 },
84 91  
85 92  
... ... @@ -513,6 +520,7 @@ Page({
513 520 }
514 521  
515 522  
  523 + t.data.data.shop_price_y = t.data.data.shop_price;
516 524 t.data.data.shop_price = gg.goods_price;
517 525 //--如果是普通购买的时候--
518 526 if (gg.is_normal == 1) {
... ... @@ -569,7 +577,10 @@ Page({
569 577 }
570 578  
571 579  
  580 + t.data.data.goods_price=th.data.param.goods_price;
572 581  
  582 + //用深拷贝把商品缓存起来,方便后面使用
  583 + th.data.old_bn_goods=ut.deep_cp(t.data.data);
573 584  
574 585 th.setData({
575 586 bn_goods: t.data.data,
... ... @@ -642,6 +653,9 @@ Page({
642 653  
643 654 }
644 655  
  656 + t.data.data.goods_price=th.data.param.goods_price;
  657 + //用深拷贝把商品缓存起来,方便后面使用
  658 + th.data.old_bn_goods=ut.deep_cp(t.data.data);
645 659  
646 660 th.setData({
647 661 bn_goods: t.data.data,
... ... @@ -651,7 +665,6 @@ Page({
651 665 bn_exp_type: et
652 666 });
653 667  
654   -
655 668 //计算价格
656 669 th.calculatePrice2();
657 670 }
... ... @@ -842,7 +855,9 @@ Page({
842 855 //-----------计算商品总价--------------
843 856 //var allpice = th.data.param.goods_price;
844 857 var allpice = (th.data.act.group_price/100).toFixed(2);
845   -
  858 + if(th.data.can_use_ord_prom[th.data.bn_pick]){
  859 + allpice=th.data.param.goods_price*th.data.bn_goods.buynum;
  860 + }
846 861  
847 862 allpice = parseFloat(allpice).toFixed(2);
848 863 var txt = "formData.all_price";
... ... @@ -868,14 +883,18 @@ Page({
868 883 var ord_prom=null;
869 884 var o_condition=allpice;
870 885 if(th.data.act.is_order_yh){
  886 + // await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  887 + // data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
  888 + // }).then(res => {
  889 + // if (res.data.code == 0) {
  890 + // ord_prom = res.data.data;
  891 + // }
  892 + // })
  893 +
  894 + th.set_by_now_ord_prom(th.data.bn_goods);
  895 + th.data.order_prom_map_ck[th.data.bn_pick].goods_price_all=o_condition;
  896 + ord_prom=await th.get_cur_ord_prom(th.data.bn_pick);
871 897  
872   - await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
873   - data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
874   - }).then(res => {
875   - if (res.data.code == 0) {
876   - ord_prom = res.data.data;
877   - }
878   - })
879 898 }
880 899  
881 900  
... ... @@ -964,7 +983,7 @@ Page({
964 983 title: "物流配置未启用物流公司", icon: 'none', duration: 2000
965 984 })
966 985 //th.setData({ show_submit:0, });
967   - th.setData({show_submit:1, submit: 0,same_ok:0 })
  986 + th.setData({show_submit:1, submit: 0,same_ok:0,sub:0 })
968 987 return false;
969 988 }
970 989  
... ... @@ -996,7 +1015,7 @@ Page({
996 1015 wx.showToast({
997 1016 title: "计算物流错误", icon: 'none', duration: 2000
998 1017 })
999   - th.setData({show_submit:1, submit: 0,same_ok:0 })
  1018 + th.setData({show_submit:1, submit: 0,same_ok:0,sub:0 })
1000 1019 return false;
1001 1020 }
1002 1021  
... ... @@ -1289,7 +1308,7 @@ Page({
1289 1308 // 提交订单前弹出确认对话框
1290 1309 submitConfirm(e) {
1291 1310 // is_show为0不显示温馨提示,为1显示温馨提示
1292   - if (this.data.param.is_show == 1) {
  1311 + if (this.data.param.is_show == 1 && !this.data.can_use_ord_prom[this.data.bn_pick]) {
1293 1312 wx.showModal({
1294 1313 title: '温馨提示',
1295 1314 content: this.data.param.alert,
... ... @@ -1451,6 +1470,18 @@ Page({
1451 1470 'prom_id': th.data.param.group_id, //促销活动id
1452 1471 };
1453 1472  
  1473 +
  1474 + if(th.data.bn_goods.discount_field){
  1475 + goods.discount_field=th.data.bn_goods.discount_field;
  1476 + }
  1477 +
  1478 + //如果有参与非实收的订单促销,那么就相当于是普通购买
  1479 + if(th.data.can_use_ord_prom[th.data.bn_pick]){
  1480 + goods.is_integral_normal=1;
  1481 + goods.prom_type=0;
  1482 + goods.prom_id=0;
  1483 + }
  1484 +
1454 1485 if (getApp().globalData.skinface_id) {
1455 1486 goods.skinface_id = getApp().globalData.skinface_id;
1456 1487 }
... ... @@ -2085,9 +2116,146 @@ Page({
2085 2116 th.calculatePrice2();
2086 2117 },
2087 2118  
  2119 + //-- 获取订单促销的判断结构 --
  2120 + set_by_now_ord_prom(item){
  2121 + let pickid=this.data.bn_pick;
  2122 + let order_prom_map_ck= this.data.order_prom_map_ck;
  2123 + order_prom_map_ck[pickid]={
  2124 + shop_price_all:0, //手店价的累计
  2125 + market_price_all:0, //市场价的累计
  2126 + goods_price_all:0, //实收价的累计
  2127 + no_ord_price:0, //要累计上不参与订单促销的金额
  2128 + goodsList:[],
  2129 + }
  2130 +
  2131 + let pk_ord_map=order_prom_map_ck[pickid];
  2132 + pk_ord_map.shop_price_all += item.shop_price_y * item.buynum;
  2133 + pk_ord_map.market_price_all += item.goods_market_price * item.buynum;
  2134 +
  2135 + },
  2136 +
  2137 + //获取当前进行中订单促销,同时带入相应的金额判断订单促销是不是运行,同时订单促销的条件不是实收价判断的话,默认的时候,订单促销是不参与运算的
  2138 + async get_cur_ord_prom(pickid) {
  2139 + let ord_prom = null;
  2140 + let order_prom_map_ck = this.data.order_prom_map_ck[pickid];
  2141 + if(!order_prom_map_ck) return null;
  2142 +
  2143 + //获取当前进行中的优惠促销
  2144 + await getApp().request.promiseGet("/api/weshop/promorder/getPromOrder", {
  2145 + data: {
  2146 + store_id: os.stoid,
  2147 + orderAmount: -1, //-1为不判断金额条件
  2148 + user_id: getApp().globalData.user_id
  2149 + }
  2150 + }).then(res => {
  2151 + if (res.data.code == 0) {
  2152 + ord_prom = res.data.data;
  2153 + }
  2154 + })
  2155 +
  2156 + if (!ord_prom) return null;
  2157 + //用于计算订单促销的金额
  2158 + let calculate_price=0;
  2159 +
  2160 + let txt1='show_ord_prom['+pickid+']';
  2161 + //-- 此时判断活动的金额满足与否 --
  2162 + switch (ord_prom.discount_field) {
  2163 + //实收价的时候
  2164 + case 0:
  2165 + //要先还原
  2166 + this.setData({
  2167 + [txt1]: 0
  2168 + });
  2169 +
  2170 + if (ord_prom.money > order_prom_map_ck.goods_price_all){
  2171 + return null;
  2172 + }
  2173 + break;
  2174 + //手店价的时候
  2175 + case 1:
  2176 + if (ord_prom.money > order_prom_map_ck.shop_price_all){
  2177 + //要先还原
  2178 + this.setData({
  2179 + [txt1]: 0
  2180 + });
  2181 + return null;
  2182 + }
  2183 + //要显示订单促销使用的按钮
  2184 + this.setData({
  2185 + [txt1]: 1
  2186 + });
  2187 + break;
  2188 + //市场价的时候
  2189 + case 2:
  2190 + if (ord_prom.money > order_prom_map_ck.market_price_all){
  2191 + //要先还原
  2192 + this.setData({
  2193 + [txt1]: 0
  2194 + });
  2195 + return null;
  2196 + }
  2197 + //要显示订单促销使用的按钮
  2198 + this.setData({
  2199 + [txt1]: 2
  2200 + });
  2201 + break;
  2202 + }
  2203 + //如果订单促销是不参与订单促销的,那么就直接返回null(订单促销不是实收价的时候)
  2204 + if(ord_prom.discount_field>0 && !this.data.can_use_ord_prom[pickid]){
  2205 + return null;
  2206 + }
  2207 + return ord_prom;
  2208 + },
  2209 +
  2210 + //立即购买的时候,点击订单促销的参与
  2211 + set_can_use_ord_prom_now:function (e){
  2212 +
  2213 + if(this.data.sub) return false;
  2214 + this.setData({ sub: 1,same_ok:1 });
2088 2215  
  2216 + let pickid=this.data.bn_pick;
  2217 + let txt = 'can_use_ord_prom[' + pickid + ']';
  2218 + let can_use = this.data.can_use_ord_prom[pickid] ? this.data.can_use_ord_prom[pickid] : 0;
  2219 + this.setData({
  2220 + [txt]: !can_use
  2221 + })
2089 2222  
  2223 + let th=this;
  2224 + let good=th.data.bn_goods;
  2225 + let param=th.data.param;
2090 2226  
  2227 + //如果有要参与订单促销的按钮点击后,要修改商品的价格
  2228 + if(th.data.can_use_ord_prom[pickid]){
  2229 + let discount_field=th.data.show_ord_prom[pickid];
  2230 + switch (discount_field){
  2231 + case 1:
  2232 + good.shop_price=good.shop_price_y;
  2233 + param.goods_price=good.shop_price_y;
  2234 + break;
  2235 + case 2:
  2236 + good.shop_price=good.market_price;
  2237 + param.goods_price=good.market_price;
  2238 + break;
  2239 + }
  2240 + //-- 转成普通商品 ---
  2241 + good.prom_type=0;
  2242 + good.prom_id=0;
  2243 + good.discount_field=discount_field;
  2244 + }else{
  2245 + good=ut.deep_cp(th.data.old_bn_goods);
  2246 + param.goods_price=good.goods_price;
  2247 + }
  2248 +
  2249 + th.setData({
  2250 + bn_goods:good,
  2251 + param
  2252 + })
  2253 + wx.showLoading({
  2254 + title: "处理中.",
  2255 + mark:true
  2256 + })
  2257 + th.calculatePrice2()
  2258 + }
2091 2259  
2092 2260  
2093 2261 });
... ...
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
... ... @@ -100,6 +100,14 @@
100 100 <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
101 101 </view>
102 102  
  103 + <!-- 订单促销取价规则的优化 -->
  104 + <view class="set-mes" wx:if="{{show_ord_prom[bn_pick]}}">
  105 + <view class="use-item" >
  106 + <icon bindtap='set_can_use_ord_prom_now' color="{{can_use_ord_prom[bn_pick]?'red':'gray'}}" size="16" type="success"></icon>
  107 + <view bindtap='set_can_use_ord_prom_now' class="yu_er">参与订单促销</view>
  108 + </view>
  109 + </view>
  110 +
103 111 <!--阶梯团是不显示的-->
104 112 <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
105 113 <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}">
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -2198,6 +2198,9 @@ Page({
2198 2198 }).then(res => {
2199 2199 if (res.data.code == 0) {
2200 2200 prom_ord = res.data.data;
  2201 +
  2202 + //如果订单促销的取价不是实收,清空订单促销
  2203 + if(prom_ord && prom_ord.discount_field>0) prom_ord=null;
2201 2204 }
2202 2205  
2203 2206 })
... ...
packageC/pages/presell/cart/cart2.js
... ... @@ -134,7 +134,14 @@ Page({
134 134 bconfig:null,
135 135 showFold:true,
136 136  
137   - is_fwk:0 //-- 判断是不是服务卡项订单 --
  137 + is_fwk:0, //-- 判断是不是服务卡项订单 --
  138 +
  139 + //-- 订单促销判断积累 ---2024-2-20
  140 + order_prom_map_ck: {},
  141 + //能不能使用订单促销
  142 + can_use_ord_prom:{},
  143 + //存储订单促销的取价,按照门店进行索引
  144 + show_ord_prom:{},
138 145 },
139 146  
140 147  
... ... @@ -595,7 +602,7 @@ Page({
595 602 });
596 603 },
597 604  
598   - //-- 获取到服务卡项的详情 --
  605 + //-- 获取到商品的详情 --
599 606 get_goods_detail(act, prelist,gg){
600 607 var th = this;
601 608 //--------如果goods_id一样,就是要立即购买-----
... ... @@ -728,7 +735,10 @@ Page({
728 735 }
729 736  
730 737 //这个位置要拿活动的预售价
  738 + t.data.data.shop_price_y = t.data.data.shop_price;
731 739 t.data.data.shop_price = prelist.presell_money;
  740 + th.data.old_bn_goods=ut.deep_cp(t.data.data);
  741 +
732 742 th.setData({
733 743 bn_goods: t.data.data,
734 744 bn_pickname: gg.pick_name,
... ... @@ -832,6 +842,7 @@ Page({
832 842 // }
833 843  
834 844 th.setData({dis_btn:1})
  845 + this.data.submit=0;
835 846  
836 847 wx.showLoading({
837 848 title: "处理中.",mask:true
... ... @@ -901,14 +912,18 @@ Page({
901 912 //-- 判断订单优惠的叠加 --
902 913 var ord_prom=null;
903 914 var o_condition=allpice;
904   - if (o_condition > 0 && th.data.act.is_useorderyh) {
905   - await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
906   - data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
907   - }).then(res => {
908   - if (res.data.code == 0) {
909   - ord_prom = res.data.data;
910   - }
911   - })
  915 + if (th.data.act.is_useorderyh) {
  916 + // await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  917 + // data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
  918 + // }).then(res => {
  919 + // if (res.data.code == 0) {
  920 + // ord_prom = res.data.data;
  921 + // }
  922 + // })
  923 +
  924 + th.set_by_now_ord_prom(th.data.bn_goods);
  925 + th.data.order_prom_map_ck[bn_pick].goods_price_all=o_condition;
  926 + ord_prom=await th.get_cur_ord_prom(bn_pick);
912 927 }
913 928  
914 929 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮,同时商品购买时候,服务卡项购买不计算运费----------
... ... @@ -1568,6 +1583,17 @@ Page({
1568 1583 'prom_id': th.data.bn_goods.prom_id, //促销活动id
1569 1584 };
1570 1585  
  1586 + if(th.data.bn_goods.discount_field){
  1587 + goods.discount_field=th.data.bn_goods.discount_field;
  1588 + }
  1589 +
  1590 + //如果有参与非实收的订单促销,那么就相当于是普通购买
  1591 + if(th.data.can_use_ord_prom[th.data.bn_pick]){
  1592 + goods.is_integral_normal=1;
  1593 + }
  1594 +
  1595 +
  1596 +
1571 1597 if(getApp().globalData.skinface_id){
1572 1598 goods.skinface_id=getApp().globalData.skinface_id;
1573 1599 }
... ... @@ -3179,8 +3205,148 @@ Page({
3179 3205 url= "/pages/goods/goodsInfo/goodsInfo?goods_id="+gid;
3180 3206 }
3181 3207 getApp().goto(url);
  3208 + },
  3209 +
  3210 +
  3211 + //-- 获取订单促销的判断结构 --
  3212 + set_by_now_ord_prom(item){
  3213 + let pickid=this.data.bn_pick;
  3214 + let order_prom_map_ck= this.data.order_prom_map_ck;
  3215 + order_prom_map_ck[pickid]={
  3216 + shop_price_all:0, //手店价的累计
  3217 + market_price_all:0, //市场价的累计
  3218 + goods_price_all:0, //实收价的累计
  3219 + no_ord_price:0, //要累计上不参与订单促销的金额
  3220 + goodsList:[],
  3221 + }
  3222 +
  3223 + let pk_ord_map=order_prom_map_ck[pickid];
  3224 + pk_ord_map.shop_price_all += item.shop_price_y * item.buynum;
  3225 + pk_ord_map.market_price_all += item.goods_market_price * item.buynum;
  3226 +
  3227 + },
  3228 +
  3229 + //获取当前进行中订单促销,同时带入相应的金额判断订单促销是不是运行,同时订单促销的条件不是实收价判断的话,默认的时候,订单促销是不参与运算的
  3230 + async get_cur_ord_prom(pickid) {
  3231 + let ord_prom = null;
  3232 + let order_prom_map_ck = this.data.order_prom_map_ck[pickid];
  3233 + if(!order_prom_map_ck) return null;
  3234 +
  3235 + //获取当前进行中的优惠促销
  3236 + await getApp().request.promiseGet("/api/weshop/promorder/getPromOrder", {
  3237 + data: {
  3238 + store_id: os.stoid,
  3239 + orderAmount: -1, //-1为不判断金额条件
  3240 + user_id: getApp().globalData.user_id
  3241 + }
  3242 + }).then(res => {
  3243 + if (res.data.code == 0) {
  3244 + ord_prom = res.data.data;
  3245 + }
  3246 + })
  3247 +
  3248 + if (!ord_prom) return null;
  3249 + //用于计算订单促销的金额
  3250 + let calculate_price=0;
  3251 +
  3252 + let txt1='show_ord_prom['+pickid+']';
  3253 + //-- 此时判断活动的金额满足与否 --
  3254 + switch (ord_prom.discount_field) {
  3255 + //实收价的时候
  3256 + case 0:
  3257 + //要先还原
  3258 + this.setData({
  3259 + [txt1]: 0
  3260 + });
  3261 +
  3262 + if (ord_prom.money > order_prom_map_ck.goods_price_all){
  3263 + return null;
  3264 + }
  3265 + break;
  3266 + //手店价的时候
  3267 + case 1:
  3268 + if (ord_prom.money > order_prom_map_ck.shop_price_all){
  3269 + //要先还原
  3270 + this.setData({
  3271 + [txt1]: 0
  3272 + });
  3273 + return null;
  3274 + }
  3275 + //要显示订单促销使用的按钮
  3276 + this.setData({
  3277 + [txt1]: 1
  3278 + });
  3279 + break;
  3280 + //市场价的时候
  3281 + case 2:
  3282 + if (ord_prom.money > order_prom_map_ck.market_price_all){
  3283 + //要先还原
  3284 + this.setData({
  3285 + [txt1]: 0
  3286 + });
  3287 + return null;
  3288 + }
  3289 + //要显示订单促销使用的按钮
  3290 + this.setData({
  3291 + [txt1]: 2
  3292 + });
  3293 + break;
  3294 + }
  3295 + //如果订单促销是不参与订单促销的,那么就直接返回null(订单促销不是实收价的时候)
  3296 + if(ord_prom.discount_field>0 && !this.data.can_use_ord_prom[pickid]){
  3297 + return null;
  3298 + }
  3299 + return ord_prom;
  3300 + },
  3301 +
  3302 + //立即购买的时候,点击订单促销的参与
  3303 + set_can_use_ord_prom_now:function (e){
  3304 +
  3305 + if(this.data.submit || this.data.dis_btn) return false;
  3306 + this.data.submit=1;
  3307 +
  3308 + let pickid=this.data.bn_pick;
  3309 + let txt = 'can_use_ord_prom[' + pickid + ']';
  3310 + let can_use = this.data.can_use_ord_prom[pickid] ? this.data.can_use_ord_prom[pickid] : 0;
  3311 + this.setData({
  3312 + [txt]: !can_use
  3313 + })
  3314 +
  3315 + let th=this;
  3316 + let good=th.data.bn_goods;
  3317 +
  3318 + //如果有要参与订单促销的按钮点击后,要修改商品的价格
  3319 + if(th.data.can_use_ord_prom[pickid]){
  3320 + let discount_field=th.data.show_ord_prom[pickid];
  3321 + switch (discount_field){
  3322 + case 1:
  3323 + good.shop_price=good.shop_price_y;
  3324 + break;
  3325 + case 2:
  3326 + good.shop_price=good.market_price;
  3327 + break;
  3328 + }
  3329 + //-- 转成普通商品 ---
  3330 + good.prom_type=0;
  3331 + good.prom_id=0;
  3332 + good.integral=0;
  3333 + good.discount_field=discount_field;
  3334 +
  3335 + }else{
  3336 + good=ut.deep_cp(th.data.old_bn_goods);
  3337 + }
  3338 +
  3339 + th.setData({
  3340 + bn_goods:good
  3341 + })
  3342 + wx.showLoading({
  3343 + title: "处理中.",
  3344 + mark:true
  3345 + })
  3346 + th.calculatePrice2()
3182 3347 }
3183 3348  
3184 3349  
3185 3350  
  3351 +
3186 3352 });
... ...
packageC/pages/presell/cart/cart2.wxml
... ... @@ -150,6 +150,15 @@
150 150 <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
151 151 </view>
152 152  
  153 + <!-- 订单促销取价规则的优化 -->
  154 + <view class="set-mes" wx:if="{{show_ord_prom[bn_pick]}}">
  155 + <view class="use-item" >
  156 + <icon bindtap='set_can_use_ord_prom_now' color="{{can_use_ord_prom[bn_pick]?'red':'gray'}}" size="16" type="success"></icon>
  157 + <view bindtap='set_can_use_ord_prom_now' class="yu_er">参与订单促销</view>
  158 + </view>
  159 + </view>
  160 +
  161 +
153 162 <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" hidden="{{is_fwk}}"
154 163 wx:if="{{(selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null}}">
155 164 <view class="work-frame flex-space-between">
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -1085,16 +1085,16 @@ Page({
1085 1085 if (gdlist && gdlist.length) {
1086 1086 //查找商品item1有没有在gdlist中,就要把商品的prom_type清理0
1087 1087 let f_idx = gdlist.findIndex(function (ele) {
1088   - return ele.id == item1.id
  1088 + return ele.id == item.id
1089 1089 });
1090 1090 if (f_idx != -1) {
1091 1091 //开始变换商品的价格显示
1092   - switch (th.data.show_ord_prom[item1.pick_id]) {
  1092 + switch (th.data.show_ord_prom[item.pick_id]) {
1093 1093 case 1:
1094   - carr[i].goods_price = item1.shop_price;
  1094 + carr[i].goods_price = item.shop_price;
1095 1095 break;
1096 1096 case 2:
1097   - carr[i].goods_price = item1.goods_market_price;
  1097 + carr[i].goods_price = item.goods_market_price;
1098 1098 break;
1099 1099 }
1100 1100  
... ... @@ -1108,7 +1108,7 @@ Page({
1108 1108 break;
1109 1109 }
1110 1110 carr[i].prom_type = 0;
1111   - carr[i].discount_field = th.data.show_ord_prom[item1.pick_id];
  1111 + carr[i].discount_field = th.data.show_ord_prom[item.pick_id];
1112 1112 }
1113 1113 }
1114 1114 }
... ...
packageE/pages/cart/cart2_inte/cart2_inte.js
... ... @@ -757,7 +757,7 @@ Page({
757 757 //---如果有选择优惠券的情况下---
758 758 var quan_price = 0, bn_pick = th.data.bn_pick;
759 759  
760   - if (condition > 0 && th.data.bn_is_order_yh && !th.data.bn_goods.whsle_id) {
  760 + if (th.data.bn_is_order_yh && !th.data.bn_goods.whsle_id) {
761 761 // await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
762 762 // data: { store_id: os.stoid, orderAmount: condition, user_id: getApp().globalData.user_id }
763 763 // }).then(res => {
... ...
packageE/pages/cart/cart2_pt/cart2_pt.js
... ... @@ -855,7 +855,7 @@ Page({
855 855 // })
856 856  
857 857 th.set_by_now_ord_prom(th.data.bn_goods);
858   - th.data.order_prom_map_ck[bn_pick].goods_price_all=condition;
  858 + th.data.order_prom_map_ck[bn_pick].goods_price_all=o_condition;
859 859 ord_prom=await th.get_cur_ord_prom(bn_pick);
860 860 }
861 861  
... ... @@ -1484,6 +1484,15 @@ Page({
1484 1484 'prom_id': th.data.bn_goods.prom_id, //促销活动id
1485 1485 };
1486 1486  
  1487 + if(th.data.bn_goods.discount_field){
  1488 + goods.discount_field=th.data.bn_goods.discount_field;
  1489 + }
  1490 +
  1491 + //如果有参与非实收的订单促销,那么就相当于是普通购买
  1492 + if(th.data.can_use_ord_prom[th.data.bn_pick]){
  1493 + goods.is_integral_normal=1;
  1494 + }
  1495 +
1487 1496 if (getApp().globalData.skinface_id) {
1488 1497 goods.skinface_id = getApp().globalData.skinface_id;
1489 1498 }
... ...
packageE/pages/cart/cart_wk/cart_wk.js
... ... @@ -539,6 +539,9 @@ Page({
539 539 }).then(res => {
540 540 if (res.data.code == 0) {
541 541 ord_prom = res.data.data;
  542 +
  543 + //如果订单促销的取价不是实收,清空订单促销
  544 + if(prom_ord && prom_ord.discount_field>0) prom_ord=null;
542 545 }
543 546 })
544 547 }
... ...
packageG/pages/user/order_detail/order_detail.js
... ... @@ -1157,13 +1157,39 @@ Page({
1157 1157 //-- 优惠促销的时候控制取价规则 --
1158 1158 // gg.prom_type!=3 && gg.prom_type!=10 同时商品不是普通购买的时候,又参与优惠促销,阶梯促销
1159 1159 if((gg.prom_type!=3 && gg.prom_type!=10) || gg.discount_field==undefined || gg.discount_field==0 ) {
1160   - if (card_field && gg[card_field] > 0) {
1161   - if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
1162   - if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
1163 1160  
1164   - } else {
1165   - if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0;
1166   - if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1161 +
  1162 + //判断一下活动是不是有参与订单促销,并且订单促销的活动是不是实收取价,2024-2-23
  1163 + let ordprom_price_type=0;
  1164 + if(order.order_prom_id && good.prom_type==0){
  1165 + let p_rs= await getApp().request.promiseGet("/api/weshop/promorder/get/"+os.stoid+"/"+order.order_prom_id, {});
  1166 + if(p_rs && p_rs.data.code==0 && p_rs.data.data){
  1167 + let ord_p=p_rs.data.data;
  1168 + if(ord_p && ord_p.discount_field>0){
  1169 + ordprom_price_type=ord_p.discount_field
  1170 + }
  1171 + }
  1172 + }
  1173 + if(ordprom_price_type>0){
  1174 + //-- 看一下订单促销的取价规则 --
  1175 + switch (ordprom_price_type){
  1176 + case 1:
  1177 + if (good.goods_price != gg.shop_price) isok = 0;
  1178 + break;
  1179 + case 2:
  1180 + if (good.goods_price != gg.market_price) isok = 0;
  1181 + break;
  1182 + }
  1183 +
  1184 + }else {
  1185 + if (card_field && gg[card_field] > 0) {
  1186 + if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
  1187 + if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1188 +
  1189 + } else {
  1190 + if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0;
  1191 + if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1192 + }
1167 1193 }
1168 1194 }else{
1169 1195 if(good.prom_type==3 && good.prom_type==10){
... ...
pages/user/order_list/order_list.js
... ... @@ -1446,14 +1446,43 @@ Page({
1446 1446 //-- 优惠促销的时候控制取价规则 --
1447 1447 // gg.prom_type!=3 && gg.prom_type!=10 同时商品不是普通购买的时候,又参与优惠促销,阶梯促销
1448 1448 if((gg.prom_type!=3 && gg.prom_type!=10) || gg.discount_field==undefined || gg.discount_field==0 ){
1449   - if (card_field && gg[card_field] > 0) {
1450   - if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
1451   - if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
1452 1449  
1453   - } else {
1454   - if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0;
1455   - if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1450 + //判断一下活动是不是有参与订单促销,并且订单促销的活动是不是实收取价,2024-2-23
  1451 + let ordprom_price_type=0;
  1452 + if(order.order_prom_id && good.prom_type==0){
  1453 + let p_rs= await getApp().request.promiseGet("/api/weshop/promorder/get/"+os.stoid+"/"+order.order_prom_id, {});
  1454 + if(p_rs && p_rs.data.code==0 && p_rs.data.data){
  1455 + let ord_p=p_rs.data.data;
  1456 + if(ord_p && ord_p.discount_field>0){
  1457 + ordprom_price_type=ord_p.discount_field
  1458 + }
  1459 + }
  1460 + }
  1461 + if(ordprom_price_type>0){
  1462 + //-- 看一下订单促销的取价规则 --
  1463 + switch (ordprom_price_type){
  1464 + case 1:
  1465 + if (good.goods_price != gg.shop_price) isok = 0;
  1466 + break;
  1467 + case 2:
  1468 + if (good.goods_price != gg.market_price) isok = 0;
  1469 + break;
  1470 + }
  1471 +
  1472 + }else{
  1473 + if (card_field && gg[card_field] > 0) {
  1474 + if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0;
  1475 + if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1476 +
  1477 + } else {
  1478 + if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0;
  1479 + if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过
  1480 + }
1456 1481 }
  1482 +
  1483 +
  1484 +
  1485 +
1457 1486 }else{
1458 1487  
1459 1488 if(good.prom_type==3 || good.prom_type==10 ){
... ...