Fix(寻趣味):获取定位和获取列表是异步,导致定位成功之后获得的城市与列表数据不一致
(cherry picked from commit cb92a1f44f)
This commit is contained in:
@@ -10,7 +10,7 @@ export default {
|
||||
page: 1,
|
||||
typeList: [],
|
||||
typeIndex: 0,
|
||||
cityName: "昆明市",
|
||||
cityName: "",
|
||||
hotelList: [],
|
||||
}
|
||||
},
|
||||
@@ -18,8 +18,6 @@ export default {
|
||||
this.getMapData();
|
||||
getHotelTypeList().then(({data}) => {
|
||||
this.typeList = data;
|
||||
console.log("getHotelTypeList")
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
@@ -32,6 +30,9 @@ export default {
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (!this.cityName) {
|
||||
return
|
||||
}
|
||||
this.page++;
|
||||
this.fetchList();
|
||||
},
|
||||
@@ -54,6 +55,7 @@ export default {
|
||||
const {latitude, longitude} = map[1];
|
||||
const address = await getCurAddress(latitude, longitude);
|
||||
this.cityName = address[1].data.result.ad_info.city;
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user