Commit 7cee7d1bd13c301866058fe4357231a0616c9004
Merge branch 'master' of http://123.56.79.57/xt/xcx-book
Showing
4 changed files
with
117 additions
and
4 deletions
| @@ -70,6 +70,8 @@ Page({ | @@ -70,6 +70,8 @@ Page({ | ||
| 70 | }, | 70 | }, |
| 71 | defDtime: ['', '12:00', '18:30'], | 71 | defDtime: ['', '12:00', '18:30'], |
| 72 | hasUseDefDtime: true, | 72 | hasUseDefDtime: true, |
| 73 | + CustomRemark:[], | ||
| 74 | + CustomRemarkMoreMask:false, | ||
| 73 | }, | 75 | }, |
| 74 | /** | 76 | /** |
| 75 | * 生命周期函数--监听页面加载 | 77 | * 生命周期函数--监听页面加载 |
| @@ -78,6 +80,7 @@ Page({ | @@ -78,6 +80,7 @@ Page({ | ||
| 78 | checkedTables:{},//已选中的桌子集合 | 80 | checkedTables:{},//已选中的桌子集合 |
| 79 | onLoad: async function (options) { | 81 | onLoad: async function (options) { |
| 80 | this.initLoad(options) | 82 | this.initLoad(options) |
| 83 | + this.getCustomRemark(); | ||
| 81 | }, | 84 | }, |
| 82 | async initLoad(options = {}){ | 85 | async initLoad(options = {}){ |
| 83 | let nt = new Date() / 1000; | 86 | let nt = new Date() / 1000; |
| @@ -88,7 +91,7 @@ Page({ | @@ -88,7 +91,7 @@ Page({ | ||
| 88 | ]; | 91 | ]; |
| 89 | this.reserve_id = options.id || ''; | 92 | this.reserve_id = options.id || ''; |
| 90 | await this.setDateStr(); | 93 | await this.setDateStr(); |
| 91 | - this.sellerid = util.cache('sellerid'); | 94 | + this.sellerid = util.cache('enter_params')['seller_id']; |
| 92 | let timePickerArray = await comm.getDayTimeSpace(); | 95 | let timePickerArray = await comm.getDayTimeSpace(); |
| 93 | //判断hasUseDefDtime | 96 | //判断hasUseDefDtime |
| 94 | let hasUseDefDtime = true; | 97 | let hasUseDefDtime = true; |
| @@ -321,7 +324,7 @@ Page({ | @@ -321,7 +324,7 @@ Page({ | ||
| 321 | let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time); | 324 | let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time); |
| 322 | console.log('rdate', this.data.dateStr[this.data.form.date], rdate); | 325 | console.log('rdate', this.data.dateStr[this.data.form.date], rdate); |
| 323 | App.Reserve.GetTableList({ | 326 | App.Reserve.GetTableList({ |
| 324 | - sid: this.sellerid, | 327 | + sid: util.cache('enter_params')['seller_id'], |
| 325 | //pnum_str:form.pnum_str, | 328 | //pnum_str:form.pnum_str, |
| 326 | pnum: form.pnum, | 329 | pnum: form.pnum, |
| 327 | rdate: rdate, | 330 | rdate: rdate, |
| @@ -448,6 +451,7 @@ Page({ | @@ -448,6 +451,7 @@ Page({ | ||
| 448 | } | 451 | } |
| 449 | App.Reserve.SetReserveInfo(form).then(res => { | 452 | App.Reserve.SetReserveInfo(form).then(res => { |
| 450 | if (res.ret == 200) { | 453 | if (res.ret == 200) { |
| 454 | + this.getCustomRemark() | ||
| 451 | let _id = (res.data.id || res.data) | 455 | let _id = (res.data.id || res.data) |
| 452 | this.setData({ | 456 | this.setData({ |
| 453 | form: JSON.parse(JSON.stringify(formTpl)), | 457 | form: JSON.parse(JSON.stringify(formTpl)), |
| @@ -708,4 +712,39 @@ Page({ | @@ -708,4 +712,39 @@ Page({ | ||
| 708 | console.log('initQuick', e) | 712 | console.log('initQuick', e) |
| 709 | } | 713 | } |
| 710 | }, | 714 | }, |
| 715 | + getCustomRemark(){ | ||
| 716 | + App.User.GetCustomRemark({ | ||
| 717 | + uid:util.cache('enter_params')['manager_id'], | ||
| 718 | + }).then(res=>{ | ||
| 719 | + this.setData({ | ||
| 720 | + CustomRemark:res.data, | ||
| 721 | + }) | ||
| 722 | + }) | ||
| 723 | + }, | ||
| 724 | + oftenUse(e){ | ||
| 725 | + let id=util.attr(e,'id'); | ||
| 726 | + let val=util.attr(e,'value'); | ||
| 727 | + let CustomRemark=this.data.CustomRemark; | ||
| 728 | + let form=this.data.form; | ||
| 729 | + CustomRemark.forEach(r=>{ | ||
| 730 | + if(id==r.id){ | ||
| 731 | + if(r.active){ | ||
| 732 | + form.cusdem=form.cusdem.replace(val+'、','') | ||
| 733 | + } | ||
| 734 | + r.active=!r.active | ||
| 735 | + if(r.active){ | ||
| 736 | + form.cusdem+=val+'、' | ||
| 737 | + } | ||
| 738 | + } | ||
| 739 | + }) | ||
| 740 | + this.setData({ | ||
| 741 | + CustomRemark:CustomRemark, | ||
| 742 | + form:form, | ||
| 743 | + }) | ||
| 744 | + }, | ||
| 745 | + CustomRemarkMore(){ | ||
| 746 | + this.setData({ | ||
| 747 | + CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask | ||
| 748 | + }) | ||
| 749 | + } | ||
| 711 | }) | 750 | }) |
| @@ -190,8 +190,23 @@ | @@ -190,8 +190,23 @@ | ||
| 190 | bindblur="inputFocus" | 190 | bindblur="inputFocus" |
| 191 | data-key="cusdem"/> | 191 | data-key="cusdem"/> |
| 192 | </view> | 192 | </view> |
| 193 | + <view wx:if="{{CustomRemark.length>0}}" class="book-info-single" style="padding-top: 14rpx; height: 60rpx;"> | ||
| 194 | + <view class="flex-lr CustomRemark"> | ||
| 195 | + <view class="CustomRemarks"> | ||
| 196 | + <view class="CustomRemarksView"> | ||
| 197 | + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 198 | + wx:if="{{item.often_use}}" bindtap="oftenUse" | ||
| 199 | + data-id="{{item.id}}" | ||
| 200 | + data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 201 | + </view> | ||
| 202 | + </view> | ||
| 203 | + <view class="CustomRemarkMore flex-rr"> | ||
| 204 | + <view class="CustomRemarkItem" style="margin-bottom: 0" bindtap="CustomRemarkMore">更多</view> | ||
| 205 | + </view> | ||
| 206 | + </view> | ||
| 207 | + </view> | ||
| 193 | </view> | 208 | </view> |
| 194 | - <view class="page-full submit"> | 209 | + <view class="page-full submit" style="background-color: #fefefe;"> |
| 195 | <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view> | 210 | <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view> |
| 196 | </view> | 211 | </view> |
| 197 | </view> | 212 | </view> |
| @@ -246,4 +261,22 @@ | @@ -246,4 +261,22 @@ | ||
| 246 | >{{item}}</view> | 261 | >{{item}}</view> |
| 247 | </view> | 262 | </view> |
| 248 | </view> | 263 | </view> |
| 264 | +</view> | ||
| 265 | + | ||
| 266 | +<view class="calendar-mask" bindtap="CustomRemarkMore" | ||
| 267 | + style="height:100%;" wx:if="{{CustomRemarkMoreMask}}"> | ||
| 268 | + <view class="timePicker" catchtap="catchtap"> | ||
| 269 | + <view class="flex-rr"> | ||
| 270 | + <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image> | ||
| 271 | + </view> | ||
| 272 | + <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;"> | ||
| 273 | + <view bindtap="calendarClose">更多标签</view> | ||
| 274 | + </view> | ||
| 275 | + <view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;"> | ||
| 276 | + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 277 | + wx:if="{{item.often_use}}" bindtap="oftenUse" | ||
| 278 | + data-id="{{item.id}}" | ||
| 279 | + data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 280 | + </view> | ||
| 281 | + </view> | ||
| 249 | </view> | 282 | </view> |
| @@ -274,4 +274,44 @@ | @@ -274,4 +274,44 @@ | ||
| 274 | transform:rotate(45deg); | 274 | transform:rotate(45deg); |
| 275 | margin-top: -10rpx; | 275 | margin-top: -10rpx; |
| 276 | margin-right: -10%; | 276 | margin-right: -10%; |
| 277 | +} | ||
| 278 | + | ||
| 279 | +.CustomRemark{ | ||
| 280 | + line-height: 60rpx; | ||
| 281 | + overflow: hidden; | ||
| 282 | +} | ||
| 283 | +.CustomRemarks{ | ||
| 284 | + width: 100%; | ||
| 285 | +} | ||
| 286 | +.CustomRemarksView{ | ||
| 287 | + height: 60rpx; | ||
| 288 | + overflow: hidden; | ||
| 289 | +} | ||
| 290 | +.CustomRemarkMore{ | ||
| 291 | + width: 200rpx; | ||
| 292 | +} | ||
| 293 | +.CustomRemarkItem{ | ||
| 294 | + height: 48rpx; | ||
| 295 | + line-height: 48rpx; | ||
| 296 | + padding: 4rpx 14rpx; | ||
| 297 | + background-color: #F5F5F5; | ||
| 298 | + font-size: 30rpx; | ||
| 299 | + color: #999999; | ||
| 300 | + border-radius: 10rpx; | ||
| 301 | + margin-right: 20rpx; | ||
| 302 | + float: left; | ||
| 303 | + margin-bottom: 40rpx; | ||
| 304 | +} | ||
| 305 | +.CustomRemarkItem:last-child{ | ||
| 306 | + margin-right: 0; | ||
| 307 | +} | ||
| 308 | +.CustomRemarkMore .CustomRemarkItem{ | ||
| 309 | + padding: 4rpx 24rpx; | ||
| 310 | +} | ||
| 311 | +.book-info-single:last-child{ | ||
| 312 | + border-width: 0; | ||
| 313 | +} | ||
| 314 | +.CustomRemarkItem.active{ | ||
| 315 | + background-color: #6AB6B9; | ||
| 316 | + color: #FFFFFF; | ||
| 277 | } | 317 | } |
| @@ -171,7 +171,8 @@ module.exports ={ | @@ -171,7 +171,8 @@ module.exports ={ | ||
| 171 | if (flag) { | 171 | if (flag) { |
| 172 | break; | 172 | break; |
| 173 | } | 173 | } |
| 174 | - if (isDay) { | 174 | + let nownd=util.unixtoTime(new Date()/1000,'HH:II') |
| 175 | + if (isDay && nownd>times[i][times[i].length-1]) { | ||
| 175 | obj.timeOpt[i] = 'disabled'; | 176 | obj.timeOpt[i] = 'disabled'; |
| 176 | } | 177 | } |
| 177 | } | 178 | } |
-
Please register or login to post a comment