1.修改商户地图可视化

master
杨杰 2 years ago
parent 027b3445e8
commit e8d79f766a
  1. 171
      pages/tabBar/category/category.vue
  2. 69
      pages/tabBar/home/home.vue
  3. BIN
      static/img/dispos.png
  4. 93
      subPages/shareCounpon/shareCounpon.vue

@ -2,105 +2,106 @@
<view class="map-container">
<map style="width: 100%; height: 10vh;" :style="{height:mapheight}" :latitude="latitude" :longitude="longitude"
:markers="marker" :scale="scale" @markertap="markertap" @callouttap='callouttap'>
<!-- <cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap">
<cover-image class="cover-image" @click="play" src="../../../static/img/adresw.png"></cover-image>
<cover-view>
定位
</cover-view>
</cover-view> -->
<cover-view class="cover-view-loca" :style='{bottom:coverbottom}' @click="onControltap">
<cover-image class="cover-image" src="../../../static/img/dispos.png"></cover-image>
</cover-view>
<!-- 一级分类 -->
<view class="width100 cover-views mart15">
<cover-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' : '']"
<cover-view class="cover-view-head font14" :class="[typeid == item.id ? 'onclick' : '']"
v-for="(item,index) in goodsFirstClassList" :key="index" @click="changeType(item)">{{item.name}}
</view>
</cover-view>
</scroll-view>
<!-- 二级分类 -->
<view class="width100 mart15 backcorfff cover-viewchage alijus fotct" style="border-radius: 22px;">
<cover-view class="width100 mart15 backcorfff cover-viewchage alijus fotct"
style="border-radius: 22px;">
<!-- :class="[selectFirst == 1? 'onchange' : '']" -->
<view class="font14 width30w onchange text1" @click="changeChilerType()">{{selectFirstName}}
<cover-view class="font14 width30w fotct onchange text1"
@click="changeChilerType()">{{selectFirstName}}
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image>
</view>
<view class="font14 width30w onchange" @click="changeChilerdistance()">{{distanceName}}
</cover-view>
<cover-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">
</cover-view>
<cover-view class="font14 width30w">
<!-- 全部
<image mode="widthFix" class="margle" style="width: 8px;" :src="imagewxUrl+imgadres2"></image> -->
</view>
</view>
</view>
</cover-view>
</cover-view>
</cover-view>
<!-- // -->
<view class="change-cont" v-if="selectChiler == 1">
<view class="width100 backcorfff"></view>
</view>
<cover-view class="change-cont" v-if="selectChiler == 1 || selectChilerdistance == 1">
<cover-view class="width100 backcorfff"></cover-view>
</cover-view>
<!-- // -->
<view class="change-optiac paddbotm20" v-if="selectChiler == 1">
<cover-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"
<cover-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>
<cover-view class="width90w font14"
:class="[selectFirst == item.id? 'onchange' : '']">{{item.name}}</cover-view>
<image class="icon20" src="../../../static/img/changed.png" mode="widthFix"
v-if="selectFirst == item.id"></image>
</view>
</cover-view>
</scroll-view>
</view>
</cover-view>
<!-- 二级距离 -->
<view class="change-optiac paddbotm20" v-if="selectChilerdistance == 1">
<cover-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"
<cover-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>
<cover-view class="width90w font14"
:class="[ distance== item.id? 'onchange' : '']">{{item.title}}</cover-view>
<image class="icon20" src="../../../static/img/changed.png" mode="widthFix"
v-if="distance == item"></image>
</view>
v-if="distance == item.id"></image>
</cover-view>
</scroll-view>
</view>
</cover-view>
<!-- 未打开筛选前 -->
<view class="cover-view-foot" v-if="isSelected == 1">
<view class="line-view" @click="updateSelected(2)"></view>
<view class="mart10 fcor666 font13 width100" @click="updateSelected(2)">发现更多商户</view>
<view class="input-box">
<cover-view class="cover-view-foot" v-if="isSelected == 1">
<cover-view class="line-view" @click="updateSelected(2)"></cover-view>
<cover-view class="paddtop10 fcor666 font13 width100" @click="updateSelected(2)">点击发现更多商户</cover-view>
<cover-view class="input-box">
<input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@click="updateSelected(2)" />
</view>
</view>
</cover-view>
</cover-view>
<!-- 打开筛选后 -->
<view class="cover-view-foot-behind" v-if="isSelected == 2">
<view class="line-view" @click="updateSelected(1)"></view>
<view class="mart10 fcor666 font13 width100" @click="updateSelected(1)">发现更多商户</view>
<view class="input-box">
<cover-view class="cover-view-foot-behind" v-if="isSelected == 2">
<cover-view class="line-view" @click="updateSelected(1)"></cover-view>
<cover-view class="paddtop10 fcor666 font13 width100" @click="updateSelected(1)">点击发现更多商户</cover-view>
<cover-view class="input-box">
<input placeholder="搜索商品" v-model="searchName" placeholder-style="color:#c0c0c0;"
@input="getMapStore()" />
</view>
</cover-view>
<scroll-view class="scoroll-cont width94 mart10" scroll-y="true">
<view v-if="marker == '' " class="mart30 fotct font14 fcor666 fotct width100">
<cover-view v-if="marker == '' " class="mart30 fotct font14 fcor666 fotct width100">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres3"></image>
</view>
<view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i"
</cover-view>
<cover-view class="width96 height80 bor-botm1 alijusstart" v-for="(box,i) in marker" :key="i"
@click="seeloaction(box)">
<image mode="widthFix" :src="box.logo" class="recontleft flleft border-r"
style="max-width: 50px;min-width: 50px;">
</image>
<view class="fotlt paddleft5">
<view class="text2 width100 font18 fontwig6">
<cover-view class="fotlt paddleft5">
<cover-view class="text2 width100 font16 fontwig6">
{{box.callout.content}}
</view>
<view class="height22">
<view class="width70 flleft text1 font13 fcor999">
</cover-view>
<cover-view class="height22">
<cover-view class="width70 flleft text1 font13 fcor999">
{{box.callout.address}}
</view>
<view class="width30 flright font13 fcor666 fotct">
</cover-view>
<cover-view class="width30 flright font13 fcor666 fotct">
<image mode="widthFix" :src="imagewxUrl+imgadres4" style="width: 10px;"></image>
{{box.distance}}km
</view>
</view>
</view>
</view>
</cover-view>
</cover-view>
</cover-view>
</cover-view>
</scroll-view>
</view>
</cover-view>
</map>
</view>
@ -151,9 +152,11 @@
}
},
onLoad() {
this.getIndustry();
this.latitude = app.globalData.latitude;
this.longitude = app.globalData.longitude;
},
onShow() {
// this.latitude = app.globalData.latitude;
// this.longitude = app.globalData.longitude;
this.onControltap();
},
computed: {
mapheight() {
@ -209,8 +212,8 @@
name: this.searchName,
type: this.typeplat,
childId: this.selectFirst,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
longitude: this.longitude,
latitude: this.latitude
}
getMapStore(datas).then(res => {
if (res.return_code == '000000') {
@ -235,15 +238,26 @@
this.getMapStore();
},
//
markertap(e) {},
markertap(e) {
// #ifdef H5
let markerId = e.detail.markerId;
for (var i = 0; i < this.marker.length; i++) {
if (markerId == this.marker[i].id) {
this.seeloaction(this.marker[i]);
}
}
// #endif
},
//
callouttap(e) {
// #ifdef MP
let markerId = e.markerId;
for (var i = 0; i < this.marker.length; i++) {
if (markerId == this.marker[i].id) {
this.seeloaction(this.marker[i]);
}
}
// #endif
},
postionIng() {
@ -356,8 +370,26 @@
},
//
onControltap() {
uni.showLoading({
title: '定位中'
})
uni.getLocation({
geocode: true,
type: 'wgs84',
success: (res) => {
uni.hideLoading();
console.log(res, '获取当前位置')
this.longitude = res.longitude;
this.latitude = res.latitude;
this.getIndustry();
},
fail() {
uni.hideLoading();
},
address: (res) => {
console.log('address', res)
}
});
},
//
changeType(item) {
@ -372,6 +404,7 @@
if (this.selectChiler == 1) {
this.selectChiler = 2;
} else {
this.selectChilerdistance = 2;
this.selectChiler = 1;
}
},
@ -380,6 +413,7 @@
if (this.selectChilerdistance == 1) {
this.selectChilerdistance = 2;
} else {
this.selectChiler = 2;
this.selectChilerdistance = 1;
}
@ -455,6 +489,7 @@
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
color: #484848;
background-color: #fff;
background-size: 60px 60px;
@ -466,8 +501,8 @@
.cover-image {
display: inline-block;
width: 15px;
height: 15px;
width: 20px;
height: 20px;
}
.cover-view-foot {

@ -272,44 +272,45 @@
that.postionIng();
// #endif
// #ifdef H5
that.postionIng();
// if (app.globalData.h5code) {
// that.getH5AccessToken();
// }
uni.showLoading({
title: '加载中'
})
var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "嗨森逛");
// uni.showLoading({
// title: ''
// })
// var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "");
//
geolocation.getLocation(
res => {
uni.hideLoading();
app.globalData.latitude = res.lat;
app.globalData.longitude = res.lng;
uni.setStorage({
key: "latitude",
data: res.lat
})
uni.setStorage({
key: "longitude",
data: res.lng
})
that.findByLatAndLng(res.lng, res.lat);
},
err => {
uni.hideLoading();
uni.showModal({
title: '获取定位权限失败,默认城市重庆市',
content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
})
that.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
that.getCmsContentcmsContent();
that.getCmsAactibity();
}
);
// geolocation.getLocation(
// res => {
// uni.hideLoading();
// app.globalData.latitude = res.lat;
// app.globalData.longitude = res.lng;
// uni.setStorage({
// key: "latitude",
// data: res.lat
// })
// uni.setStorage({
// key: "longitude",
// data: res.lng
// })
// that.findByLatAndLng(res.lng, res.lat);
// },
// err => {
// uni.hideLoading();
// uni.showModal({
// title: ',',
// content: ''
// })
// that.city = '';
// app.globalData.cityName = '';
// app.globalData.cityId = '500000';
// that.getCmsContentcmsContent();
// that.getCmsAactibity();
// }
// );
// #endif
uni.getStorage({
key: "user",

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

@ -1,7 +1,8 @@
<template>
<view>
<view class="imgshead backroundimgfit" v-if="partakeWay == 2"></view>
<view class="imgshead backroundimgsed" v-if="partakeWay == 3"></view>
<!-- v-if="partakeWay == 2" -->
<view class="imgshead backroundimgfit"></view>
<!-- <view class="imgshead backroundimgsed" v-if="partakeWay == 3"></view> -->
<view class="imgscontent">
<view class="conts paddtop13">
<view v-for="(item,index) in couponList" :key="index" class="conpon border-r height90 flleft marb10 ">
@ -52,34 +53,34 @@
couponList: [],
shareNum: 0, //
orderNo: '', //
partakeWay: '' //
partakeWay: '', //
shareLink: '', //
qrCodeSn: '' //
}
},
created() {
if (app.globalData.accountType == '0000012&key') {
this.doShare();
}
// if (app.globalData.accountType == '0000012&key') {
this.doShare();
// }
},
onShow() {
let that = this;
uni.setNavigationBarTitle({
title: '分享领取优惠券'
})
if (app.globalData.accountType == '0000012&key') {
uni.removeStorage({
key: 'shareNum'
});
uni.setNavigationBarTitle({
title: '分享领取优惠券'
})
that.partakeWay = 2;
that.getOrderByOutTradeOrder();
}
if (app.globalData.accountType == '0000014&key') {
that.partakeWay = 3;
uni.setNavigationBarTitle({
title: '立即领取优惠券'
})
uni.getStorage({
key: 'staffCode',
success: (res) => {
that.qrCodeSn = res.data;
that.getReceiveDiscountList(res.data);
},
})
@ -132,7 +133,7 @@
//
payReceiveDiscount() {
let that = this;
if (that.partakeWay == 2) {
// if (that.partakeWay == 2) {
uni.getStorage({
key: 'shareNum',
success(e) {
@ -143,7 +144,7 @@
}
}
})
}
// }
if (app.globalData.userInfo.phone == '' || app.globalData.userInfo.phone == null || app.globalData.userInfo
.phone == undefined) {
@ -160,7 +161,8 @@
})
return;
}
if (that.shareNum == 0 && that.partakeWay == 2) {
// && that.partakeWay == 2
if (that.shareNum == 0 ) {
uni.showToast({
title: "分享活动得领取机会",
duration: 2000,
@ -186,13 +188,13 @@
duration: 2000,
icon: 'none'
})
if (that.partakeWay == 2) {
// if (that.partakeWay == 2) {
that.shareNum--;
uni.setStorage({
key: "shareNum",
data: that.shareNum
})
}
// }
} else {
uni.showToast({
@ -206,6 +208,11 @@
//
doShare() {
let that = this;
if (app.globalData.accountType == '0000012&key') {
that.shareLink = 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' + that.orderNo;
} else {
that.shareLink = 'https://hsgcs.dctpay.com/hsgH5?accountId=0000014&key=&code=' + that.qrCodeSn;
}
let theUrl = window.location.href.split('#')[0];
let datas = {
url: theUrl
@ -218,39 +225,37 @@
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, // 1
jsApiList: ['onMenuShareTimeline',
jsApiList: [
'onMenuShareAppMessage'
] // 使JSJS2
});
wx.ready(function() {
wx.onMenuShareTimeline({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
that.orderNo, //
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//
uni.showToast({
title: '分享成功',
duration: 2000,
icon: 'none'
})
that.shareNum++;
uni.setStorage({
key: "shareNum",
data: that.shareNum
})
},
cancel: function(r) {},
fail: function(res) {}
});
// wx.onMenuShareTimeline({
// title: '', //
// desc: '', //
// link: that.shareLink, //
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', //
// success: function(res) {
// //
// uni.showToast({
// title: '',
// duration: 2000,
// icon: 'none'
// })
// that.shareNum++;
// uni.setStorage({
// key: "shareNum",
// data: that.shareNum
// })
// },
// cancel: function(r) {},
// fail: function(res) {}
// });
wx.onMenuShareAppMessage({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
that.orderNo, //
title: '分享朋友圈,立获大额优惠券', //
desc: '分享朋友圈,立获大额优惠券', //
link: that.shareLink, //
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//

Loading…
Cancel
Save