Commit fcc68df457b3987f283a0ad9a9925da30221263f

Authored by liuxuqinfhp1220
2 parents b8da979a 26791df8

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
... ... @@ -124,9 +124,9 @@
"version": "1.2.1",
"provider": "wx23a9cef3522e4f7c"
},
"myPlugin": {
"version": "2.1.0",
"provider": "wx6b6cb15df2836ebe"
"haowu":{
"version": "3.2.0",
"provider": "wx56c8f077de74b07c"
}
},
"permission": {
... ...
... ... @@ -9,7 +9,11 @@ Component({
hasSellerShare:{
type:Boolean,
value:false,
}
},
seller:{
type:Object,
value:{},
},
},
/**
... ... @@ -17,8 +21,17 @@ Component({
*/
data: {
hasShow:false,
product:null,
},
lifetimes: {
attached: function () {
this.formatProduct()
},
moved: function () {
},
detached: function () {
},
},
/**
* 组件的方法列表
*/
... ... @@ -46,5 +59,25 @@ Component({
},'/pages/reserve/share')
})
},
formatProduct(){
let seller=this.data.seller
let product= {
item_code:seller.id+"",
title:seller.sellername,
desc:seller.slogan,
category_list:(seller.cate && seller.cate.length>0)?seller.cate:['餐厅','饭店','餐饮','订包间','一键订'],
image_list:seller.envi_image,
src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu',
brand_info:{
name:seller.sellername,
logo:seller.seller_image,
phone:seller.seller_tel,
},
sku_list:[],
}
this.setData({
product:product,
})
},
}
})
... ...
{
"component": true,
"usingComponents": {}
"usingComponents": {
"share-button": "plugin://haowu/share-button"
}
}
\ No newline at end of file
... ...
... ... @@ -13,5 +13,11 @@
<image class="share-img qrcode"></image>
<view class="share-name">二维码</view>
</view>
<view class="share-item flex-vc">
<share-button type="3" fore-color="#dd6" product="{{product}}" style="height: 100rpx;">
<image class="share-img hwq"></image>
</share-button>
<view class="share-name">好物圈</view>
</view>
</view>
</view>
... ...
... ... @@ -22,6 +22,9 @@
.share-img.qrcode{
background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004332.png");
}
.share-img.hwq{
background-image: url("http://qn.colorcun.com/reserve/images/hwq.png");
}
.share-name{
margin-top: 20rpx;
font-size: 30rpx;
... ... @@ -30,6 +33,6 @@
color: #353535;
}
.share-item{
min-width: 33%;
width: 33%;
min-width: 25%;
width: 25%;
}
\ No newline at end of file
... ...
<!--pages/reserve/detail.wxml-->
<layout>
<nav>{{seller.sellername}}</nav>
<nav hasHome>{{seller.sellername}}</nav>
<!-- 包间预定 -->
<view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail">
... ... @@ -207,7 +207,7 @@
<as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as>
<getpos bindpos="onpos" id="getpos"></getpos>
<discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount>
<share id="share" seller_id="{{seller.id}}"></share>
<share id="share" seller_id="{{seller.id}}" seller="{{seller}}" wx:if="{{seller.id}}"></share>
</view>
<view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}">
<view class="olreserve bg_white">
... ...
... ... @@ -199,6 +199,9 @@ Page({
let today=util.unixtoTime(time,"YYYY-MM-DD")
stime=util.timetouUnix(today+' '+this.data.seller.rec_stime+':00')
etime=util.timetouUnix(today+' '+this.data.seller.rec_etime+':00')
if(etime<=stime){
etime+=86400
}
if(time>=stime && time<=etime){
return true;
}
... ...
... ... @@ -26,7 +26,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
let param="";
for(let key in data){
let val=data[key];
if(val!=""){
if(val!=="" && val!==null){
param+='&'+key+'='+val
}
}
... ...
import util from './util'
//0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单
const status=[
'待确认',//0:待确认
... ... @@ -48,7 +49,41 @@ export default {
let flag=true;
if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态
if(detail.status==3) return false //用餐完成(离店)
if(ns > detail.edate) return false//超时
//if(ns > detail.edate) return false//超时
if(ns > this.getNextTime(detail)) return false//超时
return flag
}
},
getNextTime(detail){//获取下时段时间
let solt=['','morning','noon','night','ye'];
let daily=detail.seller.daily
if(!daily) return detail.edate;
let solt_index=solt[detail.ddate_solt]
if(!solt_index) return detail.edate;
let dur=daily[solt[detail.ddate_solt]]
if(!dur) return detail.edate;
let last_time='';
let hasToday=true
for(let i=(parseInt(detail.ddate_solt)+1);i<solt.length;i++){
if(daily[solt[i]]){
last_time=daily[solt[i]]
break;
}
}
if(!last_time){//跨天
for(let i=1;i<solt.length;i++){
if(daily[solt[i]]){
hasToday=false
last_time=daily[solt[i]]
break;
}
}
}
if(!last_time) return detail.edate;
let ns=new Date()/1000;
if(!hasToday){
ns+=86400
}
let timestr=util.unixtoTime(ns,"YYYY-MM-DD "+last_time.substr(0,5)+':00')
return util.timetouUnix(timestr)
},
}
\ No newline at end of file
... ...