diff --git a/app.wxss b/app.wxss
index a37615e..e161419 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1206,5 +1206,15 @@ background: #ffe3e2;
}
+/* 去掉零售价划线 */
+.no_line_x{
+ text-decoration: none !important;
+ font-size: 24rpx !important;
+ color: #acaaaa !important;
+}
+.no_line_c{
+ text-decoration: none !important;
+}
+
diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml
index 97b65a3..e4c0fc1 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.wxml
+++ b/components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -73,7 +73,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -95,7 +95,7 @@
-
+
¥
{{item.market_price}}
@@ -111,7 +111,7 @@
-
+
¥
{{item.market_price}}
@@ -128,7 +128,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -156,7 +156,7 @@
-
+
¥
{{item.market_price}}
@@ -167,7 +167,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -248,7 +248,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -269,7 +269,7 @@
-
+
¥
{{item.market_price}}
@@ -285,7 +285,7 @@
-
+
¥
{{item.market_price}}
@@ -302,7 +302,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -330,7 +330,7 @@
-
+
¥
{{item.market_price}}
@@ -340,7 +340,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -423,7 +423,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -444,7 +444,7 @@
-
+
¥
{{item.market_price}}
@@ -460,7 +460,7 @@
-
+
¥
{{item.market_price}}
@@ -477,7 +477,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -505,7 +505,7 @@
-
+
¥
{{item.market_price}}
@@ -515,7 +515,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -600,7 +600,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -623,7 +623,7 @@
-
+
¥
{{item.market_price}}
@@ -639,7 +639,7 @@
-
+
¥
{{item.market_price}}
@@ -656,7 +656,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -683,7 +683,7 @@
-
+
¥
{{item.market_price}}
@@ -694,7 +694,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -801,7 +801,7 @@
+
¥{{aitem.prom_price}}
- ¥{{aitem.market_price}}
+ ¥{{aitem.market_price}}
@@ -822,7 +822,7 @@
-
+
¥
{{aitem.market_price}}
@@ -838,7 +838,7 @@
-
+
¥
{{aitem.market_price}}
@@ -855,7 +855,7 @@
{{filter.toFix(aitem.shop_price,2)}}
-
+
¥
{{aitem.market_price}}
@@ -883,7 +883,7 @@
-
+
¥
{{aitem.market_price}}
@@ -893,7 +893,7 @@
¥{{aitem.shop_price}}
- ¥{{aitem.market_price}}
+ ¥{{aitem.market_price}}
diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss
index 496b5ff..e76398f 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.wxss
+++ b/components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -411,17 +411,20 @@
/*一个3列*/
.zs_goods_wai_san {
- width: 236rpx;
+ /* width: 236rpx; */
+ width: 242rpx;
/* display: flex;
margin-left: 10rpx;
float: left; */
/* margin-bottom: 8rpx; */
background-color: white;
overflow: hidden;
+ box-sizing: border-box;
}
.zs_goods_san {
- width: 236rpx;
+ /* width: 236rpx; */
+ width: 242rpx;
}
.zs_goods_3l {
diff --git a/components/diy_groupbuy/diy_groupbuy.wxml b/components/diy_groupbuy/diy_groupbuy.wxml
index e928d9e..6701dd3 100644
--- a/components/diy_groupbuy/diy_groupbuy.wxml
+++ b/components/diy_groupbuy/diy_groupbuy.wxml
@@ -39,7 +39,7 @@
{{aitem.goods_name}}
¥{{aitem.price}}
- ¥{{aitem.market_price}}
+ ¥{{aitem.market_price}}
¥
- {{item.market_price}}
+ {{item.market_price}}
@@ -132,7 +132,7 @@
-
+
¥
{{item.market_price}}
@@ -149,7 +149,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -177,7 +177,7 @@
-
+
¥
{{item.market_price}}
@@ -188,7 +188,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -255,7 +255,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -276,7 +276,7 @@
-
+
¥
{{item.market_price}}
@@ -292,7 +292,7 @@
-
+
¥
{{item.market_price}}
@@ -309,7 +309,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -337,7 +337,7 @@
-
+
¥
{{item.market_price}}
@@ -347,7 +347,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -416,7 +416,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -437,7 +437,7 @@
-
+
¥
{{item.market_price}}
@@ -453,7 +453,7 @@
-
+
¥
{{item.market_price}}
@@ -470,7 +470,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -498,7 +498,7 @@
-
+
¥
{{item.market_price}}
@@ -508,7 +508,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -581,7 +581,7 @@
+
¥{{item.prom_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -604,7 +604,7 @@
-
+
¥
{{item.market_price}}
@@ -620,7 +620,7 @@
-
+
¥
{{item.market_price}}
@@ -637,7 +637,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -663,7 +663,7 @@
-
+
¥
{{item.market_price}}
@@ -674,7 +674,7 @@
¥{{item.shop_price}}
- ¥{{item.market_price}}
+ ¥{{item.market_price}}
@@ -762,7 +762,7 @@
+
¥{{aitem.prom_price}}
- ¥{{aitem.market_price}}
+ ¥{{aitem.market_price}}
@@ -783,7 +783,7 @@
-
+
¥
{{aitem.market_price}}
@@ -799,7 +799,7 @@
-
+
¥
{{aitem.market_price}}
@@ -816,7 +816,7 @@
{{filter.toFix(aitem.shop_price,2)}}
-
+
¥
{{aitem.market_price}}
@@ -844,7 +844,7 @@
-
+
¥
{{aitem.market_price}}
@@ -854,7 +854,7 @@
¥{{aitem.shop_price}}
- ¥{{aitem.market_price}}
+ ¥{{aitem.market_price}}
diff --git a/components/goods_list/goods_list.wxml b/components/goods_list/goods_list.wxml
index e15421d..5702fd8 100644
--- a/components/goods_list/goods_list.wxml
+++ b/components/goods_list/goods_list.wxml
@@ -30,7 +30,7 @@
-
+
¥
{{item.market_price}}
@@ -62,7 +62,7 @@
-
+
¥
{{item.market_price}}
@@ -80,7 +80,7 @@
-
+
¥
{{item.market_price}}
@@ -97,7 +97,7 @@
{{filter.toFix(item.shop_price,2)}}
-
+
¥
{{item.market_price}}
@@ -124,7 +124,7 @@
-
+
¥
{{item.market_price}}
@@ -143,7 +143,7 @@
-
+
¥
{{item.market_price}}
diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
index 578c154..04cb149 100644
--- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
+++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -268,13 +268,14 @@ Page({
},
//计算商品预存款请求方法------------------------------------
async getGoodsAdvancesum(storageid, listform, cartList) {
-
- await getApp().request.promisePost("/api/weshop/store/get/" + storageid,{
- }).then(res=>{
- if(res.data.code==0){
- getApp().globalData.config = res.data.data
- }
- })
+ if(!getApp().globalData.config){
+ await getApp().request.promiseGet("/api/weshop/store/get/" + os.stoid,{
+ }).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.config = res.data.data
+ }
+ })
+ }
if(!getApp().globalData.config) return false;
let res = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
index 196893a..ead2ea1 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -113,11 +113,11 @@
{{filters.toFix(luckGoInfo.group_price/100,2)}}
-
+
零售价:{{data.market_price}}
-
+
diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js
index 505c1af..6ff6b5d 100644
--- a/packageC/pages/presell/cart/cart.js
+++ b/packageC/pages/presell/cart/cart.js
@@ -1859,11 +1859,26 @@ Page({
th.setData({ quan_price: 0 })
}
+
+ //---获取订单优惠---
+ var condition = allpice - quan_price; //判断的条件
+ var prom_ord=null
+ if(condition > 0 && this.data.pre_arr.is_useorderyh) {
+ await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
+ data: {store_id: os.stoid, orderAmount: condition}
+ }).then(res => {
+ if (res.data.code == 0) {
+ prom_ord = res.data.data;
+ }
+
+ })
+ }
+
//-----------当地址不为空,且是物流时,计算物流费用----------
if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) {
//看是不是有调用过包邮券,如果活动可以使用优化券的情况下
if (!th.data.isget_by_quan[bn_pick] && th.data.act.is_usecoupon) {
- var condition = allpice - quan_price;
+
//--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱---
getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", {
data: {
@@ -1897,14 +1912,19 @@ Page({
var user_addr=th.data.user_addr;
var req_d = {
province: user_addr.province, city: user_addr.city, district: user_addr.district,
- wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
+ wuliu: parseFloat(condition).toFixed(2), store_id: os.stoid
}
var back_data = null;
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
+
+ //-- 判断是不是包邮 --
+ if (this.data.act.is_post_temp && (!prom_ord || prom_ord.is_post_temp)) {
+
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
+ }
var gd_arr_list = [];
gd_arr_list.push(good);
@@ -1993,12 +2013,13 @@ Page({
exp_price = parseFloat(shipping_price).toFixed(2);
}
- th.wuliu_next(allpice, quan_price, exp_price);
+ th.wuliu_next(allpice, quan_price, exp_price,prom_ord,1);
} else {
- th.wuliu_next(allpice, quan_price, exp_price);
+ th.wuliu_next(allpice, quan_price, exp_price,prom_ord,1);
}
//});
},
+
async calculate_same_city() {
var th = this,
good = th.data.goods,
@@ -2061,20 +2082,35 @@ Page({
- //相同的东西统一在一起
- wuliu_next(allpice, quan_price, exp_price) {
+ //相同的东西统一在一起,is_get表示订单优惠有没有被读取一遍
+ async wuliu_next(allpice, quan_price, exp_price,ord_prom,is_get) {
var th = this;
var o_condition = parseFloat(allpice) - parseFloat(quan_price);
if (o_condition < 0) o_condition = 0;
+
+ if(!ord_prom && !is_get){
+ if(o_condition > 0 && this.data.pre_arr.is_useorderyh){
+ await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
+ data: { store_id: os.stoid, orderAmount: condition }
+ }).then(res => {
+ if (res.data.code == 0) {
+ ord_prom = res.data.data;
+ }
+ })
+ }
+ }
+
+
//如果同意参与订单优惠
- if (o_condition > 0 && this.data.pre_arr.is_useorderyh) {
- th.check_is_order_prom(o_condition,async function (ord_price) {
+ if (ord_prom) {
+ //th.check_is_order_prom(o_condition,async function (ord_price) {
+ var ord_price=o_condition;
var bn_pick = th.data.pickup.pickup_id
var order_prom_amount = 0;
var order_prom_id = 0;
var order_m = 0;
- if (th.data.order_prom[bn_pick]) {
- var ord_prom = th.data.order_prom[bn_pick];
+ //if (th.data.order_prom[bn_pick]) {
+ //var ord_prom = th.data.order_prom[bn_pick];
//么有使用券,或者活动没有限制使用优惠券
if (quan_price <= 0 || !ord_prom.is_xz_yh) {
order_prom_id = ord_prom['id'];
@@ -2090,7 +2126,7 @@ Page({
}
ord_price = order_m;
}
- }
+ //}
//--订单优惠的显示--
if (order_prom_id > 0) {
@@ -2177,11 +2213,9 @@ Page({
if( th.data.bn_use_commission){
the_price-=th.data.bn_use_commission;
}
-
-
th.setData({ exp_price: exp_price, order_m: the_price, show_submit: 1, })
- })
+ //})
} else {
var o_condition1 = parseFloat(o_condition) - parseFloat(th.data.presell.presell_deposit);
diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js
index bd6dec3..37a40fa 100644
--- a/packageC/pages/presell/cart/cart2.js
+++ b/packageC/pages/presell/cart/cart2.js
@@ -408,6 +408,10 @@ Page({
t.data.data.original_img = oo.imghost + t.data.data.original_img;
t.data.data['buynum'] = th.data.gg.goods_num;
+ t.data.data.prom_id=th.data.gg.prom_id;
+ t.data.data.prom_type=8;
+
+
var distr_t = 0, et = 0;
if(t.data.data.is_minishop==1 && getApp().is_sp_hao()){
@@ -641,12 +645,11 @@ Page({
calculatePrice2: async function () {
var th = this, good = this.data.bn_goods;
if (!good) return false;
-
//搭配的计算要用购物的车计算方法
- if (good.prom_type == 5) {
- th.calculatePrice();
- return false;
- }
+ // if (good.prom_type == 5) {
+ // th.calculatePrice();
+ // return false;
+ // }
th.setData({dis_btn:1})
@@ -678,8 +681,7 @@ Page({
}
- // to.getConfig2(function (ee) {
- // to.getwuliuprice(async function (rs) {
+
var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
var out_of_weight = null; //超出多少重量
@@ -708,6 +710,30 @@ Page({
}
}
+ //-----------------支付价,优惠券不减物流-----------------
+ var total_m = (parseFloat(allpice1)).toFixed(2);
+ var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2);
+ var coupon_price = quan_price; //优惠券优惠了多少钱
+ if (order_m < 0) {
+ order_m = 0;
+ coupon_price = parseFloat(order_m).toFixed(2);
+ }
+ //--看一下有没有订单优惠--
+ var o_condition = parseFloat(order_m);
+
+ //-- 判断订单优惠的叠加 --
+ var ord_prom=null;
+ var o_condition=allpice;
+ if (o_condition > 0 && th.data.act.is_useorderyh) {
+ await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
+ data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
+ }).then(res => {
+ if (res.data.code == 0) {
+ ord_prom = res.data.data;
+ }
+ })
+ }
+
//-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) {
//看是不是有调用过包邮券
@@ -757,11 +783,16 @@ Page({
wuliu: parseFloat(parseFloat(allpice) - cut_price - quan_price).toFixed(2), store_id: os.stoid
}
var back_data = null;
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
+
+ if(!ord_prom || ord_prom.is_post_temp) {
+ if (th.data.act.is_post_temp){
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
+ }
+ }
var cut_good_weight = 0;
for (let i in gd_arr_list) {
@@ -868,306 +899,171 @@ Page({
th.setData({ [wl_txt]: 0, })
}
}
- //-----------------支付价,优惠券不减物流-----------------
- var total_m = (parseFloat(allpice1)).toFixed(2);
- var order_m = (parseFloat(allpice - cut_price) - quan_price).toFixed(2);
- var coupon_price = quan_price; //优惠券优惠了多少钱
- if (order_m < 0) {
- order_m = 0;
- coupon_price = parseFloat(order_m).toFixed(2);
- }
- //--看一下有没有订单优惠--
- var o_condition = parseFloat(order_m);
-
- if (o_condition > 0 && th.data.act.is_useorderyh) {
- th.check_is_order_prom(o_condition, async function () {
- var order_prom_amount = 0;
- var order_prom_id = 0;
- if (th.data.order_prom[th.data.bn_pick]) {
- var ord_prom = th.data.order_prom[th.data.bn_pick];
- if (!ord_prom.is_xz_yh || quan_price <= 0) {
- order_prom_id = ord_prom['id'];
- switch (ord_prom['type']) {
- case 0:
- order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
- order_prom_amount = (o_condition - order_m).toFixed(2);
- break;
- case 1:
-
- var bs=1;
- if(ord_prom.is_bz){
- bs=Math.floor(o_condition/ord_prom.money);
- }
-
- order_m = o_condition - bs*ord_prom['expression'];//满额优惠金额
- order_prom_amount = bs*ord_prom['expression'];
- break;
+ var order_prom_amount = 0;
+ var order_prom_id = 0;
+ var order_prom_txt1 = "formData.order_prom_id";
+ var order_prom_txt2 = "formData.order_prom_amount";
+ if(ord_prom){
+ if (!ord_prom.is_xz_yh || quan_price <= 0) {
+ order_prom_id = ord_prom['id'];
+ switch (ord_prom['type']) {
+ case 0:
+ order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
+ order_prom_amount = (o_condition - order_m).toFixed(2);
+ break;
+ case 1:
+
+ var bs=1;
+ if(ord_prom.is_bz){
+ bs=Math.floor(o_condition/ord_prom.money);
}
- }
- }
- //--订单优惠的显示--
- if (order_prom_id > 0) {
- var order_prom_txt1 = "formData.order_prom_id";
- var order_prom_txt2 = "formData.order_prom_amount";
- th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
+ order_m = o_condition - bs*ord_prom['expression'];//满额优惠金额
+ order_prom_amount = bs*ord_prom['expression'];
+ break;
}
+ }
+ //--订单优惠的显示--
+ if (order_prom_id > 0) {
+ th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
+ }
+ }else {
+ th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
+ }
- //判断是否同城配送,而且没有调用过
- if(th.data.bn_exp_type==2 && th.data.user_addr) {
-
- var lon=0;var lat=0;
- //-- 获取距离 --
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
- is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
- }).then(res=>{
- if(res.data.code==0){
- var data= JSON.parse(res.data.data);
- if(data.status==0){
- lon=data.result.location.lng;
- lat=data.result.location.lat;
- }
- }
- })
+ var order_prom_txt1 = "formData.order_prom_id";
+ var order_prom_txt2 = "formData.order_prom_amount";
+ th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
- var gd_w = good['weight'] * good['buynum'];
- //-- 获取距离 --
- var req_data = {
- store_id: os.stoid,
- order_amount: parseFloat(order_m),
- lon: lon, lat: lat,
- pickup_id: bn_pick,
- goods_weight: gd_w
- }
- var is_next=1;
- //获取同城配送参数
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
- is_json: 1,
- data: req_data
- }).then(res => {
- if (res.data.code == 0) {
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: res.data.data, })
- }else{
- is_next=0;
- wx.showToast({
- title: res.data.msg, icon: 'none', duration: 2000
- })
- }
- })
- if(!is_next) return false
+ //判断是否同城配送,而且没有调用过
+ if(th.data.bn_exp_type==2 && th.data.user_addr) {
+ var lon=0;var lat=0;
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
+ }).then(res=>{
+ if(res.data.code==0){
+ var data= JSON.parse(res.data.data);
+ if(data.status==0){
+ lon=data.result.location.lng;
+ lat=data.result.location.lat;
+ }
}
+ })
+ var gd_w = good['weight'] * good['buynum'];
+ //-- 获取距离 --
+ var req_data = {
+ store_id: os.stoid,
+ order_amount:parseFloat(order_m),
+ lon: lon, lat: lat,
+ pickup_id: bn_pick,
+ goods_weight: gd_w
+ }
-
- total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
- order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
-
- total_m = total_m.toFixed(2);
- order_m = order_m.toFixed(2);
-
- var atxt = "formData.total_amount";
- th.setData({ [atxt]: total_m, })
-
- var txt = "formData.user_money";
- var txt2 = "formData.order_amount";
- var txt3 = "formData.coupon_price";
-
- if(parseFloat(order_m) {
+ if (res.data.code == 0) {
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: res.data.data, })
+ }else{
+ is_next=0;
wx.showToast({
- title: '应付金额小于本单佣金,不可使用!',
- icon: 'none',
- duration: 2000
- })
-
- th.setData({
- bn_use_commission:0
+ title: res.data.msg, icon: 'none', duration: 2000
})
-
- }
-
- var txt4 = "formData.use_commission";
-
- if(th.data.bn_use_commission){
- order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2);
- th.setData({[txt4]:th.data.bn_goods.use_commission})
- }
-
- var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
- //--------------如果使用余额---------------------
- if (th.data.bn_use_money == 1) {
- if (amoney > parseFloat(order_m)) {
- order_m = parseFloat(order_m).toFixed(2);
- th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- } else {
- order_m = parseFloat(order_m) - parseFloat(amoney);
- order_m = order_m.toFixed(2);
- th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- }
- } else {
- th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- }
- //优惠活动送积分
- if (good.s_intValue) {
- txt = "formData.give_integral";
- th.setData({ [txt]: good.s_intValue });
- }
- //优惠送券
- if (good.s_coupon_id) {
- var i_txt = "formData.give_coupon_id";
- //这个是json格式的
- var i_txt1 = "formData.g_coupon_num";
- var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
- ob = JSON.stringify(ob);
- th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
- }
- //优惠礼包
- if (good.s_libao) {
- var l_txt = "formData.give_lb_id";
- //这个是json格式的
- var l_txt1 = "formData.g_lb_num";
- var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
- ob = JSON.stringify(ob);
- th.setData({ [l_txt]: good.s_libao, [l_txt1]: ob });
}
})
- } else {
- var order_prom_txt1 = "formData.order_prom_id";
- var order_prom_txt2 = "formData.order_prom_amount";
- th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
-
-
- //判断是否同城配送,而且没有调用过
- if(th.data.bn_exp_type==2 && th.data.user_addr) {
- var lon=0;var lat=0;
- //-- 获取距离 --
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
- is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
- }).then(res=>{
- if(res.data.code==0){
- var data= JSON.parse(res.data.data);
- if(data.status==0){
- lon=data.result.location.lng;
- lat=data.result.location.lat;
- }
- }
- })
-
- var gd_w = good['weight'] * good['buynum'];
- //-- 获取距离 --
- var req_data = {
- store_id: os.stoid,
- order_amount:parseFloat(order_m),
- lon: lon, lat: lat,
- pickup_id: bn_pick,
- goods_weight: gd_w
- }
-
- var is_next=1;
- //获取同城配送参数
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
- is_json: 1,
- data: req_data
- }).then(res => {
- if (res.data.code == 0) {
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: res.data.data, })
- }else{
- is_next=0;
- wx.showToast({
- title: res.data.msg, icon: 'none', duration: 2000
- })
- }
- })
- if(!is_next) return false
- }
-
- total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
- order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
- var atxt = "formData.total_amount";
+ if(!is_next) return false
+ }
- total_m = total_m.toFixed(2);
- order_m = order_m.toFixed(2);
+ total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
+ order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
+ var atxt = "formData.total_amount";
- th.setData({ [atxt]: total_m, })
+ total_m = total_m.toFixed(2);
+ order_m = order_m.toFixed(2);
- var txt = "formData.user_money";
- var txt2 = "formData.order_amount";
- var txt3 = "formData.coupon_price";
+ th.setData({ [atxt]: total_m, })
- if(parseFloat(order_m) order_m) {
- order_m = parseFloat(order_m).toFixed(2);
- th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- } else {
- order_m = parseFloat(order_m) - parseFloat(amoney);
- order_m = order_m.toFixed(2);
- th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- }
+
+ var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
+ //--------------如果使用余额---------------------
+ if (th.data.bn_use_money == 1) {
+ if (amoney > order_m) {
+ order_m = parseFloat(order_m).toFixed(2);
+ th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
} else {
- th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
- }
- //优惠活动送积分
- if (good.s_intValue) {
- txt = "formData.give_integral";
- th.setData({ [txt]: good.s_intValue });
- }
- //优惠送券
- if (good.s_coupon_id) {
- var i_txt = "formData.give_coupon_id";
- //这个是json格式的
- var i_txt1 = "formData.g_coupon_num";
- var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
- ob = JSON.stringify(ob);
- th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
- }
- //优惠礼包
- if (good.s_libao) {
- var l_txt = "formData.give_lb_id";
- //这个是json格式的
- var l_txt1 = "formData.g_lb_num";
- var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
- ob = JSON.stringify(ob);
- th.setData({ [l_txt]: good.s_coupon_id, [l_txt1]: ob });
+ order_m = parseFloat(order_m) - parseFloat(amoney);
+ order_m = order_m.toFixed(2);
+ th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
}
+ } else {
+ th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 })
+ }
+ //优惠活动送积分
+ if (good.s_intValue) {
+ txt = "formData.give_integral";
+ th.setData({ [txt]: good.s_intValue });
+ }
+ //优惠送券
+ if (good.s_coupon_id) {
+ var i_txt = "formData.give_coupon_id";
+ //这个是json格式的
+ var i_txt1 = "formData.g_coupon_num";
+ var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
+ ob = JSON.stringify(ob);
+ th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
+ }
+ //优惠礼包
+ if (good.s_libao) {
+ var l_txt = "formData.give_lb_id";
+ //这个是json格式的
+ var l_txt1 = "formData.g_lb_num";
+ var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
+ ob = JSON.stringify(ob);
+ th.setData({ [l_txt]: good.s_coupon_id, [l_txt1]: ob });
}
+
wx.hideLoading();
- // });
- // });
+
},
//--------------------提交订单-----------------------
@@ -1241,12 +1137,12 @@ Page({
var order_prom_list = {};
//--判断有没有优惠活动--
- if (th.data.order_prom[item.pickup_id]) {
+ //if (th.data.order_prom[item.pickup_id]) {
if (th.data.formData.order_prom_amount > 0) {
order_prom_list.order_prom_id = th.data.formData.order_prom_id;
order_prom_list.order_prom_amount = th.data.formData.order_prom_amount;
}
- }
+ //}
//--判断优惠活动的提交--
if (th.data.formData.cut_price > 0) {
diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js
index 1fd1b8d..5027fd6 100644
--- a/packageC/pages/presell/cart/cart2_pre.js
+++ b/packageC/pages/presell/cart/cart2_pre.js
@@ -187,6 +187,8 @@ Page({
t.data.data.original_img = os.imghost + t.data.data.original_img;
t.data.data['buynum'] = gg.goods_num;
+ t.data.data.prom_type=8;
+ t.data.data.prom_id=gg.prom_id;
var distr_t = 0, et = 0;
@@ -398,13 +400,14 @@ Page({
},
//计算商品预存款请求方法------------------------------------
async getGoodsAdvancesum(storageid, listform, cartList) {
-
- await getApp().request.promisePost("/api/weshop/store/get/" + storageid,{
- }).then(res=>{
- if(res.data.code==0){
- getApp().globalData.config = res.data.data
- }
- })
+ if(!getApp().globalData.config){
+ await getApp().request.promiseGet("/api/weshop/store/get/" + os.stoid,{
+ }).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.config = res.data.data
+ }
+ })
+ }
if(!getApp().globalData.config) return false;
let res = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js
index 4378e30..561a327 100644
--- a/packageC/pages/presell/goodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -769,6 +769,9 @@ Page({
title: t.data.data.goods_name,
});
+ t.data.data.prom_id= th.data.presell_id;
+ t.data.data.prom_type= 8;
+
//-- 把商品的赋值 --
ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data));
ee.data.sele_g_id = t.data.data.goods_id;
@@ -1151,7 +1154,7 @@ Page({
newd.goods_price = th.data.prom_price;
newd.member_goods_price = th.data.prom_price,
newd.prom_type = 8;
- newd.prom_id = o.prom_id;
+ newd.prom_id = th.data.presell_id;
if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
@@ -1734,11 +1737,11 @@ Page({
is_on_sale: 1,
pageSize: 500,
orderField: 'gg_ordid,goods_spec,sort',
- prom_type: 8,
+ //prom_type: 8,
};
if (tt.data.presellForm && tt.data.presellForm.id) {
- rq_data.prom_id = tt.data.presellForm.id;
+ //rq_data.prom_id = tt.data.presellForm.id;
}
await getApp().request.promiseGet("/api/weshop/goods/page", {
@@ -4370,6 +4373,7 @@ Page({
if (res.data.code == 0 && res.data.data) {
var arr = res.data.data;
presell_id = arr.presell_id;
+ th.data.presell_id=presell_id;
th.setData({
presellList: arr,
})
@@ -4457,7 +4461,7 @@ Page({
var userInfo = getApp().globalData.userInfo;
// timetype: 1,
- var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1, prom_type: 8, prom_id: presell_id, pageSize: 1000 };
+ var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1,presell_id: presell_id, pageSize: 1000 };
if (userInfo) {
pre_data.user_id = userInfo.user_id;
}
diff --git a/packageC/pages/presell/list/list.js b/packageC/pages/presell/list/list.js
index 70fdceb..fb80789 100644
--- a/packageC/pages/presell/list/list.js
+++ b/packageC/pages/presell/list/list.js
@@ -141,7 +141,8 @@ Page({
page: this.data.page,
pageSize: 10,
// timetype: self.data.type,
- isuse:1
+ isuse:1,
+ timetype:3
}
if(getApp().globalData.userInfo){
req.user_id=getApp().globalData.userInfo.user_id;
diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js
index a6ad0c1..82ba04d 100644
--- a/packageE/pages/cart/cart2/cart2.js
+++ b/packageE/pages/cart/cart2/cart2.js
@@ -410,12 +410,14 @@ Page({
//计算商品预存款请求方法------------------------------------
async getGoodsAdvancesum(storageid, listform, cartList) {
- await getApp().request.promisePost("/api/weshop/store/get/" + storageid,{
- }).then(res=>{
- if(res.data.code==0){
- getApp().globalData.config = res.data.data
- }
- })
+ if(!getApp().globalData.config){
+ await getApp().request.promiseGet("/api/weshop/store/get/" + os.stoid,{
+ }).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.config = res.data.data
+ }
+ })
+ }
if(!getApp().globalData.config) return false;
let res = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
data: {
@@ -2229,6 +2231,13 @@ Page({
if (kitem.act.is_orderyh)
o_price_no_zh -= kitem.cut_price;
}
+ }else{
+ //找到那些可以订单优惠叠加的
+ for (let ij in zh_prom_goods) {
+ let kitem_z = zh_prom_goods[ij];
+ if (!kitem_z.act.is_orderyh)
+ no_order_yh+=kitem_z.actual_price;
+ }
}
}
@@ -2242,6 +2251,13 @@ Page({
if (th.data.ladder_map[ij].is_useorderyh)
o_price_no_zh -= kitem.cut_price;
}
+ }else{
+ //找到那些可以订单优惠叠加的不参与的要减掉
+ for (let ij in ladder_prom_goods) {
+ let kitem_l = ladder_prom_goods[ij];
+ if (!th.data.ladder_map[ij].is_useorderyh)
+ no_order_yh+=kitem_l.actual_price;
+ }
}
}
@@ -2268,8 +2284,10 @@ Page({
var ord_prom_condition=0;
+
+ //如果有组合购
if(o_price_no_zh){
- ord_prom_condition=o_price_no_zh-whsle_goods_price-no_zh_all_quan_num;
+ ord_prom_condition=o_price_no_zh-whsle_goods_price-no_zh_all_quan_num- no_order_yh;
}else{
ord_prom_condition=o_price - quan_price - whsle_goods_price - no_order_yh;
}
@@ -5533,6 +5551,7 @@ Page({
var prom = null;
var gg = to.get_b_now();
getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then(res => {
+
if (res.data.code == 0) {
prom = res.data.data;
let min_value = 0
diff --git a/packageE/pages/cart/cart2/cart2.wxml b/packageE/pages/cart/cart2/cart2.wxml
index 54c48b4..5780298 100644
--- a/packageE/pages/cart/cart2/cart2.wxml
+++ b/packageE/pages/cart/cart2/cart2.wxml
@@ -561,7 +561,7 @@
使用优惠券
- ¥ {{formData.coupon_price}}元
-
+
优惠活动
- ¥ {{filters.toFix(formData.cut_price,2)}}元
diff --git a/pages/activity/pind_list/pind_list.wxml b/pages/activity/pind_list/pind_list.wxml
index 2e57bc9..949c5d3 100644
--- a/pages/activity/pind_list/pind_list.wxml
+++ b/pages/activity/pind_list/pind_list.wxml
@@ -69,7 +69,7 @@
¥
{{item.price}}
- ¥{{item.shop_price}}
+ ¥{{item.shop_price || item.market_price}}
diff --git a/pages/activity/seckill_list/seckill_list.wxml b/pages/activity/seckill_list/seckill_list.wxml
index 5bceb1e..588ad3c 100644
--- a/pages/activity/seckill_list/seckill_list.wxml
+++ b/pages/activity/seckill_list/seckill_list.wxml
@@ -69,7 +69,7 @@
¥
{{item.price}}
- 零售价¥{{item.market_price}}
+ 零售价¥{{item.market_price}}
diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js
index f6e0b33..dfadf4b 100644
--- a/pages/cart/cart2_inte/cart2_inte.js
+++ b/pages/cart/cart2_inte/cart2_inte.js
@@ -272,13 +272,14 @@ Page({
},
//计算商品预存款请求方法------------------------------------
async getGoodsAdvancesum(storageid, listform, cartList) {
-
- await getApp().request.promisePost("/api/weshop/store/get/" + storageid,{
- }).then(res=>{
- if(res.data.code==0){
- getApp().globalData.config = res.data.data
- }
- })
+ if(!getApp().globalData.config){
+ await getApp().request.promiseGet("/api/weshop/store/get/" + os.stoid,{
+ }).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.config = res.data.data
+ }
+ })
+ }
if(!getApp().globalData.config) return false;
let res = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js
index f3e596c..628716c 100644
--- a/pages/cart/cart2_pt/cart2_pt.js
+++ b/pages/cart/cart2_pt/cart2_pt.js
@@ -225,13 +225,14 @@ Page({
},
//计算商品预存款请求方法------------------------------------
async getGoodsAdvancesum(storageid, listform, cartList) {
-
- await getApp().request.promisePost("/api/weshop/store/get/" + storageid,{
- }).then(res=>{
- if(res.data.code==0){
- getApp().globalData.config = res.data.data
- }
- })
+ if(!getApp().globalData.config){
+ await getApp().request.promiseGet("/api/weshop/store/get/" + os.stoid,{
+ }).then(res=>{
+ if(res.data.code==0){
+ getApp().globalData.config = res.data.data
+ }
+ })
+ }
if(!getApp().globalData.config) return false;
let res = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml
index 5ac2c25..3861f4c 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.wxml
+++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -47,8 +47,8 @@
-
- {{"¥"+items.giftPosPrice}}
+
+ {{"零售价:¥"+items.giftPosPrice}}
{{"活动开始时间:"+items.starTime}}
diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxml b/pages/giftpack/giftpacklist/giftpacklist.wxml
index b5bb2de..948a3ca 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.wxml
+++ b/pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -63,7 +63,7 @@