Commit 096756478a0f1dc2ed77a3192f08596dda757d39

Authored by vking
1 parent 0fc19042

search

... ... @@ -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;
}
... ...
// 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
var myBehavior = require('hv_behavior')
const items=[
{id:1,label:'早餐'},
{id:2,label:'午餐'},
{id:3,label:'晚餐'},
{},
{},
]
Component({
behaviors: [myBehavior],
data:{
items:items,
},
lifetimes: {
created: function () {
// 在组件实例进入页面节点树时执行
this.type='dur'
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"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:{},
}
},
/**
* 组件的初始数据
*/
data: {
hidden:true,
},
created(){
this.params={}
},
attached(){
this.setData({
hidden:!this.data.hasPage
})
},
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)
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,
})
},
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'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
attached(){
this.init()
this.position={}
this.selectComponent('#getpos').getPos();
},
/**
* 组件的方法列表
*/
methods: {
async init(){
this.setData({
citys: await DA.getCitys()
})
},
onpos(e) {
let res = e.detail;
console.log('onpos.res', res);
this.position.latitude = res.latitude;
this.position.longitude = res.longitude;
},
}
})
... ...
{
"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">
<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="{{true}}" class="flex justify-start align-start">
<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">的说法是电风扇东风风神懂法守法水电费水电费水电费水电费水电费水电费水电费</view>
</view>
<view wx:else="" class="text-30 flex-treble text-center">未获取到位置</view>
<view class="view margin-bottom-xl margin-top-lg grid col-4 city-view">
<view class="view flex justify-center city-city" wx:for="{{citys}}" wx:key="citys">
<view class="view city">{{item.name}}</view>
</view>
</view>
<view class="flex justify-center margin-bottom-lg margin-top">
<button class="view cu-btn margin-right-xl round bg-ghostWhite" wx:if="{{opt.cancelText}}"
bindtap="tapButton" data-type="cancel"
style="color:{{opt.cancelColor}};">{{opt.cancelText}}</button>
<button class="view cu-btn round bg-blue"
bindtap="tapButton" data-type="confirm"
style="color:{{opt.confirmColor}};">{{opt.confirmText}}</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-view .city-city:nth-child(4n+0){
background-color: #1AAD19;
justify-items: flex-end;
}
.city.active{
color: #42A5FF;
background: #E6F3FF;
}
\ No newline at end of file
... ...
... ... @@ -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);
... ...
... ... @@ -14,7 +14,12 @@ 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,
}
\ 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'
// pages/reserve/home.js
Page({
/**
* 页面的初始数据
*/
data: {
history:[],
suggestion:[],
hasSellerMore:false,
keyword:'',
sellerSplit:-1,
navHeight:100,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -41,11 +26,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
PubSub.emit('custom-tab-bar')
this.getHistory();
this.setData({
navHeight:this.selectComponent('#nav').getHeight()
})
},
... ... @@ -62,266 +42,43 @@ 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
})
})
},
//在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:0,
page_size:20,
page_index:1,
key:map_key,
}
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
}
},
})
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
gotoList(){
wx.navigateTo({
url:util.http_build_query({
lat:this.location.latitude,
lng:this.location.longitude,
keyword:this.inputVal,
multiIndex:0,
},'./indexList')
})
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
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')
})
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return{
title:'请客订包间,就上周到安排'
}
},
historyEmpty(){
App.Customer.DelHistorySearch().then(()=>{
App.Customer.GetHistorySearch({},'clear')
this.setData({
history:[]
})
})
dispalySearchHow(){
this.selectComponent('#search-how').show();
},
clearKeyword(){
howEvent(e){
console.log('howEvent',e.detail)
//this.eventChannel.emit('findSellerData',e.detail)
this.findSellerData=e.detail
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);
}
},
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')
findSellerData:e.detail
})
//setTimeout(()=>{this.getList();},0)
this.selectComponent('#search-how').hide();
},
locationEvent(e){
console.log('locationEvent',e.detail)
}
})
\ 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"
}
}
\ 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>
<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 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 class="view flex-treble text-bold text-xl text-cut margin-right-lg">ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</view>
<view class="view flex flex-direction align-center justify-center">
<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>
<view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;" bindtap="dispalySearchHow">
<view class="flex-treble">sss</view>
<view class="more"></view>
</view>
<view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;">
<view class="flex-treble">sss</view>
<view class="more"></view>
</view>
<view class="view flex justify-around align-center" style="height: 110rpx;">
<view class="flex-treble">sss</view>
<view class="more"></view>
</view>
<view class="view flex justify-around align-center round bg-blue-blue text-bold" style="height: 84rpx;">
查找包间
</view>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
<as-phone id="as"></as-phone>
\ No newline at end of file
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<location id="location" bindevent="locationEvent"></location>
\ 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;
/* 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;
}
\ No newline at end of file
... ...