Commit d23c612b334c99a4d622721b22bde11dd614fc6a

Authored by vking
1 parent cf91655e

new 2.0

... ... @@ -3625,6 +3625,10 @@ scroll-view.cu-steps .cu-item {
background-image: var(--gradualBlue);
color: var(--white);
}
.bg-blue-blue{
background: linear-gradient(90deg, #3BBFF5 0%, #57A0FF 100%);
color: var(--white);
}
.shadow[class*="-red"] {
box-shadow: var(--ShadowSize) var(--redShadow);
... ...
... ... @@ -7,6 +7,7 @@ Component({
*/
properties: {
height:Number,
disabled:Boolean,
},
/**
... ... @@ -54,6 +55,7 @@ Component({
this.hide()
},
caixiShow() {
if(this.data.disabled) return;
if(this.data.caixiOpened){
this.selectComponent('#caixi').hide();
this.setData({
... ... @@ -69,6 +71,7 @@ Component({
}
},
filterShow() {
if(this.data.disabled) return;
if(this.data.filterOpened){
this.selectComponent('#filter').hide();
this.setData({
... ... @@ -110,6 +113,7 @@ Component({
this.hide()
},
tagsChange(e) {
if(this.data.disabled) return;
let id = util.attr(e, 'id');
let tags = this.data.tags;
let tagsIds=[];
... ...
... ... @@ -31,6 +31,7 @@ Component({
*/
methods: {
getPos(fouce=false){
console.log('getPos')
this._getPos().then(res => {
console.log('wx.getLocation.then', res);
failCount=0;
... ...
... ... @@ -3,7 +3,7 @@ import util from '../../utils/util';
import App from '../../utils/api';
import PubSub from '../../utils/PubSub'
const {regeneratorRuntime} = global
const mapScale = 15//18;
const mapScale = 18//15//18;
const def_latitude = 39.684670;
const def_longitude = 118.176300;
const cates_version = '?1.2';
... ... @@ -11,6 +11,7 @@ Page({
data:{
map:{},
height:1000,
hasLoading:true,
},
user:{},
/**
... ... @@ -73,13 +74,25 @@ Page({
}
this.setData(sdobj)
},
setLoacl(e){
let pos=util.attr(e,'val').split(',');
let map = this.data.map
map.latitude = pos[0];
map.longitude = pos[1];
this.setData({
map:map
})
},
reduceMapScale(){
let map = this.data.map
map.scale=parseInt(map.scale)-1
this.setData({
map:map
})
},
moveToLocation() {
console.log('moveToLocation')
if (!this.user.latitude) {
console.log('moveToLocation')
this.selectComponent('#getpos').getPos(true);
return;
}
this.selectComponent('#getpos').getPos(true);
},
debounceTimer:null,
debounce(func,wait){
... ... @@ -129,6 +142,9 @@ Page({
sellers:[],
getSellers(){
console.log('getSellers',this.mapScale,this.mapData)
this.setData({
hasLoading:true,
})
let param = {
lat: this.user.latitude == def_latitude ? '' : this.user.latitude,
lng: this.user.longitude == def_longitude ? '' : this.user.longitude,
... ... @@ -144,14 +160,18 @@ Page({
let lng = (this.mapData.region.southwest.longitude + this.mapData.region.northeast.longitude) / 2
param.centre_pos = `${lat},${lng}`
}
this.hasFilterData=false
if(this.filterGroupData.tags){
param.tags = this.filterGroupData.tags;
this.hasFilterData=true
}
if (this.filterGroupData.cuisine) {
param.cuisine = this.filterGroupData.cuisine;
this.hasFilterData=true
}
if(this.filterGroupData.average){
param.average = this.filterGroupData.average;
this.hasFilterData=true
}
this.param = param;
App.Customer.SellerList(param).then(async res => {
... ... @@ -207,8 +227,8 @@ Page({
iconPath: "http://nosqn.colorcun.com/2.0/home%20%288%29.png" + cates_version,
latitude: (this.user.latitude||def_latitude)+'',
longitude: (this.user.longitude||def_longitude)+'',
width: 15,
height: 29,
width: 25,
height: 41,
zIndex: 9999,
zIndexBak:9999,
})
... ... @@ -221,6 +241,9 @@ Page({
makeSellers(){
this.setData({
sellers:this.sellers,
hasSellers:(this.hasSellers==1 || this.sellers.length>0) || this.hasFilterData,
hasLoading:false,
hasFilterData:this.hasFilterData,
})
},
makeDefMarker(){
... ...
... ... @@ -7,6 +7,7 @@
"a2l":"/components/tips/add-to-lite",
"filter-group":"/components/2.0/filter/filter-group",
"seller-card":"/components/2.0/seller/card",
"chatbot":"/components/userinfo/chatbot",
"as-phone":"/components/actionSheet/phone"
}
}
\ No newline at end of file
... ...
... ... @@ -15,22 +15,60 @@
layer-style="2"
style="width: 100%; height: 360rpx;"></map>
<view class="view content" style="height: {{height}}px;">
<filter-group height="{{height}}" bindevent="filterGroupEvent"></filter-group>
<filter-group height="{{height}}" bindevent="filterGroupEvent" disabled="{{sellers.length<1 && !hasFilterData}}"></filter-group>
<scroll-view class="view scroll-view" scroll-y="true"
scroll-into-view="seller-{{activeSellerID}}"
scroll-with-animation
bindscroll="scroll" style="width:100%;height: {{height-50}}px;">
<block wx:for="{{sellers}}" wx:key="sellers">
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
<seller-card class="seller-card" id="seller-{{item.id}}"
activeSellerID="{{activeSellerID}}"
seller="{{item}}" ></seller-card>
</navigator>
<view class="view flex flex-direction justify-center align-center" wx:if="{{hasLoading}}">
<image class="view" src="http://nosqn.colorcun.com/2.0/timg.gif" style="width: 40rpx;height: 40rpx;margin-top: 260rpx;"></image>
<view class="view bg-white text-sm margin-top">包间查找中,请稍后…</view>
</view>
<block wx:else="">
<block wx:if="{{sellers.length>0}}">
<block wx:for="{{sellers}}" wx:key="sellers" >
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
<seller-card class="seller-card" id="seller-{{item.id}}"
activeSellerID="{{activeSellerID}}"
seller="{{item}}" ></seller-card>
</navigator>
</block>
</block>
<block wx:else="">
<view class="view flex flex-direction justify-center align-center empty-box margin-sm" wx:if="{{!hasSellers}}">
<view class="view text-lg">该地区没有可提供服务的餐厅</view>
<view class="view" style="margin-top: 16rpx;">您可以切换到其他城市看看</view>
<view style="margin-top: 80rpx;"
bindtap="setLoacl" data-val="39.684670,118.176300"
class="cu-btn round view text-def text-white bg-blue-blue">去唐山市</view>
</view>
<view class="view flex flex-direction justify-center align-center empty-box margin-sm" wx:elif="{{hasFilterData}}">
<view class="view text-lg">未找到符合要求的餐厅</view>
<view class="view" style="margin-top: 16rpx;">修改或减少条件,获得更多餐厅</view>
<chatbot>
<view style="margin-top: 80rpx;"
bindtap="setLoacl" data-val="39.684670,118.176300"
class="cu-btn round view text-def text-white bg-blue-blue">人工抢订</view>
</chatbot>
</view>
<view class="view flex flex-direction justify-center align-center empty-box empty-box-move margin-sm"
wx:else="">
<view class="view flex text-df tips align-center text-orange">
<view class="view icon"></view>
<view class="view">往任意方向拖动地图,可查找不同范围的餐厅</view>
</view>
<view class="view text-lg">地图显示范围无餐厅</view>
<view style="margin-top: 80rpx;"
bindtap="reduceMapScale" data-val="39.684670,118.176300"
class="cu-btn round view text-def text-white bg-blue-blue">扩大搜索范围</view>
</view>
</block>
</block>
<view class="view" style="height: 192rpx;"></view>
</scroll-view>
</view>
<getpos bindpos="onpos" id="getpos"></getpos>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<view bindtap="moveToLocation" class="view moveToLocation flex align-center justify-center">
<image class="moveToLocation-image" src="http://nosqn.colorcun.com/2.0/home%20%2811%29.png"></image>
</view>
... ...
... ... @@ -41,4 +41,29 @@ page{
box-shadow: 0rpx 0rpx 20rpx 0rpx #E5E5E5;
border-radius: 40rpx 40rpx 0rpx 0rpx;
overflow: hidden;
}
.empty-box{
height: 416rpx;
background: #FFFFFF;
box-shadow: 0px 0px 30rpx 0px #E5E5E5;
border-radius: 20rpx;
}
.empty-box-move{
position: relative;
}
.empty-box-move .tips{
position: absolute;
width:100%;
height: 64rpx;
background: #FDF9F5;
border-radius: 20rpx 20rpx 0px 0px;
top:0;
left:0;
}
.empty-box-move .tips .icon{
background-image: url("http://nosqn.colorcun.com/2.0/home%20%289%29.png");
width:42rpx;
height:36rpx;
margin-left: 44rpx;
margin-right: 20rpx;
}
\ No newline at end of file
... ...