Commit fcc68df457b3987f283a0ad9a9925da30221263f
Merge branch 'master' of http://123.56.79.57/xt/xcx-book
# By vking # Via vking * 'master' of http://123.56.79.57/xt/xcx-book: log log fixbug 接单时间跨天 fixbug 我的订单 haowuquan 使用下时段进行判断 haowuquan haowuquan haowuquan haowuquan
Showing
9 changed files
with
95 additions
and
13 deletions
| @@ -124,9 +124,9 @@ | @@ -124,9 +124,9 @@ | ||
| 124 | "version": "1.2.1", | 124 | "version": "1.2.1", |
| 125 | "provider": "wx23a9cef3522e4f7c" | 125 | "provider": "wx23a9cef3522e4f7c" |
| 126 | }, | 126 | }, |
| 127 | - "myPlugin": { | ||
| 128 | - "version": "2.1.0", | ||
| 129 | - "provider": "wx6b6cb15df2836ebe" | 127 | + "haowu":{ |
| 128 | + "version": "3.2.0", | ||
| 129 | + "provider": "wx56c8f077de74b07c" | ||
| 130 | } | 130 | } |
| 131 | }, | 131 | }, |
| 132 | "permission": { | 132 | "permission": { |
| @@ -9,7 +9,11 @@ Component({ | @@ -9,7 +9,11 @@ Component({ | ||
| 9 | hasSellerShare:{ | 9 | hasSellerShare:{ |
| 10 | type:Boolean, | 10 | type:Boolean, |
| 11 | value:false, | 11 | value:false, |
| 12 | - } | 12 | + }, |
| 13 | + seller:{ | ||
| 14 | + type:Object, | ||
| 15 | + value:{}, | ||
| 16 | + }, | ||
| 13 | }, | 17 | }, |
| 14 | 18 | ||
| 15 | /** | 19 | /** |
| @@ -17,8 +21,17 @@ Component({ | @@ -17,8 +21,17 @@ Component({ | ||
| 17 | */ | 21 | */ |
| 18 | data: { | 22 | data: { |
| 19 | hasShow:false, | 23 | hasShow:false, |
| 24 | + product:null, | ||
| 25 | + }, | ||
| 26 | + lifetimes: { | ||
| 27 | + attached: function () { | ||
| 28 | + this.formatProduct() | ||
| 29 | + }, | ||
| 30 | + moved: function () { | ||
| 31 | + }, | ||
| 32 | + detached: function () { | ||
| 33 | + }, | ||
| 20 | }, | 34 | }, |
| 21 | - | ||
| 22 | /** | 35 | /** |
| 23 | * 组件的方法列表 | 36 | * 组件的方法列表 |
| 24 | */ | 37 | */ |
| @@ -46,5 +59,25 @@ Component({ | @@ -46,5 +59,25 @@ Component({ | ||
| 46 | },'/pages/reserve/share') | 59 | },'/pages/reserve/share') |
| 47 | }) | 60 | }) |
| 48 | }, | 61 | }, |
| 62 | + formatProduct(){ | ||
| 63 | + let seller=this.data.seller | ||
| 64 | + let product= { | ||
| 65 | + item_code:seller.id+"", | ||
| 66 | + title:seller.sellername, | ||
| 67 | + desc:seller.slogan, | ||
| 68 | + category_list:(seller.cate && seller.cate.length>0)?seller.cate:['餐厅','饭店','餐饮','订包间','一键订'], | ||
| 69 | + image_list:seller.envi_image, | ||
| 70 | + src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu', | ||
| 71 | + brand_info:{ | ||
| 72 | + name:seller.sellername, | ||
| 73 | + logo:seller.seller_image, | ||
| 74 | + phone:seller.seller_tel, | ||
| 75 | + }, | ||
| 76 | + sku_list:[], | ||
| 77 | + } | ||
| 78 | + this.setData({ | ||
| 79 | + product:product, | ||
| 80 | + }) | ||
| 81 | + }, | ||
| 49 | } | 82 | } |
| 50 | }) | 83 | }) |
| @@ -13,5 +13,11 @@ | @@ -13,5 +13,11 @@ | ||
| 13 | <image class="share-img qrcode"></image> | 13 | <image class="share-img qrcode"></image> |
| 14 | <view class="share-name">二维码</view> | 14 | <view class="share-name">二维码</view> |
| 15 | </view> | 15 | </view> |
| 16 | + <view class="share-item flex-vc"> | ||
| 17 | + <share-button type="3" fore-color="#dd6" product="{{product}}" style="height: 100rpx;"> | ||
| 18 | + <image class="share-img hwq"></image> | ||
| 19 | + </share-button> | ||
| 20 | + <view class="share-name">好物圈</view> | ||
| 21 | + </view> | ||
| 16 | </view> | 22 | </view> |
| 17 | </view> | 23 | </view> |
| @@ -22,6 +22,9 @@ | @@ -22,6 +22,9 @@ | ||
| 22 | .share-img.qrcode{ | 22 | .share-img.qrcode{ |
| 23 | background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004332.png"); | 23 | background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004332.png"); |
| 24 | } | 24 | } |
| 25 | +.share-img.hwq{ | ||
| 26 | + background-image: url("http://qn.colorcun.com/reserve/images/hwq.png"); | ||
| 27 | +} | ||
| 25 | .share-name{ | 28 | .share-name{ |
| 26 | margin-top: 20rpx; | 29 | margin-top: 20rpx; |
| 27 | font-size: 30rpx; | 30 | font-size: 30rpx; |
| @@ -30,6 +33,6 @@ | @@ -30,6 +33,6 @@ | ||
| 30 | color: #353535; | 33 | color: #353535; |
| 31 | } | 34 | } |
| 32 | .share-item{ | 35 | .share-item{ |
| 33 | - min-width: 33%; | ||
| 34 | - width: 33%; | 36 | + min-width: 25%; |
| 37 | + width: 25%; | ||
| 35 | } | 38 | } |
| 1 | <!--pages/reserve/detail.wxml--> | 1 | <!--pages/reserve/detail.wxml--> |
| 2 | <layout> | 2 | <layout> |
| 3 | -<nav>{{seller.sellername}}</nav> | 3 | +<nav hasHome>{{seller.sellername}}</nav> |
| 4 | <!-- 包间预定 --> | 4 | <!-- 包间预定 --> |
| 5 | <view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}"> | 5 | <view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}"> |
| 6 | <view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail"> | 6 | <view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail"> |
| @@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
| 207 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> | 207 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> |
| 208 | <getpos bindpos="onpos" id="getpos"></getpos> | 208 | <getpos bindpos="onpos" id="getpos"></getpos> |
| 209 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> | 209 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> |
| 210 | - <share id="share" seller_id="{{seller.id}}"></share> | 210 | + <share id="share" seller_id="{{seller.id}}" seller="{{seller}}" wx:if="{{seller.id}}"></share> |
| 211 | </view> | 211 | </view> |
| 212 | <view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}"> | 212 | <view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}"> |
| 213 | <view class="olreserve bg_white"> | 213 | <view class="olreserve bg_white"> |
| @@ -199,6 +199,9 @@ Page({ | @@ -199,6 +199,9 @@ Page({ | ||
| 199 | let today=util.unixtoTime(time,"YYYY-MM-DD") | 199 | let today=util.unixtoTime(time,"YYYY-MM-DD") |
| 200 | stime=util.timetouUnix(today+' '+this.data.seller.rec_stime+':00') | 200 | stime=util.timetouUnix(today+' '+this.data.seller.rec_stime+':00') |
| 201 | etime=util.timetouUnix(today+' '+this.data.seller.rec_etime+':00') | 201 | etime=util.timetouUnix(today+' '+this.data.seller.rec_etime+':00') |
| 202 | + if(etime<=stime){ | ||
| 203 | + etime+=86400 | ||
| 204 | + } | ||
| 202 | if(time>=stime && time<=etime){ | 205 | if(time>=stime && time<=etime){ |
| 203 | return true; | 206 | return true; |
| 204 | } | 207 | } |
| @@ -26,7 +26,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0, | @@ -26,7 +26,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0, | ||
| 26 | let param=""; | 26 | let param=""; |
| 27 | for(let key in data){ | 27 | for(let key in data){ |
| 28 | let val=data[key]; | 28 | let val=data[key]; |
| 29 | - if(val!=""){ | 29 | + if(val!=="" && val!==null){ |
| 30 | param+='&'+key+'='+val | 30 | param+='&'+key+'='+val |
| 31 | } | 31 | } |
| 32 | } | 32 | } |
| 1 | +import util from './util' | ||
| 1 | //0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单 | 2 | //0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单 |
| 2 | const status=[ | 3 | const status=[ |
| 3 | '待确认',//0:待确认 | 4 | '待确认',//0:待确认 |
| @@ -48,7 +49,41 @@ export default { | @@ -48,7 +49,41 @@ export default { | ||
| 48 | let flag=true; | 49 | let flag=true; |
| 49 | if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态 | 50 | if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态 |
| 50 | if(detail.status==3) return false //用餐完成(离店) | 51 | if(detail.status==3) return false //用餐完成(离店) |
| 51 | - if(ns > detail.edate) return false//超时 | 52 | + //if(ns > detail.edate) return false//超时 |
| 53 | + if(ns > this.getNextTime(detail)) return false//超时 | ||
| 52 | return flag | 54 | return flag |
| 53 | - } | 55 | + }, |
| 56 | + getNextTime(detail){//获取下时段时间 | ||
| 57 | + let solt=['','morning','noon','night','ye']; | ||
| 58 | + let daily=detail.seller.daily | ||
| 59 | + if(!daily) return detail.edate; | ||
| 60 | + let solt_index=solt[detail.ddate_solt] | ||
| 61 | + if(!solt_index) return detail.edate; | ||
| 62 | + let dur=daily[solt[detail.ddate_solt]] | ||
| 63 | + if(!dur) return detail.edate; | ||
| 64 | + let last_time=''; | ||
| 65 | + let hasToday=true | ||
| 66 | + for(let i=(parseInt(detail.ddate_solt)+1);i<solt.length;i++){ | ||
| 67 | + if(daily[solt[i]]){ | ||
| 68 | + last_time=daily[solt[i]] | ||
| 69 | + break; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + if(!last_time){//跨天 | ||
| 73 | + for(let i=1;i<solt.length;i++){ | ||
| 74 | + if(daily[solt[i]]){ | ||
| 75 | + hasToday=false | ||
| 76 | + last_time=daily[solt[i]] | ||
| 77 | + break; | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + if(!last_time) return detail.edate; | ||
| 82 | + let ns=new Date()/1000; | ||
| 83 | + if(!hasToday){ | ||
| 84 | + ns+=86400 | ||
| 85 | + } | ||
| 86 | + let timestr=util.unixtoTime(ns,"YYYY-MM-DD "+last_time.substr(0,5)+':00') | ||
| 87 | + return util.timetouUnix(timestr) | ||
| 88 | + }, | ||
| 54 | } | 89 | } |
-
Please register or login to post a comment