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 0000000..779a728 Binary files /dev/null and b/static/img/dispos.png differ 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 @@