Commit 8712c94747da3e0463f44a6939ac94047c2d8217

Authored by wangfan
1 parent c8072b73

选择备注 & fix time bug

@@ -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;
@@ -708,4 +711,39 @@ Page({ @@ -708,4 +711,39 @@ Page({
708 console.log('initQuick', e) 711 console.log('initQuick', e)
709 } 712 }
710 }, 713 },
  714 + getCustomRemark(){
  715 + App.User.GetCustomRemark({
  716 + uid:util.cache('enter_params')['manager_id'],
  717 + }).then(res=>{
  718 + this.setData({
  719 + CustomRemark:res.data,
  720 + })
  721 + })
  722 + },
  723 + oftenUse(e){
  724 + let id=util.attr(e,'id');
  725 + let val=util.attr(e,'value');
  726 + let CustomRemark=this.data.CustomRemark;
  727 + let form=this.data.form;
  728 + CustomRemark.forEach(r=>{
  729 + if(id==r.id){
  730 + if(r.active){
  731 + form.cusdem=form.cusdem.replace(val+'、','')
  732 + }
  733 + r.active=!r.active
  734 + if(r.active){
  735 + form.cusdem+=val+'、'
  736 + }
  737 + }
  738 + })
  739 + this.setData({
  740 + CustomRemark:CustomRemark,
  741 + form:form,
  742 + })
  743 + },
  744 + CustomRemarkMore(){
  745 + this.setData({
  746 + CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask
  747 + })
  748 + }
711 }) 749 })
@@ -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 }