Showing
5 changed files
with
1367 additions
and
0 deletions
| @@ -52,6 +52,7 @@ | @@ -52,6 +52,7 @@ | ||
| 52 | "pages/book/b_invitation", | 52 | "pages/book/b_invitation", |
| 53 | "pages/book/b_desk", | 53 | "pages/book/b_desk", |
| 54 | "pages/book/b_addnew", | 54 | "pages/book/b_addnew", |
| 55 | + "pages/book/online_update", | ||
| 55 | "pages/book/b_sms", | 56 | "pages/book/b_sms", |
| 56 | "pages/book/b_setting", | 57 | "pages/book/b_setting", |
| 57 | "pages/book/setting/index", | 58 | "pages/book/setting/index", |
pack-book/pages/book/online_update.js
0 → 100644
| 1 | +// pages/book/b_addnew.js | ||
| 2 | +import util from '../../../utils/util'; | ||
| 3 | +import comm from '../../../utils/bookCommon'; | ||
| 4 | +import App from '../../../utils/api'; | ||
| 5 | +const {regeneratorRuntime} = global | ||
| 6 | +const formTpl = { | ||
| 7 | + rid: '', | ||
| 8 | + date: 0, | ||
| 9 | + time: 0, | ||
| 10 | + //pnum_str:'1-4', | ||
| 11 | + pnum: 6, | ||
| 12 | + tabid: 0, | ||
| 13 | + | ||
| 14 | + rname: '', | ||
| 15 | + phone: '', | ||
| 16 | + sex: 1, | ||
| 17 | + cusdem: '', | ||
| 18 | + | ||
| 19 | + tid: [], | ||
| 20 | + | ||
| 21 | +} | ||
| 22 | +Page({ | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 页面的初始数据 | ||
| 26 | + */ | ||
| 27 | + data: { | ||
| 28 | + dateStr: [], | ||
| 29 | + form: JSON.parse(JSON.stringify(formTpl)), | ||
| 30 | + tables: [], | ||
| 31 | + grand: [ | ||
| 32 | + { | ||
| 33 | + sex: 1, | ||
| 34 | + grand_title: '先生', | ||
| 35 | + isselect: true | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + sex: 2, | ||
| 39 | + grand_title: '女士', | ||
| 40 | + isselect: false | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + sex: 3, | ||
| 44 | + grand_title: '公司', | ||
| 45 | + isselect: false | ||
| 46 | + } | ||
| 47 | + ], | ||
| 48 | + buttonhide: true, | ||
| 49 | + | ||
| 50 | + calendarMaskLoad: false, | ||
| 51 | + calendarMask: false, | ||
| 52 | + dayStyle: [ | ||
| 53 | + {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}, | ||
| 54 | + {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'} | ||
| 55 | + ], | ||
| 56 | + timePickerArray: [ | ||
| 57 | + [], | ||
| 58 | + [], | ||
| 59 | + [], | ||
| 60 | + ], | ||
| 61 | + timePickerIndex: [0, 0, 0], | ||
| 62 | + tablesLength: 0, | ||
| 63 | + | ||
| 64 | + timePickerMask: false, | ||
| 65 | + pnumInputFocus: false, | ||
| 66 | + pageMarginBottom: 0, | ||
| 67 | + speciallist: [], | ||
| 68 | + calendar: { | ||
| 69 | + nextNum: 0, | ||
| 70 | + }, | ||
| 71 | + defDtime: ['', '12:00', '18:30'], | ||
| 72 | + hasUseDefDtime: true, | ||
| 73 | + CustomRemark:[], | ||
| 74 | + CustomRemarkMoreMask:false, | ||
| 75 | + }, | ||
| 76 | + /** | ||
| 77 | + * 生命周期函数--监听页面加载 | ||
| 78 | + */ | ||
| 79 | + reserve_id: '', | ||
| 80 | + checkedTables:{},//已选中的桌子集合 | ||
| 81 | + year:util.unixtoTime(new Date() / 1000,'YYYY'), | ||
| 82 | + onLoad: async function (options) { | ||
| 83 | + this.options=options | ||
| 84 | + this.initLoad(options) | ||
| 85 | + this.getCustomRemark(); | ||
| 86 | + }, | ||
| 87 | + async initLoad(options = {}){ | ||
| 88 | + let nt = new Date() / 1000; | ||
| 89 | + let speciallist = [ | ||
| 90 | + {date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'}, | ||
| 91 | + {date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'}, | ||
| 92 | + {date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'}, | ||
| 93 | + ]; | ||
| 94 | + this.reserve_id = options.id || ''; | ||
| 95 | + let rev_time=parseInt(nt) | ||
| 96 | + if(options.hasQuick==1){ | ||
| 97 | + let rdate=options.ddate.split('-') | ||
| 98 | + if(rev_time<rdate[0] || rev_time>rdate[1]){ | ||
| 99 | + rev_time=rdate[0] | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + await this.setDateStr(rev_time); | ||
| 103 | + this.sellerid = util.cache('enter_params')['seller_id']; | ||
| 104 | + let timePickerArray = await comm.getDayTimeSpace(); | ||
| 105 | + //判断hasUseDefDtime | ||
| 106 | + let hasUseDefDtime = true; | ||
| 107 | + let mmii = util.unixtoTime(rev_time, 'HH:II'); | ||
| 108 | + console.log('initLoad',mmii,this.data.defDtime[this.data.form.time],this.data.defDtime) | ||
| 109 | + console.log('initLoad',mmii > this.data.defDtime[this.data.form.time]) | ||
| 110 | + if (mmii > this.data.defDtime[this.data.form.time]) { | ||
| 111 | + hasUseDefDtime = false; | ||
| 112 | + } | ||
| 113 | + this.setData({ | ||
| 114 | + timePickerArray: timePickerArray, | ||
| 115 | + speciallist: speciallist, | ||
| 116 | + hasUseDefDtime: hasUseDefDtime, | ||
| 117 | + }) | ||
| 118 | + if (this.reserve_id > 0) { | ||
| 119 | + this.initModify(this.reserve_id); | ||
| 120 | + } else if(options.hasQuick==1){ | ||
| 121 | + this.initQuick(options); | ||
| 122 | + } else { | ||
| 123 | + this.getTables(); | ||
| 124 | + } | ||
| 125 | + }, | ||
| 126 | + /** | ||
| 127 | + * | ||
| 128 | + * @param d | ||
| 129 | + * | ||
| 130 | + */ | ||
| 131 | + async setDateStr(d = new Date() / 1000){ | ||
| 132 | + this.year=util.unixtoTime(d,'YYYY'); | ||
| 133 | + let ns = new Date() / 1000; | ||
| 134 | + let dateStr = [ | ||
| 135 | + util.unixtoTime(ns, 'MM-DD `DAY/周WW`'), | ||
| 136 | + util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'), | ||
| 137 | + ]; | ||
| 138 | + //let dateStr=this.data.dateStr; | ||
| 139 | + let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`') | ||
| 140 | + let form = this.data.form; | ||
| 141 | + | ||
| 142 | + let timeObj = await comm.getTimeSpaceIndexData(d); | ||
| 143 | + //form.time=await comm.getTimeSpaceIndex(d); | ||
| 144 | + form.time = timeObj.timeIndex; | ||
| 145 | + | ||
| 146 | + let ind = dateStr._indexOf(nowStr); | ||
| 147 | + if (ind > -1) { | ||
| 148 | + form.date = ind | ||
| 149 | + } else { | ||
| 150 | + dateStr.push(nowStr.substr(0, 5)); | ||
| 151 | + form.date = 2; | ||
| 152 | + } | ||
| 153 | + let timePickerIndex = this.data.timePickerIndex; | ||
| 154 | + timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex; | ||
| 155 | + let obj = { | ||
| 156 | + dateStr: dateStr, | ||
| 157 | + form: form, | ||
| 158 | + timePickerIndex: timePickerIndex, | ||
| 159 | + timeOpt: timeObj.timeOpt, | ||
| 160 | + }; | ||
| 161 | + this.setData(obj) | ||
| 162 | + return obj; | ||
| 163 | + | ||
| 164 | + }, | ||
| 165 | + | ||
| 166 | + /** | ||
| 167 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 168 | + */ | ||
| 169 | + onReady: function () { | ||
| 170 | + | ||
| 171 | + }, | ||
| 172 | + | ||
| 173 | + /** | ||
| 174 | + * 生命周期函数--监听页面显示 | ||
| 175 | + */ | ||
| 176 | + onShow: function () { | ||
| 177 | + //if(!this.reserve_id || util.cache('tableid').length>0){ | ||
| 178 | + //if (util.cache('tableid').length > 0) { | ||
| 179 | + this.getTables(); | ||
| 180 | + //} | ||
| 181 | + setTimeout(() => { | ||
| 182 | + this.setData({ | ||
| 183 | + calendarMaskLoad: true, | ||
| 184 | + }) | ||
| 185 | + }, 1000); | ||
| 186 | + this.conditionInfo() | ||
| 187 | + }, | ||
| 188 | + | ||
| 189 | + /** | ||
| 190 | + * 生命周期函数--监听页面隐藏 | ||
| 191 | + */ | ||
| 192 | + onHide: function () { | ||
| 193 | + | ||
| 194 | + }, | ||
| 195 | + | ||
| 196 | + /** | ||
| 197 | + * 生命周期函数--监听页面卸载 | ||
| 198 | + */ | ||
| 199 | + onUnload: function () { | ||
| 200 | + | ||
| 201 | + }, | ||
| 202 | + | ||
| 203 | + /** | ||
| 204 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 205 | + */ | ||
| 206 | + onPullDownRefresh: function () { | ||
| 207 | + | ||
| 208 | + }, | ||
| 209 | + | ||
| 210 | + /** | ||
| 211 | + * 页面上拉触底事件的处理函数 | ||
| 212 | + */ | ||
| 213 | + onReachBottom: function () { | ||
| 214 | + | ||
| 215 | + }, | ||
| 216 | + | ||
| 217 | + /** | ||
| 218 | + * 用户点击右上角分享 | ||
| 219 | + */ | ||
| 220 | + onShareAppMessage: function () { | ||
| 221 | + | ||
| 222 | + }, | ||
| 223 | + selectedValue(e){ | ||
| 224 | + console.log(e); | ||
| 225 | + let key = util.attr(e, 'key'); | ||
| 226 | + let val; | ||
| 227 | + let sobj = {}; | ||
| 228 | + if (key == 'date') { | ||
| 229 | + this.year=util.unixtoTime(new Date() / 1000,'YYYY'); | ||
| 230 | + } | ||
| 231 | + if (e.type == 'input' || e.type == 'confirm') { | ||
| 232 | + val = util.val(e); | ||
| 233 | + if (key == 'phone') { | ||
| 234 | + var that = this; | ||
| 235 | + if (e.detail.value != '' && e.detail.value.length >= 3) { | ||
| 236 | + App.Reserve.GetReserveUser( | ||
| 237 | + { | ||
| 238 | + keywords: e.detail.value, | ||
| 239 | + sid: this.sellerid | ||
| 240 | + } | ||
| 241 | + ).then(function (json) { | ||
| 242 | + if (json.ret == 200 && json.data.length > 0) { | ||
| 243 | + that.setData({ | ||
| 244 | + searchlist: json.data | ||
| 245 | + }) | ||
| 246 | + } else { | ||
| 247 | + that.setData({ | ||
| 248 | + searchlist: null | ||
| 249 | + }) | ||
| 250 | + } | ||
| 251 | + }) | ||
| 252 | + } else { | ||
| 253 | + this.setData({ | ||
| 254 | + searchlist: null | ||
| 255 | + }) | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | + if (key == 'pnum') { | ||
| 259 | + sobj.pnumInputFocus = true; | ||
| 260 | + } | ||
| 261 | + } else { | ||
| 262 | + val = util.attr(e, 'value'); | ||
| 263 | + } | ||
| 264 | + if (key == 'time') { | ||
| 265 | + if (this.data.timeOpt[val]) return; | ||
| 266 | + } | ||
| 267 | + if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) { | ||
| 268 | + if (util.attr(e, 'display') != 'block') { | ||
| 269 | + return; | ||
| 270 | + } | ||
| 271 | + } | ||
| 272 | + let form = this.data.form; | ||
| 273 | + | ||
| 274 | + if (key == 'tid') { | ||
| 275 | + let ts = this.data.tables; | ||
| 276 | + if (ts[val].isselect) { | ||
| 277 | + ts[val].isselect = false; | ||
| 278 | + form.tid.remove(ts[val].id); | ||
| 279 | + delete this.checkedTables[ts[val].id] | ||
| 280 | + } else { | ||
| 281 | + ts[val].isselect = true; | ||
| 282 | + form.tid.push(ts[val].id); | ||
| 283 | + this.checkedTables[ts[val].id]=ts[val].name | ||
| 284 | + } | ||
| 285 | + sobj.tables = ts; | ||
| 286 | + } else { | ||
| 287 | + form[key] = val; | ||
| 288 | + } | ||
| 289 | + console.log('ts', sobj.tables,this.checkedTables); | ||
| 290 | + //console.log(e.type,key,val,form); | ||
| 291 | + sobj.form = form; | ||
| 292 | + sobj.buttonhide = this.data.buttonhide; | ||
| 293 | + if (form.tid.length > 0 && form.rname.length > 0) { | ||
| 294 | + sobj.buttonhide = false; | ||
| 295 | + }else{ | ||
| 296 | + sobj.buttonhide = true; | ||
| 297 | + } | ||
| 298 | + let displayTimes = false; | ||
| 299 | + if (key == 'time') { | ||
| 300 | + if (util.attr(e, 'display') == 'block') { | ||
| 301 | + displayTimes = true; | ||
| 302 | + sobj.timePickerMask = true; | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | + if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) { | ||
| 306 | + if (!displayTimes) { | ||
| 307 | + //sobj.form.tid = []; //切换日期时间清空桌位 | ||
| 308 | + //sobj.buttonhide = true; | ||
| 309 | + this.getTables(); | ||
| 310 | + } | ||
| 311 | + if (key == 'date') { | ||
| 312 | + let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS'); | ||
| 313 | + this.setDateStr(util.timetouUnix(xtime)); | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + //判断hasUseDefDtime | ||
| 317 | + if ((key == 'time' || key == 'date') && !sobj.timePickerMask) { | ||
| 318 | + sobj.hasUseDefDtime = true | ||
| 319 | + } | ||
| 320 | + if (this.data.form.date == 0) {// | ||
| 321 | + let mmii = util.unixtoTime(new Date() / 1000, 'HH:II'); | ||
| 322 | + if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) { | ||
| 323 | + sobj.hasUseDefDtime = false; | ||
| 324 | + } | ||
| 325 | + } | ||
| 326 | + this.setData(sobj) | ||
| 327 | + }, | ||
| 328 | + async getTables(){ | ||
| 329 | + let form = this.data.form; | ||
| 330 | + let tableid = util.cache('tableid'); | ||
| 331 | + console.log('getTables-tableid', tableid.length, this.reserve_id); | ||
| 332 | + //if (tableid.length < 1 && this.reserve_id) { | ||
| 333 | + if (tableid.length < 1) { | ||
| 334 | + tableid = this.data.form.tid; | ||
| 335 | + } | ||
| 336 | + console.log('getTables-tableid', tableid, tableid.length); | ||
| 337 | + try { | ||
| 338 | + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year); | ||
| 339 | + console.log('rdate', this.data.dateStr[this.data.form.date], rdate); | ||
| 340 | + App.Reserve.GetTableList({ | ||
| 341 | + sid: util.cache('enter_params')['seller_id'], | ||
| 342 | + //pnum_str:form.pnum_str, | ||
| 343 | + pnum: form.pnum, | ||
| 344 | + rdate: rdate, | ||
| 345 | + tid: form.tabid, | ||
| 346 | + rid: this.reserve_id, | ||
| 347 | + }).then(res => { | ||
| 348 | + let tables = []; | ||
| 349 | + let tablesLength = 0; | ||
| 350 | + if (tableid.length > 0) { | ||
| 351 | + let toastTables={...this.checkedTables} | ||
| 352 | + let resData=res.data.slice(1,res.data.length); | ||
| 353 | + console.log('resData',resData) | ||
| 354 | + resData.forEach(p => { | ||
| 355 | + //if(tables.length>=3) return true; | ||
| 356 | + p.list.forEach(t => { | ||
| 357 | + delete toastTables[t.id] | ||
| 358 | + tablesLength++; | ||
| 359 | + if (tables.length >= 3) return true; | ||
| 360 | + if (tableid._indexOf(t.id) > -1) { | ||
| 361 | + t.isselect = true; | ||
| 362 | + tables.push(t); | ||
| 363 | + } | ||
| 364 | + }) | ||
| 365 | + }) | ||
| 366 | + console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables); | ||
| 367 | + //清理已选中的桌位 | ||
| 368 | + let toastTablesInfo=[]; | ||
| 369 | + let tid=this.data.form.tid | ||
| 370 | + Object.keys(this.checkedTables).forEach(ckid=>{ | ||
| 371 | + if(toastTables[ckid]){ | ||
| 372 | + delete this.checkedTables[ckid] | ||
| 373 | + tid.remove(ckid); | ||
| 374 | + toastTablesInfo.push(toastTables[ckid]); | ||
| 375 | + } | ||
| 376 | + }) | ||
| 377 | + if(toastTablesInfo.length>0){ | ||
| 378 | + this.setData({ | ||
| 379 | + [`form.tid`]:tid, | ||
| 380 | + }) | ||
| 381 | + util.toast(toastTablesInfo.toString()+'已被占用啦','none'); | ||
| 382 | + } | ||
| 383 | + wx.removeStorage({key: 'tableid'}) | ||
| 384 | + } | ||
| 385 | + console.log('tables-first',tables); | ||
| 386 | + if(tables.length<1){ | ||
| 387 | + tablesLength=0; | ||
| 388 | + let fortids=[]; | ||
| 389 | + res.data.forEach((p,ri) => { | ||
| 390 | + p.list.forEach(t => { | ||
| 391 | + if(fortids._indexOf(t.id)<0) { | ||
| 392 | + tablesLength++; | ||
| 393 | + tables.push(t); | ||
| 394 | + fortids.push(t.id); | ||
| 395 | + } | ||
| 396 | + }) | ||
| 397 | + }) | ||
| 398 | + if (tables.length >= 3) { | ||
| 399 | + tables = tables.slice(0, 3); | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + this.tablesLength = tablesLength; | ||
| 403 | + this.setData({ | ||
| 404 | + tables: tables, | ||
| 405 | + tablesLength: tablesLength | ||
| 406 | + }) | ||
| 407 | + this.conditionInfo(); | ||
| 408 | + }) | ||
| 409 | + } catch (e) { | ||
| 410 | + this.setData({ | ||
| 411 | + tables: [] | ||
| 412 | + }) | ||
| 413 | + } | ||
| 414 | + }, | ||
| 415 | + async formsubmit(){ | ||
| 416 | + if (this.data.buttonhide) return; | ||
| 417 | + try { | ||
| 418 | + let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]]; | ||
| 419 | + let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], | ||
| 420 | + this.data.form.time, d_stimestr,null,this.year); | ||
| 421 | + let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]]; | ||
| 422 | + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], | ||
| 423 | + this.data.form.time, stimestr,null,this.year); | ||
| 424 | + console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex); | ||
| 425 | + console.log('rdate', rdate); | ||
| 426 | + this.setData({ | ||
| 427 | + buttonhide: true, | ||
| 428 | + }) | ||
| 429 | + let form = JSON.parse(JSON.stringify(this.data.form)); | ||
| 430 | + console.log('typeof form.tid', typeof form.tid); | ||
| 431 | + if (typeof form.tid == 'object') { | ||
| 432 | + let tid = new Set(form.tid);//tid 去重 | ||
| 433 | + form.tid = [...tid].toString(); | ||
| 434 | + } | ||
| 435 | + if (!form.tid) { | ||
| 436 | + return util.toast('请选择桌子', 'none'); | ||
| 437 | + } | ||
| 438 | + if (!form.rname) { | ||
| 439 | + return util.toast('请填写预订人', 'none'); | ||
| 440 | + } | ||
| 441 | + form.sid = this.sellerid; | ||
| 442 | + form.rdate = rdate | ||
| 443 | + | ||
| 444 | + try { | ||
| 445 | + let enter_params = util.cache('enter_params'); | ||
| 446 | + let sc = (await App.Reserve.SellerInfo(enter_params)).data | ||
| 447 | + let note_openid = enter_params.seller_openid; | ||
| 448 | + let note_name = sc.seller_user.nick_name || sc.seller_user.nickname; | ||
| 449 | + form.note_openid = note_openid || ''; | ||
| 450 | + if (form.rid) {//修改时传递uid | ||
| 451 | + form.note_openid = enter_params.manager_id || ''; | ||
| 452 | + } | ||
| 453 | + form.note_name = note_name || ''; | ||
| 454 | + } catch (e) {} | ||
| 455 | + | ||
| 456 | + form.ddate = d_rdate.substr(0, 10); | ||
| 457 | + if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间 | ||
| 458 | + let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00"); | ||
| 459 | + form.ddate = util.timetouUnix(ddateStr); | ||
| 460 | + } | ||
| 461 | + App.Reserve.SetReserveInfo(form).then(res => { | ||
| 462 | + if (res.ret == 200) { | ||
| 463 | + this.getCustomRemark() | ||
| 464 | + let _id = (res.data.id || res.data) | ||
| 465 | + this.setData({ | ||
| 466 | + form: JSON.parse(JSON.stringify(formTpl)), | ||
| 467 | + tables: [], | ||
| 468 | + timePickerIndex: [0, 0, 0], | ||
| 469 | + }) | ||
| 470 | + this.initLoad(); | ||
| 471 | + this.checkedTables={}; | ||
| 472 | + App.Reserve.Detail({rid: _id, openid: ''}, 'clear') | ||
| 473 | + wx.navigateTo({ | ||
| 474 | + url: util.http_build_query({id:_id,tplid:1},'b_invitation'), | ||
| 475 | + }); | ||
| 476 | + } else { | ||
| 477 | + util.toast(res.msg, 'none') | ||
| 478 | + } | ||
| 479 | + }) | ||
| 480 | + } catch (e) { | ||
| 481 | + } | ||
| 482 | + }, | ||
| 483 | + selectphone: function (e) { | ||
| 484 | + this.data.form.phone = e.detail.phone; | ||
| 485 | + this.data.form.rname = e.detail.rname; | ||
| 486 | + this.data.form.cusdem = e.detail.cusdem; | ||
| 487 | + var form = this.data.form | ||
| 488 | + this.data.form.sex = e.detail.sex; | ||
| 489 | + this.setData({ | ||
| 490 | + form: this.data.form, | ||
| 491 | + searchlist: null | ||
| 492 | + }) | ||
| 493 | + this.conditionInfo(); | ||
| 494 | + }, | ||
| 495 | + calendarShow(){ | ||
| 496 | + this.setData({ | ||
| 497 | + calendarMask: true | ||
| 498 | + }) | ||
| 499 | + }, | ||
| 500 | + dateChange(event){ | ||
| 501 | + console.log(event); | ||
| 502 | + //let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day) | ||
| 503 | + let cktime = util.timetouUnix(event.detail.date) | ||
| 504 | + this.year=event.detail.date.substr(0, 4); | ||
| 505 | + console.log('this.year',this.year); | ||
| 506 | + let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000); | ||
| 507 | + // if (cktime < day0) { | ||
| 508 | + // util.toast('请选择有效日期', 'none'); | ||
| 509 | + // return; | ||
| 510 | + // } | ||
| 511 | + let clickDay = event.detail.date.substr(8, 2); | ||
| 512 | + let changeDay = `dayStyle[1].day`; | ||
| 513 | + let changeBg = `dayStyle[1].background`; | ||
| 514 | + this.setData({ | ||
| 515 | + [changeDay]: clickDay, | ||
| 516 | + [changeBg]: "#84e7d0", | ||
| 517 | + //[`form.tid`]: [], //切换日期时间清空桌位 | ||
| 518 | + //buttonhide: true, | ||
| 519 | + }) | ||
| 520 | + console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD')) | ||
| 521 | + this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime) | ||
| 522 | + this.calendarClose(); | ||
| 523 | + setTimeout(res=>{ | ||
| 524 | + this.getTables(); | ||
| 525 | + },10) | ||
| 526 | + | ||
| 527 | + }, | ||
| 528 | + calendarClose(){ | ||
| 529 | + this.setData({ | ||
| 530 | + calendarMask: false, | ||
| 531 | + timePickerMask: false, | ||
| 532 | + }) | ||
| 533 | + }, | ||
| 534 | + async selectdesk(){ | ||
| 535 | + let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year); | ||
| 536 | + console.log(this.data.form) | ||
| 537 | + wx.navigateTo({ | ||
| 538 | + url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid | ||
| 539 | + //+'&pnum_str='+this.data.form.pnum_str | ||
| 540 | + + '&pnum=' + this.data.form.pnum | ||
| 541 | + + '&checked_tids=' + this.data.form.tid | ||
| 542 | + + '&rid=' + this.reserve_id | ||
| 543 | + }) | ||
| 544 | + }, | ||
| 545 | + conditionInfo: function () { | ||
| 546 | + var form = this.data.form | ||
| 547 | + if (form.tid.length > 0 && form.rname.length > 0) { | ||
| 548 | + this.data.buttonhide = false; | ||
| 549 | + } | ||
| 550 | + this.setData({ | ||
| 551 | + buttonhide: this.data.buttonhide | ||
| 552 | + }) | ||
| 553 | + }, | ||
| 554 | + /** | ||
| 555 | + * 选中时间区域 | ||
| 556 | + */ | ||
| 557 | + bindTimePickerChange(e){ | ||
| 558 | + let timeIndex = util.attr(e, 'timeIndex'); | ||
| 559 | + if (timeIndex < 0) return; | ||
| 560 | + let timePickerIndex = this.data.timePickerIndex; | ||
| 561 | + //timePickerIndex[timeIndex]=util.val(e); | ||
| 562 | + timePickerIndex[timeIndex] = util.attr(e, 'val'); | ||
| 563 | + | ||
| 564 | + console.log(e, timeIndex, util.attr(e, 'val')); | ||
| 565 | + this.setData({ | ||
| 566 | + timePickerIndex: timePickerIndex, | ||
| 567 | + hasUseDefDtime: false, | ||
| 568 | + }) | ||
| 569 | + }, | ||
| 570 | + /** | ||
| 571 | + * 修改初始化 | ||
| 572 | + */ | ||
| 573 | + async initModify(id){ | ||
| 574 | + try { | ||
| 575 | + let res = await App.Reserve.Detail({rid: id, openid: ''}); | ||
| 576 | + | ||
| 577 | + console.log('initModify', res); | ||
| 578 | + //设置日期 | ||
| 579 | + let obj = await this.setDateStr(res.data.ddate); | ||
| 580 | + //设置时间 | ||
| 581 | + let nd = util.unixtoTime(res.data.ddate, 'HH:II'); | ||
| 582 | + let timePickerIndex = this.data.timePickerIndex | ||
| 583 | + console.log('initModify-', this.data.timePickerArray, obj.form.time, nd) | ||
| 584 | + this.data.timePickerArray[obj.form.time].forEach((dd, ii) => { | ||
| 585 | + console.log('initModify-', nd, dd) | ||
| 586 | + if (nd == dd) { | ||
| 587 | + timePickerIndex[obj.form.time] = ii; | ||
| 588 | + return true; | ||
| 589 | + } | ||
| 590 | + }) | ||
| 591 | + | ||
| 592 | + console.log('initModify-timePickerIndex', timePickerIndex); | ||
| 593 | + //obj.form.pnum_str=res.data.pnum_str; | ||
| 594 | + obj.form.pnum = res.data.pnum || 6; | ||
| 595 | + obj.form.rname = res.data.rname; | ||
| 596 | + obj.form.phone = res.data.phone || ""; | ||
| 597 | + obj.form.sex = res.data.sex; | ||
| 598 | + obj.form.cusdem = res.data.cusdem; | ||
| 599 | + obj.form.rid = id; | ||
| 600 | + obj.form.tid = []; | ||
| 601 | + let tablesed = []; | ||
| 602 | + res.data.tables.forEach((t, ti) => { | ||
| 603 | + obj.form.tid.push(t.id) | ||
| 604 | + if (ti >= 3) return; | ||
| 605 | + t.isselect = true | ||
| 606 | + t["isselected"] = 1 | ||
| 607 | + tablesed.push(t); | ||
| 608 | + this.checkedTables[t.id]=t.name; | ||
| 609 | + }) | ||
| 610 | + this.setData({ | ||
| 611 | + timePickerIndex: timePickerIndex, | ||
| 612 | + form: obj.form, | ||
| 613 | + //tablesed:tablesed, | ||
| 614 | + hasUseDefDtime: false, | ||
| 615 | + }) | ||
| 616 | + setTimeout(() => { | ||
| 617 | + this.getTables(); | ||
| 618 | + }, 300) | ||
| 619 | + | ||
| 620 | + } catch (e) { | ||
| 621 | + console.log('initModify', e) | ||
| 622 | + } | ||
| 623 | + }, | ||
| 624 | + pnumInputFocusEvent(e){ | ||
| 625 | + console.log(e); | ||
| 626 | + this.setData({ | ||
| 627 | + pnumInputFocus: 'focus' == e.type | ||
| 628 | + }) | ||
| 629 | + }, | ||
| 630 | + inputFocusTime: 0, | ||
| 631 | + blurTime: 0, | ||
| 632 | + inputFocus(e){ | ||
| 633 | + console.log(e, this.inputFocusTime); | ||
| 634 | + return; | ||
| 635 | + if (e.timeStamp > this.inputFocusTime) { | ||
| 636 | + this.inputFocusTime = e.timeStamp; | ||
| 637 | + if (e.type == 'focus' && this.data.pageMarginBottom == 0) { | ||
| 638 | + this.setData({ | ||
| 639 | + pageMarginBottom: 300 | ||
| 640 | + }) | ||
| 641 | + setTimeout(res => { | ||
| 642 | + this.pageScrollToBottom(); | ||
| 643 | + }, 100) | ||
| 644 | + } else { | ||
| 645 | + if (this.blurTime > 5) { | ||
| 646 | + this.blurTime = 0; | ||
| 647 | + this.setData({ | ||
| 648 | + pageMarginBottom: 0 | ||
| 649 | + }) | ||
| 650 | + } else { | ||
| 651 | + setTimeout(res => { | ||
| 652 | + this.blurTime += 1; | ||
| 653 | + this.inputFocus(e); | ||
| 654 | + }, 300) | ||
| 655 | + } | ||
| 656 | + | ||
| 657 | + } | ||
| 658 | + | ||
| 659 | + } | ||
| 660 | + }, | ||
| 661 | + pageScrollToBottom: function () { | ||
| 662 | + wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) { | ||
| 663 | + // 使页面滚动到底部 | ||
| 664 | + wx.pageScrollTo({ | ||
| 665 | + scrollTop: rect.bottom | ||
| 666 | + }) | ||
| 667 | + }).exec() | ||
| 668 | + }, | ||
| 669 | + gotoday(e){ | ||
| 670 | + this.setData({ | ||
| 671 | + [`calendar.nextNum`]: 0 | ||
| 672 | + }) | ||
| 673 | + }, | ||
| 674 | + nextMonth(e){ | ||
| 675 | + this.setData({ | ||
| 676 | + [`calendar.nextNum`]: this.data.calendar.nextNum + 1 | ||
| 677 | + }) | ||
| 678 | + }, | ||
| 679 | + prevMonth(e){ | ||
| 680 | + this.setData({ | ||
| 681 | + [`calendar.nextNum`]: this.data.calendar.nextNum - 1 | ||
| 682 | + }) | ||
| 683 | + }, | ||
| 684 | + /** | ||
| 685 | + * 快速预订初始化 | ||
| 686 | + * tid | ||
| 687 | + * tname | ||
| 688 | + * ddate | ||
| 689 | + * pnum | ||
| 690 | + */ | ||
| 691 | + async initQuick(options){ | ||
| 692 | + try { | ||
| 693 | + console.log('initQuick', options); | ||
| 694 | + this.checkedTables[options.tid]=options.tname | ||
| 695 | + this.year=util.unixtoTime(options.ddate.substr(0,10),'YYYY'); | ||
| 696 | + let form=this.data.form | ||
| 697 | + form.tid=[options.tid] | ||
| 698 | + this.setData({ | ||
| 699 | + form: form, | ||
| 700 | + }) | ||
| 701 | + setTimeout(() => { | ||
| 702 | + this.getTables(); | ||
| 703 | + }, 300) | ||
| 704 | + } catch (e) { | ||
| 705 | + console.log('initQuick', e) | ||
| 706 | + } | ||
| 707 | + }, | ||
| 708 | + getCustomRemark(){ | ||
| 709 | + App.User.GetCustomRemark({ | ||
| 710 | + uid:util.cache('enter_params')['manager_id'], | ||
| 711 | + }).then(res=>{ | ||
| 712 | + let CustomRemark=[]; | ||
| 713 | + res.data.forEach(r=>{ | ||
| 714 | + if(r.often_use){ | ||
| 715 | + CustomRemark.push(r); | ||
| 716 | + } | ||
| 717 | + }) | ||
| 718 | + this.setData({ | ||
| 719 | + CustomRemark:CustomRemark, | ||
| 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 | + this.conditionInfo() | ||
| 744 | + }, | ||
| 745 | + CustomRemarkMore(){ | ||
| 746 | + this.setData({ | ||
| 747 | + CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask | ||
| 748 | + }) | ||
| 749 | + } | ||
| 750 | +}) |
pack-book/pages/book/online_update.json
0 → 100644
| 1 | +{ | ||
| 2 | + "backgroundTextStyle":"light", | ||
| 3 | + "navigationBarBackgroundColor": "#fff", | ||
| 4 | + "navigationBarTextStyle":"black", | ||
| 5 | + "usingComponents": { | ||
| 6 | + "nothingBook":"../../components/book/nothing/nothing", | ||
| 7 | + "nav":"/components/nav/nav", | ||
| 8 | + "tabBar":"../../components/book/tabBar/tabBar", | ||
| 9 | + "searchList":"/components/searchlist/searchlist", | ||
| 10 | + "calendar": "plugin://bmCalendar/calendar", | ||
| 11 | + "board":"../../components/book/board/board", | ||
| 12 | + "formids":"/components/formids/formids" | ||
| 13 | + } | ||
| 14 | +} |
pack-book/pages/book/online_update.wxml
0 → 100644
| 1 | +<!--pages/book/b_addnew.wxml--> | ||
| 2 | +<nav>录入订座信息</nav> | ||
| 3 | +<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page"> | ||
| 4 | + <view class="base-info"> | ||
| 5 | + <!-- | ||
| 6 | + <view class="section flex-lr date"> | ||
| 7 | + <view class="flex-rr" style="width:100%;"> | ||
| 8 | + <item class="date-item {{form.date==0?'checked':''}}" | ||
| 9 | + bindtap="selectedValue" data-key="date" data-value="0"> | ||
| 10 | + <view class="date-item-text">{{dateStr[0]}}</view> | ||
| 11 | + </item> | ||
| 12 | + <item class="date-item {{form.date==1?'checked':''}}" | ||
| 13 | + bindtap="selectedValue" data-key="date" data-value="1"> | ||
| 14 | + <view class="date-item-text">{{dateStr[1]}}</view> | ||
| 15 | + </item> | ||
| 16 | + </view> | ||
| 17 | + <view class="more flex-ll" bindtap="calendarShow"> | ||
| 18 | + <view></view> | ||
| 19 | + <view></view> | ||
| 20 | + <view></view> | ||
| 21 | + </view> | ||
| 22 | + </view> | ||
| 23 | + --> | ||
| 24 | + <view class="section"> | ||
| 25 | + <view class="tab flex-ll"> | ||
| 26 | + <formids class="item {{form.date==0?'checked':''}}" | ||
| 27 | + bindtap="selectedValue" data-key="date" data-value="0"> | ||
| 28 | + {{dateStr[0]}} | ||
| 29 | + </formids> | ||
| 30 | + <formids class="item {{form.date==1?'checked':''}}" | ||
| 31 | + bindtap="selectedValue" data-key="date" data-value="1"> | ||
| 32 | + {{dateStr[1]}} | ||
| 33 | + </formids> | ||
| 34 | + <view class="item {{form.date==2?'checked':''}} flex-lr" | ||
| 35 | + bindtap="selectedValue" data-key="date" data-value="2" bindtap="calendarShow"> | ||
| 36 | + <view style="width: 80%" class="item-text">{{dateStr[2]||'其他'}}</view> | ||
| 37 | + <image | ||
| 38 | + src="http://qn.colorcun.com/custom/lite-yd/image/date{{dateStr[2]?'.selected':''}}.png" | ||
| 39 | + style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image> | ||
| 40 | + </view> | ||
| 41 | + </view> | ||
| 42 | + </view> | ||
| 43 | + <view class="section "> | ||
| 44 | + <view class="tab flex-ll"> | ||
| 45 | + <formids class="item {{form.time==0?'checked':''}} {{timeOpt[0]}}" | ||
| 46 | + wx:if="{{timePickerArray[0].length>0}}" | ||
| 47 | + bindtap="selectedValue" data-key="time" data-value="0"> | ||
| 48 | + <view class="picker">早市</view> | ||
| 49 | + </formids> | ||
| 50 | + <formids class="item {{form.time==1?'checked':''}} {{timeOpt[1]}}" | ||
| 51 | + wx:if="{{timePickerArray[1].length>0}}" | ||
| 52 | + bindtap="selectedValue" data-key="time" data-value="1"> | ||
| 53 | + <view class="picker">午市</view> | ||
| 54 | + </formids> | ||
| 55 | + <formids class="item {{form.time==2?'checked':''}} {{timeOpt[2]}}" | ||
| 56 | + wx:if="{{timePickerArray[2].length>0}}" | ||
| 57 | + bindtap="selectedValue" data-key="time" data-value="2"> | ||
| 58 | + <view class="picker">晚市</view> | ||
| 59 | + </formids> | ||
| 60 | + </view> | ||
| 61 | + </view> | ||
| 62 | + <view class="section" style="height: 90rpx;"> | ||
| 63 | + <view class="tab flex-lr"> | ||
| 64 | + <view class="tab flex-ll"> | ||
| 65 | + <formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key" | ||
| 66 | + bindtap="selectedValue" data-key="pnum" data-value="{{item}}"> | ||
| 67 | + <view class="pnum">{{item}}</view> | ||
| 68 | + </formids> | ||
| 69 | + </view> | ||
| 70 | + <view class="tab" style="margin-left: 20rpx;"> | ||
| 71 | + <view class="item {{form.pnum<6 || form.pnum>10?'checked':''}} flex-lr" | ||
| 72 | + data-key="pnum" data-value="{{form.pnum}}"> | ||
| 73 | + <view style="width: 80%" class="pnum"> | ||
| 74 | + <input | ||
| 75 | + bindinput="selectedValue" bindconfirm="selectedValue" | ||
| 76 | + bindblur="pnumInputFocusEvent" | ||
| 77 | + data-key="pnum" value="{{(form.pnum<6 || form.pnum>10) || pnumInputFocus?form.pnum:''}}" | ||
| 78 | + placeholder-class="placeholder-class-pnum" | ||
| 79 | + maxlength="3" type="number" | ||
| 80 | + placeholder="{{form.pnum<6 || form.pnum>10?form.pnum:''}} 更多"/> | ||
| 81 | + | ||
| 82 | + </view> | ||
| 83 | + <image | ||
| 84 | + src="http://qn.colorcun.com/custom/lite-yd/image/pnum{{form.pnum<6 || form.pnum>10?'.selected':''}}.png" | ||
| 85 | + style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image> | ||
| 86 | + </view> | ||
| 87 | + </view> | ||
| 88 | + </view> | ||
| 89 | + </view> | ||
| 90 | + <!-- | ||
| 91 | + <view class="section "> | ||
| 92 | + <view class="tab flex-ll"> | ||
| 93 | + <view class="item {{form.pnum_str=='1-4'?'checked':''}}" | ||
| 94 | + bindtap="selectedValue" data-key="pnum_str" data-value="1-4"> | ||
| 95 | + 4人以下 | ||
| 96 | + </view> | ||
| 97 | + <view class="item {{form.pnum_str=='5-9'?'checked':''}}" | ||
| 98 | + bindtap="selectedValue" data-key="pnum_str" data-value="5-9"> | ||
| 99 | + 5~9人 | ||
| 100 | + </view> | ||
| 101 | + <view class="item {{form.pnum_str=='10-99'?'checked':''}}" | ||
| 102 | + bindtap="selectedValue" data-key="pnum_str" data-value="10-99"> | ||
| 103 | + 10人以上 | ||
| 104 | + </view> | ||
| 105 | + </view> | ||
| 106 | + </view> | ||
| 107 | + <view class="section "> | ||
| 108 | + <view class="tab flex-ll"> | ||
| 109 | + <view class="item {{form.tabid=='2'?'checked':''}}" | ||
| 110 | + bindtap="selectedValue" data-key="tabid" data-value="2"> | ||
| 111 | + 包间 | ||
| 112 | + </view> | ||
| 113 | + <view class="item {{form.tabid=='1'?'checked':''}}" | ||
| 114 | + bindtap="selectedValue" data-key="tabid" data-value="1"> | ||
| 115 | + 散台 | ||
| 116 | + </view> | ||
| 117 | + </view> | ||
| 118 | + </view> | ||
| 119 | + --> | ||
| 120 | + </view> | ||
| 121 | + | ||
| 122 | + <view class="page-full tables"> | ||
| 123 | + <view class="page" style="margin-top: 0"> | ||
| 124 | + <view class="title flex-lr"> | ||
| 125 | + <view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view> | ||
| 126 | + <view class="flex-rr advice-more" bindtap="selectdesk"> | ||
| 127 | + <view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view> | ||
| 128 | + <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image> | ||
| 129 | + </view> | ||
| 130 | + </view> | ||
| 131 | + <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}"> | ||
| 132 | + <block wx:for="{{tablesed||tables}}" wx:key="tables.key"> | ||
| 133 | + <board width="160" height="180" board="{{item}}" | ||
| 134 | + style="margin: 20rpx 0 0 20rpx" | ||
| 135 | + event="boardChoose" className="noBottom" | ||
| 136 | + data-value="{{index}}" | ||
| 137 | + bindtap="selectedValue" | ||
| 138 | + data-key="tid"></board> | ||
| 139 | + </block> | ||
| 140 | + </view> | ||
| 141 | + <view class="advice-desk-detail flex-cc" wx:else=""> | ||
| 142 | + 没有符合条件的桌位! | ||
| 143 | + </view> | ||
| 144 | + </view> | ||
| 145 | + </view> | ||
| 146 | + <view class="book-info"> | ||
| 147 | + <view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:10;"> | ||
| 148 | + <input placeholder="客户电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" | ||
| 149 | + bindinput="selectedValue" | ||
| 150 | + bindconfirm="selectedValue" | ||
| 151 | + data-key="phone" | ||
| 152 | + value="{{form.phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;" cursor-spacing="260"/> | ||
| 153 | + <view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095"> | ||
| 154 | + <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view> | ||
| 155 | + <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view> | ||
| 156 | + </view> | ||
| 157 | + <block wx:if="{{searchlist}}"> | ||
| 158 | + <searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList> | ||
| 159 | + </block> | ||
| 160 | + </view> | ||
| 161 | + <view class="book-info-single flex-lr" style="align-items:flex-start;"> | ||
| 162 | + <input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" | ||
| 163 | + maxlength="12" style="width:450rpx;" value="{{form.rname}}" | ||
| 164 | + bindinput="selectedValue" | ||
| 165 | + bindconfirm="selectedValue" | ||
| 166 | + bindfocus="inputFocus" | ||
| 167 | + bindblur="inputFocus" | ||
| 168 | + data-key="rname"/> | ||
| 169 | + <view class="book-info-grand flex-rr font28r gray-deep-font"> | ||
| 170 | + <block wx:for="{{grand}}" wx:key="grand.key"> | ||
| 171 | + <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}" | ||
| 172 | + bindtap="selectedValue" | ||
| 173 | + data-value="{{item.sex}}" | ||
| 174 | + data-key="sex">{{item.grand_title}}</view> | ||
| 175 | + </block> | ||
| 176 | + </view> | ||
| 177 | + </view> | ||
| 178 | + | ||
| 179 | + <view class="book-info-single flex-lr"> | ||
| 180 | + <input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}" | ||
| 181 | + bindinput="selectedValue" | ||
| 182 | + bindconfirm="selectedValue" | ||
| 183 | + bindfocus="inputFocus" | ||
| 184 | + bindblur="inputFocus" | ||
| 185 | + data-key="cusdem"/> | ||
| 186 | + <view class="CustomRemarkMore flex-rr"> | ||
| 187 | + <view bindtap="CustomRemarkMore">快速备注</view> | ||
| 188 | + </view> | ||
| 189 | + </view> | ||
| 190 | + <view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;"> | ||
| 191 | + <view class="flex-lr CustomRemark"> | ||
| 192 | + <view class="CustomRemarks"> | ||
| 193 | + <view class="CustomRemarksView"> | ||
| 194 | + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 195 | + bindtap="oftenUse" | ||
| 196 | + data-id="{{item.id}}" | ||
| 197 | + data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 198 | + </view> | ||
| 199 | + </view> | ||
| 200 | + </view> | ||
| 201 | + </view> | ||
| 202 | + </view> | ||
| 203 | + <view class="page-full submit"> | ||
| 204 | + <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view> | ||
| 205 | + </view> | ||
| 206 | +</view> | ||
| 207 | +<tabBar></tabBar> | ||
| 208 | +<view class="calendar-mask" bindtap="calendarClose" | ||
| 209 | + style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}"> | ||
| 210 | + <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;"> | ||
| 211 | + <calendar catchtap="catchtap" | ||
| 212 | + isTodaybtn="{{true}}" todaybtn_txt="回到今天" | ||
| 213 | + custom="{{false}}" | ||
| 214 | + switchover="{{['上一月','下个月']}}" | ||
| 215 | + active-coloro="active-coloro" | ||
| 216 | + active-colort="active-colort" | ||
| 217 | + speciallist="{{speciallist}}" | ||
| 218 | + txt_style="txt-style" | ||
| 219 | + calendar-style="calendar" | ||
| 220 | + header-style="calendar-header" | ||
| 221 | + weektitle-style="weektitle-style" | ||
| 222 | + restcolor-style="restcolor-style" | ||
| 223 | + txt_type="cn-d" | ||
| 224 | + | ||
| 225 | + datefont-style="datefont-style" | ||
| 226 | + todaybtn-style="todaybtn-style" | ||
| 227 | + | ||
| 228 | + bindnextMonth="nextMonth" | ||
| 229 | + bindprevMonth="prevMonth" | ||
| 230 | + bindselectDate="dateChange" | ||
| 231 | + bindgotoday="gotoday" | ||
| 232 | + | ||
| 233 | + prev="{{true||calendar.nextNum>0}}" | ||
| 234 | + circle_show="{{false}}" | ||
| 235 | + closelaststyle="{{true}}" | ||
| 236 | + ></calendar> | ||
| 237 | + </view> | ||
| 238 | +</view> | ||
| 239 | +<view class="calendar-mask" bindtap="calendarClose" | ||
| 240 | + style="height:100%;" wx:if="{{timePickerMask}}"> | ||
| 241 | + <view class="timePicker"> | ||
| 242 | + <view class="flex-rr"> | ||
| 243 | + <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image> | ||
| 244 | + </view> | ||
| 245 | + <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;"> | ||
| 246 | + <view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view> | ||
| 247 | + </view> | ||
| 248 | + <view class="flex-ll" style="flex-wrap:wrap"> | ||
| 249 | + <view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}" | ||
| 250 | + style="{{(index+1)%3==0?'margin-right:0;':''}}" | ||
| 251 | + wx:for="{{timePickerArray[form.time]}}" wx:key="" | ||
| 252 | + bindtap="bindTimePickerChange" | ||
| 253 | + data-time-index="{{form.time}}" | ||
| 254 | + data-val="{{index}}" | ||
| 255 | + >{{item}}</view> | ||
| 256 | + </view> | ||
| 257 | + </view> | ||
| 258 | +</view> | ||
| 259 | + | ||
| 260 | +<view class="calendar-mask" bindtap="CustomRemarkMore" | ||
| 261 | + style="height:100%;" wx:if="{{CustomRemarkMoreMask}}"> | ||
| 262 | + <view class="timePicker" catchtap="catchtap"> | ||
| 263 | + <view class="flex-rr"> | ||
| 264 | + <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image> | ||
| 265 | + </view> | ||
| 266 | + <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;"> | ||
| 267 | + <view bindtap="calendarClose">更多标签</view> | ||
| 268 | + </view> | ||
| 269 | + <view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;"> | ||
| 270 | + <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" | ||
| 271 | + wx:if="{{item.often_use}}" bindtap="oftenUse" | ||
| 272 | + data-id="{{item.id}}" | ||
| 273 | + data-value="{{item.often_use}}">{{item.often_use}}</view> | ||
| 274 | + </view> | ||
| 275 | + </view> | ||
| 276 | +</view> |
pack-book/pages/book/online_update.wxss
0 → 100644
| 1 | +/* pages/book/b_addnew.wxss */ | ||
| 2 | +.page{ | ||
| 3 | + width: 90%; | ||
| 4 | + margin: 20rpx 4% 0; | ||
| 5 | + | ||
| 6 | +} | ||
| 7 | +.base-info{ | ||
| 8 | + | ||
| 9 | +} | ||
| 10 | +.section{ | ||
| 11 | + height: 110rpx; | ||
| 12 | +} | ||
| 13 | +.section .label{ | ||
| 14 | + width: 60rpx; | ||
| 15 | + font-size: 30rpx; | ||
| 16 | + margin-right: 38rpx; | ||
| 17 | +} | ||
| 18 | +.date{ | ||
| 19 | + color:#199095; | ||
| 20 | + width: 100%; | ||
| 21 | + font-size: 38rpx; | ||
| 22 | + font-weight: bold; | ||
| 23 | +} | ||
| 24 | +.date-item{ | ||
| 25 | + width: 50%; | ||
| 26 | +} | ||
| 27 | +.date-item-text{ | ||
| 28 | + height: 60rpx; | ||
| 29 | + line-height: 60rpx; | ||
| 30 | + border-bottom: 4rpx solid rgba(0,0,0,0); | ||
| 31 | + width: 200rpx; | ||
| 32 | + text-align: center; | ||
| 33 | + color: #666666; | ||
| 34 | +} | ||
| 35 | +.checked .date-item-text{ | ||
| 36 | + border-bottom: 4rpx solid #199095; | ||
| 37 | + color: #199095; | ||
| 38 | +} | ||
| 39 | +.date .more{ | ||
| 40 | + width: 65rpx; | ||
| 41 | + min-width: 65rpx; | ||
| 42 | + height: 60rpx; | ||
| 43 | +} | ||
| 44 | +.date .more view{ | ||
| 45 | + width: 12rpx; | ||
| 46 | + height: 12rpx; | ||
| 47 | + border-radius: 50%; | ||
| 48 | + margin-right: 12rpx; | ||
| 49 | + background-color: #999; | ||
| 50 | +} | ||
| 51 | +.section .tab{ | ||
| 52 | + font-size: 34rpx; | ||
| 53 | + color: #199095; | ||
| 54 | +} | ||
| 55 | +.section .tab .item{ | ||
| 56 | + height: 50rpx; | ||
| 57 | + line-height: 49rpx; | ||
| 58 | + width: 210rpx !important; | ||
| 59 | + min-width: 210rpx !important; | ||
| 60 | + border-radius: 10rpx; | ||
| 61 | + border: 2rpx solid #199095; | ||
| 62 | + margin-right: 20rpx; | ||
| 63 | + text-align: center; | ||
| 64 | +} | ||
| 65 | +.section .tab .item .item-text,.section .tab .item .picker{ | ||
| 66 | + height: 46rpx; | ||
| 67 | + line-height: 46rpx; | ||
| 68 | +} | ||
| 69 | +.section .tab .item .picker{ | ||
| 70 | + width:210rpx; | ||
| 71 | + text-align: center; | ||
| 72 | +} | ||
| 73 | +.section .tab .item-pnum{ | ||
| 74 | + height: 50rpx; | ||
| 75 | + line-height: 50rpx; | ||
| 76 | + width: 60rpx !important; | ||
| 77 | + min-width: 60rpx !important; | ||
| 78 | + border-radius: 10rpx; | ||
| 79 | + border: 2rpx solid #199095; | ||
| 80 | + margin-right: 32rpx; | ||
| 81 | + text-align: center; | ||
| 82 | +} | ||
| 83 | +.section .tab .item-pnum .pnum,.section .tab .item .pnum input{ | ||
| 84 | + height: 46rpx; | ||
| 85 | + line-height: 46rpx; | ||
| 86 | + font-size: 34rpx; | ||
| 87 | +} | ||
| 88 | +.section .tab .item:last-child{ | ||
| 89 | + margin-right: 0; | ||
| 90 | +} | ||
| 91 | +.section .tab .item-pnum:last-child{ | ||
| 92 | + margin-right: 0; | ||
| 93 | +} | ||
| 94 | +.section .tab .checked{ | ||
| 95 | + background-color:#199095; | ||
| 96 | + color: #FEFEFE; | ||
| 97 | + border: 2rpx solid #199095; | ||
| 98 | +} | ||
| 99 | +.section .tab .disabled{ | ||
| 100 | + background-color:#999999; | ||
| 101 | + color: #efefef; | ||
| 102 | + border: 2rpx solid #999999; | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +/** | ||
| 106 | +可定桌位 | ||
| 107 | + */ | ||
| 108 | +.page-full{ | ||
| 109 | + width: 112%; | ||
| 110 | + margin-left: -6%; | ||
| 111 | + background-color: #F5F5F5; | ||
| 112 | +} | ||
| 113 | +.tables{ | ||
| 114 | + height: 314rpx; | ||
| 115 | + font-size: 30rpx; | ||
| 116 | +} | ||
| 117 | +.tables .title{ | ||
| 118 | + padding-top: 36rpx; | ||
| 119 | + height: 42rpx; | ||
| 120 | + line-height: 42rpx; | ||
| 121 | +} | ||
| 122 | +.advice-desk-detail{ | ||
| 123 | + height: 220rpx; | ||
| 124 | + width:100%; | ||
| 125 | +} | ||
| 126 | +.order-desk-info{ | ||
| 127 | + width:160rpx; | ||
| 128 | + min-width: 160rpx; | ||
| 129 | + height:160rpx; | ||
| 130 | + background:#A9E3E6; | ||
| 131 | + border:1px solid #A9E3E6; | ||
| 132 | + border-radius:10rpx; | ||
| 133 | + position:relative; | ||
| 134 | + overflow:hidden; | ||
| 135 | + margin-left:22rpx; | ||
| 136 | +} | ||
| 137 | +.desk-checked{ | ||
| 138 | + border:1px solid #199095; | ||
| 139 | +} | ||
| 140 | +.advice-desk-detail .order-desk-info:first-child{ | ||
| 141 | + margin-left:0; | ||
| 142 | +} | ||
| 143 | +.desk-active{ | ||
| 144 | + position: absolute; | ||
| 145 | + top: -2rpx; | ||
| 146 | + right: -2rpx; | ||
| 147 | +} | ||
| 148 | +.order-desk-type{ | ||
| 149 | + height:30rpx; | ||
| 150 | + line-height: 30rpx; | ||
| 151 | + background:#61A5D1; | ||
| 152 | + position:absolute; | ||
| 153 | + left:0; | ||
| 154 | + top:0; | ||
| 155 | + font-size: 26rpx; | ||
| 156 | + padding: 0 12rpx 4rpx 8rpx; | ||
| 157 | + border-radius: 0 16rpx 16rpx 0; | ||
| 158 | +} | ||
| 159 | +.advice-more{ | ||
| 160 | + padding:20rpx 0; | ||
| 161 | + padding-left:30rpx; | ||
| 162 | +} | ||
| 163 | +.cut{ | ||
| 164 | + width:100%; | ||
| 165 | + height:4px; | ||
| 166 | + background:#efeef3; | ||
| 167 | +} | ||
| 168 | + | ||
| 169 | + | ||
| 170 | + | ||
| 171 | +/** | ||
| 172 | +预订人信息 | ||
| 173 | + */ | ||
| 174 | +.book-info{ | ||
| 175 | + width:100%; | ||
| 176 | + padding-top:20rpx; | ||
| 177 | + margin:0 auto; | ||
| 178 | + padding-bottom: 300rpx; | ||
| 179 | +} | ||
| 180 | +.book-info-single{ | ||
| 181 | + width:100%; | ||
| 182 | + height:120rpx; | ||
| 183 | + padding-top:40rpx; | ||
| 184 | + border-bottom:1px solid #efeef3; | ||
| 185 | +} | ||
| 186 | +.book-info-single>input{ | ||
| 187 | + width:100%; | ||
| 188 | + height:100rpx; | ||
| 189 | +} | ||
| 190 | +.book-info-grand{ | ||
| 191 | + height:50rpx; | ||
| 192 | + border:1px solid #199095; | ||
| 193 | + margin-top:20rpx; | ||
| 194 | +} | ||
| 195 | +.book-grand{ | ||
| 196 | + width:90rpx; | ||
| 197 | + height:100%; | ||
| 198 | + box-sizing:border-box; | ||
| 199 | +} | ||
| 200 | +.book-grand-active{ | ||
| 201 | + background:rgba(25,153,149,.8); | ||
| 202 | +} | ||
| 203 | +.book-grand-border{ | ||
| 204 | + border-right:1px solid #199095; | ||
| 205 | +} | ||
| 206 | +.book-grand-border:last-child{ | ||
| 207 | + border-width: 0; | ||
| 208 | +} | ||
| 209 | +.phone-reminder{ | ||
| 210 | + width:32rpx; | ||
| 211 | + height:32rpx; | ||
| 212 | + margin-left:20rpx; | ||
| 213 | +} | ||
| 214 | + | ||
| 215 | + | ||
| 216 | +/** | ||
| 217 | +提交按钮 | ||
| 218 | + */ | ||
| 219 | +.submit{ | ||
| 220 | + position: fixed; | ||
| 221 | + bottom: 120rpx; | ||
| 222 | + left: 0; | ||
| 223 | + right: 0; | ||
| 224 | + height: 150rpx; | ||
| 225 | + background-color: #fefefe; | ||
| 226 | + z-index: 9; | ||
| 227 | +} | ||
| 228 | +.confirm-button{ | ||
| 229 | + width:680rpx; | ||
| 230 | + height:85rpx; | ||
| 231 | + background:#199095; | ||
| 232 | + margin:42rpx auto 0; | ||
| 233 | + border-radius:10rpx; | ||
| 234 | + opacity:.6; | ||
| 235 | +} | ||
| 236 | +.confirm-button-active{ | ||
| 237 | + opacity:1; | ||
| 238 | +} | ||
| 239 | + | ||
| 240 | + | ||
| 241 | +@import "common/calendar.wxss"; | ||
| 242 | + | ||
| 243 | + | ||
| 244 | + | ||
| 245 | + | ||
| 246 | +.placeholder-class-pnum{ | ||
| 247 | + color:#199095; | ||
| 248 | + font-size: 34rpx; | ||
| 249 | +} | ||
| 250 | + | ||
| 251 | +.timePicker{ | ||
| 252 | + width: 80%; | ||
| 253 | + overflow: hidden; | ||
| 254 | + position: absolute; | ||
| 255 | + bottom: 0; | ||
| 256 | + border-top: 2rpx solid #ccc; | ||
| 257 | + background-color: #FEFEFE; | ||
| 258 | + padding: 20rpx 10% 80rpx; | ||
| 259 | +} | ||
| 260 | +.timePicker .time-item{ | ||
| 261 | + width: 150rpx; | ||
| 262 | + height: 60rpx; | ||
| 263 | + line-height: 60rpx; | ||
| 264 | + font-size: 40rpx; | ||
| 265 | + font-weight: bold; | ||
| 266 | + color:#199095; | ||
| 267 | + border: 2rpx solid #199095; | ||
| 268 | + border-radius: 10rpx; | ||
| 269 | + text-align: center; | ||
| 270 | + margin-right: 66rpx; | ||
| 271 | + margin-bottom: 60rpx; | ||
| 272 | +} | ||
| 273 | +.timePicker .time-item.checked{ | ||
| 274 | + background-color: #199095; | ||
| 275 | + color:#fefefe; | ||
| 276 | +} | ||
| 277 | +.timePicker .close{ | ||
| 278 | + width: 50rpx; | ||
| 279 | + height: 50rpx; | ||
| 280 | + transform:rotate(45deg); | ||
| 281 | + margin-top: -10rpx; | ||
| 282 | + margin-right: -10%; | ||
| 283 | +} | ||
| 284 | + | ||
| 285 | +.CustomRemark{ | ||
| 286 | + line-height: 60rpx; | ||
| 287 | + overflow: hidden; | ||
| 288 | +} | ||
| 289 | +.CustomRemarks{ | ||
| 290 | + width: 100%; | ||
| 291 | +} | ||
| 292 | +.CustomRemarksView{ | ||
| 293 | + height: 60rpx; | ||
| 294 | + overflow: hidden; | ||
| 295 | +} | ||
| 296 | +.CustomRemarkMore{ | ||
| 297 | + width: 200rpx; | ||
| 298 | + min-width: 200rpx; | ||
| 299 | + color:#199095; | ||
| 300 | + font-size: 30rpx; | ||
| 301 | +} | ||
| 302 | +.CustomRemarkItem{ | ||
| 303 | + height: 48rpx; | ||
| 304 | + line-height: 48rpx; | ||
| 305 | + padding: 4rpx 14rpx; | ||
| 306 | + background-color: #F5F5F5; | ||
| 307 | + font-size: 30rpx; | ||
| 308 | + color: #999999; | ||
| 309 | + border-radius: 10rpx; | ||
| 310 | + margin-right: 20rpx; | ||
| 311 | + float: left; | ||
| 312 | + margin-bottom: 40rpx; | ||
| 313 | +} | ||
| 314 | +.CustomRemarkItem:last-child{ | ||
| 315 | + margin-right: 0; | ||
| 316 | +} | ||
| 317 | +.CustomRemarkMore .CustomRemarkItem{ | ||
| 318 | + padding: 4rpx 24rpx; | ||
| 319 | +} | ||
| 320 | +.book-info-single.last{ | ||
| 321 | + border-width: 0; | ||
| 322 | +} | ||
| 323 | +.CustomRemarkItem.active{ | ||
| 324 | + background-color: #6AB6B9; | ||
| 325 | + color: #FFFFFF; | ||
| 326 | +} |
-
Please register or login to post a comment