Commit 163d3b7e765d78ba18643d3b59231c6875521184

Authored by pengye
1 parent 25f7e986

优惠券扫码购买页3

@@ -12,63 +12,19 @@ Page({ @@ -12,63 +12,19 @@ Page({
12 dataStr: Date.now() * 1 / 1000, 12 dataStr: Date.now() * 1 / 1000,
13 discountPrice: '', //优惠价格 13 discountPrice: '', //优惠价格
14 actualPrice: '', //实付价格 14 actualPrice: '', //实付价格
  15 + inputValue: '', //输入的金额
  16 + canSolt: {}, //当前时间是哪个餐段、节假日
15 }, 17 },
  18 + sid: '', //扫码进入带的参数商家id
16 couponModal: '', 19 couponModal: '',
17 - monidata: [{  
18 - desc: "0", //优惠条件  
19 - price: "6", //优惠金额  
20 - showCpupon: '1', //是否可选  
21 - checked: true, //是否勾选  
22 - activity_id: "566",  
23 - aid: "948",  
24 - aname: "新测试一下",  
25 - cdate: "1739429461", //领取日期  
26 - arule: {  
27 - commission: "1",  
28 - is_accumulation: "1",  
29 - is_appointment: "1",  
30 - is_commission: "1",  
31 - is_compartment: "1",  
32 - is_eatin: "1",  
33 - is_same_day: "1", //领取当日是否可用  
34 - is_share_have: "1",  
35 - is_share_lose: "1",  
36 - is_takeout: "1",  
37 - },  
38 - etime: "1739635199",  
39 - exp_date: '{"week_show":"无","week_data":[{"id":null,"title":"周日","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周一","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周二","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周三","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周四","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周五","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"周六","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false},{"id":null,"title":"法定假日","select":false,"roleName":null,"phone":null,"account":null,"selectMor":false,"selectNoon":false,"selectNig":false}]}',  
40 - explain: "",  
41 - grant_last: "93",  
42 - grant_num: "100",  
43 - id: "948",  
44 - is_examine: "1",  
45 - is_open: "1",  
46 - is_type: "3",  
47 - lite_qrcode: "https://xt04.colorcun.com/activity/LiteQRcode/activity_948.jpeg",  
48 - map_address: "陕西省西安市沣惠南路36号",  
49 - openid: "oB-xJ5NGdgXHM0Pdsq2kAf7z-n9k",  
50 - phone: "15715807436",  
51 - seller_image: "http://libpc.colorcun.com/20241118173230_b2dbe5ec7ca79a64bf7eea6f0cab3dca",  
52 - seller_tel: "010-6257270,15236523652336",  
53 - sellerid: "4352",  
54 - sellername: "长安大排档总店",  
55 - status: "1",  
56 - stime: "1739289600",  
57 - uid: "7035",  
58 - uid_list: null,  
59 - urllink: "https://wxaurl.cn/m7EcFm28Kfr",  
60 - }],  
61 /** 20 /**
62 * 生命周期函数--监听页面加载 21 * 生命周期函数--监听页面加载
63 */ 22 */
64 onLoad(options) { 23 onLoad(options) {
65 this.couponModal = this.selectComponent("#couponModal"); 24 this.couponModal = this.selectComponent("#couponModal");
66 - // this.couponModal.showModal()  
67 - this.setData({  
68 - ...options  
69 - })  
70 if (options.sid) { 25 if (options.sid) {
71 - this.getSellerDetail(options.sid) 26 + this.sid = options.sid
  27 + this.getSellerDetailFun(options.sid)
72 } 28 }
73 }, 29 },
74 // 打开优惠券弹框 30 // 打开优惠券弹框
@@ -80,7 +36,7 @@ Page({ @@ -80,7 +36,7 @@ Page({
80 this.couponModal.closeModal() 36 this.couponModal.closeModal()
81 }, 37 },
82 // 获取店铺名称 38 // 获取店铺名称
83 - getSellerDetail(sid) { 39 + getSellerDetailFun(sid) {
84 App.Customer.GetSellerDetail({ 40 App.Customer.GetSellerDetail({
85 sid 41 sid
86 }).then(res => { 42 }).then(res => {
@@ -88,20 +44,21 @@ Page({ @@ -88,20 +44,21 @@ Page({
88 this.setData({ 44 this.setData({
89 seller: { 45 seller: {
90 seller_image: data.seller_image, 46 seller_image: data.seller_image,
91 - sellername: data.sellername  
92 - 47 + sellername: data.sellername,
  48 + sid: data.id
93 } 49 }
94 }) 50 })
95 - this.getCoupon() 51 + // 判断当前时间餐段、节假日
  52 + this.getSellerDailyFun(data.daily)
96 }) 53 })
97 }, 54 },
98 // 获取所有优惠券列表 55 // 获取所有优惠券列表
99 getCoupon() { 56 getCoupon() {
100 - App.Activity.ActivityListByOpenid().then(res => { 57 + App.Activity.ActivityListByOpenid({
  58 + sellerid: this.sid
  59 + }).then(res => {
101 if (res.ret == 200 && res.data && res.data.length > 0) { 60 if (res.ret == 200 && res.data && res.data.length > 0) {
102 - let list = res.data.filter(item => {  
103 - return this.data.dataStr < (item.etime * 1) && item.is_open == '1'  
104 - }) 61 + let list = res.data
105 list.forEach(detail => { 62 list.forEach(detail => {
106 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : ''; 63 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
107 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : ''; 64 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
@@ -137,15 +94,50 @@ Page({ @@ -137,15 +94,50 @@ Page({
137 console.log('checkbox发生change事件,携带value值为:', e.detail.value) 94 console.log('checkbox发生change事件,携带value值为:', e.detail.value)
138 const list = this.data.couponArr 95 const list = this.data.couponArr
139 const values = e.detail.value 96 const values = e.detail.value
  97 + let arr = []
  98 + let currentCoupon = '0'; //没选券 为0 可叠加券1 不可叠加券2
140 for (let i = 0, lenI = list.length; i < lenI; ++i) { 99 for (let i = 0, lenI = list.length; i < lenI; ++i) {
141 list[i].checked = false 100 list[i].checked = false
142 for (let j = 0, lenJ = values.length; j < lenJ; ++j) { 101 for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
143 if (list[i].activity_id === values[j]) { 102 if (list[i].activity_id === values[j]) {
  103 + arr.push({
  104 + ...list[i]
  105 + })
144 list[i].checked = true 106 list[i].checked = true
  107 + if (list[i].accumulationShow == '1') {
  108 + currentCoupon = '1'
  109 + } else {
  110 + currentCoupon = '2'
  111 + }
145 break 112 break
146 } 113 }
147 } 114 }
148 } 115 }
  116 + console.log('没选券 为0 可叠加券1 不可叠加券2', currentCoupon);
  117 + //没选券 所有可选的打开
  118 + if (currentCoupon == '0') {
  119 + list.forEach(item => {
  120 + if (item.canCheck == "1") {
  121 + item.showCpupon = '1';
  122 + }
  123 + })
  124 + }
  125 + //选的不可叠加券 其他所有的可叠加券都不可选
  126 + if (currentCoupon == '2') {
  127 + list.forEach(item => {
  128 + if (item.accumulationShow == "1") {
  129 + item.showCpupon = '0';
  130 + }
  131 + })
  132 + }
  133 + //选的可叠加券 其他所有的不可叠加券都不可选
  134 + if (currentCoupon == '1') {
  135 + list.forEach(item => {
  136 + if (item.accumulationShow == "0") {
  137 + item.showCpupon = '0';
  138 + }
  139 + })
  140 + }
149 this.setData({ 141 this.setData({
150 couponArr: list 142 couponArr: list
151 }) 143 })
@@ -180,6 +172,7 @@ Page({ @@ -180,6 +172,7 @@ Page({
180 console.log('优惠金额----', price); 172 console.log('优惠金额----', price);
181 let val = this.data.inputValue * 1; 173 let val = this.data.inputValue * 1;
182 let actualPrice = val - price.toFixed(2) 174 let actualPrice = val - price.toFixed(2)
  175 + price = price.toFixed(2)
183 this.setData({ 176 this.setData({
184 discountPrice: price, 177 discountPrice: price,
185 actualPrice: actualPrice > 0 ? actualPrice : 0.1, 178 actualPrice: actualPrice > 0 ? actualPrice : 0.1,
@@ -189,172 +182,261 @@ Page({ @@ -189,172 +182,261 @@ Page({
189 // 处理显示券可用、不可用的列表 182 // 处理显示券可用、不可用的列表
190 async colationData() { 183 async colationData() {
191 let list = this.data.couponArr; 184 let list = this.data.couponArr;
192 - // list = list  
193 list = await this.filterCoupons(list); 185 list = await this.filterCoupons(list);
194 - list = await this.findBestCoupons(list);  
195 - console.log('eeeeeeeeeeee', list); 186 + let obj = await this.findBestCoupons(list);
  187 + list = obj.arr
  188 + console.log('处理过后的券数据', list);
  189 + list.sort((a, b) => b.canCheck - a.canCheck);
196 list.sort((a, b) => b.showCpupon - a.showCpupon); 190 list.sort((a, b) => b.showCpupon - a.showCpupon);
197 - // list.filter(i=>{return i.aexpiration!='0' && i.aexpiration>0})  
198 this.setData({ 191 this.setData({
199 - couponArr: list 192 + couponArr: list,
  193 + finalList: obj.finalList
200 }) 194 })
201 }, 195 },
  196 + // 付款
  197 + confirmPayment() {
  198 + let actualPrice = this.data.actualPrice
  199 + if (actualPrice <= 0) {
  200 + return
  201 + }
  202 + App.PayOnline.CombineTransactionsByNewActivity({
  203 + sellerid: this.data.seller.sid,
  204 + price: actualPrice,
  205 + }).then(res => {
  206 + console.log('付款信息', res.data);
  207 + if (res.ret != '200') {
  208 + wx.showToast({
  209 + title: res.msg,
  210 + duration: 1000,
  211 + icon: 'none',
  212 + })
  213 + }
  214 + if (res.ret == '200') {
  215 + wx.requestPayment({
  216 + timeStamp: res.data.timeStamp + '',
  217 + nonceStr: res.data.nonceStr,
  218 + package: res.data.package,
  219 + signType: res.data.signType,
  220 + paySign: res.data.paySign,
  221 + success(ress) {
  222 + if (ress.errMsg == 'requestPayment:ok') {
  223 + this.writeOff()
  224 + console.log('支付成功', ress);
  225 + wx.showToast({
  226 + title: '支付成功',
  227 + duration: 1000,
  228 + icon: 'none',
  229 + })
  230 + }
  231 + console.log('支付失败', ress);
  232 + wx.showToast({
  233 + title: '支付失败,请重新下单',
  234 + duration: 1000,
  235 + })
  236 + },
  237 + fail(ress) {
  238 + console.log('支付失败', ress);
  239 + wx.showToast({
  240 + title: '支付失败,请重新下单',
  241 + duration: 1000,
  242 + icon: 'none',
  243 + })
  244 + },
  245 + })
  246 + }
  247 + })
  248 + },
  249 + // 核销所勾选的券
  250 + writeOff() {
  251 + console.log('勾选的券', this.data.finalList);
  252 + if (this.data.finalList.length > 0) {
  253 + let str = this.data.finalList.map(item => item.activity_id).join(',');
  254 + console.log('核销所勾选的券传参', str);
  255 + App.Activity.SetActivityStatus({
  256 + id: str,
  257 + }).then(res => {
  258 + if (res.ret == '200') {
  259 + console.log('核销成功', str);
  260 + }
  261 + })
  262 + }
  263 + },
  264 + // 判断券开启、有效期结束时间、领取后有效天数、领取当天可用、不可用日期
202 filterCoupons(list) { 265 filterCoupons(list) {
203 - console.log(1111111, list);  
204 - // const currentTime = Math.floor(Date.now() / 1000); // 获取当前时间的 Unix 时间戳(秒)  
205 - // const today = new Date(); // 获取今天的日期  
206 - // today.setHours(0, 0, 0, 0); // 将时间设为今天的开始时间  
207 - // const todayTimestamp = Math.floor(today.getTime() / 1000); // 获取今天的开始时间戳  
208 -  
209 - // return list.filter(coupon => {  
210 - // const couponCDate = parseInt(coupon.cdate); // 领取日期  
211 - // const validDays = parseInt(coupon.aexpiration); // 有效天数  
212 - // const isSameDay = parseInt(coupon.arule.is_same_day); // 领取当日是否可用  
213 -  
214 - // // 计算有效期结束时间  
215 - // const couponExpirationDate = couponCDate + validDays * 24 * 60 * 60; // 有效期结束时间戳  
216 - // // 筛选条件  
217 - // const isWithinValidity = todayTimestamp >= couponCDate && todayTimestamp <= couponExpirationDate;  
218 - // return (  
219 - // (todayTimestamp > couponCDate && isWithinValidity) || // 今天不是领取当日,但在有效天数内  
220 - // (todayTimestamp === couponCDate && isSameDay === 1 && validDays >= 1) // 今天是领取当日且可用  
221 - // );  
222 - // });  
223 -  
224 -  
225 - // const currentTime = Math.floor(Date.now() / 1000); // 获取当前时间的 Unix 时间戳(秒)  
226 - // const today = new Date(); // 获取今天的日期  
227 - // today.setHours(0, 0, 0, 0); // 将时间设为今天的开始时间  
228 - // const todayTimestamp = Math.floor(today.getTime() / 1000); // 获取今天的开始时间戳  
229 -  
230 - // list.forEach(coupon => {  
231 - // const couponCDate = parseInt(coupon.cdate); // 领取日期  
232 - // const validDays = parseInt(coupon.aexpiration); // 有效天数  
233 - // const isSameDay = parseInt(coupon.arule.is_same_day); // 领取当日是否可用  
234 - // // const couponExpirationDate = couponCDate + validDays * 24 * 60 * 60; // 有效期结束时间戳  
235 -  
236 - // let date = new Date(couponCDate * 1000);  
237 - // date.setDate(date.getDate() + validDays);  
238 - // date.setHours(23, 59, 59, 0);  
239 - // let couponExpirationDate = Math.floor(date.getTime() / 1000);  
240 - // // 今天的开始时间戳 <= 领取日期  
241 - // const isWithinValidity = (todayTimestamp <= couponCDate) && (todayTimestamp <= couponExpirationDate);  
242 - // console.log('领取日期---',couponCDate);  
243 - // console.log('有效天数---',validDays);  
244 - // console.log('领取当日是否可用---',isSameDay);  
245 - // console.log('有效期结束时间戳---',couponExpirationDate);  
246 - // console.log('isWithinValidity---',isWithinValidity);  
247 - // console.log('获取今天的开始时间戳---',todayTimestamp);  
248 - // console.log('wwwwwwwwwww---',(todayTimestamp >= couponCDate));  
249 - // console.log('ggggggggggg---',(todayTimestamp <= couponExpirationDate));  
250 - // // 今天不是领取当日,但在有效天数内 || 今天是领取当日且可用  
251 - // if ((todayTimestamp > couponCDate && isWithinValidity) || (todayTimestamp === couponCDate && isSameDay === 1 && validDays >= 1)) {  
252 - // coupon.aa = '1';  
253 - // console.log('可用',coupon.aname);  
254 - // } else {  
255 - // coupon.aa = '0';  
256 - // console.log('不可用',coupon.aname);  
257 - // }  
258 - // });  
259 -  
260 -  
261 - const currentTime = Math.floor(Date.now() / 1000); // 获取当前时间的 Unix 时间戳(秒)  
262 -  
263 - // 获取今天的开始时间和结束时间  
264 - const today = new Date();  
265 - today.setHours(0, 0, 0, 0); // 设置为今天的开始时间  
266 - const todayStartTimestamp = Math.floor(today.getTime() / 1000); // 今天的开始时间戳  
267 -  
268 - today.setHours(23, 59, 59); // 设置为今天的结束时间  
269 - const todayEndTimestamp = Math.floor(today.getTime() / 1000); // 今天的结束时间戳  
270 - 266 + const currentDate = new Date();
  267 + currentDate.setHours(0, 0, 0, 0);
271 list.forEach(coupon => { 268 list.forEach(coupon => {
272 - const couponCDate = parseInt(coupon.cdate); // 领取日期  
273 - const validDays = parseInt(coupon.aexpiration); // 有效天数  
274 - const isSameDay = parseInt(coupon.arule.is_same_day); // 领取当日是否可用  
275 -  
276 - // 计算有效期结束时间  
277 - const couponExpirationDate = couponCDate + validDays * 24 * 60 * 60; // 有效期结束时间戳  
278 -  
279 - // 判断条件  
280 - const isWithinValidity = todayStartTimestamp > couponCDate && todayEndTimestamp < couponExpirationDate;  
281 -  
282 - if (  
283 - (todayStartTimestamp > couponCDate && isWithinValidity) || // 今天不是领取当日,但在有效天数内  
284 - (todayStartTimestamp === couponCDate && isSameDay === 1 && validDays >= 1) // 今天是领取当日且可用  
285 - ) {  
286 - coupon.aa = '1'; // 符合条件,设置为可选 269 + const startUseDate = new Date(currentDate);
  270 + let endUseDate = new Date(currentDate);
  271 + const couponDate = new Date(coupon.cdate * 1000);
  272 + if (coupon.arule.is_same_day) {
  273 + startUseDate.setDate(couponDate.getDate() - 1);
  274 + } else {
  275 + startUseDate.setDate(couponDate.getDate());
  276 + }
  277 + // 券领取天数为0或者为空 默认券可使用最晚时间是券有效期截止时间
  278 + if (coupon.aexpiration == '0' || coupon.aexpiration == '') {
  279 + let date = new Date(coupon.etime * 1000);
  280 + endUseDate = date
287 } else { 281 } else {
288 - coupon.aa = '0'; // 不符合条件,设置为不可选 282 + endUseDate.setDate(couponDate.getDate() + parseInt(coupon.aexpiration));
  283 + }
  284 + // 今天不是领取当日,但在有效天数内 && 今天是领取当日且可用 && 在有效天数内 && 券是开启状态
  285 + const isUseDate = (currentDate > startUseDate && currentDate < endUseDate) &&
  286 + (this.data.dataStr < (coupon.etime * 1) && coupon.is_open == '1')
  287 + let obj = this.data.canSolt
  288 + let selectedValue = true;
  289 + let str = true
  290 + if (coupon.exp_date && coupon.exp_date.week_data && coupon.exp_date.week_data.length > 0) {
  291 + let today = new Date(); // 获取今天是星期几(0-6,0表示周日)
  292 + let dayOfWeek = today.getDay();
  293 + let arr = coupon.exp_date.week_data
  294 + let todayArr = arr[dayOfWeek];
  295 + let legalHolidayValue = arr[arr.length - 1];
  296 + if (obj.can === "晚餐") {
  297 + selectedValue = todayArr.selectNig;
  298 + } else if (obj.can === "午餐") {
  299 + selectedValue = todayArr.selectNoon;
  300 + } else if (obj.can === "早餐") {
  301 + selectedValue = todayArr.selectMor;
  302 + }
  303 + selectedValue = !selectedValue
  304 + console.log(coupon.aname, coupon.exp_date.week_show, `今天是 ${todayArr.title},选择值为: ${selectedValue}`);
  305 + // 根据 isshow 判断法定假日是否可用
  306 + if (obj.isshow === "1") {
  307 + if (obj.can === "晚餐") {
  308 + str = legalHolidayValue.selectNig;
  309 + } else if (obj.can === "午餐") {
  310 + str = legalHolidayValue.selectNoon;
  311 + } else if (obj.can === "早餐") {
  312 + str = legalHolidayValue.selectMor;
  313 + }
  314 + str = !str
  315 + }
  316 + console.log(coupon.aname, '法定节假期', `,选择值为: ${str}`);
  317 + }
  318 + let availableDate = true;
  319 + if (str || selectedValue) {
  320 + availableDate = true
  321 + }
  322 + if (!str || !selectedValue) {
  323 + availableDate = false
289 } 324 }
  325 + if ((str && !selectedValue) || (!str && selectedValue)) {
  326 + availableDate = false
  327 + }
  328 + coupon.isOk = isUseDate && (availableDate || coupon.exp_date.week_show == '无') ? '1' : '0'; //是否在可用时间内 1可使用 2不可使用
  329 + endUseDate.setHours(23, 59, 59, 999); // 设置时间为23:59:59.999
  330 + const timestamp = Math.floor(endUseDate.getTime() / 1000);
  331 + let c = coupon.etime * 1
  332 + coupon.expirationDate = Math.min(timestamp, c);
290 }); 333 });
291 -  
292 -  
293 -  
294 -  
295 -  
296 -  
297 -  
298 -  
299 - console.log('1111', list);  
300 return list 334 return list
301 }, 335 },
302 - // (消费要求为无门槛 或者 小于输入金额的) && 勾选最优的 336 + // 最优惠的消费券组合(消费要求为无门槛 或者 满足优惠券使用金额 && 勾选最优的、最早到期的)
303 findBestCoupons(arr) { 337 findBestCoupons(arr) {
304 - console.log(333333333); 338 + console.log('勾选最优的之前', arr);
305 let inputValue = this.data.inputValue; 339 let inputValue = this.data.inputValue;
306 - const amount = parseFloat(inputValue); // 将输入金额转换为数字  
307 - const validCoupons = arr.filter(coupon => (coupon.aa == '1' && parseFloat(coupon.desc) <= amount)); // 筛选符合条件的优惠券  
308 - console.log('validCouponsvalidCoupons', validCoupons);  
309 - let bestDiscount = 0;  
310 - let bestCoupons = [];  
311 -  
312 - // 按到期时间排序,确保优先选择最早到期的券  
313 - validCoupons.sort((a, b) => parseInt(a.etime) - parseInt(b.etime));  
314 -  
315 - // 使用递归函数来查找所有组合  
316 - function findBestCombination(currentCoupons, currentDiscount, remainingCoupons) {  
317 - const totalDiscount = currentDiscount;  
318 - const finalPrice = amount - totalDiscount;  
319 - // 检查当前组合是否是最佳组合且实付价格不小于0  
320 - if (finalPrice >= 0 && totalDiscount > bestDiscount) {  
321 - bestDiscount = totalDiscount;  
322 - bestCoupons = currentCoupons.slice(); // 复制当前组合 340 + const amount = parseFloat(inputValue);
  341 + const validCoupons = arr.filter(coupon => (coupon.isOk == '1' && parseFloat(coupon.desc) <= amount));
  342 + arr.forEach(item => {
  343 + const isValid = validCoupons.some(validCoupon => validCoupon.activity_id == item.activity_id);
  344 + item.canCheck = isValid ? '1' : '0'; // 如果在 validCoupons 中,设置 canCheck 为 1,否则为 0
  345 + });
  346 + console.log('可以勾选的券 && 满足付款条件的券', validCoupons);
  347 + let list1 = []; // 可叠加的优惠券组合
  348 + let list2 = []; // 最优惠的不可叠加的优惠券
  349 + let finalList = []; //最终用的优惠券组合
  350 + // 计算可叠加的组合
  351 + let remainingValue = inputValue; // 剩余金额
  352 + let totalDiscount = 0; // 总优惠金额
  353 + // 尝试组合可叠加的优惠券
  354 + validCoupons.forEach(coupon => {
  355 + if (coupon.accumulationShow === '1') {
  356 + const discountAmount = parseInt(coupon.price);
  357 + if (remainingValue > 0) {
  358 + list1.push(coupon);
  359 + totalDiscount += discountAmount; // 累加优惠金额
  360 + remainingValue -= discountAmount; // 减少应付金额
  361 + }
323 } 362 }
324 -  
325 - // 遍历剩余的优惠券  
326 - for (let i = 0; i < remainingCoupons.length; i++) {  
327 - const nextCoupon = remainingCoupons[i];  
328 - currentCoupons.push(nextCoupon); // 选择当前优惠券  
329 - findBestCombination(currentCoupons, currentDiscount + parseFloat(nextCoupon.price), remainingCoupons.slice(i + 1)); // 递归查找  
330 - currentCoupons.pop(); // 回溯 363 + });
  364 + // 检查可叠加组合是否有效
  365 + if (remainingValue < 0) {
  366 + list1 = []; // 如果剩余金额小于0,清空可叠加列表
  367 + }
  368 + // 重置剩余金额,用于不可叠加的优惠券
  369 + remainingValue = inputValue;
  370 + // 遍历有效优惠券,寻找不可叠加的优惠券
  371 + validCoupons.forEach(coupon => {
  372 + if (coupon.accumulationShow === '0') {
  373 + const discountAmount = parseInt(coupon.price);
  374 + // 计算实际支付金额
  375 + const finalAmount = inputValue - discountAmount;
  376 + // 确保实际支付金额不小于0,并且是最优惠的
  377 + if (finalAmount >= 0) {
  378 + if (!list2.length || discountAmount > parseInt(bestCoupon.price)) {
  379 + list2.push({
  380 + ...coupon
  381 + }); // 更新最优惠的不可叠加券
  382 + }
  383 + }
  384 + }
  385 + });
  386 + console.log('可叠加的优惠券组合', list1);
  387 + console.log('不可叠加的优惠券', list2);
  388 + // 计算两个列表的最大优惠值
  389 + let maxStackableValue = list1.reduce((total, coupon) => total + coupon.price, 0);
  390 + let maxNonStackableValue = list2.reduce((total, coupon) => total + coupon.price, 0);
  391 +
  392 + // 比较两个最大值并输出结果
  393 + if (maxStackableValue > maxNonStackableValue) {
  394 + console.log(`可叠加优惠券组合的最大优惠值更高: ${maxStackableValue}`);
  395 + finalList = list1
  396 + } else if (maxStackableValue < maxNonStackableValue) {
  397 + console.log(`不可叠加券的最大优惠值更高: ${maxNonStackableValue}`);
  398 + finalList = list2
  399 + } else {
  400 + console.log(`两者的优惠值相同: ${maxStackableValue}`);
  401 + let copiedList1 = JSON.parse(JSON.stringify(list1));
  402 + let copiedList2 = JSON.parse(JSON.stringify(list2));
  403 + let minList1 = copiedList1.length > 0 ? Math.min(...copiedList1.map(item => item.expirationDate)) : Infinity;
  404 + let minList2 = copiedList2.length > 0 ? Math.min(...copiedList2.map(item => item.expirationDate)) : Infinity;
  405 + // 判断最小的 expirationDate 是在 list1 还是 list2
  406 + if (minList1 <= minList2) {
  407 + console.log('最小的在 list1 中', list1);
  408 + finalList = list1
  409 + } else {
  410 + console.log('最小的在 list2 中', list2);
  411 + finalList = list2
331 } 412 }
332 } 413 }
333 -  
334 - findBestCombination([], 0, validCoupons);  
335 -  
336 -  
337 - let totalDiscountPrice = 0; 414 + console.log('选中的券组合', finalList);
  415 + let discountPrice = 0;
338 // 更新选中的优惠券 416 // 更新选中的优惠券
339 - bestCoupons.forEach(coupon => { 417 + finalList.forEach(coupon => {
  418 + let target = arr.find(obj => obj.activity_id === coupon.activity_id);
  419 + if (target) {
  420 + target.showCpupon = 1;
  421 + target.checked = true;
  422 + discountPrice += coupon.price * 1; // 使用 parseFloat 确保类型正确
  423 + }
340 console.log('选中的券', { 424 console.log('选中的券', {
341 ...coupon 425 ...coupon
342 }); 426 });
343 - coupon.showCpupon = '1';  
344 - coupon.checked = true;  
345 - totalDiscountPrice += parseFloat(coupon.price); // 使用 parseFloat 确保类型正确  
346 }); 427 });
347 -  
348 - console.log('总优惠金额:', totalDiscountPrice);  
349 - let actualPrice = (amount - totalDiscountPrice).toFixed(2); 428 + discountPrice = discountPrice.toFixed(2)
  429 + console.log('总优惠金额:', discountPrice);
  430 + let actualPrice = (amount - discountPrice).toFixed(2);
350 console.log('实际支付金额:', actualPrice); 431 console.log('实际支付金额:', actualPrice);
351 -  
352 this.setData({ 432 this.setData({
353 - discountPrice: totalDiscountPrice, 433 + discountPrice,
354 actualPrice: actualPrice > 0 ? actualPrice : '0.1', // 确保实际支付金额不小于0.01 434 actualPrice: actualPrice > 0 ? actualPrice : '0.1', // 确保实际支付金额不小于0.01
355 }); 435 });
356 -  
357 - return arr; // 返回更新后的数组 436 + return {
  437 + arr,
  438 + finalList, // 返回可叠加和不可叠加的优惠券组合
  439 + };
358 }, 440 },
359 // 处理优惠券不可用日期数据 441 // 处理优惠券不可用日期数据
360 hasConsecutiveSelect(arr, type) { 442 hasConsecutiveSelect(arr, type) {
@@ -400,6 +482,175 @@ Page({ @@ -400,6 +482,175 @@ Page({
400 firstTitle 482 firstTitle
401 }; 483 };
402 }, 484 },
  485 + // 判断当前时间餐段、节假日
  486 + getSellerDailyFun(lunchDis) {
  487 + let lunchDinnerList = [];
  488 + if (lunchDis.morning) {
  489 + lunchDinnerList.push({
  490 + can: "早餐",
  491 + solt: 1,
  492 + class: "morning",
  493 + })
  494 + }
  495 + if (lunchDis.noon) {
  496 + lunchDinnerList.push({
  497 + can: "午餐",
  498 + solt: 2,
  499 + class: "dinner",
  500 + })
  501 + }
  502 + if (lunchDis.night) {
  503 + lunchDinnerList.push({
  504 + can: "晚餐",
  505 + solt: 3,
  506 + class: "lunch",
  507 + })
  508 + }
  509 + const currentTime = new Date().toLocaleTimeString('en-US', {
  510 + hour12: false,
  511 + hour: '2-digit',
  512 + minute: '2-digit'
  513 + });
  514 + let obj = this.checkTimeInInterval(currentTime, lunchDis, lunchDinnerList);
  515 + //节假日数组
  516 + var holidays = [
  517 + '2025-1-1', // 元旦
  518 + '2025-1-28', // 春节
  519 + '2025-1-29', // 春节
  520 + '2025-1-30', // 春节
  521 + '2025-1-31', // 春节
  522 + '2025-2-1', // 春节
  523 + '2025-2-2', // 春节
  524 + '2025-2-3', // 春节
  525 + '2025-2-4', // 春节
  526 + '2025-4-4', //清明
  527 + '2025-4-5', //清明
  528 + '2025-4-6', //清明
  529 + '2025-5-1', // 劳动节
  530 + '2025-5-2', // 劳动节
  531 + '2025-5-3', // 劳动节
  532 + '2025-5-4', // 劳动节
  533 + '2025-5-5', // 劳动节
  534 + '2025-5-31', // 端午节
  535 + '2025-6-1', // 端午节
  536 + '2025-6-2', // 端午节
  537 + '2025-10-1', // 国庆节、中秋节
  538 + '2025-10-2', // 国庆节、中秋节
  539 + '2025-10-3', // 国庆节、中秋节
  540 + '2025-10-4', // 国庆节、中秋节
  541 + '2025-10-5', // 国庆节、中秋节
  542 + '2025-10-6', // 国庆节、中秋节
  543 + '2025-10-7', // 国庆节、中秋节
  544 + '2025-10-8', // 国庆节、中秋节
  545 + ];
  546 + //周末上班日期数组
  547 + var nWeekend = [
  548 + '2025-1-26', //春节调整
  549 + '2025-2-8', //春节调整
  550 + '2025-4-27', //五一调整
  551 + '2025-9-28', //国庆调整
  552 + '2025-10-11', //国庆调整
  553 + ];
  554 + var curdate = new Date();
  555 + curdate.setTime(curdate.getTime() + 4 * 24 * 60 * 60 * 1000);
  556 + var year = curdate.getFullYear();
  557 + var month = curdate.getMonth() + 1;
  558 + var date = curdate.getDate();
  559 + var formattedDate = year + "-" + month + "-" + date;
  560 + obj.isshow = '0'
  561 + //该日期同时满足2个条件即为节假日:1.在节假日数组内或在周末. 2.不在周末上班日期数组
  562 + if ((holidays.indexOf(formattedDate) >= 0 || (curdate.getDay() == 0 || curdate.getDay() == 6)) && nWeekend.indexOf(formattedDate) < 0) {
  563 + obj.isshow = '1'
  564 + } else {
  565 + obj.isshow = '0'
  566 + }
  567 + console.log('不可用日期信息:餐段、节假日', obj);
  568 + if (obj && obj.can && obj.solt) {
  569 + this.setData({
  570 + canSolt: {
  571 + ...obj
  572 + }
  573 + })
  574 + }
  575 + this.getCoupon()
  576 + },
  577 + // 传参currentTime 当前时间 例16:51 lunchDis 餐段 {morning: "07:00-10:00",night: "16:00-21:00",noon: "11:00-14:30"}
  578 + // 判断当前时间餐段
  579 + checkTimeInInterval(currentTime, lunchDis, lunchDinnerList) {
  580 + const [currentHour, currentMinute] = currentTime.split(':');
  581 + const [morningHour2, morningMinute2] = lunchDis.morning ? lunchDis.morning.split("-")[1].split(':') : [0, 0];
  582 + const [noonHour1, noonMinute1] = lunchDis.noon ? lunchDis.noon.split("-")[1].split(':') : [0, 0];
  583 + const [noonHour2, noonMinute2] = lunchDis.noon ? lunchDis.noon.split("-")[1].split(':') : [0, 0];
  584 + const [nightHour1, nightMinute1] = lunchDis.night ? lunchDis.night.split("-")[1].split(':') : [0, 0];
  585 + const currentTimestamp = new Date().setHours(currentHour, currentMinute, 0, 0); //当前时间
  586 + const time1 = (morningHour2 && morningMinute2) ? new Date().setHours(morningHour2, morningMinute2, 0, 0) : ''; //早餐截止时间
  587 + const time2 = (noonHour1 && noonMinute1) ? new Date().setHours(noonHour1, noonMinute1, 0, 0) : ''; //午餐开始时间
  588 + const time3 = (noonHour2 && noonMinute2) ? new Date().setHours(noonHour2, noonMinute2, 0, 0) : ''; //午餐截止时间
  589 + const time4 = (nightHour1 && nightMinute1) ? new Date().setHours(nightHour1, nightMinute1, 0, 0) : ''; //晚餐开始时间
  590 + // 1个餐段
  591 + if (lunchDinnerList.length == 1) {
  592 + return {
  593 + solt: lunchDinnerList[0].solt,
  594 + can: lunchDinnerList[0].can
  595 + };
  596 + }
  597 + // 2个餐段(早,午)(早,晚)(午,晚)
  598 + if (lunchDinnerList.length == 2) {
  599 + let obj1 = lunchDinnerList[0];
  600 + let obj2 = lunchDinnerList[1];
  601 + let timeA1 = obj1.solt == 1 ? time1 : time2;
  602 + let timeA2 = obj2.solt == 2 ? time2 : time4;
  603 + if (currentTimestamp < timeA1) { // 在早餐/午餐截止时间之前
  604 + return obj1.solt == 1 ? {
  605 + solt: 1,
  606 + can: '早餐'
  607 + } : {
  608 + solt: 2,
  609 + can: '午餐'
  610 + };
  611 + } else if (currentTimestamp > timeA1 && currentTimestamp < timeA2) { //在早餐/午餐截止时间之后 && 午餐/晚餐开始时间之前
  612 + return obj2.solt == 2 ? {
  613 + solt: 2,
  614 + can: '午餐'
  615 + } : {
  616 + solt: 3,
  617 + can: '晚餐'
  618 + };
  619 + } else if (currentTimestamp > timeA2) { //在午餐/晚餐截止时间之后
  620 + return obj1.solt == 1 ? {
  621 + solt: 1,
  622 + can: '早餐'
  623 + } : {
  624 + solt: 2,
  625 + can: '午餐'
  626 + };
  627 + }
  628 + }
  629 + // 3个餐段(早,午,晚)
  630 + if (lunchDinnerList.length == 3) {
  631 + if (currentTimestamp < time1) { //当前时间 在早餐截止时间之前
  632 + return {
  633 + solt: 1,
  634 + can: '早餐'
  635 + };
  636 + } else if (currentTimestamp > time1 && currentTimestamp < time2) { //在早餐截止时间之后 && 午餐开始时间之前
  637 + return {
  638 + solt: 2,
  639 + can: '午餐'
  640 + };
  641 + } else if (currentTimestamp > time3 && currentTimestamp < time4) { //在午餐截止时间之后 && 晚餐开始时间之前
  642 + return {
  643 + solt: 3,
  644 + can: '晚餐'
  645 + };
  646 + } else {
  647 + return {
  648 + solt: 3,
  649 + can: '晚餐'
  650 + };
  651 + }
  652 + }
  653 + },
403 /** 654 /**
404 * 生命周期函数--监听页面初次渲染完成 655 * 生命周期函数--监听页面初次渲染完成
405 */ 656 */
@@ -19,9 +19,9 @@ @@ -19,9 +19,9 @@
19 </view> 19 </view>
20 <view class="couponsWrap"> 20 <view class="couponsWrap">
21 <view class="couponLeft">抵扣后</view> 21 <view class="couponLeft">抵扣后</view>
22 - <view class="couponRight" wx:if="{{actualPrice}}">¥{{actualPrice}}</view> 22 + <view class="couponRight" wx:if="{{actualPrice && inputValue}}">¥{{actualPrice}}</view>
23 </view> 23 </view>
24 - <view class="payBtn font32r">付款</view> 24 + <view class="payBtn font32r" bindtap="confirmPayment">付款</view>
25 </view> 25 </view>
26 <my-modal id="couponModal" fadeStyle="slideUp" height="{{couponArr.length > '3' ? '80%' : '60%'}}"> 26 <my-modal id="couponModal" fadeStyle="slideUp" height="{{couponArr.length > '3' ? '80%' : '60%'}}">
27 <view slot="modalName" class="titleModal"> 27 <view slot="modalName" class="titleModal">
@@ -42,22 +42,14 @@ @@ -42,22 +42,14 @@
42 <view class="itemRight"> 42 <view class="itemRight">
43 <view class="anameText"> 43 <view class="anameText">
44 <text class="font40r">{{item.aname}}</text> 44 <text class="font40r">{{item.aname}}</text>
45 - <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.accumulationShow == '1' ? '可' : '不可'}}叠加</view> 45 + <view class="discountText1 font20r">{{item.accumulationShow == '1' ? '可' : '不可'}}叠加</view>
46 </view> 46 </view>
47 <view wx:if="{{item.endDateStr}}" class="font20r bottomTitle">有效日期:<view class="bottom font20r">{{item.endDateStr}}</view> 47 <view wx:if="{{item.endDateStr}}" class="font20r bottomTitle">有效日期:<view class="bottom font20r">{{item.endDateStr}}</view>
48 </view> 48 </view>
49 - <view wx:if="{{item.noonText || item.noonText}}" class="font20r bottomTitle">不可使用:<view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view> 49 + <view wx:if="{{item.noonText || item.noonText}}" class="font20r bottomTitle"><text>不可使用:</text><view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view>
50 </view> 50 </view>
51 <view wx:if="{{item.nigText}}" class="bottom font20r nodate">{{item.nigText}}</view> 51 <view wx:if="{{item.nigText}}" class="bottom font20r nodate">{{item.nigText}}</view>
52 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font20r">无使用时间限制</view> 52 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font20r">无使用时间限制</view>
53 -  
54 - <view class="bottom font20r">领取日期:{{item.cdateText}}</view>  
55 - <view class="bottom font20r">{{item.arule.is_same_day == '1' ? '领取当日可用' : '领取当日不可用'}}</view>  
56 - <view class="bottom font20r">领取后{{item.aexpiration}}天有效</view>  
57 -  
58 -  
59 -  
60 -  
61 </view> 53 </view>
62 <checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" /> 54 <checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" />
63 </view> 55 </view>
@@ -178,6 +178,10 @@ @@ -178,6 +178,10 @@
178 font-weight: 600; 178 font-weight: 600;
179 } 179 }
180 180
  181 +.bottomTitle text {
  182 + flex-shrink: 0;
  183 +}
  184 +
181 .bottom { 185 .bottom {
182 font-weight: normal; 186 font-weight: normal;
183 } 187 }
@@ -204,7 +208,6 @@ @@ -204,7 +208,6 @@
204 208
205 .itemRight view { 209 .itemRight view {
206 display: flex; 210 display: flex;
207 - align-items: center;  
208 line-height: 36rpx; 211 line-height: 36rpx;
209 } 212 }
210 213
@@ -213,17 +216,17 @@ @@ -213,17 +216,17 @@
213 } 216 }
214 217
215 checkbox { 218 checkbox {
216 - height: 50rpx;  
217 - width: 50rpx; 219 + height: 40rpx;
  220 + width: 40rpx;
218 margin-right: 20rpx; 221 margin-right: 20rpx;
219 } 222 }
220 223
221 radio::before, 224 radio::before,
222 checkbox::before { 225 checkbox::before {
223 - height: 50rpx; 226 + height: 40rpx;
224 top: 32% !important; 227 top: 32% !important;
225 right: 0 !important; 228 right: 0 !important;
226 - width: 50rpx; 229 + width: 40rpx;
227 content: '' !important; 230 content: '' !important;
228 } 231 }
229 232
@@ -179,7 +179,8 @@ Page({ @@ -179,7 +179,8 @@ Page({
179 // 是否已领取 179 // 是否已领取
180 getCoupon() { 180 getCoupon() {
181 App.Activity.ActivityListByOpenid({ 181 App.Activity.ActivityListByOpenid({
182 - aid: this.data.opt.id 182 + aid: this.data.opt.id,
  183 + sellerid:this.data.opt.sid
183 }).then(res => { 184 }).then(res => {
184 if (res.ret === 200) { 185 if (res.ret === 200) {
185 this.setData({ 186 this.setData({
@@ -1004,7 +1004,8 @@ Page({ @@ -1004,7 +1004,8 @@ Page({
1004 let couponArr = this.data.couponArr; 1004 let couponArr = this.data.couponArr;
1005 let totalPrice = this.data.totalPrice; 1005 let totalPrice = this.data.totalPrice;
1006 App.Activity.ActivityListByOpenid({ 1006 App.Activity.ActivityListByOpenid({
1007 - aid: item.id 1007 + aid: item.id,
  1008 + sellerid:this.data.seller.sid,
1008 }).then(res => { 1009 }).then(res => {
1009 if (res.ret == 200) { 1010 if (res.ret == 200) {
1010 if (res.data.length == 0) { 1011 if (res.data.length == 0) {
@@ -959,7 +959,8 @@ Page({ @@ -959,7 +959,8 @@ Page({
959 let couponArr = this.data.couponArr; 959 let couponArr = this.data.couponArr;
960 let totalPrice = this.data.totalPrice; 960 let totalPrice = this.data.totalPrice;
961 App.Activity.ActivityListByOpenid({ 961 App.Activity.ActivityListByOpenid({
962 - aid: item.id 962 + aid: item.id,
  963 + sellerid:this.data.seller.sid,
963 }).then(res => { 964 }).then(res => {
964 if (res.ret == 200) { 965 if (res.ret == 200) {
965 if (res.data.length == 0) { 966 if (res.data.length == 0) {
@@ -959,7 +959,8 @@ Page({ @@ -959,7 +959,8 @@ Page({
959 let couponArr = this.data.couponArr; 959 let couponArr = this.data.couponArr;
960 let totalPrice = this.data.totalPrice; 960 let totalPrice = this.data.totalPrice;
961 App.Activity.ActivityListByOpenid({ 961 App.Activity.ActivityListByOpenid({
962 - aid: item.id 962 + aid: item.id,
  963 + sellerid:this.data.seller.sid,
963 }).then(res => { 964 }).then(res => {
964 if (res.ret == 200) { 965 if (res.ret == 200) {
965 if (res.data.length == 0) { 966 if (res.data.length == 0) {
@@ -958,7 +958,8 @@ Page({ @@ -958,7 +958,8 @@ Page({
958 let couponArr = this.data.couponArr; 958 let couponArr = this.data.couponArr;
959 let totalPrice = this.data.totalPrice; 959 let totalPrice = this.data.totalPrice;
960 App.Activity.ActivityListByOpenid({ 960 App.Activity.ActivityListByOpenid({
961 - aid: item.id 961 + aid: item.id,
  962 + sellerid:this.data.seller.sid,
962 }).then(res => { 963 }).then(res => {
963 if (res.ret == 200) { 964 if (res.ret == 200) {
964 if (res.data.length == 0) { 965 if (res.data.length == 0) {
@@ -915,7 +915,8 @@ Page({ @@ -915,7 +915,8 @@ Page({
915 let couponArr = this.data.couponArr; 915 let couponArr = this.data.couponArr;
916 let totalPrice = this.data.totalPrice; 916 let totalPrice = this.data.totalPrice;
917 App.Activity.ActivityListByOpenid({ 917 App.Activity.ActivityListByOpenid({
918 - aid: item.id 918 + aid: item.id,
  919 + sellerid:this.data.seller.sid,
919 }).then(res => { 920 }).then(res => {
920 if (res.ret == 200) { 921 if (res.ret == 200) {
921 if (res.data.length == 0) { 922 if (res.data.length == 0) {
@@ -959,7 +959,8 @@ Page({ @@ -959,7 +959,8 @@ Page({
959 let couponArr = this.data.couponArr; 959 let couponArr = this.data.couponArr;
960 let totalPrice = this.data.totalPrice; 960 let totalPrice = this.data.totalPrice;
961 App.Activity.ActivityListByOpenid({ 961 App.Activity.ActivityListByOpenid({
962 - aid: item.id 962 + aid: item.id,
  963 + sellerid:this.data.seller.sid,
963 }).then(res => { 964 }).then(res => {
964 if (res.ret == 200) { 965 if (res.ret == 200) {
965 if (res.data.length == 0) { 966 if (res.data.length == 0) {
@@ -958,7 +958,8 @@ Page({ @@ -958,7 +958,8 @@ Page({
958 let couponArr = this.data.couponArr; 958 let couponArr = this.data.couponArr;
959 let totalPrice = this.data.totalPrice; 959 let totalPrice = this.data.totalPrice;
960 App.Activity.ActivityListByOpenid({ 960 App.Activity.ActivityListByOpenid({
961 - aid: item.id 961 + aid: item.id,
  962 + sellerid:this.data.seller.sid,
962 }).then(res => { 963 }).then(res => {
963 if (res.ret == 200) { 964 if (res.ret == 200) {
964 if (res.data.length == 0) { 965 if (res.data.length == 0) {
@@ -992,7 +992,8 @@ Page({ @@ -992,7 +992,8 @@ Page({
992 let couponArr = this.data.couponArr; 992 let couponArr = this.data.couponArr;
993 let totalPrice = this.data.totalPrice; 993 let totalPrice = this.data.totalPrice;
994 App.Activity.ActivityListByOpenid({ 994 App.Activity.ActivityListByOpenid({
995 - aid: item.id 995 + aid: item.id,
  996 + sellerid:this.data.seller.sid,
996 }).then(res => { 997 }).then(res => {
997 if (res.ret == 200) { 998 if (res.ret == 200) {
998 if (res.data.length == 0) { 999 if (res.data.length == 0) {
@@ -345,7 +345,8 @@ Page({ @@ -345,7 +345,8 @@ Page({
345 let couponArr = this.data.couponArr; 345 let couponArr = this.data.couponArr;
346 let totalPrice = this.data.totalPrice; 346 let totalPrice = this.data.totalPrice;
347 App.Activity.ActivityListByOpenid({ 347 App.Activity.ActivityListByOpenid({
348 - aid: item.id 348 + aid: item.id,
  349 + sellerid:this.data.sid,
349 }).then(res => { 350 }).then(res => {
350 if (res.ret == 200) { 351 if (res.ret == 200) {
351 if (res.data.length == 0) { 352 if (res.data.length == 0) {
@@ -762,4 +762,18 @@ export default { @@ -762,4 +762,18 @@ export default {
762 openid:'openid', 762 openid:'openid',
763 cachetime: 0, 763 cachetime: 0,
764 }, 764 },
  765 +
  766 + //小程序最新使用优惠付款
  767 + 'App.PayOnline.CombineTransactionsByNewActivity':{
  768 + alias:'App.PayOnline.CombineTransactionsByNewActivity',
  769 + openid:'openid',
  770 + cachetime: 0,
  771 + },
  772 +
  773 + //核销
  774 + 'App.Activity.SetActivityStatus':{
  775 + alias:'App.Activity.SetActivityStatus',
  776 + openid:'openid',
  777 + cachetime: 0,
  778 + },
765 } 779 }