Commit dabf061e4a3cfb85edb760dbd3f6b8486be93459

Authored by Yolanda
1 parent 2784207b

no message

Showing 51 changed files with 1505 additions and 371 deletions
... ... @@ -4,7 +4,9 @@
<view class="item {{index==multiIndex[0]?'active':''}}"
bindtap="active" data-index="{{index}}"
wx:for="{{multiArray[0]}}" wx:key="multiArraykey">
{{item}}
<view style="height:{{index>0 ? '14rpx' : 0}}"></view>
<view style="line-height: {{index>0 ? '32rpx' : '80rpx'}};">{{item.name}}</view>
<block wx:if="{{index>0}}"><view style="line-height: 24rpx;">({{item.cu}})</view></block>
<view class="number" wx:if="{{index>=1 && index<4}}">{{index}}</view>
</view>
</view>
... ...
... ... @@ -16,14 +16,14 @@
.item{
background-color: #F1F1F1;
width: 150rpx;
height: 70rpx;
height: 80rpx;
overflow: hidden;
white-space:nowrap;
border-radius: 4rpx;
line-height: 70rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
margin-bottom: 30rpx;
margin-bottom: 20rpx;
position: relative;
display: inline-block;
margin-right: calc((100% - 600rpx) / 3);
... ...
// components/2.0/filter/filter-group.js
import DA from '../../../pages/reserve/data';
import util from '../../../utils/util'
import QQMapWX from '../../../utils/qqmap-wx-jssdk.js'
const qqmapsdk = new QQMapWX({
key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
});
Component({
/**
* 组件的属性列表
... ... @@ -9,13 +13,21 @@ Component({
height:Number,
disabled:Boolean,
filterParams:Object,//人均过滤初始值
location:{
type:Object,
value:{
latitude:39.684671,
longitude:118.176300
}
}
},
/**
* 组件的初始数据
*/
data: {
multiArray: ['全部菜系'],
multiArray: [{name:'全部菜系',cu:''}],
multiIndex: [0],
tags: [
{id: 1, name: '环境好'},
... ... @@ -26,7 +38,8 @@ Component({
filterOpened:false,
},
attached(){
this.init()
// this.init('610100');
this.getcityCode();
this.filterParams= null
this.paramsData={}//过滤参数集合
setTimeout(()=>{
... ... @@ -42,10 +55,11 @@ Component({
* 组件的方法列表
*/
methods: {
async init(){
async init(code){
this.setData({
multiArray: [['全部菜系'].concat(await DA.getCates())]
multiArray: [[{name:'全部菜系',cu:''}].concat(await DA.getCates(code))]
})
console.log('puhl',this.data.multiArray);
this.filterParams= this.data.filterParams
},
caixiActive(e) {
... ... @@ -54,7 +68,7 @@ Component({
multiIndex: [e.detail]
})
if(e.detail>0){
DA.getCatesID(parseInt(e.detail) - 1).then(cuisine=>{
DA.getCatesID(parseInt(e.detail) - 1,this.citycode).then(cuisine=>{
this.paramsData.cuisine=cuisine
this.eventPush()
})
... ... @@ -156,6 +170,19 @@ Component({
eventPush(){
this.triggerEvent('event',this.paramsData);
},
getcityCode(){
qqmapsdk.reverseGeocoder({
location: {
latitude: this.data.location.latitude,
longitude: this.data.location.longitude
},
success:(res)=>{
if(res.status!=0) return;
console.log('qqmapsdk.reverseGeocoder',res.result)
this.citycode=res.result.ad_info.city_code.slice(3);
this.init(this.citycode);
},
})
}
}
})
... ...
... ... @@ -6,7 +6,7 @@
class="view bg-white flex flex-sub filter-group padding-top-sm padding-left-lg padding-right-lg padding-bottom-sm {{caixiOpened || filterOpened?'filter-group-opened':''}}">
<view class="view cu-tag round {{caixiOpened?'opened text-blue':''}} {{multiIndex[0]>0?'bg-blue light':''}} " bindtap="caixiShow">
<block wx:if="{{multiIndex[0]==0}}">菜系</block>
<block wx:else="">{{multiArray[0][multiIndex[0]]}}</block>
<block wx:else="">{{multiArray[0][multiIndex[0]].name}}</block>
<view class="more view"></view>
</view>
<block wx:for="{{tags}}" wx:key="tagskey">
... ...
// components/2.0/reserve/card.js
import util from '../../../utils/util';
import App from '../../../utils/api';
import RS from '../../../utils/reserveStatus'
Component({
/**
... ... @@ -7,6 +8,7 @@ Component({
*/
properties: {
detail:Object,
tabType:Number
},
/**
... ... @@ -50,6 +52,87 @@ Component({
this.setData({
reserve:detail,
})
}
console.log('666666',detail);
if(this.data.tabType==6){
this.remark('auto');
}
},
openlocation(){
console.log('6666666')
wx.openLocation({
latitude:Number(this.data.reserve.seller.lat),
longitude:Number(this.data.reserve.seller.long),
scale: 18
})
},
remark(action='click'){
App.Customer.CheckIsComment({rid:this.data.reserve.id}).then(res => {
console.log('66666fffffff',res)
this.setData({
hasComment:res.data!=1,//已评论
})
if(action=='click'){
if(res.data==0){
wx.navigateTo({
url:'/pages/pinglun/create?sid='+this.data.reserve.seller.id+'&oid='+this.data.reserve.id+'&sellername='+this.data.reserve.seller.sellername
})
}else{
wx.showToast({
title:'该订单已评论',
icon:'none'
})
}
}
})
},
cookbook() {
if (this.data.reserve.order && this.data.reserve.order.cookbooklist.length > 0) {
wx.navigateTo({
url: util.http_build_query({
rid: this.data.reserve.id,
oid: this.data.reserve.order.id,
identity: 1
}, '/pack-cookbook/pages/success')
});
} else {
App.Advance.CreateOrder({
rid: this.data.reserve.id,
openid: getApp().openid,
}).then(res => {
if (res.ret != 200) {
return util.toast(res.msg, 'none')
}
wx.navigateTo({
url: util.http_build_query({
rid: this.data.reserve.id,
oid: res.data.id,
identity: 1,
sid: res.data.sellerid
}, '/pack-cookbook/pages/index')
});
})
}
},
checkout(){
if(this.data.reserve.status==0){
this.selectComponent('#showModal').options({
header: '您点早啦!',
body: '商家分配包间后,您可以通过在线买单支付,无需到前台结账排队等发票。'
}).show();
}else{
wx.navigateTo({
url:util.http_build_query({
rid:this.data.reserve.id,
sid:this.data.reserve.seller.id
},'/pack-checkout/pages/index')
})
}
},
}
})
... ...
{
"component": true,
"usingComponents": {}
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"showModal":"/components/tips/showModal/showModal"
}
}
\ No newline at end of file
... ...
... ... @@ -3,18 +3,25 @@
<view class="view margin-lr-lg margin-top-sm solid radius padding padding-bottom-lg" style="box-shadow: 0px 0px 20rpx 0px #EEF0F2;">
<view class="view flex padding-bottom solid-bottom align-center">
<view class="view round margin-right-sm"
style="width: 60rpx;height: 60rpx; background-image: url('{{reserve.seller.seller_image}}');">
style="min-width:60rpx;width: 60rpx;height: 60rpx; background-image: url('{{reserve.seller.seller_image}}');">
</view>
<view class="view text-cut flex-treble">
<view class="view text-lg text-cut Medium" style="margin-bottom: 16rpx;">{{reserve.seller.sellername}}</view>
<view class="view text-df bg-white text-cut">{{reserve.seller.map_address}}</view>
</view>
<view class="view margin-left-sm text-blue text-lg Medium" style="min-width: 100rpx;">
{{reserve.getStatusStr}}
<view class="flex-lr" style="width: 100%;">
<view class="text-lg text-cut Medium" style="margin-bottom: 16rpx;">{{reserve.seller.sellername}}</view>
<view class="margin-left-sm text-blue text-lg Medium" style="min-width: 100rpx;margin-bottom: 16rpx;font-size: 30rpx;">
{{reserve.getStatusStr}}
</view>
</view>
<view class="flex-lr" catchtap="openlocation">
<view class="view text-df bg-white text-cut" style="max-width: 450rpx;">{{reserve.seller.map_address}}</view>
<view class="more"></view>
</view>
</view>
</view>
<view class="view margin-top">
<view class="view flex align-center" style="margin-bottom: 44rpx;">
<view class="view margin-top solid-bottom">
<view class="view flex align-center" style="margin-bottom: 30rpx;">
<view class="view flex-sub bg-white Medium">预订时间</view>
<view class="view flex-treble text-bold" style="font-size: 36rpx;">
<view class="value" wx:if="{{reserve.hasOnlineReserve || reserve.hasUpdateDate || reserve.type==0}}">
... ... @@ -23,11 +30,52 @@
<view class="value" wx:else="">{{reserve.rdateStr}}</view>
</view>
</view>
<view class="view flex align-center">
<view class="view flex align-center" style="margin-bottom: 30rpx;">
<view class="view flex-sub bg-white Medium" style="min-width: 140rpx;">包间类型</view>
<view class="view flex-treble text-bold text-cut" style="font-size: 36rpx;">
{{reserve.tableFirst||util.getRoomName(reserve.room_demand)}}
</view>
</view>
<view class="view flex align-center" style="margin-bottom: 30rpx;">
<view class="view flex-sub bg-white Medium" style="min-width: 140rpx;">预订人</view>
<view class="view flex-treble text-cut text-bold" style="font-size: 36rpx;">
{{reserve.rname}}
</view>
</view>
<view class="view flex align-center">
<view class="view flex-sub bg-white Medium" style="min-width: 140rpx;">联系电话</view>
<view class="view flex-treble text-cut text-bold" style="font-size: 36rpx;">
{{reserve.phone?reserve.phoneMask:''}}
</view>
</view>
<view style="height: 30rpx;"></view>
</view>
<view class="view button-cover flex-rr">
<navigator url="/pages/reserve/reserve?id={{reserve.seller.id}}&activeTab=reserve" class="second-book-button flex-cc item-button">再次预订</navigator>
<view class="remark-button flex-cc item-button" wx:if="{{tabType==6 && hasComment}}" catchtap="remark">评价</view>
<block wx:if="{{tabType==5}}">
<userinfo
binduserinfo="checkout"
share="{{reserve}}"
share-act="invitation" wx:if="{{reserve.hasRunning && reserve.seller.isopen_md==1}}">
<view class="buy-button flex-cc item-button" >买单</view>
</userinfo>
<block wx:if="{{reserve.hasRunning && reserve.seller.is_open_order==1}}">
<userinfo
binduserinfo="cookbook"
bindshare="share"
share="{{reserve}}"
share-act="invitation">
<view class="item-button flex-cc order-button" wx:if="{{reserve.order && reserve.order.cookbooklist.length>0}}">查看菜品</view>
<view class="item-button flex-cc order-button" wx:else>提前点餐</view>
</userinfo>
</block>
</block>
</view>
</view>
<showModal id="showModal" confirmText="知道了" bindshowModal="showModal" cla="checkout"></showModal>
... ...
/* components/2.0/reserve/card.wxss */
@import "../../../colorui/main.wxss";
\ No newline at end of file
@import "../../../colorui/main.wxss";
@import '../../../app.wxss';
.button-cover{
width: 100%;
padding-top: 30rpx;
font-size: 28rpx;
}
.remark-button{
width: 120rpx;
height: 60rpx;
border-radius: 30rpx;
border: 2rpx solid #42A5FF;
box-sizing: border-box;
color: #42A5FF;
}
.second-book-button{
width: 160rpx;
height: 60rpx;
border-radius: 30rpx;
border: 2rpx solid #666666;
box-sizing: border-box;
color: #353535;
}
.item-button{
margin-right: 20rpx;
font-size: 28rpx;
}
.buy-button{
width: 120rpx;
height: 60rpx;
border-radius: 30rpx;
border: 2rpx solid #42A5FF;
box-sizing: border-box;
color: #42A5FF;
}
.order-button{
width: 160rpx;
height: 60rpx;
border-radius: 30rpx;
background: #E6F3FF;
box-sizing: border-box;
color: #42A5FF;
}
.item-button:last-child{
margin-right: 0;
}
\ No newline at end of file
... ...
/* components/2.0/reserve/card.wxss */
@import "/colorui/main.wxss";
\ No newline at end of file
@import "/colorui/main.wxss";
... ...
... ... @@ -8,7 +8,9 @@
</view>
<view class="view detail margin-left-sm flex-treble margin-top-sm text-cut">
<view class="view flex align-center justify-between" style="height: 52rpx;">
<view class="view title text-bold text-cut margin-right-sm">{{sellerx.sellername}}</view>
<view class="view title text-bold text-cut margin-right-sm">
<text style="color: #ffffff;font-size: 24rpx;margin-right: 4rpx;background-color:#d81e06;display: inline-block;border-radius: 8rpx;width: 66rpx;height: 36rpx;line-height: 36rpx;text-align: center;" wx:if="{{sellerx.is_have_activity==1}}">优惠</text>
{{sellerx.sellername}}</view>
<view class="view text-gray" style="font-size: 26rpx;">{{util.distance(sellerx.distance||sellerx.distance_centre)}}</view>
</view>
<view class="view flex align-center justify-between text-gray margin-top-xs" style="height: 36rpx;">
... ... @@ -35,8 +37,12 @@
<block wx:for="{{sellerx.class}}" wx:key="seclass">
<view
data-cid="{{item.id}}" data-cname="{{item.name}}"
class="cu-tag round line-blue text-blue view">{{item.name}}</view>
class="cu-tag round line-blue text-blue view" wx:if="{{index<3}}">{{item.name}}</view>
</block>
<block wx:if="{{sellerx.class.length>3}}">
<view class="cu-tag round line-blue text-blue view">...</view>
</block>
<view class="cu-tag round line-white text-blue view cu-tag-end"></view>
</view>
<view class="view button-view flex justify-end" bindtap="reserve">
... ...
<!--pages/reserve/indexList.wxml-->
<nav>
<view class="view header flex align-center justify-center text-blue padding-left" style="right:{{right}}px;top:{{top}}px;" wx:if="{{right>0}}">
<view class="view flex flex-direction" bindtap="dispalySearchHow">
<view class="view txt-26-h">{{headerHows[0]}}</view>
<view class="view txt-26-h">{{headerHows[1]}}</view>
</view>
<view class="line margin-lr"></view>
<view class="flex justify-around align-center" bindtap="searchKeyword">
<image class="margin-right-sm" wx:if="{{!keyword}}"
style="width: 32rpx; height: 32rpx;" src="http://nosqn.colorcun.com/search/s%20%2811%29.png"></image>
<view class="view text-cut txt-34-h text-left margin-right-sm"
style="width: 170rpx;">{{keyword||'搜索餐厅…'}}</view>
<view class="margin-right-sm clean view"
wx:if="{{keyword}}" catchtap="moveToLocation"></view>
</view>
</view>
</nav>
<!--
<view class="searchAddrView searchKeyword bg-white" bindtap="gotoSearch">
<view class="searchAddr flex-ll">
<image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image>
<input style="width: 100%;" placeholder="{{search_placeholder}}"
type="text" disabled placeholder-class="placeholder"
value="{{keyword}}"/>
<view class="clean" catchtap="moveToLocation" wx:if="{{keyword && hasSuggestion}}"></view>
</view>
</view>
-->
<view class="view content" style="height: calc(100vh - 65px);">
<filter-group height="{{height}}"
id="filter-group"
filterParams="{{filterParams}}"
bindevent="filterGroupEvent"
disabled="{{(sellers.length<1 && !hasFilterData) || hasLoading}}"></filter-group>
<block wx:if="{{hasLoading}}">
<view class="view flex flex-direction justify-center align-center" wx:if="{{hasLoading}}">
<image class="view" src="http://nosqn.colorcun.com/2.0/timg.gif" style="width: 40rpx;height: 40rpx;margin-top: 260rpx;"></image>
<view class="view bg-white text-sm margin-top">包间查找中,请稍后…</view>
</view>
</block>
<block wx:elif="{{sellers.length<1}}">
<view class="view flex flex-direction justify-center align-center empty-box margin-sm">
<image class="margin-top"
src="http://nosqn.colorcun.com/2.0/home%20%2818%29.png" style="width: 520rpx; height: 384rpx;"></image>
<view class="view margin-top-lg text-df">抱歉,没有找到符合的内容</view>
<view class="view margin-top-xs text-df">试试搜搜别的</view>
</view>
</block>
<block wx:else="">
<scroll-view class="view scroll-view" scroll-y="true"
scroll-into-view="seller-{{scrollSellerID}}"
scroll-with-animation
bindscrolltolower="getListMore"
style="width:100%;height: calc(100vh - 65px);">
<block wx:for="{{sellers}}" wx:key="sellers" >
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
<seller-card class="seller-card" id="seller-{{item.id}}"
activeSellerID="{{activeSellerID}}"
seller="{{item}}" bindevent="sellerCardEvent" ></seller-card>
</navigator>
</block>
<view class="view" style="height: 160rpx;"></view>
</scroll-view>
</block>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<as-phone id="as"></as-phone>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<menu></menu>
<service></service>
\ No newline at end of file
... ...
import App from '../../utils/api';
import util from '../../utils/util'
Component({
data:{
menuhidden:true,
... ... @@ -5,8 +7,44 @@ Component({
},
attached: function() {
this.setStatus();
this.getuser();
this.getautomenu();
this.getorder();
},
methods:{
getuser(){
App.User.GetBalance().then(res=>{
this.setData({
user:res.data
})
})
},
getorder(){
App.Reserve.GetReserveIsConsume().then((json)=>{
if(json.ret==200){
console.log('787878',json.data)
this.setData({
haveorder:json.data.is_customer==1 || json.data.is_manager==1
})
}
})
},
getautomenu(){
App.Foodset.GetUserFoodOrders({
status:2,//tabType,
openid: getApp().openid,
offset:1,
limit:1,
size:1,
}).then(res=>{
console.log(res)
if(res.data.length>0){
this.setData({
shownotice:true
})
}
})
},
showmenu(){
this.setData({
menuhidden:false
... ... @@ -19,10 +57,28 @@ Component({
},
topage(e){
let url=e.currentTarget.dataset.path;
wx.redirectTo({
wx.navigateTo({
url:url
})
},
topagerelunch(e){
let url=e.currentTarget.dataset.path;
wx.reLaunch({
url:url
})
},
tosearch(e){
let url=e.currentTarget.dataset.path;
wx.navigateTo({
url:url
})
},
gotoList(e){
getApp().meListType=e.currentTarget.dataset.type;
wx.redirectTo({
url:'/pages/me/list?type='+e.currentTarget.dataset.type
})
},
setStatus(){
let pages = getCurrentPages();
let p = pages[pages.length - 1];
... ...
<view class="menu flex-vc" bindtap="showmenu"></view>
<view class="menu-list flex-vl" style="justify-content: flex-end;" hidden="{{menuhidden}}" bindtap="hidemenu">
<view class="menu-mask" hidden="{{menuhidden}}" bindtap="hidemenu"></view>
<view class="menu-cover">
<view class="menu flex-vc white-font font28r" bindtap="{{menuhidden ? 'showmenu' : 'hidemenu'}}">
<block wx:if="{{menuhidden}}">
更多
<view class="notice" wx:if="{{shownotice==true || haveorder==true}}"></view>
</block>
<block wx:else>关闭</block>
</view>
<block wx:if="{{'pages/me/index'!=url}}">
<view class="menu-item white-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-me-active'}}" bindtap="topagerelunch" data-path="/pages/me/index">我的</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-me-active'}}" data-path="/pages/me/index">我的</view>
</block>
<block wx:if="{{'pages/me/list'!=url}}">
<view class="menu-item white-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-order-active'}}" bindtap="topagerelunch" data-path="/pages/me/list">订单</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-order-active'}}" data-path="/pages/me/list">订单</view>
</block>
<block wx:if="{{'pages/reserve/index'!=url}}">
<view class="menu-item white-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-home-active'}}" bindtap="topagerelunch" data-path="/pages/reserve/index">首页</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-home-active'}}" data-path="/pages/me/index">首页</view>
</block>
<block wx:if="{{'pages/me/follow'!=url}}">
<view class="menu-item white-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-collection-active'}}" bindtap="topage" data-path="/pages/me/follow">收藏</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-collection-active'}}" data-path="/pages/me/follow">收藏</view>
</block>
<block wx:if="{{'pages/me/list'!=url}}">
<view class="menu-item white-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-package-active'}}" bindtap="gotoList" data-path="/pages/me/list" data-type="7">套餐
<view class="notice" wx:if="{{shownotice==true}}"></view>
</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-package-active'}}" data-path="/pages/me/list">套餐
<view class="notice" wx:if="{{shownotice==true}}"></view>
</view>
</block>
<block wx:if="{{'pages/me/coupon'!=url}}">
<view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon">
<view>卡包</view>
<view>({{user.customer_activity}})</view>
</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon">
<view>卡包</view>
<view>({{user.customer_activity}})</view>
</view>
</block>
</view>
<!-- <view class="menu-list flex-vl" style="justify-content: flex-end;" hidden="{{menuhidden}}" bindtap="hidemenu">
<view class="menu-item menu-seller-item flex-ll" bindtap="hidemenu">
<view class="menu-item-image menu-item-back"></view>
<view class="white-font font30r smooth">返回</view>
</view>
<block wx:if="{{'pages/me/index'!=url}}">
<view class="menu-item menu-seller-item flex-ll" bindtap="topage" data-path="/pages/me/index">
<view class="menu-item menu-seller-item flex-ll" bindtap="topage" data-path="/pages/me/index" style="left: 40rpx;top: ;">
<view class="menu-item-image menu-item-me"></view>
<view class="white-font font30r smooth">我的</view>
</view>
... ... @@ -16,17 +73,15 @@
<view class="white-font font30r smooth">订单</view>
</view>
</block>
<block wx:if="{{'pages/reserve/search'!=url}}">
<view class="menu-item menu-seller-item flex-ll" bindtap="topage" data-path="/pages/reserve/search">
<view class="menu-item-image menu-item-search"></view>
<view class="white-font font30r smooth" bindtap="">搜索</view>
</view>
</block>
<block wx:if="{{'pages/reserve/index'!=url}}">
<view class="menu-item menu-seller-item flex-ll" bindtap="topage" data-path="/pages/reserve/index">
<view class="menu-item-image menu-item-nearby"></view>
<view class="white-font font30r smooth" bindtap="">附近</view>
<view class="white-font font30r smooth" bindtap="">首页</view>
</view>
</block>
</view>
\ No newline at end of file
</view> -->
<block wx:if="{{'pages/reserve/search'!=url && 'pages/reserve/searchKeyword'!=url}}">
<view class="menu-search-fixed flex-vc" bindtap="tosearch" data-path="/pages/reserve/search">
<view class="white-font font22r smooth" style="color: #42A5FF;">搜索</view>
</view>
</block>
\ No newline at end of file
... ...
@import '../../app.wxss';
.menu{
.menu-cover{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
position: fixed;
left: 40rpx;
bottom: 80rpx;
left: 20rpx;
bottom: 200rpx;
z-index: 10001;
border-radius: 50;
background: url(http://libpc.colorcun.com/navigator.png) center center no-repeat;
}
.menu-mask{
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10000;
}
.menu{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
/* position: fixed;
left: 40rpx;
bottom: 200rpx;
z-index: 10000;
border-radius: 50; */
/* background: url(http://libpc.colorcun.com/navigator.png) center center no-repeat;
background-size: contain; */
background: rgba(0,0,0,.8);
position: relative;
z-index: 2;
}
.menu-search-fixed{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
position: fixed;
left: 20rpx;
bottom:380rpx;
z-index: 9999;
background: url(http://nosqn.colorcun.com/searchfixed.png) center center no-repeat;
background-size: contain;
padding-top: 40rpx;
box-sizing: border-box;
font-size: 22rpx;
color: #42A5FF;
}
.menu image{
width: 34rpx;
... ... @@ -29,34 +65,72 @@
box-sizing: border-box;
}
.menu-item{
width: 100rpx;
height: 100rpx;
margin-bottom: 40rpx;
position: absolute;
background: rgba(0,0,0,.8);
border-radius: 50%;
left: 0;
top: 0;
transition: left .2s ease,top .2s ease;
opacity: 0;
}
.menu-item-me-active{
opacity: 1;
left: 0rpx;
top: -180rpx;
}
.menu-item-order-active{
opacity: 1;
left: 106rpx;
top: -146rpx;
}
.menu-item-home-active{
opacity: 1;
left: 171rpx;
top: -56rpx;
}
.menu-item-collection-active{
opacity: 1;
left: 171rpx;
top: 56rpx;
}
.menu-item-package-active{
opacity: 1;
left: 106rpx;
top: 146rpx;
}
.menu-item-card-active{
opacity: 1;
left: 0rpx;
top: 180rpx;
}
.menu-item-image{
width: 100rpx;
height: 100rpx;
margin-right: 20rpx;
border-radius: 50%;
/* margin-right: 20rpx; */
/* border-radius: 50%; */
}
.menu-item-search{
background: url(http://libpc.colorcun.com/search.png) center center no-repeat;
background-size: contain;
}
.menu-item-order{
background: url(http://libpc.colorcun.com/order.png) center center no-repeat;
background-size: contain;
/* background: url(http://libpc.colorcun.com/order.png) center center no-repeat;
background-size: contain; */
}
.menu-item-me{
background: url(http://libpc.colorcun.com/me.png) center center no-repeat;
background-size: contain;
/* background: url(http://libpc.colorcun.com/me.png) center center no-repeat;
background-size: contain; */
}
.menu-item-back{
background: url(http://nosqn.colorcun.com/menu-back.png) center center no-repeat;
background-size: contain;
/* background: url(http://nosqn.colorcun.com/menu-back.png) center center no-repeat;
background-size: contain; */
}
.menu-item-nearby{
background: url(http://libpc.colorcun.com/nearby.png) center center no-repeat;
background-size: contain;
/* background: url(http://libpc.colorcun.com/nearby.png) center center no-repeat;
background-size: contain; */
}
.click-icon{
width: 12rpx;
... ... @@ -68,4 +142,13 @@
}
.gray-font{
color: #999999;
}
.notice{
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background: #FA5151;
position: absolute;
right: 14rpx;
top: 32rpx;
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@ Component({
},
methods:{
showmenu(){
console.log('66666')
this.setData({
menuhidden:false
})
... ... @@ -17,10 +18,10 @@ Component({
menuhidden:true
})
},
topage(e){
let url=e.currentTarget.dataset.path;
wx.redirectTo({
url:url
noopen(){
wx.showToast({
title:'当前城市暂未开通该服务,敬请期待',
icon:'none'
})
},
setStatus(){
... ...
<view class="menu flex-vc white-font font26r" bindtap="showmenu">
<view>更多</view>
<view>服务</view>
<view class="menu-mask" hidden="{{menuhidden}}" bindtap="hidemenu"></view>
<view class="service-cover">
<view class="menu flex-vc white-font font26r" bindtap="{{menuhidden ? 'showmenu' : 'hidemenu'}}">
<block wx:if="{{menuhidden}}">
<view>其他</view>
<view>服务</view>
</block>
<block wx:else>关闭</block>
</view>
<view class="service-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-driving-active'}}" bindtap="noopen">代驾</view>
<view class="service-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-teahouse-active'}}" bindtap="noopen">茶楼</view>
<view class="service-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-foot-active'}}" bindtap="noopen">沐足</view>
<view class="service-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-shower-active'}}" bindtap="noopen">洗浴</view>
</view>
<view class="menu-list flex-vr" style="justify-content: flex-end;align-items: flex-end;" hidden="{{menuhidden}}" bindtap="hidemenu">
<!-- <view class="menu-list flex-vr" style="justify-content: flex-end;align-items: flex-end;" hidden="{{menuhidden}}" bindtap="hidemenu">
<view class="menu-item menu-seller-item flex-rr">
<view class="gray-font font30r smooth">代驾</view>
<view class="menu-item-image menu-item-driving"></view>
... ... @@ -23,29 +33,4 @@
<view class="white-font font30r smooth">返回</view>
<view class="menu-item-image menu-item-back"></view>
</view>
<!-- <block wx:if="{{'pages/me/index'!=url}}">
<view class="menu-item menu-seller-item flex-rr" bindtap="topage" data-path="/pages/me/index">
<view class="menu-item-image menu-item-me"></view>
<view class="white-font font30r smooth">我的</view>
</view>
</block>
<block wx:if="{{'pages/me/list'!=url}}">
<view class="menu-item menu-seller-item flex-rr" bindtap="topage" data-path="/pages/me/list">
<view class="menu-item-image menu-item-order"></view>
<view class="white-font font30r smooth">订单</view>
</view>
</block>
<block wx:if="{{'pages/reserve/search'!=url}}">
<view class="menu-item menu-seller-item flex-rr" bindtap="topage" data-path="/pages/reserve/search">
<view class="menu-item-image menu-item-search"></view>
<view class="white-font font30r smooth" bindtap="">搜索</view>
</view>
</block>
<block wx:if="{{'pages/reserve/index'!=url}}">
<view class="menu-item menu-seller-item flex-rr" bindtap="topage" data-path="/pages/reserve/index">
<view class="menu-item-image menu-item-nearby"></view>
<view class="white-font font30r smooth" bindtap="">附近</view>
</view>
</block> -->
</view>
\ No newline at end of file
</view> -->
\ No newline at end of file
... ...
@import '../../app.wxss';
.menu{
.menu-mask{
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 9999;
}
.service-cover{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
position: fixed;
right: 20rpx;
bottom: 190rpx;
z-index: 10000;
border-radius: 50;
}
.menu{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
/* position: fixed;
right: 40rpx;
bottom: 80rpx;
bottom: 80rpx; */
z-index: 10001;
border-radius: 50;
background: rgba(0,0,0,.8);
/* background: url(http://libpc.colorcun.com/navigator.png) center center no-repeat;
background-size: contain; */
line-height: 1.2;
position: relative;
z-index: 2;
}
.service-item{
width: 100rpx;
height: 100rpx;
margin-bottom: 40rpx;
position: absolute;
background: rgba(0,0,0,.8);
border-radius: 50%;
right: 0;
top: 0;
transition: right .2s ease,top .2s ease;
opacity: 0;
}
.menu-item-driving-active{
opacity: 1;
top: -166rpx;
right:69rpx;
}
.menu-item-teahouse-active{
opacity: 1;
top: -69rpx;
right:166rpx;
}
.menu-item-foot-active{
opacity: 1;
top: 69rpx;
right:166rpx;
}
.menu-item-shower-active{
opacity: 1;
top: 166rpx;
right:69rpx;
}
.menu image{
width: 34rpx;
... ...
... ... @@ -17,6 +17,10 @@ Component({
type:Boolean,
value:false,
},
search:{
type:Boolean,
value:true
}
},
/**
... ... @@ -31,7 +35,10 @@ Component({
*/
methods: {
detailGo(){
this.SetHistorySearch();
if(this.data.search==true){
this.SetHistorySearch();
}
this.triggerEvent('click',{act:'detail',data:this.data.item})
},
reserveGo(){
... ...
... ... @@ -100,7 +100,7 @@ Page({
if(bi.type==0){
if (!this.detailData.hasOwner && !this.hasCallPhone) {
return util.toast('只有记录人可以拨打', 'none');
return util.toast('您无权拨打电话', 'none');
}
}else{
//getApp().isAdmin
... ... @@ -210,7 +210,21 @@ Page({
res.data.cancel.cdateStr = util.unixtoTime(res.data.cancel.cdate, "YYYY.MM.DD HH:II")
}
this.detailData = RS.reserve(res.data);
let user=util.cache('seller_user');
if(user.id!=this.detailData.uid){
if(this.detailData.phoneStr!=''){
let phoneStr=this.detailData.phoneStr;
let phonearr=phoneStr.split('');
for(let i=3;i<7;i++){
phonearr.splice(i,1,'*');
}
console.log(phonearr)
phoneStr=phonearr.join('');
this.detailData.phoneStr=phoneStr;
}
}
let tpl='MM月DD日 HH:II'
/*
if(this.detailData.type>0){
... ... @@ -245,22 +259,38 @@ Page({
})
},
gotoModify() {
let url
if(this.detailData.type==1){
url='./online_update'
wx.navigateTo({
url: url+'?id=' + this.data.bookInfo.id
})
}else{
url='./b_addnew'
wx.redirectTo({
url: url+'?id=' + this.data.bookInfo.id
})
}
let user=util.cache('seller_user');
if(user.id==this.data.bookInfo.uid || user.role_name=='管理员' || user.role_name=='店长'){
let url
if(this.detailData.type==1){
url='./online_update'
wx.navigateTo({
url: url+'?id=' + this.data.bookInfo.id
})
}else{
url='./b_addnew'
wx.redirectTo({
url: url+'?id=' + this.data.bookInfo.id
})
}
}else{
wx.showToast({
title:'您无权操作该订单'
})
}
},
cancelReserve() {
this.selectComponent('#cancel').show();
let user=util.cache('seller_user');
if(user.id==this.data.bookInfo.uid || user.role_name=='管理员' || user.role_name=='店长'){
this.selectComponent('#cancel').show();
}else{
wx.showToast({
title:'您无权操作该订单'
})
}
},
reserveCancel(e) {
console.log('reserveCancel', e.detail);
... ...
... ... @@ -128,7 +128,7 @@ Page({
},
call(){
wx.makePhoneCall({
phoneNumber: this.data.staffinfo.phone //仅为示例,并非真实的电话号码
phoneNumber: this.data.staffinfo.phone ? this.data.staffinfo.phone : this.data.detail.seller.seller_tel.split(',')[0]//仅为示例,并非真实的电话号码
})
},
test(e){
... ... @@ -168,7 +168,7 @@ Page({
})
},
getroomimage(){
App.Photo.getSellerPhotoById({sellerid:this.data.detail.seller.id,type:2}).then((json)=>{
App.Tables.GetTablesPhoto({sellerid:this.data.detail.seller.id,tableids:this.tablestr}).then((json)=>{
if(json.ret==200){
this.setData({
roomimage:json.data
... ... @@ -244,10 +244,16 @@ Page({
openid: getApp().openid,
rid: this.id
}, fouce).then(res => {
let tables=[];
let tables=[],regions=[],tabaleids=[];
res.data.tables.forEach(t=>{
tables.push(t.name);
tabaleids.push(t.id);
if(regions.indexOf('t.rname')==-1){
regions.push(t.rname);
}
})
this.tablestr=tabaleids.toString();
let reserev=RS.reserve(res.data)
console.log('reserev',reserev)
let dateSmart
... ... @@ -266,9 +272,11 @@ Page({
seller:{
name:res.data.seller.sellername,
room:tables.join('、'),
region:regions.join('、'),
date:dateSmart,
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
tel:reserev.seller.seller_tel.split(',')[0]
}
})
if(this.data.detail.type==0){
... ... @@ -413,6 +421,9 @@ Page({
fromid:getApp().openid,
hasInvitation:1,
tplid:this.data.options.tplid,
uid:this.data.options.uid ? itation:1,
tplid:this.data.options.tplid,
uid:this.data.options.uid ? this.data.options.uid : ''
},'/pages/customer/index'),
imageUrl: this.data.tpls[0].shareImage,
}
... ... @@ -443,4 +454,10 @@ Page({
morehidden:true
})
},
noopenservice(){
wx.showToast({
title:'当前城市暂未开通该服务,敬请期待',
icon:'none'
})
}
})
... ...
<!--pages/customer/detail_owner.wxml-->
<import src="../tpl/invitation"></import>
<nav backgroundColor="rgba(0,0,0,0)" hasHome style="position: fixed;z-index: 1;" class="navhome" place="{{true}}"></nav>
<block wx:if="{{detail && detail.type==0 && detail.channel==5}}">
<!-- detail.type==0 && detail.channel==5 -->
<block wx:if="{{detail}}">
<!-- <view class="pages bg-1" style="max-height:{{height}}px;overflow-y: scroll;padding-top: {{statusBarHeight+titleBarHeight}}px;line-height: 1.4;padding-bottom: 60rpx;position: relative;">
<view class="book-image flex-cc"></view>
<view class="cover-conent flex-vc">
... ... @@ -90,9 +91,9 @@
<view class="font24r last-yellow-font" style="width:140rpx;padding: 0 20rpx;box-sizing: border-box;margin: 0 auto;" bindtap="secondbook">再次预订</view>
<view style="height:40rpx;"></view>
</scroll-view> -->
<scroll-view class="last-book-bg" style="padding-top: {{statusBarHeight+titleBarHeight}}px;line-height: 1.4;height:{{height}}px;" scroll-y>
<view class="book-flower"></view>
<view style="padding-left: 40rpx;box-sizing: border-box;">
<scroll-view class="last-book-bg" style="line-height: 1.4;height:{{height}}px;" scroll-y>
<view style="height:{{statusBarHeight+titleBarHeight}}px;"></view>
<view class="book-flower" style="top:{{statusBarHeight+titleBarHeight}}px;"></view><view style="padding-left: 40rpx;box-sizing: border-box;">
<view class="last-book-staff flex-vr" style="align-items: flex-end;">
<image src="{{staffinfo.photo}}" class="book-staff-headerimg" mode="aspectFit"></image>
<view class="flex-rr" style="margin-bottom: 20rpx;">
... ... @@ -103,7 +104,7 @@
</view>
</view>
<view class="flex-rr" bindtap="call">
<view class="flex-rr font26r yellow-font">{{staffinfo.phone}}</view>
<view class="flex-rr font26r yellow-font">{{staffinfo.phone ? staffinfo.phone : seller.tel}}</view>
<view class="book-staff-item-button flex-cc">
<image src="http://nosqn.colorcun.com/book-phone.png" class="book-header-icon"></image>
<view class="font22r brown-font">拨打电话</view>
... ... @@ -114,9 +115,11 @@
<view class="yellow-font font44r" style="margin-bottom: 60rpx;">{{seller.name}}</view>
<view>
<view class="font26r" style="color: #C9BD89;margin-bottom: 20rpx;">已为您安排在包间</view>
<view class="font40r" style="color: #E8D47E;margin-bottom: 20rpx;">{{seller.region}}</view>
<view class="book-room-rect flex-cc">
<view class="font44r yellow-font">{{seller.room}}</view>
<view class="book-look-button brown-font font22r flex-cc" wx:if="{{roomimage && roomimage.length>0}}" bindtap="lookroom">浏览照片</view>
<view class="book-look-button gray-font font22r flex-cc" wx:else style="background: #CCCCCC;">浏览照片</view>
</view>
<view class="yellow-font font30r" style="margin-bottom: 24rpx;">时间:{{seller.date}}</view>
<view class="flex-lr" style="line-height: 1.2;padding-right: 40rpx;box-sizing: border-box;margin-bottom: 200rpx;">
... ... @@ -127,13 +130,13 @@
</view>
</view>
<view class="confirm-cover" wx:if="{{showconfirm}}">
<button class="book-share-button font38r flex-cc font-bold" catchtap="confirmed">确认收到</button>
<button class="book-share-button font38r flex-cc font-bold" bindtap="confirmed">确认收到</button>
<view class="confirm-notice flex-vc">
<view class="white-font font26r flex-cc">点击确认收到,可告知发起人已收到邀请</view>
<view class="angel"></view>
</view>
</view>
<view style="height: 240rpx;"></view>
</scroll-view>
<view class="all-button flex-lr" wx:if="{{!showconfirm}}">
<block wx:if="{{detail.hasCancel}}">
... ... @@ -148,9 +151,10 @@
<view class="font30r">转发好友</view>
</button>
</block>
<view class="book-item-font second-book-button flex-cc" bindtap="secondbook">
<view class="book-item-font second-book-button flex-cc" bindtap="secondbook" style="position: relative;">
<image src="http://nosqn.colorcun.com/second-book.png" class="button-item-icon"></image>
<view class="font30r">再次预订</view>
<view class="notice" style="top: -10rpx;right: 0rpx;"></view>
</view>
<view class="line-border"></view>
<block wx:if="{{list}}">
... ... @@ -164,26 +168,26 @@
<view class="book-buttons">
<view class="select-button white-font font28r flex-cc" bindtap="showselect">选项</view>
<view hidden="{{selecthidden}}">
<navigator class="select-item-button flex-cc white-font font24r" style="left: 30rpx;bottom:328rpx;" open-type="redirect" url="/pages/customer/index?islove=custom">首页</navigator>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 126rpx;bottom:242rpx;" open-type="redirect" url="/pages/me/index">我的</navigator>
<block wx:if="{{detail.hasCancel}}"><view class="select-item-button flex-cc gray-font font28r" style="left: 130rpx;bottom:110rpx;">取消订单</view>
<view class="select-item-button flex-cc white-font font24r" style="left: 130rpx;bottom:110rpx;" bindtap="cancelmodal">取消订单</view>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 75rpx;bottom:290rpx;" open-type="redirect" url="/pages/customer/index?islove=custom">首页</navigator>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 150rpx;bottom:160rpx;" open-type="redirect" url="/pages/me/index">我的</navigator>
<block wx:if="{{detail.hasCancel}}">
<view class="select-item-button flex-cc gray-font font28r" style="left: 75rpx;bottom:30rpx;">取消订单</view>
</block>
<block wx:else>
<view class="select-item-button flex-cc white-font font24r" style="left: 130rpx;bottom:110rpx;" bindtap="cancelmodal">取消订单</view>
<view class="select-item-button flex-cc white-font font24r" style="left: 75rpx;bottom:30rpx;" bindtap="cancelmodal">取消订单</view>
</block>
<view class="select-item-button flex-cc white-font font24r" style="left: 42rpx;bottom:10rpx;" bindtap="closeselect">返回</view>
<!-- <view class="select-item-button flex-cc white-font font24r" style="left: 42rpx;bottom:10rpx;" bindtap="closeselect">返回</view> -->
</view>
</view>
<view class="book-mask" hidden="{{morehidden}}" bindtap="closemore"></view>
<view class="service-buttons">
<view class="more-button white-font font28r flex-vc" bindtap="showmore">更多<view>服务</view></view>
<view hidden="{{morehidden}}">
<view class="select-item-button flex-cc gray-font font24r" style="right: 0rpx;bottom:724rpx;">酒水</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 112rpx;bottom:660rpx;">代驾</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 152rpx;bottom:546rpx;">酒店</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 112rpx;bottom:430rpx;">茶楼沐足</view>
<view class="select-item-button flex-cc white-font font24r" style="right: 0rpx;bottom:368rpx;" bindtap="closemore">返回</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 39rpx;bottom:681rpx;" bindtap="noopenservice">酒水</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 136rpx;bottom:599rpx;" bindtap="noopenservice">代驾</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 136rpx;bottom:473rpx;" bindtap="noopenservice">酒店</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 39rpx;bottom:391rpx;" bindtap="noopenservice">茶楼沐足</view>
<!-- <view class="select-item-button flex-cc white-font font24r" style="right: 0rpx;bottom:368rpx;" bindtap="closemore">返回</view> -->
</view>
</view>
<block wx:if="{{detail.hasCancel}}">
... ...
... ... @@ -105,7 +105,7 @@ Page({
call(){
wx.reportMonitor('1012', 1)
wx.makePhoneCall({
phoneNumber: this.data.staffinfo.phone //仅为示例,并非真实的电话号码
phoneNumber: this.data.staffinfo.phone ? this.data.staffinfo.phone : this.data.detail.seller.seller_tel.split(',')[0]//仅为示例,并非真实的电话号码
})
},
test(e){
... ... @@ -139,7 +139,7 @@ Page({
})
},
getroomimage(){
App.Photo.getSellerPhotoById({sellerid:this.data.detail.seller.id,type:2}).then((json)=>{
App.Tables.GetTablesPhoto({sellerid:this.data.detail.seller.id,tableids:this.tablestr}).then((json)=>{
if(json.ret==200){
this.setData({
roomimage:json.data
... ... @@ -200,10 +200,16 @@ Page({
openid: getApp().openid,
rid: this.data.options.id
}, fouce).then(res => {
let tables=[];
let tables=[],regions=[],tabaleids=[];
res.data.tables.forEach(t=>{
tables.push(t.name);
tabaleids.push(t.id);
if(regions.indexOf('t.rname')==-1){
regions.push(t.rname);
}
})
this.tablestr=tabaleids.toString();
let reserev=RS.reserve(res.data)
console.log('reserev',reserev)
let dateSmart
... ... @@ -223,12 +229,14 @@ Page({
name:reserev.seller.sellername,
room:tables.join('、'),
date:dateSmart,
region:regions.join('、'),
addr:reserev.seller.real_address||reserev.seller.map_address,
image:reserev.image_url,
hasOwner:true,
type:reserev.type,
is_set_ddate:reserev.is_set_ddate,
hasUpTime:reserev.type==1 && reserev.hasRunning && reserev.status!=2,
tel:reserev.seller.seller_tel.split(',')[0]
}
})
if(this.data.detail.type==0){
... ... @@ -362,7 +370,7 @@ Page({
tplid:this.data.options.tplid,
}
if(this.data.options.uid){
parmdata.uid=this.data.options.uid;
parmdata.uid=this.data.options.uid;
}
return {
title: this.data.tpls[0].shareTitle,
... ... @@ -521,6 +529,12 @@ Page({
mask:true
})
},
noopenservice(){
wx.showToast({
title:'当前城市暂未开通该服务,敬请期待',
icon:'none'
})
},
showselect(){
wx.reportMonitor('1014', 1)
this.setData({
... ...
... ... @@ -11,7 +11,8 @@
-->
</nav>
<!-- 内部预定 -->
<block wx:if="{{detail && detail.type==0 && detail.channel==5}}">
<!-- detail.type==0 && detail.channel==2 -->
<block wx:if="{{detail}}">
<!-- <view class="pages bg-1" style="max-height:{{height}}px;overflow-y: scroll;padding-top: {{statusBarHeight+titleBarHeight}}px;line-height: 1.4;padding-bottom: 60rpx;">
<view class="book-image flex-cc">
</view>
... ... @@ -108,8 +109,9 @@
<view style="height:40rpx;"></view>
</scroll-view> -->
<showModal id="showModal" confirmText="知道了" bindshowModal="showModal" cla="checkout"></showModal>
<scroll-view class="last-book-bg" style="padding-top: {{statusBarHeight+titleBarHeight}}px;line-height: 1.4;height:{{height}}px;" scroll-y>
<view class="book-flower"></view>
<scroll-view class="last-book-bg" style="line-height: 1.4;height:{{height}}px;" scroll-y>
<view style="height:{{statusBarHeight+titleBarHeight}}px;"></view>
<view class="book-flower" style="top:{{statusBarHeight+titleBarHeight}}px;"></view>
<view style="padding-left: 40rpx;box-sizing: border-box;">
<view class="last-book-staff flex-vr" style="align-items: flex-end;">
<image src="{{staffinfo.photo}}" class="book-staff-headerimg" mode="aspectFit"></image>
... ... @@ -121,7 +123,7 @@
</view>
</view>
<view class="flex-rr">
<view class="flex-rr font26r yellow-font">{{staffinfo.phone}}</view>
<view class="flex-rr font26r yellow-font">{{staffinfo.phone ? staffinfo.phone : seller.tel}}</view>
<view class="book-staff-item-button flex-cc" bindtap="call">
<image src="http://nosqn.colorcun.com/book-phone.png" class="book-header-icon"></image>
<view class="font22r brown-font">拨打电话</view>
... ... @@ -131,17 +133,24 @@
<view class="book-font"></view>
<view class="flex-lr" style="padding-right: 40rpx;box-sizing: border-box;align-items: flex-start;">
<view class="yellow-font font44r" style="max-width:428rpx;margin-bottom: 60rpx;">{{seller.name}}</view>
<!-- <view class="last-book-food flex-cc" bindtap="cookbook">
<view class="white-font font30r smooth" style="color: #043341;">提前点餐</view>
<image src="http://nosqn.colorcun.com/book-direction.png" style="width: 12rpx;height: 24rpx;margin-left: 10rpx;"></image>
<view class="notice"></view>
</view> -->
<block wx:if="{{detail.seller.is_open_order==1 && !detail.hasOvered && !detail.hasCancel}}">
<block wx:if="{{detail && detail.seller.is_open_order==1}}">
<view class="last-book-food flex-cc" bindtap="cookbook">
<view class="white-font font30r smooth" style="color: #043341;">提前点餐</view>
<image src="http://nosqn.colorcun.com/book-direction.png" style="width: 12rpx;height: 24rpx;margin-left: 10rpx;"></image>
<view class="notice"></view>
</view>
</block>
<block wx:else>
<view class="last-book-food flex-ll" bindtap="noopen" data-mark="buy">
<view class="white-font font30r smooth">提前点餐</view>
<image src="http://nosqn.colorcun.com/book-direction.png" style="width: 12rpx;height: 24rpx;margin-left: 10rpx;"></image>
<view class="notice"></view>
</view>
</block>
</block>
... ... @@ -149,9 +158,11 @@
<view>
<view class="font26r" style="color: #C9BD89;margin-bottom: 20rpx;">已为您安排在包间</view>
<view class="font40r" style="color: #E8D47E;margin-bottom: 20rpx;">{{seller.region}}</view>
<view class="book-room-rect flex-cc">
<view class="font44r yellow-font">{{seller.room}}</view>
<view class="book-look-button brown-font font22r flex-cc" wx:if="{{roomimage && roomimage.length>0}}" bindtap="lookroom">浏览照片</view>
<view class="book-look-button gray-font font22r flex-cc" wx:else style="background: #CCCCCC;">浏览照片</view>
</view>
<view class="yellow-font font30r" style="margin-bottom: 24rpx;">时间:{{seller.date}}</view>
<view class="flex-lr" style="line-height: 1.2;padding-right: 40rpx;box-sizing: border-box;">
... ... @@ -161,7 +172,7 @@
</view>
</view>
<view style="height: 240rpx;"></view>
</scroll-view>
<view class="all-button flex-lr">
<block wx:if="{{detail.hasCancel}}">
... ... @@ -176,9 +187,10 @@
<view class="font30r">转发好友</view>
</button>
</block>
<view class="book-item-font second-book-button flex-cc" bindtap="secondbook">
<view class="book-item-font second-book-button flex-cc" bindtap="secondbook" style="position: relative;">
<image src="http://nosqn.colorcun.com/second-book.png" class="button-item-icon"></image>
<view class="font30r">再次预订</view>
<view class="notice" style="top: -10rpx;right: 0rpx;"></view>
</view>
<view class="line-border"></view>
<block wx:if="{{list}}">
... ... @@ -192,26 +204,26 @@
<view class="book-buttons">
<view class="select-button white-font font28r flex-cc" bindtap="showselect">选项</view>
<view hidden="{{selecthidden}}">
<navigator class="select-item-button flex-cc white-font font24r" style="left: 30rpx;bottom:328rpx;" open-type="redirect" url="/pages/customer/index?islove=custom">首页</navigator>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 126rpx;bottom:242rpx;" open-type="redirect" url="/pages/me/index">我的</navigator>
<block wx:if="{{detail.hasCancel}}"><view class="select-item-button flex-cc gray-font font28r" style="left: 130rpx;bottom:110rpx;">取消订单</view>
<view class="select-item-button flex-cc white-font font24r" style="left: 130rpx;bottom:110rpx;" bindtap="cancelmodal">取消订单</view>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 75rpx;bottom:290rpx;" open-type="redirect" url="/pages/customer/index?islove=custom">首页</navigator>
<navigator class="select-item-button flex-cc white-font font24r" style="left: 150rpx;bottom:160rpx;" open-type="redirect" url="/pages/me/index">我的</navigator>
<block wx:if="{{detail.hasCancel}}">
<view class="select-item-button flex-cc gray-font font28r" style="left: 75rpx;bottom:30rpx;">取消订单</view>
</block>
<block wx:else>
<view class="select-item-button flex-cc white-font font24r" style="left: 130rpx;bottom:110rpx;" bindtap="cancelmodal">取消订单</view>
<view class="select-item-button flex-cc white-font font24r" style="left: 75rpx;bottom:30rpx;" bindtap="cancelmodal">取消订单</view>
</block>
<view class="select-item-button flex-cc white-font font24r" style="left: 42rpx;bottom:10rpx;" bindtap="closeselect">返回</view>
<!-- <view class="select-item-button flex-cc white-font font24r" style="left: 42rpx;bottom:10rpx;" bindtap="closeselect">返回</view> -->
</view>
</view>
<view class="book-mask" hidden="{{morehidden}}" bindtap="closemore"></view>
<view class="service-buttons">
<view class="more-button white-font font28r flex-vc" bindtap="showmore">更多<view>服务</view></view>
<view hidden="{{morehidden}}">
<view class="select-item-button flex-cc gray-font font24r" style="right: 0rpx;bottom:724rpx;">酒水</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 112rpx;bottom:660rpx;">代驾</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 152rpx;bottom:546rpx;">酒店</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 112rpx;bottom:430rpx;">茶楼沐足</view>
<view class="select-item-button flex-cc white-font font24r" style="right: 0rpx;bottom:368rpx;" bindtap="closemore">返回</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 39rpx;bottom:681rpx;" bindtap="noopenservice">酒水</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 136rpx;bottom:599rpx;" bindtap="noopenservice">代驾</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 136rpx;bottom:473rpx;" bindtap="noopenservice">酒店</view>
<view class="select-item-button flex-cc gray-font font24r" style="right: 39rpx;bottom:391rpx;" bindtap="noopenservice">茶楼沐足</view>
<!-- <view class="select-item-button flex-cc white-font font24r" style="right: 0rpx;bottom:368rpx;" bindtap="closemore">返回</view> -->
</view>
</view>
<block wx:if="{{detail.hasCancel}}">
... ...
... ... @@ -406,4 +406,15 @@ image{
height: 62rpx;
background: linear-gradient(to right,#E1B275,#FEEFBC,#E1B275);
border-radius: 32rpx;
position: relative;
z-index: 100;
}
.notice{
width: 20rpx;
height: 20rpx;
border-radius: 50%;
position: absolute;
right: -10rpx;
top: 10rpx;
background: #E61010;
}
\ No newline at end of file
... ...
... ... @@ -126,7 +126,7 @@ Page({
})
if(opt.uid && opt.uid!=''){
App.Activity.SetRelation({
uid:opt.uid
uid:opt.uid,
})
App.Activity.SetIntegral({
uid:opt.uid,
... ...
<!--pages/me/follow.wxml-->
<nav>关注</nav>
<nav>收藏</nav>
<view class="pages">
<view class="flex-vc empty" wx:if="{{sellers.length<1}}">
<image src="http://nosqn.colorcun.com/2.0/home%20%2818%29.png" style="width: 520rpx;height: 348rpx;"></image>
<view style="font-size: 28rpx;margin-top: 40rpx;">暂时没有关注的店铺哦</view>
<view style="font-size: 28rpx;margin-top: 40rpx;">暂时没有收藏的店铺哦</view>
</view>
<view class="follow" wx:else="">
<block wx:for="{{sellers}}" wx:key="sellers" >
... ...
... ... @@ -16,7 +16,7 @@
<navigator url="/pages/me/follow" class="money-item">
<view class="flex-vc">
<view class="money-value">{{user.collection||0}}</view>
<view class="money-title">关注</view>
<view class="money-title">我的收藏</view>
</view>
</navigator>
<navigator url="/pack-activity/pages/money" class="money-item">
... ... @@ -46,11 +46,23 @@
</view>
</navigator>
<view class="content flex-ll">
<view class="flex-vc" bindtap="gotoList" data-type="1">
<view class="flex-vc order-item" bindtap="gotoList" data-type="1">
<view class="icon o1"></view>
<view class="text">等待确认</view>
</view>
<view class="flex-vc" bindtap="gotoList" data-type="2">
<view class="text">待确认</view>
<view class="number-notice white-font font24r flex-cc" wx:if="{{user.queren>0}}">{{user.queren}}</view>
</view>
<view class="flex-vc order-item" bindtap="gotoList" data-type="5">
<view class="icon o1"></view>
<view class="text">未赴约</view>
<view class="number-notice white-font font24r flex-cc" wx:if="{{user.fuyue>0}}">{{user.fuyue}}</view>
</view>
<view class="flex-vc order-item" bindtap="gotoList" data-type="6">
<view class="icon o1"></view>
<view class="text">待评价</view>
<view class="number-notice white-font font24r flex-cc" wx:if="{{user.pingjia>0}}">{{user.pingjia}}</view>
</view>
<!-- <view class="flex-vc" bindtap="gotoList" data-type="2">
<view class="icon o2"></view>
<view class="text">预订成功</view>
</view>
... ... @@ -61,10 +73,10 @@
<view class="flex-vc" bindtap="gotoList" data-type="4">
<view class="icon o4"></view>
<view class="text">无效预订</view>
</view>
</view> -->
</view>
</view>
<view class="block-list" style="margin-bottom: 20rpx;" bindtap="gotoList" data-type="5">
<view class="block-list" style="margin-bottom: 20rpx;" bindtap="gotoList" data-type="7">
<view class="item flex-lr">
<view class="item-name flex-ll">
<view class="taocan"></view>
... ...
... ... @@ -219,4 +219,21 @@ image{
}
.col-4 navigator{
padding-top: 60rpx;
}
.order-item{
position: relative;
}
.number-notice{
min-width: 32rpx;
height: 32rpx;
position: absolute;
left: 50%;
top: -16rpx;
background:#FA5151;
margin-left: 8rpx;
border-radius: 16rpx;
font-size: 20rpx;
padding: 0 10rpx;
box-sizing: border-box;
}
\ No newline at end of file
... ...
... ... @@ -53,7 +53,7 @@ Page({
onShow: function () {
PubSub.emit('custom-tab-bar')
console.log('getApp().meListType',getApp().meListType)
if(getApp().meListType && getApp().meListType<5){
if(getApp().meListType && getApp().meListType<7){
this.getautomenu();
}
if(!getApp().meListType) getApp().meListType=defTabType
... ... @@ -89,19 +89,19 @@ Page({
},
getLisType(){
if(this.tabType<5) return {type:this.tabType}
if(this.tabType<7) return {type:this.tabType}
//2=交易成功(待使用) 3=已使用 5=已退款 6=已过期
return {status:{5:2,6:3,7:6,8:5}[this.tabType]}
return {status:{7:2,8:3,9:6,10:5}[this.tabType]}
},
getOffset(){
if(this.tabType<5) return this.offset
if(this.tabType<7) return this.offset
let page=parseInt(this.offset/this.limit)+1
return page
},
getListData() {
let tabType=this.tabType
let lisFun=App.Customer.GetMyOrder
if(tabType>4){
if(tabType>6){
lisFun=App.Foodset.GetUserFoodOrders
}
lisFun({
... ... @@ -122,7 +122,7 @@ Page({
[`list[`+tabType+`]`]: this.data.list[tabType].concat(data),
hasMore:this.hasMore,
})
if(tabType>4 && this.getOffset()==1){
if(tabType>6 && this.getOffset()==1){
this.setData({
shownotice:resData.length>0 ? true : false
})
... ... @@ -149,7 +149,7 @@ Page({
},
formatList(list) {
if (list.length<1) return [];
if(this.tabType>4) return list;
if(this.tabType>6) return list;
let dlist = [];
let openid = getApp().openid;
list.forEach(row => {
... ...
<!--pages/customer/list.wxml-->
<nav>
<view class="view header-tabs flex align-end">
<view class="view item {{tabType<5?'active':''}} margin-right-lg" data-type="1" bindtap="switchType">我的订单</view>
<view class="view item {{tabType>4?'active':''}} flex-ll" data-type="5" bindtap="switchType">
<view class="view item {{tabType<7?'active':''}} margin-right-lg" data-type="1" bindtap="switchType">我的订单</view>
<view class="view item {{tabType>6?'active':''}} flex-ll" data-type="7" bindtap="switchType">
<view>我的套餐</view>
<view class="notice" wx:if="{{shownotice==true}}"></view>
</view>
</view>
</nav>
<view class="view tabs flex padding-lr-lg padding-top-xs justify-between padding-bottom-sm margin-bottom-sm" wx:if="{{tabType<5}}">
<view class="view item {{tabType==1?'active':''}}" data-type="1" bindtap="switchType">等待确认</view>
<view class="view item {{tabType==2?'active':''}}" data-type="2" bindtap="switchType">预订成功</view>
<view class="view item {{tabType==3?'active':''}}" data-type="3" bindtap="switchType">历史订单</view>
<view class="view item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view>
<view class="view tabs flex padding-lr-lg padding-top-xs justify-between padding-bottom-sm margin-bottom-sm" wx:if="{{tabType<7}}">
<view class="view item {{tabType==1?'active':''}}" data-type="1" bindtap="switchType">待确认</view>
<view class="view item {{tabType==5?'active':''}}" data-type="5" bindtap="switchType">未赴约</view>
<view class="view item {{tabType==6?'active':''}}" data-type="6" bindtap="switchType">待评价</view>
<!-- <view class="view item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view> -->
</view>
<view class="view tabs flex padding-lr-lg padding-top-xs justify-between padding-bottom-sm margin-bottom-sm" wx:else="">
<view class="view item {{tabType==5?'active':''}}" data-type="5" bindtap="switchType">待使用</view>
<view class="view item {{tabType==6?'active':''}}" data-type="6" bindtap="switchType">已使用</view>
<view class="view item {{tabType==7?'active':''}}" data-type="7" bindtap="switchType">已过期</view>
<view class="view item {{tabType==8?'active':''}}" data-type="8" bindtap="switchType">退款</view>
<view class="view item {{tabType==7?'active':''}}" data-type="7" bindtap="switchType">待使用</view>
<view class="view item {{tabType==8?'active':''}}" data-type="8" bindtap="switchType">已使用</view>
<view class="view item {{tabType==9?'active':''}}" data-type="9" bindtap="switchType">已过期</view>
<view class="view item {{tabType==10?'active':''}}" data-type="10" bindtap="switchType">退款</view>
</view>
<view class="view pages">
<block wx:if="{{list[tabType].length==0}}">
... ... @@ -28,13 +28,13 @@
</view>
</block>
<block wx:else="">
<block wx:if="{{tabType<5}}">
<block wx:if="{{tabType<7}}">
<navigator wx:for="{{list[tabType]}}" wx:key="*this"
wx:for-item="detail" wx:for-index="dateIndex"
url="/pages/customer/{{detail.navigator}}?id={{detail.id}}">
url="/pages/customer/{{detail.navigator}}?id={{detail.id}}" hover-stop-propagation>
<card
hasShowStatus bindevent="gotoDetail"
seller="{{detail.seller}}" detail="{{detail}}"></card>
seller="{{detail.seller}}" detail="{{detail}}" tabType="{{tabType}}"></card>
</navigator>
</block>
<view class="view padding-lr" wx:else="">
... ...
... ... @@ -2,24 +2,27 @@
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
let getCates=async function(){
let res=await App.Reserve.GetCustomerConfig();
let getCates=async function(code){
let res=await App.Reserve.GetCustomerConfig({code:code});
let cates=[];
res.data.cate.forEach(ca=>{
cates.push(ca.name);
cates.push({
name:ca.name,
cu:ca.cu
});
})
return cates;
}
let getLabels=async function(){
let res=await App.Reserve.GetCustomerConfig();
let getLabels=async function(code){
let res=await App.Reserve.GetCustomerConfig({code:code});
return res.data.pub_label;
}
let getCatesID=async function(index){
let res=await App.Reserve.GetCustomerConfig();
let getCatesID=async function(index,code){
let res=await App.Reserve.GetCustomerConfig({code:code});
return res.data.cate[index].id;
}
let getCitys=async function(){
let res=await App.Reserve.GetCustomerConfig();
let getCitys=async function(code){
let res=await App.Reserve.GetCustomerConfig({code:code});
return res.data.region_code;
}
export default {
... ...
... ... @@ -20,7 +20,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.options=options
this.options=options;
this.getroomImage();
this.downloadImages()
App.Customer.IsCollectionSeller({
sid:options.id,
... ... @@ -366,4 +367,14 @@ Page({
this.selectComponent('#as').show(this.data.seller);
}
},
getroomImage(){
App.Tables.GetTablesPhotoBySid({sellerid:this.options.id}).then((json)=>{
console.log(json)
if(json.ret==200){
this.setData({
roomImages:json.data
})
}
})
}
})
\ No newline at end of file
... ...
... ... @@ -115,14 +115,23 @@
</block>
</view>
<taocan sid="{{seller.id}}" wx:if="{{seller.id}}"></taocan>
<view class="view bg-white text-black padding-tb-lg margin-top-sm" wx:if="{{seller.room_image.length>0}}">
<view class="view bg-white text-black padding-tb-lg margin-top-sm" wx:if="{{roomImages && roomImages.length>0}}">
<view class="view padding-left-lg text-bold txt-40-h margin-bottom">参观包间</view>
<scroll-view class="text-cut margin-bottom-sm" scroll-x="true" bindscroll="scroll" style="width: 100%;">
<block wx:for="{{seller.room_image}}" wx:key="room_image">
<!-- <block wx:for="{{seller.room_image}}" wx:key="room_image">
<image class="room_image" mode="aspectFill"
bindtap="reviweRoomImage" data-current="{{item}}"
src="{{item}}?imageView2/2/w/640/interlace/0/q/100"></image>
</block>
</block> -->
<block wx:for="{{roomImages}}" wx:key="room_image">
<view class="flex-vc" style="display: inline-block;">
<image class="room_image" mode="aspectFill"
bindtap="reviweRoomImage" data-current="{{item.url}}"
src="{{item.url}}?imageView2/2/w/640/interlace/0/q/100"></image>
<view class="black-font font36r flex-cc font-bold" style="padding: 10rpx 0;">{{item.name}}</view>
</view>
</block>
</scroll-view>
</view>
<view class="view bg-white text-black padding-tb-lg margin-top-sm" wx:if="{{seller.dishes.length>0}}">
... ...
... ... @@ -29,6 +29,11 @@ Page({
})
},
})
const systeminfo=wx.getSystemInfoSync();
let ratio=750/systeminfo.windowWidth;
console.log(systeminfo)
this.systeminfo=systeminfo;
this.ratio=ratio;
},
/**
... ... @@ -89,6 +94,12 @@ Page({
let sdobj = {
map: map,
}
this.setData({
location:{
latitude:map.latitude,
longitude:map.longitude
}
})
this.setData(sdobj)
},
setLoacl(e){
... ... @@ -109,6 +120,7 @@ Page({
},
moveToLocation() {
console.log('moveToLocation')
this.oldmap=null;
this.selectComponent('#getpos').getPos(true);
},
switchpage(){
... ... @@ -157,7 +169,16 @@ Page({
this.mapCtx.getRegion({
success: (res) => {
if (res.southwest.latitude) {
this.mapData.region = res
let newragion=res;
let singlelat=(res.northeast.latitude-res.southwest.latitude)/this.systeminfo.windowHeight;
let distancelat=singlelat*(80/this.ratio);
let test=Number(distancelat.toFixed(7));
let oldlat=Number(res.southwest.latitude.toFixed(7));
let southwestlat=oldlat+test;
console.log('pua',test,oldlat,southwestlat);
newragion.southwest.latitude=southwestlat;
this.mapData.region = newragion;
console.log('uuuuuuu',newragion,southwestlat)
}
this.selectComponent('#filter-group').hide();
this.getSellers();
... ... @@ -177,7 +198,7 @@ Page({
lng: this.user.longitude == def_longitude ? '' : this.user.longitude,
offset: 0,
rows: 200,
distance: 100000,
distance: 30000,
map: JSON.stringify({...this.mapData.region, scale: 50})
}
if (param.lat) {
... ... @@ -225,47 +246,50 @@ Page({
if(seller.scale>this.mapData.scale) return;
let marker = {
id: seller.id,
iconPath: "http://nosqn.colorcun.com/custom/lite-online/cates/circle1x5.png" + cates_version,
// iconPath: "http://nosqn.colorcun.com/custom/lite-online/cates/circle1x5.png" + cates_version,
iconPath:'http://nosqn.colorcun.com/map-icon.png',
latitude: seller.lat,
longitude: seller.long,
width: 8,
height: 8,
//title:seller.seller_name,
width: 33,
height: 36,
// title:seller.seller_name,
zIndex: sellersLength - si,
zIndexBak: sellersLength - si,
//seller: seller,
};
marker.callout={
content: ' ' + seller.sellername + ' ',
color: '#353535',
content:seller.selleralias ? seller.selleralias : seller.sellername,
color: '#000000',
fontSize: 12,
borderWidth: 1,
borderColor: '#cccccc',
borderRadius: 50,
bgColor: '#fefefe',
padding: 5,
textAlign: 'left',
display:'BYCLICK',
borderWidth: 0,
// borderColor: '#cccccc',
borderRadius: 0,
bgColor: 'transparent',
padding: 0,
textAlign: 'center',
display:'ALWAYS',
anchorX:0,
anchorY:48,
};
marker.calloutDisplay='BYCLICK';
// marker.calloutDisplay='BYCLICK';
if (seller.mode.length > 0) {
seller.mode.forEach(x => {
if (x.id == 1) {//大图标
marker.iconPath = "http://nosqn.colorcun.com/custom/lite-online/cates/其他菜品.png";
if (seller.cate.length > 0) {
marker.iconPath = seller.cate[0].icon
}
marker.iconPath = marker.iconPath.replace(/\/cates\/(.*)\.png/, function ($0, $1) {
return '/cates/' + encodeURI($1) + '.png'
})
marker.iconPath += cates_version
marker.width = 20;
marker.height = 25;
}
if(x.id==2){//商家名
marker.callout.display='ALWAYS';
marker.calloutDisplay='ALWAYS';
}
// if (x.id == 1) {//大图标
// marker.iconPath = "http://nosqn.colorcun.com/custom/lite-online/cates/其他菜品.png";
// if (seller.cate.length > 0) {
// marker.iconPath = seller.cate[0].icon
// }
// marker.iconPath = marker.iconPath.replace(/\/cates\/(.*)\.png/, function ($0, $1) {
// return '/cates/' + encodeURI($1) + '.png'
// })
// marker.iconPath += cates_version
// marker.width = 20;
// marker.height = 25;
// }
// if(x.id==2){//商家名
// marker.callout.display='ALWAYS';
// marker.calloutDisplay='ALWAYS';
// }
})
}
markers.push(marker)
... ... @@ -306,37 +330,48 @@ Page({
this.activeSellerID = e.markerId
let bl = 1.2;
markers.forEach((m, i) => {
m.iconPath = m.iconPath.replace('/cates-active/', '/cates/')
// m.iconPath = m.iconPath.replace('/cates-active/', '/cates/');
if(m.id!='local'){
m.iconPath='http://nosqn.colorcun.com/map-icon.png';
m.width = 33;
m.height = 36;
}
m.zIndex = m.zIndexBak
if (m.width == 20 * bl) {
m.width = 20;
m.height = 25;
}
if (m.width == 12) {
m.width = 8;
m.height = 8;
}
// if (m.width == 20 * bl) {
// m.width = 20;
// m.height = 25;
// }
// if (m.width == 12) {
// m.width = 8;
// m.height = 8;
// }
if(m.callout){
m.callout.borderColor= '#cccccc';
m.callout.bgColor= '#fefefe';
m.callout.color= '#353535';
m.callout.display=m.calloutDisplay;
// m.callout.borderColor= 'rgba(0,0,0,0)';
m.callout.bgColor= 'transparent';
m.callout.color= '#000000';
m.callout.display='ALWAYS';
m.callout.anchorY=48;
}
if (m.id == e.markerId) {
m.iconPath = m.iconPath.replace('/cates/', '/cates-active/')
if (m.width == 20) {
m.width = 20 * bl;
m.height = 25 * bl;
} else {
m.width = 12;
m.height = 12;
}
m.zIndex = 9999
// m.iconPath = m.iconPath.replace('/cates/', '/cates-active/');
m.iconPath='http://nosqn.colorcun.com/map-icon-active.png'
// if (m.width == 20) {
// m.width = 20 * bl;
// m.height = 25 * bl;
// } else {
// m.width = 12;
// m.height = 12;
// }
m.width = 41;
m.height = 48;
m.zIndex = 9999;
if(m.callout){
m.callout.borderColor= '#F05522';
m.callout.bgColor= '#F05522';
m.callout.color= '#fefefe';
// m.callout.borderColor= 'rgba(0,0,0,0)';
m.callout.bgColor= 'transparent';
m.callout.color= '#353535';
m.callout.display='ALWAYS';
m.callout.anchorY=60;
}
}
})
... ... @@ -366,7 +401,7 @@ Page({
scrollTop:0,
scrollEvent(e){
if(this.mapScale<12) return;
//console.log(e.detail.scrollTop)
console.log(e.detail.scrollTop)
this.scrollTop=e.detail.scrollTop
if(this.hasScrollToIng)return;
this.debounce(()=>{
... ... @@ -374,12 +409,15 @@ Page({
},300)
},
scrollEventActive(){
let idx=parseInt(this.scrollTop/162)
let po=this.scrollTop%((idx>0?idx:1)*162);
if(po>80){
let idx=parseInt(this.scrollTop/(324/this.ratio))
let po=this.scrollTop%((idx>0?idx:1)*(324/this.ratio));
if(po>162/this.ratio){
idx+=1;
}
//console.log(idx,po)
console.log(idx,po)
if(idx>=this.sellers.length){
idx=this.sellers.length-1
}
if(this.sellers[idx]){
//this.activeSellerID=this.sellers[idx].id
this.markertap({markerId:this.sellers[idx].id},false)
... ...
... ... @@ -31,12 +31,17 @@
<view style="color: #42A5FF;font-size: 20rpx;">地图</view>
</view>
</view>
<!-- location="{{location}}" -->
<view class="view content padding-top-xs" style="height: 60vh;">
<taocan-notice></taocan-notice>
<filter-group height="{{height}}"
id="filter-group"
bindevent="filterGroupEvent"
disabled="{{(sellers.length<1 && !hasFilterData) || hasLoading}}"></filter-group>
<block wx:if="{{location}}">
<filter-group height="{{height}}"
location="{{location}}"
id="filter-group"
bindevent="filterGroupEvent"
disabled="{{(sellers.length<1 && !hasFilterData) || hasLoading}}"></filter-group>
</block>
<block wx:if="{{hasLoading}}">
<view class="view flex flex-direction justify-center align-center" wx:if="{{hasLoading}}">
<image class="view" src="http://nosqn.colorcun.com/2.0/timg.gif" style="width: 40rpx;height: 40rpx;margin-top: 260rpx;"></image>
... ...
... ... @@ -32,7 +32,7 @@ Page({
*/
eventChannel:null,
onLoad: async function (options) {
console.log(options)
console.log(options,'uuuuuu')
/**
* lat=39.65273
* &lng=118.15813
... ...
... ... @@ -68,4 +68,4 @@
<as-phone id="as"></as-phone>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<menu></menu>
<service></service>
\ No newline at end of file
<service></service>
... ...
... ... @@ -22,18 +22,83 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options,'pppppppppp')
if(options.frompage && options.frompage=='search'){
this.filterParams=null;
if(options.filter){
this.filterParams=JSON.parse(options.filter)
this.setData({
filterParams:this.filterParams,
})
this.filterGroupData.average=this.filterParams.active
}
if(options.city){
this.city=JSON.parse(options.city)
}
this.findSellerData=null
if(options.hows){
this.findSellerData=JSON.parse(options.hows)
let paramStr=this.findSellerData.paramStr.split(" ");
this.setData({
findSellerData:this.findSellerData,
headerHows:[
paramStr[0].substr(0,6),
paramStr[1]+' '+paramStr[2],
],
})
}
// this.options=options;
// let map=this.data.map;
// map.latitude = this.options.lat;
// map.longitude = this.options.lng;
// map.scale = mapScale;
// this.setData({
// map:map
// })
if(options.hasSuggestion){
let pos=options.centre_pos.split(',')
this.suggestion={
latitude:pos[0],
longitude:pos[1],
title:options.keyword,
}
this.setData({
hasSuggestion:true,
suggestion:this.suggestion,
keyword:this.options.keyword,
})
delete this.options.keyword
}else if(this.options.keyword){
this.setData({
keyword:options.keyword,
})
}
PubSub.on(
'searchParamList',
data=>{
console.log('searchParamList.msg',data)
if(data.fun=='setSuggestion'){
this.setSuggestion(data.suggestion);
}
}
)
}
this.move=false;
const systeminfo=wx.getSystemInfoSync();
let ratio=750/systeminfo.windowWidth;
console.log(systeminfo)
this.setData({
height:systeminfo.windowHeight-(350/ratio)
})
this.systeminfo=systeminfo;
this.ratio=ratio;
// this.setData({
// height:systeminfo.windowHeight-(350/ratio),
// })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.selectComponent('#getpos').getPos();
},
... ... @@ -61,7 +126,27 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
if(this.hasOneListPage()){
PubSub.off('searchParamList')
if(this.suggestion){
PubSub.emit('searchParam',{fun:'setSuggestion',suggestion:this.suggestion})
}else if(this.hasCleanSuggestion){
PubSub.emit('searchParam', {fun:'moveToLocation'})
}
}
},
hasOneListPage(){//判断是否只有一个列表页面
let pages = getCurrentPages();
let pc=0
pages.forEach(p=>{
if(p.route=='pages/reserve/map' && this.options.frompage){
pc++;
}
})
if(pc==1){//只有一个列表页
return true
}
return false
},
/**
* 用户点击右上角分享
... ... @@ -76,24 +161,33 @@ Page({
url: './index'
})
},
onpos(e) {
let res = e.detail;
console.log('onpos.res', res);
let map = this.data.map;
if (!res.latitude){
map.latitude = def_latitude;
map.longitude = def_longitude;
}else{
map.latitude = res.latitude;
map.longitude = res.longitude;
}
map.scale = mapScale;
this.user.latitude = res.latitude;
this.user.longitude = res.longitude;
let sdobj = {
map: map,
}
this.setData(sdobj)
onpos(e) {
let res = e.detail;
console.log('onpos.res', res,this.options.formpage,this.options.formpage=='search');
console.log('hahahhahahhaha',this.options);
let map = this.data.map;
if (!res.latitude){
map.latitude = def_latitude;
map.longitude = def_longitude;
}else{
if(this.options.frompage){
map.latitude = this.options.lat;
map.longitude = this.options.lng;
}else{
map.latitude = res.latitude;
map.longitude = res.longitude;
}
}
map.scale = mapScale;
this.user.latitude = res.latitude;
this.user.longitude = res.longitude;
let sdobj = {
map: map,
}
this.setData(sdobj)
},
setLoacl(e){
let pos=util.attr(e,'val').split(',');
... ... @@ -113,6 +207,7 @@ Page({
},
moveToLocation() {
console.log('moveToLocation')
this.oldmap=null;
this.selectComponent('#getpos').getPos(true);
},
debounceTimer:null,
... ... @@ -126,11 +221,35 @@ Page({
},wait);
},
regionChange(e){
console.log('55555',e)
if(e.type=='end'){
console.log('regionChange', e)
this.debounce(this.regionChangeDo,800)
console.log('regionChange', e);
this.debounce(this.regionChangeDo,800);
// if(this.move==false){
// this.debounce(this.regionChangeDo,800);
// this.move=true;
// }else{
// // wx.showToast({
// // title:e.causedBy
// // })
// if(e.causedBy=='drag'){
// // wx.showToast({
// // title:e.detail.causedBy
// // })
// this.sellers=[];
// this.setData({
// markers:[]
// })
// this.makeSellers();
// }
// }
}
},
tapregionchange(){
this.debounce(this.regionChangeDo,800);
},
mapCtx:null,
mapData: {
latitude: 0,
... ... @@ -144,6 +263,13 @@ Page({
},
regionChangeDo(){
console.log('regionChangeDo')
// let map=this.data.map;
// map.latitude = this.options.lat;
// map.longitude = this.options.lng;
// map.scale = mapScale;
// this.setData({
// map:map
// })
if(!this.mapCtx){
this.mapCtx = wx.createMapContext('map')
}
... ... @@ -153,18 +279,168 @@ Page({
this.mapScale = res.scale;
},
})
this.mapCtx.getRegion({
success: (res) => {
console.log('yyyyyyy',res);
let newmap={},distance=0;
if (res.southwest.latitude) {
this.mapData.region = res
let newragion=res;
let singlelat=(res.northeast.latitude-res.southwest.latitude)/this.systeminfo.windowHeight;
let distancelat=singlelat*(400/this.ratio);
let test=Number(distancelat.toFixed(7));
let oldlat=Number(res.southwest.latitude.toFixed(7));
let southwestlat=oldlat+test;
console.log('pua',test,oldlat,southwestlat);
newragion.southwest.latitude=southwestlat;
this.mapData.region = newragion;
console.log('uuuuuuu',newragion,southwestlat)
newmap.lat=(this.mapData.region.southwest.latitude + this.mapData.region.northeast.latitude) / 2;
newmap.lng=(this.mapData.region.southwest.longitude + this.mapData.region.northeast.longitude) / 2
if(this.oldmap){
distance=this.getdistance(newmap.lat,newmap.lng,this.oldmap.lat,this.oldmap.lng);
}
}
// this.selectComponent('#filter-group').hide();
this.getSellers();
console.log('distance',distance);
if(this.options.frompage && this.options.frompage=='search'){
if(distance>=2){
this.getList();
}else{
if(!this.oldmap){
this.oldmap=newmap;
this.getList();
console.log('6666666666666')
}
}
}else{
if(distance>=2){
this.getSellers();
}else{
if(!this.oldmap){
this.oldmap=newmap;
this.getSellers();
console.log('6666666666666')
}
}
}
},
})
},
add(a,b){
console.log("a",a);
console.log("b",b);
console.log("a+b",a+Number(b.toFixed(15)));
return a+b;
},
getdistance(la1,lo1,la2,lo2) {
console.log('9999',la1,lo1,la2,lo2)
var La1 = la1 * Math.PI / 180.0;
var La2 = la2 * Math.PI / 180.0;
var La3 = La1 - La2;
var Lb3 = lo1 * Math.PI / 180.0 - lo2 * Math.PI / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(La3 / 2), 2) + Math.cos(La1) * Math.cos(La2) * Math.pow(Math.sin(Lb3 / 2), 2)));
s = s * 6378.137;//地球半径
s = Math.round(s * 10000) / 10000;
return s;
// console.log("计算结果",s)
},
hasSellers:0,
sellers:[],
suggestion:null,
setSuggestion(suggestion){
console.log('tttttt')
this.suggestion=suggestion
this.hasCleanSuggestion=false
this.setData({
suggestion:suggestion,
hasSuggestion:true,
})
this.getList()
},
getList(){
this.setData({
hasLoading:true,
})
this.offset=1 //page
this.size=20 //page size
this.param={
offset:this.offset,
size:this.size,
code:this.city?this.city.code:'',
pid:this.city?this.city.pid:'',
keyword:this.options.keyword||'',
...this.findSellerData.paramObj,
}
console.log('this.location',this.location)
if(this.suggestion){
this.param.lat_extend=this.suggestion.latitude
this.param.lng_extend=this.suggestion.longitude
}else if(this.location){
this.param.lat_extend=this.location.latitude
this.param.lng_extend=this.location.longitude
}
this.hasFilterData=false
if(this.filterGroupData.tags){
this.param.tags = this.filterGroupData.tags;
this.hasFilterData=true
}
console.log('this.filterGroupData',this.filterGroupData)
if (this.filterGroupData.cuisine) {
this.param.cuisine = this.filterGroupData.cuisine;
this.hasFilterData=true
}
if(this.filterGroupData.average){
this.param.average = this.filterGroupData.average;
this.hasFilterData=true
}
App.Customer.GetSellerListByFoods(this.param).then(res=>{
this.setData({
rsl:[],
hasMore:res.data.length==this.size,
// sellers:this.sellerFormat(res.data),
hasLoading:false,
//hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData)
hasFilterData:this.hasFilterData,
})
this.setData({
current:0
})
this.sellers=this.sellerFormat(res.data);
this.makeMarker();
this.makeSellers();
this.debounce(this.makeDefMarker,300);
// this.hasGetSellerEnd=true
// this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
/*
if(res.data.length==0 && this.offset==1 && this.location){
this.GetRecommendSellerList()
}
*/
})
},
sellerFormat(sellers){
// sellers.forEach((seller) => {
// if(seller.distance || seller.distance===0) {
// seller.distance = parseInt(seller.distance);
// if (seller.distance > 1000) {
// seller.distance = (seller.distance / 1000).toFixed(2) + 'km'
// } else {
// seller.distance += 'm';
// }
// }
// })
sellers.forEach(seller=>{
if(this.findSellerData){
seller.findSellerParamObj=this.findSellerData.paramObj
}
})
return sellers;
},
getSellers(){
console.log('getSellers',this.mapScale,this.mapData)
this.setData({
... ... @@ -176,15 +452,16 @@ Page({
lng: this.user.longitude == def_longitude ? '' : this.user.longitude,
offset: 0,
rows: 200,
distance: 100000,
distance: 20000,
map: JSON.stringify({...this.mapData.region, scale: 50})
}
console.log('222222',param)
if (param.lat) {
param.centre_pos = `${param.lat},${param.lng}`
} else {
let lat = (this.mapData.region.southwest.latitude + this.mapData.region.northeast.latitude) / 2
let lng = (this.mapData.region.southwest.longitude + this.mapData.region.northeast.longitude) / 2
param.centre_pos = `${lat},${lng}`
param.centre_pos = `${lat},${lng}`;
}
this.hasFilterData=false
if(this.filterGroupData.tags){
... ... @@ -215,6 +492,9 @@ Page({
v.cateStr=v.cateStr.join('/')
}
})
this.setData({
current:0
})
this.sellers=res.data.list;
this.makeMarker();
this.makeSellers();
... ... @@ -226,8 +506,10 @@ Page({
},
makeMarker(){
console.log('699965606970970797707970')
this.mapCtx.getScale({
success: (res) => {
console.log('iiiiiiiii',res)
this.mapData.scale = res.scale;
let markers=[]
let sellersLength=this.sellers.length
... ... @@ -235,49 +517,52 @@ Page({
if(seller.scale>this.mapData.scale) return;
let marker = {
id: seller.id,
iconPath: "http://nosqn.colorcun.com/custom/lite-online/cates/circle1x5.png" + cates_version,
// iconPath: "http://nosqn.colorcun.com/custom/lite-online/cates/circle1x5.png" + cates_version,
iconPath:'http://nosqn.colorcun.com/map-icon.png',
latitude: seller.lat,
longitude: seller.long,
width: 8,
height: 8,
width: 33,
height: 36,
//title:seller.seller_name,
zIndex: sellersLength - si,
zIndexBak: sellersLength - si,
//seller: seller,
};
// marker.callout={
// content: ' ' + seller.sellername + ' ',
// color: '#353535',
// fontSize: 12,
// borderWidth: 1,
// borderColor: '#cccccc',
// borderRadius: 50,
// bgColor: '#fefefe',
// padding: 5,
// textAlign: 'left',
// display:'BYCLICK',
// };
marker.callout={
content:seller.selleralias ? seller.selleralias : seller.sellername,
color: '#000000',
fontSize: 12,
borderWidth: 0,
// borderColor: '#cccccc',
borderRadius: 0,
bgColor: 'transparent',
padding: 0,
textAlign: 'center',
display:'ALWAYS',
anchorX:0,
anchorY:48,
};
// marker.calloutDisplay='BYCLICK';
if (seller.mode.length > 0) {
seller.mode.forEach(x => {
if (x.id == 1) {//大图标
marker.iconPath = "http://nosqn.colorcun.com/custom/lite-online/cates/其他菜品.png";
if (seller.cate.length > 0) {
marker.iconPath = seller.cate[0].icon
}
marker.iconPath = marker.iconPath.replace(/\/cates\/(.*)\.png/, function ($0, $1) {
return '/cates/' + encodeURI($1) + '.png'
})
marker.iconPath += cates_version
marker.width = 20;
marker.height = 25;
}
// if(x.id==2){//商家名
// marker.callout.display='ALWAYS';
// marker.calloutDisplay='ALWAYS';
// }
})
}
// if (seller.mode.length > 0) {
// seller.mode.forEach(x => {
// if (x.id == 1) {//大图标
// marker.iconPath = "http://nosqn.colorcun.com/custom/lite-online/cates/其他菜品.png";
// if (seller.cate.length > 0) {
// marker.iconPath = seller.cate[0].icon
// }
// marker.iconPath = marker.iconPath.replace(/\/cates\/(.*)\.png/, function ($0, $1) {
// return '/cates/' + encodeURI($1) + '.png'
// })
// marker.iconPath += cates_version
// marker.width = 25;
// marker.height = 28;
// }
// if(x.id==2){//商家名
// marker.callout.display='ALWAYS';
// marker.calloutDisplay='ALWAYS';
// }
// })
// }
markers.push(marker)
})
markers.push({
... ... @@ -290,10 +575,14 @@ Page({
zIndex: 9999,
zIndexBak:9999,
})
console.log('kkkkkkkkkk',markers)
this.setData({
markers:markers,
})
},
fail:()=>{
console.log('fail')
}
})
},
makeSellers(){
... ... @@ -310,48 +599,61 @@ Page({
this.markertap({markerId:id});
},
makeDefMarker(){
console.log('mmmmmmmmm',this.data.markers,!this.activeSellerID && this.data.markers.length>0)
if(!this.activeSellerID && this.data.markers.length>0){
this.markertap({markerId:this.data.markers[0].id})
}
},
hasScrollToIng:false,
markertap(e,scrollTo=true){
console.log(e)
if(!e.markerId || e.markerId=='local') return;
let markers=this.data.markers
this.activeSellerID = e.markerId
let bl = 1.2;
markers.forEach((m, i) => {
m.iconPath = m.iconPath.replace('/cates-active/', '/cates/')
// m.iconPath = m.iconPath.replace('/cates-active/', '/cates/');
if(m.id!='local'){
m.iconPath='http://nosqn.colorcun.com/map-icon.png';
m.width = 33;
m.height = 36;
}
m.zIndex = m.zIndexBak
if (m.width == 20 * bl) {
m.width = 20;
m.height = 25;
}
if (m.width == 12) {
m.width = 8;
m.height = 8;
}
// if (m.width == 20 * bl) {
// m.width = 20;
// m.height = 25;
// }
// if (m.width == 12) {
// m.width = 8;
// m.height = 8;
// }
if(m.callout){
m.callout.borderColor= '#cccccc';
m.callout.bgColor= '#fefefe';
m.callout.color= '#353535';
m.callout.display=m.calloutDisplay;
// m.callout.borderColor= 'rgba(0,0,0,0)';
m.callout.bgColor= 'transparent';
m.callout.color= '#000000';
m.callout.display='ALWAYS';
m.callout.anchorY=48;
}
if (m.id == e.markerId) {
m.iconPath = m.iconPath.replace('/cates/', '/cates-active/')
if (m.width == 20) {
m.width = 20 * bl;
m.height = 25 * bl;
} else {
m.width = 12;
m.height = 12;
}
m.zIndex = 9999
// m.iconPath = m.iconPath.replace('/cates/', '/cates-active/')
m.iconPath='http://nosqn.colorcun.com/map-icon-active.png'
// if (m.width == 20) {
// m.width = 20 * bl;
// m.height = 25 * bl;
// } else {
// m.width = 12;
// m.height = 12;
// }
m.width = 41;
m.height = 48;
m.zIndex = 9999;
if(m.callout){
m.callout.borderColor= '#F05522';
m.callout.bgColor= '#F05522';
m.callout.color= '#fefefe';
// m.callout.borderColor= 'rgba(0,0,0,0)';
m.callout.bgColor= 'transparent';
m.callout.color= '#000000';
m.callout.display='ALWAYS';
m.callout.anchorY=60;
}
this.setData({
current:i,
... ...
<wxs src="../../utils/util.wxs" module="util" />
<map id="map" scale="{{map.scale}}"
longitude="{{map.longitude||118.170300}}" latitude="{{map.latitude||39.65273}}"
markers="{{markers}}" polygons="{{polygons}}"
... ... @@ -19,6 +20,7 @@
<image class="moveToLocation-image" src="http://nosqn.colorcun.com/loaction.png"></image>
</view>
</view>
<view class="bg-white font28r region-button flex-cc font-bold" bindtap="tapregionchange">展示当前区域内餐厅</view>
<view class="moveToLocationView">
<view bindtap="switchpage" class="view moveToLocation flex-vc" style="top: -490rpx;">
<image class="moveToLocation-image" src="http://nosqn.colorcun.com/menu.png" style="width: 32rpx;height: 26rpx;margin-bottom: 8rpx;"></image>
... ... @@ -36,7 +38,10 @@
</view>
<view>
<view class="black-font font-bold font38r font-more" style="margin-bottom: 10rpx;width: 370rpx;">{{selleritem.sellername}}</view>
<view class="black-font font-bold font38r font-more" style="margin-bottom: 10rpx;width: 370rpx;">
<text style="color: #ffffff;font-size: 24rpx;margin-right: 4rpx;background-color:#d81e06;display: inline-block;border-radius: 8rpx;width: 66rpx;height: 36rpx;line-height: 36rpx;text-align: center;" wx:if="{{selleritem.is_have_activity==1}}">优惠</text>
{{selleritem.sellername}}
</view>
<view class="gray-font font26r" style="padding-bottom: 14rpx;">{{selleritem.cateStr}}</view>
<view style="padding-top:4rpx;" wx:if="{{selleritem.activity && selleritem.activity.length>0}}">
<block wx:for="{{selleritem.activity}}" wx:key="selleractivitykey" wx:if="{{index<2}}">
... ... @@ -46,7 +51,7 @@
</block>
</view>
<view class="flex-ll">
<view class="gray-font font24r" style="margin-right: 40rpx;">{{selleritem.distance}}m</view>
<view class="gray-font font24r" style="margin-right: 40rpx;">{{util.distance(selleritem.distance||selleritem.distance_centre)}}</view>
<view class="gray-font font24r" wx:if="{{selleritem.average>0}}">¥{{selleritem.average}}/人</view>
</view>
<!-- <view></view> -->
... ... @@ -55,8 +60,13 @@
<view class="seller-room flex-ll">
<view class="flex-ll" style="width:450rpx;height:52rpx;overflow: scroll;">
<block wx:for="{{selleritem.class}}" wx:key="seclass">
<view data-cid="{{item.id}}" data-cname="{{item.name}}" class="room-type line-blue text-blue">{{item.name}}</view>
</block>
<block wx:if="{{index<3}}">
<view data-cid="{{item.id}}" data-cname="{{item.name}}" class="room-type line-blue text-blue">{{item.name}}</view>
</block>
</block>
<block wx:if="{{selleritem.class.length>3}}">
<view class="room-type line-blue text-blue">...</view>
</block>
</view>
<view class="box-shadow"></view>
<view class="book-cover">
... ... @@ -98,6 +108,7 @@
</block> -->
</view>
<getpos bindpos="onpos" id="getpos" hasFailPop></getpos>
<a2l bindshow="a2lshow" bindhide="a2lshow" key="INDEX" type="black20"></a2l>
<as-phone id="as"></as-phone>
... ...
... ... @@ -98,4 +98,17 @@ swiper{
line-height: 36rpx;
border-radius: 4rpx;
padding: 0 10rpx;
}
.region-button{
width: 276rpx;
height: 70rpx;
border-radius: 35rpx;
color: #42A5FF;
position: fixed;
left: 0;
right: 0;
top: 80rpx;
margin: 0 auto;
z-index: 1000;
box-shadow: 0 4rpx 10rpx #E5E5E5;
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import App from '../../utils/api';
const {regeneratorRuntime} = global
const zdmask='-zdmask?v=1.2'
import PubSub from '../../utils/PubSub'
const slots={'morning':1,'noon':2,'night':3}
Page({
/**
... ... @@ -192,9 +193,35 @@ Page({
if(this.options.pnum){
this.reserve.pnum = this.options.pnum;
}
wx.redirectTo({
url:util.http_build_query(this.reserve,'./submit')
})
App.Reserve.GetReserveIsExits({sid:this.reserve.sid,ddate_solt:slots[this.reserve.section],ddate:this.reserve.ddate}).then((json)=>{
console.log(json)
if(json.ret==200){
if(json.data==1){
wx.showModal({
content:'您在该店铺已有一个订单待处理,是否加订一间?',
confirmText:'是',
concelText:'否',
cancelColor:'#999999',
success:(res)=>{
if(res.confirm){
wx.redirectTo({
url:util.http_build_query(this.reserve,'./submit')
})
}
}
})
}else{
wx.redirectTo({
url:util.http_build_query(this.reserve,'./submit')
})
}
}
})
// wx.redirectTo({
// url:util.http_build_query(this.reserve,'./submit')
// })
},
selecttime(e){//时间改变
console.log(e);
... ...
... ... @@ -10,6 +10,7 @@ Page({
*/
data: {
location:'获取中...',
navborder:false,
hasFilter:false,//
taocanpos:{
top:193,
... ... @@ -166,4 +167,21 @@ Page({
this.selectComponent('#as').show(e.detail.seller);
}
},
onPageScroll(e){
console.log('scroll',e)
if(e.scrollTop>=88){
if(!this.data.navborder){
this.setData({
navborder:true
})
}
}else{
if(this.data.navborder){
this.setData({
navborder:false
})
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@
"navigationBarTextStyle": "white",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"nav":"/components/nav/nav",
"search-how":"/components/2.0/filter/how/index",
"location":"/components/2.0/filter/location",
"filter":"/components/2.0/filter/filter",
... ...
<!--pages/reserve/home.wxml-->
<!-- <nav backgroundColor="rgba(0,0,0,0)" color="#ffffff" place="{{false}}"></nav> -->
<nav backgroundColor="{{navborder ? '#ffffff' : 'transparent'}}" place="{{false}}"></nav>
<view class="view header">
<image src="http://nosqn.colorcun.com/search/s%20%281%29.png"
style="z-index: 1"
... ...
... ... @@ -29,6 +29,7 @@ Page({
onLoad: function (options) {
//filter=null&city={"code":"610100","pid":"610000","name":"西安市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606979898,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天)晚餐 4位"}
console.log('searchKeyword',options)
this.getcollectionlist();
this.options=options
this.city=JSON.parse(options.city)
this.selectComponent('#getpos').getPos();
... ... @@ -353,7 +354,26 @@ Page({
centre_pos:`${suggestion.latitude},${suggestion.longitude}`,
multiIndex:0,
...this.options,
frompage:'search',
},'/pages/reserve/indexList')
})
},
getcollectionlist(){
App.Customer.GetCollectionSellerList({
openid:getApp().openid,
lat:this.location.latitude,
lng:this.location.longitude,
offset:1,
size:10,
}).then(res=>{
let sellers=res.data;
sellers.forEach((item,i)=>{
item.title=item.sellername;
item.type='-1';
})
this.setData({
collectionlist:sellers,
})
})
}
})
\ No newline at end of file
... ...
... ... @@ -57,16 +57,29 @@
</view>
</view>
</view>
<view class="pages" wx:elif="{{history.length>0}}">
<view class="flex-lr">
<view class="history-title">最近搜索</view>
<view class="history-empty" bindtap="historyEmpty"></view>
</view>
<view class="history-list">
<block wx:for="{{history}}" wx:key="history.key">
<search-item item="{{item}}" hasHistory bindclick="searchItemClick"></search-item>
</block>
</view>
<view class="pages flex-vl" wx:else>
<block wx:if="{{history.length>0}}">
<view class="flex-lr">
<view class="history-title">最近搜索</view>
<view class="history-empty" bindtap="historyEmpty"></view>
</view>
<view class="history-list" style="margin-bottom: 60rpx;">
<block wx:for="{{history}}" wx:key="history.key">
<search-item item="{{item}}" hasHistory bindclick="searchItemClick"></search-item>
</block>
</view>
</block>
<block wx:if="{{collectionlist.length>0}}">
<view class="flex-lr">
<view class="history-title">收藏的店</view>
<navigator class="text-blue font28r" style="height: 100%;padding-left: 20rpx;color: #42A5FF;" url="/pages/me/follow">更多</navigator>
</view>
<view class="history-list">
<block wx:for="{{collectionlist}}" wx:key="collectionlist.key">
<search-item item="{{item}}" hasHistory bindclick="searchItemClick" search="{{false}}"></search-item>
</block>
</view>
</block>
</view>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
... ...
... ... @@ -597,9 +597,8 @@
overflow-y: scroll;
background: url(http://nosqn.colorcun.com/last-book-bg.png) center center no-repeat;
background-size: 100% 100%;
padding-bottom: 10rpx;
position: relative;
padding-bottom: 240rpx;
/* padding-bottom: 240rpx; */
}
.book-flower{
width: 340rpx;
... ... @@ -777,6 +776,7 @@
top: 0;
bottom: 0;
margin: auto 0;
z-index: 99;
}
.confirm-cover{
position: fixed;
... ...
... ... @@ -9,9 +9,11 @@ class PubSub {
}
on(type, handler) {
console.log('collection',handler)
let cache = this.PubSubCache[type] || (this.PubSubCache[type] = {});
console.log('cache',cache);
handler.$uid = handler.$uid || this.PubSubCache.$uid++;
console.log('handler',handler.$uid);
cache[handler.$uid] = handler;
}
... ...
... ... @@ -606,6 +606,20 @@ export default {
//判断是否点击确认收到
'App.Reserve.GetIsRelaSuccess':{
openid:'openid'
},
//App获取桌位关联图片
'App.Tables.GetTablesPhoto':null,
//小程序获取桌位关联图片
'App.Tables.GetTablesPhotoBySid':null,
//订单预订成功是否消费
'App.Reserve.GetReserveIsConsume':{
openid:'openid'
},
//预定同一商家、时段时提醒
'App.Reserve.GetReserveIsExits':{
openid:'openid'
}
}
\ No newline at end of file
... ...
... ... @@ -15,6 +15,7 @@ const status=[
'已取消',//4:取消预定
'已预订',//5:C端在线预定(分配包间)
'已拒绝'//6:拒单
// '待赴约'
];
const soltName=['','早餐','午餐','晚餐','夜宵']
export default {
... ...
... ... @@ -667,6 +667,12 @@
"pathName": "pages/customer/discount",
"query": "id=199122&sid=4352",
"scene": null
},
{
"name": "pages/reserve/detail",
"pathName": "pages/reserve/detail",
"query": "id=1297",
"scene": null
}
]
}
... ...