1.修改商户地图可视化

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

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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

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