Commit f214b6fc9d5db43c96d018f3de6bd135dadcb8cb

Authored by vking
1 parent 426e029f

商家红包活动

... ... @@ -14,14 +14,14 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.GetUserCard()
//this.GetUserCard()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -56,14 +56,30 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.page+=1;
this.GetUserCard()
}
},
page:1,
size:10,
hasMore:true,
GetUserCard(){
App.Customer.GetUserCard({
page:this.page,
size:this.size,
status:0,
lat:this.location.latitude,
lng:this.location.longitude,
}).then(res=> {
let list=this.data.list
list=list.concat(res.data)
if(res.data.length<this.size){
this.hasMore=false;
}
this.setData({
list: res.data
list: list
})
})
},
... ... @@ -77,9 +93,9 @@ Page({
//lat=39.62420161&lng=118.1174469&multiIndex=0&centre_pos=39.62420161,118.1174469&hasSuggestion=
wx.navigateTo({
url: util.http_build_query({
lat:34.216529,
lng:108.894677,
centre_pos:'34.216529,108.894677',
lat:this.location.latitude,
lng:this.location.longitude,
centre_pos:`${this.location.latitude},${this.location.longitude}`,
keyword:' ',
isopen_md:1,
multiIndex:0,
... ... @@ -87,4 +103,10 @@ Page({
})
}
},
location:null,
onpos(e){
console.log('onpos',e);
this.location=e.detail
this.GetUserCard();
},
})
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav",
"quan":"/components/reserve/seller/quan"
"quan":"/components/reserve/seller/quan",
"getpos":"/components/userinfo/getpos"
}
}
\ No newline at end of file
... ...
... ... @@ -31,3 +31,4 @@
<view class="more"></view>
</view>
</navigator>
<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos>
... ...
... ... @@ -120,7 +120,7 @@ Page({
this.param={
lat_extend:mapParam.lat,
lng_extend:mapParam.lng,
keyword:mapParam.keyword,
keyword:mapParam.keyword.trim(),
offset:this.offset,
size:this.size,
distance:500000,
... ... @@ -128,9 +128,6 @@ Page({
if(mapParam.lat){
this.param.centre_pos=`${mapParam.lat},${mapParam.lng}`
}
if(this.param.keyword=" "){
delete this.param.keyword
}
if(mapParam.isopen_md){
this.param.isopen_md=1
}
... ...