Commit 1e564142 by 程南

修改领券中心

parent 35c0a533
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id // 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播 //3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播 //门户 wx833d5ece112fc3fd //2006 泰华 , wx40fec8944623c8b3 有直播 //门户 wx833d5ece112fc3fd
...@@ -26,7 +26,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门 ...@@ -26,7 +26,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
//2002 巴黎贝甜 wx21968cb3a486d4ab //2002 巴黎贝甜 wx21968cb3a486d4ab
//2014 包小姐与鞋先生 wxa00302e2f53dd9c5 //2014 包小姐与鞋先生 wxa00302e2f53dd9c5
const BRANCH_ID = 1002 const BRANCH_ID = 1001
const isMall = true const isMall = true
// const needMock = '' // // const needMock = '' //
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wxac09792264c49b5c", "appid": "wxc3b64b09b1d3dfc2",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
...@@ -652,6 +652,12 @@ ...@@ -652,6 +652,12 @@
"pathName": "subPackageA/page/pages/moneyBuyCoupon/moneyBuyCoupon", "pathName": "subPackageA/page/pages/moneyBuyCoupon/moneyBuyCoupon",
"query": "", "query": "",
"scene": null "scene": null
},
{
"id": -1,
"name": "领券中心",
"pathName": "subPackage/page/pages/couponCenter/couponCenter",
"scene": null
} }
] ]
} }
......
...@@ -10,8 +10,8 @@ wxService.page({ ...@@ -10,8 +10,8 @@ wxService.page({
data: { data: {
query: '', query: '',
integralCouponList: [], // 积分兑换优惠券列表 integralCouponList: [], // 积分兑换优惠券列表
showDialog : false, showDialog: false,
dialogPicture : '', dialogPicture: '',
}, },
...@@ -39,7 +39,7 @@ wxService.page({ ...@@ -39,7 +39,7 @@ wxService.page({
//判断活动开始时间是不是已经开始了 //判断活动开始时间是不是已经开始了
item.isStart = true; item.isStart = true;
//判断是不是老活动 //判断是不是老活动
if(item.couponList){ if (item.couponList) {
item.isStart = util.compareCurrentDate(item.startTime); item.isStart = util.compareCurrentDate(item.startTime);
} }
}); });
...@@ -51,7 +51,7 @@ wxService.page({ ...@@ -51,7 +51,7 @@ wxService.page({
} }
} }
if(refresh){ if (refresh) {
wx.showToast({ wx.showToast({
title: '刷新成功', title: '刷新成功',
}); });
...@@ -71,52 +71,86 @@ wxService.page({ ...@@ -71,52 +71,86 @@ wxService.page({
const { id } = e.currentTarget.dataset; const { id } = e.currentTarget.dataset;
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
//先判断是不是老的活动 //先判断是不是老的活动
if(!item.couponList){ if (!item.couponList) {
this.getCoupon(id,item); this.getCoupon(id, item);
return ; return;
} }
if(isStart){ if (isStart) {
this.getCoupon(id,item); this.getCoupon(id, item);
} }
//预约 //预约
else{ else {
this.orderCouponActivity(id,item); this.orderCouponActivity(id, item);
} }
}, },
//立即领取 //立即领取
getCoupon(id,item){ getCoupon(id, item) {
wxService.post(`/coupon/couponCenterActivity/buyer/coupon/draw?id=${id}`).then(res => { wxService.post(`/coupon/couponCenterActivity/buyer/coupon/draw?id=${id}`).then(res => {
wx.hideLoading(); wx.hideLoading();
if(res){ if (res) {
if(res.data.result == 0){ if (res.data.result == 0) {
//判断是不是老活动 //判断是不是老活动
if(item.couponList){ if (item.couponList) {
this.data.showDialog = true; this.data.showDialog = true;
this.data.dialogPicture = item.dialogPicture; this.data.dialogPicture = item.dialogPicture;
this.setData({ this.setData({
showDialog : this.data.showDialog, showDialog: this.data.showDialog,
dialogPicture : this.data.dialogPicture dialogPicture: this.data.dialogPicture
}); });
} }
else{ else {
wx.showToast({ wx.showToast({
title: '领取成功!', title: '领取成功!',
}); });
} }
} }
else{ else {
wx.showToast({ wx.showToast({
title: '领取失败,请稍后再试', title: '领取失败,请稍后再试',
icon : 'none' icon: 'none'
}); });
} }
} }
}); });
}, },
//立即预约 //立即预约
orderCouponActivity(id){ orderCouponActivity(id) {
let baseUserInfo = wx.getStorageSync('_baseUserInfo');
wxService.post(`${'/merchant/message/wxSubMsgMapping/getListByParams'}`, {
scenarioIds: ['usernoticeappointment'],
sourceFrom: 2,
switchType: 3
}).then(res => {
let tempArr = res.data.data ? res.data.data : [];
if (tempArr.length == 0) {
return;
}
let tempids = [];
tempArr.map(item => {
tempids.push(item.templateId);
});
wx.requestSubscribeMessage({
tmplIds: tempids,
success: (res) => {
for (let i = 0; i < tempArr.length; i++) {
wxService.post(`${'/merchant/message/wxSubMsgSubscride/member/subscribe'}`, {
businessId: id,
memberId: baseUserInfo.memberId,
scenarioId: tempArr[i].scenarioId,
templateId: tempArr[i].templateId
}).then(resp => { });
}
},
complete: (res) => {
}
})
}).catch(err => {
})
}, },
//跳转到详情 //跳转到详情
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment