diff --git a/app.json b/app.json
index b8a1f4d..e71362a 100644
--- a/app.json
+++ b/app.json
@@ -196,8 +196,9 @@
"pages/user/monthgiftbag/giftpackbuy/giftpackbuy",
"pages/cart/cart2_pt/cart2_pt",
"pages/cart/cart_wk/cart_wk",
- "pages/cart/cart2_inte/cart2_inte"
-
+ "pages/cart/cart2_inte/cart2_inte",
+ "pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo"
+
]
},
{
diff --git a/packageA/pages/details_serviceCard/details_serviceCard.js b/packageA/pages/details_serviceCard/details_serviceCard.js
index ac80b52..98f6340 100644
--- a/packageA/pages/details_serviceCard/details_serviceCard.js
+++ b/packageA/pages/details_serviceCard/details_serviceCard.js
@@ -49,7 +49,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
- this.data.is_summit_ing=0;
+
+ this.setData({ is_summit_ing: 0 });
var th=this;
//判断是不是第一次进入
@@ -659,7 +660,9 @@ Page({
async pay() {
if(this.data.is_summit_ing) return false;
- this.data.is_summit_ing=1;
+ this.setData({
+ is_summit_ing:1
+ })
var th=this;
let order_sn = this.data.details.order_sn;
@@ -676,6 +679,25 @@ Page({
//秒杀活动和拼团活动要重新计算一下
for (const it of list) {
+
+ var card=null;
+ await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + store_id + "/" + it.card_id, {}).then(res => {
+ if(res.data.code==0 && res.data.data){
+ card = res.data.data;
+ }
+ })
+
+ if(card && card.storageId){
+ let the_c_key=it.pickup_keyid;
+ if (card.storageId.indexOf(the_c_key)==-1) {
+ getApp().confirmBox(it.service_name + "的门店不可售");
+ th.setData({ is_summit_ing: 0 });
+ flag = false;
+ return false;
+ }
+ }
+
+
if ([1,2].includes(it.prom_type)) {
let act_details = null;
let redis_num = 0;
@@ -717,7 +739,7 @@ Page({
})
if(idx0<0){
getApp().confirmBox(it.service_name + "秒杀活动的门店不可售");
- th.setData({ paying: 0 });
+ th.setData({ is_summit_ing: 0 });
flag = false;
return false;
}
@@ -951,7 +973,7 @@ Page({
})
if(!flag) {
- th.data.ser_paying=0;
+ th.setData({ is_summit_ing: 0 });
return false;
}
@@ -1022,7 +1044,7 @@ Page({
}, 1000)
}, function (e) {
- th.data.is_summit_ing = 0;
+ th.setData({ is_summit_ing: 0 });
wx.showToast({
title: e,
icon: 'none',
@@ -1030,7 +1052,7 @@ Page({
});
})
}else{
- this.data.is_summit_ing=0;
+ th.setData({ is_summit_ing: 0 });
}
},
diff --git a/packageA/pages/details_serviceCard/details_serviceCard.wxml b/packageA/pages/details_serviceCard/details_serviceCard.wxml
index b17d6e3..4d7920b 100644
--- a/packageA/pages/details_serviceCard/details_serviceCard.wxml
+++ b/packageA/pages/details_serviceCard/details_serviceCard.wxml
@@ -83,12 +83,18 @@
取消订单
- 立即支付
+
+ 支付中
+ 立即支付
+
取消订单
- 立即支付
+
+ 支付中
+ 立即支付
+
diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js
index 70fcde7..1c8778b 100644
--- a/packageA/pages/goodsInfo/goodsInfo.js
+++ b/packageA/pages/goodsInfo/goodsInfo.js
@@ -1201,7 +1201,7 @@ Page({
}
// 以下为当前门店同类商品已经加入到购物车
- var totalNum = th.data.goodsInputNum + item.goods_num;
+ var totalNum = th.data.goodsInputNum + (item?item.goods_num:0);
// 秒杀购物车购买 修正数量
if (th.data.prom_type == 1 && !th.data.is_normal) {
@@ -1225,43 +1225,60 @@ Page({
}
}
- var updata = {
- id: item.id,
- goods_num: totalNum,
- money: th.data.data.shop_price,
- store_id: os.stoid,
- };
-
- // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
- if(th.data.options.prom_type == 1) {
- // updata['prom_type'] = th.data.options.prom_type;
- // updata['prom_id'] = th.data.options.prom_id;
- if(th.data.openSpecModal_flash_normal) {
- updata['money'] = th.data.data.shop_price;
- updata['is_pd_normal'] = 1;
- } else {
- updata['money'] = th.data.prom_price;
- };
- };
-
- if (getApp().globalData.guide_id) {
- updata['guide_id'] = getApp().globalData.guide_id;
- updata['guide_type'] = 1;
- }
- if(getApp().globalData.groupchat_id){
- updata['groupchat_id'] = getApp().globalData.groupchat_id;
- }
- getApp().request.put("/api/weshop/cartService/update", {
- data: updata,
- success: function(t) {
- getApp().my_warnning('加入购物车成功', 1, th, 450);
- var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
- th.setData({
- cartGoodsNum: c_num
- });
- th.closeSpecModal();
- }
- });
+ if(item) {
+ var updata = {
+ id: item.id,
+ goods_num: totalNum,
+ money: th.data.data.shop_price,
+ store_id: os.stoid,
+ };
+
+ // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
+ if (th.data.options.prom_type == 1) {
+ // updata['prom_type'] = th.data.options.prom_type;
+ // updata['prom_id'] = th.data.options.prom_id;
+ if (th.data.openSpecModal_flash_normal) {
+ updata['money'] = th.data.data.shop_price;
+ updata['is_pd_normal'] = 1;
+ } else {
+ updata['money'] = th.data.prom_price;
+ }
+
+ }
+
+
+ if (getApp().globalData.guide_id) {
+ updata['guide_id'] = getApp().globalData.guide_id;
+ updata['guide_type'] = 1;
+ }
+ if (getApp().globalData.groupchat_id) {
+ updata['groupchat_id'] = getApp().globalData.groupchat_id;
+ }
+ getApp().request.put("/api/weshop/cartService/update", {
+ data: updata,
+ success: function (t) {
+ getApp().my_warnning('加入购物车成功', 1, th, 450);
+ var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
+ th.setData({
+ cartGoodsNum: c_num
+ });
+ th.closeSpecModal();
+ }
+ });
+ }else{
+ getApp().request.post("/api/weshop/cartService/save", {
+ data: newd,
+ success: function(t) {
+ getApp().my_warnning('加入购物车成功', 1, th, 450);
+ var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
+ th.setData({
+ cartGoodsNum: c_num
+ });
+ th.closeSpecModal();
+ }
+ });
+
+ }
} else {
getApp().request.post("/api/weshop/cartService/save", {
data: newd,
diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml
index 018d2dc..955bcfd 100644
--- a/packageA/pages/goodsInfo/goodsInfo.wxml
+++ b/packageA/pages/goodsInfo/goodsInfo.wxml
@@ -602,7 +602,6 @@
- {{cartGoodsNum}}
购物车
diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js
index d376715..86f3a58 100644
--- a/packageA/pages/profile/profile.js
+++ b/packageA/pages/profile/profile.js
@@ -1051,7 +1051,7 @@ Page({
if (e.data.code == 0) {
app.globalData.user_id = e.data.data.user_id;
} else {
- return app.showWarning("授权登入失败!" + e.data.msg);
+ return ut.m_toast("授权登入失败!" + e.data.msg);
}
getApp().globalData.login_back = 1;
wx.setStorageSync("userinfo", e.data.data);
diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js
index 2af423a..e25de68 100644
--- a/packageE/pages/cart/cart2/cart2.js
+++ b/packageE/pages/cart/cart2/cart2.js
@@ -2708,6 +2708,9 @@ Page({
item_map.monthlbtitle = get_data.monthlbtitle;
}
+ //优惠促销新增的不包邮模板
+ item_map.no_ex_id=rule.no_ex_id;
+
//-- 单赠品和多赠品 --
if (get_data.gift_id || parseInt(get_data.zp_mode) == 1) {
item_map.zp_by = rule.zp_by;
@@ -2855,7 +2858,12 @@ Page({
if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh;
ord_goods[j].is_past = item_map.is_past;
- if (ord_goods[j].is_gift) continue; //赠品不平摊
+
+ if (ord_goods[j].is_gift){
+ //赠品要看赠品本身包不包邮
+ if(!item_map.zp_by) ord_goods[j].is_past =0;
+ continue; //赠品不平摊
+ }
// ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir;
// ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir;
@@ -2883,6 +2891,38 @@ Page({
if (fd_map_gd.account_yu != undefined) ord_goods[j].account_yu = fd_map_gd.account_yu;
}
+ //优惠促销包邮,但是又不包邮模板的时候
+ if(ord_goods[j].is_past && item_map.no_ex_id>0){
+
+ let by_mb=null;
+ let by_mb_url="/api/weshop/areaFeemail/getAreaGoods";
+ let by_mb_res= await getApp().request.promiseGet(by_mb_url, {
+ data:{
+ store_id:os.stoid,
+ id:item_map.no_ex_id
+ }
+ })
+
+ if(by_mb_res && by_mb_res.data.code==0 && by_mb_res.data.data && by_mb_res.data.data.length){
+ by_mb=by_mb_res.data.data[0];
+
+ //如果是不包邮区域的话
+ if (by_mb.region_list && th.check_by_area(by_mb.region_list)) {
+ ord_goods[j].is_past =0;
+ }
+ //如果是不包邮商品的时候
+ else if (by_mb.goods_list) {
+ var no_goods_arr = by_mb.goods_list.split(",");
+ if (no_goods_arr.includes(ord_goods[j].goods_id+"")){
+ ord_goods[j].is_past =0;
+ }
+ }
+
+ }
+
+ }
+
+
}
}
}
@@ -3581,7 +3621,7 @@ Page({
//累积商品重量 每种商品的重量 * 数量
goods_weight += item[j]['weight'] * item[j]['goods_num'];
- if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ if (back_data && back_data.is_by_all && !back_data.no_free_goods && item[j].is_post_temp) {
cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
if (back_data.weight_free > 0) {
out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
diff --git a/packageE/pages/togoin/togoin.js b/packageE/pages/togoin/togoin.js
index 265671c..dce08a5 100644
--- a/packageE/pages/togoin/togoin.js
+++ b/packageE/pages/togoin/togoin.js
@@ -414,7 +414,13 @@ Page({
if (e.data.code == 0) {
app.globalData.user_id = e.data.data.user_id;
} else {
- return app.showWarning("授权登入失败!" + e.data.msg);
+
+ wx.showToast({
+ title: "授权登入失败!" + e.data.msg,
+ icon: 'none',
+ duration: 2000
+ });
+ return false;
}
getApp().globalData.login_back = 1;
wx.setStorageSync("userinfo", e.data.data);
diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
index eb488d5..6cbf12f 100644
--- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
+++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -72,30 +72,30 @@ Page({
openSpecModal: 0,
sto_sele_name_1: '',
- share_goods_img:'', //礼包的分享图
- giftImageCover:null,
- canvasHidden:true,
- is_receive:0,
+ share_goods_img: '', //礼包的分享图
+ giftImageCover: null,
+ canvasHidden: true,
+ is_receive: 0,
screenWidth: 0,
- monthgiftbag:{},
- scene:"",
- keyword:'', //门店搜索
- sec_i:-1,//选中分类门店 下标
+ monthgiftbag: {},
+ scene: "",
+ keyword: '', //门店搜索
+ sec_i: -1,//选中分类门店 下标
},
onLoad: function (options) {
//定义第一次进入
- this.data.fir_in=1;
+ this.data.fir_in = 1;
var th = this;
console.log('分享参数---');
console.log(options);
if (options.lbId && !options.id) {
- options.id=options.lbId
- // options.lbId=options.id
+ options.id = options.lbId
+ // options.lbId=options.id
}
if (options.id) {
- options.lbId=options.id
- // options.lbId=options.id
+ options.lbId = options.id
+ // options.lbId=options.id
}
@@ -105,18 +105,18 @@ Page({
getStorageID: a.stoid,
})
- if(!options.lbId && options.scene){
+ if (!options.lbId && options.scene) {
var gid_str = decodeURIComponent(options.scene);
gid_str = gid_str.split("_");
- options.lbId=gid_str[0];
- options.id=gid_str[0];
- options.first_leader=gid_str[1];
- options.isBuy=1;
+ options.lbId = gid_str[0];
+ options.id = gid_str[0];
+ options.first_leader = gid_str[1];
+ options.isBuy = 1;
}
this.setData({
params: options,
- getGiftID:options.id
+ getGiftID: options.id
})
@@ -125,8 +125,8 @@ Page({
getGiftID: options.lbId,
orderSn: options.orderSn,
flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
- record_list_id:options.record_list_id,
- is_receive:options.is_receive
+ record_list_id: options.record_list_id,
+ is_receive: options.is_receive
})
if (options.lbId) th.data.lbId = options.lbId;
//-- 获取分享人的ID --
@@ -141,7 +141,7 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
+ getApp().globalData.guide_pick_id = res.data.data.pickup_id
}
})
}
@@ -150,7 +150,7 @@ Page({
getApp().getConfig(function (e) {
- th.setData({sto_sele_name_1: e.store_name})
+ th.setData({ sto_sele_name_1: e.store_name })
})
getApp().getConfig2(function (e) {
@@ -171,10 +171,10 @@ Page({
}
});
- let monthgiftbag=wx.getStorageSync('monthgiftbag')
- let monthgiftba_defpick=wx.getStorageSync('monthgiftba_defpick')
+ let monthgiftbag = wx.getStorageSync('monthgiftbag')
+ let monthgiftba_defpick = wx.getStorageSync('monthgiftba_defpick')
var now = ut.gettimestamp();
- var isStart=0;
+ var isStart = 0;
// var str = res.data.data.starTime;
// if (start < now) isStart = 1;
// start = start / 1000;
@@ -188,32 +188,32 @@ Page({
// }
// this.setData({
- // isStart,
- // monthgiftbag,
- // sele_g:monthgiftbag,
- // def_pick_store:monthgiftba_defpick
+ // isStart,
+ // monthgiftbag,
+ // sele_g:monthgiftbag,
+ // def_pick_store:monthgiftba_defpick
// })
- let scene=wx.getLaunchOptionsSync().scene;
- if (scene==1154) {
+ let scene = wx.getLaunchOptionsSync().scene;
+ if (scene == 1154) {
this.setData({
- scene
+ scene
})
this.getList2()
- }
+ }
},
init() {
- var th=this;
+ var th = this;
//-- 检测一下有没有门店 --
- th.check_guide(function (){
- com.wait_for_store_config(th);
- com.set_user_mo_store(th, os, function () {
- if (th.data.sele_g.pickup_list && th.data.def_pick_store) {
- com.check_def_pk(th);
- }
- });
- com.get_sto(th, os);
- })
+ th.check_guide(function () {
+ com.wait_for_store_config(th);
+ com.set_user_mo_store(th, os, function () {
+ if (th.data.sele_g.pickup_list && th.data.def_pick_store) {
+ com.check_def_pk(th);
+ }
+ });
+ com.get_sto(th, os);
+ })
// this.GetBuyGiftList();
// if (this.data.flag == 1) {
// this.getZxlbDetails();
@@ -227,201 +227,210 @@ Page({
// }
},
- logTab(){
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
+ logTab() {
+ wx.navigateTo({
+ url: '/packageE/pages/togoin/togoin',
+ })
},
getListInfo: function (e) {
- var th = this;
- getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, {
- isShowLoading: true,
- data: {
- // store_id: a.stoid, //商家ID
- // user_id: d.user_id, //用户ID
- // page: 1,
- // pageSize: 10,
- // is_end:0,
- // timetype:1,
- // id:th.data.params.id
- },
- success: function (res) {
- if (res.data.code == 0) {
- // th.data.curpage++;
- // var arr1 = th.data.wareCard;
- let obj = res.data.data;
- let monthgiftbag={
- remark:obj.remark,
- cover_img:obj.imageurl,
- giftTitle:obj.act_name,
- lbPrice:obj.oldPrice
- }
- let remark=monthgiftbag.remark.replace(/\
0){
- var monthgiftbag =arr2[0];
- var ismore = 0;
- // if (arr3.length == res.data.data.total) ismore = 1
- var isStart=0;
- if (monthgiftbag) {
- var start = monthgiftbag.begindate;
- let remark=monthgiftbag.remark.replace(/\
0) {
+ var monthgiftbag = arr2[0];
+ var ismore = 0;
+ // if (arr3.length == res.data.data.total) ismore = 1
+ var isStart = 0;
+ if (monthgiftbag) {
+ var start = monthgiftbag.begindate;
+ let remark = monthgiftbag.remark.replace(/\
0){
- var monthgiftbag =arr2[0];
- var ismore = 0;
- // if (arr3.length == res.data.data.total) ismore = 1
- var isStart=0;
- if (monthgiftbag) {
- var start = monthgiftbag.begindate;
- let remark=monthgiftbag.remark.replace(/\
0) {
+ var monthgiftbag = arr2[0];
+ var ismore = 0;
+ // if (arr3.length == res.data.data.total) ismore = 1
+ var isStart = 0;
+ if (monthgiftbag) {
+ var start = monthgiftbag.begindate;
+ let remark = monthgiftbag.remark.replace(/\
{
@@ -463,60 +472,63 @@ Page({
})
- if(th.data.back_ord){
+ if (th.data.back_ord) {
- var money=th.data.payMoney;
+ var money = th.data.payMoney;
var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord;
//-- 通联的第三方支付的返回优化 --
- ut.is_pay_ok(th.data.back_ord,bk_url,"none",function (){
- if(!th.data.back_ord) return false;
+ ut.is_pay_ok(th.data.back_ord, bk_url, "none", function () {
+ if (!th.data.back_ord) return false;
getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page",
- {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{
-
- if(ut.ajax_ok(res)){
- var item=res.data.data.pageData[0];
- if(item.pay_state==1){
- //支付支付,返回首页
- ut.m_toast('支付成功');
- th.data.back_ord=null;
- setTimeout(()=>{
- getApp().goto(bk_url);
- },1000)
-
- }else{
- //支付支付,返回首页
- ut.m_toast('支付失败');
- setTimeout(()=>{
- getApp().goto("/pages/index/index/index");
- },1000)
+ { data: { store_id: os.stoid, order_sn: th.data.back_ord, user_id: getApp().globalData.user_id } }).then(res => {
+
+ if (ut.ajax_ok(res)) {
+ var item = res.data.data.pageData[0];
+ if (item.pay_state == 1) {
+ //支付支付,返回首页
+ ut.m_toast('支付成功');
+ th.data.back_ord = null;
+ setTimeout(() => {
+ getApp().goto(bk_url);
+ }, 1000)
+
+ } else {
+ //支付支付,返回首页
+ ut.m_toast('支付失败');
+ setTimeout(() => {
+ getApp().goto("/pages/index/index/index");
+ }, 1000)
+ }
}
- }
- })
- },null,null,1);
+ })
+ }, null, null, 1);
- th.data.back_ord=null;
+ th.data.back_ord = null;
}
}, 1000)
}
+
+
+
},
GetBuyPrice: function (e) {
var that = this.data;
var th = this;
- let scene=this.data.scene;
- if (scene==1154) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return
+ let scene = this.data.scene;
+ if (scene == 1154) {
+ wx.navigateTo({
+ url: '/packageE/pages/togoin/togoin',
+ })
+ return
}
- if (!d || !d.user_id ) {
+ if (!d || !d.user_id) {
getApp().my_warnning("请先登录", 0, th);
return false;
-
+
}
//如果还没有开始的话
if (th.data.isStart != 1) {
@@ -525,14 +537,14 @@ Page({
}
this.data.payMoney = th.data.sele_g.payMoney;
- th.setData({buyType: 2})
+ th.setData({ buyType: 2 })
if (th.data.sele_g.is_pickup) {
th.setData({
openSpecModal: 1
})
} else {
- if(this.data.submit) return false;
+ if (this.data.submit) return false;
var my_confirm = th.selectComponent("#my_confirm"); //组件的id
my_confirm.open(
"是否确定购买该礼包",
@@ -553,17 +565,17 @@ Page({
GetBuyIntegral: function (e) {
var that = this.data;
var th = this;
- let scene =this.data.scene;
- if (scene==1154) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return
+ let scene = this.data.scene;
+ if (scene == 1154) {
+ wx.navigateTo({
+ url: '/packageE/pages/togoin/togoin',
+ })
+ return
}
- if (!d || !d.user_id ) {
+ if (!d || !d.user_id) {
getApp().my_warnning("请先登录", 0, th);
return false;
-
+
}
//如果还没有开始的话
@@ -572,7 +584,7 @@ Page({
return false;
}
- th.setData({buyType: 1});
+ th.setData({ buyType: 1 });
if (th.data.sele_g.is_pickup) {
th.setData({
openSpecModal: 1
@@ -607,17 +619,17 @@ Page({
},
success: function (res) {
if (res.data.code == 0) {
- console.log('商品------++')
- console.log(res)
+ console.log('商品------++')
+ console.log(res)
th.setData({
- giftImage: th.data.iurl + res.data.data.lbUrl,
- giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
+ giftImage: th.data.iurl + res.data.data.lbUrl,
+ giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
giftTitle: res.data.data.giftTitle,
default_color: res.data.data.bgcolor
})
if (res.data.data.iswarelbtype == 1) {
- th.setData({iswarelbtype: 1})
+ th.setData({ iswarelbtype: 1 })
}
if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
@@ -676,7 +688,7 @@ Page({
getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, {
success: function (res) {
if (res.data.code == 0) {
- th.setData({pick_up: res.data.data});
+ th.setData({ pick_up: res.data.data });
}
}
});
@@ -693,26 +705,26 @@ Page({
},
- check_guide(func){
- var first_leader=this.data.first_leader;
- if(!first_leader){
+ check_guide(func) {
+ var first_leader = this.data.first_leader;
+ if (!first_leader) {
func();
return false;
}
- if(this.data.is_geted_guide_pick){
+ if (this.data.is_geted_guide_pick) {
func();
return false;
}
- if(getApp().globalData.guide_pick_id){
+ if (getApp().globalData.guide_pick_id) {
func();
return false;
}
- var th=this;
+ var th = this;
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
+ getApp().globalData.guide_pick_id = res.data.data.pickup_id;
}
- th.data.is_geted_guide_pick=1;
+ th.data.is_geted_guide_pick = 1;
func();
})
},
@@ -730,8 +742,8 @@ Page({
success: function success(res) {
if (res.data.code == 0) {
_this2.setData({
- giftImage: th.iurl + res.data.data.lbUrl,
- giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl),
+ giftImage: th.iurl + res.data.data.lbUrl,
+ giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img : res.data.data.lbUrl),
// giftTitle: res.data.data.giftTitle,
giftTitle: res.data.data.lbTitle,
default_color: res.data.data.bgcolor
@@ -774,7 +786,7 @@ Page({
if (!sele_g.is_pickup) return false;
//-- 检测一下有没有门店 --
- _this2.check_guide(function (){
+ _this2.check_guide(function () {
com.wait_for_store_config(_this2);
com.set_user_mo_store(_this2, os, function () {
if (sele_g.pickup_list && _this2.data.def_pick_store) {
@@ -807,7 +819,7 @@ Page({
if (res.data.code == 0) {
th.setData({
giftImage: th.data.iurl + res.data.data.lbUrl,
- giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
+ giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
giftTitle: res.data.data.lbTitle,
default_color: res.data.data.bgcolor
})
@@ -951,7 +963,7 @@ Page({
onShareAppMessage: function (e) {
getApp().globalData.no_clear = 1;
- var ee=this;
+ var ee = this;
var curPage = this;
var pagePath = curPage.route; //当前页面url
if (pagePath.indexOf('/') != 0) {
@@ -959,7 +971,7 @@ Page({
}
- pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
+ pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
console.log('分享路径');
console.log(pagePath);
// if (this.data.isBuy == 0) {
@@ -969,7 +981,7 @@ Page({
// }
// console.log('pagePath', pagePath);
- var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
+ var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
return {
@@ -985,12 +997,12 @@ Page({
onShareTimeline() {
getApp().globalData.no_clear = 1;
- var ee=this;
+ var ee = this;
var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
var user_id = getApp().globalData.user_id;
if (!user_id) user_id = 0;
- var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
+ var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
return {
title: "礼包详情",
@@ -1008,7 +1020,7 @@ Page({
getApp().my_warnning("活动还没有开始", 0, th);
return false;
}
- th.setData({buyType: 3});
+ th.setData({ buyType: 3 });
if (th.data.sele_g.is_pickup) {
th.setData({
openSpecModal: 1
@@ -1031,145 +1043,145 @@ Page({
},
- //获取搜索门店输入的值
- input_store: function(e) {
- this.setData({
- keyword: e.detail.value
- })
- },
- //搜索门店
- searchfn(){
- let choice_sort_store = this.data.choice_sort_store
- if (choice_sort_store==0) { //全局搜索
- let all_pick_list = this.data.all_pick_list
- let def_pickpu_list = this.data.def_pickpu_list
- let keyword = this.data.keyword
- if (keyword) {
- let arr=all_pick_list.filter( item =>{
- let i = item.pickup_name.indexOf(keyword)
- if (i > -1) {
- return true
- }else{
- return false
- }
- })
- if (arr && arr.length>0) {
- if(this.data.is_show_sto_cat==1){
- this.setData({
- def_pickpu_list:arr
- })
- }else{
- this.setData({
- only_pk:arr
- })
- }
- }else{
- wx.showToast({
- title: '没有搜索到门店',
- icon: 'none',
- duration: 2000
- })
- }
- }else{
- if (this.data.is_show_sto_cat==1) {
- this.setData({
- def_pickpu_list:all_pick_list.slice(0,10)
- })
- }else{
- this.setData({
- only_pk:all_pick_list
- })
- }
-
- }
- }else{ //分类下搜索
- let sec_i=this.data.sec_i
- let all_sto = this.data.all_sto
- let old_all_sto = this.data.old_all_sto
- if (!old_all_sto) {
+ //获取搜索门店输入的值
+ input_store: function (e) {
this.setData({
- old_all_sto:JSON.parse(JSON.stringify(all_sto))
+ keyword: e.detail.value
})
- }
- let sec_sto= this.data.sec_sto
- let sec_arr = this.data.old_all_sto[sec_i].s_arr
- let keyword = this.data.keyword
- let text='sec_sto.s_arr'
- if (keyword) {
- let arr=sec_arr.filter( item =>{
- let i = item.pickup_name.indexOf(keyword)
- if (i > -1) {
- return true
- }else{
- return false
+ },
+ //搜索门店
+ searchfn() {
+ let choice_sort_store = this.data.choice_sort_store
+ if (choice_sort_store == 0) { //全局搜索
+ let all_pick_list = this.data.all_pick_list
+ let def_pickpu_list = this.data.def_pickpu_list
+ let keyword = this.data.keyword
+ if (keyword) {
+ let arr = all_pick_list.filter(item => {
+ let i = item.pickup_name.indexOf(keyword)
+ if (i > -1) {
+ return true
+ } else {
+ return false
+ }
+ })
+ if (arr && arr.length > 0) {
+ if (this.data.is_show_sto_cat == 1) {
+ this.setData({
+ def_pickpu_list: arr
+ })
+ } else {
+ this.setData({
+ only_pk: arr
+ })
+ }
+ } else {
+ wx.showToast({
+ title: '没有搜索到门店',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ } else {
+ if (this.data.is_show_sto_cat == 1) {
+ this.setData({
+ def_pickpu_list: all_pick_list.slice(0, 10)
+ })
+ } else {
+ this.setData({
+ only_pk: all_pick_list
+ })
+ }
+
}
- })
- if (arr && arr.length>0) {
- this.setData({
- [text]:arr
- })
- }else{
- wx.showToast({
- title: '没有搜索到门店',
- icon: 'none',
- duration: 2000
- })
- }
- }else{
- if(this.data.old_all_sto){
- this.setData({
- [text]: this.data.old_all_sto[sec_i].s_arr
- })
- }else{
- this.setData({
- [text]: all_sto[sec_i].s_arr
- })
- }
+ } else { //分类下搜索
+ let sec_i = this.data.sec_i
+ let all_sto = this.data.all_sto
+ let old_all_sto = this.data.old_all_sto
+ if (!old_all_sto) {
+ this.setData({
+ old_all_sto: JSON.parse(JSON.stringify(all_sto))
+ })
+ }
+ let sec_sto = this.data.sec_sto
+ let sec_arr = this.data.old_all_sto[sec_i].s_arr
+ let keyword = this.data.keyword
+ let text = 'sec_sto.s_arr'
+ if (keyword) {
+ let arr = sec_arr.filter(item => {
+ let i = item.pickup_name.indexOf(keyword)
+ if (i > -1) {
+ return true
+ } else {
+ return false
+ }
+ })
+ if (arr && arr.length > 0) {
+ this.setData({
+ [text]: arr
+ })
+ } else {
+ wx.showToast({
+ title: '没有搜索到门店',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ } else {
+ if (this.data.old_all_sto) {
+ this.setData({
+ [text]: this.data.old_all_sto[sec_i].s_arr
+ })
+ } else {
+ this.setData({
+ [text]: all_sto[sec_i].s_arr
+ })
+ }
- }
+ }
- }
- },
-
- getGift(){
- var that=this;
-
- var json = {
- // "actId": '', //活动Id
- // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
- // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买
- // "giftBagId": id, //每月礼包主表id
- // "buyFrom": 2,
- "id":that.data.record_list_id,// "记录Id",
- "storeId": that.data.getStorageID, //商家Id
- "userId": that.data.getUserID, //用户ID
- };
+ }
+ },
+
+ getGift() {
+ var that = this;
+
+ var json = {
+ // "actId": '', //活动Id
+ // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
+ // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买
+ // "giftBagId": id, //每月礼包主表id
+ // "buyFrom": 2,
+ "id": that.data.record_list_id,// "记录Id",
+ "storeId": that.data.getStorageID, //商家Id
+ "userId": that.data.getUserID, //用户ID
+ };
// var url ="/api/weshop/marketing/buy/receive/gift/record/insert";
// var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder";
- var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
+ var url = "/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
getApp().request.json_post(url, json,
function (res) {
- console.log('领取礼包');
- console.log(res);
+ console.log('领取礼包');
+ console.log(res);
if (res.data.code == 0 && res.data.data) {
- that.setData({
- is_receive:1
- })
- getApp().my_warnning("领取成功!", 1, that);
- that.closeSpecModal();
- setTimeout(()=>{
- wx.navigateBack({
- delta: 0,
+ that.setData({
+ is_receive: 1
})
- },500)
+ getApp().my_warnning("领取成功!", 1, that);
+ that.closeSpecModal();
+ setTimeout(() => {
+ wx.navigateBack({
+ delta: 0,
+ })
+ }, 500)
} else {
- that.setData({submit:0})
+ that.setData({ submit: 0 })
getApp().my_warnning(res.data.msg, 0, that);
}
},
function (res) {
- that.setData({submit:0})
+ that.setData({ submit: 0 })
}
)
},
@@ -1189,7 +1201,7 @@ Page({
// 选择门店
choice_store: function (ee) {
this.setData({
- keyword:''
+ keyword: ''
})
//--先判断会员状态--
@@ -1342,7 +1354,7 @@ Page({
region_name: region_name,
sort_store: 0,
choice_sort_store: 1,
- sec_i:index,
+ sec_i: index,
sec_sto: item,
sec_pick_index: 0
});
@@ -1368,7 +1380,7 @@ Page({
if (th.data.is_show_sto_cat == 1) {
item = th.data.def_pickpu_list[index];
} else {
- item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
+ item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
}
} else {
@@ -1376,7 +1388,7 @@ Page({
item = th.data.sec_sto.s_arr[index];
}
- if(!item) return false;
+ if (!item) return false;
if (!th.data.sele_g) return false;
@@ -1412,14 +1424,14 @@ Page({
if (th.data.is_show_sto_cat == 1) {
item = th.data.def_pickpu_list[index];
} else {
- item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
+ item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
}
} else {
var index = th.data.sec_pick_index;
item = th.data.sec_sto.s_arr[index];
}
- if(!item) return false;
+ if (!item) return false;
th.setData({
def_pick_store: item,
@@ -1454,7 +1466,7 @@ Page({
},
closeSpecModal: function () {
- this.setData({openSpecModal: 0});
+ this.setData({ openSpecModal: 0 });
},
buy_libao: function () {
@@ -1496,10 +1508,10 @@ Page({
// }
if (this.data.share_hidden) {
- this.setData({share_hidden: false,});
+ this.setData({ share_hidden: false, });
}
- wx.showLoading({title: '生成中...',})
+ wx.showLoading({ title: '生成中...', })
var that = this, th = that;
//设置画板显示,才能开始绘图
that.setData({
@@ -1639,29 +1651,29 @@ Page({
context.setFontSize(32 * unit);
context.setFillStyle('#DE1117');
- var price_txt="";
- if(price || giftIntegral){
- if(price){
- price_txt='¥' + price;
- if(giftIntegral){
- if(this.data.sele_g.money_type>0){
- price_txt+='+';
- }else{
- price_txt+='或';
- }
- }
- }
- if(giftIntegral) price_txt+=giftIntegral+'积分';
- }else{
- price_txt="免费领取";
+ var price_txt = "";
+ if (price || giftIntegral) {
+ if (price) {
+ price_txt = '¥' + price;
+ if (giftIntegral) {
+ if (this.data.sele_g.money_type > 0) {
+ price_txt += '+';
+ } else {
+ price_txt += '或';
+ }
+ }
+ }
+ if (giftIntegral) price_txt += giftIntegral + '积分';
+ } else {
+ price_txt = "免费领取";
}
context.fillText(price_txt, 54 * unit, 735 * unit);
- var wp= 62 * unit;
- var hp=765 * unit
- this.draw_pos_price(context,wp,hp,this.giftPosPrice,unit);
+ var wp = 62 * unit;
+ var hp = 765 * unit
+ this.draw_pos_price(context, wp, hp, this.giftPosPrice, unit);
// 8.商品标题
context.setFontSize(20 * unit);
@@ -1683,16 +1695,16 @@ Page({
//---市场价划掉---
- draw_pos_price(context,w,h,market_price,unit){
+ draw_pos_price(context, w, h, market_price, unit) {
- if(!this.is_retail_price) return false;
+ if (!this.is_retail_price) return false;
context.setFillStyle("gray")
context.setFontSize(22 * unit)
var pri0 = "¥" + market_price.toFixed(2);
context.fillText(pri0, w, h);
- var c_h=h-6;
+ var c_h = h - 6;
context.setStrokeStyle('gray');
context.setLineWidth(1 * unit);
context.moveTo(w - 5, c_h);
@@ -1708,7 +1720,7 @@ Page({
tt();
return false;
}
- var img_url =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
+ var img_url = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
//获取商品是分享图信息
wx.getImageInfo({
@@ -1721,8 +1733,8 @@ Page({
fail: function (res) {
//获取默认空白图
wx.getImageInfo({
- src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
- success: function(res) {
+ src: ee.data.iurl + '/miniapp/images/default_g_img.gif',
+ success: function (res) {
ee.data.share_goods_img = res.path; //分享的图片不能用网络的
tt();
}
@@ -1742,13 +1754,39 @@ Page({
},
// 预览海报
previewPoster() {
- getApp().globalData.no_clear=1;
+ getApp().globalData.no_clear = 1;
wx.previewImage({
current: this.data.shareImgPath, // 当前显示图片的http链接
- urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
+ urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
});
},
+ //-- 获取从表的信息 --
+ get_lb_list() {
+ let th = this;
+ getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagList/page", {
+ data: {
+ store_id:os.stoid,
+ form_id:th.data.params.id,
+ pageSize:50
+ },
+ }).then(res => {
+ if(ut.ajax_ok(res)){
+ th.setData({
+ wareCard:res.data.data.pageData
+ })
+ }
+ })
+ },
+
+
+ //不销毁界面跳转
+ navigateTo: function (e) {
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
+ }
+
+
});
\ No newline at end of file
diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
index 2a63c2f..428e49c 100644
--- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
+++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
@@ -78,70 +78,41 @@
-->
-
+
礼包内容
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.couponName}}
-
-
-
-
-
-
- {{"数量:"+item.num}}
-
-
-
- 已核销
-
-
- 未核销
-
-
-
-
-
+
+
+
-
-
-
+
-
-
-
-
-
-
-
- 奖励已发放
-
+
+
+
+ {{item.lbtitle}}
+
+
+
+ {{"零售价:"+item.oldprice}}
+
+
+
+
+ 第{{index+1}}个月 >
+
+
+
+
-
-
-
+
+