|
@@ -41,7 +41,7 @@
|
|
|
queryValue: '',
|
|
|
location: '',
|
|
|
noDataText: '未查找到附近门店', // 列表请求状态提示语
|
|
|
- status: 'loading', // 加载中状态
|
|
|
+ status: 'loadmore', // 加载中状态
|
|
|
listdata: [], // 列表数据
|
|
|
Height: 200, // 滚动区域 元素dom高度
|
|
|
lat: '', // 纬度
|
|
@@ -66,11 +66,21 @@
|
|
|
console.log(res)
|
|
|
_this.lng = res.longitude
|
|
|
_this.lat = res.latitude
|
|
|
- // _this.location = res.address.province + res.address.city + res.address.district + res.address.street + res.address.streetNum +'靠近' + res.address.poiName
|
|
|
+ _this.location = res.address.province + res.address.city + res.address.district + res.address.street + res.address.streetNum +'靠近' + res.address.poiName
|
|
|
setTimeout(()=>{
|
|
|
_this.searchHandle(res)
|
|
|
}, 500)
|
|
|
- }
|
|
|
+ },
|
|
|
+ fail: function(error){
|
|
|
+ console.log(error)
|
|
|
+ _this.searchHandle()
|
|
|
+ if(JSON.parse(error.errMsg.replace('getLocation:fail ','')).message){
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: JSON.parse(error.errMsg.replace('getLocation:fail ','')).message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
//查询门店列表
|
|
@@ -81,6 +91,7 @@
|
|
|
lat: this.lat,
|
|
|
queryWord: this.queryValue
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.status == 200) {
|
|
|
this.listdata = res.data.list || []
|
|
|
this.noDataText = this.listdata.length == 0 && this.queryValue != '' ? '没有搜索到相关结果' : '未查找到附近门店'
|