Showing
13 changed files
with
199 additions
and
21 deletions
| @@ -31,7 +31,8 @@ | @@ -31,7 +31,8 @@ | ||
| 31 | "pages/reserve/indexList", | 31 | "pages/reserve/indexList", |
| 32 | "pages/reserve/share", | 32 | "pages/reserve/share", |
| 33 | "pages/reserve/submit", | 33 | "pages/reserve/submit", |
| 34 | - "pages/me/history" | 34 | + "pages/me/history", |
| 35 | + "pages/reserve/remark" | ||
| 35 | ], | 36 | ], |
| 36 | "subpackages": [ | 37 | "subpackages": [ |
| 37 | { | 38 | { |
| @@ -98,9 +98,9 @@ | @@ -98,9 +98,9 @@ | ||
| 98 | style="{{(detail.cusman_phone || detail.cusman_account)?'text-decoration: underline;':''}}" | 98 | style="{{(detail.cusman_phone || detail.cusman_account)?'text-decoration: underline;':''}}" |
| 99 | >{{detail.cusman||''}}</view> | 99 | >{{detail.cusman||''}}</view> |
| 100 | </view> | 100 | </view> |
| 101 | - <view class="flex-lr" style="margin-top: 43rpx;" wx:if="{{detail.cusdem}}"> | ||
| 102 | - <view>备注信息</view> | ||
| 103 | - <view class="detail-info-right">{{detail.cusdem}}</view> | 101 | + <view class="flex-lr" style="margin-top: 43rpx;align-items: flex-start;" wx:if="{{detail.cusdem}}"> |
| 102 | + <view style="line-height: 34rpx;">备注信息</view> | ||
| 103 | + <view class="detail-info-right flex-rr" style="width:500rpx;line-height: 1.35;">{{detail.cusdem}}</view> | ||
| 104 | </view> | 104 | </view> |
| 105 | </view> | 105 | </view> |
| 106 | <view class="hr" style="margin-top: 78rpx;margin-bottom: 78rpx;"></view> | 106 | <view class="hr" style="margin-top: 78rpx;margin-bottom: 78rpx;"></view> |
| @@ -23,6 +23,9 @@ Page({ | @@ -23,6 +23,9 @@ Page({ | ||
| 23 | * 生命周期函数--监听页面加载 | 23 | * 生命周期函数--监听页面加载 |
| 24 | */ | 24 | */ |
| 25 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 26 | + if(wx.getStorageSync('remark')){ | ||
| 27 | + wx.removeStorageSync('remark') | ||
| 28 | + } | ||
| 26 | console.log('onLoad', options) | 29 | console.log('onLoad', options) |
| 27 | console.log('初次进入详情页---小米8测试',this.data.reserveDate ? this.data.reserveDate : '没有日期','openid:',getApp().openid) | 30 | console.log('初次进入详情页---小米8测试',this.data.reserveDate ? this.data.reserveDate : '没有日期','openid:',getApp().openid) |
| 28 | this.options=options | 31 | this.options=options |
pages/reserve/remark.js
0 → 100644
| 1 | +import util from '../../utils/util'; | ||
| 2 | +import App from '../../utils/api'; | ||
| 3 | +Page({ | ||
| 4 | + data:{ | ||
| 5 | + remark:'' | ||
| 6 | + }, | ||
| 7 | + onLoad(opt){ | ||
| 8 | + this.setData({ | ||
| 9 | + remark:opt.remark | ||
| 10 | + }) | ||
| 11 | + this.remark=opt.remark; | ||
| 12 | + this.getlabellist(); | ||
| 13 | + }, | ||
| 14 | + inputremark(e){ | ||
| 15 | + this.remark=util.trim(e.detail.value) | ||
| 16 | + console.log(e) | ||
| 17 | + }, | ||
| 18 | + selectlabel(e){ | ||
| 19 | + let name=e.currentTarget.dataset.name; | ||
| 20 | + if(this.remark!=''){ | ||
| 21 | + let str=this.remark+','+name | ||
| 22 | + if(str.length>25){ | ||
| 23 | + console.log('rrrrrr') | ||
| 24 | + return wx.showToast({ | ||
| 25 | + icon:'none', | ||
| 26 | + title:'最多输入25个字符', | ||
| 27 | + mask:true, | ||
| 28 | + duration:1500 | ||
| 29 | + }) | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + // this.setData({ | ||
| 33 | + // remark:this.data.remark=='' ? name : this.data.remark+','+name | ||
| 34 | + // }) | ||
| 35 | + this.remark=this.remark=='' ? name : this.remark+','+name | ||
| 36 | + console.log(this.remark,this.remark.length) | ||
| 37 | + }, | ||
| 38 | + inputblur(e){ | ||
| 39 | + console.log(e) | ||
| 40 | + this.setData({ | ||
| 41 | + remark:this.remark | ||
| 42 | + }) | ||
| 43 | + }, | ||
| 44 | + getlabellist(){ | ||
| 45 | + App.Customer.GetUserRemarkes().then((json)=>{ | ||
| 46 | + console.log('eeeee',json) | ||
| 47 | + if(json.ret==200){ | ||
| 48 | + this.setData({ | ||
| 49 | + labellist:json.data | ||
| 50 | + }) | ||
| 51 | + } | ||
| 52 | + }) | ||
| 53 | + }, | ||
| 54 | + save(){ | ||
| 55 | + wx.setStorageSync('remark',this.remark); | ||
| 56 | + wx.navigateBack(); | ||
| 57 | + }, | ||
| 58 | + | ||
| 59 | +}) |
pages/reserve/remark.json
0 → 100644
pages/reserve/remark.wxml
0 → 100644
| 1 | +<layout> | ||
| 2 | + <nav>备注</nav> | ||
| 3 | + <view class="contain"> | ||
| 4 | + <view class="bg-gray textarea-cover"> | ||
| 5 | + <textarea placeholder="请输入您的特殊要求,我们会尽量安排" placeholder-class="gray-font font28r" class="black-font font28r" value="{{remark}}" maxlength="25" auto-focus bindinput="inputremark" bindblur="inputblur"></textarea> | ||
| 6 | + <view class="gray-font font24r flex-rr" style="padding-top: 20rpx;">最多输入25个字</view> | ||
| 7 | + </view> | ||
| 8 | + <view class="label"> | ||
| 9 | + <view class="gray-font font28r">快捷标签</view> | ||
| 10 | + <view class="label-list flex-rs"> | ||
| 11 | + <block wx:for="{{labellist}}"> | ||
| 12 | + <view class="black-font font28r label-single bg-gray" data-name="{{item.remark}}" bindtap="selectlabel">{{item.remark}}</view> | ||
| 13 | + </block> | ||
| 14 | + </view> | ||
| 15 | + </view> | ||
| 16 | + </view> | ||
| 17 | + <view class="save-button white-font flex-cc font32r" bindtap="save">保存</view> | ||
| 18 | +</layout> |
pages/reserve/remark.wxss
0 → 100644
| 1 | +.contain{ | ||
| 2 | + width:100%; | ||
| 3 | + padding:10rpx 0 180rpx; | ||
| 4 | +} | ||
| 5 | +.textarea-cover{ | ||
| 6 | + width: 690rpx; | ||
| 7 | + padding: 20rpx 40rpx; | ||
| 8 | + box-sizing: border-box; | ||
| 9 | + border-radius: 16rpx; | ||
| 10 | + overflow: hidden; | ||
| 11 | + margin: 0 auto 40rpx; | ||
| 12 | +} | ||
| 13 | +textarea,input{ | ||
| 14 | + width: 100%; | ||
| 15 | + height: 200rpx; | ||
| 16 | + line-height: 40rpx; | ||
| 17 | +} | ||
| 18 | +input{ | ||
| 19 | + display: block; | ||
| 20 | +} | ||
| 21 | +.label{ | ||
| 22 | + width: 100%; | ||
| 23 | + padding:0 10rpx 0 30rpx; | ||
| 24 | + box-sizing: border-box; | ||
| 25 | +} | ||
| 26 | +.label-single{ | ||
| 27 | + padding:5rpx 20rpx; | ||
| 28 | + line-height: 40rpx; | ||
| 29 | + margin-right: 20rpx; | ||
| 30 | + margin-top: 20rpx; | ||
| 31 | + border-radius:4rpx; | ||
| 32 | +} | ||
| 33 | +.save-button{ | ||
| 34 | + width: 690rpx; | ||
| 35 | + height: 80rpx; | ||
| 36 | + background: #C0A369; | ||
| 37 | + margin: 0 auto; | ||
| 38 | + position: fixed; | ||
| 39 | + left:0; | ||
| 40 | + right:0; | ||
| 41 | + bottom:60rpx; | ||
| 42 | +} |
| @@ -25,22 +25,22 @@ Page({ | @@ -25,22 +25,22 @@ Page({ | ||
| 25 | */ | 25 | */ |
| 26 | options:null, | 26 | options:null, |
| 27 | onLoad: function (options) { | 27 | onLoad: function (options) { |
| 28 | - console.log(options) | 28 | + console.log(options) |
| 29 | options.room_demand=JSON.parse(decodeURIComponent(options.room_demand)) | 29 | options.room_demand=JSON.parse(decodeURIComponent(options.room_demand)) |
| 30 | this.options=options | 30 | this.options=options |
| 31 | this.GetSellerDetail(); | 31 | this.GetSellerDetail(); |
| 32 | App.Customer.GetCustomerInfo().then(res=>{ | 32 | App.Customer.GetCustomerInfo().then(res=>{ |
| 33 | if(res.data.length>0){ | 33 | if(res.data.length>0){ |
| 34 | - res.data.forEach((v,i)=>{ | ||
| 35 | - if(v.is_default==1){ | ||
| 36 | - this.user = v | ||
| 37 | - v.remark=''; | ||
| 38 | - this.setData({ | ||
| 39 | - user: v, | ||
| 40 | - }) | ||
| 41 | - return; | ||
| 42 | - } | ||
| 43 | - }) | 34 | + res.data.forEach((v,i)=>{ |
| 35 | + if(v.is_default==1){ | ||
| 36 | + this.user = v | ||
| 37 | + v.remark=wx.getStorageSync('remark') ? wx.getStorageSync('remark') : ''; | ||
| 38 | + this.setData({ | ||
| 39 | + user: v, | ||
| 40 | + }) | ||
| 41 | + return; | ||
| 42 | + } | ||
| 43 | + }) | ||
| 44 | } | 44 | } |
| 45 | }) | 45 | }) |
| 46 | }, | 46 | }, |
| @@ -56,7 +56,9 @@ Page({ | @@ -56,7 +56,9 @@ Page({ | ||
| 56 | * 生命周期函数--监听页面显示 | 56 | * 生命周期函数--监听页面显示 |
| 57 | */ | 57 | */ |
| 58 | onShow: function () { | 58 | onShow: function () { |
| 59 | - | 59 | + this.setData({ |
| 60 | + 'user.remark':wx.getStorageSync('remark') ? wx.getStorageSync('remark') : '' | ||
| 61 | + }) | ||
| 60 | }, | 62 | }, |
| 61 | 63 | ||
| 62 | /** | 64 | /** |
| @@ -139,7 +141,7 @@ Page({ | @@ -139,7 +141,7 @@ Page({ | ||
| 139 | this.options.room_demand.forEach((v,i)=>{ | 141 | this.options.room_demand.forEach((v,i)=>{ |
| 140 | roomids.push(v.id) | 142 | roomids.push(v.id) |
| 141 | }) | 143 | }) |
| 142 | - console.log('ceshi',roomids); | 144 | + console.log('ceshi',roomids); |
| 143 | App.Customer.SetReserveInfo({ | 145 | App.Customer.SetReserveInfo({ |
| 144 | sid:this.options.sid, | 146 | sid:this.options.sid, |
| 145 | ddate:this.options.ddate, | 147 | ddate:this.options.ddate, |
| @@ -159,10 +161,14 @@ Page({ | @@ -159,10 +161,14 @@ Page({ | ||
| 159 | if(res.data.hasSetUserInfo){ | 161 | if(res.data.hasSetUserInfo){ |
| 160 | App.Customer.GetCustomerInfo({},'clear') | 162 | App.Customer.GetCustomerInfo({},'clear') |
| 161 | } | 163 | } |
| 164 | + if(this.data.user.remark!=''){ | ||
| 165 | + this.setremark(); | ||
| 166 | + } | ||
| 162 | let firstShowMsg='餐厅一般会在10分钟内为您反馈结果,请留意短信或微信通知' | 167 | let firstShowMsg='餐厅一般会在10分钟内为您反馈结果,请留意短信或微信通知' |
| 163 | if(!this.hasInWorkTime()){//非营业时间预订 | 168 | if(!this.hasInWorkTime()){//非营业时间预订 |
| 164 | firstShowMsg='商家未上班,上班后将第一时间告知您预订结果,请留意短信/微信通知(上班时间:'+this.data.seller.rec_stime+'—'+this.data.seller.rec_etime+')' | 169 | firstShowMsg='商家未上班,上班后将第一时间告知您预订结果,请留意短信/微信通知(上班时间:'+this.data.seller.rec_stime+'—'+this.data.seller.rec_etime+')' |
| 165 | } | 170 | } |
| 171 | + wx.removeStorageSync('remark') | ||
| 166 | wx.redirectTo({ | 172 | wx.redirectTo({ |
| 167 | url:util.http_build_query({ | 173 | url:util.http_build_query({ |
| 168 | id:res.data.rid, | 174 | id:res.data.rid, |
| @@ -242,4 +248,18 @@ Page({ | @@ -242,4 +248,18 @@ Page({ | ||
| 242 | }) | 248 | }) |
| 243 | }).exec() | 249 | }).exec() |
| 244 | }, | 250 | }, |
| 251 | + toremark(){ | ||
| 252 | + wx.navigateTo({ | ||
| 253 | + url:'remark?remark='+this.data.user.remark, | ||
| 254 | + }) | ||
| 255 | + }, | ||
| 256 | + setremark(){ | ||
| 257 | + App.Customer.SetUserRemarkes({remark:this.data.user.remark}).then((json)=>{ | ||
| 258 | + console.log(json) | ||
| 259 | + if(json.ret==200){ | ||
| 260 | + console.log(json) | ||
| 261 | + App.Customer.GetUserRemarkes({},'clear') | ||
| 262 | + } | ||
| 263 | + }) | ||
| 264 | + }, | ||
| 245 | }) | 265 | }) |
| @@ -30,6 +30,8 @@ | @@ -30,6 +30,8 @@ | ||
| 30 | bindinput="changeInput" | 30 | bindinput="changeInput" |
| 31 | data-key="name" | 31 | data-key="name" |
| 32 | value="{{user.name}}" | 32 | value="{{user.name}}" |
| 33 | + bindkeyboardheightchange="keyboardheightchange" | ||
| 34 | + adjust-position="{{false}}" | ||
| 33 | placeholder-class="input-pl" maxlength="10"/> | 35 | placeholder-class="input-pl" maxlength="10"/> |
| 34 | <view class="flex-rr switch"> | 36 | <view class="flex-rr switch"> |
| 35 | <view | 37 | <view |
| @@ -58,6 +60,7 @@ | @@ -58,6 +60,7 @@ | ||
| 58 | data-key="phone" | 60 | data-key="phone" |
| 59 | type="number" | 61 | type="number" |
| 60 | value="{{user.phone}}" | 62 | value="{{user.phone}}" |
| 63 | + adjust-position="{{false}}" | ||
| 61 | placeholder-class="input-pl" maxlength="11"/> | 64 | placeholder-class="input-pl" maxlength="11"/> |
| 62 | <view class="flex-rr"> | 65 | <view class="flex-rr"> |
| 63 | <!-- 一键获取 --> | 66 | <!-- 一键获取 --> |
| @@ -70,16 +73,19 @@ | @@ -70,16 +73,19 @@ | ||
| 70 | </view> | 73 | </view> |
| 71 | <view class="item flex-lr"> | 74 | <view class="item flex-lr"> |
| 72 | <view class="item-label" style="margin-left:30rpx;">备注</view> | 75 | <view class="item-label" style="margin-left:30rpx;">备注</view> |
| 73 | - <view class="Medium"> | ||
| 74 | - <input class="cusdem input" placeholder="您的特殊要求,我们会尽量安排(20字)" | 76 | + <view class="Medium flex-rr" bindtap="toremark"> |
| 77 | + <!-- <input class="cusdem input" placeholder="您的特殊要求,我们会尽量安排(20字)" | ||
| 75 | bindinput="changeInput" | 78 | bindinput="changeInput" |
| 76 | - bindkeyboardheightchange="keyboardheightchange" | ||
| 77 | bindblur="keyboardheightchange" | 79 | bindblur="keyboardheightchange" |
| 78 | bindconfirm="keyboardheightchange" | 80 | bindconfirm="keyboardheightchange" |
| 79 | adjust-position="{{false}}" | 81 | adjust-position="{{false}}" |
| 80 | data-key="remark" | 82 | data-key="remark" |
| 81 | value="{{user.remark}}" | 83 | value="{{user.remark}}" |
| 82 | - placeholder-class="input-pl" maxlength="25"/> | 84 | + placeholder-class="input-pl" maxlength="25"/> --> |
| 85 | + <view class="cusdem input {{user.remark && user.remark!='' ? 'black-font' : 'gray-font'}} font-more" data-key="remark" style="width: 496rpx;">{{user.remark && user.remark!='' ? user.remark : '您的特殊要求,我们会尽量安排'}}</view> | ||
| 86 | + <view class="click-cover" style="padding-right:30rpx;"> | ||
| 87 | + <image src="../image/click-icon.png"></image> | ||
| 88 | + </view> | ||
| 83 | </view> | 89 | </view> |
| 84 | </view> | 90 | </view> |
| 85 | <formids bindclick="saved"> | 91 | <formids bindclick="saved"> |
| @@ -564,6 +564,12 @@ | @@ -564,6 +564,12 @@ | ||
| 564 | "pathName": "pages/me/history", | 564 | "pathName": "pages/me/history", |
| 565 | "query": "", | 565 | "query": "", |
| 566 | "scene": null | 566 | "scene": null |
| 567 | + }, | ||
| 568 | + { | ||
| 569 | + "id": -1, | ||
| 570 | + "name": "pages/reserve/remark", | ||
| 571 | + "pathName": "pages/reserve/remark", | ||
| 572 | + "scene": null | ||
| 567 | } | 573 | } |
| 568 | ] | 574 | ] |
| 569 | } | 575 | } |
| @@ -399,4 +399,13 @@ export default { | @@ -399,4 +399,13 @@ export default { | ||
| 399 | openid:'openid', | 399 | openid:'openid', |
| 400 | }, | 400 | }, |
| 401 | 401 | ||
| 402 | + //快速备注 | ||
| 403 | + 'App.Customer.GetUserRemarkes':{ | ||
| 404 | + openid:'openid', | ||
| 405 | + cachetime: -1, | ||
| 406 | + }, | ||
| 407 | + //写入快速备注 | ||
| 408 | + 'App.Customer.SetUserRemarkes':{ | ||
| 409 | + openid:'openid', | ||
| 410 | + } | ||
| 402 | } | 411 | } |
-
Please register or login to post a comment