Commit 667cce9a27c0dbeeb2251cd08b6ccafe05fc66d1

Authored by vking
1 parent 2c64e2de

boost + mapmenu + 店铺红包 + 运营找店

... ... @@ -10,6 +10,7 @@
"pages/customer/list",
"pages/customer/remind",
"pages/reserve/index",
"pages/reserve/index_yy",
"pages/me/index",
"pages/me/concat",
"pages/me/setting",
... ... @@ -29,6 +30,7 @@
"pages/reserve/activity",
"pages/reserve/discount",
"pages/reserve/indexList",
"pages/reserve/indexList_yy",
"pages/reserve/share",
"pages/reserve/submit",
"pages/me/history",
... ...
... ... @@ -104,6 +104,16 @@
<view class="more"></view>
</view>
</navigator>
<navigator
url="/pages/reserve/index_yy" open-type="redirect" hover-class="other-navigator-hover">
<view class="item flex-lr">
<view class="item-name flex-ll">
<view class="tuco"></view>
<view>查找餐厅</view>
</view>
<view class="more"></view>
</view>
</navigator>
</view>
</view>
</layout>
\ No newline at end of file
... ...
// pages/reserve/indexList.js
import util from '../../utils/util';
import App from '../../utils/api';
import DA from './data';
const {regeneratorRuntime} = global
import PubSub from '../../utils/PubSub'
Page({
/**
* 页面的初始数据
*/
data: {
multiArray: ['全部菜系'],
multiIndex: [0],
tags:[
{id:1,name:'环境好'},
{id:2,name:'菜品有特色'},
{id:3,name:'超大包间'},
],
markers:[],
hasMore:true,
hasDisabled:true,
hasSuggestion:false,
placeholder:'您好,几位,什么时候',
},
/**
* 生命周期函数--监听页面加载
*/
eventChannel:null,
onLoad: async function (options) {
//lat=34.21719&lng=108.89155&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&multiIndex=1&tags=1,2
this.options=options;
if(options.hasSuggestion){
this.setData({
hasSuggestion:true
})
}
let tags=[
{id:1,name:'环境好'},
{id:2,name:'菜品有特色'},
{id:3,name:'超大包间'},
];
if(options.tags){
let ts=options.tags.split(',');
tags.forEach(t=>{
if(ts._indexOf(t.id)>-1){
t.active=true;
}
})
}
this.setData({
multiArray:[['全部菜系'].concat(await DA.getCates())],
multiIndex:[options.multiIndex],
tags:tags,
})
try{
this.eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
this.eventChannel.on('acceptDataFromMapPage', findSellerData=> {
if(findSellerData){
this.findSellerData=findSellerData
console.log('findSellerData',findSellerData)
this.setData({
findSellerData:findSellerData,
})
}
})
}catch(e){}
setTimeout(()=>{this.getList()},300)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.selectComponent('#getpos').getPos();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getListMore()
},
hasGetSellerEnd:false,
async getList(){
let mapParam=this.options
this.offset=1 //page
this.size=20 //page size
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 map=JSON.parse(mapParam.map);
let lat=map.northeast.latitude-(map.northeast.latitude-map.southwest.latitude)/2;
let 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(mapParam.centre_pos){
this.param.centre_pos=mapParam.centre_pos
}
}
if(this.data.multiIndex[0]>0){
this.param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1);
}
let tags=[];
this.data.tags.forEach(t=>{
if(t.active){
tags.push(t.id)
}
})
if(tags.length>0){
this.param.tags=tags;
}
let placeholder='您好,几位,什么时候';
if(this.findSellerData){
console.log(this.findSellerData)
this.param=Object.assign(this.param,this.findSellerData.paramObj)
//4位 今天 午餐
let sp=this.findSellerData.params
if(sp.pnum.val>30){
placeholder = '30 位以上 '
}else{
placeholder = sp.pnum.val+' 位 '
}
placeholder += util.unixtoTime(sp.date.val,' `DAY/MM-DD` ')
if(sp.dur){
placeholder+=' '+['','早餐','午餐','晚餐','夜宵'][sp.dur.val]
}
}
this.setData({
placeholder:placeholder,
})
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
rsl:[],
hasMore:res.data.length==this.size,
markers:this.sellerFormat(res.data),
hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData)
})
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
this.hasGetSellerEnd=true
if(res.data.length==0 && this.offset==1 && this.location){
this.onpos({detail:this.location})
}
})
},
/**
* @param hasLimit 是否有搜索条件
* @returns {boolean}
*/
getHasDisabled(hasData,hasLimit){
if(this.offset==1 && !hasLimit && !hasData) {
return true
}
return false
},
getListMore(){
this.param.offset+=1;
let markers=this.data.markers;
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
hasMore:res.data.length==this.size,
markers:markers.concat(this.sellerFormat(res.data)),
})
})
},
caixiShow(){
if(this.data.hasDisabled) return
this.selectComponent('#caixi').show();
},
caixiActive(e){
this.bindMultiPickerChange({
detail:{
value:[e.detail]
}
})
PubSub.emit(
'searchParam',
{
fun:'caixiActive',
e:e,
}
)
},
bindMultiPickerChange(e){
console.log(e);
let val=util.val(e);
this.setData({
multiIndex:val
})
setTimeout(()=>{this.getList();},0)
},
tagsChange(e){
if(this.data.hasDisabled) return
let id=util.attr(e,'id');
let tags=this.data.tags;
let activeNum=0;
tags.forEach(t=>{
if(t.id==id){
t.active=!t.active
}
if(t.active){
activeNum++
}
})
this.setData({
tags:tags,
})
PubSub.emit(
'searchParam',
{
fun:'tagsChange',
e:e,
}
)
setTimeout(()=>{this.getList();},0)
},
gotoDetail(e){
wx.navigateTo({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
},
sellerFormat(sellers){
// sellers.forEach((seller) => {
// if(seller.distance || seller.distance===0) {
// seller.distance = parseInt(seller.distance);
// if (seller.distance > 1000) {
// seller.distance = (seller.distance / 1000).toFixed(2) + 'km'
// } else {
// seller.distance += 'm';
// }
// }
// })
sellers.forEach(seller=>{
if(this.findSellerData){
seller.findSellerParamObj=this.findSellerData.paramObj
}
})
return sellers;
},
dispalySearchHow(){
this.selectComponent('#search-how').show();
},
howEvent(e){
this.eventChannel.emit('findSellerData',e.detail)
this.findSellerData=e.detail
this.setData({
findSellerData:e.detail
})
setTimeout(()=>{this.getList();},0)
this.selectComponent('#search-how').hide();
},
location:null,
onpos(e){
console.log('onpos',this.hasGetSellerEnd,e);
this.location=e.detail
if(!this.hasGetSellerEnd){
return setTimeout(()=>{
this.onpos(e)
},500)
}
if(this.data.markers.length<1){
this.GetRecommendSellerList()
}
},
GetRecommendSellerList(){
let param={sid:'sid'}
if(this.location){
param.lat=this.location.latitude
param.lng=this.location.longitude
}
App.Customer.GetRecommendSellerList(param).then(res=>{
this.setData({
rsl:res.data
})
})
},
hasGoto:false,
bindtransition(e){
if('change'==e.type){
this.hasGoto=false
}
if('animationfinish'==e.type){
if(this.hasGoto){
wx.switchTab({
url: '/pages/reserve/index'
})
return;
}else{
this.hasGoto=true
}
}
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
"getpos":"/components/userinfo/getpos",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"caixi":"/components/reserve/caixi",
"search-how":"/components/reserve/search/how/index",
"hr":"/components/hr"
}
}
\ No newline at end of file
... ...
<!--pages/reserve/indexList.wxml-->
<nav>周到安排</nav>
<view class="header">
<!--
<view class="searchAddrView" bindtap="dispalySearchHow">
<view class="searchAddr flex-ll">
<image class="icon" src="http://nosqn.colorcun.com/reserve/images/find-black.png"></image>
<input style="width: 100%;" placeholder="{{placeholder}}"
type="text" disabled
value="{{keyword}}"/>
</view>
</view>
-->
<view class="transverse-search flex-ll {{hasDisabled?'disabled':''}}">
<view
bindtap="caixiShow"
class="tags {{multiIndex[0]>0?'active':''}}"
>
<view class="picker flex-lr">
<view class="input">
<block wx:if="{{multiIndex[0]==0}}">菜系</block>
<block wx:else="">{{multiArray[0][multiIndex[0]]}}</block>
</view>
<view class="more"></view>
</view>
</view>
<block wx:for="{{tags}}" wx:key="tags.key">
<view class="tags {{item.active?'active':''}}"
bindtap="tagsChange"
data-id="{{item.id}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="pages">
<view class="flex-vc empty" wx:if="{{markers.length<1}}">
<block wx:if="{{!hasFirstShow}}">
<image src="http://nosqn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<block wx:if="{{hasDisabled}}">
<view>该地区没有可供预订的餐厅,努力开通中</view>
</block>
<block wx:else="">
<view class="empry-info1">未找到符合要求的餐厅</view>
<view class="empry-info2">修改或减少条件,获取更多餐厅</view>
</block>
<button class="button-none info-button"
open-type="contact">
人工帮订
</button>
</block>
</view>
<block wx:else="">
<view class="follow" >
<view class="seller" wx:for="{{markers}}" wx:key="sellers.key"
bindtap="gotoDetail" data-sid="{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityRed="true"
hasSlogan="{{false}}"
hasSuggestion="{{hasSuggestion}}"
sellerStyle="noborder noshadow noradius"></sb-tr>
</view>
</view>
<hr class="flex-vc nomore" wx:if="{{!hasMore}}" bgColor="#ffffff">我是有底线的</hr>
</block>
</view>
<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
bindactive="caixiActive" id="caixi"
></caixi>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<block wx:if="{{rsl.length>0}}">
<view class="transverse-flxed">
<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="{{10}}px" next-margin="{{10}}px" style="height: 330rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</block>
<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos>
\ No newline at end of file
... ...
/* pages/reserve/indexList.wxss */
.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;
width: 100%;
margin: 0 auto;
font-size: 24rpx;
padding-left: 20rpx;
}
.transverse-search .tags{
height: 50rpx;
line-height: 50rpx;
background-color: #F0F0F9;
border-radius: 4rpx;
margin-right: 30rpx;
padding: 0 16rpx;
}
.transverse-search .tags:last-child{
margin-right: 0;
}
.transverse-search .tags.active{
background-color: #F4DAB9;
color:#8B5318;
font-weight: 900;
}
.picker{
height: 50rpx;
line-height: 50rpx;
}
.picker .input{
height: 50rpx;
line-height: 50rpx;
margin-right: 10rpx;
}
.picker .more{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB.png");
width: 12rpx;
height: 16rpx;
min-width:12rpx;
}
.disabled .tags{
color: #999;
}
.tags.active .picker .more{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
.disabled .picker .more{
background-image: url("http://nosqn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
}
.pages{
width: 100%;
margin: 81rpx auto 0;
color:#fff;
font-size: 28rpx;
}
.follow {
padding-top: 0;
padding-bottom: 10rpx;
}
.follow .seller{
background-color: #ffffff;
overflow: hidden;
border-bottom: 20rpx solid #f5f5f5;
}
.follow .seller:last-child{
border-bottom: 20rpx solid #ffffff;
}
.nomore{
color: #999;
font-size: 28rpx;
width: calc(100% - 36rpx);
margin: 0rpx auto 40rpx;
}
.hr{
height: 2rpx;
width: 90%;
margin: 19rpx auto 0;
}
.empty{margin-top: 151rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty view{
font-size: 28rpx;
margin-top: 60rpx;
}
.empty view.empry-info2{
margin-top: 20rpx;
}
.searchAddrView{
width: 100%;
height: 70rpx;
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: 32rpx;
width:32rpx;
height: 30rpx;
margin: 0 20rpx;
}
.info-button{
width:140rpx;
height:50rpx;
background:rgba(192,163,105,1);
border-radius:25rpx;
font-size:24rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height: 50rpx;
margin-top: 42rpx;
}
.transverse-flxed{
position: fixed;
bottom: 0;
width: 100%;
z-index: 99;
}
.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;
}
.transverse-list{
background-color: #fefefe;
margin-top: 20rpx;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
\ No newline at end of file
... ...
// pages/reservr/index.js
var mta = require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
import DA from './data';
import reddot from '../../utils/reddot';
import PubSub from '../../utils/PubSub'
const {regeneratorRuntime} = global
const mapScale=15//18;
const barHeight=50;
const transverseViewHeight=253+barHeight;
const renNum=function(){
let arr=[]
for(let i=1;i<=30;i++){
arr.push(i+'位')
}
return arr;
}
const cates_version='?1.2';
const hasSellerConcat=false;//变量存储所有商户
const def_latitude=39.684670;
const def_longitude=118.176300;
Page({
/**
* 页面的初始数据
*/
data: {
map: {
latitude: def_latitude+0.0001,
longitude: def_longitude+0.0001,
scale: mapScale,
height: 300,
},
markers: [],
//polygons:{},
//sellers:[],
multiArray: ['全部菜系'],
multiIndex: [0],
//scrollIntoView:'',
suggestion:{},
hasSuggestion:false,//搜索返回
current:0,
hasSellers:false,
hasGetSellersEnd:false,
hasSetActivity:false,
tags:[
{id:1,name:'环境好'},
{id:2,name:'菜品有特色'},
{id:3,name:'超大包间'},
],
listMoreCount:0,
hasSearchLimit:false,
hasGetPos:false,
},
hasClickMoveToLocation:false,//点击回到我的位置
hasSellerConcat:hasSellerConcat,
transverseViewHeight:transverseViewHeight,//横向滚动高度,苹果要比安卓多20
//qqmapsdk:null,
sellers: [],
sellersIds:[],
sellersNow:[],//本次视图内商户
searchAddrTop:50,
user:{
latitude: def_latitude,
longitude: def_longitude,
},
/**
* 生命周期函数--监听页面加载
*/
hasOnLoad:false,
hasGetLocation:false,//定位信息
hasAppHide:false,//app切至后台
param:{},
onLoad: async function (options) {
this.reportTime=new Date()
this.hasOnLoad=true;
// this.qqmapsdk=new QQMapWX({
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
// });
this.setData({
multiArray:[['全部菜系'].concat(await DA.getCates())]
})
mta.Page.init({
"appID": "500667280",
"eventID": "500667287",
"statPullDownFresh": true,
"statShareApp": true,
"statReachBottom": true,
"lauchOpts": options, //渠道分析
});
PubSub.on(
'searchParam',
data=>{
console.log('searchParam.msg',data)
if(data.fun=='tagsChange'){
this.tagsChange(data.e);
}
if(data.fun=='caixiActive'){
this.caixiActive(data.e);
}
}
)
PubSub.on(
'appHide',
data=>{
console.log('appHide');
let pages=getCurrentPages();
if(pages.length==1){//用户停留在首页
this.hasGetLocation=false
this.hasClickMoveToLocation=false
this.hasAppHide=true
}
}
)
reddot.init()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
mapCtx: null,
mapData:{
lat:'',
lng:'',
latitude: 0,
longitude: 0,
scale: 18,
hasRegionchange:false,
region:{
southwest:{},
northeast:{},
},
},
mapDataLast:null,//最后一次成功视角,防止地图视角丢失
onReady: function () {
if (wx.canIUse('reportPerformance')) {
wx.reportPerformance(2002, new Date()-this.reportTime)
}
this.mapCtx = wx.createMapContext('map')
// this.mapCtx.moveToLocation({
// success:(res)=>{
// console.log('moveToLocation',res)
// }
// })
},
/**
* 生命周期函数--监听页面显示
*/
onShow: async function (e) {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 0
})
}
console.log({
'this.hasGetLocation':this.hasGetLocation,
'this.hasOnLoad':this.hasOnLoad,
'this.hasClickMoveToLocation':this.hasClickMoveToLocation,
'this.data.hasSuggestion':this.data.hasSuggestion,
})
this.getClassNameFlag=true;
//this.getPos();
if(this.data.hasSuggestion) return;
if(!this.hasOnLoad && this.hasGetLocation) return;
this.hasOnLoad=false;
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
console.log('systemInfo:',systemInfo)
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if(reg.test(systemInfo.system)){
pt = systemInfo.statusBarHeight;
h = 44;
if(systemInfo.pixelRatio>2){
this.transverseViewHeight=transverseViewHeight+26;
}
}else{
if(/xiaomi/i.test(systemInfo.brand)){
this.transverseViewHeight=transverseViewHeight+15;
}else{
//this.transverseViewHeight=transverseViewHeight+20;
}
pt = systemInfo.statusBarHeight;
h = 48;
}
console.log('onShow',systemInfo,systemInfo.windowHeight,systemInfo.windowHeight-this.transverseViewHeight)
this.setData({
[`map.height`]: systemInfo.windowHeight-this.transverseViewHeight,
statusBarHeight: pt,
titleBarHeight:h,
})
//this.getPos(systemInfo);
this.systemInfo=systemInfo
//this.selectComponent('#getpos').getPos();
if(!this.hasClickMoveToLocation){
//this.getMarkers();
//this.timeoutGetMarkers();
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function (e) {
util.elog(null,'离开地图页')
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
PubSub.off('searchParam')
PubSub.off('appHide')
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return{
title:'请客订包间,就上周到安排'
}
},
onpos(e){
console.log('onpos',e);
let res=e.detail;
if(!res.latitude) return this.timeoutGetMarkers();
this.hasGetLocation=true;
this.sellersIds=[]
this.sellers=[]
let map = this.data.map;
map.latitude = res.latitude;
map.longitude = res.longitude;
map.scale=mapScale;
this.user.latitude = res.latitude;
this.user.longitude = res.longitude;
map.height = this.systemInfo.windowHeight-this.transverseViewHeight
let sdobj={
map: map,
hasSuggestion:false,
}
if(!this.hasSellerConcat){
sdobj.markers=[]
}
this.setData(sdobj)
this.timeoutGetMarkers()
/*
if(this.mapCtx){
//this.mapCtx.moveToLocation();
this.mapCtx.getRegion({
success:(res)=>{
console.log('onpos.getRegion',res)
if(this.mapData.region.southwest.latitude) {
this.mapData.region = res
this.timeoutGetMarkers()
}
},
})
}
*/
},
regionchange(e){
if(e.type!='end') return;
console.log('regionchange', e)
if(typeof this.mapCtx=='undefined' || !this.mapCtx) return;
this.getClassNameFlag=true;
this.mapCtx.getScale({
success: (res) => {
this.mapData.scale = res.scale;
console.log('regionchange.getScale', res, this.data.map.scale)
},
})
this.mapCtx.getCenterLocation({
success:(res)=>{
console.log('regionchange.getCenterLocation',res)
this.mapData.latitude=res.latitude;
this.mapData.longitude=res.longitude;
if(this.mapData.lat=='' && res.latitude.toString().length>6 && res.longitude.toString().length>6){
this.mapData.lat=res.latitude;
this.mapData.lng=res.longitude;
}
},
});
this.mapCtx.getRegion({
success:(res)=>{
console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
this.hasClickMoveToLocation=false
if(res.southwest.latitude) {
this.mapData.region = res
};
this.timeoutGetMarkers();
},
})
},
setTimeoutGetMarkers:'',
timeoutGetMarkers(){//延时获取
if(this.setTimeoutGetMarkers){
clearTimeout(this.setTimeoutGetMarkers);
this.setTimeoutGetMarkers='';
}
this.setTimeoutGetMarkers=setTimeout(()=>{
this.getMarkers();
},300)
},
mapUpdated(e){
console.log('mapUpdated', e)
if(typeof this.mapCtx=='undefined' || !this.mapCtx) return;
this.getClassNameFlag=true;
this.mapCtx.getScale({
success:(res)=>{
this.mapData.scale=res.scale;
console.log('mapUpdated.getScale',res,this.data.map.scale)
},
})
this.mapCtx.getCenterLocation({
success:(res)=>{
console.log('mapUpdated.getCenterLocation',res)
this.mapData.latitude=res.latitude;
this.mapData.longitude=res.longitude;
if(this.mapData.lat=='' && res.latitude.toString().length>6 && res.longitude.toString().length>6){
this.mapData.lat=res.latitude;
this.mapData.lng=res.longitude;
}
},
});
this.mapCtx.getRegion({
success:(res)=>{
if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
this.mapData.region=res
//this.timeoutGetMarkers();
},
})
},
hasMarkertap:false,
markertap(e,flag=true){
if(e.markerId=='location' || e.markerId=='locationMe')return;
this.hasMarkertap=false
let markers=this.data.markers;
console.log('markertap',e)
this.activeSellerID=e.markerId
let bl=1.2;
let current=0,hasCurrent=true;
markers.forEach((m,i)=>{
m.iconPath=m.iconPath.replace('/cates-active/','/cates/')
m.zIndex=m.zIndexBak
if(m.width==20*bl){
m.width=20;
m.height=25;
}
if(m.width==12){
m.width=8;
m.height=8;
}
if(m.callout){
m.callout.borderColor= '#cccccc';
m.callout.bgColor= '#fefefe';
m.callout.color= '#353535';
m.callout.display=m.calloutDisplay;
}
if(m.id==e.markerId){
m.iconPath=m.iconPath.replace('/cates/','/cates-active/')
if(m.width==20){
m.width=20*bl;
m.height=25*bl;
}else{
m.width=12;
m.height=12;
}
m.zIndex=9999
if(m.callout){
m.callout.borderColor= '#F05522';
m.callout.bgColor= '#F05522';
m.callout.color= '#fefefe';
m.callout.display='ALWAYS';
}
hasCurrent=false
if("markertap"==e.type){
util.elog({id:m.seller.id,sellername:m.seller.sellername},'点击地图区域的店铺标记')
}
}
if(m.display!='none' && hasCurrent){
current++
}
})
let obj={
markers:markers,
};
console.log('markertap::current,',current);
if(flag){
//obj.scrollIntoView='seller-'+e.markerId;
obj.current=current;
//this.hasMarkertap=true;
}
this.setData(obj)
},
hasInRegionFlag:false,
hasInRegion(){//定位是否在地图视野内
let map = this.mapData;
if(!map.region.northeast.latitude || !map.region.northeast.longitude) {//未获得视野
if(this.mapDataLast){
this.mapData=this.mapDataLast
}
return {flag:false,msg:'未获得视野',map:map,mapDataLast:this.mapDataLast};
}
if(!map.region.southwest.latitude || !map.region.southwest.longitude) {//未获得视野
if(this.mapDataLast){
this.mapData=this.mapDataLast
}
return {flag:false,msg:'未获得视野',map:map,mapDataLast:this.mapDataLast};
}
this.mapDataLast=JSON.parse(JSON.stringify(this.mapData));
if(this.hasInRegionFlag) return {flag:true,msg:'二次获取'};
if(!this.user.latitude) return {flag:false,msg:'用户无定位'};//用户无定位
//if(this.user.latitude==def_latitude && this.user.longitude==def_longitude) return false;//默认位置
///判断定位 首次 进入视野
if((this.user.latitude>map.region.southwest.latitude
&& this.user.longitude>map.region.southwest.longitude
&& this.user.latitude<map.region.northeast.latitude
&& this.user.longitude<map.region.northeast.longitude) || this.data.hasSuggestion){
this.hasInRegionFlag=true;
return {flag:true,msg:'用户首次或搜索地标'};
}else{
//视野不匹配
this.mapCtx.getRegion({
success:(res)=>{
console.log('hasInRegion.getRegion',res)
this.mapData.region=res
},
})
}
return {flag:false,msg:'视野不匹配'};
},
async getMarkers(){
let cmap=this.data.map;
let map = this.mapData;
//console.log('getMarkers',map.region);
let region=this.hasInRegion();
console.log('this.hasInRegion',region)
if(!region.flag) {
return setTimeout(()=>{
this.getMarkers();
},300)
}
let markers = [];
let param={
lat: this.user.latitude==def_latitude?'':this.user.latitude,
lng: this.user.longitude==def_longitude?'':this.user.longitude,
offset: 0,
rows: 50,
distance: 100000,
map:JSON.stringify({...this.mapData.region,scale:this.mapData.scale>=19?20:this.mapData.scale})
}
if(this.data.multiIndex[0]>0){
param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1);
}
let tags=[];
this.data.tags.forEach(t=>{
if(t.active){
tags.push(t.id)
}
})
if(tags.length>0){
param.tags=tags;
}
if(param.lat){
param.centre_pos=`${param.lat},${param.lng}`
}else{
let lat=(this.mapData.region.southwest.latitude+this.mapData.region.northeast.latitude)/2
let lng=(this.mapData.region.southwest.longitude+this.mapData.region.northeast.longitude)/2
param.centre_pos=`${lat},${lng}`
}
if(this.data.hasSuggestion){
param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
}
if(this.findSellerData){
param=Object.assign(param,this.findSellerData.paramObj)
}
this.selectComponent('#list').getList(param);
this.param=param;
let now_sid=[];
App.Customer.SellerList(param).then(async res => {
//this.mapData.region.southwest.latitude='';
if (res.ret == 200) {
let sellersList=res.data;
let sellersLength=sellersList.length;
sellersList.forEach((seller,si) => {
now_sid.push(seller.id);
let hasMark=false;
if(this.sellersIds._indexOf(seller.id)<0){
// if(seller.distance || seller.distance===0){
// seller.distance=parseInt(seller.distance);
// if(seller.distance>1000){
// seller.distance=(seller.distance/1000).toFixed(2)+'km'
// }else{
// seller.distance+='m';
// }
// }
if(this.hasSellerConcat){
this.sellersIds.push(seller.id);
}
hasMark=true;
}
if(hasMark){
if(this.findSellerData){
seller.findSellerParamObj=this.findSellerData.paramObj
}
let marker={
id: seller.id,
iconPath: "http://nosqn.colorcun.com/custom/lite-online/cates/circle1x5.png"+cates_version,
latitude: seller.lat,
longitude: seller.long,
width: 8,
height: 8,
//title:seller.seller_name,
zIndex:sellersLength-si,
zIndexBak:sellersLength-si,
seller:seller,
};
marker.callout={
content: ' ' + seller.sellername + ' ',
color: '#353535',
fontSize: 12,
borderWidth: 1,
borderColor: '#cccccc',
borderRadius: 50,
bgColor: '#fefefe',
padding: 5,
textAlign: 'left',
display:'BYCLICK',
};
marker.calloutDisplay='BYCLICK';
if(seller.mode.length>0){
seller.mode.forEach(x=>{
if(x.id==1){//大图标
marker.iconPath="http://nosqn.colorcun.com/custom/lite-online/cates/其他菜品.png";
if(seller.cate.length>0){
marker.iconPath=seller.cate[0].icon
}
marker.iconPath=marker.iconPath.replace(/\/cates\/(.*)\.png/,function ($0,$1) {
return '/cates/'+encodeURI($1)+'.png'
})
marker.iconPath+=cates_version
marker.width=20;
marker.height=25;
}
if(x.id==2){//商家名
marker.callout.display='ALWAYS';
marker.calloutDisplay='ALWAYS';
}
})
}
markers.push(marker)
}
})
} else {
console.log('接口报错了');
}
this.sellersNow=now_sid;
let obj={
hasSellers:now_sid.length>0,
hasGetSellersEnd:true,
hasSearchLimit:(tags.length>0 || this.data.multiIndex[0]>0) || this.findSellerData
}
if(this.hasSellerConcat){
obj.markers=this.data.markers.concat(markers);
}else{
obj.markers=markers;
}
obj.markers.forEach(mk=>{
//mk.display='none';
if(now_sid._indexOf(mk.id)>-1){
mk.display='';
}
})
obj.markers=await this.setLocationMarker(obj.markers);
this.setData(obj)
if(now_sid.length>0) {
setTimeout(() => {
this.markertap({
markerId: now_sid._indexOf(this.activeSellerID) < 0?now_sid[0]:this.activeSellerID
}, true)
}, 100)
}
this.IsSetActivity();
})
},
//seller box 通知
sellerBoxEvent(e){
wx.showTabBar();
},
moveToLocation(){
this.hasClickMoveToLocation=true
if(this.user.latitude==def_latitude && this.user.longitude==def_longitude){
this.selectComponent('#getpos').getPos(true);
return;
}
this.sellersIds=[]
this.sellers=[]
let map = this.data.map;
map.latitude = this.user.latitude;
map.longitude = this.user.longitude;
map.scale=mapScale;
map.height = this.systemInfo.windowHeight-this.transverseViewHeight
let sdobj={
map: map,
hasSuggestion:false,
hasGetSellersEnd:false,
}
if(!this.hasSellerConcat){
sdobj.markers=[]
}
this.setData(sdobj)
this.mapCtx.moveToLocation({
success:(res)=>{
console.log('moveToLocation',res)
}
})
},
bindMultiPickerChange(e){
console.log(e);
let val=util.val(e);
this.setData({
multiIndex:val
})
this.hasSellerConcat=hasSellerConcat;
this.sellersIds=[];
if(val[0]>0){
this.hasSellerConcat=false;
}else{
if(!this.hasSellerConcat){
this.setData({
markers:[]
})
}
}
setTimeout(()=>{this.getMarkers();},0)
},
setSuggestion(suggestion){
let map=this.data.map;
//let pos=DA.gcj02towgs84(suggestion.longitude,suggestion.latitude)
map.latitude=suggestion.latitude
map.longitude=suggestion.longitude
if(suggestion.type==-1){//平台商户
this.activeSellerID=suggestion.id
map.scale=20
}else{
map.scale=mapScale
}
this.sellersIds=[]
this.sellers=[]
let sdobj={
map: map,
hasSuggestion:true,
suggestion:suggestion,
hasGetSellersEnd:false,
}
if(!this.hasSellerConcat){
sdobj.markers=[]
}
//this.findSellerData=null//清理搜索
this.setData(sdobj)
},
getClassNameFlag:true,
activeSellerID:'',
bindscroll(e){
if(!this.getClassNameFlag) return;
this.getClassNameFlag=false;
let w=e.detail.scrollWidth/this.sellers.length;
let i=Math.round(e.detail.scrollLeft/w);
console.log(e.detail,this.sellers,i);
if(this.activeSellerID!=this.sellers[i].id){
this.activeSellerID=this.sellers[i];
this.markertap({
markerId:this.sellers[i].id
},false)
}
let that=this;
setTimeout(function(){
that.getClassNameFlag=true;
},300)
},
bindtransition(e){
if(this.hasMarkertap){
this.hasMarkertap=false;
return;
}
let i=e.detail.current
if(typeof this.data.markers[i]=='undefined') return;
this.activeSellerID=this.data.markers[i].id
console.log('bindtransition',this.sellersNow,e.detail.current,this.sellersNow[e.detail.current],this.activeSellerID);
// this.activeSellerID=this.sellersNow[i];
// this.markertap({
// markerId:this.activeSellerID
// },false)
this.markertap({
markerId:this.activeSellerID
},false)
},
gotoDetail(e){
wx.navigateTo({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
util.elog({sid:util.attr(e,'sid')},'点击橱窗中的商家,进入店铺详情')
},
IsSetActivity(){
let cmap=this.data.map;
App.Customer.IsSetActivity({lat:cmap.latitude,lng:cmap.longitude,distance:50}).then(res=>{
this.setData({
hasSetActivity:res.data==1,
})
})
},
a2lshow(e){
//console.log('a2lshow',e)
let ds=this.selectComponent('#ds');
if(!ds){
return setTimeout(()=>{
this.a2lshow(e)
},500)
}
ds.setA2LHeight(e.type=='hide'?0:40);
},
async setMapRegion(){
return new Promise((success,fail)=>{
if(this.mapCtx){
this.mapCtx.getRegion({
success:(res)=>{
if(res.southwest.latitude) {
this.mapData.region = res
success()
}
},
fail:()=>{
fail()
}
})
}else{
fail()
}
})
},
async setLocationMarker(markers){
try{
await this.setMapRegion();
}catch (e){
this.timeoutGetMarkers()
return []
}
let map = this.mapData;
let mks=[]
let matchPosNum=1
if(markers.length>0){
markers.forEach(mk=>{
if(mk.id!='location' && mk.id!='locationMe'
&& mk.latitude>map.region.southwest.latitude
&& mk.longitude>map.region.southwest.longitude
&& mk.latitude<map.region.northeast.latitude
&& mk.longitude<map.region.northeast.longitude){
mks.push(mk);
}
})
}
if(mks.length-markers.length<0){
this.timeoutGetMarkers()
return []
}
if(this.data.hasSuggestion){
map=this.data.suggestion
mks.push({
id: 'location',
iconPath: "http://nosqn.colorcun.com/reserve/images/location.png"+cates_version,
latitude: map.latitude,
longitude: map.longitude,
width: 20,
height: 25,
})
}
mks.push({
id: 'locationMe',
iconPath: "http://nosqn.colorcun.com/reserve/images/lme.png"+cates_version,
latitude: this.user.latitude,
longitude: this.user.longitude,
width: 18,
height: 30,
})
return mks;
},
tagsChange(e){
if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
let id=util.attr(e,'id');
let tags=this.data.tags;
let activeNum=0;
tags.forEach(t=>{
if(t.id==id){
t.active=!t.active
}
if(t.active){
activeNum++
}
})
this.setData({
tags:tags,
})
this.hasSellerConcat=hasSellerConcat;
this.sellersIds=[];
if(activeNum>0){
this.hasSellerConcat=false;
}else{
if(!this.hasSellerConcat){
this.setData({
markers:[]
})
}
}
setTimeout(()=>{this.getMarkers();},0)
},
caixiActive(e){
console.log('caixiActive',e);
this.bindMultiPickerChange({
detail:{
value:[e.detail]
}
})
},
caixiShow(){
if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
this.selectComponent('#caixi').show();
},
listEvent(e){
let d=e.detail
console.log('listEvent',e);
if(d.type=="getListEnd"){
this.setData({
listMoreCount:d.total
});
}else if(d.type=='caixiShow'){
this.caixiShow();
}else if(d.type=='tagsChange'){
this.tagsChange(d.e);
}
},
listShow(){
//this.selectComponent('#list').show();
wx.navigateTo({
url:util.http_build_query({
lat:this.param.lat==def_latitude?'':this.param.lat,
lng:this.param.lng==def_longitude?'':this.param.lng,
map:this.param.map,
multiIndex:this.data.multiIndex,
tags:this.param.tags,
centre_pos:this.param.centre_pos,
hasSuggestion:this.data.hasSuggestion?1:''
},'./indexList'),
success: res=> {
// 通过eventChannel向被打开页面传送数据
if(this.findSellerData){
res.eventChannel.emit('acceptDataFromMapPage', this.findSellerData)
}
res.eventChannel.on('findSellerData',findSellerData=>{
console.log('findSellerData',findSellerData)
this.findSellerData=findSellerData
setTimeout(()=>{this.getMarkers();},0)
})
}
});
},
setTSLocal(){
let map=this.data.map;
map.latitude=def_latitude
map.longitude=def_longitude
map.scale=mapScale
this.sellersIds=[]
this.sellers=[]
let sdobj={
map: map,
hasGetSellersEnd:false,
hasSuggestion:false,
suggestion:{},
}
if(!this.hasSellerConcat){
sdobj.markers=[]
}
this.setData(sdobj)
},
findSellerData:null,
findSeller(){
if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
wx.navigateTo({
url: './findSeller',
success: res=> {
// 通过eventChannel向被打开页面传送数据
if(this.findSellerData){
res.eventChannel.emit('acceptDataFromMapPage', this.findSellerData)
}
res.eventChannel.on('findSellerData',findSellerData=>{
console.log('findSellerData',findSellerData)
this.findSellerData=findSellerData
setTimeout(()=>{this.getMarkers();},0)
})
}
})
},
boostEvent(e){
util.elog(e.detail,'强提醒')
if(e.detail.act=='hide'){
this.setData({
hasGetPos:true,
})
this.selectComponent('#getpos').getPos();
}
},
elog(e){
util.elog({attr:util.attr(e),detail:e.detail},util.attr(e,'ename')||'点击')
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"周到安排",
"usingComponents": {
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
"getpos":"/components/userinfo/getpos",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"a2l":"/components/tips/add-to-lite",
"boost":"/components/tips/boost",
"caixi":"/components/reserve/caixi",
"list":"/components/reserve/seller-box-transverse-cview/list",
"activity-enter":"/components/activity/enter"
}
}
\ No newline at end of file
... ...
<!--pages/reservr/index.wxml-->
<view class="pages">
<view class="flex-vc map">
<map id="map" scale="{{map.scale}}"
longitude="{{map.longitude}}" latitude="{{map.latitude}}"
markers="{{markers}}" polygons="{{polygons}}"
bindmarkertap="markertap"
bindcallouttap="markertap"
bindregionchange="regionchange"
bindupdated="mapUpdated"
show-location="{{false}}"
enable-3D="{{false}}"
enable-zoom
enable-scroll
enable-rotate
subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ"
layer-style="2"
style="width: 100%; height: {{map.height}}px;"></map>
</view>
<view class="seller-view">
<!--
<view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}">
<view class="line"></view>
<view class="text">
<view>{{hasSellers?'查看其它':'已扩大范围为你找到'}}{{listMoreCount}}家餐厅</view>
</view>
</view>
-->
<navigator url="./search"
bindtap="elog" data-ename="点击搜索框" hover-class="navigator-hover">
<view class="flex-ll transverse-view-search">
<view class="searchAddr flex-ll">
<image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image>
<view class="title">{{hasSuggestion?suggestion.title:'输入餐厅名或地名,快速订包间'}}</view>
</view>
<view class="searchList flex-tb" catchtap="listShow">
<image class="icon" src="http://nosqn.colorcun.com/mapmenu/maplist.png"></image>
<view class="title">列表模式</view>
</view>
</view>
</navigator>
<view class="transverse-search flex-ll">
<view
bindtap="caixiShow"
class="tags {{multiIndex[0]>0?'active':''}}"
>
<view class="picker flex-lr">
<view class="input">
<block wx:if="{{multiIndex[0]==0}}">菜系</block>
<block wx:else="">{{multiArray[0][multiIndex[0]]}}</block>
</view>
<view class="more"></view>
</view>
</view>
<block wx:for="{{tags}}" wx:key="tagskey">
<view class="tags {{item.active?'active':''}}"
bindtap="tagsChange"
data-id="{{item.id}}">{{item.name}}</view>
</block>
<!--
<view class="fingSeller flex-ll" bindtap="findSeller">
<view class="icon"></view>
<view>查找餐厅</view>
</view>
-->
</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" hidden="{{!hasSellers}}">
<block wx:for="{{markers}}" wx:key="markerskey" wx:if="{{item.id!='location' && item.id!='locationMe'}}">
<swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.display!='none'}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item.seller}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityRed="true"
hasSuggestion="{{hasSuggestion}}"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
<swiper-item bindtap="gotoDetail2" wx:if="{{hasGetSellersEnd}}">
<view class="seller seller-last" id="seller-last">
<view class="empty">
<view class="info">
<view class="info-msg Semibold">缩放地图发现更多餐厅</view>
<view class="info-txt">往任意方向拖动地图,可搜索不同范围</view>
</view>
<view class="icon"></view>
</view>
</view>
</swiper-item>
</swiper>
<view class="empty-txt flex-vc">
<view class="seller" wx:if="{{hasGetSellersEnd}}">
<view class="empty">
<view class="info" wx:if="{{listMoreCount>0}}" bindtap="listShow">
<view class="info-msg Semibold" style="margin-top: 58rpx;">已扩大范围为你找到餐厅</view>
<view class="info-txt">当前范围没有找到符合条件的餐厅</view>
<view class="info-button flex-lr" style="display: flex;margin-top: 50rpx;margin-left: 0;">
<view>去挑选</view>
<view class="info-button-gt"></view>
</view>
</view>
<view class="info" wx:elif="{{hasSearchLimit}}">
<view class="info-msg Semibold" style="margin-top: 58rpx;">未找到符合要求的餐厅</view>
<view class="info-txt">修改或减少条件,获取更多餐厅</view>
<button class="button-none flex-lr info-button"
style="display: flex;margin-top: 50rpx;margin-left: 0;"
open-type="contact">
<view>人工帮订</view>
<view class="info-button-gt"></view>
</button>
</view>
<view class="info" wx:else="" bindtap="setTSLocal">
<view class="info-msg Semibold">你可以切换到其他城市看看</view>
<view class="info-button full flex-lr">
<view>唐山市</view>
<view class="info-button-gt"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view bindtap="moveToLocation" class="moveToLocation">
<image src="http://nosqn.colorcun.com/reserve/images/golocal.png"></image>
</view>
<view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit && markers.length<2}}">该地区没有可供预订的餐厅哦!努力开通中</view>
<view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</view>
<getpos bindpos="onpos" id="getpos"></getpos>
<seller-box id="seller-box" bindevent="sellerBoxEvent"></seller-box>
<cover-view class="tab-patch"></cover-view>
<a2l bindshow="a2lshow" bindhide="a2lshow" key="INDEX"></a2l>
<list id="list" bindevent="listEvent"
multiArray="{{multiArray}}" multiIndex="{{multiIndex}}" tags="{{tags}}"></list>
<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
bindactive="caixiActive" id="caixi"
></caixi>
<activity-enter hasInHome wx:if="{{hasGetPos}}"></activity-enter>
<boost bindevent="boostEvent"></boost>
\ No newline at end of file
... ...
/* pages/reservr/index.wxss */
page{
background-color: #efefef;
--barHeight: calc(98rpx + env(safe-area-inset-bottom));
}
.pages{
width: 100%;
margin: 0 0 0;
color:#353535;
}
.map{
}
.tab-patch{
position: fixed;
background-color: #fefefe;
height: 20rpx;
width: 100%;
bottom: -120rpx;
}
.moveToLocation{
position: fixed;
bottom: calc(520rpx + var(--barHeight));
right: 20rpx;
width: 62rpx;
height: 62rpx;
}
.moveToLocation image{
width: 62rpx;
height: 62rpx;
}
.transverse-view{
position: relative;
height: 464rpx;
width: 100%;
background-color: #fefefe;
overflow: hidden;
}
.transverse-list{
background-color: #fefefe;
/*height: 264rpx;*/
width: 100%;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
.transverse-list .seller .empty{
height: 300rpx;
overflow: hidden;
color: #353535;
width: 86%;
border: 2rpx solid #E0E0E0;
border-left: 6rpx solid #F05522;
border-radius: 6rpx;
box-shadow: 0 4rpx 8rpx 0 #E0E0E0;
position: relative;
}
.transverse-list .seller-last .empty{
width: 99%;
}
.seller .empty .info{
height: 124rpx;
font-size: 28rpx;
margin-left: 34rpx;
margin-top: 88rpx;
}
.seller .empty .info .info-msg{
font-size: 32rpx;
color:#F05522;
margin-bottom: 40rpx;
height: 44rpx;
line-height: 44rpx;
}
.info-txt{
line-height: 40rpx;
height: 40rpx;
}
.seller .empty .icon{
background-image: url("http://nosqn.colorcun.com/reserve/images/hasClick.png");
background-size: 100% 100%;
width: 54rpx;
height: 56rpx;
position: absolute;
top:82rpx;
right:40rpx;
}
.seller-last .empty .icon{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E7%BC%A9%E6%94%BE.png");
background-size: 100% 100%;
width: 98rpx;
height: 76rpx;
position: absolute;
top:40rpx;
right:68rpx;
}
.picker{
height: 50rpx;
line-height: 50rpx;
}
.picker .input{
height: 50rpx;
line-height: 50rpx;
margin-right: 10rpx;
}
.picker .more{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB.png");
width: 12rpx;
height: 16rpx;
min-width:12rpx;
}
.disabled .tags{
color: #999;
}
.enabled .tags{
color: #353535;
}
.disabled .fingSeller{
color: #999;
}
.disabled .fingSeller .icon{
position: relative;
background: none;
}
.disabled .fingSeller .icon:after{
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: url('http://nosqn.colorcun.com/reserve/images/find-black.png');
background-size: 100% 100%;
opacity: 0.5;
}
.enabled .fingSeller,.fingSeller{
height: 70rpx;
line-height: 70rpx;
width: 172rpx;
box-shadow:-12rpx 0 10rpx -8rpx rgba(178,177,177,0.5);
box-sizing: border-box;
padding-left: 28rpx;
font-weight:600;
color:rgba(240,85,34,1);
}
.enabled .fingSeller .icon,.fingSeller .icon{
width: 32rpx;
height: 30rpx;
margin-right: 6rpx;
background-image: url("http://nosqn.colorcun.com/reserve/images/find.png");
background-size: 100% 100%;
}
.enabled .fingSeller .icon:after{
opacity: 0;
background:none;
}
.tags.active .picker .more{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
.disabled .picker .more{
background-image: url("http://nosqn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
}
.enabled .picker .more{
background-image: url("http://nosqn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
}
.searchAddr {
margin-left: 15rpx;
width: 400rpx;
height: 64rpx;
background-color: #fefefe;
line-height: 64rpx;
font-weight:400;
color:rgba(153,153,153,1);
font-size: 28rpx;
border-radius:32rpx;
border:2rpx solid rgba(204,204,204,1);
width: 100%;
box-sizing: border-box;
}
.searchAddr .icon{
min-width: 22rpx;
width: 22rpx;
height: 22rpx;
margin: 0 10rpx 0 40rpx;
}
.searchAddr .title{
line-height: 60rpx;
height: 60rpx;
overflow: hidden;
width: 100%;
text-align: left;
}
.searchList{
margin-left: 30rpx;
width:72rpx;
min-width: 72rpx;
align-items: center;
}
.searchList .icon{
width:40rpx;
height:36rpx;
margin-bottom: 4rpx;
}
.searchList .title{
height:26rpx;
font-size:18rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(192,163,105,1);
line-height:26rpx;
}
.empty-txt{
height: 300rpx;
line-height: 300rpx;
font-size: 34rpx;
}
.empty-txt .seller{
}
.empty-txt .seller .empty{
background-image: url("http://nosqn.colorcun.com/reserve/images/empty-seller.png");
background-size: 100% 100%;
border-left-width: 0;
margin: 0 auto;
width: 90%;
}
.empty-txt .seller .empty .info{
margin-top: 52rpx;
margin-left: 30rpx;
}
.empty-txt .seller .empty .info .info-msg{
margin-bottom: 14rpx;
font-size: 34rpx;
margin-top: 78rpx;
height: 48rpx;
line-height: 48rpx;
}
.empty-txt .seller .empty .info .info-txt{
font-size: 24rpx;
}
.info-button{
border: 2rpx solid #F05522;
border-radius: 28rpx;
height: 56rpx;
line-height: 56rpx;
padding: 0 20rpx;
color: #F05522;
font-size: 28rpx;
min-width: 146rpx;
max-width: 170rpx;
box-sizing: border-box;
}
.info-button-gt{
background-image: url("http://nosqn.colorcun.com/reserve/images/gt-cheng.png");
background-size: 100% 100%;
width: 10rpx;
height: 20rpx;
}
.info-button.full{
background-color: #F05522;
color:#fefefe;
}
.info-button.full .info-button-gt{
background-image: url("http://nosqn.colorcun.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925175650.png");
}
.transverse-search .tags{
height: 50rpx;
line-height: 50rpx;
background-color: #F0F0F9;
border-radius: 4rpx;
margin-right: 30rpx;
padding: 0 16rpx;
}
.transverse-search .tags:last-child{
margin-right: 0;
}
.transverse-search .tags.active{
background:linear-gradient(to bottom ,#F4DAB9,#E9BE94);
color:#8B5318;
font-weight: 900;
}
/* seller-view start*/
.seller-view{
position:fixed;
bottom: calc(0rpx + var(--barHeight));
width: 100%;
background-color: #fefefe;
border-radius: 20rpx 20rpx 0 0;
box-shadow: -4rpx 0 4rpx 2rpx #C5C1C1;
overflow: hidden;
padding: 30rpx 0 20rpx;
height: 506rpx;
box-sizing: border-box;
}
.seller-view.disabled{
height: 410rpx;
}
.transverse-view-top{
height: 58rpx;
overflow: hidden;
background-color:#FFFFFF;
border-radius: 20rpx 20rpx 0 0;
position: fixed;
width: 100%;
}
.transverse-view-top .line{
height: 6rpx;
width: 70rpx;
margin-top: 14rpx;
background-color: #E0E0E0;
}
.transverse-view-top .text{
height: 34rpx;
line-height: 34rpx;
font-size: 24rpx;
color: #999999;
margin-top: 6rpx;
}
.transverse-search{
background-color: #fefefe;
height: 90rpx;
font-size: 24rpx;
padding-left: 40rpx;
line-height: 90rpx;
}
.disabled .transverse-search{
padding-top: 0;
}
.toast{
background-color: #000;
width: calc(100% - 272rpx);
position: fixed;
bottom:calc(520rpx + var(--barHeight));
color: #fefefe;
height:60rpx;
font-size:26rpx;
line-height:60rpx;
left: 136rpx;
text-align: center;
border-radius:30rpx;
opacity:0.64;
}
.disabled .toast{
background-color: #000;
width: calc(100% - 72rpx);
position: fixed;
bottom:calc(430rpx + var(--barHeight));
color: #fefefe;
height:60rpx;
font-size:26rpx;
line-height:60rpx;
left: 36rpx;
text-align: center;
border-radius:30rpx;
opacity:0.64;
}
.transverse-view-search{
width:100%;
height:66rpx;
padding: 0 20rpx;
background:rgba(254,254,254,1);
box-sizing: border-box;
}
\ No newline at end of file
... ...