|
@@ -57,7 +57,9 @@ export default {
|
|
|
pageSize: 10,
|
|
|
isloaded: false, // 判断是否请求接口完成
|
|
|
usedBundleId:'',
|
|
|
- bundleName:'' // 套餐名称
|
|
|
+ bundleName:'' ,// 套餐名称
|
|
|
+ latitude:'', // 当前位置经度
|
|
|
+ longitude:'' // 当前位置维度
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -105,11 +107,18 @@ export default {
|
|
|
// 获取套餐下的适用门店
|
|
|
getBundleStoreList(){
|
|
|
const _this=this
|
|
|
+ const params={bundleId:this.usedBundleId,pageNo: this.pageNo,pageSize: this.pageSize}
|
|
|
+ if(this.latitude && this.longitude){
|
|
|
+ params.store={
|
|
|
+ lat:this.latitude,
|
|
|
+ lng:this.longitude
|
|
|
+ }
|
|
|
+ }
|
|
|
wx.showLoading({
|
|
|
mask: true,
|
|
|
title: '加载中'
|
|
|
});
|
|
|
- getBundleStore({id:this.usedBundleId,pageNo: this.pageNo,pageSize: this.pageSize,}).then(res=>{
|
|
|
+ getBundleStore(params).then(res=>{
|
|
|
setTimeout(function(){
|
|
|
wx.hideLoading();
|
|
|
},500)
|
|
@@ -155,6 +164,9 @@ export default {
|
|
|
title: '加载中'
|
|
|
});
|
|
|
this.pageInit()
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.getBundleStoreList()
|
|
|
+ },500)
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log(options,"sotore index options",options.bundleName,'bundleName')
|
|
@@ -162,8 +174,17 @@ export default {
|
|
|
if(options && options.bundleId && options.bundleName){
|
|
|
this.usedBundleId=options.bundleId
|
|
|
this.bundleName=options.bundleName
|
|
|
- this.getBundleStoreList()
|
|
|
}
|
|
|
+ wx.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success:(res=> {
|
|
|
+ if(res.latitude && res.longitude){
|
|
|
+ this.latitude = res.latitude
|
|
|
+ this.longitude = res.longitude
|
|
|
+ }
|
|
|
+ console.log(res,'位置信息',this.latitude,this.longitude)
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
};
|
|
|
</script>
|