|
|
@@ -269,8 +269,8 @@ export default {
|
|
|
// 查询门店信息
|
|
|
const data = uni.getStorageSync('storeInfo');
|
|
|
if (!data) {
|
|
|
- // 获取门店列表数据
|
|
|
- this.getStoreListData();
|
|
|
+ // 获取位置信息查询门店列表数据
|
|
|
+ this.getLocation();
|
|
|
} else {
|
|
|
this.storeInfo = data;
|
|
|
}
|
|
|
@@ -303,7 +303,7 @@ export default {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.getLocation();
|
|
|
+ // this.getLocation();
|
|
|
|
|
|
//公告信息
|
|
|
this.getNoticeListData();
|
|
|
@@ -430,10 +430,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 获取门店列表数据
|
|
|
- getStoreListData() {
|
|
|
+ getStoreListData(data) {
|
|
|
let that = this;
|
|
|
// 用户绑定门店
|
|
|
- this.$api.storeList(this.reqParm).then((res) => {
|
|
|
+ this.$api.storeList(data).then((res) => {
|
|
|
console.log(res.data.data[0])
|
|
|
that.storeInfo = res.data.data[0]
|
|
|
// 更新用户选择的门店信息
|
|
|
@@ -468,7 +468,8 @@ export default {
|
|
|
},
|
|
|
// 获取经纬度信息
|
|
|
getLocation() {
|
|
|
-
|
|
|
+ let that = this
|
|
|
+ console.log('+++++++++++++开始获取位置信息++++++++++++++++')
|
|
|
uni.getLocation({
|
|
|
type: 'gcj02',
|
|
|
success: function (res) {
|
|
|
@@ -479,14 +480,17 @@ export default {
|
|
|
let accuracy = res.accuracy; // 精确度
|
|
|
// 在这里可以对位置信息进行处理
|
|
|
console.log("纬度:" + latitude + ";经度" + longitude)
|
|
|
- this.reqParm.latitude = latitude
|
|
|
- this.reqParm.longitude = longitude
|
|
|
+ that.reqParm.latitude = latitude
|
|
|
+ that.reqParm.longitude = longitude
|
|
|
+ uni.setStorageSync('location', that.reqParm)
|
|
|
+ that.getStoreListData(that.reqParm)
|
|
|
},
|
|
|
fail:function (fail) {
|
|
|
console.log('获取用户地址失败==》',fail)
|
|
|
+ that.getStoreListData(that.reqParm)
|
|
|
},
|
|
|
- complete:function () {
|
|
|
-
|
|
|
+ complete:function (complete) {
|
|
|
+ console.log('获取用户地址失败or成功==》',complete)
|
|
|
}
|
|
|
});
|
|
|
},
|