From e8d79f766a77440d6f8d1b187b1de2d58aecbdb5 Mon Sep 17 00:00:00 2001 From: Wik-T <812952667@qq.com> Date: Sat, 6 May 2023 09:34:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=95=86=E6=88=B7=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E5=8F=AF=E8=A7=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabBar/category/category.vue | 177 +++++++++++++++---------- pages/tabBar/home/home.vue | 69 +++++----- static/img/dispos.png | Bin 0 -> 969 bytes subPages/shareCounpon/shareCounpon.vue | 103 +++++++------- 4 files changed, 195 insertions(+), 154 deletions(-) create mode 100644 static/img/dispos.png diff --git a/pages/tabBar/category/category.vue b/pages/tabBar/category/category.vue index 379b5e6..e5ba6e8 100644 --- a/pages/tabBar/category/category.vue +++ b/pages/tabBar/category/category.vue @@ -2,105 +2,106 @@ - + + + - + - {{item.name}} - + - + - {{selectFirstName}} + {{selectFirstName}} - - {{distanceName}} + + {{distanceName}} - - + + - - - + + + - - - + + + - + - - {{item.name}} + {{item.name}} - + - + - + - - {{item.title}} + {{item.title}} - + v-if="distance == item.id"> + - + - - - 发现更多商户 - + + + 点击发现更多商户 + - - + + - - - 发现更多商户 - + + + 点击发现更多商户 + - + - + - - + - - + + {{box.callout.content}} - - - + + + {{box.callout.address}} - - + + {{box.distance}}km - - - - + + + + - + @@ -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) { + callouttap(e) { + // #ifdef MP let markerId = e.markerId; 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]); } - } + } + // #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 { diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 1b6428d..94d8609 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -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", diff --git a/static/img/dispos.png b/static/img/dispos.png new file mode 100644 index 0000000000000000000000000000000000000000..779a728f6461feb76a80a6b4a149af4becdde9b4 GIT binary patch literal 969 zcmV;)12+7LP)Px&gGod|RCr$Pn@f`1APk1hne2TgC(Gny>Fn(@c}gzmq6r}VlKhysd(~5I1NzVl zp$WsyKjG%`52pc`rs-o{*I%>&A%x%aJU`CZjMD&&; z2cfHLr$|9Rc*Af5u$SN^jTkcBG{ObIG)7fGbF4%Ubtb6-5QTqH z;S|24X)OXE1JN`!G9gXqgaPz~N77kKD%|op8VE3en$2r$(RvtaK!DE_5P;gG8sVi$ z3iq4`1TlcC3E%Sz$fk$^luiqogxg8$?+vpQIYkkG+U}oqd~Lz1KoI!@7Qj_izXVZ> zPLikq1Gtjvmk=~szyhe)zR0$$cCC58rUjg-b^%n>Uu0LB#e2O|Y5`{kT>zEADCc%N zih2p1k5kct?xt}7E>X8bK_O<_1b~u67rE#2h#B+%yqvr|y?^B>?OOXQeOGVohXd$U zkGvow+S>$xsF75iC8aaYYfI)*0ZZIXn-@AmkSwusQX@ zp;sbA7ZG{wAM*H;c)iy%NDhOX1qLKM?IoOKT;$S)I}PT2Jk-o|*3!Ggk&6bD5a@3~^E3*?Rd7`zgszxtb{34c zi_rPJ?i$cJt&vUl+Tpi0`uJ}%+jmXxuK?=HBZmPf7bb}Us4$x6-vBh!Jl?US!XEP< r;skpOwRVepK{(9>yace0b9(?^KDJhFn&HRg00000NkvXXu0mjfgNeaC literal 0 HcmV?d00001 diff --git a/subPages/shareCounpon/shareCounpon.vue b/subPages/shareCounpon/shareCounpon.vue index 71a785b..edaf61d 100644 --- a/subPages/shareCounpon/shareCounpon.vue +++ b/subPages/shareCounpon/shareCounpon.vue @@ -1,7 +1,8 @@