Commit 71872ed72cef3bb478c3f0710e2ddf750feab8ac

Authored by WXD-SEASON\season
2 parents 6c2a73d1 af940be4

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into test

packageE/pages/cart/cart2/cart2.js
@@ -2065,7 +2065,12 @@ Page({ @@ -2065,7 +2065,12 @@ Page({
2065 } 2065 }
2066 } 2066 }
2067 2067
2068 - //调用函数计算每件商品的单价 2068 + for (var i in c_arr) {
  2069 + var cart_item = c_arr[i];
  2070 + cart_item.prom_pt_json=[];
  2071 + }
  2072 +
  2073 + //调用函数计算每件商品的单价
2069 await th.calc_per(c_arr); 2074 await th.calc_per(c_arr);
2070 2075
2071 //调用函数计算每件组合购商品的单价, 2076 //调用函数计算每件组合购商品的单价,
@@ -2152,6 +2157,8 @@ Page({ @@ -2152,6 +2157,8 @@ Page({
2152 2157
2153 2158
2154 var whsle_goods_price = 0; 2159 var whsle_goods_price = 0;
  2160 + var no_zh_all_quan_num=0; //不是组合购商品的使用的优惠券综合
  2161 +
2155 //--------循环计算总价----------- 2162 //--------循环计算总价-----------
2156 for (var jc = 0; jc < item.length; jc++) { 2163 for (var jc = 0; jc < item.length; jc++) {
2157 2164
@@ -2175,7 +2182,9 @@ Page({ @@ -2175,7 +2182,9 @@ Page({
2175 2182
2176 if (is_no_zh) { 2183 if (is_no_zh) {
2177 o_price_no_zh += item[jc].goods_price * item[jc].goods_num; 2184 o_price_no_zh += item[jc].goods_price * item[jc].goods_num;
  2185 + if(item[jc].quan_num && item[jc].quan_num>0) no_zh_all_quan_num += item[jc].quan_num;
2178 } 2186 }
  2187 +
2179 o_price += item[jc].goods_price * item[jc].goods_num; 2188 o_price += item[jc].goods_price * item[jc].goods_num;
2180 2189
2181 //--- 秒杀, 团购的时候,判断有没有订单优惠和包邮模板的叠加 --- 2190 //--- 秒杀, 团购的时候,判断有没有订单优惠和包邮模板的叠加 ---
@@ -2246,9 +2255,17 @@ Page({ @@ -2246,9 +2255,17 @@ Page({
2246 var quan_no_goods_arr = null; 2255 var quan_no_goods_arr = null;
2247 var ord_prom = null; 2256 var ord_prom = null;
2248 2257
  2258 +
  2259 + var ord_prom_condition=0;
  2260 + if(o_price_no_zh){
  2261 + ord_prom_condition=o_price_no_zh-whsle_goods_price-no_zh_all_quan_num;
  2262 + }else{
  2263 + ord_prom_condition=o_price - quan_price - whsle_goods_price - no_order_yh;
  2264 + }
  2265 +
2249 //---判断是不是有订单优惠--- 2266 //---判断是不是有订单优惠---
2250 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { 2267 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
2251 - data: { store_id: os.stoid, orderAmount: parseFloat(o_price - quan_price - whsle_goods_price - no_order_yh).toFixed(2), user_id: getApp().globalData.user_id } 2268 + data: { store_id: os.stoid, orderAmount: parseFloat(ord_prom_condition).toFixed(2), user_id: getApp().globalData.user_id }
2252 }).then(res => { 2269 }).then(res => {
2253 if (res.data.code == 0) { 2270 if (res.data.code == 0) {
2254 ord_prom = res.data.data; 2271 ord_prom = res.data.data;
@@ -2301,6 +2318,11 @@ Page({ @@ -2301,6 +2318,11 @@ Page({
2301 } 2318 }
2302 2319
2303 2320
  2321 +
  2322 +
  2323 +
  2324 +
  2325 +
2304 //-- 如果没有订单优惠,或者订单优惠中有勾选包邮模板 -- 2326 //-- 如果没有订单优惠,或者订单优惠中有勾选包邮模板 --
2305 if (!ord_prom || ord_prom.is_post_temp) { 2327 if (!ord_prom || ord_prom.is_post_temp) {
2306 var user_addr = th.data.user_addr; 2328 var user_addr = th.data.user_addr;
@@ -2476,11 +2498,11 @@ Page({ @@ -2476,11 +2498,11 @@ Page({
2476 2498
2477 //看一下是不是不用组合购的订单优惠的叠加 2499 //看一下是不是不用组合购的订单优惠的叠加
2478 if (is_has_zh) { 2500 if (is_has_zh) {
2479 - o_condition = o_price_no_zh - quan_price; 2501 + o_condition = o_price_no_zh - no_zh_all_quan_num;
2480 } 2502 }
2481 //看一下是不是不用组合购的订单优惠的叠加 2503 //看一下是不是不用组合购的订单优惠的叠加
2482 if (is_has_ladder) { 2504 if (is_has_ladder) {
2483 - o_condition = o_price_no_zh - quan_price; 2505 + o_condition = o_price_no_zh - no_zh_all_quan_num;
2484 } 2506 }
2485 2507
2486 if (whsle_goods_price > 0) { 2508 if (whsle_goods_price > 0) {
@@ -2492,6 +2514,7 @@ Page({ @@ -2492,6 +2514,7 @@ Page({
2492 if (no_order_yh) { 2514 if (no_order_yh) {
2493 o_condition = o_condition - no_order_yh; 2515 o_condition = o_condition - no_order_yh;
2494 t_o_condition = t_o_condition - no_order_yh; 2516 t_o_condition = t_o_condition - no_order_yh;
  2517 + o_price_no_zh = o_price_no_zh - no_order_yh;
2495 } 2518 }
2496 2519
2497 var order_m = 0; 2520 var order_m = 0;
@@ -5994,6 +6017,7 @@ Page({ @@ -5994,6 +6017,7 @@ Page({
5994 var bn_coll= this.selectComponent('#bn_coll'); 6017 var bn_coll= this.selectComponent('#bn_coll');
5995 bn_coll.clear_sele(); 6018 bn_coll.clear_sele();
5996 this.setData({ collocation_goods: [] }); 6019 this.setData({ collocation_goods: [] });
  6020 + this.data.old_cartlist=null;
5997 //让主商品的活动变成5,搭配购 6021 //让主商品的活动变成5,搭配购
5998 if(this.data.bn_goods==5) 6022 if(this.data.bn_goods==5)
5999 this.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0 }); 6023 this.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0 });
packageE/pages/user/punchInhistory/punchInhistory.wxss
@@ -267,7 +267,7 @@ page{ @@ -267,7 +267,7 @@ page{
267 .tiny_box2 { 267 .tiny_box2 {
268 display: flex; 268 display: flex;
269 flex-direction: column; 269 flex-direction: column;
270 - width: 40%; 270 + width: 100%;
271 } 271 }
272 .tiny_box3 { 272 .tiny_box3 {
273 display: flex; 273 display: flex;
pages/goods/goodsInfo/goodsInfo.js
@@ -2033,7 +2033,7 @@ Page({ @@ -2033,7 +2033,7 @@ Page({
2033 //----先看会员在购物车中是否加入了该商品,立即购买的----- 2033 //----先看会员在购物车中是否加入了该商品,立即购买的-----
2034 getApp().request.get("/api/weshop/cart/page", { 2034 getApp().request.get("/api/weshop/cart/page", {
2035 data: { 2035 data: {
2036 - store_id: e.data.stoid, 2036 + store_id: os.stoid,
2037 user_id: oo.user_id, 2037 user_id: oo.user_id,
2038 state: 1 2038 state: 1
2039 }, 2039 },
@@ -2070,7 +2070,7 @@ Page({ @@ -2070,7 +2070,7 @@ Page({
2070 //----先看会员在购物车中是否加入了该商品,立即购买的----- 2070 //----先看会员在购物车中是否加入了该商品,立即购买的-----
2071 getApp().request.get("/api/weshop/cart/page", { 2071 getApp().request.get("/api/weshop/cart/page", {
2072 data: { 2072 data: {
2073 - store_id: e.data.stoid, 2073 + store_id: os.stoid,
2074 user_id: oo.user_id, 2074 user_id: oo.user_id,
2075 state: 1 2075 state: 1
2076 }, 2076 },
@@ -2105,7 +2105,7 @@ Page({ @@ -2105,7 +2105,7 @@ Page({
2105 //----先看会员在购物车中是否加入了该商品,立即购买的----- 2105 //----先看会员在购物车中是否加入了该商品,立即购买的-----
2106 getApp().request.get("/api/weshop/cart/page", { 2106 getApp().request.get("/api/weshop/cart/page", {
2107 data: { 2107 data: {
2108 - store_id: e.data.stoid, 2108 + store_id: os.stoid,
2109 user_id: oo.user_id, 2109 user_id: oo.user_id,
2110 state: 1 2110 state: 1
2111 }, 2111 },
@@ -2155,7 +2155,7 @@ Page({ @@ -2155,7 +2155,7 @@ Page({
2155 //----先看会员在购物车中是否加入了该商品,立即购买的----- 2155 //----先看会员在购物车中是否加入了该商品,立即购买的-----
2156 getApp().request.get("/api/weshop/cart/page", { 2156 getApp().request.get("/api/weshop/cart/page", {
2157 data: { 2157 data: {
2158 - store_id: e.data.stoid, 2158 + store_id: os.stoid,
2159 user_id: oo.user_id, 2159 user_id: oo.user_id,
2160 state: 1 2160 state: 1
2161 }, 2161 },
@@ -5093,7 +5093,7 @@ Page({ @@ -5093,7 +5093,7 @@ Page({
5093 //----先看会员在购物车中是否加入了该商品,立即购买的----- 5093 //----先看会员在购物车中是否加入了该商品,立即购买的-----
5094 getApp().request.get("/api/weshop/cart/page", { 5094 getApp().request.get("/api/weshop/cart/page", {
5095 data: { 5095 data: {
5096 - store_id: e.store_id, 5096 + store_id: os.stoid,
5097 user_id: oo.user_id, 5097 user_id: oo.user_id,
5098 state: 1 5098 state: 1
5099 }, 5099 },
@@ -5102,7 +5102,7 @@ Page({ @@ -5102,7 +5102,7 @@ Page({
5102 if (res.data.code == 0 && res.data.data.total > 0) { 5102 if (res.data.code == 0 && res.data.data.total > 0) {
5103 for (let j in res.data.data.pageData) { 5103 for (let j in res.data.data.pageData) {
5104 let item_j = res.data.data.pageData[j]; 5104 let item_j = res.data.data.pageData[j];
5105 - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; 5105 + var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id;
5106 getApp().request.delete(url, {}); 5106 getApp().request.delete(url, {});
5107 } 5107 }
5108 } 5108 }
@@ -7484,11 +7484,12 @@ Page({ @@ -7484,11 +7484,12 @@ Page({
7484 7484
7485 7485
7486 var is_ok=1; 7486 var is_ok=1;
7487 -  
7488 if (r_data.ladderLists) { 7487 if (r_data.ladderLists) {
7489 var act_id = r_data.ladderLists[0].form_id; 7488 var act_id = r_data.ladderLists[0].form_id;
7490 //-- 判断会员能不能参与阶梯促销 -- 7489 //-- 判断会员能不能参与阶梯促销 --
7491 await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { 7490 await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => {
  7491 +
  7492 +
7492 if (res.data.code == 0 && res.data.data) { 7493 if (res.data.code == 0 && res.data.data) {
7493 var prom_content = ""; 7494 var prom_content = "";
7494 //暂定优惠促销还不能重叠 7495 //暂定优惠促销还不能重叠
@@ -7520,6 +7521,13 @@ Page({ @@ -7520,6 +7521,13 @@ Page({
7520 return false; 7521 return false;
7521 } 7522 }
7522 7523
  7524 + obj = {
  7525 + act_id: 0,
  7526 + prom_type:0
  7527 + }
  7528 + back(obj);
  7529 +
  7530 +
7523 } 7531 }
7524 } 7532 }
7525 }) 7533 })