Commit 6b3417238bfe684d3e0deaa49cc35b187e6dd8cd

Authored by vking
1 parent 0763505c

new 2.0

... ... @@ -25,6 +25,7 @@ Component({
wx.getLocation({
type: 'gcj02',
success: (res) => {
getApp().location=res
success(res)
},
fail: (res) => {
... ... @@ -57,6 +58,13 @@ Component({
});
}
}else{//
console.log('getApp().location',getApp().location)
if(getApp().location && getApp().location.latitude){
return this.triggerEvent("pos",{
latitude: getApp().location.latitude,
longitude: getApp().location.longitude,
});
}
this.getPosDo(timeout).then(res=>{
console.log('getPos.then',res)
this.triggerEvent("pos",{
... ...
... ... @@ -32,6 +32,12 @@ Component({
methods: {
getPos(fouce=false){
console.log('getPos')
if(getApp().location && getApp().location.latitude){
return this.triggerEvent("pos",{
latitude: getApp().location.latitude,
longitude: getApp().location.longitude,
});
}
this._getPos().then(res => {
console.log('wx.getLocation.then', res);
failCount=0;
... ...
... ... @@ -17,7 +17,7 @@ Page({
{id:2,name:'菜品有特色'},
{id:3,name:'超大包间'},
],
markers:[],
sellers:[],
hasMore:true,
hasDisabled:true,
hasSuggestion:false,
... ... @@ -282,11 +282,11 @@ Page({
},
getListMore(){
this.param.offset+=1;
let markers=this.data.markers;
let sellers=this.data.sellers;
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
hasMore:res.data.length==this.size,
markers:markers.concat(this.sellerFormat(res.data)),
sellers:sellers.concat(this.sellerFormat(res.data)),
})
})
},
... ... @@ -389,9 +389,9 @@ Page({
this.onpos(e)
},500)
}
if(this.data.markers.length<1){
this.GetRecommendSellerList()
}
// if(this.data.sellers.length<1){
// this.GetRecommendSellerList()
// }
},
GetRecommendSellerList(){
let param={sid:'sid'}
... ...
... ... @@ -32,7 +32,7 @@
<scroll-view class="view scroll-view" scroll-y="true"
scroll-into-view="seller-{{scrollSellerID}}"
scroll-with-animation
bindscroll="scrollEvent"
bindscrolltolower="getListMore"
style="width:100%;height: calc(100vh - 150px);">
<block wx:for="{{sellers}}" wx:key="sellers" >
<navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
... ...
... ... @@ -466,10 +466,9 @@
"scene": null
},
{
"id": 52,
"name": "pages/reserve/indexList",
"pathName": "pages/reserve/indexList",
"query": "lat=34.216529&lng=108.891677&map={\"errMsg\":\"getMapRegion:ok\",\"southwest\":{\"longitude\":108.85949049182128,\"latitude\":34.18927020234597},\"northeast\":{\"longitude\":108.9238635081787,\"latitude\":34.24377898163213},\"scale\":14}&multiIndex=0&tags=1,2",
"query": "lat=39.65157&lng=118.15044&keyword=西安&multiIndex=0",
"scene": null
},
{
... ...