Showing
12 changed files
with
233 additions
and
101 deletions
| @@ -6,7 +6,8 @@ Page({ | @@ -6,7 +6,8 @@ Page({ | ||
| 6 | */ | 6 | */ |
| 7 | data: { | 7 | data: { |
| 8 | opt: { | 8 | opt: { |
| 9 | - name: '唐人街1号中餐厅', | 9 | + name: '', |
| 10 | + id:'', | ||
| 10 | }, | 11 | }, |
| 11 | num: 1, | 12 | num: 1, |
| 12 | totalize: '', | 13 | totalize: '', |
| @@ -18,7 +19,13 @@ Page({ | @@ -18,7 +19,13 @@ Page({ | ||
| 18 | * 生命周期函数--监听页面加载 | 19 | * 生命周期函数--监听页面加载 |
| 19 | */ | 20 | */ |
| 20 | onLoad(options) { | 21 | onLoad(options) { |
| 21 | - this.data.opt.name = options.name | 22 | + this.setData({ |
| 23 | + opt:{ | ||
| 24 | + id:options.id, | ||
| 25 | + name:options.name, | ||
| 26 | + } | ||
| 27 | + }) | ||
| 28 | + console.log({...this.data.opt}); | ||
| 22 | }, | 29 | }, |
| 23 | 30 | ||
| 24 | /** | 31 | /** |
| 1 | // pack-activity/pack/confirmPayment.js | 1 | // pack-activity/pack/confirmPayment.js |
| 2 | +import util from '../../utils/util' | ||
| 2 | Page({ | 3 | Page({ |
| 3 | 4 | ||
| 4 | /** | 5 | /** |
| 5 | * 页面的初始数据 | 6 | * 页面的初始数据 |
| 6 | */ | 7 | */ |
| 7 | data: { | 8 | data: { |
| 9 | + type: '2', | ||
| 10 | + detail:{}, | ||
| 8 | time: 1800, | 11 | time: 1800, |
| 9 | countdown: '', | 12 | countdown: '', |
| 10 | tip: '', | 13 | tip: '', |
| 11 | - active: '2', | ||
| 12 | date: "", | 14 | date: "", |
| 13 | type: '2', | 15 | type: '2', |
| 14 | }, | 16 | }, |
| @@ -17,17 +19,41 @@ Page({ | @@ -17,17 +19,41 @@ Page({ | ||
| 17 | * 生命周期函数--监听页面加载 | 19 | * 生命周期函数--监听页面加载 |
| 18 | */ | 20 | */ |
| 19 | onLoad(options) { | 21 | onLoad(options) { |
| 22 | + this.setData({ | ||
| 23 | + opt:{ | ||
| 24 | + type:options.type, | ||
| 25 | + detail:JSON.parse(options.detail), | ||
| 26 | + } | ||
| 27 | + }) | ||
| 28 | + console.log('options.detail',JSON.parse(options.detail)); | ||
| 20 | this.countdown() | 29 | this.countdown() |
| 21 | this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 | 30 | this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 |
| 22 | }, | 31 | }, |
| 23 | showModal() { | 32 | showModal() { |
| 24 | this.modal.showModal() //调用组件中打开模态框方法 | 33 | this.modal.showModal() //调用组件中打开模态框方法 |
| 25 | }, | 34 | }, |
| 35 | + confirmPayment(){ | ||
| 36 | + }, | ||
| 26 | closeModal() { | 37 | closeModal() { |
| 27 | this.modal.closeModal() //调用组件中关闭模态框方法 | 38 | this.modal.closeModal() //调用组件中关闭模态框方法 |
| 28 | }, | 39 | }, |
| 40 | + // 充值————点击确认支付 | ||
| 29 | formSubmit(e) { | 41 | formSubmit(e) { |
| 30 | - console.log('form发生了submit事件,携带数据为:', e.detail.value) | 42 | + let form=e.detail.value |
| 43 | + console.log('form',form); | ||
| 44 | + if (!form.name) { | ||
| 45 | + util.toast('未填写姓名', 'none') | ||
| 46 | + return; | ||
| 47 | + } | ||
| 48 | + if (!form.phone) { | ||
| 49 | + util.toast('未填写手机号码', 'none') | ||
| 50 | + return; | ||
| 51 | + } | ||
| 52 | + if (!/^1\d{10}$/.test(form.phone)) { | ||
| 53 | + util.toast('手机号码错误', 'none') | ||
| 54 | + return; | ||
| 55 | + } | ||
| 56 | + this.confirmPayment() | ||
| 31 | }, | 57 | }, |
| 32 | // 选择日期 | 58 | // 选择日期 |
| 33 | bind_ChangeDate(event) { | 59 | bind_ChangeDate(event) { |
| @@ -61,7 +87,7 @@ Page({ | @@ -61,7 +87,7 @@ Page({ | ||
| 61 | }) | 87 | }) |
| 62 | setTimeout(this.countdown, 1000); | 88 | setTimeout(this.countdown, 1000); |
| 63 | }, | 89 | }, |
| 64 | - // 点击确认支付 | 90 | + // 支付 |
| 65 | confirmPayment() { | 91 | confirmPayment() { |
| 66 | // wx.requestPayment({ | 92 | // wx.requestPayment({ |
| 67 | // timeStamp: '', | 93 | // timeStamp: '', |
| 1 | <!--pack-activity/pack/confirmPayment.wxml 代金券和充值支付页面--> | 1 | <!--pack-activity/pack/confirmPayment.wxml 代金券和充值支付页面--> |
| 2 | -<nav> </nav> | 2 | +<nav>{{opt.detail.name}}</nav> |
| 3 | <view class="box_wrap"> | 3 | <view class="box_wrap"> |
| 4 | - <view wx:if="{{active=='1'}}" class="box"> | 4 | + <view wx:if="{{type=='1'}}" class="box"> |
| 5 | <view class="countdown font24r"> | 5 | <view class="countdown font24r"> |
| 6 | 支付剩余时间 {{countdown}} | 6 | 支付剩余时间 {{countdown}} |
| 7 | </view> | 7 | </view> |
| @@ -15,41 +15,42 @@ | @@ -15,41 +15,42 @@ | ||
| 15 | 唐人街1号中餐厅 | 15 | 唐人街1号中餐厅 |
| 16 | </view> | 16 | </view> |
| 17 | </view> | 17 | </view> |
| 18 | - <view class="coupon"> | 18 | + <view wx:if="{{type=='2'}}" class="coupon"> |
| 19 | <form catchsubmit="formSubmit"> | 19 | <form catchsubmit="formSubmit"> |
| 20 | <view class="page-section"> | 20 | <view class="page-section"> |
| 21 | <view class="page-section-title font32r">您的姓名</view> | 21 | <view class="page-section-title font32r">您的姓名</view> |
| 22 | <view class="weui-cells weui-cell__bd" style="margin: 30rpx 0"> | 22 | <view class="weui-cells weui-cell__bd" style="margin: 30rpx 0"> |
| 23 | - <input class="weui-input" name="input" placeholder="点击输入您的姓名" placeholder-style="color:#000;" /> | 23 | + <input class="weui-input" name="name" placeholder="点击输入您的姓名" placeholder-style="color:#999;" /> |
| 24 | </view> | 24 | </view> |
| 25 | </view> | 25 | </view> |
| 26 | <view class="page-section"> | 26 | <view class="page-section"> |
| 27 | <view class="page-section-title font32r">联系电话</view> | 27 | <view class="page-section-title font32r">联系电话</view> |
| 28 | <view class="weui-cells weui-cell__bd" style="margin: 30rpx 0"> | 28 | <view class="weui-cells weui-cell__bd" style="margin: 30rpx 0"> |
| 29 | - <input class="weui-input" name="input" placeholder="点击输入您的电话" placeholder-style="color:#000;" /> | 29 | + <input class="weui-input" type="number" name="phone" maxlength="11" placeholder="点击输入您的电话" placeholder-style="color:#999;" style="color: #999"/> |
| 30 | </view> | 30 | </view> |
| 31 | </view> | 31 | </view> |
| 32 | - <view class="page-section"> | 32 | + <view class="page-section page-section1"> |
| 33 | <view class="page-section-title font32r">您的生日</view> | 33 | <view class="page-section-title font32r">您的生日</view> |
| 34 | <view class="weui-cells weui-cell__bd"> | 34 | <view class="weui-cells weui-cell__bd"> |
| 35 | <picker mode="date" value="{{date}}" bindchange="bind_ChangeDate" class="pickerBox"> | 35 | <picker mode="date" value="{{date}}" bindchange="bind_ChangeDate" class="pickerBox"> |
| 36 | - {{date?date:'点击输入您的生日'}} | 36 | + <view class="colorSty">{{date?date:'点击输入您的生日'}}</view> |
| 37 | </picker> | 37 | </picker> |
| 38 | </view> | 38 | </view> |
| 39 | + <view class="more"></view> | ||
| 39 | </view> | 40 | </view> |
| 40 | <view class="page-section"> | 41 | <view class="page-section"> |
| 41 | <view class="page-section-title font32r">充值金额</view> | 42 | <view class="page-section-title font32r">充值金额</view> |
| 42 | - <view class="weui-cells weui-cell__bd sum"> | ||
| 43 | - 1000元 | 43 | + <view class="weui-cells weui-cell__bd sum colorSty"> |
| 44 | + {{opt.detail.recharge_money}}元 | ||
| 44 | </view> | 45 | </view> |
| 45 | </view> | 46 | </view> |
| 47 | + <view class="fixed_box"> | ||
| 48 | + <button class="font32r btns" formType="submit">确认支付 | ||
| 49 | + </button> | ||
| 50 | + </view> | ||
| 46 | </form> | 51 | </form> |
| 47 | </view> | 52 | </view> |
| 48 | </view> | 53 | </view> |
| 49 | -<view class="fixed_box"> | ||
| 50 | - <button class="font32r btns" bindtap="showModal">确认支付 | ||
| 51 | - </button> | ||
| 52 | -</view> | ||
| 53 | <my-modal id="payModal" fadeStyle="slideUp" height="380px"> | 54 | <my-modal id="payModal" fadeStyle="slideUp" height="380px"> |
| 54 | <view slot="modalName" class="titleModal">成功支付50.00元</view> | 55 | <view slot="modalName" class="titleModal">成功支付50.00元</view> |
| 55 | <view slot="modalContent"> | 56 | <view slot="modalContent"> |
| @@ -101,6 +101,10 @@ | @@ -101,6 +101,10 @@ | ||
| 101 | border-bottom: 2rpx solid #E7E7E7; | 101 | border-bottom: 2rpx solid #E7E7E7; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | +.page-section1 .more { | ||
| 105 | + margin-right: 32rpx; | ||
| 106 | +} | ||
| 107 | + | ||
| 104 | .weui-cells { | 108 | .weui-cells { |
| 105 | flex: 1; | 109 | flex: 1; |
| 106 | } | 110 | } |
| @@ -114,12 +118,13 @@ | @@ -114,12 +118,13 @@ | ||
| 114 | .weui-input { | 118 | .weui-input { |
| 115 | text-align: right; | 119 | text-align: right; |
| 116 | margin-right: 30rpx; | 120 | margin-right: 30rpx; |
| 121 | + font-size: 32rpx; | ||
| 117 | } | 122 | } |
| 118 | 123 | ||
| 119 | .pickerBox { | 124 | .pickerBox { |
| 120 | display: flex; | 125 | display: flex; |
| 121 | justify-content: flex-end; | 126 | justify-content: flex-end; |
| 122 | - margin-right: 30rpx; | 127 | + margin-right: 12rpx; |
| 123 | height: 94rpx; | 128 | height: 94rpx; |
| 124 | line-height: 94rpx; | 129 | line-height: 94rpx; |
| 125 | } | 130 | } |
| @@ -134,4 +139,9 @@ | @@ -134,4 +139,9 @@ | ||
| 134 | font-family: PingFang SC; | 139 | font-family: PingFang SC; |
| 135 | padding: 0 36rpx 0 36rpx; | 140 | padding: 0 36rpx 0 36rpx; |
| 136 | margin-top: 40rpx; | 141 | margin-top: 40rpx; |
| 137 | -} | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +.colorSty{ | ||
| 145 | + color: #999999; | ||
| 146 | + font-size: 32rpx; | ||
| 147 | +} |
| 1 | // pack-activity/pack/seeRecharge.js | 1 | // pack-activity/pack/seeRecharge.js |
| 2 | +import App from '../../utils/api'; | ||
| 3 | +import util from '../../utils/util' | ||
| 2 | Page({ | 4 | Page({ |
| 3 | 5 | ||
| 4 | /** | 6 | /** |
| @@ -6,23 +8,31 @@ Page({ | @@ -6,23 +8,31 @@ Page({ | ||
| 6 | */ | 8 | */ |
| 7 | data: { | 9 | data: { |
| 8 | opt: { | 10 | opt: { |
| 9 | - name: '唐人街1号中餐厅', | 11 | + name: '', |
| 12 | + id:'', | ||
| 10 | }, | 13 | }, |
| 11 | - recharge: "关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事", | 14 | + stime: '', |
| 15 | + etime:'', | ||
| 12 | }, | 16 | }, |
| 13 | 17 | ||
| 14 | /** | 18 | /** |
| 15 | * 生命周期函数--监听页面加载 | 19 | * 生命周期函数--监听页面加载 |
| 16 | */ | 20 | */ |
| 17 | onLoad(options) { | 21 | onLoad(options) { |
| 18 | - | 22 | + this.setData({ |
| 23 | + opt:{ | ||
| 24 | + id:options.id, | ||
| 25 | + name:options.name, | ||
| 26 | + } | ||
| 27 | + }) | ||
| 28 | + console.log({...options}); | ||
| 19 | }, | 29 | }, |
| 20 | 30 | ||
| 21 | /** | 31 | /** |
| 22 | * 生命周期函数--监听页面初次渲染完成 | 32 | * 生命周期函数--监听页面初次渲染完成 |
| 23 | */ | 33 | */ |
| 24 | onReady() { | 34 | onReady() { |
| 25 | - | 35 | + this.getDetail(); |
| 26 | }, | 36 | }, |
| 27 | 37 | ||
| 28 | /** | 38 | /** |
| @@ -31,7 +41,21 @@ Page({ | @@ -31,7 +41,21 @@ Page({ | ||
| 31 | onShow() { | 41 | onShow() { |
| 32 | 42 | ||
| 33 | }, | 43 | }, |
| 34 | - | 44 | + getDetail(){ |
| 45 | + App.Activity.GetActivityById({ | ||
| 46 | + id: this.data.opt.id | ||
| 47 | + }).then(res => { | ||
| 48 | + let detail=res.data[0]; | ||
| 49 | + let stime=util.unixtoTime(detail.stime,'YYYY-MM-DD'); | ||
| 50 | + let etime=util.unixtoTime(detail.etime,'YYYY-MM-DD'); | ||
| 51 | + this.setData({ | ||
| 52 | + detail, | ||
| 53 | + stime, | ||
| 54 | + etime | ||
| 55 | + }) | ||
| 56 | + console.log('detail',{...detail}); | ||
| 57 | + }) | ||
| 58 | + }, | ||
| 35 | /** | 59 | /** |
| 36 | * 生命周期函数--监听页面隐藏 | 60 | * 生命周期函数--监听页面隐藏 |
| 37 | */ | 61 | */ |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <view class="box_wrap"> | 3 | <view class="box_wrap"> |
| 4 | <view class="info"> | 4 | <view class="info"> |
| 5 | <view class="info_left font40r"> | 5 | <view class="info_left font40r"> |
| 6 | - 50元代金券 | 6 | + {{detail.aname}} |
| 7 | </view> | 7 | </view> |
| 8 | </view> | 8 | </view> |
| 9 | <view class="info"> | 9 | <view class="info"> |
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | 券要求 | 11 | 券要求 |
| 12 | </view> | 12 | </view> |
| 13 | <view class="info_right text_info font32r"> | 13 | <view class="info_right text_info font32r"> |
| 14 | - 满200可用 | 14 | + {{detail.desc}} |
| 15 | </view> | 15 | </view> |
| 16 | </view> | 16 | </view> |
| 17 | <view class="info"> | 17 | <view class="info"> |
| @@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
| 19 | 有效期从 | 19 | 有效期从 |
| 20 | </view> | 20 | </view> |
| 21 | <view class="info_right text_info font32r"> | 21 | <view class="info_right text_info font32r"> |
| 22 | - 2023-04-28 | 22 | + {{stime}} |
| 23 | </view> | 23 | </view> |
| 24 | </view> | 24 | </view> |
| 25 | <view class="info"> | 25 | <view class="info"> |
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | 有效期至 | 27 | 有效期至 |
| 28 | </view> | 28 | </view> |
| 29 | <view class="info_right text_info font32r"> | 29 | <view class="info_right text_info font32r"> |
| 30 | - 2023-08-28 | 30 | + {{etime}} |
| 31 | </view> | 31 | </view> |
| 32 | </view> | 32 | </view> |
| 33 | <view class="info"> | 33 | <view class="info"> |
| @@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
| 35 | 使用限制: | 35 | 使用限制: |
| 36 | </view> | 36 | </view> |
| 37 | <view class="info_right text_info font32r"> | 37 | <view class="info_right text_info font32r"> |
| 38 | - 无限制 | 38 | + <!-- 没做 --> |
| 39 | </view> | 39 | </view> |
| 40 | </view> | 40 | </view> |
| 41 | <view class="info info1"> | 41 | <view class="info info1"> |
| @@ -43,5 +43,5 @@ | @@ -43,5 +43,5 @@ | ||
| 43 | 券说明 | 43 | 券说明 |
| 44 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | - <view class="recharge_news">{{recharge}}</view> | 46 | + <view class="recharge_news">{{detail.explain}}</view> |
| 47 | </view> | 47 | </view> |
| 1 | // pack-activity/pack/vipRecharge.js | 1 | // pack-activity/pack/vipRecharge.js |
| 2 | +import App from '../../utils/api'; | ||
| 3 | +import util from '../../utils/util' | ||
| 2 | Page({ | 4 | Page({ |
| 3 | 5 | ||
| 4 | /** | 6 | /** |
| @@ -6,40 +8,32 @@ Page({ | @@ -6,40 +8,32 @@ Page({ | ||
| 6 | */ | 8 | */ |
| 7 | data: { | 9 | data: { |
| 8 | opt: { | 10 | opt: { |
| 9 | - name: '唐人街1号中餐厅', | 11 | + name: '', |
| 12 | + id:'', | ||
| 10 | }, | 13 | }, |
| 11 | - list: [{ | ||
| 12 | - val: '1', | ||
| 13 | - info: '50元代金券' | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | - val: '2', | ||
| 17 | - info: '1000积分' | ||
| 18 | - }, | ||
| 19 | - { | ||
| 20 | - val: '3', | ||
| 21 | - info: '优惠券' | ||
| 22 | - }, | ||
| 23 | - ], | ||
| 24 | - status: 'week', //none 无限制 birthday 生日当天 week 指定日期 | ||
| 25 | - num: 1, | ||
| 26 | - totalize: '', | ||
| 27 | - money: 20.55, | ||
| 28 | - explain: "关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事,关于代金券不得不说的那些事", | 14 | + exp_date:{}, |
| 15 | + detail:{}, | ||
| 16 | + recharge_list:{}, | ||
| 29 | }, | 17 | }, |
| 30 | 18 | ||
| 31 | /** | 19 | /** |
| 32 | * 生命周期函数--监听页面加载 | 20 | * 生命周期函数--监听页面加载 |
| 33 | */ | 21 | */ |
| 34 | onLoad(options) { | 22 | onLoad(options) { |
| 35 | - | 23 | + this.setData({ |
| 24 | + opt:{ | ||
| 25 | + id:options.id, | ||
| 26 | + name:options.name, | ||
| 27 | + } | ||
| 28 | + }) | ||
| 29 | + console.log({...this.data.opt}); | ||
| 36 | }, | 30 | }, |
| 37 | 31 | ||
| 38 | /** | 32 | /** |
| 39 | * 生命周期函数--监听页面初次渲染完成 | 33 | * 生命周期函数--监听页面初次渲染完成 |
| 40 | */ | 34 | */ |
| 41 | onReady() { | 35 | onReady() { |
| 42 | - | 36 | + this.getDetail(); |
| 43 | }, | 37 | }, |
| 44 | 38 | ||
| 45 | /** | 39 | /** |
| @@ -55,14 +49,34 @@ Page({ | @@ -55,14 +49,34 @@ Page({ | ||
| 55 | onHide() { | 49 | onHide() { |
| 56 | 50 | ||
| 57 | }, | 51 | }, |
| 58 | - | ||
| 59 | - /** | ||
| 60 | - * 生命周期函数--监听页面卸载 | ||
| 61 | - */ | ||
| 62 | - onUnload() { | ||
| 63 | - | 52 | + getDetail(){ |
| 53 | + App.Activity.GetNewRecharge({ | ||
| 54 | + id: this.data.opt.id | ||
| 55 | + }).then(res => { | ||
| 56 | + let detail=res.data | ||
| 57 | + detail.name=this.data.opt.name | ||
| 58 | + let exp_date=util.parseDataValue(res.data.exp_date) | ||
| 59 | + let recharge_list=util.parseDataValue(res.data.recharge_list) | ||
| 60 | + this.setData({ | ||
| 61 | + detail, | ||
| 62 | + exp_date, | ||
| 63 | + recharge_list | ||
| 64 | + }) | ||
| 65 | + console.log('exp_date',{...exp_date}); | ||
| 66 | + console.log('recharge_list',{...recharge_list}); | ||
| 67 | + }) | ||
| 68 | + }, | ||
| 69 | + getCouponDetail(e){ | ||
| 70 | + const item= e.currentTarget.dataset['item']; | ||
| 71 | + wx.navigateTo({ | ||
| 72 | + url: `./seeRecharge?id=${item.id}&name=${this.data.opt.name}`, | ||
| 73 | + }) | ||
| 74 | + }, | ||
| 75 | + submitOrder(){ | ||
| 76 | + wx.navigateTo({ | ||
| 77 | + url: `./confirmPayment?type=2&detail=${JSON.stringify(this.data.detail)}`, | ||
| 78 | + }) | ||
| 64 | }, | 79 | }, |
| 65 | - | ||
| 66 | /** | 80 | /** |
| 67 | * 页面相关事件处理函数--监听用户下拉动作 | 81 | * 页面相关事件处理函数--监听用户下拉动作 |
| 68 | */ | 82 | */ |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | 活动名称 | 6 | 活动名称 |
| 7 | </view> | 7 | </view> |
| 8 | <view class="info_right text_info font32r"> | 8 | <view class="info_right text_info font32r"> |
| 9 | - 充1000赠398 | 9 | + {{detail.rname}} |
| 10 | </view> | 10 | </view> |
| 11 | </view> | 11 | </view> |
| 12 | <view class="info"> | 12 | <view class="info"> |
| @@ -14,36 +14,44 @@ | @@ -14,36 +14,44 @@ | ||
| 14 | 充值满 | 14 | 充值满 |
| 15 | </view> | 15 | </view> |
| 16 | <view class="info_right text_info font32r"> | 16 | <view class="info_right text_info font32r"> |
| 17 | - 1000 | 17 | + {{detail.recharge_money}} |
| 18 | </view> | 18 | </view> |
| 19 | </view> | 19 | </view> |
| 20 | <view class="favourable_box"> | 20 | <view class="favourable_box"> |
| 21 | <view class="about font32r"> | 21 | <view class="about font32r"> |
| 22 | 优惠活动 | 22 | 优惠活动 |
| 23 | </view> | 23 | </view> |
| 24 | - <view class="bundle"> | 24 | + <view class="bundle" wx:if="{{recharge_list.is_price=='1'}}"> |
| 25 | <view class="bundle_left font30r"> | 25 | <view class="bundle_left font30r"> |
| 26 | 赠送 | 26 | 赠送 |
| 27 | </view> | 27 | </view> |
| 28 | <view class="bundle_right font30r"> | 28 | <view class="bundle_right font30r"> |
| 29 | - 200元余额 | 29 | + {{recharge_list.price+'元余额'}} |
| 30 | </view> | 30 | </view> |
| 31 | </view> | 31 | </view> |
| 32 | - <view class="bundle"> | 32 | + <view class="bundle" wx:if="{{recharge_list.is_score=='1'}}"> |
| 33 | <view class="bundle_left font30r"> | 33 | <view class="bundle_left font30r"> |
| 34 | 赠送 | 34 | 赠送 |
| 35 | </view> | 35 | </view> |
| 36 | <view class="bundle_right font30r"> | 36 | <view class="bundle_right font30r"> |
| 37 | - 200元余额 | 37 | + {{recharge_list.score+'积分'}} |
| 38 | + </view> | ||
| 39 | + </view> | ||
| 40 | + <view class="bundle" wx:if="{{recharge_list.is_coupons=='1'}}"> | ||
| 41 | + <view class="bundle_left font30r"> | ||
| 42 | + 赠送 | ||
| 43 | + </view> | ||
| 44 | + <view class="bundle_right font30r"> | ||
| 45 | + 优惠券 | ||
| 38 | </view> | 46 | </view> |
| 39 | </view> | 47 | </view> |
| 40 | </view> | 48 | </view> |
| 41 | <view class="list"> | 49 | <view class="list"> |
| 42 | - <view class="item font32r" wx:for="{{list}}" wx:key="{{item.val}}"> | ||
| 43 | - {{item.info}} | 50 | + <view class="item font32r" wx:for="{{recharge_list.coupons}}" wx:key="{{item.id}}" bindtap="getCouponDetail" data-item="{{item}}"> |
| 51 | + {{item.aname}} | ||
| 44 | </view> | 52 | </view> |
| 45 | </view> | 53 | </view> |
| 46 | - <view class="week" wx:if="{{status=='week'}}"> | 54 | + <view class="week" wx:if="{{exp_date.is_week=='1'}}"> |
| 47 | <view class="week_top"> | 55 | <view class="week_top"> |
| 48 | <view class="week_left font32r"> | 56 | <view class="week_left font32r"> |
| 49 | 充值日期限制: | 57 | 充值日期限制: |
| @@ -53,10 +61,10 @@ | @@ -53,10 +61,10 @@ | ||
| 53 | </view> | 61 | </view> |
| 54 | </view> | 62 | </view> |
| 55 | <view class="dateList texts font32r"> | 63 | <view class="dateList texts font32r"> |
| 56 | - 周一 周二 周三 周四 周五 周六 | 64 | + {{exp_date.week_date_show}} |
| 57 | </view> | 65 | </view> |
| 58 | </view> | 66 | </view> |
| 59 | - <view class="week" wx:if="{{status=='birthday'}}"> | 67 | + <view class="week" wx:if="{{exp_date.is_birthday=='1'}}"> |
| 60 | <view class="week_top"> | 68 | <view class="week_top"> |
| 61 | <view class="week_left font32r"> | 69 | <view class="week_left font32r"> |
| 62 | 充值日期限制: | 70 | 充值日期限制: |
| @@ -66,13 +74,13 @@ | @@ -66,13 +74,13 @@ | ||
| 66 | </view> | 74 | </view> |
| 67 | </view> | 75 | </view> |
| 68 | </view> | 76 | </view> |
| 69 | - <view class="week" wx:if="{{status=='none'}}"> | 77 | + <view class="week" wx:if="{{exp_date.is_fix=='1'}}"> |
| 70 | <view class="week_top"> | 78 | <view class="week_top"> |
| 71 | <view class="week_left font32r"> | 79 | <view class="week_left font32r"> |
| 72 | 充值日期限制: | 80 | 充值日期限制: |
| 73 | </view> | 81 | </view> |
| 74 | <view class="texts font32r"> | 82 | <view class="texts font32r"> |
| 75 | - 无限制 | 83 | + {{exp_date.fix_sdate+'至'+exp_date.fix_edate}} |
| 76 | </view> | 84 | </view> |
| 77 | </view> | 85 | </view> |
| 78 | </view> | 86 | </view> |
| @@ -81,7 +89,7 @@ | @@ -81,7 +89,7 @@ | ||
| 81 | 备注 | 89 | 备注 |
| 82 | </view> | 90 | </view> |
| 83 | </view> | 91 | </view> |
| 84 | - <view class="explain_news">{{explain}}</view> | 92 | + <view class="explain_news">{{detail.explain}}</view> |
| 85 | </view> | 93 | </view> |
| 86 | <view class="fixed_box"> | 94 | <view class="fixed_box"> |
| 87 | <button class="font32r btns" bindtap="submitOrder">提交订单 | 95 | <button class="font32r btns" bindtap="submitOrder">提交订单 |
| @@ -34,6 +34,8 @@ Page({ | @@ -34,6 +34,8 @@ Page({ | ||
| 34 | date: '', | 34 | date: '', |
| 35 | addr: '' | 35 | addr: '' |
| 36 | }, | 36 | }, |
| 37 | + priceInfo:'', | ||
| 38 | + scoreInfo:'', | ||
| 37 | }, | 39 | }, |
| 38 | /** | 40 | /** |
| 39 | * 生命周期函数--监听页面加载 | 41 | * 生命周期函数--监听页面加载 |
| @@ -260,15 +262,21 @@ Page({ | @@ -260,15 +262,21 @@ Page({ | ||
| 260 | App.Seller.GetSellerTemplateConf({ | 262 | App.Seller.GetSellerTemplateConf({ |
| 261 | sid | 263 | sid |
| 262 | }).then(res => { | 264 | }).then(res => { |
| 263 | - let home,chef,marketing,reserve,signboard,store,homeColor; | ||
| 264 | - chef = res.data.chef?JSON.parse(res.data.chef):''; | ||
| 265 | - reserve = res.data.reserve?JSON.parse(res.data.reserve):''; | ||
| 266 | - marketing = res.data.marketing?JSON.parse(res.data.marketing):''; | ||
| 267 | - signboard = res.data.signboard?JSON.parse(res.data.signboard):''; | ||
| 268 | - store = res.data.store?JSON.parse(res.data.store):''; | ||
| 269 | - home = res.data.home?JSON.parse(res.data.home):''; | ||
| 270 | - if(store && store.images.length>0) store.images = JSON.parse(store.images) | ||
| 271 | - if(signboard && signboard.images) signboard.images = JSON.parse(signboard.images) | 265 | + let home,chef,marketing,reserve,signboard,store,homeColor,priceInfo,scoreInfo,recharge_data,recharge_list; |
| 266 | + chef = util.parseDataValue(res.data.chef) | ||
| 267 | + reserve = util.parseDataValue(res.data.reserve) | ||
| 268 | + marketing = util.parseDataValue(res.data.marketing) | ||
| 269 | + signboard = util.parseDataValue(res.data.signboard) | ||
| 270 | + store = util.parseDataValue(res.data.store) | ||
| 271 | + home = util.parseDataValue(res.data.home) | ||
| 272 | + if(marketing.is_recharge=='1'){ | ||
| 273 | + recharge_data=marketing.recharge_data | ||
| 274 | + recharge_list=marketing.recharge_data.recharge_list | ||
| 275 | + if(recharge_list.is_price=='1') priceInfo='会员充值满'+recharge_data.recharge_money+'元赠送'+recharge_list.price+'元余额'; | ||
| 276 | + if(recharge_list.is_score=='1') scoreInfo='会员充值满'+recharge_data.recharge_money+'元赠送'+recharge_list.score+'积分'; | ||
| 277 | + } | ||
| 278 | + if(store && store.images.length>0) store.images =util.parseDataValue(store.images) | ||
| 279 | + if(signboard && signboard.images) signboard.images = util.parseDataValue(signboard.images) | ||
| 272 | if (marketing && marketing.is_online_book=='1' && marketing.is_transpond =='1') { | 280 | if (marketing && marketing.is_online_book=='1' && marketing.is_transpond =='1') { |
| 273 | this.setData({ | 281 | this.setData({ |
| 274 | between: true | 282 | between: true |
| @@ -293,7 +301,9 @@ Page({ | @@ -293,7 +301,9 @@ Page({ | ||
| 293 | reserve, | 301 | reserve, |
| 294 | signboard, | 302 | signboard, |
| 295 | store, | 303 | store, |
| 296 | - homeColor //home主题颜色 | 304 | + homeColor, //home主题颜色 |
| 305 | + priceInfo, | ||
| 306 | + scoreInfo | ||
| 297 | }) | 307 | }) |
| 298 | if (home && home.red == '1' && home.green == '67' && home.blue == '163') { | 308 | if (home && home.red == '1' && home.green == '67' && home.blue == '163') { |
| 299 | this.setData({ | 309 | this.setData({ |
| @@ -188,37 +188,50 @@ | @@ -188,37 +188,50 @@ | ||
| 188 | </view> | 188 | </view> |
| 189 | </view> | 189 | </view> |
| 190 | </view> | 190 | </view> |
| 191 | - <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}"> | 191 | + <!-- <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}"> --> |
| 192 | + <view class="preferential"> | ||
| 192 | <view class="rubric rubric1"> | 193 | <view class="rubric rubric1"> |
| 193 | 特别优惠 | 194 | 特别优惠 |
| 194 | </view> | 195 | </view> |
| 195 | - <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}"> | 196 | + <!-- <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1'}}"> --> |
| 197 | + <view class="preferentialItems" wx:if="{{marketing.is_coupon=='1'}}"> | ||
| 196 | <view class="left"> | 198 | <view class="left"> |
| 197 | <view class="top"> | 199 | <view class="top"> |
| 198 | - <text>200元代金券</text> | ||
| 199 | - <text class="price">¥100</text> | ||
| 200 | - <text class="discount">5折</text> | 200 | + <text>{{marketing.coupon_data.aname}}代金券</text> |
| 201 | + <!-- <text class="price">¥{{ticketList.ticket.price1}}</text> | ||
| 202 | + <text class="discount">{{ticketList.ticket.rebate}}折</text> --> | ||
| 201 | </view> | 203 | </view> |
| 202 | - <view class="bottom"> | ||
| 203 | - 周一到周五可用,消费满600元可用一张。 | ||
| 204 | - </view> | ||
| 205 | - </view> | ||
| 206 | - <view class="font24r orderingFood"> | ||
| 207 | - 去抢购 | 204 | + <!-- <view class="bottom"> |
| 205 | + {{ticketList.ticket.info}} | ||
| 206 | + </view> --> | ||
| 208 | </view> | 207 | </view> |
| 208 | + <navigator url="/pack-activity/pack/buyCoupon?id={{marketing.coupon_data.id}}&name={{seller.name}}" hover-class="navigator-hover"> | ||
| 209 | + <view class="font24r orderingFood"> | ||
| 210 | + 去抢购 | ||
| 211 | + </view> | ||
| 212 | + </navigator> | ||
| 209 | </view> | 213 | </view> |
| 210 | - <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1'}}"> | 214 | + <!-- <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1'}}"> --> |
| 215 | + <view class="preferentialItems" wx:if="{{marketing.is_recharge=='1'}}"> | ||
| 211 | <view class="left"> | 216 | <view class="left"> |
| 212 | <view class="top"> | 217 | <view class="top"> |
| 213 | - <text>充1000赠300</text> | 218 | + <text>{{marketing.recharge_data.rname}}</text> |
| 214 | </view> | 219 | </view> |
| 215 | <view class="bottom"> | 220 | <view class="bottom"> |
| 216 | - 会员充值满1000元赠余额200元;会员充值满1000元赠送50元代金券;会员充值满1000元赠50元菜品。 | 221 | + {{priceInfo}}{{(marketing.recharge_data.recharge_list.is_coupons=='0' && marketing.recharge_data.recharge_list.is_score=='0')?'。':';'}} |
| 222 | + </view> | ||
| 223 | + <view class="bottom"> | ||
| 224 | + {{scoreInfo}}{{marketing.recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 225 | + </view> | ||
| 226 | + <view class="bottom"> | ||
| 227 | + {{marketing.recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。 | ||
| 217 | </view> | 228 | </view> |
| 218 | </view> | 229 | </view> |
| 219 | - <view class="font24r orderingFood"> | ||
| 220 | - 去充值 | ||
| 221 | - </view> | 230 | + <navigator url="/pack-activity/pack/vipRecharge?id={{marketing.recharge_data.id}}&name={{seller.name}}" hover-class="navigator-hover"> |
| 231 | + <view class="font24r orderingFood"> | ||
| 232 | + 去充值 | ||
| 233 | + </view> | ||
| 234 | + </navigator> | ||
| 222 | </view> | 235 | </view> |
| 223 | </view> | 236 | </view> |
| 224 | <view class="vips"> | 237 | <view class="vips"> |
| @@ -624,6 +624,15 @@ export default { | @@ -624,6 +624,15 @@ export default { | ||
| 624 | //预定同一商家、时段时提醒 | 624 | //预定同一商家、时段时提醒 |
| 625 | 'App.Reserve.GetReserveIsExits':{ | 625 | 'App.Reserve.GetReserveIsExits':{ |
| 626 | openid:'openid' | 626 | openid:'openid' |
| 627 | - } | 627 | + }, |
| 628 | 628 | ||
| 629 | + //新充值活动详情 | ||
| 630 | + 'App.Activity.GetNewRecharge':{ | ||
| 631 | + openid:'openid' | ||
| 632 | + }, | ||
| 633 | + | ||
| 634 | + //客户经理优惠券信息 | ||
| 635 | + 'App.Activity.GetActivityById':{ | ||
| 636 | + openid:'openid' | ||
| 637 | + } | ||
| 629 | } | 638 | } |
| @@ -129,10 +129,20 @@ const wxPromisify = fn => { | @@ -129,10 +129,20 @@ const wxPromisify = fn => { | ||
| 129 | }) | 129 | }) |
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| 132 | +// 判断数据是否为空,不为空则JSON.parse转化json数据 | ||
| 133 | +function parseDataValue(val) { | ||
| 134 | + var arr = Object.keys(JSON.parse(val)); | ||
| 135 | + if(arr.length!= '0'){ | ||
| 136 | + let data=JSON.parse(val) | ||
| 137 | + return data | ||
| 138 | + } | ||
| 139 | +} | ||
| 140 | + | ||
| 132 | module.exports = { | 141 | module.exports = { |
| 133 | formatTime: formatTime, | 142 | formatTime: formatTime, |
| 134 | unixtoTime: unixtoTime, | 143 | unixtoTime: unixtoTime, |
| 135 | timetouUnix: timetouUnix, | 144 | timetouUnix: timetouUnix, |
| 145 | + parseDataValue, | ||
| 136 | cgi: function (act) { | 146 | cgi: function (act) { |
| 137 | return uri.HOST__LINE + act //正式 | 147 | return uri.HOST__LINE + act //正式 |
| 138 | //return uri.HOST__TEST+act //测试 | 148 | //return uri.HOST__TEST+act //测试 |
-
Please register or login to post a comment