Commit 3160b78f714e46cbb495c85cfe73f8391698835b

Authored by pengye
1 parent 384f643d

邀请函2-17付费券、免费券

Showing 31 changed files with 4888 additions and 1445 deletions
@@ -96,7 +96,8 @@ @@ -96,7 +96,8 @@
96 "pack/examineCertificate", 96 "pack/examineCertificate",
97 "pack/subscribeDrawback", 97 "pack/subscribeDrawback",
98 "pack/vipRecharge", 98 "pack/vipRecharge",
99 - "pack/seeRecharge" 99 + "pack/seeRecharge",
  100 + "pack/receiveCoupon"
100 ] 101 ]
101 }, 102 },
102 { 103 {
@@ -66,6 +66,7 @@ Page({ @@ -66,6 +66,7 @@ Page({
66 isMoreBtn:'',//再次预订按钮 66 isMoreBtn:'',//再次预订按钮
67 isPaymenBtn:'',//支付定金按钮 67 isPaymenBtn:'',//支付定金按钮
68 isShareItem:'',//转发客人按钮 68 isShareItem:'',//转发客人按钮
  69 + couponArr: [],//待领取的优惠券列表
69 }, 70 },
70 tablestr: '', 71 tablestr: '',
71 urlsValue: [], 72 urlsValue: [],
@@ -75,6 +76,7 @@ Page({ @@ -75,6 +76,7 @@ Page({
75 timers: null, // 动画定时器 76 timers: null, // 动画定时器
76 n: 0, 77 n: 0,
77 modal:'', 78 modal:'',
  79 + couponModal: '',
78 /** 80 /**
79 * 生命周期函数--监听页面加载 81 * 生命周期函数--监听页面加载
80 */ 82 */
@@ -102,6 +104,7 @@ Page({ @@ -102,6 +104,7 @@ Page({
102 wx.onUserCaptureScreen((res)=> { 104 wx.onUserCaptureScreen((res)=> {
103 this.showModal() 105 this.showModal()
104 }) 106 })
  107 + this.couponModal = this.selectComponent("#couponModal");
105 }, 108 },
106 // 打开截屏弹框 109 // 打开截屏弹框
107 showModal() { 110 showModal() {
@@ -111,6 +114,10 @@ Page({ @@ -111,6 +114,10 @@ Page({
111 closeModal() { 114 closeModal() {
112 this.modal.closeModal() 115 this.modal.closeModal()
113 }, 116 },
  117 + // 关闭优惠券弹框
  118 + closeCouponModal() {
  119 + this.couponModal.closeModal()
  120 + },
114 // 页面滚动事件 121 // 页面滚动事件
115 onPageScroll: function (event) { 122 onPageScroll: function (event) {
116 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 123 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -456,9 +463,10 @@ Page({ @@ -456,9 +463,10 @@ Page({
456 uid 463 uid
457 }).then((json) => { 464 }).then((json) => {
458 if (json.ret == 200) { 465 if (json.ret == 200) {
459 - console.log('staffinfostaffinfostaffinfo', json.data) 466 + console.log('客户经理获取基本信息------', json.data)
460 this.setData({ 467 this.setData({
461 - staffinfo: json.data 468 + staffinfo: json.data,
  469 + couponArr:[],
462 }) 470 })
463 this.getSellerTemplateConfFun(sid); 471 this.getSellerTemplateConfFun(sid);
464 } 472 }
@@ -579,7 +587,7 @@ Page({ @@ -579,7 +587,7 @@ Page({
579 let data = res.data 587 let data = res.data
580 console.log('data', data); 588 console.log('data', data);
581 let couponList = [] 589 let couponList = []
582 - let themeColor, StyleType, titleType, themeSixteen, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 590 + let themeColor, StyleType, titleType, themeSixteen, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
583 chef = util.determine(data.chef); 591 chef = util.determine(data.chef);
584 reserve = util.determine(data.reserve); 592 reserve = util.determine(data.reserve);
585 marketing = util.determine(data.marketing); 593 marketing = util.determine(data.marketing);
@@ -598,29 +606,23 @@ Page({ @@ -598,29 +606,23 @@ Page({
598 if (marketing) { 606 if (marketing) {
599 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 607 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
600 is_comments = marketing.is_comments ? marketing.is_comments : ''; 608 is_comments = marketing.is_comments ? marketing.is_comments : '';
601 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 609 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  610 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  611 + marketing.coupon_data_payList = coupon_data_pay
  612 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  613 + marketing.coupon_data_freeList = coupon_data_free
602 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 614 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
603 let couponDataId = info && info.length > 0 ? info[0].id : {} 615 let couponDataId = info && info.length > 0 ? info[0].id : {}
604 // 根据券ID获取评价赠送的券详情 616 // 根据券ID获取评价赠送的券详情
605 if(couponDataId) this.getEvaluateFun(couponDataId) 617 if(couponDataId) this.getEvaluateFun(couponDataId)
606 } 618 }
607 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 619 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
608 - if (coupon && util.getType(coupon) == 'object') {  
609 - couponList.push({  
610 - id: coupon.id  
611 - });  
612 - }  
613 - if (coupon && util.getType(coupon) == 'array') {  
614 - if (coupon.length > 0) {  
615 - coupon.forEach(item => {  
616 - couponList.push({  
617 - id: item.id  
618 - })  
619 - })  
620 - }  
621 - } 620 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  621 + couponList = this.addCoupons(coupon,couponList);
  622 + couponList = this.addCoupons(coupon_data_pay,couponList);
  623 + couponList = this.addCoupons(coupon_data_free,couponList);
622 // 根据券ID获取券详情 624 // 根据券ID获取券详情
623 - this.getActivityByIdFun(couponList, couponList.length) 625 + this.getActivityByIdFun(couponList)
624 // 根据充值ID获取充值详情 626 // 根据充值ID获取充值详情
625 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 627 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
626 this.getRechargeDetail(marketing.recharge_data.id) 628 this.getRechargeDetail(marketing.recharge_data.id)
@@ -742,13 +744,16 @@ Page({ @@ -742,13 +744,16 @@ Page({
742 }) 744 })
743 }, 745 },
744 // 点击商家有礼 746 // 点击商家有礼
745 - gotoSellerGift(){  
746 - let url = util.http_build_query({ 747 + gotoSellerGift(e){
  748 + this.couponModal.closeModal()
  749 + const form = e.currentTarget.dataset['form'];
  750 + let url = util.http_build_query({
747 id: this.data.detail.id, 751 id: this.data.detail.id,
748 - }, '/pages/reserve/sellerGift')  
749 - wx.navigateTo({  
750 - url  
751 - }) 752 + form
  753 + }, '/pages/reserve/sellerGift')
  754 + wx.navigateTo({
  755 + url
  756 + })
752 }, 757 },
753 // 再次预订 758 // 再次预订
754 secondbook() { 759 secondbook() {
@@ -902,34 +907,172 @@ Page({ @@ -902,34 +907,172 @@ Page({
902 }) 907 })
903 }, 908 },
904 // 根据券ID获取券详情 909 // 根据券ID获取券详情
905 - getActivityByIdFun(ids, length) {  
906 - let coupon_dataList = [];  
907 - ids.forEach(i => {  
908 - App.Activity.GetActivityById({  
909 - id: i.id  
910 - }).then(res => {  
911 - if (res.data.length > 0) {  
912 - let detail = res.data[0];  
913 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
914 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
915 - detail.use = detail.use ? util.determine(detail.use) : '';  
916 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
917 - let cash = detail.use.cash * 1;  
918 - let price = detail.price * 1;  
919 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
920 - }  
921 - coupon_dataList.push(detail);  
922 - if (length === coupon_dataList.length) {  
923 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
924 - console.log('邀请函--------------------优惠券',coupon_dataList);  
925 - this.setData({  
926 - coupon_dataList,  
927 - })  
928 - }  
929 - }  
930 - })  
931 - })  
932 - }, 910 + getActivityByIdFun(obj) {
  911 + App.Activity.GetActivityById({
  912 + id: obj.map(item => item.id).join(','),
  913 + }).then(res => {
  914 + if (res.data.length > 0) {
  915 + let list = res.data.filter(item => {
  916 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  917 + })
  918 + list.forEach(detail => {
  919 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  920 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  921 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  922 + detail.use = detail.use ? util.determine(detail.use) : '';
  923 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  924 + let cash = detail.use.cash * 1;
  925 + let price = detail.price * 1;
  926 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  927 + }
  928 + let num = detail.receiveNum;
  929 + if (num > 0) {
  930 + detail.receiveNumText = ''
  931 + if (num >= 0 && num <= 100) {
  932 + detail.receiveNumText = num.toString();
  933 + } else if (num >= 101 && num <= 199) {
  934 + detail.receiveNumText = '100+';
  935 + } else if (num >= 200 && num <= 299) {
  936 + detail.receiveNumText = '200+';
  937 + } else {
  938 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  939 + }
  940 + }
  941 + if (detail.exp_date && detail.exp_date.week_data) {
  942 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  943 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  944 + if (noon) noon = '午餐:' + noon
  945 + if (nig) nig = '晚餐:' + nig
  946 + detail.noonText = noon;
  947 + detail.nigText = nig;
  948 + }
  949 + })
  950 + let freeCoupons = list.filter(item => {
  951 + return item.is_type == '3'
  952 + })
  953 + // 免费券判断是否领取,弹框领取
  954 + if (freeCoupons.length > 0) {
  955 + let length = freeCoupons.length - 1
  956 + freeCoupons.forEach(i => {
  957 + this.getCoupon(i, freeCoupons[length].id, obj)
  958 + })
  959 + }
  960 + console.log('邀请函--------------------优惠券', list);
  961 + this.setData({
  962 + coupon_dataList: list,
  963 + })
  964 + }
  965 + })
  966 + },
  967 + // 获取所有的券并且展示
  968 + addCoupons(coupons, couponList) {
  969 + if (coupons && util.getType(coupons) == 'object') {
  970 + couponList.push({
  971 + id: coupon.id,
  972 + number: coupon.number
  973 + });
  974 + }
  975 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  976 + coupons.forEach(item => {
  977 + couponList.push({
  978 + id: item.id,
  979 + number: item.number
  980 + });
  981 + });
  982 + }
  983 + return couponList
  984 + },
  985 + // 弹框领取免费券
  986 + setcouponFun(arr) {
  987 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  988 + console.log('弹框领取免费券id', str);
  989 + App.Activity.SetActivityAsReserve({
  990 + aid: str,
  991 + rid: this.id,
  992 + }).then((json) => {
  993 + if (json.ret != 200) {
  994 + wx.showToast({
  995 + title: res.msg,
  996 + duration: 2000,
  997 + mask: true
  998 + })
  999 + }
  1000 + })
  1001 + },
  1002 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  1003 + getCoupon(item, id, obj) {
  1004 + let couponArr = this.data.couponArr;
  1005 + let totalPrice = this.data.totalPrice;
  1006 + App.Activity.ActivityListByOpenid({
  1007 + aid: item.id
  1008 + }).then(res => {
  1009 + if (res.ret == 200) {
  1010 + if (res.data.length == 0) {
  1011 + couponArr.push(item)
  1012 + }
  1013 + if (item.id == id && couponArr.length > 0) {
  1014 + couponArr.forEach(item => {
  1015 + let match = obj.find(b => b.id === item.id);
  1016 + if (match) {
  1017 + item.number = match.number;
  1018 + }
  1019 + });
  1020 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  1021 + this.setcouponFun(couponArr)
  1022 + this.couponModal.showModal()
  1023 + }
  1024 + console.log('未领取的券列表-----------', couponArr);
  1025 + this.setData({
  1026 + couponArr,
  1027 + totalPrice
  1028 + })
  1029 + }
  1030 + })
  1031 + },
  1032 + // 处理优惠券不可用日期数据
  1033 + hasConsecutiveSelect(arr, type) {
  1034 + let firstTitle = null;
  1035 + let lastTitle = null;
  1036 + let rArr = []
  1037 + let num = 0
  1038 + for (let i = 0; i < arr.length; i++) {
  1039 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  1040 + if (str) {
  1041 + rArr.push(arr[i].title)
  1042 + num++
  1043 + if (num == 1) {
  1044 + firstTitle = arr[i].title
  1045 + }
  1046 + if (num >= 5) {
  1047 + lastTitle = arr[i].title
  1048 + }
  1049 + if (num >= 5 && i >= (arr.length - 1)) {
  1050 + let fi = rArr.findIndex((item) => {
  1051 + return item == firstTitle
  1052 + })
  1053 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1054 + num = 0
  1055 + }
  1056 + } else {
  1057 + if (num < 5) {
  1058 + num = 0
  1059 + firstTitle = null;
  1060 + lastTitle = null;
  1061 + } else {
  1062 + let fi = rArr.findIndex((item) => {
  1063 + return item == firstTitle
  1064 + })
  1065 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1066 + num = 0
  1067 + }
  1068 + }
  1069 + }
  1070 + return {
  1071 + rArr,
  1072 + lastTitle,
  1073 + firstTitle
  1074 + };
  1075 + },
933 /** 1076 /**
934 * 生命周期函数--监听页面隐藏 1077 * 生命周期函数--监听页面隐藏
935 */ 1078 */
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
  14 + data-form="1"
14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 15 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 16 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 17 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -83,29 +84,49 @@ @@ -83,29 +84,49 @@
83 </view> 84 </view>
84 </view> 85 </view>
85 </block> 86 </block>
86 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 87 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
87 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 88 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
88 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 89 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
89 <view class="preferentialItems"> 90 <view class="preferentialItems">
90 <view class="itemLeft"> 91 <view class="itemLeft">
91 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 92 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  93 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
92 <view class="priceText" wx:if="{{item.price}}"> 94 <view class="priceText" wx:if="{{item.price}}">
93 - <view class="icons font40r">¥</view>{{item.price}} 95 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
94 </view> 96 </view>
  97 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
95 </view> 98 </view>
  99 + <view class="couponLine"></view>
96 <view class="itemRight"> 100 <view class="itemRight">
97 <view class="btns"> 101 <view class="btns">
98 <text class="font40r">{{item.aname}}</text> 102 <text class="font40r">{{item.aname}}</text>
99 - <view class="font24r orderingFood">  
100 - 抢购  
101 - </view> 103 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  104 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  105 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  106 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  107 + </view>
  108 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  109 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  110 + </view>
  111 + </block>
  112 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  113 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  114 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可使用:</view>
  115 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  116 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  117 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  118 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  119 + </block>
102 </view> 120 </view>
103 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
104 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
105 - 无限制{{item.desc?','+item.desc+'。':'。'}} 121 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  122 + <view class="font24r orderingFood orderingFood1">已领取</view>
  123 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  124 + <view class="font24r">已被领取</view>
  125 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  126 + </view>
106 </view> 127 </view>
107 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
108 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 128 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  129 + 立即抢购
109 </view> 130 </view>
110 </view> 131 </view>
111 </view> 132 </view>
@@ -326,4 +347,24 @@ @@ -326,4 +347,24 @@
326 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 347 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
327 </view> 348 </view>
328 </view> 349 </view>
  350 +</my-modal>
  351 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  352 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  353 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  354 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  355 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  356 + </view>
  357 + <view slot="modalContent">
  358 + <view class="couponBox">
  359 + <view wx:for="{{couponArr}}" class="couponItems">
  360 + <view class="couponNum font20r">×{{item.number}}</view>
  361 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  362 + <view class="couponLines"></view>
  363 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  364 + <view class="font28r couponCondition" wx:else>无门槛</view>
  365 + </view>
  366 + </view>
  367 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  368 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  369 + </view>
329 </my-modal> 370 </my-modal>
@@ -271,13 +271,103 @@ @@ -271,13 +271,103 @@
271 flex-shrink: 0; 271 flex-shrink: 0;
272 } 272 }
273 273
  274 +.preferentialCoupon .itemRight {
  275 + width: 74%;
  276 + display: flex;
  277 + align-items: center;
  278 +}
  279 +
  280 +.preferentialCoupon .itemLeft {
  281 + width: 26%;
  282 +}
  283 +
  284 +.preferentialCoupon .couponLine{
  285 + margin: 24rpx 0;
  286 + border-right: 2rpx dashed #f6231b;
  287 +}
  288 +
  289 +.preferentialCoupon .orderingFood {
  290 + padding: 0 20rpx;
  291 + color: #fff !important;
  292 + border: none !important;
  293 + text-align: center;
  294 + border-radius: 20rpx;
  295 + line-height: 44rpx;
  296 + height: 44rpx;
  297 + width: max-content;
  298 + flex-shrink: 0;
  299 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  300 +}
  301 +.preferentialCoupon .icons {
  302 + color: #F6231B;
  303 + text-align: center;
  304 +}
  305 +
  306 +.preferentialCoupon .priceText {
  307 + display: flex;
  308 + align-items: baseline;
  309 + justify-content: center;
  310 + font-family: PingFang SC;
  311 + color: #F6231B;
  312 + font-weight: 600;
  313 + font-size: 48rpx;
  314 + margin-top: 6rpx;
  315 +}
  316 +
  317 +.preferentialCoupon .priceText text {
  318 + font-size: 48rpx;
  319 +}
  320 +
  321 +.preferentialCoupon .btns {
  322 + flex: 1;
  323 +}
  324 +.preferentialCoupon .btnBox {
  325 + display: flex;
  326 + flex-direction: column;
  327 +}
  328 +
  329 +.preferentialCoupon .grantNum {
  330 + display: flex;
  331 + flex-direction: column;
  332 + align-items: center;
  333 + color: #C36607;
  334 + margin-top: 10rpx;
  335 +}
  336 +
  337 +.preferentialCoupon .grantNum text {
  338 + color: #F6231B;
  339 + margin-right: 10rpx;
  340 +}
  341 +
  342 +.preferentialCoupon .btns text {
  343 + font-weight: 600;
  344 +}
  345 +
  346 +.preferentialCoupon .orderingFood1 {
  347 + border: 2rpx solid #fa4b20 !important;
  348 + background: transparent !important;
  349 + color: #fa4b20 !important;
  350 +}
  351 +
  352 +.preferentialCoupon .btns text {
  353 + color: #0B0805 !important;
  354 +}
  355 +
  356 +.preferentialCoupon .bottom {
  357 + color: #C36607 !important;
  358 +}
  359 +
  360 +.preferentialCoupon .nodate{
  361 + margin-left: 20rpx;
  362 +}
  363 +
274 .preferentialItems { 364 .preferentialItems {
275 display: flex; 365 display: flex;
276 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat;  
277 - background-size: 100% 100%; 366 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
278 margin-bottom: 20rpx; 367 margin-bottom: 20rpx;
279 min-height: 160rpx; 368 min-height: 160rpx;
280 padding-bottom: 10rpx; 369 padding-bottom: 10rpx;
  370 + border: 2rpx solid #ff7e06;
281 } 371 }
282 372
283 .rechargeItems { 373 .rechargeItems {
@@ -290,6 +380,7 @@ @@ -290,6 +380,7 @@
290 height: auto; 380 height: auto;
291 padding: 12rpx 0; 381 padding: 12rpx 0;
292 margin: 0 20rpx; 382 margin: 0 20rpx;
  383 + border: none;
293 } 384 }
294 385
295 .rechargeItems .orderingFood { 386 .rechargeItems .orderingFood {
@@ -331,6 +422,20 @@ @@ -331,6 +422,20 @@
331 top: 12rpx; 422 top: 12rpx;
332 } 423 }
333 424
  425 +.discountText1{
  426 + text-align: center;
  427 + color: #FD4D59;
  428 + border: 2rpx solid #FD4D59;
  429 + border-radius: 6rpx;
  430 + font-family: PingFang SC;
  431 + background: transparent;
  432 + width: max-content;
  433 + padding: 0 6rpx;
  434 + position: absolute;
  435 + left: 16rpx;
  436 + top: 12rpx;
  437 +}
  438 +
334 .famousChefBox .labelBox, 439 .famousChefBox .labelBox,
335 .stopBox .labelBox { 440 .stopBox .labelBox {
336 border-bottom: none; 441 border-bottom: none;
@@ -424,9 +529,7 @@ @@ -424,9 +529,7 @@
424 } 529 }
425 530
426 .priceText .icons { 531 .priceText .icons {
427 - font-family: 'Abel';  
428 color: #FD4D59; 532 color: #FD4D59;
429 - font-size: 40rpx;  
430 } 533 }
431 534
432 .itemRight { 535 .itemRight {
@@ -440,6 +543,7 @@ @@ -440,6 +543,7 @@
440 display: flex; 543 display: flex;
441 justify-content: space-between; 544 justify-content: space-between;
442 align-items: baseline; 545 align-items: baseline;
  546 + flex-direction: column;
443 } 547 }
444 548
445 .btns text { 549 .btns text {
@@ -696,6 +800,145 @@ @@ -696,6 +800,145 @@
696 box-sizing: border-box; 800 box-sizing: border-box;
697 } 801 }
698 802
  803 +#couponModal .titleModal {
  804 + margin-top: 30%;
  805 + position: relative;
  806 +}
  807 +
  808 +#couponModal .titleModal2 {
  809 + margin-top: 80%;
  810 +}
  811 +
  812 +#couponModal .titleModal3 {
  813 + margin-top: 60%;
  814 +}
  815 +
  816 +#couponModal .titleModal4 {
  817 + margin-top: 30%;
  818 +}
  819 +
  820 +#couponModal .mymodal {
  821 + background: rgba(0, 0, 0, 0.8);
  822 + width: 100% !important;
  823 + top: 0 !important;
  824 + height: auto !important;
  825 + z-index: 300;
  826 +}
  827 +
  828 +.nameInfo {
  829 + font-family: PingFang SC;
  830 + font-weight: 400;
  831 + font-size: 52rpx;
  832 + line-height: 56rpx;
  833 + color: #fff;
  834 + margin-bottom: 40rpx;
  835 + padding-top: 60rpx;
  836 +}
  837 +
  838 +.couponTotal {
  839 + color: #dfdfdf;
  840 + font-family: PingFang SC;
  841 + font-weight: 400;
  842 + font-size: 40rpx;
  843 + line-height: 48rpx;
  844 + margin-bottom: 40rpx;
  845 + display: flex;
  846 + align-items: center;
  847 + justify-content: center;
  848 +}
  849 +
  850 +.couponTotal text {
  851 + color: #ffc806;
  852 + font-weight: 600;
  853 + font-size: 80rpx;
  854 + margin: 0 14rpx;
  855 +}
  856 +
  857 +.couponBox {
  858 + width: 80%;
  859 + margin: 0 auto;
  860 + display: flex;
  861 + flex-wrap: wrap;
  862 + justify-content: space-evenly;
  863 +}
  864 +
  865 +.couponItems {
  866 + width: 46%;
  867 + margin-bottom: 24rpx;
  868 + padding-bottom: 52rpx;
  869 + border-radius: 20rpx;
  870 + border: 2rpx solid #ff7e06;
  871 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  872 +}
  873 +
  874 +.couponNum {
  875 + background: #727272;
  876 + border-radius: 50%;
  877 + color: #fff;
  878 + width: 40rpx;
  879 + height: 40rpx;
  880 + display: flex;
  881 + align-items: center;
  882 + justify-content: center;
  883 + margin: 8rpx 0 0 8rpx;
  884 +}
  885 +
  886 +.couponPrice {
  887 + display: flex;
  888 + align-items: center;
  889 + justify-content: center;
  890 + color: #F6231B;
  891 + font-weight: 500;
  892 +}
  893 +
  894 +.couponLines{
  895 + width: 80%;
  896 + margin: 0 auto;
  897 + height: 2rpx;
  898 + border-bottom: 2rpx dashed #F6231B;
  899 +}
  900 +
  901 +.couponPrice text {
  902 + margin-left: 4rpx;
  903 + font-size: 76rpx;
  904 + font-weight: 700;
  905 +}
  906 +
  907 +.couponCondition {
  908 + color: #C36607;
  909 + display: flex;
  910 + align-items: center;
  911 + justify-content: center;
  912 + padding-top: 24rpx;
  913 +}
  914 +
  915 +.couponBtn {
  916 + width: 80%;
  917 + margin: 0 auto;
  918 + border-radius: 42rpx;
  919 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  920 + font-weight: 400;
  921 + color: #fff;
  922 + text-align: center;
  923 + border: 4rpx solid #fff;
  924 + padding: 12rpx 0;
  925 + margin: 16rpx auto 20rpx auto;
  926 +}
  927 +
  928 +.couponText {
  929 + color: #fff;
  930 + text-decoration: underline;
  931 + text-align: center;
  932 +}
  933 +
  934 +.closeImg {
  935 + width: 60rpx;
  936 + height: 60rpx;
  937 + position: absolute;
  938 + right: 0;
  939 + top: 0;
  940 +}
  941 +
699 /* 深中国红 */ 942 /* 深中国红 */
700 .crimson, 943 .crimson,
701 .crimson .positioningBox { 944 .crimson .positioningBox {
@@ -987,14 +1230,6 @@ @@ -987,14 +1230,6 @@
987 color: #578C69; 1230 color: #578C69;
988 } 1231 }
989 1232
990 -.pearlWhite .preferentialItems {  
991 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
992 - background-size: 100% 100%;  
993 - margin-bottom: 20rpx;  
994 - min-height: 160rpx;  
995 - padding-bottom: 10rpx;  
996 -}  
997 -  
998 .pearlWhite .rechargeItems { 1233 .pearlWhite .rechargeItems {
999 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat; 1234 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat;
1000 background-size: 100% 100%; 1235 background-size: 100% 100%;
@@ -1053,12 +1288,6 @@ @@ -1053,12 +1288,6 @@
1053 color: #578C69; 1288 color: #578C69;
1054 } 1289 }
1055 1290
1056 -.pearlWhite .discountText {  
1057 - background: transparent;  
1058 - border: 2rpx solid #FD4D59;  
1059 - color: #FD4D59;  
1060 -}  
1061 -  
1062 .toastBox { 1291 .toastBox {
1063 width: fit-content; 1292 width: fit-content;
1064 position: fixed; 1293 position: fixed;
@@ -66,6 +66,7 @@ Page({ @@ -66,6 +66,7 @@ Page({
66 isMoreBtn:'',//再次预订按钮 66 isMoreBtn:'',//再次预订按钮
67 isPaymenBtn:'',//支付定金按钮 67 isPaymenBtn:'',//支付定金按钮
68 isShareItem:'',//转发客人按钮 68 isShareItem:'',//转发客人按钮
  69 + couponArr: [],//待领取的优惠券列表
69 }, 70 },
70 tablestr: '', 71 tablestr: '',
71 urlsValue: [], 72 urlsValue: [],
@@ -75,6 +76,7 @@ Page({ @@ -75,6 +76,7 @@ Page({
75 timers: null, // 动画定时器 76 timers: null, // 动画定时器
76 n: 0, 77 n: 0,
77 modal:'', 78 modal:'',
  79 + couponModal: '',
78 /** 80 /**
79 * 生命周期函数--监听页面加载 81 * 生命周期函数--监听页面加载
80 */ 82 */
@@ -102,6 +104,7 @@ Page({ @@ -102,6 +104,7 @@ Page({
102 wx.onUserCaptureScreen((res)=> { 104 wx.onUserCaptureScreen((res)=> {
103 this.showModal() 105 this.showModal()
104 }) 106 })
  107 + this.couponModal = this.selectComponent("#couponModal");
105 }, 108 },
106 // 打开截屏弹框 109 // 打开截屏弹框
107 showModal() { 110 showModal() {
@@ -111,6 +114,10 @@ Page({ @@ -111,6 +114,10 @@ Page({
111 closeModal() { 114 closeModal() {
112 this.modal.closeModal() 115 this.modal.closeModal()
113 }, 116 },
  117 + // 关闭优惠券弹框
  118 + closeCouponModal() {
  119 + this.couponModal.closeModal()
  120 + },
114 // 页面滚动事件 121 // 页面滚动事件
115 onPageScroll: function (event) { 122 onPageScroll: function (event) {
116 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 123 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -456,9 +463,10 @@ Page({ @@ -456,9 +463,10 @@ Page({
456 uid 463 uid
457 }).then((json) => { 464 }).then((json) => {
458 if (json.ret == 200) { 465 if (json.ret == 200) {
459 - console.log('staffinfostaffinfostaffinfo', json.data) 466 + console.log('客户经理获取基本信息------', json.data)
460 this.setData({ 467 this.setData({
461 - staffinfo: json.data 468 + staffinfo: json.data,
  469 + couponArr:[],
462 }) 470 })
463 this.getSellerTemplateConfFun(sid); 471 this.getSellerTemplateConfFun(sid);
464 } 472 }
@@ -579,7 +587,7 @@ Page({ @@ -579,7 +587,7 @@ Page({
579 let data = res.data 587 let data = res.data
580 console.log('data', data); 588 console.log('data', data);
581 let couponList = [] 589 let couponList = []
582 - let themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 590 + let themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
583 chef = util.determine(data.chef); 591 chef = util.determine(data.chef);
584 reserve = util.determine(data.reserve); 592 reserve = util.determine(data.reserve);
585 marketing = util.determine(data.marketing); 593 marketing = util.determine(data.marketing);
@@ -598,29 +606,23 @@ Page({ @@ -598,29 +606,23 @@ Page({
598 if (marketing) { 606 if (marketing) {
599 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 607 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
600 is_comments = marketing.is_comments ? marketing.is_comments : ''; 608 is_comments = marketing.is_comments ? marketing.is_comments : '';
601 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 609 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  610 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  611 + marketing.coupon_data_payList = coupon_data_pay
  612 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  613 + marketing.coupon_data_freeList = coupon_data_free
602 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 614 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
603 let couponDataId = info && info.length > 0 ? info[0].id : {} 615 let couponDataId = info && info.length > 0 ? info[0].id : {}
604 // 根据券ID获取评价赠送的券详情 616 // 根据券ID获取评价赠送的券详情
605 if(couponDataId) this.getEvaluateFun(couponDataId) 617 if(couponDataId) this.getEvaluateFun(couponDataId)
606 } 618 }
607 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 619 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
608 - if (coupon && util.getType(coupon) == 'object') {  
609 - couponList.push({  
610 - id: coupon.id  
611 - });  
612 - }  
613 - if (coupon && util.getType(coupon) == 'array') {  
614 - if (coupon.length > 0) {  
615 - coupon.forEach(item => {  
616 - couponList.push({  
617 - id: item.id  
618 - })  
619 - })  
620 - }  
621 - } 620 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  621 + couponList = this.addCoupons(coupon,couponList);
  622 + couponList = this.addCoupons(coupon_data_pay,couponList);
  623 + couponList = this.addCoupons(coupon_data_free,couponList);
622 // 根据券ID获取券详情 624 // 根据券ID获取券详情
623 - this.getActivityByIdFun(couponList, couponList.length) 625 + this.getActivityByIdFun(couponList)
624 // 根据充值ID获取充值详情 626 // 根据充值ID获取充值详情
625 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 627 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
626 this.getRechargeDetail(marketing.recharge_data.id) 628 this.getRechargeDetail(marketing.recharge_data.id)
@@ -697,13 +699,16 @@ Page({ @@ -697,13 +699,16 @@ Page({
697 }) 699 })
698 }, 700 },
699 // 点击商家有礼 701 // 点击商家有礼
700 - gotoSellerGift(){  
701 - let url = util.http_build_query({ 702 + gotoSellerGift(e){
  703 + this.couponModal.closeModal()
  704 + const form = e.currentTarget.dataset['form'];
  705 + let url = util.http_build_query({
702 id: this.data.detail.id, 706 id: this.data.detail.id,
703 - }, '/pages/reserve/sellerGift')  
704 - wx.navigateTo({  
705 - url  
706 - }) 707 + form
  708 + }, '/pages/reserve/sellerGift')
  709 + wx.navigateTo({
  710 + url
  711 + })
707 }, 712 },
708 // 再次预订 713 // 再次预订
709 secondbook() { 714 secondbook() {
@@ -857,34 +862,172 @@ Page({ @@ -857,34 +862,172 @@ Page({
857 }) 862 })
858 }, 863 },
859 // 根据券ID获取券详情 864 // 根据券ID获取券详情
860 - getActivityByIdFun(ids, length) {  
861 - let coupon_dataList = [];  
862 - ids.forEach(i => {  
863 - App.Activity.GetActivityById({  
864 - id: i.id  
865 - }).then(res => {  
866 - if (res.data.length > 0) {  
867 - let detail = res.data[0];  
868 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
869 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
870 - detail.use = detail.use ? util.determine(detail.use) : '';  
871 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
872 - let cash = detail.use.cash * 1;  
873 - let price = detail.price * 1;  
874 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
875 - }  
876 - coupon_dataList.push(detail);  
877 - if (length === coupon_dataList.length) {  
878 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
879 - console.log('邀请函--------------------优惠券',coupon_dataList);  
880 - this.setData({  
881 - coupon_dataList,  
882 - })  
883 - }  
884 - }  
885 - })  
886 - })  
887 - }, 865 + getActivityByIdFun(obj) {
  866 + App.Activity.GetActivityById({
  867 + id: obj.map(item => item.id).join(','),
  868 + }).then(res => {
  869 + if (res.data.length > 0) {
  870 + let list = res.data.filter(item => {
  871 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  872 + })
  873 + list.forEach(detail => {
  874 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  875 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  876 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  877 + detail.use = detail.use ? util.determine(detail.use) : '';
  878 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  879 + let cash = detail.use.cash * 1;
  880 + let price = detail.price * 1;
  881 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  882 + }
  883 + let num = detail.receiveNum;
  884 + if (num > 0) {
  885 + detail.receiveNumText = ''
  886 + if (num >= 0 && num <= 100) {
  887 + detail.receiveNumText = num.toString();
  888 + } else if (num >= 101 && num <= 199) {
  889 + detail.receiveNumText = '100+';
  890 + } else if (num >= 200 && num <= 299) {
  891 + detail.receiveNumText = '200+';
  892 + } else {
  893 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  894 + }
  895 + }
  896 + if (detail.exp_date && detail.exp_date.week_data) {
  897 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  898 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  899 + if (noon) noon = '午餐:' + noon
  900 + if (nig) nig = '晚餐:' + nig
  901 + detail.noonText = noon;
  902 + detail.nigText = nig;
  903 + }
  904 + })
  905 + let freeCoupons = list.filter(item => {
  906 + return item.is_type == '3'
  907 + })
  908 + // 免费券判断是否领取,弹框领取
  909 + if (freeCoupons.length > 0) {
  910 + let length = freeCoupons.length - 1
  911 + freeCoupons.forEach(i => {
  912 + this.getCoupon(i, freeCoupons[length].id, obj)
  913 + })
  914 + }
  915 + console.log('邀请函--------------------优惠券', list);
  916 + this.setData({
  917 + coupon_dataList: list,
  918 + })
  919 + }
  920 + })
  921 + },
  922 + // 获取所有的券并且展示
  923 + addCoupons(coupons, couponList) {
  924 + if (coupons && util.getType(coupons) == 'object') {
  925 + couponList.push({
  926 + id: coupon.id,
  927 + number: coupon.number
  928 + });
  929 + }
  930 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  931 + coupons.forEach(item => {
  932 + couponList.push({
  933 + id: item.id,
  934 + number: item.number
  935 + });
  936 + });
  937 + }
  938 + return couponList
  939 + },
  940 + // 弹框领取免费券
  941 + setcouponFun(arr) {
  942 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  943 + console.log('弹框领取免费券id', str);
  944 + App.Activity.SetActivityAsReserve({
  945 + aid: str,
  946 + rid: this.id,
  947 + }).then((json) => {
  948 + if (json.ret != 200) {
  949 + wx.showToast({
  950 + title: res.msg,
  951 + duration: 2000,
  952 + mask: true
  953 + })
  954 + }
  955 + })
  956 + },
  957 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  958 + getCoupon(item, id, obj) {
  959 + let couponArr = this.data.couponArr;
  960 + let totalPrice = this.data.totalPrice;
  961 + App.Activity.ActivityListByOpenid({
  962 + aid: item.id
  963 + }).then(res => {
  964 + if (res.ret == 200) {
  965 + if (res.data.length == 0) {
  966 + couponArr.push(item)
  967 + }
  968 + if (item.id == id && couponArr.length > 0) {
  969 + couponArr.forEach(item => {
  970 + let match = obj.find(b => b.id === item.id);
  971 + if (match) {
  972 + item.number = match.number;
  973 + }
  974 + });
  975 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  976 + this.setcouponFun(couponArr)
  977 + this.couponModal.showModal()
  978 + }
  979 + console.log('未领取的券列表-----------', couponArr);
  980 + this.setData({
  981 + couponArr,
  982 + totalPrice
  983 + })
  984 + }
  985 + })
  986 + },
  987 + // 处理优惠券不可用日期数据
  988 + hasConsecutiveSelect(arr, type) {
  989 + let firstTitle = null;
  990 + let lastTitle = null;
  991 + let rArr = []
  992 + let num = 0
  993 + for (let i = 0; i < arr.length; i++) {
  994 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  995 + if (str) {
  996 + rArr.push(arr[i].title)
  997 + num++
  998 + if (num == 1) {
  999 + firstTitle = arr[i].title
  1000 + }
  1001 + if (num >= 5) {
  1002 + lastTitle = arr[i].title
  1003 + }
  1004 + if (num >= 5 && i >= (arr.length - 1)) {
  1005 + let fi = rArr.findIndex((item) => {
  1006 + return item == firstTitle
  1007 + })
  1008 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1009 + num = 0
  1010 + }
  1011 + } else {
  1012 + if (num < 5) {
  1013 + num = 0
  1014 + firstTitle = null;
  1015 + lastTitle = null;
  1016 + } else {
  1017 + let fi = rArr.findIndex((item) => {
  1018 + return item == firstTitle
  1019 + })
  1020 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1021 + num = 0
  1022 + }
  1023 + }
  1024 + }
  1025 + return {
  1026 + rArr,
  1027 + lastTitle,
  1028 + firstTitle
  1029 + };
  1030 + },
888 /** 1031 /**
889 * 生命周期函数--监听页面隐藏 1032 * 生命周期函数--监听页面隐藏
890 */ 1033 */
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
  14 + data-form="1"
14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 15 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 16 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 17 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -89,29 +90,49 @@ @@ -89,29 +90,49 @@
89 </button> 90 </button>
90 </view> 91 </view>
91 </view> 92 </view>
92 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 93 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
93 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 94 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
94 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 95 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
95 <view class="preferentialItems"> 96 <view class="preferentialItems">
96 <view class="itemLeft"> 97 <view class="itemLeft">
97 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 98 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  99 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
98 <view class="priceText" wx:if="{{item.price}}"> 100 <view class="priceText" wx:if="{{item.price}}">
99 - <view class="icons font40r">¥</view>{{item.price}} 101 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
100 </view> 102 </view>
  103 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
101 </view> 104 </view>
  105 + <view class="couponLine"></view>
102 <view class="itemRight"> 106 <view class="itemRight">
103 <view class="btns"> 107 <view class="btns">
104 <text class="font40r">{{item.aname}}</text> 108 <text class="font40r">{{item.aname}}</text>
105 - <view class="font24r orderingFood">  
106 - 抢购  
107 - </view> 109 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  110 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  111 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  112 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  113 + </view>
  114 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  115 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  116 + </view>
  117 + </block>
  118 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  119 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  120 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  121 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  122 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  123 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  124 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  125 + </block>
108 </view> 126 </view>
109 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
110 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
111 - 无限制{{item.desc?','+item.desc+'。':'。'}} 127 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  128 + <view class="font24r orderingFood orderingFood1">已领取</view>
  129 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  130 + <view class="font24r">已被领取</view>
  131 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  132 + </view>
112 </view> 133 </view>
113 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
114 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 134 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  135 + 立即抢购
115 </view> 136 </view>
116 </view> 137 </view>
117 </view> 138 </view>
@@ -331,4 +352,24 @@ @@ -331,4 +352,24 @@
331 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 352 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
332 </view> 353 </view>
333 </view> 354 </view>
  355 +</my-modal>
  356 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  357 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  358 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  359 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  360 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  361 + </view>
  362 + <view slot="modalContent">
  363 + <view class="couponBox">
  364 + <view wx:for="{{couponArr}}" class="couponItems">
  365 + <view class="couponNum font20r">×{{item.number}}</view>
  366 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  367 + <view class="couponLines"></view>
  368 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  369 + <view class="font28r couponCondition" wx:else>无门槛</view>
  370 + </view>
  371 + </view>
  372 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  373 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  374 + </view>
334 </my-modal> 375 </my-modal>
@@ -298,13 +298,104 @@ @@ -298,13 +298,104 @@
298 flex-shrink: 0; 298 flex-shrink: 0;
299 } 299 }
300 300
  301 +.preferentialCoupon .itemRight {
  302 + width: 74%;
  303 + display: flex;
  304 + align-items: center;
  305 +}
  306 +
  307 +.preferentialCoupon .itemLeft {
  308 + width: 26%;
  309 +}
  310 +
  311 +.preferentialCoupon .couponLine{
  312 + margin: 24rpx 0;
  313 + border-right: 2rpx dashed #f6231b;
  314 +}
  315 +
  316 +.preferentialCoupon .orderingFood {
  317 + padding: 0 20rpx;
  318 + color: #fff !important;
  319 + border: none !important;
  320 + text-align: center;
  321 + border-radius: 20rpx;
  322 + line-height: 44rpx;
  323 + height: 44rpx;
  324 + width: max-content;
  325 + flex-shrink: 0;
  326 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  327 +}
  328 +.preferentialCoupon .icons {
  329 + color: #F6231B;
  330 + text-align: center;
  331 +}
  332 +
  333 +.preferentialCoupon .priceText {
  334 + display: flex;
  335 + align-items: baseline;
  336 + justify-content: center;
  337 + font-family: PingFang SC;
  338 + color: #F6231B;
  339 + font-weight: 600;
  340 + font-size: 48rpx;
  341 + margin-top: 6rpx;
  342 +}
  343 +
  344 +.preferentialCoupon .priceText text {
  345 + font-size: 48rpx;
  346 +}
  347 +
  348 +.preferentialCoupon .btns {
  349 + flex: 1;
  350 +}
  351 +.preferentialCoupon .btnBox {
  352 + display: flex;
  353 + flex-direction: column;
  354 +}
  355 +
  356 +.preferentialCoupon .grantNum {
  357 + display: flex;
  358 + flex-direction: column;
  359 + align-items: center;
  360 + color: #C36607;
  361 + margin-top: 10rpx;
  362 +}
  363 +
  364 +.preferentialCoupon .grantNum text {
  365 + color: #F6231B;
  366 + margin-right: 10rpx;
  367 +}
  368 +
  369 +.preferentialCoupon .btns text {
  370 + font-weight: 600;
  371 +}
  372 +
  373 +.preferentialCoupon .orderingFood1 {
  374 + border: 2rpx solid #fa4b20 !important;
  375 + background: transparent !important;
  376 + color: #fa4b20 !important;
  377 +}
  378 +
  379 +.preferentialCoupon .btns text {
  380 + color: #0B0805 !important;
  381 +}
  382 +
  383 +.preferentialCoupon .bottom {
  384 + color: #C36607 !important;
  385 +}
  386 +
  387 +.preferentialCoupon .nodate{
  388 + margin-left: 20rpx;
  389 +}
  390 +
301 .preferentialItems { 391 .preferentialItems {
302 display: flex; 392 display: flex;
303 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat;  
304 - background-size: 100% 100%; 393 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
305 margin-bottom: 20rpx; 394 margin-bottom: 20rpx;
306 min-height: 160rpx; 395 min-height: 160rpx;
307 padding-bottom: 10rpx; 396 padding-bottom: 10rpx;
  397 + border-radius: 20rpx;
  398 + border: 2rpx solid #ff7e06;
308 } 399 }
309 400
310 .rechargeItems { 401 .rechargeItems {
@@ -317,6 +408,7 @@ @@ -317,6 +408,7 @@
317 height: auto; 408 height: auto;
318 padding: 12rpx 0; 409 padding: 12rpx 0;
319 margin: 0 20rpx; 410 margin: 0 20rpx;
  411 + border: none;
320 } 412 }
321 413
322 .rechargeItems .orderingFood { 414 .rechargeItems .orderingFood {
@@ -358,6 +450,20 @@ @@ -358,6 +450,20 @@
358 top: 12rpx; 450 top: 12rpx;
359 } 451 }
360 452
  453 +.discountText1{
  454 + text-align: center;
  455 + color: #FD4D59;
  456 + border: 2rpx solid #FD4D59;
  457 + border-radius: 6rpx;
  458 + font-family: PingFang SC;
  459 + background: transparent;
  460 + width: max-content;
  461 + padding: 0 6rpx;
  462 + position: absolute;
  463 + left: 16rpx;
  464 + top: 12rpx;
  465 +}
  466 +
361 .famousChefBox .labelBox, 467 .famousChefBox .labelBox,
362 .stopBox .labelBox { 468 .stopBox .labelBox {
363 border-bottom: none; 469 border-bottom: none;
@@ -451,9 +557,7 @@ @@ -451,9 +557,7 @@
451 } 557 }
452 558
453 .priceText .icons { 559 .priceText .icons {
454 - font-family: 'Abel';  
455 color: #FD4D59; 560 color: #FD4D59;
456 - font-size: 40rpx;  
457 } 561 }
458 562
459 .itemRight { 563 .itemRight {
@@ -467,6 +571,7 @@ @@ -467,6 +571,7 @@
467 display: flex; 571 display: flex;
468 justify-content: space-between; 572 justify-content: space-between;
469 align-items: baseline; 573 align-items: baseline;
  574 + flex-direction: column;
470 } 575 }
471 576
472 .btns text { 577 .btns text {
@@ -727,6 +832,145 @@ @@ -727,6 +832,145 @@
727 box-sizing: border-box; 832 box-sizing: border-box;
728 } 833 }
729 834
  835 +#couponModal .titleModal {
  836 + margin-top: 30%;
  837 + position: relative;
  838 +}
  839 +
  840 +#couponModal .titleModal2 {
  841 + margin-top: 80%;
  842 +}
  843 +
  844 +#couponModal .titleModal3 {
  845 + margin-top: 60%;
  846 +}
  847 +
  848 +#couponModal .titleModal4 {
  849 + margin-top: 30%;
  850 +}
  851 +
  852 +#couponModal .mymodal {
  853 + background: rgba(0, 0, 0, 0.8);
  854 + width: 100% !important;
  855 + top: 0 !important;
  856 + height: auto !important;
  857 + z-index: 300;
  858 +}
  859 +
  860 +.nameInfo {
  861 + font-family: PingFang SC;
  862 + font-weight: 400;
  863 + font-size: 52rpx;
  864 + line-height: 56rpx;
  865 + color: #fff;
  866 + margin-bottom: 40rpx;
  867 + padding-top: 60rpx;
  868 +}
  869 +
  870 +.couponTotal {
  871 + color: #dfdfdf;
  872 + font-family: PingFang SC;
  873 + font-weight: 400;
  874 + font-size: 40rpx;
  875 + line-height: 48rpx;
  876 + margin-bottom: 40rpx;
  877 + display: flex;
  878 + align-items: center;
  879 + justify-content: center;
  880 +}
  881 +
  882 +.couponTotal text {
  883 + color: #ffc806;
  884 + font-weight: 600;
  885 + font-size: 80rpx;
  886 + margin: 0 14rpx;
  887 +}
  888 +
  889 +.couponBox {
  890 + width: 80%;
  891 + margin: 0 auto;
  892 + display: flex;
  893 + flex-wrap: wrap;
  894 + justify-content: space-evenly;
  895 +}
  896 +
  897 +.couponItems {
  898 + width: 46%;
  899 + margin-bottom: 24rpx;
  900 + padding-bottom: 52rpx;
  901 + border-radius: 20rpx;
  902 + border: 2rpx solid #ff7e06;
  903 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  904 +}
  905 +
  906 +.couponNum {
  907 + background: #727272;
  908 + border-radius: 50%;
  909 + color: #fff;
  910 + width: 40rpx;
  911 + height: 40rpx;
  912 + display: flex;
  913 + align-items: center;
  914 + justify-content: center;
  915 + margin: 8rpx 0 0 8rpx;
  916 +}
  917 +
  918 +.couponPrice {
  919 + display: flex;
  920 + align-items: center;
  921 + justify-content: center;
  922 + color: #F6231B;
  923 + font-weight: 500;
  924 +}
  925 +
  926 +.couponLines{
  927 + width: 80%;
  928 + margin: 0 auto;
  929 + height: 2rpx;
  930 + border-bottom: 2rpx dashed #F6231B;
  931 +}
  932 +
  933 +.couponPrice text {
  934 + margin-left: 4rpx;
  935 + font-size: 76rpx;
  936 + font-weight: 700;
  937 +}
  938 +
  939 +.couponCondition {
  940 + color: #C36607;
  941 + display: flex;
  942 + align-items: center;
  943 + justify-content: center;
  944 + padding-top: 24rpx;
  945 +}
  946 +
  947 +.couponBtn {
  948 + width: 80%;
  949 + margin: 0 auto;
  950 + border-radius: 42rpx;
  951 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  952 + font-weight: 400;
  953 + color: #fff;
  954 + text-align: center;
  955 + border: 4rpx solid #fff;
  956 + padding: 12rpx 0;
  957 + margin: 16rpx auto 20rpx auto;
  958 +}
  959 +
  960 +.couponText {
  961 + color: #fff;
  962 + text-decoration: underline;
  963 + text-align: center;
  964 +}
  965 +
  966 +.closeImg {
  967 + width: 60rpx;
  968 + height: 60rpx;
  969 + position: absolute;
  970 + right: 0;
  971 + top: 0;
  972 +}
  973 +
730 /* 深中国红 */ 974 /* 深中国红 */
731 .crimson, 975 .crimson,
732 .crimson .positioningBox { 976 .crimson .positioningBox {
@@ -1017,14 +1261,6 @@ @@ -1017,14 +1261,6 @@
1017 color: #578C69; 1261 color: #578C69;
1018 } 1262 }
1019 1263
1020 -.pearlWhite .preferentialItems {  
1021 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
1022 - background-size: 100% 100%;  
1023 - margin-bottom: 20rpx;  
1024 - min-height: 160rpx;  
1025 - padding-bottom: 10rpx;  
1026 -}  
1027 -  
1028 .pearlWhite .rechargeItems { 1264 .pearlWhite .rechargeItems {
1029 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat; 1265 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat;
1030 background-size: 100% 100%; 1266 background-size: 100% 100%;
@@ -1080,12 +1316,6 @@ @@ -1080,12 +1316,6 @@
1080 border: none; 1316 border: none;
1081 } 1317 }
1082 1318
1083 -.pearlWhite .discountText {  
1084 - background: transparent;  
1085 - border: 2rpx solid #FD4D59;  
1086 - color: #FD4D59;  
1087 -}  
1088 -  
1089 .toastBox { 1319 .toastBox {
1090 width: fit-content; 1320 width: fit-content;
1091 position: fixed; 1321 position: fixed;
@@ -66,6 +66,7 @@ Page({ @@ -66,6 +66,7 @@ Page({
66 isMoreBtn:'',//再次预订按钮 66 isMoreBtn:'',//再次预订按钮
67 isPaymenBtn:'',//支付定金按钮 67 isPaymenBtn:'',//支付定金按钮
68 isShareItem:'',//转发客人按钮 68 isShareItem:'',//转发客人按钮
  69 + couponArr: [],//待领取的优惠券列表
69 }, 70 },
70 tablestr: '', 71 tablestr: '',
71 urlsValue: [], 72 urlsValue: [],
@@ -75,6 +76,7 @@ Page({ @@ -75,6 +76,7 @@ Page({
75 timers: null, // 动画定时器 76 timers: null, // 动画定时器
76 n: 0, 77 n: 0,
77 modal:'', 78 modal:'',
  79 + couponModal: '',
78 /** 80 /**
79 * 生命周期函数--监听页面加载 81 * 生命周期函数--监听页面加载
80 */ 82 */
@@ -102,6 +104,7 @@ Page({ @@ -102,6 +104,7 @@ Page({
102 wx.onUserCaptureScreen((res)=> { 104 wx.onUserCaptureScreen((res)=> {
103 this.showModal() 105 this.showModal()
104 }) 106 })
  107 + this.couponModal = this.selectComponent("#couponModal");
105 }, 108 },
106 // 打开截屏弹框 109 // 打开截屏弹框
107 showModal() { 110 showModal() {
@@ -111,6 +114,10 @@ Page({ @@ -111,6 +114,10 @@ Page({
111 closeModal() { 114 closeModal() {
112 this.modal.closeModal() 115 this.modal.closeModal()
113 }, 116 },
  117 + // 关闭优惠券弹框
  118 + closeCouponModal() {
  119 + this.couponModal.closeModal()
  120 + },
114 // 页面滚动事件 121 // 页面滚动事件
115 onPageScroll: function (event) { 122 onPageScroll: function (event) {
116 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 123 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -456,9 +463,10 @@ Page({ @@ -456,9 +463,10 @@ Page({
456 uid 463 uid
457 }).then((json) => { 464 }).then((json) => {
458 if (json.ret == 200) { 465 if (json.ret == 200) {
459 - console.log('staffinfostaffinfostaffinfo', json.data) 466 + console.log('客户经理获取基本信息------', json.data)
460 this.setData({ 467 this.setData({
461 - staffinfo: json.data 468 + staffinfo: json.data,
  469 + couponArr:[],
462 }) 470 })
463 this.getSellerTemplateConfFun(sid); 471 this.getSellerTemplateConfFun(sid);
464 } 472 }
@@ -579,7 +587,7 @@ Page({ @@ -579,7 +587,7 @@ Page({
579 let data = res.data 587 let data = res.data
580 console.log('data', data); 588 console.log('data', data);
581 let couponList = [] 589 let couponList = []
582 - let themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 590 + let themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
583 chef = util.determine(data.chef); 591 chef = util.determine(data.chef);
584 reserve = util.determine(data.reserve); 592 reserve = util.determine(data.reserve);
585 marketing = util.determine(data.marketing); 593 marketing = util.determine(data.marketing);
@@ -598,29 +606,23 @@ Page({ @@ -598,29 +606,23 @@ Page({
598 if (marketing) { 606 if (marketing) {
599 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 607 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
600 is_comments = marketing.is_comments ? marketing.is_comments : ''; 608 is_comments = marketing.is_comments ? marketing.is_comments : '';
601 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 609 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  610 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  611 + marketing.coupon_data_payList = coupon_data_pay
  612 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  613 + marketing.coupon_data_freeList = coupon_data_free
602 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 614 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
603 let couponDataId = info && info.length > 0 ? info[0].id : {} 615 let couponDataId = info && info.length > 0 ? info[0].id : {}
604 // 根据券ID获取评价赠送的券详情 616 // 根据券ID获取评价赠送的券详情
605 if(couponDataId) this.getEvaluateFun(couponDataId) 617 if(couponDataId) this.getEvaluateFun(couponDataId)
606 } 618 }
607 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 619 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
608 - if (coupon && util.getType(coupon) == 'object') {  
609 - couponList.push({  
610 - id: coupon.id  
611 - });  
612 - }  
613 - if (coupon && util.getType(coupon) == 'array') {  
614 - if (coupon.length > 0) {  
615 - coupon.forEach(item => {  
616 - couponList.push({  
617 - id: item.id  
618 - })  
619 - })  
620 - }  
621 - } 620 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  621 + couponList = this.addCoupons(coupon,couponList);
  622 + couponList = this.addCoupons(coupon_data_pay,couponList);
  623 + couponList = this.addCoupons(coupon_data_free,couponList);
622 // 根据券ID获取券详情 624 // 根据券ID获取券详情
623 - this.getActivityByIdFun(couponList, couponList.length) 625 + this.getActivityByIdFun(couponList)
624 // 根据充值ID获取充值详情 626 // 根据充值ID获取充值详情
625 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 627 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
626 this.getRechargeDetail(marketing.recharge_data.id) 628 this.getRechargeDetail(marketing.recharge_data.id)
@@ -697,13 +699,16 @@ Page({ @@ -697,13 +699,16 @@ Page({
697 }) 699 })
698 }, 700 },
699 // 点击商家有礼 701 // 点击商家有礼
700 - gotoSellerGift(){  
701 - let url = util.http_build_query({ 702 + gotoSellerGift(e){
  703 + this.couponModal.closeModal()
  704 + const form = e.currentTarget.dataset['form'];
  705 + let url = util.http_build_query({
702 id: this.data.detail.id, 706 id: this.data.detail.id,
703 - }, '/pages/reserve/sellerGift')  
704 - wx.navigateTo({  
705 - url  
706 - }) 707 + form
  708 + }, '/pages/reserve/sellerGift')
  709 + wx.navigateTo({
  710 + url
  711 + })
707 }, 712 },
708 // 再次预订 713 // 再次预订
709 secondbook() { 714 secondbook() {
@@ -857,34 +862,172 @@ Page({ @@ -857,34 +862,172 @@ Page({
857 }) 862 })
858 }, 863 },
859 // 根据券ID获取券详情 864 // 根据券ID获取券详情
860 - getActivityByIdFun(ids, length) {  
861 - let coupon_dataList = [];  
862 - ids.forEach(i => {  
863 - App.Activity.GetActivityById({  
864 - id: i.id  
865 - }).then(res => {  
866 - if (res.data.length > 0) {  
867 - let detail = res.data[0];  
868 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
869 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
870 - detail.use = detail.use ? util.determine(detail.use) : '';  
871 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
872 - let cash = detail.use.cash * 1;  
873 - let price = detail.price * 1;  
874 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
875 - }  
876 - coupon_dataList.push(detail);  
877 - if (length === coupon_dataList.length) {  
878 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
879 - console.log('邀请函--------------------优惠券',coupon_dataList);  
880 - this.setData({  
881 - coupon_dataList,  
882 - })  
883 - }  
884 - }  
885 - })  
886 - })  
887 - }, 865 + getActivityByIdFun(obj) {
  866 + App.Activity.GetActivityById({
  867 + id: obj.map(item => item.id).join(','),
  868 + }).then(res => {
  869 + if (res.data.length > 0) {
  870 + let list = res.data.filter(item => {
  871 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  872 + })
  873 + list.forEach(detail => {
  874 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  875 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  876 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  877 + detail.use = detail.use ? util.determine(detail.use) : '';
  878 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  879 + let cash = detail.use.cash * 1;
  880 + let price = detail.price * 1;
  881 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  882 + }
  883 + let num = detail.receiveNum;
  884 + if (num > 0) {
  885 + detail.receiveNumText = ''
  886 + if (num >= 0 && num <= 100) {
  887 + detail.receiveNumText = num.toString();
  888 + } else if (num >= 101 && num <= 199) {
  889 + detail.receiveNumText = '100+';
  890 + } else if (num >= 200 && num <= 299) {
  891 + detail.receiveNumText = '200+';
  892 + } else {
  893 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  894 + }
  895 + }
  896 + if (detail.exp_date && detail.exp_date.week_data) {
  897 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  898 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  899 + if (noon) noon = '午餐:' + noon
  900 + if (nig) nig = '晚餐:' + nig
  901 + detail.noonText = noon;
  902 + detail.nigText = nig;
  903 + }
  904 + })
  905 + let freeCoupons = list.filter(item => {
  906 + return item.is_type == '3'
  907 + })
  908 + // 免费券判断是否领取,弹框领取
  909 + if (freeCoupons.length > 0) {
  910 + let length = freeCoupons.length - 1
  911 + freeCoupons.forEach(i => {
  912 + this.getCoupon(i, freeCoupons[length].id, obj)
  913 + })
  914 + }
  915 + console.log('邀请函--------------------优惠券', list);
  916 + this.setData({
  917 + coupon_dataList: list,
  918 + })
  919 + }
  920 + })
  921 + },
  922 + // 获取所有的券并且展示
  923 + addCoupons(coupons, couponList) {
  924 + if (coupons && util.getType(coupons) == 'object') {
  925 + couponList.push({
  926 + id: coupon.id,
  927 + number: coupon.number
  928 + });
  929 + }
  930 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  931 + coupons.forEach(item => {
  932 + couponList.push({
  933 + id: item.id,
  934 + number: item.number
  935 + });
  936 + });
  937 + }
  938 + return couponList
  939 + },
  940 + // 弹框领取免费券
  941 + setcouponFun(arr) {
  942 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  943 + console.log('弹框领取免费券id', str);
  944 + App.Activity.SetActivityAsReserve({
  945 + aid: str,
  946 + rid: this.id,
  947 + }).then((json) => {
  948 + if (json.ret != 200) {
  949 + wx.showToast({
  950 + title: res.msg,
  951 + duration: 2000,
  952 + mask: true
  953 + })
  954 + }
  955 + })
  956 + },
  957 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  958 + getCoupon(item, id, obj) {
  959 + let couponArr = this.data.couponArr;
  960 + let totalPrice = this.data.totalPrice;
  961 + App.Activity.ActivityListByOpenid({
  962 + aid: item.id
  963 + }).then(res => {
  964 + if (res.ret == 200) {
  965 + if (res.data.length == 0) {
  966 + couponArr.push(item)
  967 + }
  968 + if (item.id == id && couponArr.length > 0) {
  969 + couponArr.forEach(item => {
  970 + let match = obj.find(b => b.id === item.id);
  971 + if (match) {
  972 + item.number = match.number;
  973 + }
  974 + });
  975 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  976 + this.setcouponFun(couponArr)
  977 + this.couponModal.showModal()
  978 + }
  979 + console.log('未领取的券列表-----------', couponArr);
  980 + this.setData({
  981 + couponArr,
  982 + totalPrice
  983 + })
  984 + }
  985 + })
  986 + },
  987 + // 处理优惠券不可用日期数据
  988 + hasConsecutiveSelect(arr, type) {
  989 + let firstTitle = null;
  990 + let lastTitle = null;
  991 + let rArr = []
  992 + let num = 0
  993 + for (let i = 0; i < arr.length; i++) {
  994 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  995 + if (str) {
  996 + rArr.push(arr[i].title)
  997 + num++
  998 + if (num == 1) {
  999 + firstTitle = arr[i].title
  1000 + }
  1001 + if (num >= 5) {
  1002 + lastTitle = arr[i].title
  1003 + }
  1004 + if (num >= 5 && i >= (arr.length - 1)) {
  1005 + let fi = rArr.findIndex((item) => {
  1006 + return item == firstTitle
  1007 + })
  1008 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1009 + num = 0
  1010 + }
  1011 + } else {
  1012 + if (num < 5) {
  1013 + num = 0
  1014 + firstTitle = null;
  1015 + lastTitle = null;
  1016 + } else {
  1017 + let fi = rArr.findIndex((item) => {
  1018 + return item == firstTitle
  1019 + })
  1020 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1021 + num = 0
  1022 + }
  1023 + }
  1024 + }
  1025 + return {
  1026 + rArr,
  1027 + lastTitle,
  1028 + firstTitle
  1029 + };
  1030 + },
888 /** 1031 /**
889 * 生命周期函数--监听页面隐藏 1032 * 生命周期函数--监听页面隐藏
890 */ 1033 */
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 /> 10 />
11 <image class="giftImg" 11 <image class="giftImg"
12 bindtap="gotoSellerGift" 12 bindtap="gotoSellerGift"
  13 + data-form="1"
13 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -72,29 +73,49 @@ @@ -72,29 +73,49 @@
72 导航到店 73 导航到店
73 </button> 74 </button>
74 </view> 75 </view>
75 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 76 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
76 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 77 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
77 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 78 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
78 <view class="preferentialItems"> 79 <view class="preferentialItems">
79 <view class="itemLeft"> 80 <view class="itemLeft">
80 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 81 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  82 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
81 <view class="priceText" wx:if="{{item.price}}"> 83 <view class="priceText" wx:if="{{item.price}}">
82 - <view class="icons font40r">¥</view>{{item.price}} 84 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
83 </view> 85 </view>
  86 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
84 </view> 87 </view>
  88 + <view class="couponLine"></view>
85 <view class="itemRight"> 89 <view class="itemRight">
86 <view class="btns"> 90 <view class="btns">
87 <text class="font40r">{{item.aname}}</text> 91 <text class="font40r">{{item.aname}}</text>
88 - <view class="font24r orderingFood">  
89 - 抢购  
90 - </view> 92 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  93 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  94 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  95 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  96 + </view>
  97 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  98 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  99 + </view>
  100 + </block>
  101 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  102 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  103 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  104 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  105 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  106 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  107 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  108 + </block>
91 </view> 109 </view>
92 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
93 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
94 - 无限制{{item.desc?','+item.desc+'。':'。'}} 110 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  111 + <view class="font24r orderingFood orderingFood1">已领取</view>
  112 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  113 + <view class="font24r">已被领取</view>
  114 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  115 + </view>
95 </view> 116 </view>
96 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
97 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 117 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  118 + 立即抢购
98 </view> 119 </view>
99 </view> 120 </view>
100 </view> 121 </view>
@@ -314,4 +335,24 @@ @@ -314,4 +335,24 @@
314 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 335 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
315 </view> 336 </view>
316 </view> 337 </view>
  338 +</my-modal>
  339 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  340 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  341 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  342 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  343 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  344 + </view>
  345 + <view slot="modalContent">
  346 + <view class="couponBox">
  347 + <view wx:for="{{couponArr}}" class="couponItems">
  348 + <view class="couponNum font20r">×{{item.number}}</view>
  349 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  350 + <view class="couponLines"></view>
  351 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  352 + <view class="font28r couponCondition" wx:else>无门槛</view>
  353 + </view>
  354 + </view>
  355 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  356 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  357 + </view>
317 </my-modal> 358 </my-modal>
@@ -288,13 +288,104 @@ @@ -288,13 +288,104 @@
288 flex-shrink: 0; 288 flex-shrink: 0;
289 } 289 }
290 290
  291 +.preferentialCoupon .itemRight {
  292 + width: 74%;
  293 + display: flex;
  294 + align-items: center;
  295 +}
  296 +
  297 +.preferentialCoupon .itemLeft {
  298 + width: 26%;
  299 +}
  300 +
  301 +.preferentialCoupon .couponLine{
  302 + margin: 24rpx 0;
  303 + border-right: 2rpx dashed #f6231b;
  304 +}
  305 +
  306 +.preferentialCoupon .orderingFood {
  307 + padding: 0 20rpx;
  308 + color: #fff !important;
  309 + border: none !important;
  310 + text-align: center;
  311 + border-radius: 20rpx;
  312 + line-height: 44rpx;
  313 + height: 44rpx;
  314 + width: max-content;
  315 + flex-shrink: 0;
  316 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  317 +}
  318 +.preferentialCoupon .icons {
  319 + color: #F6231B;
  320 + text-align: center;
  321 +}
  322 +
  323 +.preferentialCoupon .priceText {
  324 + display: flex;
  325 + align-items: baseline;
  326 + justify-content: center;
  327 + font-family: PingFang SC;
  328 + color: #F6231B;
  329 + font-weight: 600;
  330 + font-size: 48rpx;
  331 + margin-top: 6rpx;
  332 +}
  333 +
  334 +.preferentialCoupon .priceText text {
  335 + font-size: 48rpx;
  336 +}
  337 +
  338 +.preferentialCoupon .btns {
  339 + flex: 1;
  340 +}
  341 +.preferentialCoupon .btnBox {
  342 + display: flex;
  343 + flex-direction: column;
  344 +}
  345 +
  346 +.preferentialCoupon .grantNum {
  347 + display: flex;
  348 + flex-direction: column;
  349 + align-items: center;
  350 + color: #C36607;
  351 + margin-top: 10rpx;
  352 +}
  353 +
  354 +.preferentialCoupon .grantNum text {
  355 + color: #F6231B;
  356 + margin-right: 10rpx;
  357 +}
  358 +
  359 +.preferentialCoupon .btns text {
  360 + font-weight: 600;
  361 +}
  362 +
  363 +.preferentialCoupon .orderingFood1 {
  364 + border: 2rpx solid #fa4b20 !important;
  365 + background: transparent !important;
  366 + color: #fa4b20 !important;
  367 +}
  368 +
  369 +.preferentialCoupon .btns text {
  370 + color: #0B0805 !important;
  371 +}
  372 +
  373 +.preferentialCoupon .bottom {
  374 + color: #C36607 !important;
  375 +}
  376 +
  377 +.preferentialCoupon .nodate{
  378 + margin-left: 20rpx;
  379 +}
  380 +
291 .preferentialItems { 381 .preferentialItems {
292 display: flex; 382 display: flex;
293 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat;  
294 - background-size: 100% 100%; 383 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
295 margin-bottom: 20rpx; 384 margin-bottom: 20rpx;
296 min-height: 160rpx; 385 min-height: 160rpx;
297 padding-bottom: 10rpx; 386 padding-bottom: 10rpx;
  387 + border-radius: 20rpx;
  388 + border: 2rpx solid #ff7e06;
298 } 389 }
299 390
300 .rechargeItems { 391 .rechargeItems {
@@ -307,6 +398,7 @@ @@ -307,6 +398,7 @@
307 height: auto; 398 height: auto;
308 padding: 12rpx 0; 399 padding: 12rpx 0;
309 margin: 0 20rpx; 400 margin: 0 20rpx;
  401 + border: none;
310 } 402 }
311 403
312 .rechargeItems .orderingFood { 404 .rechargeItems .orderingFood {
@@ -348,6 +440,20 @@ @@ -348,6 +440,20 @@
348 top: 12rpx; 440 top: 12rpx;
349 } 441 }
350 442
  443 +.discountText1{
  444 + text-align: center;
  445 + color: #FD4D59;
  446 + border: 2rpx solid #FD4D59;
  447 + border-radius: 6rpx;
  448 + font-family: PingFang SC;
  449 + background: transparent;
  450 + width: max-content;
  451 + padding: 0 6rpx;
  452 + position: absolute;
  453 + left: 16rpx;
  454 + top: 12rpx;
  455 +}
  456 +
351 .famousChefBox .labelBox, 457 .famousChefBox .labelBox,
352 .stopBox .labelBox { 458 .stopBox .labelBox {
353 border-bottom: none; 459 border-bottom: none;
@@ -441,9 +547,7 @@ @@ -441,9 +547,7 @@
441 } 547 }
442 548
443 .priceText .icons { 549 .priceText .icons {
444 - font-family: 'Abel';  
445 color: #FD4D59; 550 color: #FD4D59;
446 - font-size: 40rpx;  
447 } 551 }
448 552
449 .itemRight { 553 .itemRight {
@@ -457,6 +561,7 @@ @@ -457,6 +561,7 @@
457 display: flex; 561 display: flex;
458 justify-content: space-between; 562 justify-content: space-between;
459 align-items: baseline; 563 align-items: baseline;
  564 + flex-direction: column;
460 } 565 }
461 566
462 .btns text { 567 .btns text {
@@ -717,6 +822,145 @@ @@ -717,6 +822,145 @@
717 box-sizing: border-box; 822 box-sizing: border-box;
718 } 823 }
719 824
  825 +#couponModal .titleModal {
  826 + margin-top: 30%;
  827 + position: relative;
  828 +}
  829 +
  830 +#couponModal .titleModal2 {
  831 + margin-top: 80%;
  832 +}
  833 +
  834 +#couponModal .titleModal3 {
  835 + margin-top: 60%;
  836 +}
  837 +
  838 +#couponModal .titleModal4 {
  839 + margin-top: 30%;
  840 +}
  841 +
  842 +#couponModal .mymodal {
  843 + background: rgba(0, 0, 0, 0.8);
  844 + width: 100% !important;
  845 + top: 0 !important;
  846 + height: auto !important;
  847 + z-index: 300;
  848 +}
  849 +
  850 +.nameInfo {
  851 + font-family: PingFang SC;
  852 + font-weight: 400;
  853 + font-size: 52rpx;
  854 + line-height: 56rpx;
  855 + color: #fff;
  856 + margin-bottom: 40rpx;
  857 + padding-top: 60rpx;
  858 +}
  859 +
  860 +.couponTotal {
  861 + color: #dfdfdf;
  862 + font-family: PingFang SC;
  863 + font-weight: 400;
  864 + font-size: 40rpx;
  865 + line-height: 48rpx;
  866 + margin-bottom: 40rpx;
  867 + display: flex;
  868 + align-items: center;
  869 + justify-content: center;
  870 +}
  871 +
  872 +.couponTotal text {
  873 + color: #ffc806;
  874 + font-weight: 600;
  875 + font-size: 80rpx;
  876 + margin: 0 14rpx;
  877 +}
  878 +
  879 +.couponBox {
  880 + width: 80%;
  881 + margin: 0 auto;
  882 + display: flex;
  883 + flex-wrap: wrap;
  884 + justify-content: space-evenly;
  885 +}
  886 +
  887 +.couponItems {
  888 + width: 46%;
  889 + margin-bottom: 24rpx;
  890 + padding-bottom: 52rpx;
  891 + border-radius: 20rpx;
  892 + border: 2rpx solid #ff7e06;
  893 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  894 +}
  895 +
  896 +.couponNum {
  897 + background: #727272;
  898 + border-radius: 50%;
  899 + color: #fff;
  900 + width: 40rpx;
  901 + height: 40rpx;
  902 + display: flex;
  903 + align-items: center;
  904 + justify-content: center;
  905 + margin: 8rpx 0 0 8rpx;
  906 +}
  907 +
  908 +.couponPrice {
  909 + display: flex;
  910 + align-items: center;
  911 + justify-content: center;
  912 + color: #F6231B;
  913 + font-weight: 500;
  914 +}
  915 +
  916 +.couponLines{
  917 + width: 80%;
  918 + margin: 0 auto;
  919 + height: 2rpx;
  920 + border-bottom: 2rpx dashed #F6231B;
  921 +}
  922 +
  923 +.couponPrice text {
  924 + margin-left: 4rpx;
  925 + font-size: 76rpx;
  926 + font-weight: 700;
  927 +}
  928 +
  929 +.couponCondition {
  930 + color: #C36607;
  931 + display: flex;
  932 + align-items: center;
  933 + justify-content: center;
  934 + padding-top: 24rpx;
  935 +}
  936 +
  937 +.couponBtn {
  938 + width: 80%;
  939 + margin: 0 auto;
  940 + border-radius: 42rpx;
  941 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  942 + font-weight: 400;
  943 + color: #fff;
  944 + text-align: center;
  945 + border: 4rpx solid #fff;
  946 + padding: 12rpx 0;
  947 + margin: 16rpx auto 20rpx auto;
  948 +}
  949 +
  950 +.couponText {
  951 + color: #fff;
  952 + text-decoration: underline;
  953 + text-align: center;
  954 +}
  955 +
  956 +.closeImg {
  957 + width: 60rpx;
  958 + height: 60rpx;
  959 + position: absolute;
  960 + right: 0;
  961 + top: 0;
  962 +}
  963 +
720 /* 深中国红 */ 964 /* 深中国红 */
721 .crimson, 965 .crimson,
722 .crimson .positioningBox { 966 .crimson .positioningBox {
@@ -1050,14 +1294,6 @@ @@ -1050,14 +1294,6 @@
1050 color: #578C69; 1294 color: #578C69;
1051 } 1295 }
1052 1296
1053 -.pearlWhite .preferentialItems {  
1054 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
1055 - background-size: 100% 100%;  
1056 - margin-bottom: 20rpx;  
1057 - min-height: 160rpx;  
1058 - padding-bottom: 10rpx;  
1059 -}  
1060 -  
1061 .pearlWhite .rechargeItems { 1297 .pearlWhite .rechargeItems {
1062 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat; 1298 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat;
1063 background-size: 100% 100%; 1299 background-size: 100% 100%;
@@ -1125,12 +1361,6 @@ @@ -1125,12 +1361,6 @@
1125 border: none; 1361 border: none;
1126 } 1362 }
1127 1363
1128 -.pearlWhite .discountText {  
1129 - background: transparent;  
1130 - border: 2rpx solid #FD4D59;  
1131 - color: #FD4D59;  
1132 -}  
1133 -  
1134 .toastBox { 1364 .toastBox {
1135 width: fit-content; 1365 width: fit-content;
1136 position: fixed; 1366 position: fixed;
@@ -65,6 +65,7 @@ Page({ @@ -65,6 +65,7 @@ Page({
65 isMoreBtn:'',//再次预订按钮 65 isMoreBtn:'',//再次预订按钮
66 isPaymenBtn:'',//支付定金按钮 66 isPaymenBtn:'',//支付定金按钮
67 isShareItem:'',//转发客人按钮 67 isShareItem:'',//转发客人按钮
  68 + couponArr: [],//待领取的优惠券列表
68 }, 69 },
69 tablestr: '', 70 tablestr: '',
70 urlsValue: [], 71 urlsValue: [],
@@ -74,6 +75,7 @@ Page({ @@ -74,6 +75,7 @@ Page({
74 timers: null, // 动画定时器 75 timers: null, // 动画定时器
75 n: 0, 76 n: 0,
76 modal:'', 77 modal:'',
  78 + couponModal: '',
77 /** 79 /**
78 * 生命周期函数--监听页面加载 80 * 生命周期函数--监听页面加载
79 */ 81 */
@@ -101,6 +103,7 @@ Page({ @@ -101,6 +103,7 @@ Page({
101 wx.onUserCaptureScreen((res)=> { 103 wx.onUserCaptureScreen((res)=> {
102 this.showModal() 104 this.showModal()
103 }) 105 })
  106 + this.couponModal = this.selectComponent("#couponModal");
104 }, 107 },
105 // 打开截屏弹框 108 // 打开截屏弹框
106 showModal() { 109 showModal() {
@@ -110,6 +113,10 @@ Page({ @@ -110,6 +113,10 @@ Page({
110 closeModal() { 113 closeModal() {
111 this.modal.closeModal() 114 this.modal.closeModal()
112 }, 115 },
  116 + // 关闭优惠券弹框
  117 + closeCouponModal() {
  118 + this.couponModal.closeModal()
  119 + },
113 // 页面滚动事件 120 // 页面滚动事件
114 onPageScroll: function (event) { 121 onPageScroll: function (event) {
115 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 122 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -455,9 +462,10 @@ Page({ @@ -455,9 +462,10 @@ Page({
455 uid 462 uid
456 }).then((json) => { 463 }).then((json) => {
457 if (json.ret == 200) { 464 if (json.ret == 200) {
458 - console.log('staffinfostaffinfostaffinfo', json.data) 465 + console.log('客户经理获取基本信息------', json.data)
459 this.setData({ 466 this.setData({
460 - staffinfo: json.data 467 + staffinfo: json.data,
  468 + couponArr:[],
461 }) 469 })
462 this.getSellerTemplateConfFun(sid); 470 this.getSellerTemplateConfFun(sid);
463 } 471 }
@@ -578,7 +586,7 @@ Page({ @@ -578,7 +586,7 @@ Page({
578 let data = res.data 586 let data = res.data
579 console.log('data', data); 587 console.log('data', data);
580 let couponList = [] 588 let couponList = []
581 - let themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 589 + let themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
582 chef = util.determine(data.chef); 590 chef = util.determine(data.chef);
583 reserve = util.determine(data.reserve); 591 reserve = util.determine(data.reserve);
584 marketing = util.determine(data.marketing); 592 marketing = util.determine(data.marketing);
@@ -597,29 +605,23 @@ Page({ @@ -597,29 +605,23 @@ Page({
597 if (marketing) { 605 if (marketing) {
598 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 606 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
599 is_comments = marketing.is_comments ? marketing.is_comments : ''; 607 is_comments = marketing.is_comments ? marketing.is_comments : '';
600 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 608 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  609 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  610 + marketing.coupon_data_payList = coupon_data_pay
  611 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  612 + marketing.coupon_data_freeList = coupon_data_free
601 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 613 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
602 let couponDataId = info && info.length > 0 ? info[0].id : {} 614 let couponDataId = info && info.length > 0 ? info[0].id : {}
603 // 根据券ID获取评价赠送的券详情 615 // 根据券ID获取评价赠送的券详情
604 if(couponDataId) this.getEvaluateFun(couponDataId) 616 if(couponDataId) this.getEvaluateFun(couponDataId)
605 } 617 }
606 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 618 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
607 - if (coupon && util.getType(coupon) == 'object') {  
608 - couponList.push({  
609 - id: coupon.id  
610 - });  
611 - }  
612 - if (coupon && util.getType(coupon) == 'array') {  
613 - if (coupon.length > 0) {  
614 - coupon.forEach(item => {  
615 - couponList.push({  
616 - id: item.id  
617 - })  
618 - })  
619 - }  
620 - } 619 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  620 + couponList = this.addCoupons(coupon,couponList);
  621 + couponList = this.addCoupons(coupon_data_pay,couponList);
  622 + couponList = this.addCoupons(coupon_data_free,couponList);
621 // 根据券ID获取券详情 623 // 根据券ID获取券详情
622 - this.getActivityByIdFun(couponList, couponList.length) 624 + this.getActivityByIdFun(couponList)
623 // 根据充值ID获取充值详情 625 // 根据充值ID获取充值详情
624 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 626 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
625 this.getRechargeDetail(marketing.recharge_data.id) 627 this.getRechargeDetail(marketing.recharge_data.id)
@@ -696,13 +698,16 @@ Page({ @@ -696,13 +698,16 @@ Page({
696 }) 698 })
697 }, 699 },
698 // 点击商家有礼 700 // 点击商家有礼
699 - gotoSellerGift(){  
700 - let url = util.http_build_query({ 701 + gotoSellerGift(e){
  702 + this.couponModal.closeModal()
  703 + const form = e.currentTarget.dataset['form'];
  704 + let url = util.http_build_query({
701 id: this.data.detail.id, 705 id: this.data.detail.id,
702 - }, '/pages/reserve/sellerGift')  
703 - wx.navigateTo({  
704 - url  
705 - }) 706 + form
  707 + }, '/pages/reserve/sellerGift')
  708 + wx.navigateTo({
  709 + url
  710 + })
706 }, 711 },
707 // 再次预订 712 // 再次预订
708 secondbook() { 713 secondbook() {
@@ -856,34 +861,172 @@ Page({ @@ -856,34 +861,172 @@ Page({
856 }) 861 })
857 }, 862 },
858 // 根据券ID获取券详情 863 // 根据券ID获取券详情
859 - getActivityByIdFun(ids, length) {  
860 - let coupon_dataList = [];  
861 - ids.forEach(i => {  
862 - App.Activity.GetActivityById({  
863 - id: i.id  
864 - }).then(res => {  
865 - if (res.data.length > 0) {  
866 - let detail = res.data[0];  
867 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
868 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
869 - detail.use = detail.use ? util.determine(detail.use) : '';  
870 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
871 - let cash = detail.use.cash * 1;  
872 - let price = detail.price * 1;  
873 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
874 - }  
875 - coupon_dataList.push(detail);  
876 - if (length === coupon_dataList.length) {  
877 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
878 - console.log('邀请函--------------------优惠券',coupon_dataList);  
879 - this.setData({  
880 - coupon_dataList,  
881 - })  
882 - }  
883 - }  
884 - })  
885 - })  
886 - }, 864 + getActivityByIdFun(obj) {
  865 + App.Activity.GetActivityById({
  866 + id: obj.map(item => item.id).join(','),
  867 + }).then(res => {
  868 + if (res.data.length > 0) {
  869 + let list = res.data.filter(item => {
  870 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  871 + })
  872 + list.forEach(detail => {
  873 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  874 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  875 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  876 + detail.use = detail.use ? util.determine(detail.use) : '';
  877 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  878 + let cash = detail.use.cash * 1;
  879 + let price = detail.price * 1;
  880 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  881 + }
  882 + let num = detail.receiveNum;
  883 + if (num > 0) {
  884 + detail.receiveNumText = ''
  885 + if (num >= 0 && num <= 100) {
  886 + detail.receiveNumText = num.toString();
  887 + } else if (num >= 101 && num <= 199) {
  888 + detail.receiveNumText = '100+';
  889 + } else if (num >= 200 && num <= 299) {
  890 + detail.receiveNumText = '200+';
  891 + } else {
  892 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  893 + }
  894 + }
  895 + if (detail.exp_date && detail.exp_date.week_data) {
  896 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  897 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  898 + if (noon) noon = '午餐:' + noon
  899 + if (nig) nig = '晚餐:' + nig
  900 + detail.noonText = noon;
  901 + detail.nigText = nig;
  902 + }
  903 + })
  904 + let freeCoupons = list.filter(item => {
  905 + return item.is_type == '3'
  906 + })
  907 + // 免费券判断是否领取,弹框领取
  908 + if (freeCoupons.length > 0) {
  909 + let length = freeCoupons.length - 1
  910 + freeCoupons.forEach(i => {
  911 + this.getCoupon(i, freeCoupons[length].id, obj)
  912 + })
  913 + }
  914 + console.log('邀请函--------------------优惠券', list);
  915 + this.setData({
  916 + coupon_dataList: list,
  917 + })
  918 + }
  919 + })
  920 + },
  921 + // 获取所有的券并且展示
  922 + addCoupons(coupons, couponList) {
  923 + if (coupons && util.getType(coupons) == 'object') {
  924 + couponList.push({
  925 + id: coupon.id,
  926 + number: coupon.number
  927 + });
  928 + }
  929 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  930 + coupons.forEach(item => {
  931 + couponList.push({
  932 + id: item.id,
  933 + number: item.number
  934 + });
  935 + });
  936 + }
  937 + return couponList
  938 + },
  939 + // 弹框领取免费券
  940 + setcouponFun(arr) {
  941 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  942 + console.log('弹框领取免费券id', str);
  943 + App.Activity.SetActivityAsReserve({
  944 + aid: str,
  945 + rid: this.id,
  946 + }).then((json) => {
  947 + if (json.ret != 200) {
  948 + wx.showToast({
  949 + title: res.msg,
  950 + duration: 2000,
  951 + mask: true
  952 + })
  953 + }
  954 + })
  955 + },
  956 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  957 + getCoupon(item, id, obj) {
  958 + let couponArr = this.data.couponArr;
  959 + let totalPrice = this.data.totalPrice;
  960 + App.Activity.ActivityListByOpenid({
  961 + aid: item.id
  962 + }).then(res => {
  963 + if (res.ret == 200) {
  964 + if (res.data.length == 0) {
  965 + couponArr.push(item)
  966 + }
  967 + if (item.id == id && couponArr.length > 0) {
  968 + couponArr.forEach(item => {
  969 + let match = obj.find(b => b.id === item.id);
  970 + if (match) {
  971 + item.number = match.number;
  972 + }
  973 + });
  974 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  975 + this.setcouponFun(couponArr)
  976 + this.couponModal.showModal()
  977 + }
  978 + console.log('未领取的券列表-----------', couponArr);
  979 + this.setData({
  980 + couponArr,
  981 + totalPrice
  982 + })
  983 + }
  984 + })
  985 + },
  986 + // 处理优惠券不可用日期数据
  987 + hasConsecutiveSelect(arr, type) {
  988 + let firstTitle = null;
  989 + let lastTitle = null;
  990 + let rArr = []
  991 + let num = 0
  992 + for (let i = 0; i < arr.length; i++) {
  993 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  994 + if (str) {
  995 + rArr.push(arr[i].title)
  996 + num++
  997 + if (num == 1) {
  998 + firstTitle = arr[i].title
  999 + }
  1000 + if (num >= 5) {
  1001 + lastTitle = arr[i].title
  1002 + }
  1003 + if (num >= 5 && i >= (arr.length - 1)) {
  1004 + let fi = rArr.findIndex((item) => {
  1005 + return item == firstTitle
  1006 + })
  1007 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1008 + num = 0
  1009 + }
  1010 + } else {
  1011 + if (num < 5) {
  1012 + num = 0
  1013 + firstTitle = null;
  1014 + lastTitle = null;
  1015 + } else {
  1016 + let fi = rArr.findIndex((item) => {
  1017 + return item == firstTitle
  1018 + })
  1019 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1020 + num = 0
  1021 + }
  1022 + }
  1023 + }
  1024 + return {
  1025 + rArr,
  1026 + lastTitle,
  1027 + firstTitle
  1028 + };
  1029 + },
887 /** 1030 /**
888 * 生命周期函数--监听页面隐藏 1031 * 生命周期函数--监听页面隐藏
889 */ 1032 */
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 /> 10 />
11 <image class="giftImg" 11 <image class="giftImg"
12 bindtap="gotoSellerGift" 12 bindtap="gotoSellerGift"
  13 + data-form="1"
13 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -70,29 +71,49 @@ @@ -70,29 +71,49 @@
70 </button> 71 </button>
71 </view> 72 </view>
72 </view> 73 </view>
73 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 74 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
74 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 75 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
75 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 76 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
76 <view class="preferentialItems"> 77 <view class="preferentialItems">
77 <view class="itemLeft"> 78 <view class="itemLeft">
78 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 79 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  80 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
79 <view class="priceText" wx:if="{{item.price}}"> 81 <view class="priceText" wx:if="{{item.price}}">
80 - <view class="icons font40r">¥</view>{{item.price}} 82 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
81 </view> 83 </view>
  84 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
82 </view> 85 </view>
  86 + <view class="couponLine"></view>
83 <view class="itemRight"> 87 <view class="itemRight">
84 <view class="btns"> 88 <view class="btns">
85 <text class="font40r">{{item.aname}}</text> 89 <text class="font40r">{{item.aname}}</text>
86 - <view class="font24r orderingFood">  
87 - 抢购  
88 - </view> 90 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  91 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  92 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  93 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  94 + </view>
  95 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  96 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  97 + </view>
  98 + </block>
  99 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  100 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  101 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  102 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  103 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  104 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  105 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  106 + </block>
89 </view> 107 </view>
90 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
91 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
92 - 无限制{{item.desc?','+item.desc+'。':'。'}} 108 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  109 + <view class="font24r orderingFood orderingFood1">已领取</view>
  110 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  111 + <view class="font24r">已被领取</view>
  112 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  113 + </view>
93 </view> 114 </view>
94 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
95 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 115 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  116 + 立即抢购
96 </view> 117 </view>
97 </view> 118 </view>
98 </view> 119 </view>
@@ -313,4 +334,24 @@ @@ -313,4 +334,24 @@
313 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 334 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
314 </view> 335 </view>
315 </view> 336 </view>
  337 +</my-modal>
  338 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  339 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  340 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  341 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  342 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  343 + </view>
  344 + <view slot="modalContent">
  345 + <view class="couponBox">
  346 + <view wx:for="{{couponArr}}" class="couponItems">
  347 + <view class="couponNum font20r">×{{item.number}}</view>
  348 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  349 + <view class="couponLines"></view>
  350 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  351 + <view class="font28r couponCondition" wx:else>无门槛</view>
  352 + </view>
  353 + </view>
  354 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  355 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  356 + </view>
316 </my-modal> 357 </my-modal>
@@ -287,13 +287,104 @@ @@ -287,13 +287,104 @@
287 flex-shrink: 0; 287 flex-shrink: 0;
288 } 288 }
289 289
  290 +.preferentialCoupon .itemRight {
  291 + width: 74%;
  292 + display: flex;
  293 + align-items: center;
  294 +}
  295 +
  296 +.preferentialCoupon .itemLeft {
  297 + width: 26%;
  298 +}
  299 +
  300 +.preferentialCoupon .couponLine{
  301 + margin: 24rpx 0;
  302 + border-right: 2rpx dashed #f6231b;
  303 +}
  304 +
  305 +.preferentialCoupon .orderingFood {
  306 + padding: 0 20rpx;
  307 + color: #fff !important;
  308 + border: none !important;
  309 + text-align: center;
  310 + border-radius: 20rpx;
  311 + line-height: 44rpx;
  312 + height: 44rpx;
  313 + width: max-content;
  314 + flex-shrink: 0;
  315 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  316 +}
  317 +.preferentialCoupon .icons {
  318 + color: #F6231B;
  319 + text-align: center;
  320 +}
  321 +
  322 +.preferentialCoupon .priceText {
  323 + display: flex;
  324 + align-items: baseline;
  325 + justify-content: center;
  326 + font-family: PingFang SC;
  327 + color: #F6231B;
  328 + font-weight: 600;
  329 + font-size: 48rpx;
  330 + margin-top: 6rpx;
  331 +}
  332 +
  333 +.preferentialCoupon .priceText text {
  334 + font-size: 48rpx;
  335 +}
  336 +
  337 +.preferentialCoupon .btns {
  338 + flex: 1;
  339 +}
  340 +.preferentialCoupon .btnBox {
  341 + display: flex;
  342 + flex-direction: column;
  343 +}
  344 +
  345 +.preferentialCoupon .grantNum {
  346 + display: flex;
  347 + flex-direction: column;
  348 + align-items: center;
  349 + color: #C36607;
  350 + margin-top: 10rpx;
  351 +}
  352 +
  353 +.preferentialCoupon .grantNum text {
  354 + color: #F6231B;
  355 + margin-right: 10rpx;
  356 +}
  357 +
  358 +.preferentialCoupon .btns text {
  359 + font-weight: 600;
  360 +}
  361 +
  362 +.preferentialCoupon .orderingFood1 {
  363 + border: 2rpx solid #fa4b20 !important;
  364 + background: transparent !important;
  365 + color: #fa4b20 !important;
  366 +}
  367 +
  368 +.preferentialCoupon .btns text {
  369 + color: #0B0805 !important;
  370 +}
  371 +
  372 +.preferentialCoupon .bottom {
  373 + color: #C36607 !important;
  374 +}
  375 +
  376 +.preferentialCoupon .nodate{
  377 + margin-left: 20rpx;
  378 +}
  379 +
290 .preferentialItems { 380 .preferentialItems {
291 display: flex; 381 display: flex;
292 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat;  
293 - background-size: 100% 100%; 382 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
294 margin-bottom: 20rpx; 383 margin-bottom: 20rpx;
295 min-height: 160rpx; 384 min-height: 160rpx;
296 padding-bottom: 10rpx; 385 padding-bottom: 10rpx;
  386 + border-radius: 20rpx;
  387 + border: 2rpx solid #ff7e06;
297 } 388 }
298 389
299 .rechargeItems { 390 .rechargeItems {
@@ -306,6 +397,7 @@ @@ -306,6 +397,7 @@
306 height: auto; 397 height: auto;
307 padding: 12rpx 0; 398 padding: 12rpx 0;
308 margin: 0 20rpx; 399 margin: 0 20rpx;
  400 + border: none;
309 } 401 }
310 402
311 .rechargeItems .orderingFood { 403 .rechargeItems .orderingFood {
@@ -347,6 +439,20 @@ @@ -347,6 +439,20 @@
347 top: 12rpx; 439 top: 12rpx;
348 } 440 }
349 441
  442 +.discountText1{
  443 + text-align: center;
  444 + color: #FD4D59;
  445 + border: 2rpx solid #FD4D59;
  446 + border-radius: 6rpx;
  447 + font-family: PingFang SC;
  448 + background: transparent;
  449 + width: max-content;
  450 + padding: 0 6rpx;
  451 + position: absolute;
  452 + left: 16rpx;
  453 + top: 12rpx;
  454 +}
  455 +
350 .famousChefBox .labelBox, 456 .famousChefBox .labelBox,
351 .stopBox .labelBox { 457 .stopBox .labelBox {
352 border-bottom: none; 458 border-bottom: none;
@@ -440,9 +546,7 @@ @@ -440,9 +546,7 @@
440 } 546 }
441 547
442 .priceText .icons { 548 .priceText .icons {
443 - font-family: 'Abel';  
444 color: #FD4D59; 549 color: #FD4D59;
445 - font-size: 40rpx;  
446 } 550 }
447 551
448 .itemRight { 552 .itemRight {
@@ -456,6 +560,7 @@ @@ -456,6 +560,7 @@
456 display: flex; 560 display: flex;
457 justify-content: space-between; 561 justify-content: space-between;
458 align-items: baseline; 562 align-items: baseline;
  563 + flex-direction: column;
459 } 564 }
460 565
461 .btns text { 566 .btns text {
@@ -716,6 +821,145 @@ @@ -716,6 +821,145 @@
716 box-sizing: border-box; 821 box-sizing: border-box;
717 } 822 }
718 823
  824 +#couponModal .titleModal {
  825 + margin-top: 30%;
  826 + position: relative;
  827 +}
  828 +
  829 +#couponModal .titleModal2 {
  830 + margin-top: 80%;
  831 +}
  832 +
  833 +#couponModal .titleModal3 {
  834 + margin-top: 60%;
  835 +}
  836 +
  837 +#couponModal .titleModal4 {
  838 + margin-top: 30%;
  839 +}
  840 +
  841 +#couponModal .mymodal {
  842 + background: rgba(0, 0, 0, 0.8);
  843 + width: 100% !important;
  844 + top: 0 !important;
  845 + height: auto !important;
  846 + z-index: 300;
  847 +}
  848 +
  849 +.nameInfo {
  850 + font-family: PingFang SC;
  851 + font-weight: 400;
  852 + font-size: 52rpx;
  853 + line-height: 56rpx;
  854 + color: #fff;
  855 + margin-bottom: 40rpx;
  856 + padding-top: 60rpx;
  857 +}
  858 +
  859 +.couponTotal {
  860 + color: #dfdfdf;
  861 + font-family: PingFang SC;
  862 + font-weight: 400;
  863 + font-size: 40rpx;
  864 + line-height: 48rpx;
  865 + margin-bottom: 40rpx;
  866 + display: flex;
  867 + align-items: center;
  868 + justify-content: center;
  869 +}
  870 +
  871 +.couponTotal text {
  872 + color: #ffc806;
  873 + font-weight: 600;
  874 + font-size: 80rpx;
  875 + margin: 0 14rpx;
  876 +}
  877 +
  878 +.couponBox {
  879 + width: 80%;
  880 + margin: 0 auto;
  881 + display: flex;
  882 + flex-wrap: wrap;
  883 + justify-content: space-evenly;
  884 +}
  885 +
  886 +.couponItems {
  887 + width: 46%;
  888 + margin-bottom: 24rpx;
  889 + padding-bottom: 52rpx;
  890 + border-radius: 20rpx;
  891 + border: 2rpx solid #ff7e06;
  892 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  893 +}
  894 +
  895 +.couponNum {
  896 + background: #727272;
  897 + border-radius: 50%;
  898 + color: #fff;
  899 + width: 40rpx;
  900 + height: 40rpx;
  901 + display: flex;
  902 + align-items: center;
  903 + justify-content: center;
  904 + margin: 8rpx 0 0 8rpx;
  905 +}
  906 +
  907 +.couponPrice {
  908 + display: flex;
  909 + align-items: center;
  910 + justify-content: center;
  911 + color: #F6231B;
  912 + font-weight: 500;
  913 +}
  914 +
  915 +.couponLines{
  916 + width: 80%;
  917 + margin: 0 auto;
  918 + height: 2rpx;
  919 + border-bottom: 2rpx dashed #F6231B;
  920 +}
  921 +
  922 +.couponPrice text {
  923 + margin-left: 4rpx;
  924 + font-size: 76rpx;
  925 + font-weight: 700;
  926 +}
  927 +
  928 +.couponCondition {
  929 + color: #C36607;
  930 + display: flex;
  931 + align-items: center;
  932 + justify-content: center;
  933 + padding-top: 24rpx;
  934 +}
  935 +
  936 +.couponBtn {
  937 + width: 80%;
  938 + margin: 0 auto;
  939 + border-radius: 42rpx;
  940 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  941 + font-weight: 400;
  942 + color: #fff;
  943 + text-align: center;
  944 + border: 4rpx solid #fff;
  945 + padding: 12rpx 0;
  946 + margin: 16rpx auto 20rpx auto;
  947 +}
  948 +
  949 +.couponText {
  950 + color: #fff;
  951 + text-decoration: underline;
  952 + text-align: center;
  953 +}
  954 +
  955 +.closeImg {
  956 + width: 60rpx;
  957 + height: 60rpx;
  958 + position: absolute;
  959 + right: 0;
  960 + top: 0;
  961 +}
  962 +
719 /* 深中国红 */ 963 /* 深中国红 */
720 .crimson, 964 .crimson,
721 .crimson .positioningBox { 965 .crimson .positioningBox {
@@ -1047,14 +1291,6 @@ @@ -1047,14 +1291,6 @@
1047 color: #578C69; 1291 color: #578C69;
1048 } 1292 }
1049 1293
1050 -.pearlWhite .preferentialItems {  
1051 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
1052 - background-size: 100% 100%;  
1053 - margin-bottom: 20rpx;  
1054 - min-height: 160rpx;  
1055 - padding-bottom: 10rpx;  
1056 -}  
1057 -  
1058 .pearlWhite .rechargeItems { 1294 .pearlWhite .rechargeItems {
1059 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat; 1295 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat;
1060 background-size: 100% 100%; 1296 background-size: 100% 100%;
@@ -1122,12 +1358,6 @@ @@ -1122,12 +1358,6 @@
1122 border: none; 1358 border: none;
1123 } 1359 }
1124 1360
1125 -.pearlWhite .discountText {  
1126 - background: transparent;  
1127 - border: 2rpx solid #FD4D59;  
1128 - color: #FD4D59;  
1129 -}  
1130 -  
1131 .toastBox { 1361 .toastBox {
1132 width: fit-content; 1362 width: fit-content;
1133 position: fixed; 1363 position: fixed;
@@ -67,6 +67,7 @@ Page({ @@ -67,6 +67,7 @@ Page({
67 isMoreBtn:'',//再次预订按钮 67 isMoreBtn:'',//再次预订按钮
68 isPaymenBtn:'',//支付定金按钮 68 isPaymenBtn:'',//支付定金按钮
69 isShareItem:'',//转发客人按钮 69 isShareItem:'',//转发客人按钮
  70 + couponArr: [],//待领取的优惠券列表
70 }, 71 },
71 screenHeight: '', 72 screenHeight: '',
72 attentionAnim: {}, 73 attentionAnim: {},
@@ -74,6 +75,7 @@ Page({ @@ -74,6 +75,7 @@ Page({
74 timers: null, // 动画定时器 75 timers: null, // 动画定时器
75 n: 0, 76 n: 0,
76 modal:'', 77 modal:'',
  78 + couponModal: '',
77 /** 79 /**
78 * 生命周期函数--监听页面加载 80 * 生命周期函数--监听页面加载
79 */ 81 */
@@ -101,6 +103,7 @@ Page({ @@ -101,6 +103,7 @@ Page({
101 wx.onUserCaptureScreen((res)=> { 103 wx.onUserCaptureScreen((res)=> {
102 this.showModal() 104 this.showModal()
103 }) 105 })
  106 + this.couponModal = this.selectComponent("#couponModal");
104 }, 107 },
105 // 打开截屏弹框 108 // 打开截屏弹框
106 showModal() { 109 showModal() {
@@ -110,6 +113,10 @@ Page({ @@ -110,6 +113,10 @@ Page({
110 closeModal() { 113 closeModal() {
111 this.modal.closeModal() 114 this.modal.closeModal()
112 }, 115 },
  116 + // 关闭优惠券弹框
  117 + closeCouponModal() {
  118 + this.couponModal.closeModal()
  119 + },
113 // 页面滚动事件 120 // 页面滚动事件
114 onPageScroll: function (event) { 121 onPageScroll: function (event) {
115 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 122 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -409,9 +416,10 @@ Page({ @@ -409,9 +416,10 @@ Page({
409 uid 416 uid
410 }).then((json) => { 417 }).then((json) => {
411 if (json.ret == 200) { 418 if (json.ret == 200) {
412 - console.log('staffinfostaffinfostaffinfo', json.data) 419 + console.log('客户经理获取基本信息------', json.data)
413 this.setData({ 420 this.setData({
414 - staffinfo: json.data 421 + staffinfo: json.data,
  422 + couponArr:[],
415 }) 423 })
416 this.getSellerTemplateConfFun(sid); 424 this.getSellerTemplateConfFun(sid);
417 } 425 }
@@ -529,7 +537,7 @@ Page({ @@ -529,7 +537,7 @@ Page({
529 let data = res.data 537 let data = res.data
530 console.log('data', data); 538 console.log('data', data);
531 let couponList = [] 539 let couponList = []
532 - let themeColor, StyleType, titleType, whiteBj, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 540 + let themeColor, StyleType, titleType, whiteBj, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
533 chef = util.determine(data.chef); 541 chef = util.determine(data.chef);
534 reserve = util.determine(data.reserve); 542 reserve = util.determine(data.reserve);
535 marketing = util.determine(data.marketing); 543 marketing = util.determine(data.marketing);
@@ -548,29 +556,23 @@ Page({ @@ -548,29 +556,23 @@ Page({
548 if (marketing) { 556 if (marketing) {
549 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 557 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
550 is_comments = marketing.is_comments ? marketing.is_comments : ''; 558 is_comments = marketing.is_comments ? marketing.is_comments : '';
551 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 559 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  560 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  561 + marketing.coupon_data_payList = coupon_data_pay
  562 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  563 + marketing.coupon_data_freeList = coupon_data_free
552 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 564 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
553 let couponDataId = info && info.length > 0 ? info[0].id : {} 565 let couponDataId = info && info.length > 0 ? info[0].id : {}
554 // 根据券ID获取评价赠送的券详情 566 // 根据券ID获取评价赠送的券详情
555 if(couponDataId) this.getEvaluateFun(couponDataId) 567 if(couponDataId) this.getEvaluateFun(couponDataId)
556 } 568 }
557 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 569 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
558 - if (coupon && util.getType(coupon) == 'object') {  
559 - couponList.push({  
560 - id: coupon.id  
561 - });  
562 - }  
563 - if (coupon && util.getType(coupon) == 'array') {  
564 - if (coupon.length > 0) {  
565 - coupon.forEach(item => {  
566 - couponList.push({  
567 - id: item.id  
568 - })  
569 - })  
570 - }  
571 - } 570 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  571 + couponList = this.addCoupons(coupon,couponList);
  572 + couponList = this.addCoupons(coupon_data_pay,couponList);
  573 + couponList = this.addCoupons(coupon_data_free,couponList);
572 // 根据券ID获取券详情 574 // 根据券ID获取券详情
573 - this.getActivityByIdFun(couponList, couponList.length) 575 + this.getActivityByIdFun(couponList)
574 // 根据充值ID获取充值详情 576 // 根据充值ID获取充值详情
575 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 577 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
576 this.getRechargeDetail(marketing.recharge_data.id) 578 this.getRechargeDetail(marketing.recharge_data.id)
@@ -654,8 +656,11 @@ Page({ @@ -654,8 +656,11 @@ Page({
654 }, 656 },
655 // 点击商家有礼 657 // 点击商家有礼
656 gotoSellerGift(){ 658 gotoSellerGift(){
  659 + this.couponModal.closeModal()
  660 + const form = e.currentTarget.dataset['form'];
657 let url = util.http_build_query({ 661 let url = util.http_build_query({
658 id: this.data.detail.id, 662 id: this.data.detail.id,
  663 + form
659 }, '/pages/reserve/sellerGift') 664 }, '/pages/reserve/sellerGift')
660 wx.navigateTo({ 665 wx.navigateTo({
661 url 666 url
@@ -812,35 +817,173 @@ Page({ @@ -812,35 +817,173 @@ Page({
812 } 817 }
813 }) 818 })
814 }, 819 },
815 - // 根据券ID获取券详情  
816 - getActivityByIdFun(ids, length) {  
817 - let coupon_dataList = [];  
818 - ids.forEach(i => {  
819 - App.Activity.GetActivityById({  
820 - id: i.id  
821 - }).then(res => {  
822 - if (res.data.length > 0) {  
823 - let detail = res.data[0];  
824 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
825 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
826 - detail.use = detail.use ? util.determine(detail.use) : '';  
827 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
828 - let cash = detail.use.cash * 1;  
829 - let price = detail.price * 1;  
830 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
831 - }  
832 - coupon_dataList.push(detail);  
833 - if (length === coupon_dataList.length) {  
834 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
835 - console.log('邀请函--------------------优惠券',coupon_dataList);  
836 - this.setData({  
837 - coupon_dataList,  
838 - })  
839 - }  
840 - }  
841 - })  
842 - })  
843 - }, 820 + // 根据券ID获取券详情
  821 + getActivityByIdFun(obj) {
  822 + App.Activity.GetActivityById({
  823 + id: obj.map(item => item.id).join(','),
  824 + }).then(res => {
  825 + if (res.data.length > 0) {
  826 + let list = res.data.filter(item => {
  827 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  828 + })
  829 + list.forEach(detail => {
  830 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  831 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  832 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  833 + detail.use = detail.use ? util.determine(detail.use) : '';
  834 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  835 + let cash = detail.use.cash * 1;
  836 + let price = detail.price * 1;
  837 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  838 + }
  839 + let num = detail.receiveNum;
  840 + if (num > 0) {
  841 + detail.receiveNumText = ''
  842 + if (num >= 0 && num <= 100) {
  843 + detail.receiveNumText = num.toString();
  844 + } else if (num >= 101 && num <= 199) {
  845 + detail.receiveNumText = '100+';
  846 + } else if (num >= 200 && num <= 299) {
  847 + detail.receiveNumText = '200+';
  848 + } else {
  849 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  850 + }
  851 + }
  852 + if (detail.exp_date && detail.exp_date.week_data) {
  853 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  854 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  855 + if (noon) noon = '午餐:' + noon
  856 + if (nig) nig = '晚餐:' + nig
  857 + detail.noonText = noon;
  858 + detail.nigText = nig;
  859 + }
  860 + })
  861 + let freeCoupons = list.filter(item => {
  862 + return item.is_type == '3'
  863 + })
  864 + // 免费券判断是否领取,弹框领取
  865 + if (freeCoupons.length > 0) {
  866 + let length = freeCoupons.length - 1
  867 + freeCoupons.forEach(i => {
  868 + this.getCoupon(i, freeCoupons[length].id, obj)
  869 + })
  870 + }
  871 + console.log('邀请函--------------------优惠券', list);
  872 + this.setData({
  873 + coupon_dataList: list,
  874 + })
  875 + }
  876 + })
  877 + },
  878 + // 获取所有的券并且展示
  879 + addCoupons(coupons, couponList) {
  880 + if (coupons && util.getType(coupons) == 'object') {
  881 + couponList.push({
  882 + id: coupon.id,
  883 + number: coupon.number
  884 + });
  885 + }
  886 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  887 + coupons.forEach(item => {
  888 + couponList.push({
  889 + id: item.id,
  890 + number: item.number
  891 + });
  892 + });
  893 + }
  894 + return couponList
  895 + },
  896 + // 弹框领取免费券
  897 + setcouponFun(arr) {
  898 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  899 + console.log('弹框领取免费券id', str);
  900 + App.Activity.SetActivityAsReserve({
  901 + aid: str,
  902 + rid: this.id,
  903 + }).then((json) => {
  904 + if (json.ret != 200) {
  905 + wx.showToast({
  906 + title: res.msg,
  907 + duration: 2000,
  908 + mask: true
  909 + })
  910 + }
  911 + })
  912 + },
  913 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  914 + getCoupon(item, id, obj) {
  915 + let couponArr = this.data.couponArr;
  916 + let totalPrice = this.data.totalPrice;
  917 + App.Activity.ActivityListByOpenid({
  918 + aid: item.id
  919 + }).then(res => {
  920 + if (res.ret == 200) {
  921 + if (res.data.length == 0) {
  922 + couponArr.push(item)
  923 + }
  924 + if (item.id == id && couponArr.length > 0) {
  925 + couponArr.forEach(item => {
  926 + let match = obj.find(b => b.id === item.id);
  927 + if (match) {
  928 + item.number = match.number;
  929 + }
  930 + });
  931 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  932 + this.setcouponFun(couponArr)
  933 + this.couponModal.showModal()
  934 + }
  935 + console.log('未领取的券列表-----------', couponArr);
  936 + this.setData({
  937 + couponArr,
  938 + totalPrice
  939 + })
  940 + }
  941 + })
  942 + },
  943 + // 处理优惠券不可用日期数据
  944 + hasConsecutiveSelect(arr, type) {
  945 + let firstTitle = null;
  946 + let lastTitle = null;
  947 + let rArr = []
  948 + let num = 0
  949 + for (let i = 0; i < arr.length; i++) {
  950 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  951 + if (str) {
  952 + rArr.push(arr[i].title)
  953 + num++
  954 + if (num == 1) {
  955 + firstTitle = arr[i].title
  956 + }
  957 + if (num >= 5) {
  958 + lastTitle = arr[i].title
  959 + }
  960 + if (num >= 5 && i >= (arr.length - 1)) {
  961 + let fi = rArr.findIndex((item) => {
  962 + return item == firstTitle
  963 + })
  964 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  965 + num = 0
  966 + }
  967 + } else {
  968 + if (num < 5) {
  969 + num = 0
  970 + firstTitle = null;
  971 + lastTitle = null;
  972 + } else {
  973 + let fi = rArr.findIndex((item) => {
  974 + return item == firstTitle
  975 + })
  976 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  977 + num = 0
  978 + }
  979 + }
  980 + }
  981 + return {
  982 + rArr,
  983 + lastTitle,
  984 + firstTitle
  985 + };
  986 + },
844 /** 987 /**
845 * 生命周期函数--监听页面隐藏 988 * 生命周期函数--监听页面隐藏
846 */ 989 */
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
  14 + data-form="1"
14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 15 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 16 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 17 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -92,29 +93,50 @@ @@ -92,29 +93,50 @@
92 </view> 93 </view>
93 </view> 94 </view>
94 </view> 95 </view>
95 - <view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 96 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
96 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 97 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
97 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 98 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
98 <view class="preferentialItems"> 99 <view class="preferentialItems">
99 - <view class="left">  
100 - <view class="top">  
101 - <text class="font28r">{{item.aname}}</text>  
102 - <view class="price font24r" wx:if="{{item.price}}">  
103 - <view class="icons font24r">¥</view>{{item.price}}  
104 - </view>  
105 - <!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->  
106 - <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discount font24r">{{item.discount}}折</text> 100 + <view class="itemLeft">
  101 + <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  102 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
  103 + <view class="priceText" wx:if="{{item.price}}">
  104 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
107 </view> 105 </view>
108 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r oneBottom">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
109 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
110 - 无限制{{item.desc?','+item.desc+'。':'。'}} 106 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  107 + </view>
  108 + <view class="couponLine"></view>
  109 + <view class="itemRight">
  110 + <view class="btns">
  111 + <text class="font40r">{{item.aname}}</text>
  112 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  113 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  114 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  115 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  116 + </view>
  117 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  118 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  119 + </view>
  120 + </block>
  121 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  122 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  123 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  124 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  125 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  126 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  127 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  128 + </block>
111 </view> 129 </view>
112 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
113 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 130 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  131 + <view class="font24r orderingFood orderingFood1">已领取</view>
  132 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  133 + <view class="font24r">已被领取</view>
  134 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  135 + </view>
  136 + </view>
  137 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  138 + 立即抢购
114 </view> 139 </view>
115 - </view>  
116 - <view class="font24r orderingFood">  
117 - 去抢购  
118 </view> 140 </view>
119 </view> 141 </view>
120 </navigator> 142 </navigator>
@@ -241,7 +263,7 @@ @@ -241,7 +263,7 @@
241 特别优惠 263 特别优惠
242 </view> 264 </view>
243 <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 265 <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
244 - <view class="preferentialItems"> 266 + <view class="rechargeItems">
245 <view class="left"> 267 <view class="left">
246 <view class="top"> 268 <view class="top">
247 <text class="font28r">{{recharge_data.rname}}</text> 269 <text class="font28r">{{recharge_data.rname}}</text>
@@ -300,4 +322,24 @@ @@ -300,4 +322,24 @@
300 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 322 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
301 </view> 323 </view>
302 </view> 324 </view>
  325 +</my-modal>
  326 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  327 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  328 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  329 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  330 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  331 + </view>
  332 + <view slot="modalContent">
  333 + <view class="couponBox">
  334 + <view wx:for="{{couponArr}}" class="couponItems">
  335 + <view class="couponNum font20r">×{{item.number}}</view>
  336 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  337 + <view class="couponLines"></view>
  338 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  339 + <view class="font28r couponCondition" wx:else>无门槛</view>
  340 + </view>
  341 + </view>
  342 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  343 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  344 + </view>
303 </my-modal> 345 </my-modal>
@@ -22,8 +22,16 @@ @@ -22,8 +22,16 @@
22 font-family: PingFang SC; 22 font-family: PingFang SC;
23 font-size: 72rpx; 23 font-size: 72rpx;
24 color: #FFD200; 24 color: #FFD200;
25 - position: relative;  
26 - top: -50rpx; 25 + position: absolute;
  26 + top: 40rpx;
  27 + left: 0;
  28 + right: 0;
  29 + overflow: hidden;
  30 + word-break: break-all;
  31 + text-overflow: ellipsis;
  32 + display: -webkit-box;
  33 + -webkit-box-orient: vertical;
  34 + -webkit-line-clamp: 1;
27 } 35 }
28 36
29 37
@@ -455,14 +463,172 @@ @@ -455,14 +463,172 @@
455 flex-shrink: 0; 463 flex-shrink: 0;
456 } 464 }
457 465
  466 +.preferentialCoupon .nodate{
  467 + margin-left: 20rpx;
  468 +}
  469 +
458 .preferentialItems { 470 .preferentialItems {
459 - padding: 16rpx 16rpx 16rpx 24rpx;  
460 display: flex; 471 display: flex;
461 - justify-content: space-between;  
462 - align-items: center; 472 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  473 + margin: 0 20rpx 20rpx 20rpx;
  474 + min-height: 160rpx;
  475 + padding-bottom: 10rpx;
  476 + border-radius: 20rpx;
  477 + border: 2rpx solid #ff7e06;
  478 +}
  479 +
  480 +.rechargeItems {
463 background: url('https://qn.colorcun.com/certificateBj.png') no-repeat; 481 background: url('https://qn.colorcun.com/certificateBj.png') no-repeat;
464 background-size: 100% 100%; 482 background-size: 100% 100%;
465 - margin-bottom: 20rpx; 483 + min-height: 160rpx;
  484 + display: flex;
  485 + justify-content: space-between;
  486 + align-items: center;
  487 + height: auto;
  488 + padding: 12rpx 20rpx 12rpx 32rpx;
  489 + margin: 0 20rpx;
  490 + border: none;
  491 +}
  492 +
  493 +.preferentialCoupon .itemRight {
  494 + width: 74%;
  495 + display: flex;
  496 + align-items: center;
  497 +}
  498 +
  499 +.preferentialCoupon .itemLeft {
  500 + width: 26%;
  501 +}
  502 +
  503 +.preferentialCoupon .couponLine{
  504 + margin: 24rpx 0;
  505 + border-right: 2rpx dashed #f6231b;
  506 +}
  507 +
  508 +.preferentialCoupon .orderingFood {
  509 + padding: 0 20rpx;
  510 + color: #fff !important;
  511 + border: none !important;
  512 + text-align: center;
  513 + border-radius: 20rpx;
  514 + line-height: 44rpx;
  515 + height: 44rpx;
  516 + width: max-content;
  517 + flex-shrink: 0;
  518 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  519 +}
  520 +.preferentialCoupon .icons {
  521 + color: #F6231B;
  522 + text-align: center;
  523 +}
  524 +
  525 +.preferentialCoupon .priceText {
  526 + display: flex;
  527 + align-items: baseline;
  528 + justify-content: center;
  529 + font-family: PingFang SC;
  530 + color: #F6231B;
  531 + font-weight: 600;
  532 + font-size: 48rpx;
  533 + margin-top: 6rpx;
  534 +}
  535 +
  536 +.preferentialCoupon .priceText text {
  537 + font-size: 48rpx;
  538 +}
  539 +
  540 +.preferentialCoupon .btns {
  541 + flex: 1;
  542 +}
  543 +.preferentialCoupon .btnBox {
  544 + display: flex;
  545 + flex-direction: column;
  546 +}
  547 +
  548 +.preferentialCoupon .grantNum {
  549 + display: flex;
  550 + flex-direction: column;
  551 + align-items: center;
  552 + color: #C36607;
  553 + margin-top: 10rpx;
  554 +}
  555 +
  556 +.preferentialCoupon .grantNum text {
  557 + color: #F6231B;
  558 + margin-right: 10rpx;
  559 +}
  560 +
  561 +.preferentialCoupon .btns text {
  562 + font-weight: 600;
  563 +}
  564 +
  565 +.preferentialCoupon .orderingFood1 {
  566 + border: 2rpx solid #fa4b20 !important;
  567 + background: transparent !important;
  568 + color: #fa4b20 !important;
  569 +}
  570 +
  571 +.preferentialItems .priceText .icons {
  572 + color: #FD4D59;
  573 +}
  574 +
  575 +.preferentialItems .btns {
  576 + margin: 24rpx 20rpx 0 0;
  577 + display: flex;
  578 + justify-content: space-between;
  579 + align-items: baseline;
  580 + flex-direction: column;
  581 +}
  582 +
  583 +.preferentialItems .bottom {
  584 + color: #C36607;
  585 +}
  586 +
  587 +.preferentialItems .priceText {
  588 + display: flex;
  589 + align-items: center;
  590 + justify-content: center;
  591 +}
  592 +
  593 +.preferentialItems .discountText {
  594 + text-align: center;
  595 + color: #FFEFC5;
  596 + border-radius: 6rpx;
  597 + font-family: PingFang SC;
  598 + background: #FD4D59;
  599 + width: max-content;
  600 + padding: 6rpx;
  601 + position: absolute;
  602 + left: 16rpx;
  603 + top: 12rpx;
  604 +}
  605 +
  606 +.preferentialItems .discountText1{
  607 + text-align: center;
  608 + color: #FD4D59;
  609 + border: 2rpx solid #FD4D59;
  610 + border-radius: 6rpx;
  611 + font-family: PingFang SC;
  612 + background: transparent;
  613 + width: max-content;
  614 + padding: 0 6rpx;
  615 + position: absolute;
  616 + left: 16rpx;
  617 + top: 12rpx;
  618 +}
  619 +
  620 +.preferentialItems .itemRight {
  621 + width: 70%;
  622 + padding-right: 10rpx;
  623 + margin-left: 18rpx;
  624 +}
  625 +
  626 +.preferentialItems .itemLeft {
  627 + width: 30%;
  628 + display: flex;
  629 + flex-direction: column;
  630 + justify-content: center;
  631 + position: relative;
466 } 632 }
467 633
468 .rubric1 { 634 .rubric1 {
@@ -806,6 +972,145 @@ @@ -806,6 +972,145 @@
806 box-sizing: border-box; 972 box-sizing: border-box;
807 } 973 }
808 974
  975 +#couponModal .titleModal {
  976 + margin-top: 30%;
  977 + position: relative;
  978 +}
  979 +
  980 +#couponModal .titleModal2 {
  981 + margin-top: 80%;
  982 +}
  983 +
  984 +#couponModal .titleModal3 {
  985 + margin-top: 60%;
  986 +}
  987 +
  988 +#couponModal .titleModal4 {
  989 + margin-top: 30%;
  990 +}
  991 +
  992 +#couponModal .mymodal {
  993 + background: rgba(0, 0, 0, 0.8);
  994 + width: 100% !important;
  995 + top: 0 !important;
  996 + height: auto !important;
  997 + z-index: 300;
  998 +}
  999 +
  1000 +.nameInfo {
  1001 + font-family: PingFang SC;
  1002 + font-weight: 400;
  1003 + font-size: 52rpx;
  1004 + line-height: 56rpx;
  1005 + color: #fff;
  1006 + margin-bottom: 40rpx;
  1007 + padding-top: 60rpx;
  1008 +}
  1009 +
  1010 +.couponTotal {
  1011 + color: #dfdfdf;
  1012 + font-family: PingFang SC;
  1013 + font-weight: 400;
  1014 + font-size: 40rpx;
  1015 + line-height: 48rpx;
  1016 + margin-bottom: 40rpx;
  1017 + display: flex;
  1018 + align-items: center;
  1019 + justify-content: center;
  1020 +}
  1021 +
  1022 +.couponTotal text {
  1023 + color: #ffc806;
  1024 + font-weight: 600;
  1025 + font-size: 80rpx;
  1026 + margin: 0 14rpx;
  1027 +}
  1028 +
  1029 +.couponBox {
  1030 + width: 80%;
  1031 + margin: 0 auto;
  1032 + display: flex;
  1033 + flex-wrap: wrap;
  1034 + justify-content: space-evenly;
  1035 +}
  1036 +
  1037 +.couponItems {
  1038 + width: 46%;
  1039 + margin-bottom: 24rpx;
  1040 + padding-bottom: 52rpx;
  1041 + border-radius: 20rpx;
  1042 + border: 2rpx solid #ff7e06;
  1043 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  1044 +}
  1045 +
  1046 +.couponNum {
  1047 + background: #727272;
  1048 + border-radius: 50%;
  1049 + color: #fff;
  1050 + width: 40rpx;
  1051 + height: 40rpx;
  1052 + display: flex;
  1053 + align-items: center;
  1054 + justify-content: center;
  1055 + margin: 8rpx 0 0 8rpx;
  1056 +}
  1057 +
  1058 +.couponPrice {
  1059 + display: flex;
  1060 + align-items: center;
  1061 + justify-content: center;
  1062 + color: #F6231B;
  1063 + font-weight: 500;
  1064 +}
  1065 +
  1066 +.couponLines{
  1067 + width: 80%;
  1068 + margin: 0 auto;
  1069 + height: 2rpx;
  1070 + border-bottom: 2rpx dashed #F6231B;
  1071 +}
  1072 +
  1073 +.couponPrice text {
  1074 + margin-left: 4rpx;
  1075 + font-size: 76rpx;
  1076 + font-weight: 700;
  1077 +}
  1078 +
  1079 +.couponCondition {
  1080 + color: #C36607;
  1081 + display: flex;
  1082 + align-items: center;
  1083 + justify-content: center;
  1084 + padding-top: 24rpx;
  1085 +}
  1086 +
  1087 +.couponBtn {
  1088 + width: 80%;
  1089 + margin: 0 auto;
  1090 + border-radius: 42rpx;
  1091 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  1092 + font-weight: 400;
  1093 + color: #fff;
  1094 + text-align: center;
  1095 + border: 4rpx solid #fff;
  1096 + padding: 12rpx 0;
  1097 + margin: 16rpx auto 20rpx auto;
  1098 +}
  1099 +
  1100 +.couponText {
  1101 + color: #fff;
  1102 + text-decoration: underline;
  1103 + text-align: center;
  1104 +}
  1105 +
  1106 +.closeImg {
  1107 + width: 60rpx;
  1108 + height: 60rpx;
  1109 + position: absolute;
  1110 + right: 0;
  1111 + top: 0;
  1112 +}
  1113 +
809 .arrivalBox{ 1114 .arrivalBox{
810 display: flex; 1115 display: flex;
811 width: 100%; 1116 width: 100%;
@@ -66,6 +66,7 @@ Page({ @@ -66,6 +66,7 @@ Page({
66 isMoreBtn:'',//再次预订按钮 66 isMoreBtn:'',//再次预订按钮
67 isPaymenBtn:'',//支付定金按钮 67 isPaymenBtn:'',//支付定金按钮
68 isShareItem:'',//转发客人按钮 68 isShareItem:'',//转发客人按钮
  69 + couponArr: [],//待领取的优惠券列表
69 }, 70 },
70 tablestr: '', 71 tablestr: '',
71 urlsValue: [], 72 urlsValue: [],
@@ -75,6 +76,7 @@ Page({ @@ -75,6 +76,7 @@ Page({
75 timers: null, // 动画定时器 76 timers: null, // 动画定时器
76 n: 0, 77 n: 0,
77 modal:'', 78 modal:'',
  79 + couponModal: '',
78 /** 80 /**
79 * 生命周期函数--监听页面加载 81 * 生命周期函数--监听页面加载
80 */ 82 */
@@ -102,6 +104,7 @@ Page({ @@ -102,6 +104,7 @@ Page({
102 wx.onUserCaptureScreen((res)=> { 104 wx.onUserCaptureScreen((res)=> {
103 this.showModal() 105 this.showModal()
104 }) 106 })
  107 + this.couponModal = this.selectComponent("#couponModal");
105 }, 108 },
106 // 打开截屏弹框 109 // 打开截屏弹框
107 showModal() { 110 showModal() {
@@ -111,6 +114,10 @@ Page({ @@ -111,6 +114,10 @@ Page({
111 closeModal() { 114 closeModal() {
112 this.modal.closeModal() 115 this.modal.closeModal()
113 }, 116 },
  117 + // 关闭优惠券弹框
  118 + closeCouponModal() {
  119 + this.couponModal.closeModal()
  120 + },
114 // 页面滚动事件 121 // 页面滚动事件
115 onPageScroll: function (event) { 122 onPageScroll: function (event) {
116 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 123 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -456,9 +463,10 @@ Page({ @@ -456,9 +463,10 @@ Page({
456 uid 463 uid
457 }).then((json) => { 464 }).then((json) => {
458 if (json.ret == 200) { 465 if (json.ret == 200) {
459 - console.log('staffinfostaffinfostaffinfo', json.data) 466 + console.log('客户经理获取基本信息------', json.data)
460 this.setData({ 467 this.setData({
461 - staffinfo: json.data 468 + staffinfo: json.data,
  469 + couponArr:[],
462 }) 470 })
463 this.getSellerTemplateConfFun(sid); 471 this.getSellerTemplateConfFun(sid);
464 } 472 }
@@ -579,7 +587,7 @@ Page({ @@ -579,7 +587,7 @@ Page({
579 let data = res.data 587 let data = res.data
580 console.log('data', data); 588 console.log('data', data);
581 let couponList = [] 589 let couponList = []
582 - let themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 590 + let themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
583 chef = util.determine(data.chef); 591 chef = util.determine(data.chef);
584 reserve = util.determine(data.reserve); 592 reserve = util.determine(data.reserve);
585 marketing = util.determine(data.marketing); 593 marketing = util.determine(data.marketing);
@@ -598,29 +606,23 @@ Page({ @@ -598,29 +606,23 @@ Page({
598 if (marketing) { 606 if (marketing) {
599 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 607 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
600 is_comments = marketing.is_comments ? marketing.is_comments : ''; 608 is_comments = marketing.is_comments ? marketing.is_comments : '';
601 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 609 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  610 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  611 + marketing.coupon_data_payList = coupon_data_pay
  612 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  613 + marketing.coupon_data_freeList = coupon_data_free
602 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 614 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
603 let couponDataId = info && info.length > 0 ? info[0].id : {} 615 let couponDataId = info && info.length > 0 ? info[0].id : {}
604 // 根据券ID获取评价赠送的券详情 616 // 根据券ID获取评价赠送的券详情
605 if(couponDataId) this.getEvaluateFun(couponDataId) 617 if(couponDataId) this.getEvaluateFun(couponDataId)
606 } 618 }
607 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 619 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
608 - if (coupon && util.getType(coupon) == 'object') {  
609 - couponList.push({  
610 - id: coupon.id  
611 - });  
612 - }  
613 - if (coupon && util.getType(coupon) == 'array') {  
614 - if (coupon.length > 0) {  
615 - coupon.forEach(item => {  
616 - couponList.push({  
617 - id: item.id  
618 - })  
619 - })  
620 - }  
621 - } 620 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  621 + couponList = this.addCoupons(coupon,couponList);
  622 + couponList = this.addCoupons(coupon_data_pay,couponList);
  623 + couponList = this.addCoupons(coupon_data_free,couponList);
622 // 根据券ID获取券详情 624 // 根据券ID获取券详情
623 - this.getActivityByIdFun(couponList, couponList.length) 625 + this.getActivityByIdFun(couponList)
624 // 根据充值ID获取充值详情 626 // 根据充值ID获取充值详情
625 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 627 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
626 this.getRechargeDetail(marketing.recharge_data.id) 628 this.getRechargeDetail(marketing.recharge_data.id)
@@ -697,9 +699,12 @@ Page({ @@ -697,9 +699,12 @@ Page({
697 }) 699 })
698 }, 700 },
699 // 点击商家有礼 701 // 点击商家有礼
700 - gotoSellerGift(){  
701 - let url = util.http_build_query({ 702 + gotoSellerGift(e){
  703 + this.couponModal.closeModal()
  704 + const form = e.currentTarget.dataset['form'];
  705 + let url = util.http_build_query({
702 id: this.data.detail.id, 706 id: this.data.detail.id,
  707 + form
703 }, '/pages/reserve/sellerGift') 708 }, '/pages/reserve/sellerGift')
704 wx.navigateTo({ 709 wx.navigateTo({
705 url 710 url
@@ -856,35 +861,173 @@ Page({ @@ -856,35 +861,173 @@ Page({
856 } 861 }
857 }) 862 })
858 }, 863 },
859 - // 根据券ID获取券详情  
860 - getActivityByIdFun(ids, length) {  
861 - let coupon_dataList = [];  
862 - ids.forEach(i => {  
863 - App.Activity.GetActivityById({  
864 - id: i.id  
865 - }).then(res => {  
866 - if (res.data.length > 0) {  
867 - let detail = res.data[0];  
868 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
869 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
870 - detail.use = detail.use ? util.determine(detail.use) : '';  
871 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
872 - let cash = detail.use.cash * 1;  
873 - let price = detail.price * 1;  
874 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
875 - }  
876 - coupon_dataList.push(detail);  
877 - if (length === coupon_dataList.length) {  
878 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
879 - console.log('邀请函--------------------优惠券',coupon_dataList);  
880 - this.setData({  
881 - coupon_dataList,  
882 - })  
883 - }  
884 - }  
885 - })  
886 - })  
887 - }, 864 + // 根据券ID获取券详情
  865 + getActivityByIdFun(obj) {
  866 + App.Activity.GetActivityById({
  867 + id: obj.map(item => item.id).join(','),
  868 + }).then(res => {
  869 + if (res.data.length > 0) {
  870 + let list = res.data.filter(item => {
  871 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  872 + })
  873 + list.forEach(detail => {
  874 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  875 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  876 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  877 + detail.use = detail.use ? util.determine(detail.use) : '';
  878 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  879 + let cash = detail.use.cash * 1;
  880 + let price = detail.price * 1;
  881 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  882 + }
  883 + let num = detail.receiveNum;
  884 + if (num > 0) {
  885 + detail.receiveNumText = ''
  886 + if (num >= 0 && num <= 100) {
  887 + detail.receiveNumText = num.toString();
  888 + } else if (num >= 101 && num <= 199) {
  889 + detail.receiveNumText = '100+';
  890 + } else if (num >= 200 && num <= 299) {
  891 + detail.receiveNumText = '200+';
  892 + } else {
  893 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  894 + }
  895 + }
  896 + if (detail.exp_date && detail.exp_date.week_data) {
  897 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  898 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  899 + if (noon) noon = '午餐:' + noon
  900 + if (nig) nig = '晚餐:' + nig
  901 + detail.noonText = noon;
  902 + detail.nigText = nig;
  903 + }
  904 + })
  905 + let freeCoupons = list.filter(item => {
  906 + return item.is_type == '3'
  907 + })
  908 + // 免费券判断是否领取,弹框领取
  909 + if (freeCoupons.length > 0) {
  910 + let length = freeCoupons.length - 1
  911 + freeCoupons.forEach(i => {
  912 + this.getCoupon(i, freeCoupons[length].id, obj)
  913 + })
  914 + }
  915 + console.log('邀请函--------------------优惠券', list);
  916 + this.setData({
  917 + coupon_dataList: list,
  918 + })
  919 + }
  920 + })
  921 + },
  922 + // 获取所有的券并且展示
  923 + addCoupons(coupons, couponList) {
  924 + if (coupons && util.getType(coupons) == 'object') {
  925 + couponList.push({
  926 + id: coupon.id,
  927 + number: coupon.number
  928 + });
  929 + }
  930 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  931 + coupons.forEach(item => {
  932 + couponList.push({
  933 + id: item.id,
  934 + number: item.number
  935 + });
  936 + });
  937 + }
  938 + return couponList
  939 + },
  940 + // 弹框领取免费券
  941 + setcouponFun(arr) {
  942 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  943 + console.log('弹框领取免费券id', str);
  944 + App.Activity.SetActivityAsReserve({
  945 + aid: str,
  946 + rid: this.id,
  947 + }).then((json) => {
  948 + if (json.ret != 200) {
  949 + wx.showToast({
  950 + title: res.msg,
  951 + duration: 2000,
  952 + mask: true
  953 + })
  954 + }
  955 + })
  956 + },
  957 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  958 + getCoupon(item, id, obj) {
  959 + let couponArr = this.data.couponArr;
  960 + let totalPrice = this.data.totalPrice;
  961 + App.Activity.ActivityListByOpenid({
  962 + aid: item.id
  963 + }).then(res => {
  964 + if (res.ret == 200) {
  965 + if (res.data.length == 0) {
  966 + couponArr.push(item)
  967 + }
  968 + if (item.id == id && couponArr.length > 0) {
  969 + couponArr.forEach(item => {
  970 + let match = obj.find(b => b.id === item.id);
  971 + if (match) {
  972 + item.number = match.number;
  973 + }
  974 + });
  975 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  976 + this.setcouponFun(couponArr)
  977 + this.couponModal.showModal()
  978 + }
  979 + console.log('未领取的券列表-----------', couponArr);
  980 + this.setData({
  981 + couponArr,
  982 + totalPrice
  983 + })
  984 + }
  985 + })
  986 + },
  987 + // 处理优惠券不可用日期数据
  988 + hasConsecutiveSelect(arr, type) {
  989 + let firstTitle = null;
  990 + let lastTitle = null;
  991 + let rArr = []
  992 + let num = 0
  993 + for (let i = 0; i < arr.length; i++) {
  994 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  995 + if (str) {
  996 + rArr.push(arr[i].title)
  997 + num++
  998 + if (num == 1) {
  999 + firstTitle = arr[i].title
  1000 + }
  1001 + if (num >= 5) {
  1002 + lastTitle = arr[i].title
  1003 + }
  1004 + if (num >= 5 && i >= (arr.length - 1)) {
  1005 + let fi = rArr.findIndex((item) => {
  1006 + return item == firstTitle
  1007 + })
  1008 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1009 + num = 0
  1010 + }
  1011 + } else {
  1012 + if (num < 5) {
  1013 + num = 0
  1014 + firstTitle = null;
  1015 + lastTitle = null;
  1016 + } else {
  1017 + let fi = rArr.findIndex((item) => {
  1018 + return item == firstTitle
  1019 + })
  1020 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1021 + num = 0
  1022 + }
  1023 + }
  1024 + }
  1025 + return {
  1026 + rArr,
  1027 + lastTitle,
  1028 + firstTitle
  1029 + };
  1030 + },
888 /** 1031 /**
889 * 生命周期函数--监听页面隐藏 1032 * 生命周期函数--监听页面隐藏
890 */ 1033 */
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
  14 + data-form="1"
14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 15 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 16 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 17 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -85,29 +86,49 @@ @@ -85,29 +86,49 @@
85 </button> 86 </button>
86 </view> 87 </view>
87 </view> 88 </view>
88 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 89 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
89 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 90 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
90 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 91 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
91 <view class="preferentialItems"> 92 <view class="preferentialItems">
92 <view class="itemLeft"> 93 <view class="itemLeft">
93 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 94 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  95 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
94 <view class="priceText" wx:if="{{item.price}}"> 96 <view class="priceText" wx:if="{{item.price}}">
95 - <view class="icons font40r">¥</view>{{item.price}} 97 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
96 </view> 98 </view>
  99 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
97 </view> 100 </view>
  101 + <view class="couponLine"></view>
98 <view class="itemRight"> 102 <view class="itemRight">
99 <view class="btns"> 103 <view class="btns">
100 <text class="font40r">{{item.aname}}</text> 104 <text class="font40r">{{item.aname}}</text>
101 - <view class="font24r orderingFood">  
102 - 抢购  
103 - </view> 105 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  106 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  107 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  108 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  109 + </view>
  110 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  111 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  112 + </view>
  113 + </block>
  114 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  115 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  116 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  117 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  118 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  119 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  120 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  121 + </block>
104 </view> 122 </view>
105 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
106 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
107 - 无限制{{item.desc?','+item.desc+'。':'。'}} 123 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  124 + <view class="font24r orderingFood orderingFood1">已领取</view>
  125 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  126 + <view class="font24r">已被领取</view>
  127 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  128 + </view>
108 </view> 129 </view>
109 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
110 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 130 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  131 + 立即抢购
111 </view> 132 </view>
112 </view> 133 </view>
113 </view> 134 </view>
@@ -326,4 +347,24 @@ @@ -326,4 +347,24 @@
326 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 347 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
327 </view> 348 </view>
328 </view> 349 </view>
  350 +</my-modal>
  351 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  352 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  353 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  354 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  355 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  356 + </view>
  357 + <view slot="modalContent">
  358 + <view class="couponBox">
  359 + <view wx:for="{{couponArr}}" class="couponItems">
  360 + <view class="couponNum font20r">×{{item.number}}</view>
  361 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  362 + <view class="couponLines"></view>
  363 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  364 + <view class="font28r couponCondition" wx:else>无门槛</view>
  365 + </view>
  366 + </view>
  367 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  368 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  369 + </view>
329 </my-modal> 370 </my-modal>
@@ -264,7 +264,7 @@ @@ -264,7 +264,7 @@
264 264
265 /* 优惠券开始 */ 265 /* 优惠券开始 */
266 .preferentialCoupon { 266 .preferentialCoupon {
267 - padding: 60rpx 40rpx 0 40rpx; 267 + padding: 40rpx 40rpx 0 40rpx;
268 } 268 }
269 269
270 .orderingFood { 270 .orderingFood {
@@ -281,13 +281,114 @@ @@ -281,13 +281,114 @@
281 flex-shrink: 0; 281 flex-shrink: 0;
282 } 282 }
283 283
  284 +.preferentialCoupon .itemRight {
  285 + width: 74%;
  286 + display: flex;
  287 + align-items: center;
  288 +}
  289 +
  290 +.preferentialCoupon .itemLeft {
  291 + width: 26%;
  292 +}
  293 +
  294 +.preferentialCoupon .couponLine{
  295 + margin: 24rpx 0;
  296 + border-right: 2rpx dashed #f6231b;
  297 +}
  298 +
  299 +.preferentialCoupon .orderingFood {
  300 + padding: 0 20rpx;
  301 + color: #fff !important;
  302 + border: none !important;
  303 + text-align: center;
  304 + border-radius: 20rpx;
  305 + line-height: 44rpx;
  306 + height: 44rpx;
  307 + width: max-content;
  308 + flex-shrink: 0;
  309 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  310 +}
  311 +.preferentialCoupon .icons {
  312 + color: #F6231B;
  313 + text-align: center;
  314 +}
  315 +
  316 +.preferentialCoupon .priceText {
  317 + display: flex;
  318 + align-items: baseline;
  319 + justify-content: center;
  320 + font-family: PingFang SC;
  321 + color: #F6231B;
  322 + font-weight: 600;
  323 + font-size: 48rpx;
  324 + margin-top: 6rpx;
  325 +}
  326 +
  327 +.preferentialCoupon .priceText text {
  328 + font-size: 48rpx;
  329 +}
  330 +
  331 +.preferentialCoupon .btns {
  332 + flex: 1;
  333 +}
  334 +.preferentialCoupon .btnBox {
  335 + display: flex;
  336 + flex-direction: column;
  337 +}
  338 +
  339 +.preferentialCoupon .grantNum {
  340 + display: flex;
  341 + flex-direction: column;
  342 + align-items: center;
  343 + color: #C36607;
  344 + margin-top: 10rpx;
  345 +}
  346 +
  347 +.preferentialCoupon .grantNum text {
  348 + color: #F6231B;
  349 + margin-right: 10rpx;
  350 +}
  351 +
  352 +.preferentialCoupon .btns text {
  353 + font-weight: 600;
  354 +}
  355 +
  356 +.preferentialCoupon .orderingFood1 {
  357 + border: 2rpx solid #fa4b20 !important;
  358 + background: transparent !important;
  359 + color: #fa4b20 !important;
  360 +}
  361 +
  362 +.preferentialCoupon .btns text {
  363 + color: #0B0805 !important;
  364 +}
  365 +
  366 +.preferentialCoupon .bottom {
  367 + margin-top: 4rpx;
  368 + width: 100%;
  369 + color: #C36607 !important;
  370 + font-family: PingFang SC;
  371 + font-weight: 500;
  372 + display: -webkit-box;
  373 + word-break: break-all;
  374 + word-wrap: break-word;
  375 + overflow: hidden;
  376 + text-align: left;
  377 +}
  378 +
  379 +.preferentialCoupon .nodate{
  380 + margin-left: 20rpx;
  381 +}
  382 +
284 .preferentialItems { 383 .preferentialItems {
285 display: flex; 384 display: flex;
286 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat; 385 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
287 background-size: 100% 100%; 386 background-size: 100% 100%;
288 margin-bottom: 20rpx; 387 margin-bottom: 20rpx;
289 min-height: 160rpx; 388 min-height: 160rpx;
290 padding-bottom: 10rpx; 389 padding-bottom: 10rpx;
  390 + border-radius: 20rpx;
  391 + border: 2rpx solid #ff7e06;
291 } 392 }
292 393
293 .rechargeItems { 394 .rechargeItems {
@@ -300,6 +401,7 @@ @@ -300,6 +401,7 @@
300 height: auto; 401 height: auto;
301 padding: 12rpx 0; 402 padding: 12rpx 0;
302 margin: 0 20rpx; 403 margin: 0 20rpx;
  404 + border: none;
303 } 405 }
304 406
305 .rechargeItems .orderingFood { 407 .rechargeItems .orderingFood {
@@ -341,6 +443,20 @@ @@ -341,6 +443,20 @@
341 top: 12rpx; 443 top: 12rpx;
342 } 444 }
343 445
  446 +.discountText1{
  447 + text-align: center;
  448 + color: #FD4D59;
  449 + border: 2rpx solid #FD4D59;
  450 + border-radius: 6rpx;
  451 + font-family: PingFang SC;
  452 + background: transparent;
  453 + width: max-content;
  454 + padding: 0 6rpx;
  455 + position: absolute;
  456 + left: 16rpx;
  457 + top: 12rpx;
  458 +}
  459 +
344 .famousChefBox .labelBox, 460 .famousChefBox .labelBox,
345 .stopBox .labelBox { 461 .stopBox .labelBox {
346 border-bottom: none; 462 border-bottom: none;
@@ -433,9 +549,7 @@ @@ -433,9 +549,7 @@
433 } 549 }
434 550
435 .priceText .icons { 551 .priceText .icons {
436 - font-family: 'Abel';  
437 color: #FD4D59; 552 color: #FD4D59;
438 - font-size: 40rpx;  
439 } 553 }
440 554
441 .itemRight { 555 .itemRight {
@@ -449,10 +563,7 @@ @@ -449,10 +563,7 @@
449 display: flex; 563 display: flex;
450 justify-content: space-between; 564 justify-content: space-between;
451 align-items: baseline; 565 align-items: baseline;
452 -}  
453 -  
454 -.btns text {  
455 - color: #0B0805; 566 + flex-direction: column;
456 } 567 }
457 568
458 .priceText { 569 .priceText {
@@ -709,6 +820,145 @@ @@ -709,6 +820,145 @@
709 box-sizing: border-box; 820 box-sizing: border-box;
710 } 821 }
711 822
  823 +#couponModal .titleModal {
  824 + margin-top: 30%;
  825 + position: relative;
  826 +}
  827 +
  828 +#couponModal .titleModal2 {
  829 + margin-top: 80%;
  830 +}
  831 +
  832 +#couponModal .titleModal3 {
  833 + margin-top: 60%;
  834 +}
  835 +
  836 +#couponModal .titleModal4 {
  837 + margin-top: 30%;
  838 +}
  839 +
  840 +#couponModal .mymodal {
  841 + background: rgba(0, 0, 0, 0.8);
  842 + width: 100% !important;
  843 + top: 0 !important;
  844 + height: auto !important;
  845 + z-index: 300;
  846 +}
  847 +
  848 +.nameInfo {
  849 + font-family: PingFang SC;
  850 + font-weight: 400;
  851 + font-size: 52rpx;
  852 + line-height: 56rpx;
  853 + color: #fff;
  854 + margin-bottom: 40rpx;
  855 + padding-top: 60rpx;
  856 +}
  857 +
  858 +.couponTotal {
  859 + color: #dfdfdf;
  860 + font-family: PingFang SC;
  861 + font-weight: 400;
  862 + font-size: 40rpx;
  863 + line-height: 48rpx;
  864 + margin-bottom: 40rpx;
  865 + display: flex;
  866 + align-items: center;
  867 + justify-content: center;
  868 +}
  869 +
  870 +.couponTotal text {
  871 + color: #ffc806;
  872 + font-weight: 600;
  873 + font-size: 80rpx;
  874 + margin: 0 14rpx;
  875 +}
  876 +
  877 +.couponBox {
  878 + width: 80%;
  879 + margin: 0 auto;
  880 + display: flex;
  881 + flex-wrap: wrap;
  882 + justify-content: space-evenly;
  883 +}
  884 +
  885 +.couponItems {
  886 + width: 46%;
  887 + margin-bottom: 24rpx;
  888 + padding-bottom: 52rpx;
  889 + border-radius: 20rpx;
  890 + border: 2rpx solid #ff7e06;
  891 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  892 +}
  893 +
  894 +.couponNum {
  895 + background: #727272;
  896 + border-radius: 50%;
  897 + color: #fff;
  898 + width: 40rpx;
  899 + height: 40rpx;
  900 + display: flex;
  901 + align-items: center;
  902 + justify-content: center;
  903 + margin: 8rpx 0 0 8rpx;
  904 +}
  905 +
  906 +.couponPrice {
  907 + display: flex;
  908 + align-items: center;
  909 + justify-content: center;
  910 + color: #F6231B;
  911 + font-weight: 500;
  912 +}
  913 +
  914 +.couponLines{
  915 + width: 80%;
  916 + margin: 0 auto;
  917 + height: 2rpx;
  918 + border-bottom: 2rpx dashed #F6231B;
  919 +}
  920 +
  921 +.couponPrice text {
  922 + margin-left: 4rpx;
  923 + font-size: 76rpx;
  924 + font-weight: 700;
  925 +}
  926 +
  927 +.couponCondition {
  928 + color: #C36607;
  929 + display: flex;
  930 + align-items: center;
  931 + justify-content: center;
  932 + padding-top: 24rpx;
  933 +}
  934 +
  935 +.couponBtn {
  936 + width: 80%;
  937 + margin: 0 auto;
  938 + border-radius: 42rpx;
  939 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  940 + font-weight: 400;
  941 + color: #fff;
  942 + text-align: center;
  943 + border: 4rpx solid #fff;
  944 + padding: 12rpx 0;
  945 + margin: 16rpx auto 20rpx auto;
  946 +}
  947 +
  948 +.couponText {
  949 + color: #fff;
  950 + text-decoration: underline;
  951 + text-align: center;
  952 +}
  953 +
  954 +.closeImg {
  955 + width: 60rpx;
  956 + height: 60rpx;
  957 + position: absolute;
  958 + right: 0;
  959 + top: 0;
  960 +}
  961 +
712 /* 深中国红 */ 962 /* 深中国红 */
713 .crimson, 963 .crimson,
714 .crimson .positioningBox { 964 .crimson .positioningBox {
@@ -1041,14 +1291,6 @@ @@ -1041,14 +1291,6 @@
1041 color: #578C69; 1291 color: #578C69;
1042 } 1292 }
1043 1293
1044 -.pearlWhite .preferentialItems {  
1045 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
1046 - background-size: 100% 100%;  
1047 - margin-bottom: 20rpx;  
1048 - min-height: 160rpx;  
1049 - padding-bottom: 10rpx;  
1050 -}  
1051 -  
1052 .pearlWhite .rechargeItems { 1294 .pearlWhite .rechargeItems {
1053 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat; 1295 background: url(https://nosqn.colorcun.com/certificateWhiteBj2.png) no-repeat;
1054 background-size: 100% 100%; 1296 background-size: 100% 100%;
@@ -1117,12 +1359,6 @@ @@ -1117,12 +1359,6 @@
1117 border: none; 1359 border: none;
1118 } 1360 }
1119 1361
1120 -.pearlWhite .discountText {  
1121 - background: transparent;  
1122 - border: 2rpx solid #FD4D59;  
1123 - color: #FD4D59;  
1124 -}  
1125 -  
1126 .toastBox { 1362 .toastBox {
1127 width: fit-content; 1363 width: fit-content;
1128 position: fixed; 1364 position: fixed;
@@ -66,6 +66,7 @@ Page({ @@ -66,6 +66,7 @@ Page({
66 isMoreBtn:'',//再次预订按钮 66 isMoreBtn:'',//再次预订按钮
67 isPaymenBtn:'',//支付定金按钮 67 isPaymenBtn:'',//支付定金按钮
68 isShareItem:'',//转发客人按钮 68 isShareItem:'',//转发客人按钮
  69 + couponArr: [],//待领取的优惠券列表
69 }, 70 },
70 tablestr: '', 71 tablestr: '',
71 urlsValue: [], 72 urlsValue: [],
@@ -75,6 +76,7 @@ Page({ @@ -75,6 +76,7 @@ Page({
75 timers: null, // 动画定时器 76 timers: null, // 动画定时器
76 n: 0, 77 n: 0,
77 modal:'', 78 modal:'',
  79 + couponModal: '',
78 /** 80 /**
79 * 生命周期函数--监听页面加载 81 * 生命周期函数--监听页面加载
80 */ 82 */
@@ -102,6 +104,7 @@ Page({ @@ -102,6 +104,7 @@ Page({
102 wx.onUserCaptureScreen((res)=> { 104 wx.onUserCaptureScreen((res)=> {
103 this.showModal() 105 this.showModal()
104 }) 106 })
  107 + this.couponModal = this.selectComponent("#couponModal");
105 }, 108 },
106 // 打开截屏弹框 109 // 打开截屏弹框
107 showModal() { 110 showModal() {
@@ -111,6 +114,10 @@ Page({ @@ -111,6 +114,10 @@ Page({
111 closeModal() { 114 closeModal() {
112 this.modal.closeModal() 115 this.modal.closeModal()
113 }, 116 },
  117 + // 关闭优惠券弹框
  118 + closeCouponModal() {
  119 + this.couponModal.closeModal()
  120 + },
114 // 页面滚动事件 121 // 页面滚动事件
115 onPageScroll: function (event) { 122 onPageScroll: function (event) {
116 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离 123 const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
@@ -455,9 +462,10 @@ Page({ @@ -455,9 +462,10 @@ Page({
455 uid 462 uid
456 }).then((json) => { 463 }).then((json) => {
457 if (json.ret == 200) { 464 if (json.ret == 200) {
458 - console.log('staffinfostaffinfostaffinfo', json.data) 465 + console.log('客户经理获取基本信息------', json.data)
459 this.setData({ 466 this.setData({
460 - staffinfo: json.data 467 + staffinfo: json.data,
  468 + couponArr:[],
461 }) 469 })
462 this.getSellerTemplateConfFun(sid); 470 this.getSellerTemplateConfFun(sid);
463 } 471 }
@@ -578,7 +586,7 @@ Page({ @@ -578,7 +586,7 @@ Page({
578 let data = res.data 586 let data = res.data
579 console.log('data', data); 587 console.log('data', data);
580 let couponList = [] 588 let couponList = []
581 - let themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store; 589 + let themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
582 chef = util.determine(data.chef); 590 chef = util.determine(data.chef);
583 reserve = util.determine(data.reserve); 591 reserve = util.determine(data.reserve);
584 marketing = util.determine(data.marketing); 592 marketing = util.determine(data.marketing);
@@ -597,29 +605,23 @@ Page({ @@ -597,29 +605,23 @@ Page({
597 if (marketing) { 605 if (marketing) {
598 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : ''; 606 marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
599 is_comments = marketing.is_comments ? marketing.is_comments : ''; 607 is_comments = marketing.is_comments ? marketing.is_comments : '';
600 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 608 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  609 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  610 + marketing.coupon_data_payList = coupon_data_pay
  611 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  612 + marketing.coupon_data_freeList = coupon_data_free
601 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 613 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
602 let couponDataId = info && info.length > 0 ? info[0].id : {} 614 let couponDataId = info && info.length > 0 ? info[0].id : {}
603 // 根据券ID获取评价赠送的券详情 615 // 根据券ID获取评价赠送的券详情
604 if(couponDataId) this.getEvaluateFun(couponDataId) 616 if(couponDataId) this.getEvaluateFun(couponDataId)
605 } 617 }
606 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 618 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
607 - if (coupon && util.getType(coupon) == 'object') {  
608 - couponList.push({  
609 - id: coupon.id  
610 - });  
611 - }  
612 - if (coupon && util.getType(coupon) == 'array') {  
613 - if (coupon.length > 0) {  
614 - coupon.forEach(item => {  
615 - couponList.push({  
616 - id: item.id  
617 - })  
618 - })  
619 - }  
620 - } 619 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  620 + couponList = this.addCoupons(coupon,couponList);
  621 + couponList = this.addCoupons(coupon_data_pay,couponList);
  622 + couponList = this.addCoupons(coupon_data_free,couponList);
621 // 根据券ID获取券详情 623 // 根据券ID获取券详情
622 - this.getActivityByIdFun(couponList, couponList.length) 624 + this.getActivityByIdFun(couponList)
623 // 根据充值ID获取充值详情 625 // 根据充值ID获取充值详情
624 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { 626 if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
625 this.getRechargeDetail(marketing.recharge_data.id) 627 this.getRechargeDetail(marketing.recharge_data.id)
@@ -696,9 +698,12 @@ Page({ @@ -696,9 +698,12 @@ Page({
696 }) 698 })
697 }, 699 },
698 // 点击商家有礼 700 // 点击商家有礼
699 - gotoSellerGift(){  
700 - let url = util.http_build_query({ 701 + gotoSellerGift(e){
  702 + this.couponModal.closeModal()
  703 + const form = e.currentTarget.dataset['form'];
  704 + let url = util.http_build_query({
701 id: this.data.detail.id, 705 id: this.data.detail.id,
  706 + form
702 }, '/pages/reserve/sellerGift') 707 }, '/pages/reserve/sellerGift')
703 wx.navigateTo({ 708 wx.navigateTo({
704 url 709 url
@@ -855,35 +860,173 @@ Page({ @@ -855,35 +860,173 @@ Page({
855 } 860 }
856 }) 861 })
857 }, 862 },
858 - // 根据券ID获取券详情  
859 - getActivityByIdFun(ids, length) {  
860 - let coupon_dataList = [];  
861 - ids.forEach(i => {  
862 - App.Activity.GetActivityById({  
863 - id: i.id  
864 - }).then(res => {  
865 - if (res.data.length > 0) {  
866 - let detail = res.data[0];  
867 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
868 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
869 - detail.use = detail.use ? util.determine(detail.use) : '';  
870 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
871 - let cash = detail.use.cash * 1;  
872 - let price = detail.price * 1;  
873 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
874 - }  
875 - coupon_dataList.push(detail);  
876 - if (length === coupon_dataList.length) {  
877 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
878 - console.log('邀请函--------------------优惠券',coupon_dataList);  
879 - this.setData({  
880 - coupon_dataList,  
881 - })  
882 - }  
883 - }  
884 - })  
885 - })  
886 - }, 863 + // 根据券ID获取券详情
  864 + getActivityByIdFun(obj) {
  865 + App.Activity.GetActivityById({
  866 + id: obj.map(item => item.id).join(','),
  867 + }).then(res => {
  868 + if (res.data.length > 0) {
  869 + let list = res.data.filter(item => {
  870 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  871 + })
  872 + list.forEach(detail => {
  873 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  874 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  875 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  876 + detail.use = detail.use ? util.determine(detail.use) : '';
  877 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  878 + let cash = detail.use.cash * 1;
  879 + let price = detail.price * 1;
  880 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  881 + }
  882 + let num = detail.receiveNum;
  883 + if (num > 0) {
  884 + detail.receiveNumText = ''
  885 + if (num >= 0 && num <= 100) {
  886 + detail.receiveNumText = num.toString();
  887 + } else if (num >= 101 && num <= 199) {
  888 + detail.receiveNumText = '100+';
  889 + } else if (num >= 200 && num <= 299) {
  890 + detail.receiveNumText = '200+';
  891 + } else {
  892 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  893 + }
  894 + }
  895 + if (detail.exp_date && detail.exp_date.week_data) {
  896 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  897 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  898 + if (noon) noon = '午餐:' + noon
  899 + if (nig) nig = '晚餐:' + nig
  900 + detail.noonText = noon;
  901 + detail.nigText = nig;
  902 + }
  903 + })
  904 + let freeCoupons = list.filter(item => {
  905 + return item.is_type == '3'
  906 + })
  907 + // 免费券判断是否领取,弹框领取
  908 + if (freeCoupons.length > 0) {
  909 + let length = freeCoupons.length - 1
  910 + freeCoupons.forEach(i => {
  911 + this.getCoupon(i, freeCoupons[length].id, obj)
  912 + })
  913 + }
  914 + console.log('邀请函--------------------优惠券', list);
  915 + this.setData({
  916 + coupon_dataList: list,
  917 + })
  918 + }
  919 + })
  920 + },
  921 + // 获取所有的券并且展示
  922 + addCoupons(coupons, couponList) {
  923 + if (coupons && util.getType(coupons) == 'object') {
  924 + couponList.push({
  925 + id: coupon.id,
  926 + number: coupon.number
  927 + });
  928 + }
  929 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  930 + coupons.forEach(item => {
  931 + couponList.push({
  932 + id: item.id,
  933 + number: item.number
  934 + });
  935 + });
  936 + }
  937 + return couponList
  938 + },
  939 + // 弹框领取免费券
  940 + setcouponFun(arr) {
  941 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  942 + console.log('弹框领取免费券id', str);
  943 + App.Activity.SetActivityAsReserve({
  944 + aid: str,
  945 + rid: this.id,
  946 + }).then((json) => {
  947 + if (json.ret != 200) {
  948 + wx.showToast({
  949 + title: res.msg,
  950 + duration: 2000,
  951 + mask: true
  952 + })
  953 + }
  954 + })
  955 + },
  956 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  957 + getCoupon(item, id, obj) {
  958 + let couponArr = this.data.couponArr;
  959 + let totalPrice = this.data.totalPrice;
  960 + App.Activity.ActivityListByOpenid({
  961 + aid: item.id
  962 + }).then(res => {
  963 + if (res.ret == 200) {
  964 + if (res.data.length == 0) {
  965 + couponArr.push(item)
  966 + }
  967 + if (item.id == id && couponArr.length > 0) {
  968 + couponArr.forEach(item => {
  969 + let match = obj.find(b => b.id === item.id);
  970 + if (match) {
  971 + item.number = match.number;
  972 + }
  973 + });
  974 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  975 + this.setcouponFun(couponArr)
  976 + this.couponModal.showModal()
  977 + }
  978 + console.log('未领取的券列表-----------', couponArr);
  979 + this.setData({
  980 + couponArr,
  981 + totalPrice
  982 + })
  983 + }
  984 + })
  985 + },
  986 + // 处理优惠券不可用日期数据
  987 + hasConsecutiveSelect(arr, type) {
  988 + let firstTitle = null;
  989 + let lastTitle = null;
  990 + let rArr = []
  991 + let num = 0
  992 + for (let i = 0; i < arr.length; i++) {
  993 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  994 + if (str) {
  995 + rArr.push(arr[i].title)
  996 + num++
  997 + if (num == 1) {
  998 + firstTitle = arr[i].title
  999 + }
  1000 + if (num >= 5) {
  1001 + lastTitle = arr[i].title
  1002 + }
  1003 + if (num >= 5 && i >= (arr.length - 1)) {
  1004 + let fi = rArr.findIndex((item) => {
  1005 + return item == firstTitle
  1006 + })
  1007 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1008 + num = 0
  1009 + }
  1010 + } else {
  1011 + if (num < 5) {
  1012 + num = 0
  1013 + firstTitle = null;
  1014 + lastTitle = null;
  1015 + } else {
  1016 + let fi = rArr.findIndex((item) => {
  1017 + return item == firstTitle
  1018 + })
  1019 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1020 + num = 0
  1021 + }
  1022 + }
  1023 + }
  1024 + return {
  1025 + rArr,
  1026 + lastTitle,
  1027 + firstTitle
  1028 + };
  1029 + },
887 /** 1030 /**
888 * 生命周期函数--监听页面隐藏 1031 * 生命周期函数--监听页面隐藏
889 */ 1032 */
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
  14 + data-form="1"
14 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 15 wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 16 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 17 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
@@ -82,29 +83,49 @@ @@ -82,29 +83,49 @@
82 </button> 83 </button>
83 </view> 84 </view>
84 </view> 85 </view>
85 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 86 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
86 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 87 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
87 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 88 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
88 <view class="preferentialItems"> 89 <view class="preferentialItems">
89 <view class="itemLeft"> 90 <view class="itemLeft">
90 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 91 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  92 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
91 <view class="priceText" wx:if="{{item.price}}"> 93 <view class="priceText" wx:if="{{item.price}}">
92 - <view class="icons font40r">¥</view>{{item.price}} 94 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
93 </view> 95 </view>
  96 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
94 </view> 97 </view>
  98 + <view class="couponLine"></view>
95 <view class="itemRight"> 99 <view class="itemRight">
96 <view class="btns"> 100 <view class="btns">
97 <text class="font40r">{{item.aname}}</text> 101 <text class="font40r">{{item.aname}}</text>
98 - <view class="font24r orderingFood">  
99 - 抢购  
100 - </view> 102 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  103 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  104 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  105 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  106 + </view>
  107 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  108 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  109 + </view>
  110 + </block>
  111 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  112 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  113 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  114 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  115 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  116 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  117 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  118 + </block>
101 </view> 119 </view>
102 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
103 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
104 - 无限制{{item.desc?','+item.desc+'。':'。'}} 120 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  121 + <view class="font24r orderingFood orderingFood1">已领取</view>
  122 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  123 + <view class="font24r">已被领取</view>
  124 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  125 + </view>
105 </view> 126 </view>
106 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
107 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 127 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  128 + 立即抢购
108 </view> 129 </view>
109 </view> 130 </view>
110 </view> 131 </view>
@@ -324,4 +345,25 @@ @@ -324,4 +345,25 @@
324 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 345 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
325 </view> 346 </view>
326 </view> 347 </view>
  348 +</my-modal>
  349 +
  350 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  351 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  352 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  353 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  354 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  355 + </view>
  356 + <view slot="modalContent">
  357 + <view class="couponBox">
  358 + <view wx:for="{{couponArr}}" class="couponItems">
  359 + <view class="couponNum font20r">×{{item.number}}</view>
  360 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  361 + <view class="couponLines"></view>
  362 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  363 + <view class="font28r couponCondition" wx:else>无门槛</view>
  364 + </view>
  365 + </view>
  366 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  367 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  368 + </view>
327 </my-modal> 369 </my-modal>
@@ -289,13 +289,101 @@ @@ -289,13 +289,101 @@
289 flex-shrink: 0; 289 flex-shrink: 0;
290 } 290 }
291 291
  292 +.preferentialCoupon .itemRight {
  293 + width: 74%;
  294 + display: flex;
  295 + align-items: center;
  296 +}
  297 +
  298 +.preferentialCoupon .itemLeft {
  299 + width: 26%;
  300 +}
  301 +
  302 +.preferentialCoupon .couponLine{
  303 + margin: 24rpx 0;
  304 + border-right: 2rpx dashed #f6231b;
  305 +}
  306 +
  307 +.preferentialCoupon .orderingFood {
  308 + padding: 0 20rpx;
  309 + color: #fff !important;
  310 + border: none !important;
  311 + text-align: center;
  312 + border-radius: 20rpx;
  313 + line-height: 44rpx;
  314 + height: 44rpx;
  315 + width: max-content;
  316 + flex-shrink: 0;
  317 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  318 +}
  319 +.preferentialCoupon .icons {
  320 + color: #F6231B;
  321 + text-align: center;
  322 +}
  323 +
  324 +.preferentialCoupon .priceText {
  325 + display: flex;
  326 + align-items: baseline;
  327 + justify-content: center;
  328 + font-family: PingFang SC;
  329 + color: #F6231B;
  330 + font-weight: 600;
  331 + font-size: 48rpx;
  332 + margin-top: 6rpx;
  333 +}
  334 +
  335 +.preferentialCoupon .priceText text {
  336 + font-size: 48rpx;
  337 +}
  338 +
  339 +.preferentialCoupon .btns {
  340 + flex: 1;
  341 +}
  342 +.preferentialCoupon .btnBox {
  343 + display: flex;
  344 + flex-direction: column;
  345 +}
  346 +
  347 +.preferentialCoupon .grantNum {
  348 + display: flex;
  349 + flex-direction: column;
  350 + align-items: center;
  351 + color: #C36607;
  352 + margin-top: 10rpx;
  353 +}
  354 +
  355 +.preferentialCoupon .grantNum text {
  356 + color: #F6231B;
  357 + margin-right: 10rpx;
  358 +}
  359 +
  360 +.preferentialCoupon .btns text {
  361 + font-weight: 600;
  362 +}
  363 +
  364 +.preferentialCoupon .orderingFood1 {
  365 + border: 2rpx solid #fa4b20 !important;
  366 + background: transparent !important;
  367 + color: #fa4b20 !important;
  368 +}
  369 +
  370 +.preferentialCoupon .bottom {
  371 + color: #C36607 !important;
  372 +}
  373 +
  374 +.preferentialCoupon .nodate{
  375 + margin-left: 20rpx;
  376 +}
  377 +
292 .preferentialItems { 378 .preferentialItems {
293 display: flex; 379 display: flex;
294 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat; 380 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
295 background-size: 100% 100%; 381 background-size: 100% 100%;
296 margin-bottom: 20rpx; 382 margin-bottom: 20rpx;
297 min-height: 160rpx; 383 min-height: 160rpx;
298 padding-bottom: 10rpx; 384 padding-bottom: 10rpx;
  385 + border-radius: 20rpx;
  386 + border: 2rpx solid #ff7e06;
299 } 387 }
300 388
301 .rechargeItems { 389 .rechargeItems {
@@ -308,6 +396,7 @@ @@ -308,6 +396,7 @@
308 height: auto; 396 height: auto;
309 padding: 12rpx 0; 397 padding: 12rpx 0;
310 margin: 0 20rpx; 398 margin: 0 20rpx;
  399 + border: none;
311 } 400 }
312 401
313 .rechargeItems .orderingFood { 402 .rechargeItems .orderingFood {
@@ -349,6 +438,20 @@ @@ -349,6 +438,20 @@
349 top: 12rpx; 438 top: 12rpx;
350 } 439 }
351 440
  441 +.discountText1{
  442 + text-align: center;
  443 + color: #FD4D59;
  444 + border: 2rpx solid #FD4D59;
  445 + border-radius: 6rpx;
  446 + font-family: PingFang SC;
  447 + background: transparent;
  448 + width: max-content;
  449 + padding: 0 6rpx;
  450 + position: absolute;
  451 + left: 16rpx;
  452 + top: 12rpx;
  453 +}
  454 +
352 .famousChefBox .labelBox, 455 .famousChefBox .labelBox,
353 .stopBox .labelBox { 456 .stopBox .labelBox {
354 border-bottom: none; 457 border-bottom: none;
@@ -442,9 +545,7 @@ @@ -442,9 +545,7 @@
442 } 545 }
443 546
444 .priceText .icons { 547 .priceText .icons {
445 - font-family: 'Abel';  
446 color: #FD4D59; 548 color: #FD4D59;
447 - font-size: 40rpx;  
448 } 549 }
449 550
450 .itemRight { 551 .itemRight {
@@ -458,6 +559,7 @@ @@ -458,6 +559,7 @@
458 display: flex; 559 display: flex;
459 justify-content: space-between; 560 justify-content: space-between;
460 align-items: baseline; 561 align-items: baseline;
  562 + flex-direction: column;
461 } 563 }
462 564
463 .btns text { 565 .btns text {
@@ -718,6 +820,145 @@ @@ -718,6 +820,145 @@
718 box-sizing: border-box; 820 box-sizing: border-box;
719 } 821 }
720 822
  823 +#couponModal .titleModal {
  824 + margin-top: 30%;
  825 + position: relative;
  826 +}
  827 +
  828 +#couponModal .titleModal2 {
  829 + margin-top: 80%;
  830 +}
  831 +
  832 +#couponModal .titleModal3 {
  833 + margin-top: 60%;
  834 +}
  835 +
  836 +#couponModal .titleModal4 {
  837 + margin-top: 30%;
  838 +}
  839 +
  840 +#couponModal .mymodal {
  841 + background: rgba(0, 0, 0, 0.8);
  842 + width: 100% !important;
  843 + top: 0 !important;
  844 + height: auto !important;
  845 + z-index: 300;
  846 +}
  847 +
  848 +.nameInfo {
  849 + font-family: PingFang SC;
  850 + font-weight: 400;
  851 + font-size: 52rpx;
  852 + line-height: 56rpx;
  853 + color: #fff;
  854 + margin-bottom: 40rpx;
  855 + padding-top: 60rpx;
  856 +}
  857 +
  858 +.couponTotal {
  859 + color: #dfdfdf;
  860 + font-family: PingFang SC;
  861 + font-weight: 400;
  862 + font-size: 40rpx;
  863 + line-height: 48rpx;
  864 + margin-bottom: 40rpx;
  865 + display: flex;
  866 + align-items: center;
  867 + justify-content: center;
  868 +}
  869 +
  870 +.couponTotal text {
  871 + color: #ffc806;
  872 + font-weight: 600;
  873 + font-size: 80rpx;
  874 + margin: 0 14rpx;
  875 +}
  876 +
  877 +.couponBox {
  878 + width: 80%;
  879 + margin: 0 auto;
  880 + display: flex;
  881 + flex-wrap: wrap;
  882 + justify-content: space-evenly;
  883 +}
  884 +
  885 +.couponItems {
  886 + width: 46%;
  887 + margin-bottom: 24rpx;
  888 + padding-bottom: 52rpx;
  889 + border-radius: 20rpx;
  890 + border: 2rpx solid #ff7e06;
  891 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  892 +}
  893 +
  894 +.couponNum {
  895 + background: #727272;
  896 + border-radius: 50%;
  897 + color: #fff;
  898 + width: 40rpx;
  899 + height: 40rpx;
  900 + display: flex;
  901 + align-items: center;
  902 + justify-content: center;
  903 + margin: 8rpx 0 0 8rpx;
  904 +}
  905 +
  906 +.couponPrice {
  907 + display: flex;
  908 + align-items: center;
  909 + justify-content: center;
  910 + color: #F6231B;
  911 + font-weight: 500;
  912 +}
  913 +
  914 +.couponLines{
  915 + width: 80%;
  916 + margin: 0 auto;
  917 + height: 2rpx;
  918 + border-bottom: 2rpx dashed #F6231B;
  919 +}
  920 +
  921 +.couponPrice text {
  922 + margin-left: 4rpx;
  923 + font-size: 76rpx;
  924 + font-weight: 700;
  925 +}
  926 +
  927 +.couponCondition {
  928 + color: #C36607;
  929 + display: flex;
  930 + align-items: center;
  931 + justify-content: center;
  932 + padding-top: 24rpx;
  933 +}
  934 +
  935 +.couponBtn {
  936 + width: 80%;
  937 + margin: 0 auto;
  938 + border-radius: 42rpx;
  939 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  940 + font-weight: 400;
  941 + color: #fff;
  942 + text-align: center;
  943 + border: 4rpx solid #fff;
  944 + padding: 12rpx 0;
  945 + margin: 16rpx auto 20rpx auto;
  946 +}
  947 +
  948 +.couponText {
  949 + color: #fff;
  950 + text-decoration: underline;
  951 + text-align: center;
  952 +}
  953 +
  954 +.closeImg {
  955 + width: 60rpx;
  956 + height: 60rpx;
  957 + position: absolute;
  958 + right: 0;
  959 + top: 0;
  960 +}
  961 +
721 /* 深中国红 */ 962 /* 深中国红 */
722 .crimson, 963 .crimson,
723 .crimson .positioningBox { 964 .crimson .positioningBox {
@@ -1049,8 +1290,6 @@ @@ -1049,8 +1290,6 @@
1049 } 1290 }
1050 1291
1051 .pearlWhite .preferentialItems { 1292 .pearlWhite .preferentialItems {
1052 - background: url(https://nosqn.colorcun.com/certificateWhiteBj1.png) no-repeat;  
1053 - background-size: 100% 100%;  
1054 margin-bottom: 20rpx; 1293 margin-bottom: 20rpx;
1055 min-height: 160rpx; 1294 min-height: 160rpx;
1056 padding-bottom: 10rpx; 1295 padding-bottom: 10rpx;
@@ -1071,7 +1310,6 @@ @@ -1071,7 +1310,6 @@
1071 .pearlWhite .positioningName, 1310 .pearlWhite .positioningName,
1072 .pearlWhite .rubric, 1311 .pearlWhite .rubric,
1073 .pearlWhite .contentData, 1312 .pearlWhite .contentData,
1074 -.pearlWhite .btns text,  
1075 .pearlWhite .itemRight .bottom, 1313 .pearlWhite .itemRight .bottom,
1076 .pearlWhite .evaluateBox text, 1314 .pearlWhite .evaluateBox text,
1077 .pearlWhite .labelBox .texts, 1315 .pearlWhite .labelBox .texts,
@@ -1134,12 +1372,6 @@ @@ -1134,12 +1372,6 @@
1134 border: none; 1372 border: none;
1135 } 1373 }
1136 1374
1137 -.pearlWhite .discountText {  
1138 - background: transparent;  
1139 - border: 2rpx solid #FD4D59;  
1140 - color: #FD4D59;  
1141 -}  
1142 -  
1143 .toastBox { 1375 .toastBox {
1144 width: fit-content; 1376 width: fit-content;
1145 position: fixed; 1377 position: fixed;
@@ -7,65 +7,65 @@ import RS from '../../utils/reserveStatus' @@ -7,65 +7,65 @@ import RS from '../../utils/reserveStatus'
7 var plugin = requirePlugin("WechatSI"); 7 var plugin = requirePlugin("WechatSI");
8 import canvas from "../../pages/customer/canvas" 8 import canvas from "../../pages/customer/canvas"
9 Page({ 9 Page({
10 - /**  
11 - * 页面的初始数据  
12 - */  
13 - data: { 10 + /**
  11 + * 页面的初始数据
  12 + */
  13 + data: {
14 show_white:false, 14 show_white:false,
15 - options: {  
16 - tplid: ''  
17 - },  
18 - tableNum: 0,  
19 - detail: {},  
20 - staffinfo: {},  
21 - chef: {},  
22 - marketing: {},  
23 - home: {},  
24 - reserve: {},  
25 - signboard: {},  
26 - store: {},  
27 - recharge_data: {},  
28 - coupon_dataList: [],  
29 - current: 0,  
30 - seller: {  
31 - name: '',  
32 - tablesText: '',  
33 - date: '',  
34 - addr: ''  
35 - },  
36 - priceInfo: '',  
37 - scoreInfo: '',  
38 - discount: '',  
39 - certificate: '',  
40 - dataStr: Date.now() * 1 / 1000,  
41 - swich_phone: '0',  
42 - is_comments: '0',  
43 - is_user_comments: false,  
44 - tableinfo: [],  
45 - roomimage: [],  
46 - StyleType: '',  
47 - showMoreTip: true,  
48 - settingUrl: '',  
49 - inviteImgUrl: '',  
50 - themeColor: '',  
51 - screenHeight: '',  
52 - hasValueOrder: false, //商家是否开通提前点餐功能  
53 - hasValueCertificate: false, //商家是否开通优惠券功能  
54 - hasValueRecharge: false, //商家是否开通充值功能  
55 - hasValueBroadcast: false, //商家是否能播报,只有极速版不能播报  
56 - _attentionAnim: {},  
57 - isPlay: '1',  
58 - titleType: '', //标题样式  
59 - num1: [1, 2, 3, 4, 5, 6, 7, 8],  
60 - num2: [8, 7, 6, 5, 4, 3, 2, 1],  
61 - titleType: '', //标题样式  
62 - paymentStatus: '', //定金支付状态 1支付 0未支付  
63 - reserveData: {}, //自定义图文数据  
64 - toastBool: false, //支付定金提示框  
65 - toastText: '', //支付定金提示文字  
66 - paymentId: '', //定金id  
67 - wxml: null,  
68 - imgSrc: '', //canvas图片地址 15 + options: {
  16 + tplid: ''
  17 + },
  18 + tableNum: 0,
  19 + detail: {},
  20 + staffinfo: {},
  21 + chef: {},
  22 + marketing: {},
  23 + home: {},
  24 + reserve: {},
  25 + signboard: {},
  26 + store: {},
  27 + recharge_data: {},
  28 + coupon_dataList: [],
  29 + current: 0,
  30 + seller: {
  31 + name: '',
  32 + tablesText: '',
  33 + date: '',
  34 + addr: ''
  35 + },
  36 + priceInfo: '',
  37 + scoreInfo: '',
  38 + discount: '',
  39 + certificate: '',
  40 + dataStr: Date.now() * 1 / 1000,
  41 + swich_phone: '0',
  42 + is_comments: '0',
  43 + is_user_comments: false,
  44 + tableinfo: [],
  45 + roomimage: [],
  46 + StyleType: '',
  47 + showMoreTip: true,
  48 + settingUrl: '',
  49 + inviteImgUrl: '',
  50 + themeColor: '',
  51 + screenHeight: '',
  52 + hasValueOrder: false, //商家是否开通提前点餐功能
  53 + hasValueCertificate: false, //商家是否开通优惠券功能
  54 + hasValueRecharge: false, //商家是否开通充值功能
  55 + hasValueBroadcast: false, //商家是否能播报,只有极速版不能播报
  56 + _attentionAnim: {},
  57 + isPlay: '1',
  58 + titleType: '', //标题样式
  59 + num1: [1, 2, 3, 4, 5, 6, 7, 8],
  60 + num2: [8, 7, 6, 5, 4, 3, 2, 1],
  61 + titleType: '', //标题样式
  62 + paymentStatus: '', //定金支付状态 1支付 0未支付
  63 + reserveData: {}, //自定义图文数据
  64 + toastBool: false, //支付定金提示框
  65 + toastText: '', //支付定金提示文字
  66 + paymentId: '', //定金id
  67 + wxml: null,
  68 + imgSrc: '', //canvas图片地址
69 colors:'',//导航栏颜色 69 colors:'',//导航栏颜色
70 couponData: '', //评价赠送优惠券数据 70 couponData: '', //评价赠送优惠券数据
71 timeList: [], 71 timeList: [],
@@ -74,42 +74,45 @@ Page({ @@ -74,42 +74,45 @@ Page({
74 isMoreBtn:'',//再次预订按钮 74 isMoreBtn:'',//再次预订按钮
75 isPaymenBtn:'',//支付定金按钮 75 isPaymenBtn:'',//支付定金按钮
76 isShareItem:'',//转发客人按钮 76 isShareItem:'',//转发客人按钮
77 - },  
78 - tablestr: '',  
79 - urlsValue: [],  
80 - screenHeight: '',  
81 - attentionAnim: {},  
82 - audioCtx: '', //播报  
83 - timers: null, // 动画定时器 77 + couponArr: [],//待领取的优惠券列表
  78 + },
  79 + tablestr: '',
  80 + urlsValue: [],
  81 + screenHeight: '',
  82 + attentionAnim: {},
  83 + audioCtx: '', //播报
  84 + timers: null, // 动画定时器
84 n: 0, 85 n: 0,
85 modal:'', 86 modal:'',
86 - /**  
87 - * 生命周期函数--监听页面加载  
88 - */  
89 - onLoad(options) {  
90 - this.id = options.id  
91 - let param = {  
92 - options: options,  
93 - hasOwner: options.hasSellerShare == 1, //是否为发起人  
94 - }  
95 - param.tpls = [TP.tpls(options.tplid)]  
96 - console.log(param);  
97 - console.log(options);  
98 - this.setData(param)  
99 - mta.Page.init({  
100 - "appID": "500667280",  
101 - "eventID": "500667287",  
102 - "statPullDownFresh": true,  
103 - "statShareApp": true,  
104 - "statReachBottom": true,  
105 - "lauchOpts": options, //渠道分析  
106 - });  
107 - const systemInfo = wx.getSystemInfoSync(); 87 + couponModal: '',
  88 + /**
  89 + * 生命周期函数--监听页面加载
  90 + */
  91 + onLoad(options) {
  92 + this.id = options.id
  93 + let param = {
  94 + options: options,
  95 + hasOwner: options.hasSellerShare == 1, //是否为发起人
  96 + }
  97 + param.tpls = [TP.tpls(options.tplid)]
  98 + console.log(param);
  99 + console.log(options);
  100 + this.setData(param)
  101 + mta.Page.init({
  102 + "appID": "500667280",
  103 + "eventID": "500667287",
  104 + "statPullDownFresh": true,
  105 + "statShareApp": true,
  106 + "statReachBottom": true,
  107 + "lauchOpts": options, //渠道分析
  108 + });
  109 + const systemInfo = wx.getSystemInfoSync();
108 this.screenHeight = systemInfo.windowHeight; // 获取屏幕高度 110 this.screenHeight = systemInfo.windowHeight; // 获取屏幕高度
109 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 111 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
110 wx.onUserCaptureScreen((res)=> { 112 wx.onUserCaptureScreen((res)=> {
111 this.modal.showModal() 113 this.modal.showModal()
112 }) 114 })
  115 + this.couponModal = this.selectComponent("#couponModal");
113 }, 116 },
114 // 打开截屏弹框 117 // 打开截屏弹框
115 showModal() { 118 showModal() {
@@ -119,8 +122,12 @@ Page({ @@ -119,8 +122,12 @@ Page({
119 closeModal() { 122 closeModal() {
120 this.modal.closeModal() 123 this.modal.closeModal()
121 }, 124 },
122 - // 页面滚动事件  
123 - onPageScroll: function (event) { 125 + // 关闭优惠券弹框
  126 + closeCouponModal() {
  127 + this.couponModal.closeModal()
  128 + },
  129 + // 页面滚动事件
  130 + onPageScroll: function (event) {
124 if(event.scrollTop>150){ //当页面滚动到某个位置时(这里设置为50),将导航栏背景颜色设置为白色 131 if(event.scrollTop>150){ //当页面滚动到某个位置时(这里设置为50),将导航栏背景颜色设置为白色
125 this.setData({ 132 this.setData({
126 show_white:true 133 show_white:true
@@ -130,411 +137,412 @@ Page({ @@ -130,411 +137,412 @@ Page({
130 show_white:false 137 show_white:false
131 }) 138 })
132 } 139 }
133 - const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离  
134 - if (scrollTop < this.screenHeight) {  
135 - this.setData({  
136 - showMoreTip: true  
137 - });  
138 - } else {  
139 - this.setData({  
140 - showMoreTip: false  
141 - });  
142 - }  
143 - },  
144 - // 点击了解更多会员优惠政策  
145 - gotoFavourableList() {  
146 - let url = util.http_build_query({  
147 - sellerName: this.data.seller.name,  
148 - sellerid: this.data.seller.sid,  
149 - oid: this.data.detail.id,  
150 - types: '1'  
151 - }, '/pack-cookbook/pages/favourableList')  
152 - wx.navigateTo({  
153 - url  
154 - })  
155 - },  
156 - // 去评价  
157 - evaluateFun() {  
158 - let url = util.http_build_query({  
159 - sellerName: this.data.seller.name,  
160 - sellerid: this.data.seller.sid,  
161 - oid: this.data.detail.id,  
162 - types: '1',  
163 - previousPage: '1',  
164 - }, '/pages/pinglun/createOpinion')  
165 - wx.navigateTo({  
166 - url  
167 - })  
168 - },  
169 - /**  
170 - * 用户点击右上角分享  
171 - */  
172 - onShareAppMessage: function () {  
173 - return this.sharesetting();  
174 - },  
175 - /**  
176 - * 监听用户点击分享到朋友圈按钮的操作  
177 - */  
178 - onShareTimeline() {  
179 - return this.sharesetting();  
180 - },  
181 - /**  
182 - * 生命周期函数--监听页面显示  
183 - */  
184 - onShow: function () {  
185 - this.getDetail()  
186 - this.getText()  
187 - this.getPaymentStatus()  
188 - },  
189 - // 复制微信号  
190 - copyWeChat() {  
191 - if (this.data.staffinfo.wechat) {  
192 - wx.setClipboardData({  
193 - data: this.data.staffinfo.wechat,  
194 - success(res) {  
195 - wx.getClipboardData({  
196 - success(res) {  
197 - console.log(res.data) // data  
198 - }  
199 - })  
200 - }  
201 - })  
202 - } else {  
203 - console.log('无微信号')  
204 - }  
205 - },  
206 - // 拨打电话  
207 - call(e) {  
208 - const phone = e.currentTarget.dataset['phone'];  
209 - wx.reportMonitor('1012', 1)  
210 - wx.makePhoneCall({  
211 - phoneNumber: phone  
212 - })  
213 - },  
214 - // 跳转到商家入驻页  
215 - gotoJoinSeller() {  
216 - wx.navigateTo({ 140 + const scrollTop = event.scrollTop * 1 + this.screenHeight - 80; // 获取滚动的距离
  141 + if (scrollTop < this.screenHeight) {
  142 + this.setData({
  143 + showMoreTip: true
  144 + });
  145 + } else {
  146 + this.setData({
  147 + showMoreTip: false
  148 + });
  149 + }
  150 + },
  151 + // 点击了解更多会员优惠政策
  152 + gotoFavourableList() {
  153 + let url = util.http_build_query({
  154 + sellerName: this.data.seller.name,
  155 + sellerid: this.data.seller.sid,
  156 + oid: this.data.detail.id,
  157 + types: '1'
  158 + }, '/pack-cookbook/pages/favourableList')
  159 + wx.navigateTo({
  160 + url
  161 + })
  162 + },
  163 + // 去评价
  164 + evaluateFun() {
  165 + let url = util.http_build_query({
  166 + sellerName: this.data.seller.name,
  167 + sellerid: this.data.seller.sid,
  168 + oid: this.data.detail.id,
  169 + types: '1',
  170 + previousPage: '1',
  171 + }, '/pages/pinglun/createOpinion')
  172 + wx.navigateTo({
  173 + url
  174 + })
  175 + },
  176 + /**
  177 + * 用户点击右上角分享
  178 + */
  179 + onShareAppMessage: function () {
  180 + return this.sharesetting();
  181 + },
  182 + /**
  183 + * 监听用户点击分享到朋友圈按钮的操作
  184 + */
  185 + onShareTimeline() {
  186 + return this.sharesetting();
  187 + },
  188 + /**
  189 + * 生命周期函数--监听页面显示
  190 + */
  191 + onShow: function () {
  192 + this.getDetail()
  193 + this.getText()
  194 + this.getPaymentStatus()
  195 + },
  196 + // 复制微信号
  197 + copyWeChat() {
  198 + if (this.data.staffinfo.wechat) {
  199 + wx.setClipboardData({
  200 + data: this.data.staffinfo.wechat,
  201 + success(res) {
  202 + wx.getClipboardData({
  203 + success(res) {
  204 + console.log(res.data) // data
  205 + }
  206 + })
  207 + }
  208 + })
  209 + } else {
  210 + console.log('无微信号')
  211 + }
  212 + },
  213 + // 拨打电话
  214 + call(e) {
  215 + const phone = e.currentTarget.dataset['phone'];
  216 + wx.reportMonitor('1012', 1)
  217 + wx.makePhoneCall({
  218 + phoneNumber: phone
  219 + })
  220 + },
  221 + // 跳转到商家入驻页
  222 + gotoJoinSeller() {
  223 + wx.navigateTo({
217 url: util.http_build_query({ 224 url: util.http_build_query({
218 laiyuan:'邀请函' 225 laiyuan:'邀请函'
219 }, '/pages/customer/joinSeller') 226 }, '/pages/customer/joinSeller')
220 - })  
221 - },  
222 - // 导航  
223 - looklocation: function () {  
224 - wx.reportMonitor('1015', 1)  
225 - wx.openLocation({  
226 - latitude: Number(this.data.seller.lat),  
227 - longitude: Number(this.data.seller.long),  
228 - scale: 17,  
229 - address: this.data.seller.addr,  
230 - success: function (res) {  
231 - console.log(res)  
232 - }  
233 - })  
234 - },  
235 - // 获取包间图片列表  
236 - getroomimage(sellerid) {  
237 - App.Tables.GetTablesPhoto({  
238 - sellerid,  
239 - tableids: this.tablestr  
240 - }).then((json) => {  
241 - if (json.ret == 200) {  
242 - this.setData({  
243 - roomimage: json.data  
244 - })  
245 - var urlsArr = [];  
246 - json.data.forEach((v, i) => {  
247 - urlsArr.push(v.url);  
248 - })  
249 - this.urlsValue = urlsArr;  
250 - console.log('urlsArr', urlsArr)  
251 - console.log('roomimage', json.data)  
252 - }  
253 - })  
254 - },  
255 - // 预览包间图片  
256 - lookroom(e) {  
257 - const item = e.currentTarget.dataset['item'];  
258 - wx.previewImage({  
259 - current: item.url, // 当前显示图片的http链接  
260 - urls: this.urlsValue, // 需要预览的图片http链接列表  
261 - })  
262 - },  
263 - // 预览其他图片  
264 - lookImgs(e) {  
265 - const url = e.currentTarget.dataset['url'];  
266 - const imgs = e.currentTarget.dataset['imgs'];  
267 - let urls = imgs ? imgs : [url]  
268 - wx.previewImage({  
269 - current: url,  
270 - urls,  
271 - })  
272 - },  
273 - // 获取店铺详情  
274 - getDetail() {  
275 - App.Reserve.Detail({  
276 - openid: getApp().openid,  
277 - rid: this.data.options.id  
278 - }).then(res => {  
279 - let tablesText = '', //桌子信息  
280 - deskStr = '',  
281 - tableNum = 0;  
282 - let tableinfo = util.determine(res.data.tableinfo);  
283 - console.log('tableinfo', tableinfo);  
284 - res.data.tables.forEach((t, i) => {  
285 - tableNum += t.table_pnum * 1  
286 - tablesText += t.rname + t.name + (i == (res.data.tables.length - 1) ? '' : '、');  
287 - deskStr += t.name + (i == (res.data.tables.length - 1) ? '' : '、');  
288 - })  
289 - let tabaleids = [];  
290 - res.data.tables.forEach(t => {  
291 - tabaleids.push(t.id);  
292 - })  
293 - this.tablestr = tabaleids.toString();  
294 - let reserev = RS.reserve(res.data)  
295 - let dateSmart = util.unixtoTime(reserev.ddate, 'YYYY-MM-DD 星期WW');  
296 - let yearMonthDay = util.unixtoTime(reserev.ddate, 'YYYY年MM月DD日')  
297 - let yearMonth = util.unixtoTime(reserev.ddate, 'MM月DD日')  
298 - let dateStr = util.unixtoTime(reserev.ddate, 'HH点')  
299 - let dateStrDivide = util.unixtoTime(reserev.ddate, 'II分')  
300 - console.log('dateSmart', dateSmart);  
301 - this.setData({  
302 - detail: this.formatDatail(reserev, dateSmart),  
303 - tableNum,  
304 - tableinfo,  
305 - is_user_comments: res.data.is_user_comments, 227 + })
  228 + },
  229 + // 导航
  230 + looklocation: function () {
  231 + wx.reportMonitor('1015', 1)
  232 + wx.openLocation({
  233 + latitude: Number(this.data.seller.lat),
  234 + longitude: Number(this.data.seller.long),
  235 + scale: 17,
  236 + address: this.data.seller.addr,
  237 + success: function (res) {
  238 + console.log(res)
  239 + }
  240 + })
  241 + },
  242 + // 获取包间图片列表
  243 + getroomimage(sellerid) {
  244 + App.Tables.GetTablesPhoto({
  245 + sellerid,
  246 + tableids: this.tablestr
  247 + }).then((json) => {
  248 + if (json.ret == 200) {
  249 + this.setData({
  250 + roomimage: json.data
  251 + })
  252 + var urlsArr = [];
  253 + json.data.forEach((v, i) => {
  254 + urlsArr.push(v.url);
  255 + })
  256 + this.urlsValue = urlsArr;
  257 + console.log('urlsArr', urlsArr)
  258 + console.log('roomimage', json.data)
  259 + }
  260 + })
  261 + },
  262 + // 预览包间图片
  263 + lookroom(e) {
  264 + const item = e.currentTarget.dataset['item'];
  265 + wx.previewImage({
  266 + current: item.url, // 当前显示图片的http链接
  267 + urls: this.urlsValue, // 需要预览的图片http链接列表
  268 + })
  269 + },
  270 + // 预览其他图片
  271 + lookImgs(e) {
  272 + const url = e.currentTarget.dataset['url'];
  273 + const imgs = e.currentTarget.dataset['imgs'];
  274 + let urls = imgs ? imgs : [url]
  275 + wx.previewImage({
  276 + current: url,
  277 + urls,
  278 + })
  279 + },
  280 + // 获取店铺详情
  281 + getDetail() {
  282 + App.Reserve.Detail({
  283 + openid: getApp().openid,
  284 + rid: this.data.options.id
  285 + }).then(res => {
  286 + let tablesText = '', //桌子信息
  287 + deskStr = '',
  288 + tableNum = 0;
  289 + let tableinfo = util.determine(res.data.tableinfo);
  290 + console.log('tableinfo', tableinfo);
  291 + res.data.tables.forEach((t, i) => {
  292 + tableNum += t.table_pnum * 1
  293 + tablesText += t.rname + t.name + (i == (res.data.tables.length - 1) ? '' : '、');
  294 + deskStr += t.name + (i == (res.data.tables.length - 1) ? '' : '、');
  295 + })
  296 + let tabaleids = [];
  297 + res.data.tables.forEach(t => {
  298 + tabaleids.push(t.id);
  299 + })
  300 + this.tablestr = tabaleids.toString();
  301 + let reserev = RS.reserve(res.data)
  302 + let dateSmart = util.unixtoTime(reserev.ddate, 'YYYY-MM-DD 星期WW');
  303 + let yearMonthDay = util.unixtoTime(reserev.ddate, 'YYYY年MM月DD日')
  304 + let yearMonth = util.unixtoTime(reserev.ddate, 'MM月DD日')
  305 + let dateStr = util.unixtoTime(reserev.ddate, 'HH点')
  306 + let dateStrDivide = util.unixtoTime(reserev.ddate, 'II分')
  307 + console.log('dateSmart', dateSmart);
  308 + this.setData({
  309 + detail: this.formatDatail(reserev, dateSmart),
  310 + tableNum,
  311 + tableinfo,
  312 + is_user_comments: res.data.is_user_comments,
306 temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'), 313 temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
307 - seller: { 314 + seller: {
308 daily: reserev.seller.daily, 315 daily: reserev.seller.daily,
309 - name: reserev.seller.sellername,  
310 - sid: reserev.sid,  
311 - date: dateSmart,  
312 - tablesText,  
313 - addr: reserev.seller.real_address || reserev.seller.map_address,  
314 - image: reserev.image_url,  
315 - hasOwner: true,  
316 - type: reserev.type,  
317 - is_set_ddate: reserev.is_set_ddate,  
318 - hasUpTime: reserev.type == 1 && reserev.hasRunning && reserev.status != 2,  
319 - tel: reserev.seller.seller_tel.split(','),  
320 - soltName: reserev.soltName,  
321 - dateTime: util.unixtoTime(reserev.ddate, 'HH:II'),  
322 - time: util.unixtoTime(reserev.ddate, '星期WW HH:II'),  
323 - lat: reserev.seller.lat,  
324 - long: reserev.seller.long,  
325 - yearMonthDay,  
326 - yearMonth,  
327 - dateStr,  
328 - deskStr,  
329 - dateStrDivide: dateStrDivide == '00分' ? '' : dateStrDivide,  
330 - seller_tel: reserev.seller.seller_tel, 316 + name: reserev.seller.sellername,
  317 + sid: reserev.sid,
  318 + date: dateSmart,
  319 + tablesText,
  320 + addr: reserev.seller.real_address || reserev.seller.map_address,
  321 + image: reserev.image_url,
  322 + hasOwner: true,
  323 + type: reserev.type,
  324 + is_set_ddate: reserev.is_set_ddate,
  325 + hasUpTime: reserev.type == 1 && reserev.hasRunning && reserev.status != 2,
  326 + tel: reserev.seller.seller_tel.split(','),
  327 + soltName: reserev.soltName,
  328 + dateTime: util.unixtoTime(reserev.ddate, 'HH:II'),
  329 + time: util.unixtoTime(reserev.ddate, '星期WW HH:II'),
  330 + lat: reserev.seller.lat,
  331 + long: reserev.seller.long,
  332 + yearMonthDay,
  333 + yearMonth,
  334 + dateStr,
  335 + deskStr,
  336 + dateStrDivide: dateStrDivide == '00分' ? '' : dateStrDivide,
  337 + seller_tel: reserev.seller.seller_tel,
331 phone:reserev.phone, 338 phone:reserev.phone,
332 - }  
333 - })  
334 - console.log('reserev reserev', reserev);  
335 - console.log('seller seller', this.data.seller);  
336 - console.log('detail detail', this.data.detail);  
337 - setTimeout(() => {  
338 - this.getstaffinfo(res.data.uid, reserev.sid);  
339 - this.getroomimage(reserev.sid)  
340 - this.getSellerVersionFun(reserev.sid);  
341 - }, 0);  
342 - }).catch(res => {  
343 - console.log(res, '详情请求失败');  
344 - })  
345 - },  
346 - // 获取商家版本,不是超能版或者没有开通对应模块,不显示  
347 - getSellerVersionFun(sellerid) {  
348 - App.SellerVersion.GetSellerVersion({  
349 - sellerid  
350 - }).then((res) => {  
351 - let data = res.data;  
352 - console.log('版本列表', data);  
353 - if (data && data.length > 0) {  
354 - data.sort((a, b) => b.cdate * 1 - a.cdate * 1);  
355 - // 获取店铺当前版本 (cdate最大最后一个充入的 && 当前时间有效 && 当前版本)  
356 - let obj = data.find(item => item.vtype == 1 || item.vtype == 2 || item.vtype == 4);  
357 - console.log('当前版本', {  
358 - ...obj  
359 - });  
360 - // 提前点餐功能:超能版 || 有提前点餐模块  
361 - const hasValueOrder = obj.vtype == '1' || data.some(item => item.vid == '6');  
362 - // 优惠券功能:超能版 || 高级版 || 有优惠券模块  
363 - const hasValueCertificate = obj.vtype == '1' || obj.vtype == '4' || data.some(item => item.vid == '8');  
364 - // 充值功能:超能版 || 有充值模块  
365 - const hasValueRecharge = obj.vtype == '1' || data.some(item => item.vid == '9');  
366 - // 播报功能:超能版 || 标准版 || 标准版首年 || 高级版  
367 - const hasValueBroadcast = obj.vtype == '1' || obj.vid == '4' || obj.vid == '13' || obj.vtype == '4';  
368 - this.setData({  
369 - hasValueOrder,  
370 - hasValueCertificate,  
371 - hasValueRecharge,  
372 - hasValueBroadcast,  
373 - })  
374 - }  
375 - })  
376 - },  
377 - // 通过预订ID查收定金详情  
378 - getPaymentStatus() {  
379 - App.Reserve.GetReserveDepositByRid({  
380 - rid: this.data.options.id  
381 - }).then(res => {  
382 - if (res.ret == 200 && res.data && res.data.length > 0) {  
383 - let data = res.data[0]; 339 + }
  340 + })
  341 + console.log('reserev reserev', reserev);
  342 + console.log('seller seller', this.data.seller);
  343 + console.log('detail detail', this.data.detail);
  344 + setTimeout(() => {
  345 + this.getstaffinfo(res.data.uid, reserev.sid);
  346 + this.getroomimage(reserev.sid)
  347 + this.getSellerVersionFun(reserev.sid);
  348 + }, 0);
  349 + }).catch(res => {
  350 + console.log(res, '详情请求失败');
  351 + })
  352 + },
  353 + // 获取商家版本,不是超能版或者没有开通对应模块,不显示
  354 + getSellerVersionFun(sellerid) {
  355 + App.SellerVersion.GetSellerVersion({
  356 + sellerid
  357 + }).then((res) => {
  358 + let data = res.data;
  359 + console.log('版本列表', data);
  360 + if (data && data.length > 0) {
  361 + data.sort((a, b) => b.cdate * 1 - a.cdate * 1);
  362 + // 获取店铺当前版本 (cdate最大最后一个充入的 && 当前时间有效 && 当前版本)
  363 + let obj = data.find(item => item.vtype == 1 || item.vtype == 2 || item.vtype == 4);
  364 + console.log('当前版本', {
  365 + ...obj
  366 + });
  367 + // 提前点餐功能:超能版 || 有提前点餐模块
  368 + const hasValueOrder = obj.vtype == '1' || data.some(item => item.vid == '6');
  369 + // 优惠券功能:超能版 || 高级版 || 有优惠券模块
  370 + const hasValueCertificate = obj.vtype == '1' || obj.vtype == '4' || data.some(item => item.vid == '8');
  371 + // 充值功能:超能版 || 有充值模块
  372 + const hasValueRecharge = obj.vtype == '1' || data.some(item => item.vid == '9');
  373 + // 播报功能:超能版 || 标准版 || 标准版首年 || 高级版
  374 + const hasValueBroadcast = obj.vtype == '1' || obj.vid == '4' || obj.vid == '13' || obj.vtype == '4';
  375 + this.setData({
  376 + hasValueOrder,
  377 + hasValueCertificate,
  378 + hasValueRecharge,
  379 + hasValueBroadcast,
  380 + })
  381 + }
  382 + })
  383 + },
  384 + // 通过预订ID查收定金详情
  385 + getPaymentStatus() {
  386 + App.Reserve.GetReserveDepositByRid({
  387 + rid: this.data.options.id
  388 + }).then(res => {
  389 + if (res.ret == 200 && res.data && res.data.length > 0) {
  390 + let data = res.data[0];
384 let paymentStatus = data.trade_state == 'SUCCESS' ? '1' : '0'; 391 let paymentStatus = data.trade_state == 'SUCCESS' ? '1' : '0';
385 let options = this.data.options 392 let options = this.data.options
386 - this.setData({  
387 - paymentId: data.id,  
388 - paymentStatus, 393 + this.setData({
  394 + paymentId: data.id,
  395 + paymentStatus,
389 isPaymenBtn:options.isOrder != '1' && data.id && paymentStatus == '0' && options.hasSellerShare == '1' && options.isDeposit == '1', 396 isPaymenBtn:options.isOrder != '1' && data.id && paymentStatus == '0' && options.hasSellerShare == '1' && options.isDeposit == '1',
390 - })  
391 - }  
392 - })  
393 - },  
394 - // 获取自定义图文内容  
395 - getText() {  
396 - App.Reserve.GetReserveImgText({  
397 - rid: this.data.options.id  
398 - }).then(res => {  
399 - if (res.ret == 200 && res.data) {  
400 - let data = res.data;  
401 - let content = util.determine(data.content)  
402 - console.log('contentcontentcontent', content);  
403 - this.setData({  
404 - reserveData: {  
405 - title: data.title || '',  
406 - content,  
407 - }  
408 - })  
409 - }  
410 - })  
411 - },  
412 - // 点击支付定金  
413 - paymentFun() {  
414 - let that = this;  
415 - App.PayOnline.CombineTransactionsByDeposit({  
416 - id: this.data.paymentId,  
417 - openid: getApp().openid,  
418 - }).then(res => {  
419 - if (res.ret == 200) {  
420 - wx.requestPayment({  
421 - timeStamp: res.data.timeStamp + '',  
422 - nonceStr: res.data.nonceStr,  
423 - package: res.data.package,  
424 - signType: res.data.signType,  
425 - paySign: res.data.paySign,  
426 - success(ress) {  
427 - console.log('微信支付结果', ress);  
428 - if (ress.errMsg == 'requestPayment:ok') {  
429 - console.log('支付成功', ress);  
430 - that.setData({  
431 - paymentStatus: '1',  
432 - toastBool: true,  
433 - toastText: '支付成功'  
434 - })  
435 - that.hideToast();  
436 - return  
437 - }  
438 - console.log('支付失败1', ress);  
439 - that.setData({  
440 - toastBool: true,  
441 - toastText: '支付失败,请重新支付'  
442 - })  
443 - that.hideToast();  
444 - },  
445 - fail(ress) {  
446 - console.log('支付失败2', ress);  
447 - that.setData({  
448 - toastBool: true,  
449 - toastText: '支付失败,请重新支付'  
450 - })  
451 - that.hideToast();  
452 - },  
453 - })  
454 - } else {  
455 - wx.showToast({  
456 - title: res.msg,  
457 - icon: 'none',  
458 - })  
459 - }  
460 - })  
461 - },  
462 - // 关闭支付失败或者成功弹框  
463 - hideToast() {  
464 - setTimeout(() => {  
465 - this.setData({  
466 - toastBool: false  
467 - })  
468 - }, 1500)  
469 - },  
470 - // 客户经理获取基本信息  
471 - getstaffinfo(uid, sid) {  
472 - console.log('sellerid', this.data.detail.seller.id);  
473 - App.Activity.GetCustomerActivityBaseinfo({  
474 - sellerid: this.data.detail.seller.id,  
475 - uid  
476 - }).then((json) => {  
477 - if (json.ret == 200) {  
478 - console.log('staffinfostaffinfostaffinfo', json.data)  
479 - this.setData({  
480 - staffinfo: json.data  
481 - })  
482 - this.getSellerTemplateConfFun(sid);  
483 - }  
484 - })  
485 - },  
486 - // 提前点餐  
487 - cookbook() {  
488 - if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) {  
489 - let data = {  
490 - rid: this.id,  
491 - oid: this.data.detail.order.id,  
492 - sellerName: this.data.seller.name,  
493 - sid: this.data.seller.sid,  
494 - identity: '1',  
495 - hasSuccess: '1',  
496 - }  
497 - wx.navigateTo({  
498 - url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`,  
499 - })  
500 - } else {  
501 - App.Advance.CreateOrder({  
502 - rid: this.id,  
503 - openid: getApp().openid,  
504 - }).then(res => {  
505 - if (res.ret != 200) {  
506 - return util.toast(res.msg, 'none')  
507 - }  
508 - wx.navigateTo({  
509 - url: util.http_build_query({  
510 - rid: this.id,  
511 - oid: res.data.id,  
512 - sid: res.data.sellerid,  
513 - sellerName: this.data.seller.name,  
514 - identity: '1',  
515 - }, '/pack-cookbook/pages/index_new')  
516 - });  
517 - })  
518 - }  
519 - },  
520 - // 生成海报  
521 - painterBtn(img, sellerName, date, time) {  
522 - img = img.replace(/^http:/, "https:");  
523 - this.setData({  
524 - wxml: canvas({  
525 - imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',  
526 - sellerName,  
527 - date,  
528 - time,  
529 - })  
530 - })  
531 - },  
532 - onImgOK(e) {  
533 - this.setData({  
534 - imgSrc: e.detail.path  
535 - })  
536 - console.log('海报生成成功', this.data.imgSrc);  
537 - }, 397 + })
  398 + }
  399 + })
  400 + },
  401 + // 获取自定义图文内容
  402 + getText() {
  403 + App.Reserve.GetReserveImgText({
  404 + rid: this.data.options.id
  405 + }).then(res => {
  406 + if (res.ret == 200 && res.data) {
  407 + let data = res.data;
  408 + let content = util.determine(data.content)
  409 + console.log('contentcontentcontent', content);
  410 + this.setData({
  411 + reserveData: {
  412 + title: data.title || '',
  413 + content,
  414 + }
  415 + })
  416 + }
  417 + })
  418 + },
  419 + // 点击支付定金
  420 + paymentFun() {
  421 + let that = this;
  422 + App.PayOnline.CombineTransactionsByDeposit({
  423 + id: this.data.paymentId,
  424 + openid: getApp().openid,
  425 + }).then(res => {
  426 + if (res.ret == 200) {
  427 + wx.requestPayment({
  428 + timeStamp: res.data.timeStamp + '',
  429 + nonceStr: res.data.nonceStr,
  430 + package: res.data.package,
  431 + signType: res.data.signType,
  432 + paySign: res.data.paySign,
  433 + success(ress) {
  434 + console.log('微信支付结果', ress);
  435 + if (ress.errMsg == 'requestPayment:ok') {
  436 + console.log('支付成功', ress);
  437 + that.setData({
  438 + paymentStatus: '1',
  439 + toastBool: true,
  440 + toastText: '支付成功'
  441 + })
  442 + that.hideToast();
  443 + return
  444 + }
  445 + console.log('支付失败1', ress);
  446 + that.setData({
  447 + toastBool: true,
  448 + toastText: '支付失败,请重新支付'
  449 + })
  450 + that.hideToast();
  451 + },
  452 + fail(ress) {
  453 + console.log('支付失败2', ress);
  454 + that.setData({
  455 + toastBool: true,
  456 + toastText: '支付失败,请重新支付'
  457 + })
  458 + that.hideToast();
  459 + },
  460 + })
  461 + } else {
  462 + wx.showToast({
  463 + title: res.msg,
  464 + icon: 'none',
  465 + })
  466 + }
  467 + })
  468 + },
  469 + // 关闭支付失败或者成功弹框
  470 + hideToast() {
  471 + setTimeout(() => {
  472 + this.setData({
  473 + toastBool: false
  474 + })
  475 + }, 1500)
  476 + },
  477 + // 客户经理获取基本信息
  478 + getstaffinfo(uid, sid) {
  479 + console.log('sellerid', this.data.detail.seller.id);
  480 + App.Activity.GetCustomerActivityBaseinfo({
  481 + sellerid: this.data.detail.seller.id,
  482 + uid
  483 + }).then((json) => {
  484 + if (json.ret == 200) {
  485 + console.log('客户经理获取基本信息------', json.data)
  486 + this.setData({
  487 + staffinfo: json.data,
  488 + couponArr:[],
  489 + })
  490 + this.getSellerTemplateConfFun(sid);
  491 + }
  492 + })
  493 + },
  494 + // 提前点餐
  495 + cookbook() {
  496 + if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) {
  497 + let data = {
  498 + rid: this.id,
  499 + oid: this.data.detail.order.id,
  500 + sellerName: this.data.seller.name,
  501 + sid: this.data.seller.sid,
  502 + identity: '1',
  503 + hasSuccess: '1',
  504 + }
  505 + wx.navigateTo({
  506 + url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`,
  507 + })
  508 + } else {
  509 + App.Advance.CreateOrder({
  510 + rid: this.id,
  511 + openid: getApp().openid,
  512 + }).then(res => {
  513 + if (res.ret != 200) {
  514 + return util.toast(res.msg, 'none')
  515 + }
  516 + wx.navigateTo({
  517 + url: util.http_build_query({
  518 + rid: this.id,
  519 + oid: res.data.id,
  520 + sid: res.data.sellerid,
  521 + sellerName: this.data.seller.name,
  522 + identity: '1',
  523 + }, '/pack-cookbook/pages/index_new')
  524 + });
  525 + })
  526 + }
  527 + },
  528 + // 生成海报
  529 + painterBtn(img, sellerName, date, time) {
  530 + img = img.replace(/^http:/, "https:");
  531 + this.setData({
  532 + wxml: canvas({
  533 + imgUrl: img || 'https://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png',
  534 + sellerName,
  535 + date,
  536 + time,
  537 + })
  538 + })
  539 + },
  540 + onImgOK(e) {
  541 + this.setData({
  542 + imgSrc: e.detail.path
  543 + })
  544 + console.log('海报生成成功', this.data.imgSrc);
  545 + },
538 // 分享 546 // 分享
539 sharesetting() { 547 sharesetting() {
540 wx.reportMonitor('1017', 1) 548 wx.reportMonitor('1017', 1)
@@ -564,14 +572,14 @@ Page({ @@ -564,14 +572,14 @@ Page({
564 } 572 }
565 } 573 }
566 }, 574 },
567 - // 修改detail数据  
568 - formatDatail(detail, dateSmart) {  
569 - detail.rdateStr = dateSmart;  
570 - detail.tableFirst = detail.tables[0].name;  
571 - if (detail.tables.length > 1) {  
572 - detail.tableSubInfo = '等' + (detail.tables.length) + '个' +  
573 - (detail.tables[0].tid == 2 ? '包间' : '');  
574 - } 575 + // 修改detail数据
  576 + formatDatail(detail, dateSmart) {
  577 + detail.rdateStr = dateSmart;
  578 + detail.tableFirst = detail.tables[0].name;
  579 + if (detail.tables.length > 1) {
  580 + detail.tableSubInfo = '等' + (detail.tables.length) + '个' +
  581 + (detail.tables[0].tid == 2 ? '包间' : '');
  582 + }
575 detail.rname = detail.rname.trim() 583 detail.rname = detail.rname.trim()
576 if (detail.rname && detail.sex != 3) { 584 if (detail.rname && detail.sex != 3) {
577 detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') 585 detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '')
@@ -580,84 +588,78 @@ Page({ @@ -580,84 +588,78 @@ Page({
580 } else { 588 } else {
581 detail.rnameStr = detail.rname 589 detail.rnameStr = detail.rname
582 } 590 }
583 - detail.eatStr = '邀请您共进晚餐';  
584 - let hi = util.unixtoTime(detail.ddate, 'HHII');  
585 - if (hi < '10:00') {  
586 - detail.eatStr = '邀请您共进早餐';  
587 - } else if (hi < '15:00') {  
588 - detail.eatStr = '邀请您共进午餐';  
589 - }  
590 - return detail;  
591 - },  
592 - // 获取商家设置营销信息  
593 - getSellerTemplateConfFun(sid) {  
594 - console.log(sid, 'sidsidsidsid');  
595 - App.Seller.GetSellerTemplateConf({  
596 - sid  
597 - }).then(res => {  
598 - let data = res.data  
599 - console.log('data', data);  
600 - let couponList = []  
601 - let colors, settingUrl, inviteImgUrl, themeColor, StyleType, titleType, home, chef, marketing, coupon, reserve, swich_phone, is_comments, signboard, store;  
602 - chef = util.determine(data.chef);  
603 - reserve = util.determine(data.reserve);  
604 - marketing = util.determine(data.marketing);  
605 - signboard = util.determine(data.signboard);  
606 - store = util.determine(data.store);  
607 - home = util.determine(data.home);  
608 - themeColor = data.lite_class || 'ultramarine';  
609 - StyleType = data.type;  
610 - if (StyleType == '9' || StyleType == '10' || StyleType == '11' || StyleType == '12') {  
611 - inviteImgUrl = 'https://nosqn.colorcun.com/inviteText.png';  
612 - } else {  
613 - inviteImgUrl = 'https://nosqn.colorcun.com/inviteText1.png';  
614 - }  
615 - settingUrl = StyleType == '12' ? 'https://nosqn.colorcun.com/template12.jpg' : 'https://nosqn.colorcun.com/template' + StyleType + '.png';  
616 - if (StyleType == '9') colors = "#0B0805";  
617 - if (StyleType == '10' || StyleType == '17') colors = "#750100";  
618 - if (StyleType == '11' || StyleType == '12') colors = "#0B1A67";  
619 - if (StyleType == '13' || StyleType == '15') colors = "#0B3133";  
620 - if (StyleType == '14' || StyleType == '16') colors = "#1B1A23";  
621 - titleType = data.title_class || '1';  
622 - swich_phone = reserve && reserve.swich_phone ? reserve.swich_phone : '';  
623 - if (store) store.content = (store.is_introduce_all == '1' && store.content) ? util.determine(store.content) : '';  
624 - if (chef) chef.content = (chef.is_introduce_all == '1' && chef.content) ? util.determine(chef.content) : '';  
625 - if (signboard) signboard.content = (signboard.is_introduce_all == '1' && signboard.content) ? util.determine(signboard.content) : '';  
626 - if (reserve) reserve.content = (reserve.is_introduce_all == '1' && reserve.content) ? util.determine(reserve.content) : '';  
627 - if (home) home.image = (home && home.image && (!home.id_first_image || home.id_first_image!='0')) ? home.image : '';  
628 - if (marketing) {  
629 - marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';  
630 - is_comments = marketing.is_comments ? marketing.is_comments : '';  
631 - coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 591 + detail.eatStr = '邀请您共进晚餐';
  592 + let hi = util.unixtoTime(detail.ddate, 'HHII');
  593 + if (hi < '10:00') {
  594 + detail.eatStr = '邀请您共进早餐';
  595 + } else if (hi < '15:00') {
  596 + detail.eatStr = '邀请您共进午餐';
  597 + }
  598 + return detail;
  599 + },
  600 + // 获取商家设置营销信息
  601 + getSellerTemplateConfFun(sid) {
  602 + console.log(sid, 'sidsidsidsid');
  603 + App.Seller.GetSellerTemplateConf({
  604 + sid
  605 + }).then(res => {
  606 + let data = res.data
  607 + console.log('data', data);
  608 + let couponList = []
  609 + let colors, settingUrl, inviteImgUrl, themeColor, StyleType, titleType, home, chef, marketing, coupon, coupon_data_pay, coupon_data_free, reserve, swich_phone, is_comments, signboard, store;
  610 + chef = util.determine(data.chef);
  611 + reserve = util.determine(data.reserve);
  612 + marketing = util.determine(data.marketing);
  613 + signboard = util.determine(data.signboard);
  614 + store = util.determine(data.store);
  615 + home = util.determine(data.home);
  616 + themeColor = data.lite_class || 'ultramarine';
  617 + StyleType = data.type;
  618 + if (StyleType == '9' || StyleType == '10' || StyleType == '11' || StyleType == '12') {
  619 + inviteImgUrl = 'https://nosqn.colorcun.com/inviteText.png';
  620 + } else {
  621 + inviteImgUrl = 'https://nosqn.colorcun.com/inviteText1.png';
  622 + }
  623 + settingUrl = StyleType == '12' ? 'https://nosqn.colorcun.com/template12.jpg' : 'https://nosqn.colorcun.com/template' + StyleType + '.png';
  624 + if (StyleType == '9') colors = "#0B0805";
  625 + if (StyleType == '10' || StyleType == '17') colors = "#750100";
  626 + if (StyleType == '11' || StyleType == '12') colors = "#0B1A67";
  627 + if (StyleType == '13' || StyleType == '15') colors = "#0B3133";
  628 + if (StyleType == '14' || StyleType == '16') colors = "#1B1A23";
  629 + titleType = data.title_class || '1';
  630 + swich_phone = reserve && reserve.swich_phone ? reserve.swich_phone : '';
  631 + if (store) store.content = (store.is_introduce_all == '1' && store.content) ? util.determine(store.content) : '';
  632 + if (chef) chef.content = (chef.is_introduce_all == '1' && chef.content) ? util.determine(chef.content) : '';
  633 + if (signboard) signboard.content = (signboard.is_introduce_all == '1' && signboard.content) ? util.determine(signboard.content) : '';
  634 + if (reserve) reserve.content = (reserve.is_introduce_all == '1' && reserve.content) ? util.determine(reserve.content) : '';
  635 + if (home) home.image = (home && home.image && (!home.id_first_image || home.id_first_image!='0')) ? home.image : '';
  636 + if (marketing) {
  637 + marketing.logo = (marketing.logo && (!marketing.is_logo || marketing.is_logo!='0')) ? marketing.logo : '';
  638 + is_comments = marketing.is_comments ? marketing.is_comments : '';
  639 + coupon = (marketing.coupon_data && marketing.is_coupon == '1') ? util.determine(marketing.coupon_data) : '';
  640 + coupon_data_pay = (marketing.coupon_data_pay && marketing.is_coupon_pay == '1') ? util.determine(marketing.coupon_data_pay) : '';
  641 + marketing.coupon_data_payList = coupon_data_pay
  642 + coupon_data_free = (marketing.coupon_data_free && marketing.is_coupon_free == '1') ? util.determine(marketing.coupon_data_free) : '';
  643 + marketing.coupon_data_freeList = coupon_data_free
632 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; 644 let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
633 let couponDataId = info && info.length > 0 ? info[0].id : {} 645 let couponDataId = info && info.length > 0 ? info[0].id : {}
634 // 根据券ID获取评价赠送的券详情 646 // 根据券ID获取评价赠送的券详情
635 if(couponDataId) this.getEvaluateFun(couponDataId) 647 if(couponDataId) this.getEvaluateFun(couponDataId)
636 } 648 }
637 - // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示  
638 - if (coupon && util.getType(coupon) == 'object') {  
639 - couponList.push({  
640 - id: coupon.id  
641 - });  
642 - }  
643 - if (coupon && util.getType(coupon) == 'array') {  
644 - if (coupon.length > 0) {  
645 - coupon.forEach(item => {  
646 - couponList.push({  
647 - id: item.id  
648 - })  
649 - })  
650 - }  
651 - } 649 + // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
  650 + // 获取全部的优惠券(商家券、个人券、免费券、付费券)
  651 + couponList = this.addCoupons(coupon,couponList);
  652 + couponList = this.addCoupons(coupon_data_pay,couponList);
  653 + couponList = this.addCoupons(coupon_data_free,couponList);
652 // 根据券ID获取券详情 654 // 根据券ID获取券详情
653 - this.getActivityByIdFun(couponList, couponList.length)  
654 - // 根据充值ID获取充值详情  
655 - if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {  
656 - this.getRechargeDetail(marketing.recharge_data.id)  
657 - }  
658 - if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);  
659 - if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);  
660 - if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images); 655 + this.getActivityByIdFun(couponList)
  656 + // 根据充值ID获取充值详情
  657 + if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
  658 + this.getRechargeDetail(marketing.recharge_data.id)
  659 + }
  660 + if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
  661 + if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
  662 + if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
661 let solt = this.data.detail.ddate_solt; 663 let solt = this.data.detail.ddate_solt;
662 let lunchDis = this.data.seller.daily; 664 let lunchDis = this.data.seller.daily;
663 let timeList = [] 665 let timeList = []
@@ -668,20 +670,20 @@ Page({ @@ -668,20 +670,20 @@ Page({
668 var nightStr = lunchDis.night.split("-"); 670 var nightStr = lunchDis.night.split("-");
669 var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : []; 671 var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
670 timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : [] 672 timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
671 - let obj = {  
672 - chef,  
673 - marketing,  
674 - home,  
675 - reserve,  
676 - signboard,  
677 - store,  
678 - swich_phone,  
679 - is_comments,  
680 - StyleType,  
681 - titleType,  
682 - themeColor,  
683 - settingUrl,  
684 - inviteImgUrl, 673 + let obj = {
  674 + chef,
  675 + marketing,
  676 + home,
  677 + reserve,
  678 + signboard,
  679 + store,
  680 + swich_phone,
  681 + is_comments,
  682 + StyleType,
  683 + titleType,
  684 + themeColor,
  685 + settingUrl,
  686 + inviteImgUrl,
685 colors, 687 colors,
686 lite_style:data.lite_style, 688 lite_style:data.lite_style,
687 timeList, 689 timeList,
@@ -693,185 +695,188 @@ Page({ @@ -693,185 +695,188 @@ Page({
693 }); 695 });
694 this.setData({ 696 this.setData({
695 ...obj 697 ...obj
696 - })  
697 - // 开启语音播报  
698 - if (reserve && reserve.swich_voice == '1') {  
699 - this.setData({  
700 - isPlay: '1',  
701 - })  
702 - this.textToSpeechFun(reserve.voice_info)  
703 - }  
704 - // 获取转发客人卡片设置  
705 - let detailInfo = this.data.detail;  
706 - if (data.lite_style == '0') {  
707 - this.setData({  
708 - imgSrc: detailInfo.seller.seller_image  
709 - })  
710 - } else {  
711 - let d = detailInfo.ddate_solt;  
712 - let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');  
713 - let time2; 698 + })
  699 + // 开启语音播报
  700 + if (reserve && reserve.swich_voice == '1') {
  701 + this.setData({
  702 + isPlay: '1',
  703 + })
  704 + this.textToSpeechFun(reserve.voice_info)
  705 + }
  706 + // 获取转发客人卡片设置
  707 + let detailInfo = this.data.detail;
  708 + if (data.lite_style == '0') {
  709 + this.setData({
  710 + imgSrc: detailInfo.seller.seller_image
  711 + })
  712 + } else {
  713 + let d = detailInfo.ddate_solt;
  714 + let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
  715 + let time2;
714 if(this.data.temp_ddate){ 716 if(this.data.temp_ddate){
715 time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate 717 time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
716 }else{ 718 }else{
717 time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II') 719 time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
718 } 720 }
719 - let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');  
720 - let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';  
721 - this.painterBtn(  
722 - detailInfo.seller.seller_image,  
723 - detailInfo.seller.sellername,  
724 - util.unixtoTime(detailInfo.ddate, 'MM月DD日'),  
725 - time  
726 - );  
727 - }  
728 - }).catch(res => {  
729 - console.log('GetSellerTemplateConf请求失败');  
730 - }) 721 + let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
  722 + let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
  723 + this.painterBtn(
  724 + detailInfo.seller.seller_image,
  725 + detailInfo.seller.sellername,
  726 + util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
  727 + time
  728 + );
  729 + }
  730 + }).catch(res => {
  731 + console.log('GetSellerTemplateConf请求失败');
  732 + })
731 }, 733 },
732 // 点击商家有礼 734 // 点击商家有礼
733 - gotoSellerGift(){  
734 - let url = util.http_build_query({ 735 + gotoSellerGift(e){
  736 + this.couponModal.closeModal()
  737 + const form = e.currentTarget.dataset['form'];
  738 + let url = util.http_build_query({
735 id: this.data.detail.id, 739 id: this.data.detail.id,
736 - }, '/pages/reserve/sellerGift')  
737 - wx.navigateTo({  
738 - url  
739 - }) 740 + form
  741 + }, '/pages/reserve/sellerGift')
  742 + wx.navigateTo({
  743 + url
  744 + })
740 }, 745 },
741 - // 再次预订  
742 - secondbook() {  
743 - wx.reportMonitor('1013', 1)  
744 - wx.redirectTo({  
745 - url: '/pages/reserve/shopHome?id=' + this.data.detail.seller.id  
746 - })  
747 - },  
748 - // 文字转语音的方法  
749 - textToSpeechFun(voice_info) {  
750 - console.log('voice_info', voice_info);  
751 - let that = this;  
752 - let data = this.data; 746 + // 再次预订
  747 + secondbook() {
  748 + wx.reportMonitor('1013', 1)
  749 + wx.redirectTo({
  750 + url: '/pages/reserve/shopHome?id=' + this.data.detail.seller.id
  751 + })
  752 + },
  753 + // 文字转语音的方法
  754 + textToSpeechFun(voice_info) {
  755 + console.log('voice_info', voice_info);
  756 + let that = this;
  757 + let data = this.data;
753 data.detail.rname = data.detail.rname.trim() 758 data.detail.rname = data.detail.rname.trim()
754 - let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';  
755 - let charArray = data.seller.deskStr.split('');  
756 - let modifiedArray = charArray.map(char => char + ' ');  
757 - let resultString = modifiedArray.join('').slice(0, -1);  
758 - const replacements = {  
759 - "{年月日}": data.seller.yearMonthDay,  
760 - "{月日}": data.seller.yearMonth,  
761 - "{餐段}": data.seller.soltName,  
762 - "{就餐时间}": data.seller.dateStr + data.seller.dateStrDivide,  
763 - "{包间名}": resultString,  
764 - "{区域名+包间名}": data.seller.tablesText,  
765 - "{经理名字}": data.staffinfo.name, 759 + let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
  760 + let charArray = data.seller.deskStr.split('');
  761 + let modifiedArray = charArray.map(char => char + ' ');
  762 + let resultString = modifiedArray.join('').slice(0, -1);
  763 + const replacements = {
  764 + "{年月日}": data.seller.yearMonthDay,
  765 + "{月日}": data.seller.yearMonth,
  766 + "{餐段}": data.seller.soltName,
  767 + "{就餐时间}": data.seller.dateStr + data.seller.dateStrDivide,
  768 + "{包间名}": resultString,
  769 + "{区域名+包间名}": data.seller.tablesText,
  770 + "{经理名字}": data.staffinfo.name,
766 "{客人姓名}": data.detail.rname ? (data.detail.rname + str) : str=='贵宾' ? '贵宾' : '', 771 "{客人姓名}": data.detail.rname ? (data.detail.rname + str) : str=='贵宾' ? '贵宾' : '',
767 - "{预订日期}": data.seller.yearMonthDay,  
768 - "{桌位}": resultString,  
769 - };  
770 - let newStr = voice_info.replace(/{预订日期}|{桌位}|{年月日}|{月日}|{餐段}|{就餐时间}|{包间名}|{区域名\+包间名}|{经理名字}|{客人姓名}/g, function (matched) {  
771 - return replacements[matched];  
772 - });  
773 - console.log('newStr', newStr);  
774 - plugin.textToSpeech({  
775 - lang: "zh_CN",  
776 - tts: true,  
777 - content: newStr,  
778 - success: function (res) {  
779 - that.filename = res.filename  
780 - that.speech()  
781 - },  
782 - fail: function (res) {  
783 - console.log("fail tts", res)  
784 - }  
785 - })  
786 - },  
787 - // 开启语音播报  
788 - speech() {  
789 - var attentionAnim = wx.createAnimation({  
790 - duration: 1000,  
791 - timingFunction: 'linear',  
792 - })  
793 - this.attentionAnim = attentionAnim  
794 - this.setData({  
795 - _attentionAnim: attentionAnim,  
796 - attentionAnim: attentionAnim.export()  
797 - })  
798 - this.audioCtx = wx.createInnerAudioContext()  
799 - this.audioCtx.src = this.filename  
800 - this.audioCtx.loop = true  
801 - this.audioCtx.play()  
802 - this.audioCtx.onPlay((e) => {  
803 - this.setData({  
804 - isPlay: this.audioCtx.paused ? '2' : '1'  
805 - })  
806 - })  
807 - this.audioCtx.onPause((e) => {  
808 - this.setData({  
809 - isPlay: this.audioCtx.paused ? '2' : '1'  
810 - })  
811 - })  
812 - clearInterval(this.timers)  
813 - this.animation()  
814 - },  
815 - // 持续旋转动画  
816 - animation() {  
817 - let that = this;  
818 - var time = setInterval(function () {  
819 - this.n = this.n + 1;  
820 - let attentionAnim = that.data._attentionAnim  
821 - attentionAnim.rotate(180 * (this.n)).step()  
822 - that.setData({  
823 - attentionAnim: attentionAnim.export(),  
824 - })  
825 - }.bind(this), 1000)  
826 - this.timers = time;  
827 - },  
828 - // 暂停/继续播放  
829 - stopMusic() {  
830 - if (this.data.isPlay == '2') { // 2 暂停状态  
831 - console.log("开始");  
832 - clearInterval(this.timers)  
833 - this.animation()  
834 - this.audioCtx.play() //开始  
835 - return;  
836 - }  
837 - if (this.data.isPlay == '1') { // 1 运行状态  
838 - console.log('暂停');  
839 - if (this.n % 2 != 0) {  
840 - this.n = this.n + 1;  
841 - let attentionAnim = this.data._attentionAnim;  
842 - attentionAnim.rotate(180 * this.n).step();  
843 - this.setData({  
844 - attentionAnim: attentionAnim.export(),  
845 - })  
846 - }  
847 - clearInterval(this.timers)  
848 - this.audioCtx.pause() //暂停  
849 - return;  
850 - }  
851 - },  
852 - // 根据充值ID获取充值详情  
853 - getRechargeDetail(id) {  
854 - App.Activity.GetNewRecharge({  
855 - id  
856 - }).then(res => { 772 + "{预订日期}": data.seller.yearMonthDay,
  773 + "{桌位}": resultString,
  774 + };
  775 + let newStr = voice_info.replace(/{预订日期}|{桌位}|{年月日}|{月日}|{餐段}|{就餐时间}|{包间名}|{区域名\+包间名}|{经理名字}|{客人姓名}/g, function (matched) {
  776 + return replacements[matched];
  777 + });
  778 + console.log('newStr', newStr);
  779 + plugin.textToSpeech({
  780 + lang: "zh_CN",
  781 + tts: true,
  782 + content: newStr,
  783 + success: function (res) {
  784 + that.filename = res.filename
  785 + that.speech()
  786 + },
  787 + fail: function (res) {
  788 + console.log("fail tts", res)
  789 + }
  790 + })
  791 + },
  792 + // 开启语音播报
  793 + speech() {
  794 + var attentionAnim = wx.createAnimation({
  795 + duration: 1000,
  796 + timingFunction: 'linear',
  797 + })
  798 + this.attentionAnim = attentionAnim
  799 + this.setData({
  800 + _attentionAnim: attentionAnim,
  801 + attentionAnim: attentionAnim.export()
  802 + })
  803 + this.audioCtx = wx.createInnerAudioContext()
  804 + this.audioCtx.src = this.filename
  805 + this.audioCtx.loop = true
  806 + this.audioCtx.play()
  807 + this.audioCtx.onPlay((e) => {
  808 + this.setData({
  809 + isPlay: this.audioCtx.paused ? '2' : '1'
  810 + })
  811 + })
  812 + this.audioCtx.onPause((e) => {
  813 + this.setData({
  814 + isPlay: this.audioCtx.paused ? '2' : '1'
  815 + })
  816 + })
  817 + clearInterval(this.timers)
  818 + this.animation()
  819 + },
  820 + // 持续旋转动画
  821 + animation() {
  822 + let that = this;
  823 + var time = setInterval(function () {
  824 + this.n = this.n + 1;
  825 + let attentionAnim = that.data._attentionAnim
  826 + attentionAnim.rotate(180 * (this.n)).step()
  827 + that.setData({
  828 + attentionAnim: attentionAnim.export(),
  829 + })
  830 + }.bind(this), 1000)
  831 + this.timers = time;
  832 + },
  833 + // 暂停/继续播放
  834 + stopMusic() {
  835 + if (this.data.isPlay == '2') { // 2 暂停状态
  836 + console.log("开始");
  837 + clearInterval(this.timers)
  838 + this.animation()
  839 + this.audioCtx.play() //开始
  840 + return;
  841 + }
  842 + if (this.data.isPlay == '1') { // 1 运行状态
  843 + console.log('暂停');
  844 + if (this.n % 2 != 0) {
  845 + this.n = this.n + 1;
  846 + let attentionAnim = this.data._attentionAnim;
  847 + attentionAnim.rotate(180 * this.n).step();
  848 + this.setData({
  849 + attentionAnim: attentionAnim.export(),
  850 + })
  851 + }
  852 + clearInterval(this.timers)
  853 + this.audioCtx.pause() //暂停
  854 + return;
  855 + }
  856 + },
  857 + // 根据充值ID获取充值详情
  858 + getRechargeDetail(id) {
  859 + App.Activity.GetNewRecharge({
  860 + id
  861 + }).then(res => {
857 let detail = res.data 862 let detail = res.data
858 - let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : ''  
859 - let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : ''  
860 - let priceInfo, scoreInfo, certificate;  
861 - detail.recharge_list = recharge_list;  
862 - detail.exp_date = exp_date;  
863 - if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';  
864 - if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';  
865 - if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 863 + let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : ''
  864 + let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : ''
  865 + let priceInfo, scoreInfo, certificate;
  866 + detail.recharge_list = recharge_list;
  867 + detail.exp_date = exp_date;
  868 + if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
  869 + if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
  870 + if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
866 let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : '' 871 let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
867 console.log('邀请函--------------充值',recharge_data); 872 console.log('邀请函--------------充值',recharge_data);
868 this.setData({ 873 this.setData({
869 - recharge_data,  
870 - scoreInfo,  
871 - priceInfo,  
872 - certificate  
873 - })  
874 - }) 874 + recharge_data,
  875 + scoreInfo,
  876 + priceInfo,
  877 + certificate
  878 + })
  879 + })
875 }, 880 },
876 // 获取评价赠送的券最新详情 881 // 获取评价赠送的券最新详情
877 getEvaluateFun(id){ 882 getEvaluateFun(id){
@@ -889,54 +894,192 @@ Page({ @@ -889,54 +894,192 @@ Page({
889 } 894 }
890 }) 895 })
891 }, 896 },
892 - // 根据券ID获取券详情  
893 - getActivityByIdFun(ids, length) {  
894 - let coupon_dataList = [];  
895 - ids.forEach(i => {  
896 - App.Activity.GetActivityById({  
897 - id: i.id  
898 - }).then(res => {  
899 - if (res.data.length > 0) {  
900 - let detail = res.data[0];  
901 - detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';  
902 - detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';  
903 - detail.use = detail.use ? util.determine(detail.use) : '';  
904 - if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {  
905 - let cash = detail.use.cash * 1;  
906 - let price = detail.price * 1;  
907 - detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 897 + // 根据券ID获取券详情
  898 + getActivityByIdFun(obj) {
  899 + App.Activity.GetActivityById({
  900 + id: obj.map(item => item.id).join(','),
  901 + }).then(res => {
  902 + if (res.data.length > 0) {
  903 + let list = res.data.filter(item => {
  904 + return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
  905 + })
  906 + list.forEach(detail => {
  907 + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
  908 + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  909 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
  910 + detail.use = detail.use ? util.determine(detail.use) : '';
  911 + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
  912 + let cash = detail.use.cash * 1;
  913 + let price = detail.price * 1;
  914 + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
908 } 915 }
909 - coupon_dataList.push(detail);  
910 - if (length === coupon_dataList.length) {  
911 - coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})  
912 - console.log('邀请函--------------------优惠券',coupon_dataList);  
913 - this.setData({  
914 - coupon_dataList,  
915 - })  
916 - }  
917 - }  
918 - })  
919 - })  
920 - },  
921 - /**  
922 - * 生命周期函数--监听页面隐藏  
923 - */  
924 - onHide() {  
925 - clearInterval(this.timers)  
926 - if (this.audioCtx) {  
927 - this.audioCtx.destroy(); // 释放音频资源  
928 - }  
929 - }, 916 + let num = detail.receiveNum;
  917 + if (num > 0) {
  918 + detail.receiveNumText = ''
  919 + if (num >= 0 && num <= 100) {
  920 + detail.receiveNumText = num.toString();
  921 + } else if (num >= 101 && num <= 199) {
  922 + detail.receiveNumText = '100+';
  923 + } else if (num >= 200 && num <= 299) {
  924 + detail.receiveNumText = '200+';
  925 + } else {
  926 + detail.receiveNumText = Math.floor(num / 100) * 100 + '+';
  927 + }
  928 + }
  929 + if (detail.exp_date && detail.exp_date.week_data) {
  930 + let noon = this.hasConsecutiveSelect(detail.exp_date.week_data, '1').rArr.join('、')
  931 + let nig = this.hasConsecutiveSelect(detail.exp_date.week_data, '2').rArr.join('、')
  932 + if (noon) noon = '午餐:' + noon
  933 + if (nig) nig = '晚餐:' + nig
  934 + detail.noonText = noon;
  935 + detail.nigText = nig;
  936 + }
  937 + })
  938 + let freeCoupons = list.filter(item => {
  939 + return item.is_type == '3'
  940 + })
  941 + // 免费券判断是否领取,弹框领取
  942 + if (freeCoupons.length > 0) {
  943 + let length = freeCoupons.length - 1
  944 + freeCoupons.forEach(i => {
  945 + this.getCoupon(i, freeCoupons[length].id, obj)
  946 + })
  947 + }
  948 + console.log('邀请函--------------------优惠券', list);
  949 + this.setData({
  950 + coupon_dataList: list,
  951 + })
  952 + }
  953 + })
  954 + },
  955 + // 获取所有的券并且展示
  956 + addCoupons(coupons, couponList) {
  957 + if (coupons && util.getType(coupons) == 'object') {
  958 + couponList.push({
  959 + id: coupon.id,
  960 + number: coupon.number
  961 + });
  962 + }
  963 + if (coupons && util.getType(coupons) === 'array' && coupons.length > 0) {
  964 + coupons.forEach(item => {
  965 + couponList.push({
  966 + id: item.id,
  967 + number: item.number
  968 + });
  969 + });
  970 + }
  971 + return couponList
  972 + },
  973 + // 弹框领取免费券
  974 + setcouponFun(arr) {
  975 + let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
  976 + console.log('弹框领取免费券id', str);
  977 + App.Activity.SetActivityAsReserve({
  978 + aid: str,
  979 + rid: this.id,
  980 + }).then((json) => {
  981 + if (json.ret != 200) {
  982 + wx.showToast({
  983 + title: res.msg,
  984 + duration: 2000,
  985 + mask: true
  986 + })
  987 + }
  988 + })
  989 + },
  990 + // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
  991 + getCoupon(item, id, obj) {
  992 + let couponArr = this.data.couponArr;
  993 + let totalPrice = this.data.totalPrice;
  994 + App.Activity.ActivityListByOpenid({
  995 + aid: item.id
  996 + }).then(res => {
  997 + if (res.ret == 200) {
  998 + if (res.data.length == 0) {
  999 + couponArr.push(item)
  1000 + }
  1001 + if (item.id == id && couponArr.length > 0) {
  1002 + couponArr.forEach(item => {
  1003 + let match = obj.find(b => b.id === item.id);
  1004 + if (match) {
  1005 + item.number = match.number;
  1006 + }
  1007 + });
  1008 + totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
  1009 + this.setcouponFun(couponArr)
  1010 + this.couponModal.showModal()
  1011 + }
  1012 + console.log('未领取的券列表-----------', couponArr);
  1013 + this.setData({
  1014 + couponArr,
  1015 + totalPrice
  1016 + })
  1017 + }
  1018 + })
  1019 + },
  1020 + // 处理优惠券不可用日期数据
  1021 + hasConsecutiveSelect(arr, type) {
  1022 + let firstTitle = null;
  1023 + let lastTitle = null;
  1024 + let rArr = []
  1025 + let num = 0
  1026 + for (let i = 0; i < arr.length; i++) {
  1027 + let str = type == '1' ? arr[i].selectNoon : arr[i].selectNig
  1028 + if (str) {
  1029 + rArr.push(arr[i].title)
  1030 + num++
  1031 + if (num == 1) {
  1032 + firstTitle = arr[i].title
  1033 + }
  1034 + if (num >= 5) {
  1035 + lastTitle = arr[i].title
  1036 + }
  1037 + if (num >= 5 && i >= (arr.length - 1)) {
  1038 + let fi = rArr.findIndex((item) => {
  1039 + return item == firstTitle
  1040 + })
  1041 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1042 + num = 0
  1043 + }
  1044 + } else {
  1045 + if (num < 5) {
  1046 + num = 0
  1047 + firstTitle = null;
  1048 + lastTitle = null;
  1049 + } else {
  1050 + let fi = rArr.findIndex((item) => {
  1051 + return item == firstTitle
  1052 + })
  1053 + rArr.splice(fi, num, firstTitle + '至' + lastTitle)
  1054 + num = 0
  1055 + }
  1056 + }
  1057 + }
  1058 + return {
  1059 + rArr,
  1060 + lastTitle,
  1061 + firstTitle
  1062 + };
  1063 + },
  1064 + /**
  1065 + * 生命周期函数--监听页面隐藏
  1066 + */
  1067 + onHide() {
  1068 + clearInterval(this.timers)
  1069 + if (this.audioCtx) {
  1070 + this.audioCtx.destroy(); // 释放音频资源
  1071 + }
  1072 + },
930 1073
931 - /**  
932 - * 生命周期函数--监听页面卸载  
933 - */  
934 - onUnload() {  
935 - clearInterval(this.timers)  
936 - if (this.audioCtx) {  
937 - this.audioCtx.destroy(); // 释放音频资源  
938 - }  
939 - }, 1074 + /**
  1075 + * 生命周期函数--监听页面卸载
  1076 + */
  1077 + onUnload() {
  1078 + clearInterval(this.timers)
  1079 + if (this.audioCtx) {
  1080 + this.audioCtx.destroy(); // 释放音频资源
  1081 + }
  1082 + },
940 // 设置虚拟到店时间 1083 // 设置虚拟到店时间
941 bindPickerChange: function(e) { 1084 bindPickerChange: function(e) {
942 let index = e.detail.value 1085 let index = e.detail.value
@@ -985,57 +1128,57 @@ Page({ @@ -985,57 +1128,57 @@ Page({
985 computeHour (time1, time2, interval) { 1128 computeHour (time1, time2, interval) {
986 //time1 开始时间 time2结束时间 interval间隔时长 1129 //time1 开始时间 time2结束时间 interval间隔时长
987 function getTimeList (time1, time2, interval) { 1130 function getTimeList (time1, time2, interval) {
988 - var timeList = [];  
989 - time1 = time1.split(":");  
990 - time2 = time2.split(":");  
991 - time1 = new Date(0, 0, 0, time1[0], time1[1], 0);  
992 - time2 = new Date(0, 0, 0, time2[0], time2[1], 0);  
993 - interval = interval * 60 * 1000;  
994 - while (time1 <= time2) {  
995 - timeList.push(time1.format("hh:mm"));  
996 - time1 = new Date(time1.getTime() + interval);  
997 - }  
998 - return timeList; 1131 + var timeList = [];
  1132 + time1 = time1.split(":");
  1133 + time2 = time2.split(":");
  1134 + time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
  1135 + time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
  1136 + interval = interval * 60 * 1000;
  1137 + while (time1 <= time2) {
  1138 + timeList.push(time1.format("hh:mm"));
  1139 + time1 = new Date(time1.getTime() + interval);
  1140 + }
  1141 + return timeList;
999 } 1142 }
1000 Date.prototype.format = function (format) { 1143 Date.prototype.format = function (format) {
1001 - var date = {  
1002 - "M+": this.getMonth() + 1,  
1003 - "d+": this.getDate(),  
1004 - "h+": this.getHours(),  
1005 - "m+": this.getMinutes(),  
1006 - "s+": this.getSeconds(),  
1007 - "q+": Math.floor((this.getMonth() + 3) / 3),  
1008 - S: this.getMilliseconds(),  
1009 - };  
1010 - if (/(y+)/.test(format))  
1011 - format = format.replace(  
1012 - RegExp.$1,  
1013 - (this.getFullYear() + "").substr(4 - RegExp.$1.length)  
1014 - );  
1015 - for (var k in date)  
1016 - if (new RegExp("(" + k + ")").test(format))  
1017 - format = format.replace(  
1018 - RegExp.$1,  
1019 - RegExp.$1.length == 1  
1020 - ? date[k]  
1021 - : ("00" + date[k]).substr(("" + date[k]).length)  
1022 - );  
1023 - return format; 1144 + var date = {
  1145 + "M+": this.getMonth() + 1,
  1146 + "d+": this.getDate(),
  1147 + "h+": this.getHours(),
  1148 + "m+": this.getMinutes(),
  1149 + "s+": this.getSeconds(),
  1150 + "q+": Math.floor((this.getMonth() + 3) / 3),
  1151 + S: this.getMilliseconds(),
  1152 + };
  1153 + if (/(y+)/.test(format))
  1154 + format = format.replace(
  1155 + RegExp.$1,
  1156 + (this.getFullYear() + "").substr(4 - RegExp.$1.length)
  1157 + );
  1158 + for (var k in date)
  1159 + if (new RegExp("(" + k + ")").test(format))
  1160 + format = format.replace(
  1161 + RegExp.$1,
  1162 + RegExp.$1.length == 1
  1163 + ? date[k]
  1164 + : ("00" + date[k]).substr(("" + date[k]).length)
  1165 + );
  1166 + return format;
1024 }; 1167 };
1025 return getTimeList(time1, time2, interval); 1168 return getTimeList(time1, time2, interval);
1026 }, 1169 },
1027 1170
1028 - /**  
1029 - * 页面相关事件处理函数--监听用户下拉动作  
1030 - */  
1031 - onPullDownRefresh() { 1171 + /**
  1172 + * 页面相关事件处理函数--监听用户下拉动作
  1173 + */
  1174 + onPullDownRefresh() {
1032 1175
1033 - }, 1176 + },
1034 1177
1035 - /**  
1036 - * 页面上拉触底事件的处理函数  
1037 - */  
1038 - onReachBottom() { 1178 + /**
  1179 + * 页面上拉触底事件的处理函数
  1180 + */
  1181 + onReachBottom() {
1039 1182
1040 - }, 1183 + },
1041 }) 1184 })
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 <image wx:if="{{hasValueBroadcast && reserve && reserve.swich_voice && reserve.swich_voice=='1'}}" class="musicImg" src="{{isPlay=='1'?'https://qn.colorcun.com/open.svg':'https://qn.colorcun.com/close.svg'}}" bindtap="stopMusic" animation="{{attentionAnim}}" /> 5 <image wx:if="{{hasValueBroadcast && reserve && reserve.swich_voice && reserve.swich_voice=='1'}}" class="musicImg" src="{{isPlay=='1'?'https://qn.colorcun.com/open.svg':'https://qn.colorcun.com/close.svg'}}" bindtap="stopMusic" animation="{{attentionAnim}}" />
6 <image class="giftImg" 6 <image class="giftImg"
7 bindtap="gotoSellerGift" 7 bindtap="gotoSellerGift"
8 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}" 8 + data-form="1"
  9 + wx:if="{{(hasValueCertificate && marketing && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
9 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 10 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
10 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 11 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
11 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 12 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -87,29 +88,49 @@ @@ -87,29 +88,49 @@
87 </block> 88 </block>
88 </view> 89 </view>
89 </view> 90 </view>
90 - <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 91 + <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && coupon_dataList.length>0}}">
91 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 92 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
92 - <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> 93 + <navigator url="/pack-activity/pack/{{item.is_type == '3'?'receiveCoupon':'buyCoupon'}}?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
93 <view class="preferentialItems"> 94 <view class="preferentialItems">
94 <view class="itemLeft"> 95 <view class="itemLeft">
95 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 96 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  97 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
96 <view class="priceText" wx:if="{{item.price}}"> 98 <view class="priceText" wx:if="{{item.price}}">
97 - <view class="icons font40r">¥</view>{{item.price}} 99 + <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
98 </view> 100 </view>
  101 + <view class="icons font20r" wx:if="{{item.is_type == '3' && item.desc!='0'}}">消费满{{item.desc}}元可用</view>
99 </view> 102 </view>
  103 + <view class="couponLine"></view>
100 <view class="itemRight"> 104 <view class="itemRight">
101 <view class="btns"> 105 <view class="btns">
102 <text class="font40r">{{item.aname}}</text> 106 <text class="font40r">{{item.aname}}</text>
103 - <view class="font24r orderingFood">  
104 - 抢购  
105 - </view> 107 + <block wx:if="{{item.is_type == '1' || item.is_type == '2'}}">
  108 + <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</view>
  109 + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">
  110 + 无限制{{item.desc?','+item.desc+'。':'。'}}
  111 + </view>
  112 + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">
  113 + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}}
  114 + </view>
  115 + </block>
  116 + <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
  117 + <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
  118 + <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
  119 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  120 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
  121 + <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
  122 + <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
  123 + </block>
106 </view> 124 </view>
107 - <text wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom font24r">{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}</text>  
108 - <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r">  
109 - 无限制{{item.desc?','+item.desc+'。':'。'}} 125 + <view class="btnBox" wx:if="{{item.is_type == '3'}}" >
  126 + <view class="font24r orderingFood orderingFood1">已领取</view>
  127 + <view class="grantNum" wx:if="{{item.receiveNumText}}">
  128 + <view class="font24r">已被领取</view>
  129 + <view class="font24r"><text>{{item.receiveNumText}}</text>张</view>
  130 + </view>
110 </view> 131 </view>
111 - <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r">  
112 - 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} 132 + <view wx:if="{{item.is_type != '3'}}" class="font24r orderingFood">
  133 + 立即抢购
113 </view> 134 </view>
114 </view> 135 </view>
115 </view> 136 </view>
@@ -258,7 +279,7 @@ @@ -258,7 +279,7 @@
258 </view> 279 </view>
259 </view> 280 </view>
260 </view> 281 </view>
261 - <view class="introduce {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}"> 282 + <view class="introduce rechargeBox {{(marketing.is_online_book=='1' && options.onlineReserve == '1') || (detail.status !='4' && options.isOrder != '1' && paymentId && paymentStatus == '0') || (detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc)?'introduceBottom':''}}">
262 <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}"> 283 <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
263 <block wx:if="{{titleType}}"> 284 <block wx:if="{{titleType}}">
264 <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 285 <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
@@ -324,4 +345,24 @@ @@ -324,4 +345,24 @@
324 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button> 345 <button wx:if="{{detail.status !='4' && options.isOrder != '1' && marketing.is_transpond=='1' && imgSrc}}" class="flex-cc font30r btnsRight" open-type="share">立即转发</button>
325 </view> 346 </view>
326 </view> 347 </view>
  348 +</my-modal>
  349 +<my-modal id="couponModal" fadeStyle="slideUp" height="240px">
  350 + <view slot="modalName" class="titleModal {{(couponArr.length == '2' || couponArr.length < '2') ? 'titleModal2 ' : (couponArr.length == '4' || couponArr.length < '4') ? 'titleModal3 ' : (couponArr.length > '4') ? 'titleModal4' : '' }}">
  351 + <image bindtap="closeCouponModal" class="closeImg" src="https://qn.colorcun.com/closeOutline.png" mode=""/>
  352 + <view class="nameInfo">{{seller.name||reserve.seller_name}}</view>
  353 + <view class="couponTotal">赠送给您<text>{{totalPrice}}元</text>代金券</view>
  354 + </view>
  355 + <view slot="modalContent">
  356 + <view class="couponBox">
  357 + <view wx:for="{{couponArr}}" class="couponItems">
  358 + <view class="couponNum font20r">×{{item.number}}</view>
  359 + <view class="font36r couponPrice">¥<text>{{item.price}}</text></view>
  360 + <view class="couponLines"></view>
  361 + <view class="font28r couponCondition" wx:if="{{item.desc!='0'}}">消费满{{item.desc}}元可用</view>
  362 + <view class="font28r couponCondition" wx:else>无门槛</view>
  363 + </view>
  364 + </view>
  365 + <view bindtap="closeCouponModal" class="couponBtn font36r">我知道了</view>
  366 + <view class="couponText font24r" bindtap="gotoSellerGift" data-form="2">查看更多</view>
  367 + </view>
327 </my-modal> 368 </my-modal>
@@ -326,13 +326,18 @@ @@ -326,13 +326,18 @@
326 padding: 40rpx 40rpx 0 40rpx; 326 padding: 40rpx 40rpx 0 40rpx;
327 } 327 }
328 328
  329 +.preferentialCoupon .nodate{
  330 + margin-left: 20rpx;
  331 +}
  332 +
329 .preferentialItems { 333 .preferentialItems {
330 display: flex; 334 display: flex;
331 - background: url('https://qn.colorcun.com/certificateBj1.png') no-repeat;  
332 - background-size: 100% 100%; 335 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
333 margin-bottom: 20rpx; 336 margin-bottom: 20rpx;
334 min-height: 160rpx; 337 min-height: 160rpx;
335 padding-bottom: 10rpx; 338 padding-bottom: 10rpx;
  339 + border-radius: 20rpx;
  340 + border: 2rpx solid #ff7e06;
336 } 341 }
337 342
338 .rechargeItems { 343 .rechargeItems {
@@ -344,7 +349,8 @@ @@ -344,7 +349,8 @@
344 align-items: center; 349 align-items: center;
345 height: auto; 350 height: auto;
346 padding: 12rpx 0; 351 padding: 12rpx 0;
347 - margin: 0 20rpx; 352 + margin: 0 20rpx;
  353 + border: none;
348 } 354 }
349 355
350 .itemLeft { 356 .itemLeft {
@@ -373,6 +379,20 @@ @@ -373,6 +379,20 @@
373 top: 12rpx; 379 top: 12rpx;
374 } 380 }
375 381
  382 +.discountText1{
  383 + text-align: center;
  384 + color: #FD4D59;
  385 + border: 2rpx solid #FD4D59;
  386 + border-radius: 6rpx;
  387 + font-family: PingFang SC;
  388 + background: transparent;
  389 + width: max-content;
  390 + padding: 0 6rpx;
  391 + position: absolute;
  392 + left: 16rpx;
  393 + top: 12rpx;
  394 +}
  395 +
376 .priceText { 396 .priceText {
377 font-family: 'Abel'; 397 font-family: 'Abel';
378 color: #E34D59; 398 color: #E34D59;
@@ -382,9 +402,7 @@ @@ -382,9 +402,7 @@
382 } 402 }
383 403
384 .priceText .icons { 404 .priceText .icons {
385 - font-family: 'Abel';  
386 color: #FD4D59; 405 color: #FD4D59;
387 - font-size: 40rpx;  
388 } 406 }
389 407
390 .itemRight { 408 .itemRight {
@@ -398,6 +416,7 @@ @@ -398,6 +416,7 @@
398 display: flex; 416 display: flex;
399 justify-content: space-between; 417 justify-content: space-between;
400 align-items: baseline; 418 align-items: baseline;
  419 + flex-direction: column;
401 } 420 }
402 421
403 .orderingFood { 422 .orderingFood {
@@ -414,10 +433,88 @@ @@ -414,10 +433,88 @@
414 flex-shrink: 0; 433 flex-shrink: 0;
415 } 434 }
416 435
  436 +.preferentialCoupon .itemRight {
  437 + width: 74%;
  438 + display: flex;
  439 + align-items: center;
  440 +}
  441 +
  442 +.preferentialCoupon .itemLeft {
  443 + width: 26%;
  444 +}
  445 +
  446 +.preferentialCoupon .couponLine{
  447 + margin: 24rpx 0;
  448 + border-right: 2rpx dashed #f6231b;
  449 +}
  450 +
  451 +.preferentialCoupon .orderingFood {
  452 + padding: 0 20rpx;
  453 + color: #fff !important;
  454 + border: none !important;
  455 + text-align: center;
  456 + border-radius: 20rpx;
  457 + line-height: 44rpx;
  458 + height: 44rpx;
  459 + width: max-content;
  460 + flex-shrink: 0;
  461 + background: linear-gradient(94.4deg, #f41919 2.72%, #ff7426 122.17%);
  462 +}
  463 +.preferentialCoupon .icons {
  464 + color: #F6231B;
  465 + text-align: center;
  466 +}
  467 +
  468 +.preferentialCoupon .priceText {
  469 + display: flex;
  470 + align-items: baseline;
  471 + justify-content: center;
  472 + font-family: PingFang SC;
  473 + color: #F6231B;
  474 + font-weight: 600;
  475 + font-size: 48rpx;
  476 + margin-top: 6rpx;
  477 +}
  478 +
  479 +.preferentialCoupon .priceText text {
  480 + font-size: 48rpx;
  481 +}
  482 +
  483 +.preferentialCoupon .btns {
  484 + flex: 1;
  485 +}
  486 +.preferentialCoupon .btnBox {
  487 + display: flex;
  488 + flex-direction: column;
  489 +}
  490 +
  491 +.preferentialCoupon .grantNum {
  492 + display: flex;
  493 + flex-direction: column;
  494 + align-items: center;
  495 + color: #C36607;
  496 + margin-top: 10rpx;
  497 +}
  498 +
  499 +.preferentialCoupon .grantNum text {
  500 + color: #F6231B;
  501 + margin-right: 10rpx;
  502 +}
  503 +
  504 +.preferentialCoupon .btns text {
  505 + font-weight: 600;
  506 +}
  507 +
  508 +.preferentialCoupon .orderingFood1 {
  509 + border: 2rpx solid #fa4b20 !important;
  510 + background: transparent !important;
  511 + color: #fa4b20 !important;
  512 +}
  513 +
417 .bottom { 514 .bottom {
418 - margin-top: 10rpx; 515 + margin-top: 4rpx;
419 width: 100%; 516 width: 100%;
420 - color: #0B0805; 517 + color: #C36607;
421 font-family: PingFang SC; 518 font-family: PingFang SC;
422 font-weight: 500; 519 font-weight: 500;
423 display: -webkit-box; 520 display: -webkit-box;
@@ -839,6 +936,145 @@ @@ -839,6 +936,145 @@
839 box-sizing: border-box; 936 box-sizing: border-box;
840 } 937 }
841 938
  939 +#couponModal .titleModal {
  940 + margin-top: 30%;
  941 + position: relative;
  942 +}
  943 +
  944 +#couponModal .titleModal2 {
  945 + margin-top: 80%;
  946 +}
  947 +
  948 +#couponModal .titleModal3 {
  949 + margin-top: 60%;
  950 +}
  951 +
  952 +#couponModal .titleModal4 {
  953 + margin-top: 30%;
  954 +}
  955 +
  956 +#couponModal .mymodal {
  957 + background: rgba(0, 0, 0, 0.8);
  958 + width: 100% !important;
  959 + top: 0 !important;
  960 + height: auto !important;
  961 + z-index: 300;
  962 +}
  963 +
  964 +.nameInfo {
  965 + font-family: PingFang SC;
  966 + font-weight: 400;
  967 + font-size: 52rpx;
  968 + line-height: 56rpx;
  969 + color: #fff;
  970 + margin-bottom: 40rpx;
  971 + padding-top: 60rpx;
  972 +}
  973 +
  974 +.couponTotal {
  975 + color: #dfdfdf;
  976 + font-family: PingFang SC;
  977 + font-weight: 400;
  978 + font-size: 40rpx;
  979 + line-height: 48rpx;
  980 + margin-bottom: 40rpx;
  981 + display: flex;
  982 + align-items: center;
  983 + justify-content: center;
  984 +}
  985 +
  986 +.couponTotal text {
  987 + color: #ffc806;
  988 + font-weight: 600;
  989 + font-size: 80rpx;
  990 + margin: 0 14rpx;
  991 +}
  992 +
  993 +.couponBox {
  994 + width: 80%;
  995 + margin: 0 auto;
  996 + display: flex;
  997 + flex-wrap: wrap;
  998 + justify-content: space-evenly;
  999 +}
  1000 +
  1001 +.couponItems {
  1002 + width: 46%;
  1003 + margin-bottom: 24rpx;
  1004 + padding-bottom: 52rpx;
  1005 + border-radius: 20rpx;
  1006 + border: 2rpx solid #ff7e06;
  1007 + background: linear-gradient(180deg, #ffefd0 0%, #ffdc9b 100%);
  1008 +}
  1009 +
  1010 +.couponNum {
  1011 + background: #727272;
  1012 + border-radius: 50%;
  1013 + color: #fff;
  1014 + width: 40rpx;
  1015 + height: 40rpx;
  1016 + display: flex;
  1017 + align-items: center;
  1018 + justify-content: center;
  1019 + margin: 8rpx 0 0 8rpx;
  1020 +}
  1021 +
  1022 +.couponPrice {
  1023 + display: flex;
  1024 + align-items: center;
  1025 + justify-content: center;
  1026 + color: #F6231B;
  1027 + font-weight: 500;
  1028 +}
  1029 +
  1030 +.couponLines{
  1031 + width: 80%;
  1032 + margin: 0 auto;
  1033 + height: 2rpx;
  1034 + border-bottom: 2rpx dashed #F6231B;
  1035 +}
  1036 +
  1037 +.couponPrice text {
  1038 + margin-left: 4rpx;
  1039 + font-size: 76rpx;
  1040 + font-weight: 700;
  1041 +}
  1042 +
  1043 +.couponCondition {
  1044 + color: #C36607;
  1045 + display: flex;
  1046 + align-items: center;
  1047 + justify-content: center;
  1048 + padding-top: 24rpx;
  1049 +}
  1050 +
  1051 +.couponBtn {
  1052 + width: 80%;
  1053 + margin: 0 auto;
  1054 + border-radius: 42rpx;
  1055 + background: linear-gradient(90.98deg, #f41919 0.25%, #ff7426 120.07%);
  1056 + font-weight: 400;
  1057 + color: #fff;
  1058 + text-align: center;
  1059 + border: 4rpx solid #fff;
  1060 + padding: 12rpx 0;
  1061 + margin: 16rpx auto 20rpx auto;
  1062 +}
  1063 +
  1064 +.couponText {
  1065 + color: #fff;
  1066 + text-decoration: underline;
  1067 + text-align: center;
  1068 +}
  1069 +
  1070 +.closeImg {
  1071 + width: 60rpx;
  1072 + height: 60rpx;
  1073 + position: absolute;
  1074 + right: 0;
  1075 + top: 0;
  1076 +}
  1077 +
842 /* 模板9 */ 1078 /* 模板9 */
843 .viewBox9 { 1079 .viewBox9 {
844 background: #23201e; 1080 background: #23201e;
@@ -853,8 +1089,8 @@ @@ -853,8 +1089,8 @@
853 background: rgba(11, 8, 5, 0.85); 1089 background: rgba(11, 8, 5, 0.85);
854 } 1090 }
855 1091
856 -.viewBox9 .btns text,  
857 -.viewBox9 .bottom, 1092 +.viewBox9 .rechargeBox .btns text,
  1093 +.viewBox9 .rechargeBox .bottom,
858 .viewBox9 .itemBottom, 1094 .viewBox9 .itemBottom,
859 .viewBox9+.sharewidth .shareItem { 1095 .viewBox9+.sharewidth .shareItem {
860 color: #0B0805; 1096 color: #0B0805;
@@ -887,12 +1123,12 @@ @@ -887,12 +1123,12 @@
887 background: rgba(117, 1, 0, 0.75); 1123 background: rgba(117, 1, 0, 0.75);
888 } 1124 }
889 1125
890 -.viewBox10 .btns text,  
891 -.viewBox10 .bottom, 1126 +.viewBox10 .rechargeBox .btns text,
  1127 +.viewBox10 .rechargeBox .bottom,
892 .viewBox10 .itemBottom, 1128 .viewBox10 .itemBottom,
893 .viewBox10+.sharewidth .shareItem, 1129 .viewBox10+.sharewidth .shareItem,
894 -.viewBox17 .btns text,  
895 -.viewBox17 .bottom, 1130 +.viewBox17 .rechargeBox .btns text,
  1131 +.viewBox17 .rechargeBox .bottom,
896 .viewBox17 .itemBottom, 1132 .viewBox17 .itemBottom,
897 .viewBox17+.sharewidth .shareItem { 1133 .viewBox17+.sharewidth .shareItem {
898 color: #750100; 1134 color: #750100;
@@ -927,12 +1163,12 @@ @@ -927,12 +1163,12 @@
927 background: rgba(33, 74, 165, 0.7); 1163 background: rgba(33, 74, 165, 0.7);
928 } 1164 }
929 1165
930 -.viewBox11 .btns text,  
931 -.viewBox11 .bottom, 1166 +.viewBox11 .rechargeBox .btns text,
  1167 +.viewBox11 .rechargeBox .bottom,
932 .viewBox11 .itemBottom, 1168 .viewBox11 .itemBottom,
933 .viewBox11+.sharewidth .shareItem, 1169 .viewBox11+.sharewidth .shareItem,
934 -.viewBox12 .btns text,  
935 -.viewBox12 .bottom, 1170 +.viewBox12 .rechargeBox .btns text,
  1171 +.viewBox12 .rechargeBox .bottom,
936 .viewBox12 .itemBottom, 1172 .viewBox12 .itemBottom,
937 .viewBox12+.sharewidth .shareItem { 1173 .viewBox12+.sharewidth .shareItem {
938 color: #0B1A67; 1174 color: #0B1A67;
@@ -977,12 +1213,12 @@ @@ -977,12 +1213,12 @@
977 background: rgba(33, 89, 96, 0.35); 1213 background: rgba(33, 89, 96, 0.35);
978 } 1214 }
979 1215
980 -.viewBox13 .btns text,  
981 -.viewBox13 .bottom, 1216 +.viewBox13 .rechargeBox .btns text,
  1217 +.viewBox13 .rechargeBox .bottom,
982 .viewBox13 .itemBottom, 1218 .viewBox13 .itemBottom,
983 .viewBox13+.sharewidth .shareItem, 1219 .viewBox13+.sharewidth .shareItem,
984 -.viewBox15 .btns text,  
985 -.viewBox15 .bottom, 1220 +.viewBox15 .rechargeBox .btns text,
  1221 +.viewBox15 .rechargeBox .bottom,
986 .viewBox15 .itemBottom, 1222 .viewBox15 .itemBottom,
987 .viewBox15+.sharewidth .shareItem { 1223 .viewBox15+.sharewidth .shareItem {
988 color: #215960; 1224 color: #215960;
@@ -1021,12 +1257,12 @@ @@ -1021,12 +1257,12 @@
1021 background: rgba(11, 8, 5, 0.35); 1257 background: rgba(11, 8, 5, 0.35);
1022 } 1258 }
1023 1259
1024 -.viewBox14 .btns text,  
1025 -.viewBox14 .bottom, 1260 +.viewBox14 .rechargeBox .btns text,
  1261 +.viewBox14 .rechargeBox .bottom,
1026 .viewBox14 .itemBottom, 1262 .viewBox14 .itemBottom,
1027 .viewBox14+.sharewidth .shareItem, 1263 .viewBox14+.sharewidth .shareItem,
1028 -.viewBox16 .btns text,  
1029 -.viewBox16 .bottom, 1264 +.viewBox16 .rechargeBox .btns text,
  1265 +.viewBox16 .rechargeBox .bottom,
1030 .viewBox16 .itemBottom, 1266 .viewBox16 .itemBottom,
1031 .viewBox16+.sharewidth .shareItem { 1267 .viewBox16+.sharewidth .shareItem {
1032 color: #0B0805; 1268 color: #0B0805;
@@ -217,6 +217,7 @@ Page({ @@ -217,6 +217,7 @@ Page({
217 list.forEach(detail => { 217 list.forEach(detail => {
218 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : ''; 218 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
219 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : ''; 219 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  220 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
220 detail.use = detail.use ? util.determine(detail.use) : ''; 221 detail.use = detail.use ? util.determine(detail.use) : '';
221 if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) { 222 if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
222 let cash = detail.use.cash * 1; 223 let cash = detail.use.cash * 1;
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 <view class="couponWrap"> 10 <view class="couponWrap">
11 <view class="itemLeft"> 11 <view class="itemLeft">
12 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 12 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  13 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
13 <view class="priceText" wx:if="{{item.price}}"> 14 <view class="priceText" wx:if="{{item.price}}">
14 <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text> 15 <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
15 </view> 16 </view>
@@ -31,8 +32,8 @@ @@ -31,8 +32,8 @@
31 <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}"> 32 <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
32 <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view> 33 <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
33 <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view> 34 <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
34 - <view wx:if="{{item.noonText}}" class="bottom font24r">{{item.noonText}}</view>  
35 - <view wx:if="{{item.nigText}}" class="bottom font24r">{{item.nigText}}</view> 35 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  36 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
36 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view> 37 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
37 <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view> 38 <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
38 </block> 39 </block>
@@ -31,6 +31,10 @@ page { @@ -31,6 +31,10 @@ page {
31 color: #000; 31 color: #000;
32 } 32 }
33 33
  34 +.couponWrap .nodate{
  35 + margin-left: 20rpx;
  36 +}
  37 +
34 .preferentialItems { 38 .preferentialItems {
35 display: flex; 39 display: flex;
36 margin-bottom: 20rpx; 40 margin-bottom: 20rpx;
@@ -153,6 +157,20 @@ page { @@ -153,6 +157,20 @@ page {
153 background: #F6231B; 157 background: #F6231B;
154 } 158 }
155 159
  160 +.couponWrap .discountText1{
  161 + text-align: center;
  162 + color: #FD4D59;
  163 + border: 2rpx solid #FD4D59;
  164 + border-radius: 6rpx;
  165 + font-family: PingFang SC;
  166 + background: transparent;
  167 + width: max-content;
  168 + padding: 0 6rpx;
  169 + position: absolute;
  170 + left: 16rpx;
  171 + top: 12rpx;
  172 +}
  173 +
156 .itemLeft { 174 .itemLeft {
157 width: 30%; 175 width: 30%;
158 display: flex; 176 display: flex;
@@ -259,6 +259,7 @@ Page({ @@ -259,6 +259,7 @@ Page({
259 list.forEach(detail => { 259 list.forEach(detail => {
260 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : ''; 260 detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : '';
261 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : ''; 261 detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : '';
  262 + detail.arule = detail.arule ? util.determine(detail.arule) : '';
262 detail.use = detail.use ? util.determine(detail.use) : ''; 263 detail.use = detail.use ? util.determine(detail.use) : '';
263 if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) { 264 if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) {
264 let cash = detail.use.cash * 1; 265 let cash = detail.use.cash * 1;
@@ -326,18 +327,18 @@ Page({ @@ -326,18 +327,18 @@ Page({
326 setcouponFun(arr) { 327 setcouponFun(arr) {
327 let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(','); 328 let str = arr.flatMap(item => Array(item.number).fill(item.id)).join(',');
328 console.log('弹框领取免费券id', str); 329 console.log('弹框领取免费券id', str);
329 - // App.Activity.SetActivityAsReserve({  
330 - // aid: str,  
331 - // rid: this.id,  
332 - // }).then((json) => {  
333 - // if (json.ret != 200) {  
334 - // wx.showToast({  
335 - // title: res.msg,  
336 - // duration: 2000,  
337 - // mask: true  
338 - // })  
339 - // }  
340 - // }) 330 + App.Activity.SetActivityAsReserve({
  331 + aid: str,
  332 + rid: this.id,
  333 + }).then((json) => {
  334 + if (json.ret != 200) {
  335 + wx.showToast({
  336 + title: res.msg,
  337 + duration: 2000,
  338 + mask: true
  339 + })
  340 + }
  341 + })
341 }, 342 },
342 // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr 343 // 免费券 0未领取 1已领取 获取未领取的组成数组couponArr
343 getCoupon(item, id, obj) { 344 getCoupon(item, id, obj) {
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 <view class="couponWrap"> 25 <view class="couponWrap">
26 <view class="itemLeft"> 26 <view class="itemLeft">
27 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 27 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
  28 + <view class="discountText1 font20r" wx:if="{{item.is_type == '3'}}">{{item.arule.is_accumulation == '1' ? '可' : '不可'}}叠加</view>
28 <view class="priceText" wx:if="{{item.price}}"> 29 <view class="priceText" wx:if="{{item.price}}">
29 <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text> 30 <view class="icons font24r">¥</view><text class="font40r">{{item.price}}</text>
30 </view> 31 </view>
@@ -46,8 +47,8 @@ @@ -46,8 +47,8 @@
46 <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}"> 47 <block wx:if="{{item.is_type == '3' || item.is_type == '4'}}">
47 <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view> 48 <view wx:if="{{item.is_type == '3' && item.aexpiration}}" class="bottom font24r">领取后{{item.aexpiration}}天有效</view>
48 <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view> 49 <view wx:if="{{item.noonText || item.noonText}}" class="bottom font24r">不可用日期:</view>
49 - <view wx:if="{{item.noonText}}" class="bottom font24r">{{item.noonText}}</view>  
50 - <view wx:if="{{item.nigText}}" class="bottom font24r">{{item.nigText}}</view> 50 + <view wx:if="{{item.noonText}}" class="bottom font24r nodate">{{item.noonText}}</view>
  51 + <view wx:if="{{item.nigText}}" class="bottom font24r nodate">{{item.nigText}}</view>
51 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view> 52 <view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font24r">无使用时间限制</view>
52 <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view> 53 <view wx:if="{{item.is_type == '4' && item.desc!='0'}}" class="bottom font24r">消费满{{item.desc}}元可用</view>
53 </block> 54 </block>
@@ -203,6 +203,10 @@ @@ -203,6 +203,10 @@
203 margin-bottom: 20rpx; 203 margin-bottom: 20rpx;
204 } 204 }
205 205
  206 +.couponWrap .nodate{
  207 + margin-left: 20rpx;
  208 +}
  209 +
206 .preferentialItems { 210 .preferentialItems {
207 padding: 20rpx 30rpx 20rpx 20rpx; 211 padding: 20rpx 30rpx 20rpx 20rpx;
208 display: flex; 212 display: flex;
@@ -454,6 +458,20 @@ @@ -454,6 +458,20 @@
454 top: 12rpx; 458 top: 12rpx;
455 } 459 }
456 460
  461 +.couponWrap .discountText1{
  462 + text-align: center;
  463 + color: #FD4D59;
  464 + border: 2rpx solid #FD4D59;
  465 + border-radius: 6rpx;
  466 + font-family: PingFang SC;
  467 + background: transparent;
  468 + width: max-content;
  469 + padding: 0 6rpx;
  470 + position: absolute;
  471 + left: 16rpx;
  472 + top: 12rpx;
  473 +}
  474 +
457 #couponModal .titleModal { 475 #couponModal .titleModal {
458 margin-top: 30%; 476 margin-top: 30%;
459 position: relative; 477 position: relative;