Showing
18 changed files
with
526 additions
and
16 deletions
| @@ -73,7 +73,8 @@ | @@ -73,7 +73,8 @@ | ||
| 73 | "pages/customer/detail_owner_invitation_new", | 73 | "pages/customer/detail_owner_invitation_new", |
| 74 | "pages/customer/detail_owner_invitation9", | 74 | "pages/customer/detail_owner_invitation9", |
| 75 | "pages/me/invitation", | 75 | "pages/me/invitation", |
| 76 | - "pages/reserve/index_new" | 76 | + "pages/reserve/index_new", |
| 77 | + "pages/reserve/sellerGift" | ||
| 77 | ], | 78 | ], |
| 78 | "requiredPrivateInfos": [ | 79 | "requiredPrivateInfos": [ |
| 79 | "getLocation", | 80 | "getLocation", |
| @@ -291,7 +291,7 @@ Page({ | @@ -291,7 +291,7 @@ Page({ | ||
| 291 | (detail.tables[0].tid == 2 ? '包间' : ''); | 291 | (detail.tables[0].tid == 2 ? '包间' : ''); |
| 292 | } | 292 | } |
| 293 | if (detail.rname && detail.sex != 3) { | 293 | if (detail.rname && detail.sex != 3) { |
| 294 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '' ) | 294 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '' ) |
| 295 | } else { | 295 | } else { |
| 296 | detail.rnameStr = detail.rname | 296 | detail.rnameStr = detail.rname |
| 297 | } | 297 | } |
| @@ -518,7 +518,7 @@ Page({ | @@ -518,7 +518,7 @@ Page({ | ||
| 518 | } | 518 | } |
| 519 | detail.rname = detail.rname.trim() | 519 | detail.rname = detail.rname.trim() |
| 520 | if (detail.rname && detail.sex != 3) { | 520 | if (detail.rname && detail.sex != 3) { |
| 521 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 521 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 522 | } else if (!detail.rname && detail.sex == 4) { | 522 | } else if (!detail.rname && detail.sex == 4) { |
| 523 | detail.rnameStr = '贵宾' | 523 | detail.rnameStr = '贵宾' |
| 524 | } else { | 524 | } else { |
| @@ -518,7 +518,7 @@ Page({ | @@ -518,7 +518,7 @@ Page({ | ||
| 518 | } | 518 | } |
| 519 | detail.rname = detail.rname.trim() | 519 | detail.rname = detail.rname.trim() |
| 520 | if (detail.rname && detail.sex != 3) { | 520 | if (detail.rname && detail.sex != 3) { |
| 521 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 521 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 522 | } else if (!detail.rname && detail.sex == 4) { | 522 | } else if (!detail.rname && detail.sex == 4) { |
| 523 | detail.rnameStr = '贵宾' | 523 | detail.rnameStr = '贵宾' |
| 524 | } else { | 524 | } else { |
| @@ -518,7 +518,7 @@ Page({ | @@ -518,7 +518,7 @@ Page({ | ||
| 518 | } | 518 | } |
| 519 | detail.rname = detail.rname.trim() | 519 | detail.rname = detail.rname.trim() |
| 520 | if (detail.rname && detail.sex != 3) { | 520 | if (detail.rname && detail.sex != 3) { |
| 521 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 521 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 522 | } else if (!detail.rname && detail.sex == 4) { | 522 | } else if (!detail.rname && detail.sex == 4) { |
| 523 | detail.rnameStr = '贵宾' | 523 | detail.rnameStr = '贵宾' |
| 524 | } else { | 524 | } else { |
| @@ -517,7 +517,7 @@ Page({ | @@ -517,7 +517,7 @@ Page({ | ||
| 517 | } | 517 | } |
| 518 | detail.rname = detail.rname.trim() | 518 | detail.rname = detail.rname.trim() |
| 519 | if (detail.rname && detail.sex != 3) { | 519 | if (detail.rname && detail.sex != 3) { |
| 520 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 520 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 521 | } else if (!detail.rname && detail.sex == 4) { | 521 | } else if (!detail.rname && detail.sex == 4) { |
| 522 | detail.rnameStr = '贵宾' | 522 | detail.rnameStr = '贵宾' |
| 523 | } else { | 523 | } else { |
| @@ -467,7 +467,7 @@ Page({ | @@ -467,7 +467,7 @@ Page({ | ||
| 467 | } | 467 | } |
| 468 | detail.rname = detail.rname.trim() | 468 | detail.rname = detail.rname.trim() |
| 469 | if (detail.rname && detail.sex != 3) { | 469 | if (detail.rname && detail.sex != 3) { |
| 470 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 470 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 471 | } else if (!detail.rname && detail.sex == 4) { | 471 | } else if (!detail.rname && detail.sex == 4) { |
| 472 | detail.rnameStr = '贵宾' | 472 | detail.rnameStr = '贵宾' |
| 473 | } else { | 473 | } else { |
| @@ -518,7 +518,7 @@ Page({ | @@ -518,7 +518,7 @@ Page({ | ||
| 518 | } | 518 | } |
| 519 | detail.rname = detail.rname.trim() | 519 | detail.rname = detail.rname.trim() |
| 520 | if (detail.rname && detail.sex != 3) { | 520 | if (detail.rname && detail.sex != 3) { |
| 521 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 521 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 522 | } else if (!detail.rname && detail.sex == 4) { | 522 | } else if (!detail.rname && detail.sex == 4) { |
| 523 | detail.rnameStr = '贵宾' | 523 | detail.rnameStr = '贵宾' |
| 524 | } else { | 524 | } else { |
| @@ -517,7 +517,7 @@ Page({ | @@ -517,7 +517,7 @@ Page({ | ||
| 517 | } | 517 | } |
| 518 | detail.rname = detail.rname.trim() | 518 | detail.rname = detail.rname.trim() |
| 519 | if (detail.rname && detail.sex != 3) { | 519 | if (detail.rname && detail.sex != 3) { |
| 520 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 520 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 521 | } else if (!detail.rname && detail.sex == 4) { | 521 | } else if (!detail.rname && detail.sex == 4) { |
| 522 | detail.rnameStr = '贵宾' | 522 | detail.rnameStr = '贵宾' |
| 523 | } else { | 523 | } else { |
| @@ -97,7 +97,13 @@ Page({ | @@ -97,7 +97,13 @@ Page({ | ||
| 97 | "lauchOpts": options, //渠道分析 | 97 | "lauchOpts": options, //渠道分析 |
| 98 | }); | 98 | }); |
| 99 | const systemInfo = wx.getSystemInfoSync(); | 99 | const systemInfo = wx.getSystemInfoSync(); |
| 100 | - this.screenHeight = systemInfo.windowHeight; // 获取屏幕高度 | 100 | + this.screenHeight = systemInfo.windowHeight; // 获取屏幕高度 |
| 101 | + // wx.onUserCaptureScreen(function(res) { | ||
| 102 | + // wx.showToast({ | ||
| 103 | + // icon:'none', | ||
| 104 | + // title: '建议直接转发,分享给朋友!', | ||
| 105 | + // }) | ||
| 106 | + // }) | ||
| 101 | }, | 107 | }, |
| 102 | // 页面滚动事件 | 108 | // 页面滚动事件 |
| 103 | onPageScroll: function (event) { | 109 | onPageScroll: function (event) { |
| @@ -537,7 +543,7 @@ Page({ | @@ -537,7 +543,7 @@ Page({ | ||
| 537 | } | 543 | } |
| 538 | detail.rname = detail.rname.trim() | 544 | detail.rname = detail.rname.trim() |
| 539 | if (detail.rname && detail.sex != 3) { | 545 | if (detail.rname && detail.sex != 3) { |
| 540 | - detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') | 546 | + detail.rnameStr = detail.rname + (detail.sex == 1 ? '先生' : detail.sex == 2 ? '女士' : detail.sex == 4 ? '贵宾' : '') |
| 541 | } else if (!detail.rname && detail.sex == 4) { | 547 | } else if (!detail.rname && detail.sex == 4) { |
| 542 | detail.rnameStr = '贵宾' | 548 | detail.rnameStr = '贵宾' |
| 543 | } else { | 549 | } else { |
| @@ -586,7 +592,7 @@ Page({ | @@ -586,7 +592,7 @@ Page({ | ||
| 586 | if (marketing) { | 592 | if (marketing) { |
| 587 | is_comments = marketing.is_comments ? marketing.is_comments : ''; | 593 | is_comments = marketing.is_comments ? marketing.is_comments : ''; |
| 588 | coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; | 594 | coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; |
| 589 | - } | 595 | + } |
| 590 | // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 | 596 | // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 |
| 591 | if (coupon && util.getType(coupon) == 'object') { | 597 | if (coupon && util.getType(coupon) == 'object') { |
| 592 | couponList.push({ | 598 | couponList.push({ |
| @@ -677,7 +683,16 @@ Page({ | @@ -677,7 +683,16 @@ Page({ | ||
| 677 | }).catch(res => { | 683 | }).catch(res => { |
| 678 | console.log('GetSellerTemplateConf请求失败'); | 684 | console.log('GetSellerTemplateConf请求失败'); |
| 679 | }) | 685 | }) |
| 680 | - }, | 686 | + }, |
| 687 | + // 点击商家有礼 | ||
| 688 | + gotoSellerGift(){ | ||
| 689 | + let url = util.http_build_query({ | ||
| 690 | + id: this.data.detail.id, | ||
| 691 | + }, '/pages/reserve/sellerGift') | ||
| 692 | + wx.navigateTo({ | ||
| 693 | + url | ||
| 694 | + }) | ||
| 695 | + }, | ||
| 681 | // 再次预订 | 696 | // 再次预订 |
| 682 | secondbook() { | 697 | secondbook() { |
| 683 | wx.reportMonitor('1013', 1) | 698 | wx.reportMonitor('1013', 1) |
| @@ -3,7 +3,11 @@ | @@ -3,7 +3,11 @@ | ||
| 3 | <nav hasHome id='nav' backgroundColor="{{show_white ? colors : 'transparent'}}" place="{{false}}"></nav> | 3 | <nav hasHome id='nav' backgroundColor="{{show_white ? colors : 'transparent'}}" place="{{false}}"></nav> |
| 4 | <scroll-view scroll-y class="viewBox viewBox{{StyleType}}"> | 4 | <scroll-view scroll-y class="viewBox viewBox{{StyleType}}"> |
| 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 wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> | 6 | + <!-- <image class="giftImg" |
| 7 | + bindtap="gotoSellerGift" | ||
| 8 | + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments) || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" | ||
| 9 | + 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" /> | ||
| 7 | <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> | 11 | <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> |
| 8 | <view class="reservationInfo" style="background: url('{{settingUrl}}') no-repeat;background-size:cover;"> | 12 | <view class="reservationInfo" style="background: url('{{settingUrl}}') no-repeat;background-size:cover;"> |
| 9 | <view class="infoTop"> | 13 | <view class="infoTop"> |
| @@ -189,7 +193,7 @@ | @@ -189,7 +193,7 @@ | ||
| 189 | </view> | 193 | </view> |
| 190 | </view> | 194 | </view> |
| 191 | <view class="introduce introduceBottom"> | 195 | <view class="introduce introduceBottom"> |
| 192 | - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> | 196 | + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> |
| 193 | <block wx:if="{{titleType}}"> | 197 | <block wx:if="{{titleType}}"> |
| 194 | <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> | 198 | <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> |
| 195 | </block> | 199 | </block> |
| @@ -699,6 +699,15 @@ | @@ -699,6 +699,15 @@ | ||
| 699 | background: #FFEFC5; | 699 | background: #FFEFC5; |
| 700 | } | 700 | } |
| 701 | 701 | ||
| 702 | +.giftImg{ | ||
| 703 | + width: 108rpx; | ||
| 704 | + height: 108rpx; | ||
| 705 | + position: fixed !important; | ||
| 706 | + right: 5%; | ||
| 707 | + top: 33%; | ||
| 708 | + z-index: 200; | ||
| 709 | +} | ||
| 710 | + | ||
| 702 | /* 模板9 */ | 711 | /* 模板9 */ |
| 703 | .viewBox9 { | 712 | .viewBox9 { |
| 704 | background: #23201e; | 713 | background: #23201e; |
miniprogram/pages/image/concat.jpg
deleted
100644 → 0
3.73 KB
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <nav id="nav">周到安排</nav> | 2 | <nav id="nav">周到安排</nav> |
| 3 | <image class="imgTop" src="https://qn.colorcun.com/homeTop.png" mode="widthFix" /> | 3 | <image class="imgTop" src="https://qn.colorcun.com/homeTop.png" mode="widthFix" /> |
| 4 | <view class="page-section page-section-spacing swiper"> | 4 | <view class="page-section page-section-spacing swiper"> |
| 5 | - <swiper autoplay="true"> | 5 | + <swiper autoplay="true" circular="{{true}}"> |
| 6 | <block wx:for="{{background}}" wx:key="item"> | 6 | <block wx:for="{{background}}" wx:key="item"> |
| 7 | <swiper-item> | 7 | <swiper-item> |
| 8 | <image class="imgs" src="{{item}}" mode="widthFix" /> | 8 | <image class="imgs" src="{{item}}" mode="widthFix" /> |
miniprogram/pages/reserve/sellerGift.js
0 → 100644
| 1 | +// pages/reserve/sellerGift.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +import RS from '../../utils/reserveStatus' | ||
| 5 | +Page({ | ||
| 6 | + /** | ||
| 7 | + * 页面的初始数据 | ||
| 8 | + */ | ||
| 9 | + data: { | ||
| 10 | + options: {}, | ||
| 11 | + marketing: {}, | ||
| 12 | + recharge_data: {}, | ||
| 13 | + coupon_dataList: [], | ||
| 14 | + seller: { | ||
| 15 | + name: '', | ||
| 16 | + tablesText: '', | ||
| 17 | + date: '', | ||
| 18 | + addr: '' | ||
| 19 | + }, | ||
| 20 | + StyleType: '', | ||
| 21 | + priceInfo: '', | ||
| 22 | + scoreInfo: '', | ||
| 23 | + discount: '', | ||
| 24 | + certificate: '', | ||
| 25 | + dataStr: Date.now() * 1 / 1000, | ||
| 26 | + is_comments: '0', | ||
| 27 | + is_user_comments: false, | ||
| 28 | + hasValueCertificate: false, //商家是否开通优惠券功能 | ||
| 29 | + hasValueRecharge: false, //商家是否开通充值功能 | ||
| 30 | + couponData: '', //评价赠送优惠券数据 | ||
| 31 | + }, | ||
| 32 | + /** | ||
| 33 | + * 生命周期函数--监听页面加载 | ||
| 34 | + */ | ||
| 35 | + onLoad(options) { | ||
| 36 | + this.id = options.id | ||
| 37 | + let param = { | ||
| 38 | + options: options | ||
| 39 | + } | ||
| 40 | + console.log('options', options); | ||
| 41 | + this.setData(param) | ||
| 42 | + }, | ||
| 43 | + // 去评价 | ||
| 44 | + evaluateFun() { | ||
| 45 | + let url = util.http_build_query({ | ||
| 46 | + sellerName: this.data.seller.name, | ||
| 47 | + sellerid: this.data.seller.sid, | ||
| 48 | + oid: this.data.options.id, | ||
| 49 | + types: '1', | ||
| 50 | + previousPage: '1', | ||
| 51 | + }, '/pages/pinglun/createOpinion') | ||
| 52 | + wx.navigateTo({ | ||
| 53 | + url | ||
| 54 | + }) | ||
| 55 | + }, | ||
| 56 | + /** | ||
| 57 | + * 生命周期函数--监听页面显示 | ||
| 58 | + */ | ||
| 59 | + onShow: function () { | ||
| 60 | + this.getDetail() | ||
| 61 | + }, | ||
| 62 | + // 获取店铺详情 | ||
| 63 | + getDetail() { | ||
| 64 | + App.Reserve.Detail({ | ||
| 65 | + openid: getApp().openid, | ||
| 66 | + rid: this.data.options.id | ||
| 67 | + }).then(res => { | ||
| 68 | + let reserev = RS.reserve(res.data) | ||
| 69 | + this.setData({ | ||
| 70 | + is_user_comments: res.data.is_user_comments, | ||
| 71 | + seller: { | ||
| 72 | + name: reserev.seller.sellername, | ||
| 73 | + sid: reserev.sid, | ||
| 74 | + } | ||
| 75 | + }) | ||
| 76 | + console.log('reserev reserev', reserev); | ||
| 77 | + setTimeout(() => { | ||
| 78 | + this.getSellerVersionFun(reserev.sid); | ||
| 79 | + this.getSellerTemplateConfFun(reserev.sid); | ||
| 80 | + }, 0); | ||
| 81 | + }).catch(res => { | ||
| 82 | + console.log(res, '详情请求失败'); | ||
| 83 | + }) | ||
| 84 | + }, | ||
| 85 | + // 获取商家版本,不是超能版或者没有开通对应模块,不显示 | ||
| 86 | + getSellerVersionFun(sellerid) { | ||
| 87 | + App.SellerVersion.GetSellerVersion({ | ||
| 88 | + sellerid | ||
| 89 | + }).then((res) => { | ||
| 90 | + let data = res.data; | ||
| 91 | + console.log('版本列表', data); | ||
| 92 | + if (data && data.length > 0) { | ||
| 93 | + data.sort((a, b) => b.cdate * 1 - a.cdate * 1); | ||
| 94 | + // 获取店铺当前版本 (cdate最大最后一个充入的 && 当前时间有效 && 当前版本) | ||
| 95 | + let obj = data.find(item => item.vtype == 1 || item.vtype == 2 || item.vtype == 4); | ||
| 96 | + console.log('当前版本', { | ||
| 97 | + ...obj | ||
| 98 | + }); | ||
| 99 | + // 优惠券功能:超能版 || 高级版 || 有优惠券模块 | ||
| 100 | + const hasValueCertificate = obj.vtype == '1' || obj.vtype == '4' || data.some(item => item.vid == '8'); | ||
| 101 | + // 充值功能:超能版 || 有充值模块 | ||
| 102 | + const hasValueRecharge = obj.vtype == '1' || data.some(item => item.vid == '9'); | ||
| 103 | + this.setData({ | ||
| 104 | + hasValueCertificate, | ||
| 105 | + hasValueRecharge, | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + }) | ||
| 109 | + }, | ||
| 110 | + // 获取商家设置营销信息 | ||
| 111 | + getSellerTemplateConfFun(sid) { | ||
| 112 | + console.log(sid, 'sidsidsidsid'); | ||
| 113 | + App.Seller.GetSellerTemplateConf({ | ||
| 114 | + sid | ||
| 115 | + }).then(res => { | ||
| 116 | + let data = res.data | ||
| 117 | + console.log('data', data); | ||
| 118 | + let couponList = [] | ||
| 119 | + let StyleType, couponData, marketing, coupon, is_comments; | ||
| 120 | + marketing = util.determine(data.marketing); | ||
| 121 | + StyleType = data.type; | ||
| 122 | + if (marketing) { | ||
| 123 | + is_comments = marketing.is_comments ? marketing.is_comments : ''; | ||
| 124 | + coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; | ||
| 125 | + couponData = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : ''; | ||
| 126 | + couponData = couponData && couponData.length > 0 ? couponData[0] : {} | ||
| 127 | + if ((couponData.use && (!couponData.use.is_cash || couponData.use.is_cash == '1'))) { | ||
| 128 | + let cash = couponData.use.cash * 1; | ||
| 129 | + let price = couponData.price * 1; | ||
| 130 | + couponData.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 | ||
| 134 | + if (coupon && util.getType(coupon) == 'object') { | ||
| 135 | + couponList.push({ | ||
| 136 | + id: coupon.id | ||
| 137 | + }); | ||
| 138 | + } | ||
| 139 | + if (coupon && util.getType(coupon) == 'array') { | ||
| 140 | + if (coupon.length > 0) { | ||
| 141 | + coupon.forEach(item => { | ||
| 142 | + couponList.push({ | ||
| 143 | + id: item.id | ||
| 144 | + }) | ||
| 145 | + }) | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + let obj = { | ||
| 149 | + marketing, | ||
| 150 | + coupon, | ||
| 151 | + couponList, | ||
| 152 | + is_comments, | ||
| 153 | + couponData, | ||
| 154 | + StyleType, | ||
| 155 | + } | ||
| 156 | + console.log('获取数据', { | ||
| 157 | + ...obj | ||
| 158 | + }); | ||
| 159 | + // 根据券ID获取券详情 | ||
| 160 | + this.getActivityByIdFun(couponList, couponList.length) | ||
| 161 | + // 根据充值ID获取充值详情 | ||
| 162 | + if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) { | ||
| 163 | + this.getRechargeDetail(marketing.recharge_data.id) | ||
| 164 | + } | ||
| 165 | + this.setData({ | ||
| 166 | + marketing, | ||
| 167 | + coupon, | ||
| 168 | + is_comments, | ||
| 169 | + couponList, | ||
| 170 | + couponData, | ||
| 171 | + StyleType, | ||
| 172 | + }) | ||
| 173 | + }).catch(res => { | ||
| 174 | + console.log('GetSellerTemplateConf请求失败'); | ||
| 175 | + }) | ||
| 176 | + }, | ||
| 177 | + // 根据充值ID获取充值详情 | ||
| 178 | + getRechargeDetail(id) { | ||
| 179 | + App.Activity.GetNewRecharge({ | ||
| 180 | + id | ||
| 181 | + }).then(res => { | ||
| 182 | + let detail = res.data | ||
| 183 | + let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : '' | ||
| 184 | + let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : '' | ||
| 185 | + let priceInfo, scoreInfo, certificate; | ||
| 186 | + detail.recharge_list = recharge_list; | ||
| 187 | + detail.exp_date = exp_date; | ||
| 188 | + if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; | ||
| 189 | + if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; | ||
| 190 | + if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); | ||
| 191 | + this.setData({ | ||
| 192 | + recharge_data: detail, | ||
| 193 | + scoreInfo, | ||
| 194 | + priceInfo, | ||
| 195 | + certificate | ||
| 196 | + }) | ||
| 197 | + }) | ||
| 198 | + }, | ||
| 199 | + // 根据券ID获取券详情 | ||
| 200 | + getActivityByIdFun(ids, length) { | ||
| 201 | + let coupon_dataList = []; | ||
| 202 | + ids.forEach(i => { | ||
| 203 | + App.Activity.GetActivityById({ | ||
| 204 | + id: i.id | ||
| 205 | + }).then(res => { | ||
| 206 | + if (res.data.length > 0) { | ||
| 207 | + let detail = res.data[0]; | ||
| 208 | + detail.stringifyUse = detail.use ? JSON.stringify(detail.use) : ''; | ||
| 209 | + detail.exp_date = detail.exp_date ? util.determine(detail.exp_date) : ''; | ||
| 210 | + detail.use = detail.use ? util.determine(detail.use) : ''; | ||
| 211 | + if ((detail.use && (!detail.use.is_cash || detail.use.is_cash == '1'))) { | ||
| 212 | + let cash = detail.use.cash * 1; | ||
| 213 | + let price = detail.price * 1; | ||
| 214 | + detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; | ||
| 215 | + } | ||
| 216 | + coupon_dataList.push(detail); | ||
| 217 | + if (length === ids.length) { | ||
| 218 | + this.setData({ | ||
| 219 | + coupon_dataList, | ||
| 220 | + }) | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + }) | ||
| 224 | + }) | ||
| 225 | + }, | ||
| 226 | + /** | ||
| 227 | + * 生命周期函数--监听页面隐藏 | ||
| 228 | + */ | ||
| 229 | + onHide() {}, | ||
| 230 | + | ||
| 231 | + /** | ||
| 232 | + * 生命周期函数--监听页面卸载 | ||
| 233 | + */ | ||
| 234 | + onUnload() {}, | ||
| 235 | + | ||
| 236 | + /** | ||
| 237 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 238 | + */ | ||
| 239 | + onPullDownRefresh() {}, | ||
| 240 | + | ||
| 241 | + /** | ||
| 242 | + * 页面上拉触底事件的处理函数 | ||
| 243 | + */ | ||
| 244 | + onReachBottom() { | ||
| 245 | + | ||
| 246 | + }, | ||
| 247 | +}) |
miniprogram/pages/reserve/sellerGift.json
0 → 100644
miniprogram/pages/reserve/sellerGift.wxml
0 → 100644
| 1 | +<!--pages/reserve/sellerGift.wxml--> | ||
| 2 | +<import src="../tpl/invitation"></import> | ||
| 3 | +<nav id='nav'>商家有礼</nav> | ||
| 4 | +<view class="box" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> | ||
| 5 | + <view class="title"> | ||
| 6 | + <view class="sign"></view><text class="font32r">专属优惠券</text> | ||
| 7 | + </view> | ||
| 8 | + <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> | ||
| 9 | + <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> | ||
| 10 | + <view class="itemLeft"> | ||
| 11 | + <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.use.is_dish=='1'}}" class="discountText font24r">特惠菜品</text> | ||
| 13 | + <text wx:if="{{item.use.is_discount=='1'}}" class="discountText font24r">超值折扣</text> | ||
| 14 | + <view class="priceText" wx:if="{{item.price}}"> | ||
| 15 | + <text class="icons font40r">¥</text><text>{{item.price}}</text> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | + <view class="itemRight"> | ||
| 19 | + <view class="btns"> | ||
| 20 | + <text class="font40r">{{item.aname}}</text> | ||
| 21 | + <navigator url="/pack-activity/pack/buyCoupon?id={{item.id}}&name={{seller.name}}&use={{item.stringifyUse}}&sid={{seller.sid}}&oid={{options.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | ||
| 22 | + <view class="font24r orderingFood"> | ||
| 23 | + 抢购 | ||
| 24 | + </view> | ||
| 25 | + </navigator> | ||
| 26 | + </view> | ||
| 27 | + <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> | ||
| 28 | + <view wx:if="{{item.exp_date.is_none=='1' || item.exp_date.is_none===true}}" class="bottom font24r"> | ||
| 29 | + 无限制{{item.desc?','+item.desc+'。':'。'}} | ||
| 30 | + </view> | ||
| 31 | + <view wx:if="{{item.exp_date.is_birthday=='1' || item.exp_date.is_birthday===true}}" class="bottom font24r"> | ||
| 32 | + 会员生日当天可用{{item.desc?','+item.desc+'。':'。'}} | ||
| 33 | + </view> | ||
| 34 | + </view> | ||
| 35 | + </view> | ||
| 36 | + </block> | ||
| 37 | +</view> | ||
| 38 | +<view class="box" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> | ||
| 39 | + <view class="title"> | ||
| 40 | + <view class="sign"></view><text class="font32r">会员充值优惠</text> | ||
| 41 | + </view> | ||
| 42 | + <view class="rechargeItems"> | ||
| 43 | + <view class="itemLeft"> | ||
| 44 | + <view class="itemTop font36r"> | ||
| 45 | + {{recharge_data.rname}} | ||
| 46 | + </view> | ||
| 47 | + <view class="itemBottom font24r" wx:if="{{priceInfo}}"> | ||
| 48 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 49 | + </view> | ||
| 50 | + <view class="bottom font24r" wx:if="{{scoreInfo}}"> | ||
| 51 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 52 | + </view> | ||
| 53 | + <view class="bottom font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 54 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。 | ||
| 55 | + </view> | ||
| 56 | + </view> | ||
| 57 | + <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{options.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover"> | ||
| 58 | + <view class="font24r orderingFood"> | ||
| 59 | + 充值 | ||
| 60 | + </view> | ||
| 61 | + </navigator> | ||
| 62 | + </view> | ||
| 63 | +</view> | ||
| 64 | +<!-- 启用评价 && 是否评价过 && 评价赠送优惠券 && 赠送的优惠券有数据--> | ||
| 65 | +<view class="box" wx:if="{{is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData}}"> | ||
| 66 | + <view class="title"> | ||
| 67 | + <view class="sign"></view><text class="font32r">反馈有礼</text> | ||
| 68 | + </view> | ||
| 69 | + <view class="preferentialItems" wx:if="{{couponData && dataStr<(couponData.etime*1) && couponData.status == '1'}}"> | ||
| 70 | + <view class="itemLeft"> | ||
| 71 | + <text wx:if="{{couponData.discount!='0.00' && (couponData.use.is_cash=='1' || couponData.use.is_cash) && couponData.discount}}" class="discountText font24r">{{couponData.discount}}折</text> | ||
| 72 | + <view class="priceText" wx:if="{{couponData.price}}"> | ||
| 73 | + <text class="icons font40r">¥</text><text>{{couponData.price}}</text> | ||
| 74 | + </view> | ||
| 75 | + </view> | ||
| 76 | + <view class="itemRight"> | ||
| 77 | + <view class="btns"> | ||
| 78 | + <text class="font40r">{{couponData.aname}}</text> | ||
| 79 | + <view bindtap="evaluateFun" class="font24r orderingFood"> | ||
| 80 | + 抢购 | ||
| 81 | + </view> | ||
| 82 | + </view> | ||
| 83 | + <text wx:if="{{couponData.exp_date.is_week=='1' || couponData.exp_date.is_week===true}}" class="bottom font24r">{{couponData.exp_date.week_show?couponData.exp_date.week_show+'可用':''}}{{couponData.desc?','+couponData.desc+'。':'。'}}</text> | ||
| 84 | + <view wx:if="{{couponData.exp_date.is_none=='1' || couponData.exp_date.is_none===true}}" class="bottom font24r"> | ||
| 85 | + 无限制{{couponData.desc?','+couponData.desc+'。':'。'}} | ||
| 86 | + </view> | ||
| 87 | + <view wx:if="{{couponData.exp_date.is_birthday=='1' || couponData.exp_date.is_birthday===true}}" class="bottom font24r"> | ||
| 88 | + 会员生日当天可用{{couponData.desc?','+couponData.desc+'。':'。'}} | ||
| 89 | + </view> | ||
| 90 | + </view> | ||
| 91 | + </view> | ||
| 92 | +</view> |
miniprogram/pages/reserve/sellerGift.wxss
0 → 100644
| 1 | +/* pages/reserve/sellerGift.wxss */ | ||
| 2 | +page { | ||
| 3 | + background: #F5F5F5; | ||
| 4 | +} | ||
| 5 | + | ||
| 6 | +.box { | ||
| 7 | + margin: 24rpx; | ||
| 8 | + border-radius: 10rpx; | ||
| 9 | + background: #fff; | ||
| 10 | + padding: 40rpx 20rpx; | ||
| 11 | + margin-bottom: 24rpx; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +.title { | ||
| 15 | + display: flex; | ||
| 16 | + align-items: center; | ||
| 17 | + border-bottom: 2rpx solid #dbdbdb; | ||
| 18 | + padding: 0 0 12rpx 24rpx; | ||
| 19 | + margin-bottom: 30rpx; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +.sign { | ||
| 23 | + width: 6rpx; | ||
| 24 | + height: 30rpx; | ||
| 25 | + border-radius: 16rpx; | ||
| 26 | + background: #0143a3; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +.title text { | ||
| 30 | + margin-left: 10rpx; | ||
| 31 | + color: #000; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +.preferentialItems { | ||
| 35 | + display: flex; | ||
| 36 | + margin-bottom: 20rpx; | ||
| 37 | + min-height: 160rpx; | ||
| 38 | + padding-bottom: 10rpx; | ||
| 39 | + background: #F8F9FD; | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +.itemLeft { | ||
| 43 | + width: 30%; | ||
| 44 | + display: flex; | ||
| 45 | + flex-direction: column; | ||
| 46 | + justify-content: center; | ||
| 47 | + position: relative; | ||
| 48 | + background: #0143A3; | ||
| 49 | + border-top-left-radius: 20rpx; | ||
| 50 | + border-bottom-left-radius: 20rpx; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +.priceText { | ||
| 54 | + font-family: 'Abel'; | ||
| 55 | + color: #fff; | ||
| 56 | + font-weight: 500; | ||
| 57 | + font-size: 64rpx; | ||
| 58 | + margin-top: 6rpx; | ||
| 59 | + display: flex; | ||
| 60 | + align-items: flex-end; | ||
| 61 | + justify-content: center; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +.priceText .icons { | ||
| 65 | + font-family: 'Abel'; | ||
| 66 | + color: #fff; | ||
| 67 | + font-size: 40rpx; | ||
| 68 | + margin-bottom: 8rpx; | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | +.discountText { | ||
| 72 | + background: #E4525E; | ||
| 73 | + color: #fff; | ||
| 74 | + border-radius: 4rpx; | ||
| 75 | + width: max-content; | ||
| 76 | + padding: 4rpx; | ||
| 77 | + margin-left: 16rpx; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +.itemRight { | ||
| 81 | + width: 70%; | ||
| 82 | + padding-right: 10rpx; | ||
| 83 | + margin-left: 18rpx; | ||
| 84 | + display: flex; | ||
| 85 | + flex-direction: column; | ||
| 86 | + justify-content: center; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +.btns { | ||
| 90 | + margin: 24rpx 20rpx 0 0; | ||
| 91 | + display: flex; | ||
| 92 | + justify-content: space-between; | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +.btns text { | ||
| 96 | + color: #000; | ||
| 97 | + font-family: "PingFang SC"; | ||
| 98 | + font-weight: 600; | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | +.orderingFood { | ||
| 102 | + padding: 0 40rpx; | ||
| 103 | + border-radius: 22rpx; | ||
| 104 | + text-align: center; | ||
| 105 | + color: #fff; | ||
| 106 | + border-radius: 20rpx; | ||
| 107 | + line-height: 44rpx; | ||
| 108 | + height: 44rpx; | ||
| 109 | + background: linear-gradient(95.61deg, #2186e2 0.55%, #054baa 130.76%); | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +.rechargeItems { | ||
| 113 | + background: url('https://nosqn.colorcun.com/certificateBjNew.png') no-repeat; | ||
| 114 | + background-size: 100% 100%; | ||
| 115 | + min-height: 160rpx; | ||
| 116 | + display: flex; | ||
| 117 | + justify-content: space-between; | ||
| 118 | + align-items: center; | ||
| 119 | + height: auto; | ||
| 120 | + padding: 12rpx 48rpx; | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | +.rechargeItems .itemLeft { | ||
| 124 | + width: 64%; | ||
| 125 | + background: transparent; | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +.itemTop { | ||
| 129 | + display: flex; | ||
| 130 | + width: 100%; | ||
| 131 | + align-items: center; | ||
| 132 | + font-family: 'Abel'; | ||
| 133 | + margin-bottom: 10rpx; | ||
| 134 | + font-weight: 600; | ||
| 135 | +} |
-
Please register or login to post a comment