Commit 9c8e2f1b4e09bd2d19b3277096512dab493348a8

Authored by vking
2 parents 139f4d10 a68aae07

合并search

Showing 56 changed files with 1762 additions and 605 deletions
... ... @@ -17,6 +17,7 @@
"pages/me/setting",
"pages/me/list",
"pages/reserve/search",
"pages/reserve/searchKeyword",
"pages/reserve/detail",
"pages/me/follow",
"pages/manager-invitation/index",
... ...
... ... @@ -3882,7 +3882,9 @@ scroll-view.cu-steps .cu-item {
.text-df {
font-size: 28rpx;
}
.text-30{
font-size: 30rpx;
}
.text-lg {
font-size: 32rpx;
}
... ...
... ... @@ -55,12 +55,11 @@ Component({
})
},
tapButton(e) {
if(util.attr(e, 'type')=='confirm'){
this.triggerEvent('event', {type: util.attr(e, 'type')})
}
this.hide();
//this.triggerEvent('event', {type: util.attr(e, 'type')})
this.hide(util.attr(e, 'type'));
},
hide() {
hide(type='') {
this.triggerEvent('event', {type: type})
this.setData({
hasShow: false,
})
... ...
... ... @@ -8,6 +8,7 @@ Component({
properties: {
height:Number,
disabled:Boolean,
filterParams:Object,//人均过滤初始值
},
/**
... ... @@ -28,6 +29,14 @@ Component({
this.init()
this.filterParams= null
this.paramsData={}//过滤参数集合
setTimeout(()=>{
if(this.data.filterParams){
this.filterEvent({detail:{
type:'set',
data:this.data.filterParams,
}})
}
},0)
},
/**
* 组件的方法列表
... ... @@ -37,6 +46,7 @@ Component({
this.setData({
multiArray: [['全部菜系'].concat(await DA.getCates())]
})
this.filterParams= this.data.filterParams
},
caixiActive(e) {
console.log('caixiActive', e);
... ...
... ... @@ -5,7 +5,7 @@ Component({
* 组件的属性列表
*/
properties: {
cla:String,
},
/**
... ...
<!--components/reserve/search/filter.wxml-->
<view class="filter {{hasDisplay?'animation-slide-top':''}}" catchtap="catchtap" wx:if="{{hasDisplay}}">
<view class="filter {{cla}} {{(hasDisplay && !cla)?'animation-slide-top':''}}" catchtap="catchtap" wx:if="{{hasDisplay}}">
<view class="part flex-ll">
人均消费
<view class="txt" wx:if="{{consumeStr}}">{{consumeStr}}</view>
... ...
... ... @@ -10,7 +10,9 @@
box-sizing: border-box;
border-radius: 0px 0px 40rpx 40rpx;
}
.bottom-search{
border-radius: 40rpx 40rpx 0px 0px ;
}
.part{
height: 48rpx;
font-size: 34rpx;
... ...
// components/reserve/search/how/hv/date.js
var myBehavior = require('hv_behavior')
const items=(function(){
let today=parseInt(new Date()/1000);
let ds=[]
for(let i=0;i<15;i++){
ds.push(today+86400*i)
}
return ds
})()
Component({
behaviors: [myBehavior],
data:{
items:items,
},
lifetimes: {
created: function () {
// 在组件实例进入页面节点树时执行
this.type='date'
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/reserve/search/how/hv/date.wxml-->
<wxs src="../../../../utils/util.wxs" module="util" />
<swiper previous-margin="35rpx" next-margin="45rpx"
class="tabs date" current="{{current}}"
display-multiple-items="4">
<swiper-item wx:for="{{items}}" wx:key="items">
<view class="item {{spi==index?'active':''}} flex-vc" bindtap="checked" data-index="{{index}}" data-val="{{item}}" data-type="date">
<view class="name">{{util.unixtoTime(item,'DAY')||util.unixtoTime(item,'周WW')}}</view>
<view class="mmdd">{{util.unixtoTime(item,'MM月DD日')}}</view>
</view>
</swiper-item>
</swiper>
... ...
/* components/reserve/search/how/hv/date.wxss */
@import "hv_behavior.wxss";
.date .item{
width: 140rpx;
height: 100rpx;
}
.item .name{
height: 36rpx;
font-size: 26rpx;
line-height: 36rpx;
}
.item .mmdd{
height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
}
\ No newline at end of file
... ...
// components/reserve/search/how/hv/pnum.js
/**
早餐:7:00 —10:00
午餐:11:00 — 14:30
晚餐:16:00—22:00
取最近未到的时段
当天最后一个时段过了,那就第二天第一个时段
*/
import util from '../../../../utils/util'
var myBehavior = require('hv_behavior')
const items=[
{id:1,label:'早餐',stime:'07:00',etime:'10:00'},
{id:2,label:'午餐',stime:'11:00',etime:'14:30'},
{id:3,label:'晚餐',stime:'16:00',etime:'22:00'},
{},
{},
]
Component({
behaviors: [myBehavior],
data:{
items:items,
},
created: function () {
// 在组件实例进入页面节点树时执行
this.type='dur'
setTimeout(()=>{
this.autoChecked()//自动选中
},0)
},
/**
* 组件的方法列表
*/
methods: {
autoChecked(){
if(this.data.ckdata) return;
//console.log('findSellerData',this.data.ckdata)
let now=parseInt(new Date()/1000);
let nowHHII=util.unixtoTime(now,'HH:II')
let activeIndex=0
if(nowHHII>items[0].etime && nowHHII<=items[2].etime){//有效时间内计算
activeIndex=1
if(nowHHII>items[1].etime){
activeIndex=2
}
}
let dataset={
index:activeIndex,
val:items[activeIndex].id,
type:'dur',
}
//console.log('dur-dataset',dataset)
setTimeout(()=>{
this.checked({currentTarget:{dataset:dataset}})
},0)
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/reserve/search/how/dur.wxml-->
<swiper previous-margin="35rpx" next-margin="45rpx"
class="tabs"
display-multiple-items="5">
<swiper-item wx:for="{{items}}" wx:key="items">
<view class="item {{spi==index?'active':''}} flex-vc"
bindtap="{{index>2?'':'checked'}}"
data-index="{{index}}"
data-val="{{item.id}}"
data-type="dur">
<view class="name">{{item.label}}</view>
</view>
</swiper-item>
</swiper>
... ...
/* components/reserve/search/how/dur.wxss */
@import "hv_behavior.wxss";
... ...
// components/reserve/search/how/hv.js
import util from '../../../../utils/util'
module.exports = Behavior({
properties: {
ckdata:{
type:Object,
val:null,
},
},
data: {
spi:-1
},
observers: {
'ckdata': function() {
this.checkedDefEvent()
}
},
methods: {
checked(e,hasCurrent=false){
let index=util.attr(e,'index')
let val=util.attr(e,'val')
let type=util.attr(e,'type')
let obj={
spi:index,
}
if(hasCurrent){
let current=index-2
if(type=='date'){
current=current>10?10:current
}else if(type=='pnum'){
current=current>26?26:current
}
obj.current=current>-1?current:0
}
this.setData(obj)
this.triggerEvent('event',{index,val,type})
},
checkedDefEvent(){
console.log('this.type',this.type)
let type=this.type
let ckdata = {}
if (!this.data.ckdata) {//初始化值
if(type == 'dur') return;
let index, val
if (type == 'pnum') {
index = 3
val = this.data.items[index]
} else if (type == 'date') {
index = 0
val = this.data.items[index]
}
ckdata = {index, val, type}
}else{
ckdata = this.data.ckdata
}
this.checked({currentTarget:{dataset:ckdata}},true)
},
}
})
\ No newline at end of file
... ...
/* components/reserve/search/how/hv.wxss */
@import "../../../../app.wxss";
.tabs {
height: 100rpx;
}
.tabs .item{
width:120rpx;
height:100rpx;
line-height: 100rpx;
border-radius:10rpx;
border:2rpx solid #fffff;
font-size:28rpx;
font-weight:400;
color:#353535;
text-align: center;
box-sizing: border-box;
}
.tabs .item.active{
border-radius:10rpx;
background:#E6F3FF;
border:#E6F3FF;
color:#42A5FF;
}
\ No newline at end of file
... ...
// components/reserve/search/how/index.js
import util from '../../../../utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
hasPage:{
type:Boolean,
value:false,
},
findSellerData:{
type:Object,
value:null,
}
},
/**
* 组件的初始数据
*/
data: {
hidden:true,
},
created(){
this.params={}
},
attached(){
this.setData({
hidden:!this.data.hasPage
})
setTimeout(()=>{
if(!this.data.findSellerData){
this.submit()
}
},300)
},
observers: {
'findSellerData': function(findSellerData) {
console.log('page=>findSellerData',findSellerData)
}
},
/**
* 组件的方法列表
*/
methods: {
paramEvent(e){
console.log('paramEvent',e.detail.type,e.detail)
this.params[e.detail.type]=e.detail
},
submit(){
console.log('this.params',this.params)
let paramObj={}
if(this.params['date']){
paramObj.when_date=util.unixtoTime(this.params['date'].val,'YYYY-MM-DD')
}
if(this.params['pnum']){
paramObj.several=this.params['pnum'].val
}
if(this.params['dur'] && this.params['dur'].val>=0){
paramObj.daily=this.params['dur'].val
}
this.triggerEvent('event',{
params:this.params,
paramObj:paramObj,
paramStr:util.unixtoTime(this.params['date'].val,'MM月DD日(`DAY/周WW`)')
+' '+{1:'早餐',2:'午餐',3:'晚餐'}[this.params['dur'].val]
+' '+this.params['pnum'].val+'位',
})
},
show(){
this.setData({
hidden:false
})
},
hide(){
this.setData({
hidden:true
})
},
}
})
... ...
{
"component": true,
"usingComponents": {
"date":"./date",
"pnum":"./pnum",
"dur":"./dur"
}
}
\ No newline at end of file
... ...
<!--components/reserve/search/how/index.wxml-->
<view hidden="{{hidden}}">
<view class="mask" wx:if="{{!hasPage}}" bindtap="hide"></view>
<view class="{{hasPage?'pages':'pages-window'}}">
<view class="title flex-lr">
<view class="title-name">您几位?什么时间用餐?</view>
<view class="close33" bindtap="hide"></view>
</view>
<view>
<pnum bindevent="paramEvent"
ckdata="{{findSellerData.params.pnum}}"></pnum>
<view style="margin: 40rpx 0">
<date bindevent="paramEvent" ckdata="{{findSellerData.params.date}}"></date>
</view>
<dur bindevent="paramEvent" ckdata="{{findSellerData.params.dur}}"></dur>
</view>
<view class="submit" bindtap="submit">查找餐厅</view>
</view>
</view>
... ...
/* components/reserve/search/how/index.wxss */
@import "../../../../app.wxss";
.mask{
z-index: 99999;
}
.pages{
padding: 20rpx 0;
}
.pages-window{
padding: 40rpx 0;
border-radius:40rpx 40rpx 0 0;
position: fixed;
bottom: 0;
background-color: #fff;
width: 100%;
z-index: 99999;
height: 708rpx;
box-sizing: border-box;
}
.pages .close{
display: none;
}
.title{
height:48rpx;
font-size:34rpx;
font-weight:bold;
color:rgba(53,53,53,1);
line-height:48rpx;
padding: 0 40rpx;
width: calc(100% - 80rpx);
margin-bottom: 40rpx;
}
.close{
background-image: url("http://nosqn.colorcun.com/reserve/images/close.png");
background-size: 100% 100%;
width: 32rpx;
height: 32rpx;
}
.submit{
height:80rpx;
background:#42A5FF;
border-radius:10rpx;
font-size:32rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height:80rpx;
text-align: center;
margin: 0 40rpx;
width: calc(100% - 80rpx);
position: fixed;
bottom: 40rpx;
}
\ No newline at end of file
... ...
// components/reserve/search/how/hv/pnum.js
var myBehavior = require('hv_behavior')
const items=(function(){
let today=1;
let ds=[]
for(let i=0;i<=30;i++){
ds.push(today+i)
}
return ds
})()
Component({
behaviors: [myBehavior],
data:{
items:items,
current:0,
},
lifetimes: {
created: function () {
// 在组件实例进入页面节点树时执行
this.type='pnum'
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/reserve/search/how/hv/pnum.wxml-->
<swiper previous-margin="35rpx" next-margin="45rpx"
class="tabs" current="{{current}}"
display-multiple-items="5">
<swiper-item wx:for="{{items}}" wx:key="items">
<view class="item {{spi==index?'active':''}} flex-vc"
bindtap="checked" data-index="{{index}}"
data-val="{{item}}" data-type="pnum">
<view class="name">{{item>30?'30位以上':item+' 位'}}</view>
</view>
</swiper-item>
</swiper>
... ...
/* components/reserve/search/how/hv/pnum.wxss */
@import "hv_behavior.wxss";
.item .name{
font-size: 30rpx;
line-height: 40rpx;
}
\ No newline at end of file
... ...
// components/2.0/filter/location.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'
});
const CACHE_LOCALTION_KEY='CACHE_LOCALTION_KEY'
Component({
/**
* 组件的属性列表
*/
properties: {
code:String,
},
/**
* 组件的初始数据
*/
data: {
address:'',
activeCity:{},
hasShow:false,
},
attached(){
this.init()
},
/**
* 组件的方法列表
*/
methods: {
async init(){
this.position={}
this.isAddr=false
this.useDefTS=false
this.citys=await DA.getCitys()
this.cacheCity=null
this.setData({
citys: this.citys
})
let cache=util.cache(CACHE_LOCALTION_KEY)
if(cache && cache.city){
this.cacheCity=cache.city
}
this.selectComponent('#getpos').getPos();
},
rePos(e){
this.cacheCity=null
this.isAddr=util.attr(e,'isAddr') && !this.useDefTS
this.selectComponent('#getpos').getPos();
},
hide(){
this.setData({
hasShow:false,
})
},
show(){
this.setData({
hasShow:true,
})
},
event(data){
data.position=this.position
this.triggerEvent('event',data)
util.cache('CACHE_LOCALTION_KEY',data)
},
checkedCity(e){
let activeCity=this.citys[util.attr(e,'index')]
this.setData({
activeCity:activeCity,
})
this.event({city:activeCity,address:this.position.address,isAddr:false})
this.hide()
},
onpos(e) {
let res = e.detail;
console.log('onpos.res', res);
let useDef=false
if(res.latitude==''){//默认使用唐山
this.useDefTS=true
res.latitude=39.684671
res.longitude=118.176300
}
this.position.latitude = res.latitude;
this.position.longitude = res.longitude;
qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success:(res)=>{
if(res.status!=0) return;
console.log('qqmapsdk.reverseGeocoder',res.result)
this.position.address_component= res.result.address_component
this.position.address=this.useDefTS?'':res.result.address
let activeCity={}
if(this.cacheCity){
activeCity=this.cacheCity
}else if(!this.data.code){
this.citys.some(ci=>{
if(ci.name==this.position.address_component.city){
activeCity=ci
return true
}
})
}else{
this.citys.some(ci=>{
if(ci.code==this.data.code){
activeCity=ci
return true
}
})
}
this.setData({
activeCity:activeCity,
address:this.position.address
})
this.event({city:activeCity,address:this.position.address,isAddr:this.isAddr})
if(this.isAddr){//点击地址
this.hide()
}
},
})
},
}
})
... ...
{
"component": true,
"usingComponents": {
"getpos":"/components/2.0/userinfo/getpos"
}
}
\ No newline at end of file
... ...
<!--components/2.0/filter/location.wxml-->
<view class="view cu-modal bottom-modal {{hasShow?'show':''}}" bindtap="hide">
<view class="cu-dialog confirm bg-white " catchtap="catchtap" style="border-radius: 40rpx 40rpx 0px 0px;">
<view class="padding-lg">
<view class="view txt-32-h">
城市选择
</view>
<view class="flex margin-tb-lg">
<view class="flex-treble text-bold txt-34-h flex justify-start">我的位置</view>
<view class="flex justify-end align-center" bindtap="rePos">
<image src="http://nosqn.colorcun.com/search/s%20%289%29.png" style="width: 28rpx;height: 28rpx;"></image>
<view class="margin-left-sm text-blue txt-26-h">重新定位</view>
</view>
</view>
<view wx:if="{{address}}" class="flex justify-start align-start" bindtap="rePos" data-is-addr="{{true}}">
<image src="http://nosqn.colorcun.com/search/s%20%2810%29.png"
style="width: 26rpx;height: 30rpx;margin-top: 6rpx;"></image>
<view class="text-30 margin-left-sm flex-treble text-left">{{address}}</view>
</view>
<view wx:else="" class="text-30 flex-treble text-center">未获取到位置</view>
<view class="view margin-top-lg grid col-4 city-view">
<view class="view flex justify-center city-city"
bindtap="checkedCity" data-index="{{index}}"
wx:for="{{citys}}" wx:key="citys">
<view class="view city {{activeCity.code==item.code?'active':''}}">{{item.name}}</view>
</view>
</view>
<view class="txt-24-h text-gray margin-bottom-lg ">更多城市敬请期待…</view>
<view class="flex justify-center padding-top-lg">
<button class="view cu-btn round bg-ghostWhite txt-34-h"
style="width: 100%;color:#666666; height: 80rpx;"
bindtap="hide">
取消
</button>
</view>
</view>
</view>
</view>
<getpos bindpos="onpos" id="getpos" hasFailPop></getpos>
... ...
/* components/2.0/filter/location.wxss */
@import "../../../colorui/main.wxss";
.city{
width: 148rpx;
height: 84rpx;
background: #F1F1F1;
border-radius: 10rpx;
text-align: center;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 84rpx;
margin-bottom: 40rpx;
}
.city.active{
color: #42A5FF;
background: #E6F3FF;
}
\ No newline at end of file
... ...
... ... @@ -97,12 +97,20 @@ Component({
})
},
confirmEvent(e){
wx.openSetting({
success:res=>{
console.log('getPos.openSetting',res)
this.getPos();
}
})
console.log('confirmEvent.type',e.detail.type)
if(e.detail.type=='confirm') {
wx.openSetting({
success: res => {
console.log('getPos.openSetting', res)
this.getPos();
}
})
}else{
this.triggerEvent("pos",{
latitude: '',
longitude: '',
});
}
},
}
})
... ...
... ... @@ -4,7 +4,9 @@
<view class="nav" style="margin-top: {{statusBarHeight}}px;">
<view class="flex-lr part" style="height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px">
<view class="opt flex-ll">
<view class="back flex-vc" bindtap="back" wx:if="{{disBack}}">
<view class="back flex-vc"
style="height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px"
bindtap="back" wx:if="{{disBack}}">
<image class="back-image"
src="http://nosqn.colorcun.com/custom/lite-yd/image/back{{backgroundColor!='#ffffff'?'-light':''}}.png"></image>
</view>
... ...
... ... @@ -135,7 +135,10 @@ Component({
})
},
confirmEvent(e){
wx.openSetting()
console.log('confirmEvent.type',e.detail.type)
if(e.detail.type=='confirm') {
wx.openSetting()
}
},
}
})
... ...
... ... @@ -11,7 +11,7 @@ Component({
* 组件的初始数据
*/
data: {
url:'pages/reserve/index'
url:'pages/reserve/search'
},
pageLifetimes:{
show(){
... ... @@ -57,9 +57,6 @@ Component({
},
redirectTo(e){
let url= util.attr(e, 'url');
this.setData({
url:url,
})
wx.switchTab({
url: '/'+url,
})
... ...
... ... @@ -26,8 +26,13 @@
.tabBar .checked .text{
color: #5EB2FF;
}
.tabBar .search.checked .icon{
width: 56rpx;
height: 56rpx;
}
.tabBar .search.checked .text{
color: #FFFFFF;
display: none;
}
.home .icon{
width: 40rpx;
... ...
... ... @@ -32,6 +32,7 @@ Component({
type: String,
value: '',
},
seeAll:String,//只看标识
},
/**
... ...
... ... @@ -14,7 +14,7 @@
</block>
</view>
<view class="price">¥ {{item.spec[0].price>0 ? item.spec[0].price : item.price}}
<view class="opt flex-cc">
<view class="opt flex-cc" wx:if="{{!seeAll}}">
<block wx:if="{{item_clear_num==0}}">
<image
class="avater"
... ...
<!--cookbook/index.wxml-->
<nav>{{order.seller.sellername||'提前点菜'}}</nav>
<nav>{{options.seeAll||order.seller.sellername||'提前点菜'}}</nav>
<loading wx:if="{{isloading}}">数据加载中</loading>
<view class="{{hasListModel?'page-list flex-ll-top':'page'}}" wx:if="{{!isloading}}">
<!--第四部分 原始菜无图或有图展示-->
<scroll-view
scroll-y class = "partfour list-model"
style = "height:{{kindHeight-55}}px;width:100%;z-index:{{scrollZindex}}; position: fixed;"
style = "height:{{kindHeight-(options.seeAll?0:55)}}px;width:100%;z-index:{{scrollZindex}}; position: fixed;"
scroll-into-view = "{{toView}}"
scroll-with-animation
bindscroll="bindscroll"
... ... @@ -19,7 +19,7 @@
<view class="list-model-column">
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="itemIndex" >
<view class="item">
<foodCard item="{{item}}"
<foodCard item="{{item}}" seeAll="{{options.seeAll}}"
sellerid="{{order.sellerid}}" orderid="{{order.id}}"
identity="{{options.identity}}"
bindfoodCardCallback="foodCardCallback"
... ... @@ -32,7 +32,7 @@
<view style="height: 110rpx;width: 100%;"></view>
</view>
</scroll-view>
<view class="white flex-lr bottom-view">
<view class="white flex-lr bottom-view" wx:if="{{!options.seeAll}}">
<button class="share flex-vc button-none" open-type="share">
<view class="flex-vc">
<view class="icon">
... ...
... ... @@ -78,7 +78,7 @@ Page({
this.isInvitation = true;
}
//console.log('this.enter_params',this.enter_params)
let url = '/pages/reserve/index';
let url = '/pages/reserve/search';
if (opt.id > 0 || opt.sms_code) {
if (opt.invite_name) {
let invite_names = wx.getStorageSync('invite_names') || {};
... ... @@ -162,7 +162,7 @@ Page({
},
redirectTo(red) {
console.log('this.redirectTo', red);
if (red.url.indexOf('list') > 0 || red.url.indexOf('reserve/index') > 0) {
if (red.url.indexOf('list') > 0 || red.url.indexOf('reserve/search') > 0) {
wx.switchTab(red);
} else {
wx.redirectTo(red);
... ...
... ... @@ -18,8 +18,13 @@ let getCatesID=async function(index){
let res=await App.Reserve.GetCustomerConfig();
return res.data.cate[index].id;
}
let getCitys=async function(){
let res=await App.Reserve.GetCustomerConfig();
return res.data.region_code;
}
export default {
getCates:getCates,
getCatesID:getCatesID,
getCitys:getCitys,
getLabels:getLabels,
}
\ No newline at end of file
... ...
... ... @@ -149,9 +149,11 @@
<view class="black20line"></view>
<view class="block" wx:if="{{seller.dishes.length>0}}">
<view class="header flex-ll">
<view class="line"></view>
<view class="name">推荐菜品</view>
<view class="header flex-lr">
<view class="flex-ll">
<view class="line"></view>
<view class="name">推荐菜品</view>
</view>
</view>
<scroll-view wx:if="{{hasDishesImage}}"
scroll-x
... ... @@ -177,6 +179,22 @@
</block>
</view>
</view>
<block wx:if="{{seller.seller_config_info.is_display_dish==1}}">
<view class="black20line"></view>
<navigator url="/pack-cookbook/pages/index?rid=18599&oid=273&identity=1&seeAll={{seller.sellername}}&sid={{seller.id}}" hover-class="navigator-hover">
<view class="view padding-tb-lg">
<view class="view flex justify-between align-center">
<view class="view txt-40-h text-bold">查看菜单</view>
<view class="view flex justify-end align-center">
<view style="font-size: 28rpx;margin-right: 20rpx;">所有菜品</view>
<view class="more"></view>
</view>
</view>
</view>
</navigator>
<view class="black20line"></view>
<view class="black20line"></view>
</block>
</view>
</view>
<view class="footer flex-lr">
... ...
/* pages/reserve/detail.wxss */
@import "./detail.skeleton.wxss";
@import "../../colorui/main.wxss";
.pages{
width: 100%;
margin: 0 auto;
... ...
... ... @@ -94,9 +94,10 @@ Page({
size:10,
hasMore:true,
GetCollectionSellerList(){
App.Customer.GetActivitySellerList({
lat:this.options.latitude,
lng:this.options.longitude,
this.city=JSON.parse(this.options.city)
App.Customer.GetActivitySellerListByFoods({
code:this.city.code,
pid:this.city.pid,
offset:this.offset,
size:this.size,
distance:50,
... ...
... ... @@ -42,6 +42,13 @@ Page({
* &keyword=
* &filterParams={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"}
*/
/**
hasSuggestion=1&keyword=橡树湾&lat=39.662877&lng=118.130962&centre_pos=39.662877,118.130962&multiIndex=0&filter={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"}&city={"code":"610100","pid":"610000","name":"西安市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606983211,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天) 晚餐 4位"}
lat=39.65157&lng=118.15044&keyword=1&multiIndex=0&city={"code":"130200","pid":"130000","name":"唐山市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":5,"val":6,"type":"pnum"},"date":{"index":1,"val":1607399207,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-08","several":6,"daily":3},"paramStr":"12月08日(明天) 晚餐 6位"}&filter={"consumeStr":"¥101-220","min":"101","max":"220","active":"101,220"}
city={"code":"130200","pid":"130000","name":"唐山市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606984766,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天) 晚餐 4位"}
*/
wx.getSystemInfo({
success:res=>{
console.log('wx.getSystemInfo',res)
... ... @@ -51,11 +58,28 @@ Page({
},
})
this.filterParams=null
if(options.filterParams){
this.filterParams=JSON.parse(options.filterParams)
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;
if(options.hasSuggestion){
... ... @@ -67,9 +91,14 @@ Page({
}
this.setData({
hasSuggestion:true,
suggestion:this.suggestion
suggestion:this.suggestion,
keyword:this.options.keyword,
})
delete this.options.keyword
}else if(this.options.keyword){
this.setData({
keyword:options.keyword,
})
}
let tags=[
{id:1,name:'环境好'},
... ... @@ -102,7 +131,7 @@ Page({
}
})
}catch(e){}
setTimeout(()=>{this.getList()},300)
//setTimeout(()=>{this.getList()},300)
},
... ... @@ -127,6 +156,14 @@ Page({
}
}
)
if(wx.getMenuButtonBoundingClientRect){
let rect=wx.getMenuButtonBoundingClientRect()
console.log(rect,getApp().system)
this.setData({
right:getApp().system.windowWidth - rect.right + rect.width + 10,
top:rect.top+(rect.height/2-20),
})
}
},
/**
... ... @@ -182,69 +219,30 @@ Page({
this.setData({
hasLoading:true,
})
let mapParam=this.options
this.offset=1 //page
this.size=20 //page size
this.setData({
keyword:mapParam.keyword||'',
})
if(mapParam.keyword){
this.param={
lat_extend:mapParam.lat,
lng_extend:mapParam.lng,
keyword:mapParam.keyword.trim(),
offset:this.offset,
size:this.size,
distance:500000,
};
if(mapParam.lat){
this.param.centre_pos=`${mapParam.lat},${mapParam.lng}`
}
if(mapParam.isopen_md){
this.param.isopen_md=1
}
}else{
//计算视窗中心
let lat,lng
if(this.suggestion){
lat=this.suggestion.latitude
lng=this.suggestion.longitude
this.setData({
keyword:this.suggestion.title,
})
}else if(this.hasCleanSuggestion){//清理地标使用人的位置
lat=this.location.latitude
lng=this.location.longitude
}
if(!lat || !lng){//不完整时,使用地图中心点
let map=JSON.parse(mapParam.map);
lat=map.northeast.latitude-(map.northeast.latitude-map.southwest.latitude)/2;
lng=map.northeast.longitude-(map.northeast.longitude-map.southwest.longitude)/2;
}
this.param={
lat:lat,
lng:lng,
lat_extend:mapParam.lat,
lng_extend:mapParam.lng,
offset:this.offset,
size:this.size,
distance:50,
};
if(this.suggestion || this.hasCleanSuggestion){
this.param.centre_pos=`${lat},${lng}`
}else{
if(mapParam.centre_pos){
this.param.centre_pos=mapParam.centre_pos
}
}
this.param={
offset:this.offset,
size:this.size,
code:this.city.code,
pid: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
... ... @@ -254,7 +252,7 @@ Page({
this.hasFilterData=true
}
App.Customer.SellerLists(this.param).then(res=>{
App.Customer.GetSellerListByFoods(this.param).then(res=>{
this.setData({
rsl:[],
hasMore:res.data.length==this.size,
... ... @@ -265,9 +263,11 @@ Page({
})
this.hasGetSellerEnd=true
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
/*
if(res.data.length==0 && this.offset==1 && this.location){
this.onpos({detail:this.location})
this.GetRecommendSellerList()
}
*/
})
},
/**
... ... @@ -283,7 +283,7 @@ Page({
getListMore(){
this.param.offset+=1;
let sellers=this.data.sellers;
App.Customer.SellerLists(this.param).then(res=>{
App.Customer.GetSellerListByFoods(this.param).then(res=>{
this.setData({
hasMore:res.data.length==this.size,
sellers:sellers.concat(this.sellerFormat(res.data)),
... ... @@ -372,10 +372,15 @@ Page({
this.selectComponent('#search-how').show();
},
howEvent(e){
this.eventChannel.emit('findSellerData',e.detail)
//this.eventChannel.emit('findSellerData',e.detail)
this.findSellerData=e.detail
let paramStr=this.findSellerData.paramStr.split(" ");
this.setData({
findSellerData:e.detail
findSellerData:e.detail,
headerHows:[
paramStr[0].substr(0,6),
paramStr[1]+' '+paramStr[2],
],
})
setTimeout(()=>{this.getList();},0)
this.selectComponent('#search-how').hide();
... ... @@ -384,11 +389,7 @@ Page({
onpos(e){
console.log('onpos',this.hasGetSellerEnd,e);
this.location=e.detail
if(!this.hasGetSellerEnd){
return setTimeout(()=>{
this.onpos(e)
},500)
}
this.getList()
// if(this.data.sellers.length<1){
// this.GetRecommendSellerList()
// }
... ... @@ -450,19 +451,12 @@ Page({
this.getList()
},
moveToLocation(){
if(!this.location || !this.location.latitude || !this.location.longitude){
this.selectComponent('#getpos').getPos(true);
return;
}
delete this.options.keyword
this.suggestion=null
this.hasCleanSuggestion=true
this.setData({
suggestion:null,
hasSuggestion:false,
keyword:'',
})
//PubSub.emit('searchParam', {fun:'moveToLocation'})
setTimeout(()=>{this.getList()},0)
this.selectComponent('#getpos').getPos();
},
filterShow(){
this.selectComponent('#filter').show(this.filterParams);
... ... @@ -513,4 +507,20 @@ Page({
this.selectComponent('#as').show(e.detail.seller);
}
},
searchKeyword(){
let pages = getCurrentPages();
if(pages.length>=2){
let p = pages[pages.length - 2];
if(p.route=='pages/reserve/searchKeyword') {
return wx.navigateBack();
}
}
wx.navigateTo({
url:util.http_build_query({
filter:this.filterParams?JSON.stringify(this.filterParams):null,
city:JSON.stringify(this.city),
hows:JSON.stringify(this.findSellerData),
},'/pages/reserve/searchKeyword')
})
},
})
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
"nav":"/components/nav/nav",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"caixi":"/components/reserve/caixi",
"search-how":"/components/reserve/search/how/index",
"search-how":"/components/2.0/filter/how/index",
"hr":"/components/hr",
"filter":"/components/reserve/search/filter",
... ...
<!--pages/reserve/indexList.wxml-->
<nav>周到安排</nav>
<view class="view content" style="height: calc(100vh - 65px);">
<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>
... ... @@ -10,8 +26,11 @@
<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}}">
... ... @@ -33,7 +52,7 @@
scroll-into-view="seller-{{scrollSellerID}}"
scroll-with-animation
bindscrolltolower="getListMore"
style="width:100%;height: calc(100vh - 150px);">
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}}"
... ... @@ -41,9 +60,10 @@
seller="{{item}}" bindevent="sellerCardEvent" ></seller-card>
</navigator>
</block>
<view class="view" style="height: 50rpx;"></view>
<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>
\ No newline at end of file
<as-phone id="as"></as-phone>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
\ No newline at end of file
... ...
... ... @@ -7,14 +7,6 @@
position: relative;
z-index: 99998;
}
.header{
height: 81rpx;
position: fixed;
width: 100%;
z-index: 10;
background-color: #fefefe;
border-bottom: 1rpx solid #F5F5F5;
}
.transverse-search{
background-color: #fefefe;
height: 60rpx;
... ... @@ -227,4 +219,36 @@
position: absolute;
top:16rpx;
left:32rpx;
}
.header{
max-width: 468rpx;
height: 80rpx;
background: #F4FAFF;
border-radius: 48rpx;
border: 2rpx solid #4C91F8;
position: fixed;
font-weight: 500;
}
.header .line{
width: 2rpx;
height: 32rpx;
background: #42A5FF;
}
.header .clean{
position: relative;
background-image: url("http://nosqn.colorcun.com/clean.png");
width: 28rpx;
height: 28rpx;
}
.header .clean:after{
display: block;
content: "";
width:80rpx;
height:80rpx;
position: absolute;
top:-30rpx;
left:-30rpx;
}
\ No newline at end of file
... ...
// pages/reserve/search.js\
const map_key='SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
// 引入SDK核心类
var QQMapWX = require('../../utils/qqmap-wx-jssdk');
// 实例化API核心类
var qqmapsdk = new QQMapWX({
key:map_key // 必填
});
import util from '../../utils/util';
// pages/reserve/home.js
import App from '../../utils/api';
import util from '../../utils/util'
import PubSub from '../../utils/PubSub'
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
history:[],
suggestion:[],
hasSellerMore:false,
keyword:'',
sellerSplit:-1,
navHeight:100,
location:'获取中...',
hasFilter:false,//
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -42,11 +32,6 @@ Page({
*/
onShow: function () {
PubSub.emit('custom-tab-bar')
this.getHistory();
this.setData({
navHeight:this.selectComponent('#nav').getHeight()
})
},
/**
... ... @@ -62,266 +47,117 @@ Page({
onUnload: function () {
},
getHistory(){
App.Customer.GetHistorySearch().then(res=>{
let mks=[]
res.data.forEach(h=>{
mks.push({ // 获取返回结果,放到mks数组中
title: h.name,
id: h.sid,
addr: '',
city: '',
district: 0,
latitude: h.latitude,
longitude: h.longitude,
type:h.type==1?-1:h.type,
})
})
this.setData({
history:mks
})
})
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
//在Page({})中使用下列代码
//数据回填方法
backfill: function (e) {
var id = e.currentTarget.id;
for (var i = 0; i < this.data.suggestion.length; i++) {
if (i == id) {
console.log('backfill,this.data.suggestion[i]:',this.data.suggestion[i])
// let pages = getCurrentPages();
// let p = pages[pages.length - 2];
// p.setSuggestion(this.data.suggestion[i])
//util.cache('suggestion',this.data.suggestion[i]);
this.setData({
backfill: this.data.suggestion[i].title
});
this.setSuggestion({fun:'setSuggestion',suggestion:this.data.suggestion[i]})
wx.navigateBack();
break;
}
}
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
inputVal:'',
//触发关键词输入提示事件
getsuggest: function (e) {
//调用关键词提示接口
this.inputVal=e.detail.value;
if(this.inputVal.length<1){
return this.setData({
suggestion: [],
keyword:''
})
}
let prarms={
keyword:this.inputVal,
region:this.location.city||'',
region_fix:0,
page_size:20,
page_index:1,
key:map_key,
}
if(this.location.latitude){
prarms.location=this.location.latitude+','+this.location.longitude
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return{
title:'请客订包间,就上周到安排'
}
App.Customer.KeywordTips(prarms).then(res=>{
if(this.inputVal.length<1){
return this.setData({
suggestion: []
})
}
var sug = [],hasSellerMore=false,sellerSplit=-1
try{
res.data=res.data.data
if(res.data instanceof Array){
for (var i = 0; i < res.data.length; i++) {
if(i==2 && res.data[i].type==-1){
hasSellerMore=true
continue;
}
if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){
sellerSplit=i-1
}
let item=res.data[i]
item.latitude=item.location.lat
item.longitude=item.location.lng
item.addr=item.address
item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))
sug.push(item);
}
}
}catch(e){}
this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion: sug,
hasSellerMore:hasSellerMore,
keyword:this.inputVal,
sellerSplit:sellerSplit,
});
})
},
nearby_search: function () {
App.Customer.SearchMap({
boundary:'region('+this.location.city+',1)',
//boundary:'nearby('+this.location.latitude+','+this.location.longitude+',1000,1)',
location:this.location.latitude+','+this.location.longitude,
keyword:this.inputVal,
page_size:20,
page_index:1,
orderby:'_distance',
key:map_key,
}).then(res=>{
var mks = []
for (var i = 0; i < res.data.length; i++) {
mks.push({ // 获取返回结果,放到mks数组中
title: res.data[i].title,
id: res.data[i].id,
addr: res.data[i].address,
city: res.data[i].city,
district: res.data[i].district,
latitude: res.data[i].location.lat,
longitude: res.data[i].location.lng,
type:res.data[i].type,
category:res.data[i].category,
})
}
this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion:mks,
});
})
},
location:'',
onpos(e){
console.log(e);
this.location=e.detail
this.GetRecommendSellerLists()
this.getCity()
dispalySearchHow(){
this.selectComponent('#search-how').show();
},
getCity(){
qqmapsdk.reverseGeocoder({
location:this.location,
success:(res)=>{
this.location['city']='';
if(res.status==0){
this.location['city']=res.result.ad_info.city
}
},
})
},
gotoList(){
wx.navigateTo({
url:util.http_build_query({
lat:this.location.latitude,
lng:this.location.longitude,
keyword:this.inputVal,
multiIndex:0,
},'./indexList')
howEvent(e){
console.log('howEvent',e.detail)
//this.eventChannel.emit('findSellerData',e.detail)
this.findSellerData=e.detail
this.setData({
findSellerData:e.detail
})
},
searchItemClick(e){
//console.log('searchItemClick',e)
let item=e.detail.data
if(e.detail.act=='detail'){
if(item.type==-1){
wx.navigateTo({
url:util.http_build_query({
id:item.id,
},'./detail')
})
}else{
//let pages = getCurrentPages();
//let p = pages[pages.length - 2];
//p.setSuggestion(item)
this.setSuggestion({fun:'setSuggestion',suggestion:item})
this.setData({
backfill: item.title
});
wx.navigateBack();
}
}else{
wx.navigateTo({
url:util.http_build_query({
id:item.id,
activeTab:'reserve',
},'./detail')
//setTimeout(()=>{this.getList();},0)
this.selectComponent('#search-how').hide();
},
dispalyLocation(){
this.selectComponent('#location').show();
},
meLocation(){
this.selectComponent('#location').rePos({currentTarget:{dataset:{isAddr:true}}});
},
GetRecomList(){
App.Customer.GetRecomList({
pid:this.city.pid,
code:this.city.code,
lat:this.position.latitude,
lng:this.position.longitude,
offset:1,
size:100
}).then(res=>{
this.setData({
sellers:res.data,
})
}
})
},
historyEmpty(){
App.Customer.DelHistorySearch().then(()=>{
App.Customer.GetHistorySearch({},'clear')
locationEvent(e){
console.log('locationEvent',e.detail)
this.city=e.detail.city
this.position=e.detail.position
this.setData({
location:e.detail.isAddr?e.detail.address:e.detail.city.name,
IsSetActivityByFoods:false,
sellers:[],
})
App.Customer.IsSetActivityByFoods({
pid:this.city.pid,
code:this.city.code,
}).then(res=>{
this.setData({
history:[]
IsSetActivityByFoods:res.data,
})
})
this.GetRecomList()
},
clearKeyword(){
filterParams:null,
displayFilter(){
this.selectComponent('#filter').show(this.filterParams);
this.setData({
keyword:'',
suggestion:[],
hasFilter:true,
})
},
GetRecommendSellerLists(){
if(!this.location.latitude) return;
let param={}
param={
lat:this.location.latitude,
lng:this.location.longitude
}
App.Customer.GetRecommendSellerLists(param).then(res=>{
filterEvent(e){
console.log('filterEvent',e.detail)
if(e.detail.type=='set'){
this.filterParams=e.detail.data
this.setData({
rsl:res.data
hasFilter:false,
consumeStr:e.detail.data.consumeStr,
})
}else{
this.filterParams=null;
this.setData({
hasFilter:false,
consumeStr:'',
})
})
},
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
}
}
},
gotoSellerDetail(e){
let url='/pages/reserve/detail?id='+e.currentTarget.id
goPath(e){
let path=util.attr(e,'path');
wx.navigateTo({
url:url,
url:util.http_build_query({
filter:this.filterParams?JSON.stringify(this.filterParams):null,
city:JSON.stringify(this.city),
hows:JSON.stringify(this.findSellerData),
},path)
})
},
sbtrEvent(e){
console.log(e);
if(e.detail.act=='oncall'){
sellerCardEvent(e){
if(e.detail.type=='phone'){
this.selectComponent('#as').show(e.detail.seller);
}
},
setSuggestion(data){//只通知前页变更数据
/*
let pages = getCurrentPages();
let p = pages[pages.length - 2];
if(p.route=='pages/reserve/index'){
PubSub.emit('searchParam',data)
}else{
PubSub.emit('searchParamList',data)
}
*/
let suggestion=data.suggestion
wx.navigateTo({
url:util.http_build_query({
hasSuggestion:1,
keyword:suggestion.title,
lat:suggestion.latitude,
lng:suggestion.longitude,
centre_pos:`${suggestion.latitude},${suggestion.longitude}`,
multiIndex:0,
},'/pages/reserve/indexList')
})
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTextStyle": "white",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"getpos":"/components/userinfo/getpos",
"nav":"/components/nav/nav",
"search-item":"/components/reserve/search/item",
"as-phone":"/components/actionSheet/phone",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box"
"search-how":"/components/2.0/filter/how/index",
"location":"/components/2.0/filter/location",
"filter":"/components/2.0/filter/filter",
"seller-card":"/components/2.0/seller/card",
"as-phone":"/components/2.0/dialog/phone"
}
}
\ No newline at end of file
... ...
<!--pages/reserve/search.wxml-->
<nav id="nav">搜索</nav>
<view class="searchAddrView" style="height: {{navHeight+40}}px;">
<view class="searchAddr flex-ll" style="margin-top: {{navHeight+5}}px;">
<image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image>
<input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
type="text" confirm-type="done"
focus
bindinput="getsuggest" value="{{keyword}}"/>
<image class="icon icon-del" wx:if="{{keyword.length>0}}"
catchtap="clearKeyword"
src="http://nosqn.colorcun.com/reserve/images/del.png"></image>
</view>
</view>
<view class="pages">
<view class="res-view">
<!--绑定回填事件-->
<block wx:for="{{suggestion}}" wx:key="index"
bindtap="backfill" id="{{index}}">
<search-item item="{{item}}" keyword="{{keyword}}" bindclick="searchItemClick"></search-item>
<view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view>
<view wx:if="{{index==sellerSplit && sellerSplit>-1}}" class="see-split"></view>
</block>
<view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view>
</view>
<!--pages/reserve/home.wxml-->
<view class="view header">
<image src="http://nosqn.colorcun.com/search/s%20%281%29.png"
style="z-index: 1"
mode="widthFix" class="bg-img"></image>
</view>
<view class="history" wx:if="{{suggestion.length<1}}">
<view wx:if="{{keyword.length>0}}">
<view class="flex-vc empty">
<block wx:if="{{!hasFirstShow}}">
<image src="http://nosqn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<view class="empty-t1">抱歉,没有找到符合的内容</view>
<view class="empty-t2">试试搜搜别的</view>
</block>
<view class="view search margin-lr padding-top-0 padding-lr-lg padding-bottom-lg">
<view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;">
<view bindtap="dispalyLocation"
class="view flex-treble text-bold text-xl text-cut margin-right-lg">
{{location}}
</view>
<view class="rsl-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}}"
hasInSwiper bindevent="sbtrEvent"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class="view flex flex-direction align-center justify-center" bindtap="meLocation">
<view class="view posicon"></view>
<view class="view text-blue txt-24-h" style="margin-top: 4rpx;">我的位置</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 class="view solid-bottom flex justify-around align-center" style="height: 110rpx;" bindtap="dispalySearchHow">
<view class="flex-treble txt-36-h text-bold">{{findSellerData.paramStr||'周到安排(今天) 晚餐 4位'}}</view>
<view class="more"></view>
</view>
<view class="view solid-bottom flex justify-around align-center"
bindtap="goPath" data-path="/pages/reserve/searchKeyword"
style="height: 110rpx;">
<view class="flex-treble txt-32-h text-gray">搜索餐厅/位置/关键词</view>
<view class="more"></view>
</view>
<view class="view flex justify-around align-center" style="height: 110rpx;" bindtap="displayFilter">
<view class="flex-treble txt-32-h {{consumeStr?'':'text-gray'}}">{{consumeStr||'人均消费'}}</view>
<view class="more"></view>
</view>
<view class="view flex justify-around align-center round bg-blue-blue text-bold"
bindtap="goPath" data-path="/pages/reserve/indexList"
style="height: 84rpx;">
查找包间
</view>
</view>
<view wx:if="{{IsSetActivityByFoods}}" class="margin-top-lg padding-lr-lg padding-top-lg" bindtap="goPath"
data-path="/pages/reserve/discount">
<view class="txt-40-h text-bold margin-bottom">精选特惠</view>
<view class="flex justify-center align-center">
<view class="view youhui-image image1" style=""></view>
<view class="margin-left-xs">
<view class="view youhui-image image2"></view>
<view class="view youhui-image image3 margin-top-xs"></view>
</view>
</view>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
<view wx:if="{{sellers.length>0}}" class="margin-tb-lg padding-tb-lg">
<view class="txt-40-h text-bold margin-bottom margin-lr-lg">为你推荐</view>
<view wx:for="{{sellers}}" wx:key="sellers" class="margin-lr-sm" >
<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>
</view>
</view>
<view style="height: 150rpx;"></view>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<location id="location" bindevent="locationEvent"></location>
<view class="view filter-mask" hidden="{{!hasFilter}}">
<view class="view filter">
<filter id="filter" bindevent="filterEvent" cla="bottom-search"></filter>
</view>
</view>
<as-phone id="as"></as-phone>
\ No newline at end of file
... ...
/* pages/reserve/search.wxss */
.pages{
width: 90%;
margin: 5% auto;
color:#353535;
}
.searchAddrView{
position: fixed;
top:0rpx;
width: 100%;
height: 240rpx;
background-color: #ffffff;
z-index: 9;
}
.searchAddr {
width: 90%;
height: 60rpx;
background-color: #F5F5F5;
border-radius: 30rpx;
line-height: 60rpx;
color:#999999;
line-height: 60rpx;
font-size: 28rpx;
margin:0 auto;
}
.searchAddr .icon{
min-width: 26rpx;
width:26rpx;
height: 26rpx;
margin: 0 20rpx;
}
.searchAddr .icon-del{
min-width: 28rpx;
width: 28rpx;
height: 28rpx;
}
.res-view{
margin-top: 120rpx;
/* pages/reserve/home.wxss */
@import "../../colorui/main.wxss";
.header{
position: relative;
width: 100%;
}
.bg-img{
width: 100%;
}
.header:before{
width: calc(100% - 60rpx);
left:30rpx;
top:280rpx;
height: 558rpx;
background: #FFFFFF;
box-shadow: 0px 0px 30rpx 0px #E5E5E5;
border-radius: 20rpx;
display: block;
content: "";
position: absolute;
}
.header:after{
display: block;
content: "";
position: absolute;
width: 100%;
height: 286rpx;
top:60rpx;
background-image: url("http://nosqn.colorcun.com/search/s%20%282%29.png");
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
z-index: 1;
}
.search{
width: calc(100% - 60rpx);
height: 558rpx;
background: #fff;
border-radius: 20rpx;
position: relative;
z-index: 2;
margin-top: -330rpx;
}
.posicon{
background-image: url("http://nosqn.colorcun.com/search/s%20%283%29.png");
width: 36rpx;
height: 36rpx;
}
.filter-mask{
background-color: rgba(0,0,0,0.5);
width: 100%;
height: 100%;
position: fixed;
z-index: 99999;
bottom:0;
left:0;
}
.filter{
position: relative;
/*margin-top: calc(100% + 30rpx);*/
top:calc(100vh - 550rpx);
}
.image1{
background-image: url("http://nosqn.colorcun.com/search/s%20%285%29.png");
width: 330rpx;
height: 346rpx;
}
.image2{
background-image: url("http://nosqn.colorcun.com/search/s%20%286%29.png");
width: 330rpx;
height: 168rpx;
}
.image3{
background-image: url("http://nosqn.colorcun.com/search/s%20%287%29.png");
width: 330rpx;
height: 168rpx;
}
.youhui-image{
position: relative;
}
.youhui-image:before{
position: absolute;
height: 50rpx;
font-size: 36rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #FFFFFF;
line-height: 50rpx;
top:20rpx;
left: 20rpx;
content: "";
display: block;
}
.youhui-image:after{
position: absolute;
height: 34rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 34rpx;
top:70rpx;
left: 20rpx;
content: "";
display: block;
}
.image1:before{
content: "预订买单更优惠";
}
.image1:after{
content: "100+优质餐厅";
}
.search-but{
min-width: 140rpx;
color:#000000;
border-left: 2rpx solid #cccccc;
text-align: center;
height: 32rpx;
line-height: 32rpx;
}
.history{
margin-top: 140rpx;
.image2:before{
content: "百万补贴来袭";
}
.history .history-title{
font-size: 28rpx;
color:#353535;
height: 40rpx;
line-height: 40rpx;
font-weight:600;
margin-bottom: 20rpx;
.image2:after{
content: "限时特惠";
}
.see-more{
width: 100%;
height: 34rpx;
position: relative;
margin-bottom: 40rpx;
margin-top: 40rpx;
}
.see-more:before{
content: "";
width: 100%;
height: 2rpx;
background-color: #F5F5F5;
position: absolute;
left: 0;
top:17rpx;
}
.see-more:after{
content: "查看更多";
width:136rpx;
height:34rpx;
font-size:24rpx;
color:rgba(153,153,153,1);
line-height:34rpx;
background-color: #fefefe;
position: absolute;
display: block;
left:calc(50% - 68rpx);
top:0;
text-align: center;
}
.see-more.bottom:after{
width:200rpx;
content: "我是有底线的";
left:calc(50% - 100rpx);
}
.see-more.bottom{
padding-bottom: 40rpx;
}
.see-split{
width: 100%;
height: 20rpx;
}
.history-empty{
width: 28rpx;
height: 28rpx;
background-image: url("http://nosqn.colorcun.com/reserve/images/empty.png");
background-size: 100% 100%;
.image3:before{
content: "超值套餐";
}
.empty{margin-top: 150rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty .empty-t1{
font-size: 28rpx;
margin-top: 60rpx;
height:40px;
line-height:40px;
}
.empty .empty-t2{
font-size: 28rpx;
margin-top: 20rpx;
height:40px;
line-height:40px;
}
.line-push{
background-image: url("http://nosqn.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-bottom: 60rpx;
}
.rsl-block{
position: fixed;
bottom: 0rpx;
width: 100%;
}
.transverse-list{
background-color: #fefefe;
width: 100%;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
.image3:after{
content: "包间可用";
}
\ No newline at end of file
... ...
// pages/reserve/search.js\
const map_key='SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
// 引入SDK核心类
var QQMapWX = require('../../utils/qqmap-wx-jssdk');
// 实例化API核心类
var qqmapsdk = new QQMapWX({
key:map_key // 必填
});
import util from '../../utils/util';
import App from '../../utils/api';
import PubSub from '../../utils/PubSub'
Page({
/**
* 页面的初始数据
*/
data: {
history:[],
suggestion:[],
hasSellerMore:false,
keyword:'',
sellerSplit:-1,
navHeight:100,
},
/**
* 生命周期函数--监听页面加载
*/
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.options=options
this.city=JSON.parse(options.city)
this.selectComponent('#getpos').getPos();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
PubSub.emit('custom-tab-bar')
this.getHistory();
this.setData({
navHeight:this.selectComponent('#nav').getHeight()
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
getHistory(){
//this.city=util.cache('CACHE_LOCALTION_KEY')
App.Customer.GetHistorySearch().then(res=>{
let mks=[]
res.data.forEach(h=>{
mks.push({ // 获取返回结果,放到mks数组中
title: h.name,
id: h.sid,
addr: '',
city: '',
district: 0,
latitude: h.latitude,
longitude: h.longitude,
type:h.type==1?-1:h.type,
})
})
this.setData({
history:mks
})
})
},
//在Page({})中使用下列代码
//数据回填方法
backfill: function (e) {
var id = e.currentTarget.id;
for (var i = 0; i < this.data.suggestion.length; i++) {
if (i == id) {
console.log('backfill,this.data.suggestion[i]:',this.data.suggestion[i])
// let pages = getCurrentPages();
// let p = pages[pages.length - 2];
// p.setSuggestion(this.data.suggestion[i])
//util.cache('suggestion',this.data.suggestion[i]);
this.setData({
backfill: this.data.suggestion[i].title
});
this.setSuggestion({fun:'setSuggestion',suggestion:this.data.suggestion[i]})
wx.navigateBack();
break;
}
}
},
inputVal:'',
//触发关键词输入提示事件
getsuggest: function (e) {
//调用关键词提示接口
this.inputVal=e.detail.value;
if(this.inputVal.length<1){
return this.setData({
suggestion: [],
keyword:''
})
}
let prarms={
keyword:this.inputVal,
region:this.location.city||'',
region_fix:1,
page_size:20,
page_index:1,
key:map_key,
}
if(this.city){
prarms.name=this.city.name
prarms.code=this.city.code
prarms.pid=this.city.pid
}
if(this.location.latitude){
prarms.location=this.location.latitude+','+this.location.longitude
}
App.Customer.KeywordTips(prarms).then(res=>{
if(this.inputVal.length<1){
return this.setData({
suggestion: []
})
}
var sug = [],hasSellerMore=false,sellerSplit=-1
try{
res.data=res.data.data
if(res.data instanceof Array){
for (var i = 0; i < res.data.length; i++) {
if(i==2 && res.data[i].type==-1){
hasSellerMore=true
continue;
}
if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){
sellerSplit=i-1
}
let item=res.data[i]
item.latitude=item.location.lat
item.longitude=item.location.lng
item.addr=item.address
item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))
sug.push(item);
}
}
}catch(e){}
this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion: sug,
hasSellerMore:hasSellerMore,
keyword:this.inputVal,
sellerSplit:sellerSplit,
});
})
},
nearby_search: function () {
App.Customer.SearchMap({
boundary:'region('+this.location.city+',1)',
//boundary:'nearby('+this.location.latitude+','+this.location.longitude+',1000,1)',
location:this.location.latitude+','+this.location.longitude,
keyword:this.inputVal,
page_size:20,
page_index:1,
orderby:'_distance',
key:map_key,
}).then(res=>{
var mks = []
for (var i = 0; i < res.data.length; i++) {
mks.push({ // 获取返回结果,放到mks数组中
title: res.data[i].title,
id: res.data[i].id,
addr: res.data[i].address,
city: res.data[i].city,
district: res.data[i].district,
latitude: res.data[i].location.lat,
longitude: res.data[i].location.lng,
type:res.data[i].type,
category:res.data[i].category,
})
}
this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion:mks,
});
})
},
location:'',
onpos(e){
console.log(e);
this.location=e.detail
this.GetRecommendSellerLists()
this.getCity()
},
getCity(){
qqmapsdk.reverseGeocoder({
location:this.location,
success:(res)=>{
this.location['city']='';
if(res.status==0){
this.location['city']=res.result.ad_info.city
}
},
})
},
gotoList(){
wx.navigateTo({
url:util.http_build_query({
lat:this.location.latitude,
lng:this.location.longitude,
keyword:this.inputVal,
multiIndex:0,
city:this.options.city,
hows:this.options.hows,
filter:this.options.filter,
},'./indexList')
})
},
searchItemClick(e){
//console.log('searchItemClick',e)
let item=e.detail.data
if(e.detail.act=='detail'){
if(item.type==-1){
wx.navigateTo({
url:util.http_build_query({
id:item.id,
},'./detail')
})
}else{
this.setSuggestion({fun:'setSuggestion',suggestion:item})
}
}else{
wx.navigateTo({
url:util.http_build_query({
id:item.id,
activeTab:'reserve',
},'./detail')
})
}
},
historyEmpty(){
App.Customer.DelHistorySearch().then(()=>{
App.Customer.GetHistorySearch({},'clear')
this.setData({
history:[]
})
})
},
clearKeyword(){
this.setData({
keyword:'',
suggestion:[],
})
},
GetRecommendSellerLists(){
if(!this.location.latitude) return;
let param={}
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
}
}
},
gotoSellerDetail(e){
let url='/pages/reserve/detail?id='+e.currentTarget.id
wx.navigateTo({
url:url,
})
},
sbtrEvent(e){
console.log(e);
if(e.detail.act=='oncall'){
this.selectComponent('#as').show(e.detail.seller);
}
},
async hasInCity(suggestion){
return new Promise((success,fail)=>{
if(this.city){
qqmapsdk.reverseGeocoder({
location: {
latitude: suggestion.latitude,
longitude: suggestion.longitude
},
success:(res)=>{
if(res.status!=0) return success({flag:true,'msg':'1001'})
console.log('qqmapsdk.reverseGeocoder',res.result.address_component.city,this.city.name)
if(res.result.address_component.city==this.city.name){
return success({flag:true,msg:''})
}
success({flag:false,msg:''})
},
fail:()=>{
success({flag:true,msg:'1002'})
},
})
}else{
success({flag:true,msg:'1003'})
}
})
},
async setSuggestion(data){//只通知前页变更数据
let suggestion=data.suggestion
//地址解析
wx.showLoading()
let hasInCity=await this.hasInCity(suggestion)
console.log('hasInCity',hasInCity)
if(!hasInCity.flag){
return setTimeout(()=>{
util.toast('该位置不在当前城市,建议换个位置','none');
},300)
}
wx.navigateTo({
url:util.http_build_query({
hasSuggestion:1,
keyword:suggestion.title,
lat:suggestion.latitude,
lng:suggestion.longitude,
centre_pos:`${suggestion.latitude},${suggestion.longitude}`,
multiIndex:0,
...this.options,
},'/pages/reserve/indexList')
})
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"getpos":"/components/userinfo/getpos",
"nav":"/components/nav/nav",
"search-item":"/components/reserve/search/item",
"as-phone":"/components/actionSheet/phone",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box"
}
}
\ No newline at end of file
... ...
<!--pages/reserve/search.wxml-->
<nav id="nav">搜索</nav>
<view class="searchAddrView" style="height: {{navHeight+40}}px;">
<view class="searchAddr flex-ll" style="margin-top: {{navHeight+5}}px;">
<image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image>
<input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
type="text" confirm-type="done"
focus
bindinput="getsuggest" value="{{keyword}}"/>
<image class="icon icon-del" wx:if="{{keyword.length>0}}"
catchtap="clearKeyword"
src="http://nosqn.colorcun.com/reserve/images/del.png"></image>
</view>
</view>
<view class="pages">
<view class="res-view">
<!--绑定回填事件-->
<block wx:for="{{suggestion}}" wx:key="index"
bindtap="backfill" id="{{index}}">
<search-item item="{{item}}" keyword="{{keyword}}" bindclick="searchItemClick"></search-item>
<view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view>
<view wx:if="{{index==sellerSplit && sellerSplit>-1}}" class="see-split"></view>
</block>
<view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view>
</view>
</view>
<view class="history" wx:if="{{suggestion.length<1}}">
<view wx:if="{{keyword.length>0}}">
<view class="flex-vc empty">
<block wx:if="{{!hasFirstShow}}">
<image src="http://nosqn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<view class="empty-t1">抱歉,没有找到符合的内容</view>
<view class="empty-t2">试试搜搜别的</view>
</block>
</view>
<view class="rsl-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}}"
hasInSwiper bindevent="sbtrEvent"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</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>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
<as-phone id="as"></as-phone>
\ No newline at end of file
... ...
/* pages/reserve/search.wxss */
.pages{
width: 90%;
margin: 5% auto;
color:#353535;
}
.searchAddrView{
position: fixed;
top:0rpx;
width: 100%;
height: 240rpx;
background-color: #ffffff;
z-index: 9;
}
.searchAddr {
width: 90%;
height: 60rpx;
background-color: #F5F5F5;
border-radius: 30rpx;
line-height: 60rpx;
color:#999999;
line-height: 60rpx;
font-size: 28rpx;
margin:0 auto;
}
.searchAddr .icon{
min-width: 26rpx;
width:26rpx;
height: 26rpx;
margin: 0 20rpx;
}
.searchAddr .icon-del{
min-width: 28rpx;
width: 28rpx;
height: 28rpx;
}
.res-view{
margin-top: 120rpx;
}
.search-but{
min-width: 140rpx;
color:#000000;
border-left: 2rpx solid #cccccc;
text-align: center;
height: 32rpx;
line-height: 32rpx;
}
.history{
margin-top: 140rpx;
}
.history .history-title{
font-size: 28rpx;
color:#353535;
height: 40rpx;
line-height: 40rpx;
font-weight:600;
margin-bottom: 20rpx;
}
.see-more{
width: 100%;
height: 34rpx;
position: relative;
margin-bottom: 40rpx;
margin-top: 40rpx;
}
.see-more:before{
content: "";
width: 100%;
height: 2rpx;
background-color: #F5F5F5;
position: absolute;
left: 0;
top:17rpx;
}
.see-more:after{
content: "查看更多";
width:136rpx;
height:34rpx;
font-size:24rpx;
color:rgba(153,153,153,1);
line-height:34rpx;
background-color: #fefefe;
position: absolute;
display: block;
left:calc(50% - 68rpx);
top:0;
text-align: center;
}
.see-more.bottom:after{
width:200rpx;
content: "我是有底线的";
left:calc(50% - 100rpx);
}
.see-more.bottom{
padding-bottom: 40rpx;
}
.see-split{
width: 100%;
height: 20rpx;
}
.history-empty{
width: 28rpx;
height: 28rpx;
background-image: url("http://nosqn.colorcun.com/reserve/images/empty.png");
background-size: 100% 100%;
}
.empty{margin-top: 150rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty .empty-t1{
font-size: 28rpx;
margin-top: 60rpx;
height:40px;
line-height:40px;
}
.empty .empty-t2{
font-size: 28rpx;
margin-top: 20rpx;
height:40px;
line-height:40px;
}
.line-push{
background-image: url("http://nosqn.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-bottom: 60rpx;
}
.rsl-block{
position: fixed;
bottom: 0rpx;
width: 100%;
}
.transverse-list{
background-color: #fefefe;
width: 100%;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
\ No newline at end of file
... ...
... ... @@ -626,9 +626,10 @@
"scene": null
},
{
"id": 76,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id=118852",
"query": "id=59113",
"scene": null
},
{
... ...
... ... @@ -294,7 +294,9 @@ export default {
'App.Customer.SearchMap':null,
//根据腾讯地点搜索api整合现有商家
'App.Customer.KeywordTips':null,
'App.Customer.KeywordTips':{
alias:'App.App.KeywordTips'//限制城市
},
//设置C端用户常用信息
'App.Customer.SetCustomerInfo':{
... ... @@ -512,6 +514,18 @@ export default {
openid:'openid',
},
//根据区域查询指定条件下的商家列表
'App.Customer.GetSellerListByFoods':null,
//用来检测找包间首页优惠板块是否显示
'App.Customer.IsSetActivityByFoods':null,
//根据地理位置获取相应的商家活动列表
'App.Customer.GetActivitySellerListByFoods':null,
//根据code获取指定区域下面的推介的商家列表
'App.Customer.GetRecomList':null,
//根据账单ID获取账单详情
'App.Foodset.GetFoodOrdersDetail':null,
... ...