Commit 9251ed7682dcd7113349926cc8ed1eb8a1629064

Authored by wangfan
1 parent 1fd35486

c端预定

... ... @@ -17,8 +17,6 @@ Component({
* 组件的初始数据
*/
data: {
hasShow:false,
se:{},
},
attached(){
this.init()
... ...
<!--components/showModal/showModal.wxml-->
<view class="seller flex-ll">
<view class="image">
<image src=""></image>
<image src="{{seller.seller_image}}"></image>
<view class="room_num" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
</view>
<view class="info flex-tb">
<view class="name Semibold">{{se.sellername}}</view>
<view class="text">潮汕火锅 | 距当前位置{{se.distance}}</view>
<view class="name Semibold">{{seller.sellername}}</view>
<view class="text">{{seller.cate[0].name?seller.cate[0].name+' |':''}}距当前位置{{seller.distance}}</view>
<view class="price flex-lr">
<view class="number Semibold">¥50元/人</view>
<view class="number Semibold">
<block wx:if="{{seller.average>0}}">¥{{seller.average}}元/人</block>
</view>
<view class="phone flex-ll" bindtap="tapButton" data-type="oncall">
<image src="http://qn.colorcun.com/custom/lite-online/image/phone.png"></image>
<text>预订</text>
... ...
... ... @@ -18,6 +18,20 @@
height: 240rpx;
background-color: #4C4E4F;
min-width: 268rpx;
position: relative;
}
.seller .image .room_num{
height: 34rpx;
width: 120rpx;
line-height: 34rpx;
color: #fefefe;
background-color: rgba(248, 137, 68, 0.86);
border-radius: 18rpx;
text-align: center;
position: absolute;
top:10rpx;
left: 74rpx;
font-size: 24rpx;
}
.seller .info{
padding: 10rpx 3%;
... ...
//
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
let getCates=async function(){
let res=await App.Reserve.GetCustomerConfig();
let cates=[];
res.data.cate.forEach(ca=>{
cates.push(ca.name);
})
return cates;
}
export default {
caixi:['福建菜','日本菜','火锅','日韩料理','西餐','川湘菜','江浙菜','粤菜','西北菜','徽菜','东北菜','云贵菜','客家菜','新疆菜'],
getCates:getCates,
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ Page({
markers: [],
//polygons:{},
sellers:[],
multiArray: [['不确定'].concat(renNum()), ['全部菜系'].concat(DA.caixi)],
multiArray: [['不确定'], ['全部菜系']],
multiIndex: [6, 0],
scrollIntoView:'',
suggestion:{},
... ... @@ -37,13 +37,20 @@ Page({
sellers: [],
sellersIds:[],
searchAddrTop:50,
user:{
latitude: 23.099994,
longitude: 113.324520,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: async function (options) {
// this.qqmapsdk=new QQMapWX({
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
// });
this.setData({
multiArray:[['不确定'].concat(renNum()), ['全部菜系'].concat(await DA.getCates())]
})
},
/**
... ... @@ -77,6 +84,7 @@ Page({
//this.getPos();
if(this.data.hasSuggestion) return;
let sys=getApp().system;
console.log('onShow',sys.windowHeight,sys.windowHeight-this.transverseViewHeight)
this.setData({
[`map.height`]: sys.windowHeight-this.transverseViewHeight,
searchAddrTop:sys.statusBarHeight
... ... @@ -125,6 +133,11 @@ Page({
let map = this.data.map;
map.latitude = res.latitude;
map.longitude = res.longitude;
this.user.latitude = res.latitude;
this.user.longitude = res.longitude;
console.log('onShow.getPos',getApp().system.windowHeight,getApp().system.windowHeight-this.transverseViewHeight)
map.height = getApp().system.windowHeight-this.transverseViewHeight
this.setData({
map: map,
... ... @@ -262,8 +275,8 @@ Page({
let markers = [];
let sellers=[];
App.Reserve.SellerList({
lat: cmap.latitude,
lng: cmap.longitude,
lat: this.user.latitude,
lng: this.user.longitude,
offset: 0,
rows: 10000,
distance: 100000,
... ... @@ -279,9 +292,14 @@ Page({
}
this.sellersIds=sellersIds;
sellers=res.data;
this.sellers = sellers;
sellers.forEach(seller => {
seller.distance=parseInt(seller.distance);
if(seller.distance>1000){
seller.distance=(seller.distance/1000).toFixed(2)+'公里'
}else{
seller.distance+='米';
}
if(this.mapData.scale<13){
markers.push({
id: seller.id,
... ... @@ -295,7 +313,7 @@ Page({
return;
}
let namelength = seller.sellername.replace(/[^\x00-\xff]/g, "01").length + 8;
markers.push({
let marker={
id: seller.id,
iconPath: "http://qn.colorcun.com/custom/lite-online/image/circle.png",
latitude: seller.lat,
... ... @@ -315,7 +333,16 @@ Page({
textAlign: 'center',
display:'ALWAYS',
},
})
};
if(seller.level[0].id<3){
//http://qn.colorcun.com/custom/lite-online/cates/%E6%B1%9F%E6%B5%99%E8%8F%9C.png
marker.iconPath="http://qn.colorcun.com/custom/lite-online/cates/"
+(seller.cate.length>0?seller.cate[0].name:'其他菜品')
+".png";
marker.width=20;
marker.height=25;
}
markers.push(marker)
})
} else {
markers.push({
... ... @@ -341,6 +368,7 @@ Page({
},
})
}
this.sellers = sellers;
this.setData({
markers: markers,
sellers:sellers,
... ...
... ... @@ -150,4 +150,9 @@ export default {
/**crm**/
'App.Reserve.Members':null,
//顾客端配置信息、菜系
'App.Reserve.GetCustomerConfig':{
cachetime: 1800,
},
}
\ No newline at end of file
... ...