|
@@ -14,14 +14,14 @@ Page({ |
|
@@ -14,14 +14,14 @@ Page({ |
|
14
|
* 生命周期函数--监听页面加载
|
14
|
* 生命周期函数--监听页面加载
|
|
15
|
*/
|
15
|
*/
|
|
16
|
onLoad: function (options) {
|
16
|
onLoad: function (options) {
|
|
17
|
- this.GetUserCard()
|
17
|
+ //this.GetUserCard()
|
|
18
|
},
|
18
|
},
|
|
19
|
|
19
|
|
|
20
|
/**
|
20
|
/**
|
|
21
|
* 生命周期函数--监听页面初次渲染完成
|
21
|
* 生命周期函数--监听页面初次渲染完成
|
|
22
|
*/
|
22
|
*/
|
|
23
|
onReady: function () {
|
23
|
onReady: function () {
|
|
24
|
-
|
24
|
+ this.selectComponent('#getpos').getPos();
|
|
25
|
},
|
25
|
},
|
|
26
|
|
26
|
|
|
27
|
/**
|
27
|
/**
|
|
@@ -56,14 +56,30 @@ Page({ |
|
@@ -56,14 +56,30 @@ Page({ |
|
56
|
* 页面上拉触底事件的处理函数
|
56
|
* 页面上拉触底事件的处理函数
|
|
57
|
*/
|
57
|
*/
|
|
58
|
onReachBottom: function () {
|
58
|
onReachBottom: function () {
|
|
|
|
59
|
+ if(this.hasMore){
|
|
|
|
60
|
+ this.page+=1;
|
|
|
|
61
|
+ this.GetUserCard()
|
|
|
|
62
|
+ }
|
|
59
|
|
63
|
|
|
60
|
},
|
64
|
},
|
|
|
|
65
|
+ page:1,
|
|
|
|
66
|
+ size:10,
|
|
|
|
67
|
+ hasMore:true,
|
|
61
|
GetUserCard(){
|
68
|
GetUserCard(){
|
|
62
|
App.Customer.GetUserCard({
|
69
|
App.Customer.GetUserCard({
|
|
|
|
70
|
+ page:this.page,
|
|
|
|
71
|
+ size:this.size,
|
|
63
|
status:0,
|
72
|
status:0,
|
|
|
|
73
|
+ lat:this.location.latitude,
|
|
|
|
74
|
+ lng:this.location.longitude,
|
|
64
|
}).then(res=> {
|
75
|
}).then(res=> {
|
|
|
|
76
|
+ let list=this.data.list
|
|
|
|
77
|
+ list=list.concat(res.data)
|
|
|
|
78
|
+ if(res.data.length<this.size){
|
|
|
|
79
|
+ this.hasMore=false;
|
|
|
|
80
|
+ }
|
|
65
|
this.setData({
|
81
|
this.setData({
|
|
66
|
- list: res.data
|
82
|
+ list: list
|
|
67
|
})
|
83
|
})
|
|
68
|
})
|
84
|
})
|
|
69
|
},
|
85
|
},
|
|
@@ -77,9 +93,9 @@ Page({ |
|
@@ -77,9 +93,9 @@ Page({ |
|
77
|
//lat=39.62420161&lng=118.1174469&multiIndex=0¢re_pos=39.62420161,118.1174469&hasSuggestion=
|
93
|
//lat=39.62420161&lng=118.1174469&multiIndex=0¢re_pos=39.62420161,118.1174469&hasSuggestion=
|
|
78
|
wx.navigateTo({
|
94
|
wx.navigateTo({
|
|
79
|
url: util.http_build_query({
|
95
|
url: util.http_build_query({
|
|
80
|
- lat:34.216529,
|
|
|
|
81
|
- lng:108.894677,
|
|
|
|
82
|
- centre_pos:'34.216529,108.894677',
|
96
|
+ lat:this.location.latitude,
|
|
|
|
97
|
+ lng:this.location.longitude,
|
|
|
|
98
|
+ centre_pos:`${this.location.latitude},${this.location.longitude}`,
|
|
83
|
keyword:' ',
|
99
|
keyword:' ',
|
|
84
|
isopen_md:1,
|
100
|
isopen_md:1,
|
|
85
|
multiIndex:0,
|
101
|
multiIndex:0,
|
|
@@ -87,4 +103,10 @@ Page({ |
|
@@ -87,4 +103,10 @@ Page({ |
|
87
|
})
|
103
|
})
|
|
88
|
}
|
104
|
}
|
|
89
|
},
|
105
|
},
|
|
|
|
106
|
+ location:null,
|
|
|
|
107
|
+ onpos(e){
|
|
|
|
108
|
+ console.log('onpos',e);
|
|
|
|
109
|
+ this.location=e.detail
|
|
|
|
110
|
+ this.GetUserCard();
|
|
|
|
111
|
+ },
|
|
90
|
}) |
112
|
}) |