Showing
6 changed files
with
41 additions
and
36 deletions
| @@ -46,21 +46,23 @@ Component({ | @@ -46,21 +46,23 @@ Component({ | ||
| 46 | } | 46 | } |
| 47 | let durlist=[]; | 47 | let durlist=[]; |
| 48 | for(let key in timedur){ | 48 | for(let key in timedur){ |
| 49 | - let arr=timedur[key].split('-'); | ||
| 50 | - //每个时段的开始时间、结束时间 | ||
| 51 | - let starttime=Number(arr[0].split(':')[0]); | ||
| 52 | - let endtime=Number(arr[1].split(':')[0]); | ||
| 53 | - if(util.unixtoTime(date/1000,'YYYY-MM-DD')==this.data.date){ | ||
| 54 | - if(currenttimemark+0.5<endtime){ | ||
| 55 | - if(currenttimemark+0.5>starttime){ | ||
| 56 | - starttime=Math.round(currenttimemark)+0.5; | 49 | + if(timedur[key]!=""){ |
| 50 | + let arr=timedur[key].split('-'); | ||
| 51 | + //每个时段的开始时间、结束时间 | ||
| 52 | + let starttime=Number(arr[0].split(':')[0]); | ||
| 53 | + let endtime=Number(arr[1].split(':')[0]); | ||
| 54 | + if(util.unixtoTime(date/1000,'YYYY-MM-DD')==this.data.date){ //当天 | ||
| 55 | + if(currenttimemark+0.5<endtime){ | ||
| 56 | + if(currenttimemark+0.5>starttime){ | ||
| 57 | + starttime=Math.round(currenttimemark)+0.5; | ||
| 58 | + } | ||
| 59 | + let thisdurlist=this.getsinglelist(starttime,endtime) | ||
| 60 | + durlist=durlist.concat(thisdurlist) | ||
| 57 | } | 61 | } |
| 58 | - let thisdurlist=this.getsinglelist(starttime,endtime) | 62 | + }else{ |
| 63 | + let thisdurlist=this.getsinglelist(starttime,endtime); | ||
| 59 | durlist=durlist.concat(thisdurlist) | 64 | durlist=durlist.concat(thisdurlist) |
| 60 | } | 65 | } |
| 61 | - }else{ | ||
| 62 | - let thisdurlist=this.getsinglelist(starttime,endtime); | ||
| 63 | - durlist=durlist.concat(thisdurlist) | ||
| 64 | } | 66 | } |
| 65 | } | 67 | } |
| 66 | this.setData({ | 68 | this.setData({ |
| @@ -3,19 +3,24 @@ Component({ | @@ -3,19 +3,24 @@ Component({ | ||
| 3 | methods:{ | 3 | methods:{ |
| 4 | getphone(e){ | 4 | getphone(e){ |
| 5 | console.log(e) | 5 | console.log(e) |
| 6 | - let parmdata={ | ||
| 7 | - session_key:wx.getStorageSync('customer_session_key'), | ||
| 8 | - encryptedData:e.detail.encryptedData, | ||
| 9 | - iv:e.detail.iv | ||
| 10 | - | ||
| 11 | - } | ||
| 12 | - App.Customer.GetCustomerTel(parmdata).then((json)=>{ | ||
| 13 | - console.log(json) | ||
| 14 | - if(json.ret==200){ | ||
| 15 | - let phoneNumber=JSON.parse(json.data).phoneNumber; | ||
| 16 | - this.triggerEvent('getphoneNumber',{phone:phoneNumber}) | 6 | + if(e.detail.errMsg=="getPhoneNumber:ok"){ |
| 7 | + let parmdata={ | ||
| 8 | + session_key:wx.getStorageSync('customer_session_key'), | ||
| 9 | + encryptedData:e.detail.encryptedData, | ||
| 10 | + iv:e.detail.iv | ||
| 11 | + | ||
| 17 | } | 12 | } |
| 18 | - }) | 13 | + App.Customer.GetCustomerTel(parmdata).then((json)=>{ |
| 14 | + console.log(json) | ||
| 15 | + if(json.ret==200){ | ||
| 16 | + let phoneNumber=JSON.parse(json.data).phoneNumber; | ||
| 17 | + this.triggerEvent('getphoneNumber',{ret:200,phone:phoneNumber}) | ||
| 18 | + }else{ | ||
| 19 | + this.triggerEvent('getphoneNumber',{ret:json.ret,msg:jaon.data}) | ||
| 20 | + } | ||
| 21 | + }) | ||
| 22 | + } | ||
| 23 | + | ||
| 19 | } | 24 | } |
| 20 | } | 25 | } |
| 21 | }) | 26 | }) |
| 1 | -<button class="button-none white-font font28r smooth phone-button flex-cc" open-type="getPhoneNumber" bindgetphonenumber="getphone">一键获取</button> | ||
| 1 | +<button class="button-none white-font font28r smooth phone-button flex-cc" open-type="getPhoneNumber" bindgetphonenumber="getphone"><slot></slot></button> |
| @@ -50,7 +50,9 @@ | @@ -50,7 +50,9 @@ | ||
| 50 | placeholder-class="input-pl"/> | 50 | placeholder-class="input-pl"/> |
| 51 | <view class="flex-rr"> | 51 | <view class="flex-rr"> |
| 52 | <!-- 一键获取 --> | 52 | <!-- 一键获取 --> |
| 53 | - <phone></phone> | 53 | + <phone> |
| 54 | + <view class="smooth white-font get-phone flex-cc" style="font-size:28rpx;">一键获取</view> | ||
| 55 | + </phone> | ||
| 54 | </view> | 56 | </view> |
| 55 | </view> | 57 | </view> |
| 56 | </view> | 58 | </view> |
-
Please register or login to post a comment