Commit eb63e538b1d46613cee75620eab962efb068d5d6
Merge remote-tracking branch 'origin/master'
# Conflicts: # pages/customer/detail_owner.js
Showing
9 changed files
with
30 additions
and
16 deletions
| @@ -21,10 +21,9 @@ Component({ | @@ -21,10 +21,9 @@ Component({ | ||
| 21 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); | 21 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); |
| 22 | this.getsectionlist(); | 22 | this.getsectionlist(); |
| 23 | if(today==newdate){ | 23 | if(today==newdate){ |
| 24 | + this.markoversection(); | ||
| 24 | if(this.data.section){ | 25 | if(this.data.section){ |
| 25 | this.changesectionstyle(this.data.section); | 26 | this.changesectionstyle(this.data.section); |
| 26 | - }else{ | ||
| 27 | - this.markoversection(); | ||
| 28 | } | 27 | } |
| 29 | }else{ | 28 | }else{ |
| 30 | if(this.data.section){ | 29 | if(this.data.section){ |
| @@ -85,9 +84,11 @@ Component({ | @@ -85,9 +84,11 @@ Component({ | ||
| 85 | } | 84 | } |
| 86 | }) | 85 | }) |
| 87 | console.log(interval) | 86 | console.log(interval) |
| 88 | - if(interval.length>0){ | ||
| 89 | - sectionlist[interval[0].index].isselected=true; | ||
| 90 | - this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index) | 87 | + if(!this.data.section){ |
| 88 | + if(interval.length>0){ | ||
| 89 | + sectionlist[interval[0].index].isselected=true; | ||
| 90 | + this.tellsection(sectionlist[interval[0].index].section,'defalut',interval[0].index) | ||
| 91 | + } | ||
| 91 | } | 92 | } |
| 92 | this.setData({ | 93 | this.setData({ |
| 93 | sectionlist:sectionlist | 94 | sectionlist:sectionlist |
| @@ -15,6 +15,7 @@ Page({ | @@ -15,6 +15,7 @@ Page({ | ||
| 15 | console.log('selectdate',e); | 15 | console.log('selectdate',e); |
| 16 | this.setData({ | 16 | this.setData({ |
| 17 | reserveDate:e.detail.date, | 17 | reserveDate:e.detail.date, |
| 18 | + reserveSection:e.detail.action=='click' ? null : this.data.reserveSection | ||
| 18 | }) | 19 | }) |
| 19 | }, | 20 | }, |
| 20 | //时段改变 | 21 | //时段改变 |
| @@ -211,7 +211,6 @@ Page({ | @@ -211,7 +211,6 @@ Page({ | ||
| 211 | rid: this.id | 211 | rid: this.id |
| 212 | }).then(res => { | 212 | }).then(res => { |
| 213 | let detail=this.formatDatail(res.data) | 213 | let detail=this.formatDatail(res.data) |
| 214 | - //detail.room_demand=JSON.parse(detail.room_demand); | ||
| 215 | detail.ddate_solt=Number(detail.ddate_solt); | 214 | detail.ddate_solt=Number(detail.ddate_solt); |
| 216 | this.setData({ | 215 | this.setData({ |
| 217 | detail: detail, | 216 | detail: detail, |
| @@ -65,6 +65,9 @@ Page({ | @@ -65,6 +65,9 @@ Page({ | ||
| 65 | if(!this.user.name){ | 65 | if(!this.user.name){ |
| 66 | return util.toast('请填写预定人','none') | 66 | return util.toast('请填写预定人','none') |
| 67 | } | 67 | } |
| 68 | + if(!this.user.phone){ | ||
| 69 | + return util.toast('请填写正确的手机号','none') | ||
| 70 | + } | ||
| 68 | App.Customer.SetCustomerInfo({ | 71 | App.Customer.SetCustomerInfo({ |
| 69 | ...this.user | 72 | ...this.user |
| 70 | }).then(res=>{ | 73 | }).then(res=>{ |
| @@ -84,6 +87,13 @@ Page({ | @@ -84,6 +87,13 @@ Page({ | ||
| 84 | val = util.attr(e, 'val'); | 87 | val = util.attr(e, 'val'); |
| 85 | console.log(val) | 88 | console.log(val) |
| 86 | } else { | 89 | } else { |
| 90 | + if(key=='phone'){ | ||
| 91 | + console.log('key',key) | ||
| 92 | + let myreg=/^[1][3,4,5,7,8][0-9]{9}$/; | ||
| 93 | + if(!myreg.test(util.val(e))){ | ||
| 94 | + return util.val(e); | ||
| 95 | + } | ||
| 96 | + } | ||
| 87 | val = util.val(e); | 97 | val = util.val(e); |
| 88 | } | 98 | } |
| 89 | this.user[key] = val; | 99 | this.user[key] = val; |
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | data-key="phone" | 38 | data-key="phone" |
| 39 | type="number" | 39 | type="number" |
| 40 | value="{{user.phone}}" | 40 | value="{{user.phone}}" |
| 41 | - placeholder-class="input-pl" maxlength="20"/> | 41 | + placeholder-class="input-pl" maxlength="11"/> |
| 42 | </view> | 42 | </view> |
| 43 | <view class="flex-rr"> | 43 | <view class="flex-rr"> |
| 44 | <!-- 一键获取 --> | 44 | <!-- 一键获取 --> |
| @@ -281,7 +281,6 @@ Page({ | @@ -281,7 +281,6 @@ Page({ | ||
| 281 | reserveSection:e.detail.section, | 281 | reserveSection:e.detail.section, |
| 282 | seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist, | 282 | seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist, |
| 283 | }) | 283 | }) |
| 284 | - this.reserve.selectroom=e.detail.action=='click' ? [] : this.reserve.selectroom; | ||
| 285 | clearTimeout(t); | 284 | clearTimeout(t); |
| 286 | },0) | 285 | },0) |
| 287 | 286 | ||
| @@ -294,15 +293,14 @@ Page({ | @@ -294,15 +293,14 @@ Page({ | ||
| 294 | this.setData({ | 293 | this.setData({ |
| 295 | seletroomlist:e.detail.selectroom | 294 | seletroomlist:e.detail.selectroom |
| 296 | }) | 295 | }) |
| 297 | - this.reserve.selectroom=e.detail.selectroom; | ||
| 298 | }, | 296 | }, |
| 299 | complete(){ | 297 | complete(){ |
| 300 | - if(!this.reserve.selectroom || (this.reserve.selectroom && this.reserve.selectroom.length==0)){ | 298 | + if(!this.data.seletroomlist || (this.data.seletroomlist && this.data.seletroomlist.length==0)){ |
| 301 | return util.toast('请选择包间类型','none'); | 299 | return util.toast('请选择包间类型','none'); |
| 302 | } | 300 | } |
| 303 | this.reserve.sid=this.options.id | 301 | this.reserve.sid=this.options.id |
| 304 | this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00'); | 302 | this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00'); |
| 305 | - this.reserve.room_demand=JSON.stringify(this.reserve.selectroom) | 303 | + this.reserve.room_demand=JSON.stringify(this.data.seletroomlist) |
| 306 | wx.navigateTo({ | 304 | wx.navigateTo({ |
| 307 | url:util.http_build_query(this.reserve,'./submit') | 305 | url:util.http_build_query(this.reserve,'./submit') |
| 308 | }) | 306 | }) |
| @@ -337,7 +335,6 @@ Page({ | @@ -337,7 +335,6 @@ Page({ | ||
| 337 | }) | 335 | }) |
| 338 | } | 336 | } |
| 339 | this.reserve.date=e.detail.date; | 337 | this.reserve.date=e.detail.date; |
| 340 | - this.reserve.selectroom=e.detail.action=='click' ? [] : this.reserve.selectroom; | ||
| 341 | this.setData({ | 338 | this.setData({ |
| 342 | reserveDate:e.detail.date, | 339 | reserveDate:e.detail.date, |
| 343 | seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist, | 340 | seletroomlist:e.detail.action=='click' ? [] : this.data.seletroomlist, |
| @@ -109,6 +109,12 @@ Page({ | @@ -109,6 +109,12 @@ Page({ | ||
| 109 | if (key == 'sex') { | 109 | if (key == 'sex') { |
| 110 | val = util.attr(e, 'val'); | 110 | val = util.attr(e, 'val'); |
| 111 | } else { | 111 | } else { |
| 112 | + if(key=='phone'){ | ||
| 113 | + let myreg=/^[1][3,4,5,7,8][0-9]{9}$/; | ||
| 114 | + if(!myreg.test(util.val(e))){ | ||
| 115 | + return util.val(e); | ||
| 116 | + } | ||
| 117 | + } | ||
| 112 | val = util.val(e); | 118 | val = util.val(e); |
| 113 | } | 119 | } |
| 114 | this.user[key] = val; | 120 | this.user[key] = val; |
| @@ -124,7 +130,7 @@ Page({ | @@ -124,7 +130,7 @@ Page({ | ||
| 124 | return util.toast('请填写姓名','none') | 130 | return util.toast('请填写姓名','none') |
| 125 | } | 131 | } |
| 126 | if(!this.user.phone){ | 132 | if(!this.user.phone){ |
| 127 | - return util.toast('请填写手机','none') | 133 | + return util.toast('请填写正确的手机号','none') |
| 128 | } | 134 | } |
| 129 | this.hasSubmit=false; | 135 | this.hasSubmit=false; |
| 130 | let roomids=[]; | 136 | let roomids=[]; |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | data-key="phone" | 58 | data-key="phone" |
| 59 | type="number" | 59 | type="number" |
| 60 | value="{{user.phone}}" | 60 | value="{{user.phone}}" |
| 61 | - placeholder-class="input-pl" maxlength="20"/> | 61 | + placeholder-class="input-pl" maxlength="11"/> |
| 62 | <view class="flex-rr"> | 62 | <view class="flex-rr"> |
| 63 | <!-- 一键获取 --> | 63 | <!-- 一键获取 --> |
| 64 | <phone bindgetphone="getphone"> | 64 | <phone bindgetphone="getphone"> |
| @@ -49,13 +49,13 @@ | @@ -49,13 +49,13 @@ | ||
| 49 | "list": [] | 49 | "list": [] |
| 50 | }, | 50 | }, |
| 51 | "miniprogram": { | 51 | "miniprogram": { |
| 52 | - "current": 56, | 52 | + "current": 0, |
| 53 | "list": [ | 53 | "list": [ |
| 54 | { | 54 | { |
| 55 | "id": 0, | 55 | "id": 0, |
| 56 | "name": "预订本-商家1", | 56 | "name": "预订本-商家1", |
| 57 | "pathName": "pack-book/pages/book/b_index", | 57 | "pathName": "pack-book/pages/book/b_index", |
| 58 | - "query": "seller_id=80&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500", | 58 | + "query": "seller_id=154&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500", |
| 59 | "scene": 1001 | 59 | "scene": 1001 |
| 60 | }, | 60 | }, |
| 61 | { | 61 | { |
-
Please register or login to post a comment