1.修改商户的地图可视化

dev
杨杰 2 years ago
parent 14fcb61ffe
commit 850903d2f1
  1. 9
      Utils/Api.js
  2. 269
      pages/tabBar/category/category.vue
  3. BIN
      static/img/changed.png

@ -139,7 +139,14 @@ export const getOrderById = params => {
//获取商户列表
export const getMerchantList = params => {
return POST('GET', `${base}/highMerchantStore/getMerchantList`, params).then(res => res.data);
}
}
//查询新的地图商户
export const getIndustry = params => {
return POST('GET', `${base}/common/getIndustry`, params).then(res => res.data);
}
export const getMapStore = params => {
return POST('GET', `${base}/common/getMapStore`, params).then(res => res.data);
}
//首页获取门店
export const getStoreListByMerchant = params => {
return POST('GET', `${base}/highMerchantStore/getStoreListByMerchant`, params).then(res => res.data);

@ -12,15 +12,16 @@
<view class="width100 cover-views mart15">
<scroll-view class="width90 cover-view-cont" scroll-x="true">
<view class="cover-view-head font14" :class="[typeid == item.id ? 'onclick' : '']"
v-for="(item,index) in marker" :key="index" @click="changeType(item)">全部全部{{index}}</view>
v-for="(item,index) in goodsFirstClassList" :key="index" @click="changeType(item)">{{item.name}}
</view>
</scroll-view>
<!-- 二级分类 -->
<view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;">
<view class="font14 width30w" :class="[selectFirst == 1? 'onchange' : '']"
@click="changeChilerType()">全部
<!-- :class="[selectFirst == 1? 'onchange' : '']" -->
<view class="font14 width30w onchange text1" @click="changeChilerType()">{{selectFirstName}}
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
</view>
<view class="font14 width30w" :class="[selectFirst == 1? 'onchange' : '']">全部
<view class="font14 width30w onchange" @click="changeChilerdistance()">{{distanceName}}
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
</view>
<view class="font14 width30w">
@ -36,33 +37,22 @@
<!-- // -->
<view class="change-optiac paddbotm20" v-if="selectChiler == 1">
<scroll-view scroll-y="true" class="width100 height260">
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w" :class="[selectFirst == 1? 'onchange' : '']">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"
v-for="(item,index) in goodsSendotClassList" :key="item.id" @click="changeFirstcont(item)">
<view class="width90w" :class="[selectFirst == item.id? 'onchange' : '']">{{item.name}}</view>
<image class="icon20" src="../../../static/img/changed.png" mode="widthFix"
v-if="selectFirst == item.id"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</view>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart">
<view class="width90w">发生地方是发生地方</view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image>
</scroll-view>
</view>
<!-- 二级距离 -->
<view class="change-optiac paddbotm20" v-if="selectChilerdistance == 1">
<scroll-view scroll-y="true" class="width100 height260">
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"
v-for="(item,index) in distanceList" :key="index" @click="changeDistance(item)">
<view class="width90w" :class="[ distance== item.id? 'onchange' : '']">{{item.title}}</view>
<image class="icon20" src="../../../static/img/changed.png" mode="widthFix"
v-if="distance == item"></image>
</view>
</scroll-view>
</view>
@ -72,7 +62,7 @@
<view class="line-view"></view>
<view class="mart10 fcor666 font13 width100">发现更多商户</view>
<view class="input-box">
<input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;"
<input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@input="toSearch()" />
</view>
</view>
@ -82,16 +72,14 @@
<view class="line-view"></view>
<view class="mart10 fcor666 font13 width100">发现更多商户</view>
<view class="input-box">
<input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;"
<input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@input="toSearch()" />
</view>
<scroll-view class="scoroll-cont width94 mart10" scroll-y="true">
<view class="width94 alijusstart" @click.stop="updateSelected(1)">
<view class="width30">
<image src="../../../static/img/jfx.png" class="icon45" mode="widthFix">
</image>
</view>
<view class="width70"></view>
</view>
</scroll-view>
</view>
@ -100,146 +88,51 @@
</view>
</template>
<script>
import {
getIndustry,
getMapStore
} from '../../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
latitude: 23.106574, //
longitude: 113.324587, //
latitude: '', //
longitude: '', //
scale: 13, //
bottomData: false,
imagewxUrl: app.globalData.imageWxImg,
imgadres2: 'xiala.png',
marker: [{
id: 0,
latitude: 23.13065, //
longitude: 113.3274, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
// title:'',//
alpha: 0.5, //
callout: { //
content: '天宝大厦', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '10',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
{
id: 1234597,
latitude: 23.106574, //
longitude: 113.324587, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
// title:'',//
alpha: 0.5, //
// label:{// //H5
// color:'red',//
// },
callout: { //
content: '广州塔', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '10',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
{
id: 2,
latitude: 23.1338, //
longitude: 113.33052, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '德隆大厦', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '10',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
marker: '',
typeid: 0, //
isSelected: 1, //
selectFirst: '', //
selectFirstName: '', //
selectChiler: 2, //
selectChilerdistance: 2, //
goodsFirstClassList: '', //
goodsSendotClassList: '', //
distanceList: [{
id: 1,
title: '1km'
},
{
id: 3,
latitude: 23.136455, //
longitude: 113.329002, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '羊城国际商贸中心', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '10',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
},
{
id: 4,
latitude: 23.224781, //
longitude: 113.293911, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '天瑞广场A座', //
color: '#ffffff', //
fontSize: 16, //
borderRadius: 15, //
borderWidth: '12',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
title: '3km'
},
{
id: 5,
latitude: 23.072726, //
longitude: 113.277921, //
iconPath: '../../../static/img/user/user5.png', //
rotate: 0, //
width: 20, //
height: 30, //
alpha: 0.5, //
callout: { //
content: '大米和小米儿童康复(广州盈丰)中心', //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 15, //
borderWidth: '8',
bgColor: '#e51860', //
display: 'ALWAYS', //
},
title: '5km'
},
],
typeid: 0, //
isSelected: 1, //
selectFirst: 1, //
selectChiler: 1, //
], //
distance: '1',
distanceName: '1km',
searchName: '' //
}
},
onLoad() {
this.getIndustry();
this.latitude = app.globalData.latitude;
this.longitude = app.globalData.longitude;
},
computed: {
mapheight() {
@ -267,6 +160,46 @@
},
methods: {
//
getIndustry() {
getIndustry().then(res => {
if (res.return_code == '000000') {
this.goodsFirstClassList = res.return_data;
this.typeid = res.return_data[0].id;
this.goodsSendotClassList = res.return_data[0].childIndustry;
this.selectFirst = res.return_data[0].childIndustry[0].id;
this.selectFirstName = res.return_data[0].childIndustry[0].name;
this.getMapStore();
}
})
},
//
getMapStore() {
let datas = {
distance: this.distance,
name: this.searchName,
childId: this.selectFirst,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
}
getMapStore(datas).then(res => {
if (res.return_code == '000000') {
this.marker = res.return_data
}
})
},
//
changeFirstcont(item) {
this.selectFirst = item.id;
this.selectFirstName = item.name;
this.selectChiler = 2;
},
//
changeDistance(item) {
this.distance = item.id;
this.distanceName = item.title;
this.selectChilerdistance = 2;
},
//
markertap(e) {},
//
@ -305,9 +238,9 @@
}
findByLatAndLng(datas).then(res => {
if (res.return_code == '000000') {
this.city = res.return_data.provinceName;
app.globalData.cityName = res.return_data.provinceName;
app.globalData.qianzhuCityName = res.return_data.cityName;
this.city = res.return_data.provinceName;
app.globalData.cityName = res.return_data.provinceName;
app.globalData.qianzhuCityName = res.return_data.cityName;
app.globalData.cityId = res.return_data.regionId;
// app.globalData.cityId = '500100';
if (res.return_data.result.addressComponent.adcode) {
@ -390,6 +323,9 @@
//
changeType(item) {
this.typeid = item.id;
this.goodsSendotClassList = item.childIndustry;
this.selectFirst = item.childIndustry[0].id;
this.selectFirstName = item.childIndustry[0].name;
},
//
changeChilerType() {
@ -399,6 +335,15 @@
this.selectChiler = 1;
}
},
//
changeChilerdistance() {
if (this.selectChilerdistance == 1) {
this.selectChilerdistance = 2;
} else {
this.selectChilerdistance = 1;
}
},
//
updateSelected(item) {
this.isSelected = item;

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Loading…
Cancel
Save