Commit 159b852e1a3efd5462b1a18a18e36e6522680326

Authored by wangfan
1 parent 1e53089c

reserve index

@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <view class="gps-icon"> 29 <view class="gps-icon">
30 <image src="/pages/image/gps-icon.png"></image> 30 <image src="/pages/image/gps-icon.png"></image>
31 </view> 31 </view>
32 - <view> 32 + <view style="line-height: 40rpx;">
33 {{seller.map_address}} 33 {{seller.map_address}}
34 </view> 34 </view>
35 </view> 35 </view>
@@ -88,6 +88,7 @@ Page({ @@ -88,6 +88,7 @@ Page({
88 detail.customers.forEach(item=>{ 88 detail.customers.forEach(item=>{
89 if(openid==item.openid){ 89 if(openid==item.openid){
90 detail.hasCanSuccess=true; 90 detail.hasCanSuccess=true;
  91 + detail.remindtime=item.remind_date;
91 return true; 92 return true;
92 } 93 }
93 }) 94 })
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <formids bindclick="reserveCancel"> 13 <formids bindclick="reserveCancel">
14 <view class="opt-button">取消</view> 14 <view class="opt-button">取消</view>
15 </formids> 15 </formids>
16 - <formids url="./remind?id={{detail.id}}&rdate={{detail.rdate}}"> 16 + <formids url="./remind?id={{detail.id}}&rdate={{detail.rdate}}&remindtime={{detail.remindtime}}">
17 <view class="opt-button">提醒</view> 17 <view class="opt-button">提醒</view>
18 </formids> 18 </formids>
19 <userinfo-share 19 <userinfo-share
@@ -16,10 +16,12 @@ Page({ @@ -16,10 +16,12 @@ Page({
16 {val:24*60,label:'1天前'}, 16 {val:24*60,label:'1天前'},
17 {val:48*60,label:'2天前'}, 17 {val:48*60,label:'2天前'},
18 ], 18 ],
  19 + remindtime:0,
19 }, 20 },
20 remind_date:0, 21 remind_date:0,
21 id:null, 22 id:null,
22 rdate:0, 23 rdate:0,
  24 +
23 /** 25 /**
24 * 生命周期函数--监听页面加载 26 * 生命周期函数--监听页面加载
25 */ 27 */
@@ -27,6 +29,18 @@ Page({ @@ -27,6 +29,18 @@ Page({
27 console.log('onLoad',options); 29 console.log('onLoad',options);
28 this.id=options.id; 30 this.id=options.id;
29 this.rdate=options.rdate; 31 this.rdate=options.rdate;
  32 + if(new Date()/1000+1800>options.rdate){
  33 + this.setData({
  34 + reminds:[{val:0,label:'不提醒'}]
  35 + })
  36 + }else{
  37 + if(options.remindtime>0){
  38 + this.setData({
  39 + remindtime:(options.rdate-options.remindtime)/60
  40 + })
  41 + }
  42 + }
  43 +
30 }, 44 },
31 45
32 /** 46 /**
@@ -71,6 +85,10 @@ Page({ @@ -71,6 +85,10 @@ Page({
71 remind_date:this.remind_date, 85 remind_date:this.remind_date,
72 is_agree:1 86 is_agree:1
73 }).then(res=>{ 87 }).then(res=>{
  88 + App.Reserve.Detail({
  89 + openid: getApp().openid,
  90 + rid: this.id
  91 + },'clear')
74 wx.navigateBack() 92 wx.navigateBack()
75 }) 93 })
76 } 94 }
1 <!--pages/customer/remind.wxml--> 1 <!--pages/customer/remind.wxml-->
2 <nav hasHome>设置提醒</nav> 2 <nav hasHome>设置提醒</nav>
3 -<view class="page"> 3 +<view class="page" wx:if="{{reminds.length>1}}">
4 <view class="reminds"> 4 <view class="reminds">
5 <radio-group class="radio-group" bindchange="radioChange" > 5 <radio-group class="radio-group" bindchange="radioChange" >
6 <label class="radio" wx:for="{{reminds}}" wx:key="reminds.key"> 6 <label class="radio" wx:for="{{reminds}}" wx:key="reminds.key">
7 - <radio value="{{item.val}}" color="#262628"/>{{item.label}} 7 + <radio value="{{item.val}}" checked="{{remindtime==item.val?true:false}}" color="#262628"/>{{item.label}}
8 </label> 8 </label>
9 </radio-group> 9 </radio-group>
10 </view> 10 </view>
@@ -12,3 +12,13 @@ @@ -12,3 +12,13 @@
12 <view class="share-but">确定</view> 12 <view class="share-but">确定</view>
13 </formids> 13 </formids>
14 </view> 14 </view>
  15 +<view class="page" wx:else="">
  16 + <view class="reminds">
  17 + <radio-group class="radio-group" bindchange="radioChange" >
  18 + <label class="radio" wx:for="{{reminds}}" wx:key="reminds.key">
  19 + <radio value="{{item.val}}" color="#262628"/>{{item.label}}
  20 + </label>
  21 + </radio-group>
  22 + </view>
  23 + <view style="color:#666666; font-size: 26rpx; text-align: center;">已接近开始时间,无法设置提醒</view>
  24 +</view>