Commit 066572abc23b17c55845382eb4a321bd9c457595

Authored by liuxuqinfhp1220
2 parents 999a2a6f eabe276e

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:
  share blur
  推荐商家
  推荐商家
  推荐商家
  推荐商家
  推荐商家
... ... @@ -40,19 +40,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
let detail=this.formatDatail(res.data)
this.setData({
detail: detail,
hasOnlineReserve:res.data.type==1,
})
if(detail.type==1 && detail.status==6){
this.GetRecommendSellerList(detail.seller.id)
}
})
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -185,9 +173,14 @@ Page({
console.log(e)
},
GetRecommendSellerList(sid){
App.Customer.GetRecommendSellerList({
let param={
sid:sid,
}).then(res=>{
}
if(this.location){
param.lat=this.location.latitude
param.lng=this.location.longitude
}
App.Customer.GetRecommendSellerList(param).then(res=>{
this.setData({
rsl:res.data
})
... ... @@ -209,4 +202,29 @@ Page({
}
}
},
location:null,
onpos(e){
console.log('onpos',e);
this.location=e.detail
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
}).then(res => {
let detail=this.formatDatail(res.data)
this.setData({
detail: detail,
hasOnlineReserve:res.data.type==1,
})
if(detail.type==1 && detail.status==6){
this.GetRecommendSellerList(detail.seller.id)
}
})
},
gotoSellerDetail(e){
console.log(e)
let url='/pages/reserve/detail?id='+e.currentTarget.id
wx.navigateTo({
url:url,
})
},
})
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"getpos":"/components/userinfo/getpos",
"as":"/components/actionSheet/index"
}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,14 @@
<nav hasHome>订座详情</nav>
<view class="page">
<view class="flex-vc success">
<block wx:if="{{detail.hasCancel}}">
<block wx:if="{{detail.hasRunning}}">
<view class="icon">
<icon type="success" size="47" color="#C8B16D"/>
</view>
<view class="title Medium">订座成功</view>
<view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
</block>
<block wx:elif="{{detail.hasCancel}}">
<view class="icon">
<icon type="info" size="47" color="#C9C9C9"/>
</view>
... ... @@ -26,18 +33,11 @@
<view class="icon">
<icon type="warn" size="47" color="#999999"/>
</view>
<view class="title Medium">{{detail.cancel.desc||'包间已订满'}}</view>
</block>
<block wx:else="">
<view class="icon">
<icon type="success" size="47" color="#C8B16D"/>
</view>
<view class="title Medium">订座成功</view>
<view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
<view class="title Medium" style="font-size: 36rpx;">抱歉!</view>
<view class="info Medium" style="font-size: 36rpx;color: #353535;">您相中的餐厅包间已经订满</view>
</block>
</block>
</view>
<block wx:if="{{detail.hasRunning}}">
<view class="flex-lr share-view" wx:if="{{detail.type==1}}">
<formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1"
... ... @@ -86,7 +86,7 @@
<view>预订人</view>
<view class="detail-info-right">{{detail.rname}}</view>
</view>
<view class="flex-lr" style="margin-top: 43rpx;">
<view class="flex-lr" style="margin-top: 43rpx;" wx:if="{{detail.type!=1}}">
<view>用餐人数</view>
<view class="detail-info-right">{{detail.pnum||detail.pnum_str}}人</view>
</view>
... ... @@ -103,18 +103,20 @@
<view class="detail-info-right">{{detail.cusdem}}</view>
</view>
</view>
<view class="hr" style="margin-top: 52rpx;margin-bottom: 48rpx;"></view>
<formids url="./detail_owner_part?id={{detail.id}}" hover-class="navigator-hover" wx:if="{{detail.customers.length>0}}">
<view class="flex-lr customers_view">
<view class="customers flex-ll">
<block wx:for="{{detail.customers}}" wx:key="detail.customers.key">
<image src="{{item.headimgurl}}" class="avatar" mode="aspectFill" wx:if="{{index<3}}"></image>
</block>
<view style="margin-left: 12rpx;">等{{detail.customers.length}}人已参加</view>
<block wx:if="{{detail.customers.length>1}}">
<view class="hr" style="margin-top: 52rpx;margin-bottom: 48rpx;"></view>
<formids url="./detail_owner_part?id={{detail.id}}" hover-class="navigator-hover" wx:if="{{detail.customers.length>0}}">
<view class="flex-lr customers_view">
<view class="customers flex-ll">
<block wx:for="{{detail.customers}}" wx:key="detail.customers.key">
<image src="{{item.headimgurl}}" class="avatar" mode="aspectFill" wx:if="{{index<3}}"></image>
</block>
<view style="margin-left: 12rpx;">等{{detail.customers.length}}人已参加</view>
</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="more"></image>
</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="more"></image>
</view>
</formids>
</formids>
</block>
<view class="detail-info Medium tuiding">
<view class="flex-rr">
<view class="item" bindtap="callSeller">联系商家</view>
... ... @@ -130,8 +132,8 @@
previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoDetail" data-sid="{{id}}">
<view class="seller" id="seller-{{id}}">
<swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
... ... @@ -146,4 +148,5 @@
<view style="height: 50rpx;"></view>
</view>
<manager manager="{{detail}}" id="manager"></manager>
<as id="as" items="{{detail.seller.seller_tel}}" bindclick="callSellerPhone">拨打电话</as>
\ No newline at end of file
<as id="as" items="{{detail.seller.seller_tel}}" bindclick="callSellerPhone">拨打电话</as>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
\ No newline at end of file
... ...
... ... @@ -107,7 +107,6 @@
.customers_view{
height: 60rpx;
line-height: 60rpx;
margin-bottom: 54rpx;
font-size: 26rpx;
color: #999999;
}
... ... @@ -128,6 +127,7 @@
}
.tuiding{
font-size: 30rpx;
margin-top: 54rpx;
}
.tuiding .item{
margin-left: 40rpx;
... ...
... ... @@ -13,9 +13,10 @@ Page({
total: 0,
tabType:1,
hasMore:true,
rsl:[],//推荐商家
},
tabType:1,
offset:1,
offset:0,
limit:10,
hasMore:true,
/**
... ... @@ -36,7 +37,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getListData();
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -53,49 +54,41 @@ Page({
},
getListData() {
App.Reserve.GetListFromScheAndRes({
flag: 1,
App.Customer.GetMyOrder({
type: this.tabType,
openid: getApp().openid,
offset:this.offset,
limit:this.limit,
}).then(res => {
let total = res.data.success.length
let total = res.data.length
let data = this.formatList(res.data);
this.hasMore=data.success.length>=this.limit
this.hasMore=res.data.length>=this.limit
if(this.hasMore){
this.offset+=this.limit
}
this.setData({
list: data.success,
list: this.data.list.concat(data),
hasMore:this.hasMore
})
if(res.data.length==0){
this.GetRecommendSellerLists()
}
})
},
_formatList(list) {
if (!list) return {};
let dlist = {};
if (list.length > 0) {
let openid = getApp().openid;
list.forEach(row => {
row.rdateStr = util.unixtoTime(row.ddate, 'MM月DD日 WW HH:II');
row.navigator = row.openid == openid ? 'detail_owner' : 'detail_customer';
let d = util.unixtoTime(row.rdate, 'MM月DD日 DAY 星期WW');
typeof dlist[d] == 'undefined' ? dlist[d] = [] : '';
dlist[d].push(row);
})
}
formatList(list) {
if (list.length<1) return [];
let dlist = [];
let openid = getApp().openid;
list.forEach(row => {
row.rdateStr = util.unixtoTime(row.ddate, 'MM月DD日 WW HH:II');
row.navigator = row.openid == openid ? 'detail_owner' : 'detail_customer';
dlist.push(row);
})
return dlist;
},
formatList(res) {
res.success = this._formatList(res.success);
res.padding = this._formatList(res.padding);
return res;
},
switchTab(e) {
this.setData({
tabFlag: util.attr(e, 'index')
tabFlag: util.attr(e, 'index'),
})
this.getListData();
},
... ... @@ -121,10 +114,21 @@ Page({
url:url,
})
},
gotoSellerDetail(e){
console.log(e)
let url='/pages/reserve/detail?id='+e.currentTarget.id
wx.navigateTo({
url:url,
})
},
switchType(e){
this.hasRecommend=true
this.offset=0
this.tabType=util.attr(e,'type')
this.setData({
tabType:this.tabType,
list: [],
hasMore:false
})
this.getListData()
},
... ... @@ -137,4 +141,43 @@ Page({
this.getListData();
}
},
hasRecommend:true,
GetRecommendSellerLists(){
if(!this.hasRecommend) return
let param={}
if(this.location){
param={
lat:this.location.latitude,
lng:this.location.longitude
}
}
App.Customer.GetRecommendSellerLists(param).then(res=>{
this.setData({
rsl:res.data
})
})
},
hasGoto:false,
bindtransition(e){
console.log(e)
if('change'==e.type){
this.hasGoto=false
}
if('animationfinish'==e.type){
if(this.hasGoto && (e.detail.current+1)==this.data.rsl.length){
wx.switchTab({
url: '/pages/reserve/index'
})
return;
}else{
this.hasGoto=true
}
}
},
location:null,
onpos(e){
console.log('onpos',e);
this.location=e.detail
this.getListData();
},
})
\ No newline at end of file
... ...
... ... @@ -6,6 +6,8 @@
"userinfo": "/components/userinfo/userinfo",
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"getpos":"/components/userinfo/getpos",
"card":"/components/seller-card/seller-card"
}
}
\ No newline at end of file
... ...
... ... @@ -9,21 +9,40 @@
<view class="page">
<block wx:if="{{list.length==0}}">
<view class="flex-vc empry">
<image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image>
<view class="Medium">暂无订座</view>
<image src="http://qn.colorcun.com/reserve/images/order-empty.png"></image>
<view class="Medium">暂无订单</view>
</view>
<block wx:if="{{rsl.length>0}}">
<view class="line-push">为你推荐</view>
<view class="transverse-list">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
</block>
</block>
<block wx:else="">
<block wx:for="{{list}}" wx:key="success.key" wx:for-item="part" wx:for-index="dateIndex">
<view class="list-content" wx:if="{{part.length>0}}">
<block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail">
<view class="card">
<card
hasShowStatus bindevent="gotoDetail"
seller="{{detail.seller}}" detail="{{detail}}"></card>
</view>
</block>
<block wx:for="{{list}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex">
<view class="card">
<card
hasShowStatus bindevent="gotoDetail"
seller="{{detail.seller}}" detail="{{detail}}"></card>
</view>
</block>
</block>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
\ No newline at end of file
... ...
... ... @@ -81,13 +81,13 @@
border-color: #C8B16D;
}
.empry{
font-size: 34rpx;
font-size: 28rpx;
margin-top: 210rpx;
}
.empry image{
width:384rpx;
height: 296rpx;
margin-bottom: 100rpx;
margin-top: 176rpx;
margin-bottom: 60rpx;
}
.cate-class{
margin-bottom: 72rpx;
... ... @@ -106,4 +106,27 @@
}
.customers view{
margin-left: 14rpx;
}
.line-push{
background-image: url("https://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
margin: 0 auto;
font-size:30rpx;
color: #C0A369;
line-height: 24rpx;
background-repeat: no-repeat;
text-align: center;
margin-top: 158rpx;
}
.transverse-list{
background-color: #fefefe;
width: 100%;
margin-top: 40rpx;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
\ No newline at end of file
... ...
... ... @@ -130,7 +130,7 @@ Page({
+'?imageView2/1/w/750/h/500/q/100'
share_image_full=seller.share_image
.replace('http://','https://')
+'?imageView2/0/w/25/q/100'
+'?imageMogr2/thumbnail/750x/blur/20x50'
console.log('share_image:',share_image)
palette={
background: '#fff',
... ...
... ... @@ -352,7 +352,7 @@
"id": 39,
"name": "pages/reserve/detail 在线订座 ",
"pathName": "pages/reserve/detail",
"query": "id=1&fromid=&activeTab=",
"query": "id=1&fromid=&activeTab=reserve",
"scene": null
},
{
... ...
... ... @@ -285,6 +285,10 @@ export default {
openid:'openid',
silence:false,
},
//我的订单
'App.Customer.GetMyOrder':null,
// 预定失败推荐商家接口
'App.Customer.GetRecommendSellerList':null,
... ...
... ... @@ -10,21 +10,35 @@ const status=[
];
export default {
reserve(detail){
/*
let ns = new Date() / 1000
//取消
detail.hasCancel=detail.status==4;
//结束
detail.hasOvered= ns > detail.edate || (detail.status >= 2 && detail.status <= 3)
detail.hasOvered= (ns > detail.edate || (detail.status >= 2 && detail.status <= 3)) && detail.status!=6
//正常运行已接单
if(detail.type==0){//B端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel
}else{//C端
detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5
}
*/
detail.hasRunning=this.hasRunningFlag(detail)
if(!detail.hasRunning){
detail.hasCancel=detail.status==4;
detail.hasOvered=detail.status!=0 && detail.status!=6;
}
detail.getStatusStr='';
if(detail.status>=0){
detail.getStatusStr=status[detail.status];
}
return detail;
},
hasRunningFlag(detail){//判断订单正在运行
let ns = new Date() / 1000
let flag=true;
if(detail.status==0 || detail.status==6 || detail.status==4) return false//未进行状态
if(ns > detail.edate) return false//超时
return flag
}
}
\ No newline at end of file
... ...