From 4bc7ececf72e1b266a9a2a02f97a405582768dc7 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Wed, 21 Feb 2024 18:20:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/upload.js | 4 ++-- manifest.json | 2 +- pages/index/index.vue | 20 +++++++++++++++----- pages/shop/list.vue | 10 ++++++++-- pages/user/index.vue | 8 ++++---- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/api/upload.js b/api/upload.js index b2afd17..20bbb42 100644 --- a/api/upload.js +++ b/api/upload.js @@ -25,8 +25,8 @@ export const goods_detail_image = (files) => { const fileIds = [] Promise.all( files.map(async file => { - const {data: {fileInfo: {file_id}}} = await ossUploadFile(file) - fileIds.push(file_id) + const {data: {fileInfo: {preview_url}}} = await ossUploadFile(file) + fileIds.push(preview_url) }) ).then(() => { resolve(fileIds) diff --git a/manifest.json b/manifest.json index 56dad4c..358e956 100644 --- a/manifest.json +++ b/manifest.json @@ -103,7 +103,7 @@ "sdkConfigs" : { "maps" : { "qqmap" : { - "key" : "YYYBZ-QOAH4-2Y2UW-XJOUU-RNSVZ-UVFC4" + "key" : "RDABZ-IF7AB-L4AUO-JHMX3-GBSGE-KIF53" } } }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 8b22741..8c2a2e8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -301,7 +301,7 @@ 我是商家,申请免费入驻互动平台 - + @@ -436,6 +436,9 @@ export default { //_this.getGoodsList() _this.getLocation(res => { _this.flowList = [] + console.log('res.longitude', res.longitude) + uni.setStorageSync('longitude', res.longitude); + uni.setStorageSync('latitude', res.latitude); _this.getDWList(res.longitude, res.latitude); //_this.getGoodsList(res.longitude, res.latitude) @@ -631,6 +634,7 @@ export default { this.longitude = longitude this.latitude = latitude uni.setStorageSync('city', result.data.ads.city); + this.getGoodsList() }) @@ -675,6 +679,9 @@ export default { setTimeout(() => { // 获取用户坐标 app.getLocation((res) => { + console.log('res.longitude', res.longitude) + uni.setStorageSync('longitude', res.longitude); + uni.setStorageSync('latitude', res.latitude); app.getGoodsList(res.longitude, res.latitude) app.getDWList(res.longitude, res.latitude); }) @@ -687,6 +694,9 @@ export default { console.log('222') // 获取用户坐标 app.getLocation((res) => { + console.log('res.longitude', res.longitude) + uni.setStorageSync('longitude', res.longitude); + uni.setStorageSync('latitude', res.latitude); app.getShopList(res.longitude, res.latitude) app.getDWList(res.longitude, res.latitude); }) @@ -1061,9 +1071,9 @@ page { .settle-btn { position: fixed; bottom: 130rpx; - left: calc(50% - 240rpx); + left: calc(50% - 310rpx); z-index: 11; - width: 480rpx; + width: 640rpx; .btn { margin: auto; @@ -1071,10 +1081,10 @@ page { display: flex; align-items: center; justify-content: center; - padding: 10rpx 20rpx; + padding: 20rpx 40rpx; color: #ffffff; text-align: center; - font-size: 25rpx; + font-size: 34rpx; border-radius: 999rpx; text { diff --git a/pages/shop/list.vue b/pages/shop/list.vue index b2b5135..d0cf41e 100644 --- a/pages/shop/list.vue +++ b/pages/shop/list.vue @@ -94,6 +94,8 @@ export default { }, async onLoad(options) { this.options = options + this.latitude = uni.getStorageSync('latitude'); + this.longitude = uni.getStorageSync('longitude'); // await this.getLocation() await this.getChildCategory(options.shopId) await this.getShopList(1) @@ -146,11 +148,15 @@ export default { uni.getLocation({ type: 'wgs84', success: (res) => { + console.log('getLocation', res) + _this.latitude = parseFloat(res[0].latitude) + _this.longitude = parseFloat(res[0].longitude) resolve(res) }, - fail() { + fail(res) { + console.log('getLocation fail', res) reject() - _this.$toast('获取定位失败,请点击右下角按钮重新尝试定位') + // _this.$toast('获取定位失败,请点击右下角按钮重新尝试定位') }, complete: res => { console.log(res) diff --git a/pages/user/index.vue b/pages/user/index.vue index b192a59..16d075e 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -120,10 +120,10 @@ - - 退出登录 - + + + +