|
|
@@ -1,22 +1,22 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
-
|
|
|
+
|
|
|
<!-- 地图容器 -->
|
|
|
<view class="map-wrap">
|
|
|
- <map style="width: 100%; height: 300px;"
|
|
|
+ <map style="width: 100%; height: 300px;"
|
|
|
id="map"
|
|
|
- :latitude="latitude"
|
|
|
- :longitude="longitude"
|
|
|
+ :latitude="latitude"
|
|
|
+ :longitude="longitude"
|
|
|
:scale="scale"
|
|
|
:show-location="true"
|
|
|
@markertap="handleMarkerTap"
|
|
|
>
|
|
|
</map>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 地区 -->
|
|
|
- <!-- <view class="h-area-wrap">
|
|
|
-
|
|
|
+ <!-- <view class="h-area-wrap">
|
|
|
+
|
|
|
<view class="h-search">
|
|
|
<view class="h-time">
|
|
|
<view class="time">{{areaName}}</view>
|
|
|
@@ -26,7 +26,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view> -->
|
|
|
-
|
|
|
+
|
|
|
<!-- 门店列表 -->
|
|
|
<view class="h-store-wrap">
|
|
|
<view v-for="(item,index) in storeList" class="h-store-content">
|
|
|
@@ -50,10 +50,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="h-right-value h-flex">
|
|
|
- <view @click="makePhone(item)" class="phone">
|
|
|
+ <view class="phone">
|
|
|
<image src="../../static/goods/u291.png" mode=""></image>
|
|
|
</view>
|
|
|
- <view @click="gotoOrder(item)" class="sure">
|
|
|
+ <view class="sure">
|
|
|
<image src="../../static/goods/u292.png" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -64,7 +64,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {storeList} from '/src/api/goods/goods.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -109,12 +108,12 @@ export default {
|
|
|
this.initMap();
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
-
|
|
|
+
|
|
|
// 获取商店数据
|
|
|
this.getStoreListData();
|
|
|
-
|
|
|
+
|
|
|
// 判断Openid是否为空
|
|
|
- if(!this.$isDataEmpty(option.type)){
|
|
|
+ if(option.type){
|
|
|
this.type = option.type;
|
|
|
}
|
|
|
},
|
|
|
@@ -122,28 +121,20 @@ export default {
|
|
|
// 选择门店
|
|
|
selectStore(item){
|
|
|
// 更新用户选择的门店信息
|
|
|
- this.$store.commit('updateStoreInfo', item);
|
|
|
- let pageCur = 'index';
|
|
|
- if(this.type == '2'){
|
|
|
- pageCur = 'goods';
|
|
|
- }
|
|
|
- uni.$u.route({
|
|
|
- url: '/pages/index/tabbar',
|
|
|
- params: {
|
|
|
- PageCur: pageCur
|
|
|
- }
|
|
|
+ uni.setStorageSync('storeInfo', item);
|
|
|
+
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index',
|
|
|
})
|
|
|
},
|
|
|
// 获取门店列表数据
|
|
|
getStoreListData(){
|
|
|
let that = this;
|
|
|
- storeList({data:this.reqParm}).then((res)=>{
|
|
|
+ this.$api.storeList({data:this.reqParm}).then((res)=>{
|
|
|
console.log(res)
|
|
|
- if(res.length>0){
|
|
|
- that.storeList = res
|
|
|
+ that.storeList = res.data.data
|
|
|
// 添加坐标点
|
|
|
// that.addMarkers();
|
|
|
- }
|
|
|
}).catch(() =>{
|
|
|
console.log("获取用户门店列表报错")
|
|
|
// uni.showToast({
|
|
|
@@ -153,7 +144,7 @@ export default {
|
|
|
},
|
|
|
initMap(){
|
|
|
this._mapContext = uni.createMapContext("map", this);
|
|
|
-
|
|
|
+
|
|
|
// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})
|
|
|
this._mapContext.initMarkerCluster({
|
|
|
enableDefaultStyle: false,
|
|
|
@@ -163,11 +154,11 @@ export default {
|
|
|
console.log('initMarkerCluster', res)
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
this._mapContext.on("markerClusterCreate", (e) => {
|
|
|
console.log("markerClusterCreate", e);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
addMarkers() {
|
|
|
const markers = []
|
|
|
@@ -195,7 +186,7 @@ export default {
|
|
|
},p)
|
|
|
)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// 添加点
|
|
|
this._mapContext.addMarkers({
|
|
|
markers,
|
|
|
@@ -205,7 +196,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 点击地图上的点
|
|
|
handleMarkerTap(marker){
|
|
|
console.log('Marker tapped:', marker);
|
|
|
@@ -214,7 +205,7 @@ export default {
|
|
|
// 打电话
|
|
|
makePhone(phoneNumber){
|
|
|
uni.makePhoneCall({
|
|
|
- phoneNumber: phoneNumber
|
|
|
+ phoneNumber: phoneNumber
|
|
|
});
|
|
|
},
|
|
|
// 去下单页面
|
|
|
@@ -318,4 +309,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|