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

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

@ -140,6 +140,13 @@ export const getOrderById = params => {
export const getMerchantList = params => { export const getMerchantList = params => {
return POST('GET', `${base}/highMerchantStore/getMerchantList`, params).then(res => res.data); 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 => { export const getStoreListByMerchant = params => {
return POST('GET', `${base}/highMerchantStore/getStoreListByMerchant`, params).then(res => res.data); return POST('GET', `${base}/highMerchantStore/getStoreListByMerchant`, params).then(res => res.data);

@ -12,15 +12,16 @@
<view class="width100 cover-views mart15"> <view class="width100 cover-views mart15">
<scroll-view class="width90 cover-view-cont" scroll-x="true"> <scroll-view class="width90 cover-view-cont" scroll-x="true">
<view class="cover-view-head font14" :class="[typeid == item.id ? 'onclick' : '']" <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> </scroll-view>
<!-- 二级分类 --> <!-- 二级分类 -->
<view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;"> <view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;">
<view class="font14 width30w" :class="[selectFirst == 1? 'onchange' : '']" <!-- :class="[selectFirst == 1? 'onchange' : '']" -->
@click="changeChilerType()">全部 <view class="font14 width30w onchange text1" @click="changeChilerType()">{{selectFirstName}}
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image> <image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
</view> </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> <image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
</view> </view>
<view class="font14 width30w"> <view class="font14 width30w">
@ -36,33 +37,22 @@
<!-- // --> <!-- // -->
<view class="change-optiac paddbotm20" v-if="selectChiler == 1"> <view class="change-optiac paddbotm20" v-if="selectChiler == 1">
<scroll-view scroll-y="true" class="width100 height260"> <scroll-view scroll-y="true" class="width100 height260">
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"> <view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"
<view class="width90w" :class="[selectFirst == 1? 'onchange' : '']">发生地方是发生地方</view> v-for="(item,index) in goodsSendotClassList" :key="item.id" @click="changeFirstcont(item)">
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image> <view class="width90w" :class="[selectFirst == item.id? 'onchange' : '']">{{item.name}}</view>
</view> <image class="icon20" src="../../../static/img/changed.png" mode="widthFix"
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"> v-if="selectFirst == item.id"></image>
<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>
<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>
<view class="width90 bor-botm1 paddtop15 paddbotm15 alijusstart"> </scroll-view>
<view class="width90w">发生地方是发生地方</view> </view>
<image class="icon12" src="../../../static/img/jt.png" mode="widthFix"></image> <!-- 二级距离 -->
<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> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -72,7 +62,7 @@
<view class="line-view"></view> <view class="line-view"></view>
<view class="mart10 fcor666 font13 width100">发现更多商户</view> <view class="mart10 fcor666 font13 width100">发现更多商户</view>
<view class="input-box"> <view class="input-box">
<input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;" <input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@input="toSearch()" /> @input="toSearch()" />
</view> </view>
</view> </view>
@ -82,16 +72,14 @@
<view class="line-view"></view> <view class="line-view"></view>
<view class="mart10 fcor666 font13 width100">发现更多商户</view> <view class="mart10 fcor666 font13 width100">发现更多商户</view>
<view class="input-box"> <view class="input-box">
<input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;" <input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@input="toSearch()" /> @input="toSearch()" />
</view> </view>
<scroll-view class="scoroll-cont width94 mart10" scroll-y="true"> <scroll-view class="scoroll-cont width94 mart10" scroll-y="true">
<view class="width94 alijusstart" @click.stop="updateSelected(1)"> <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> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -100,146 +88,51 @@
</view> </view>
</template> </template>
<script> <script>
import {
getIndustry,
getMapStore
} from '../../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
latitude: 23.106574, // latitude: '', //
longitude: 113.324587, // longitude: '', //
scale: 13, // scale: 13, //
bottomData: false, bottomData: false,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres2: 'xiala.png', imgadres2: 'xiala.png',
marker: [{ marker: '',
id: 0, typeid: 0, //
latitude: 23.13065, // isSelected: 1, //
longitude: 113.3274, // selectFirst: '', //
iconPath: '../../../static/img/user/user5.png', // selectFirstName: '', //
rotate: 0, // selectChiler: 2, //
width: 20, // selectChilerdistance: 2, //
height: 30, // goodsFirstClassList: '', //
// title:'',// goodsSendotClassList: '', //
alpha: 0.5, // distanceList: [{
callout: { // id: 1,
content: '天宝大厦', // title: '1km'
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', //
},
}, },
{ {
id: 3, id: 3,
latitude: 23.136455, // title: '3km'
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', //
},
}, },
{ {
id: 5, id: 5,
latitude: 23.072726, // title: '5km'
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', //
},
}, },
], ], //
typeid: 0, // distance: '1',
isSelected: 1, // distanceName: '1km',
selectFirst: 1, // searchName: '' //
selectChiler: 1, //
} }
}, },
onLoad() { onLoad() {
this.getIndustry();
this.latitude = app.globalData.latitude;
this.longitude = app.globalData.longitude;
}, },
computed: { computed: {
mapheight() { mapheight() {
@ -267,6 +160,46 @@
}, },
methods: { 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) {}, markertap(e) {},
// //
@ -390,6 +323,9 @@
// //
changeType(item) { changeType(item) {
this.typeid = item.id; this.typeid = item.id;
this.goodsSendotClassList = item.childIndustry;
this.selectFirst = item.childIndustry[0].id;
this.selectFirstName = item.childIndustry[0].name;
}, },
// //
changeChilerType() { changeChilerType() {
@ -399,6 +335,15 @@
this.selectChiler = 1; this.selectChiler = 1;
} }
}, },
//
changeChilerdistance() {
if (this.selectChilerdistance == 1) {
this.selectChilerdistance = 2;
} else {
this.selectChilerdistance = 1;
}
},
// //
updateSelected(item) { updateSelected(item) {
this.isSelected = item; this.isSelected = item;

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Loading…
Cancel
Save