From e2ae755323783ebd33dfb53aaf70f4f7099533c0 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 13 Jul 2024 18:00:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E8=8E=B7=E5=8F=96=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/good.js | 4 + pageQuota/vipUser/index.vue | 7 +- pages.json | 8 ++ pages/my/my.vue | 1 + pages/product/product.vue | 199 +++++++++++++++++++++++++++++++++++ pagesOrder/settle/settle.vue | 41 +++++--- 6 files changed, 243 insertions(+), 17 deletions(-) create mode 100644 pages/product/product.vue diff --git a/api/good.js b/api/good.js index a61c66a..fa7a5df 100644 --- a/api/good.js +++ b/api/good.js @@ -6,4 +6,8 @@ export const goodListApi = (data) => { export const goodClassListApi = (data) => { return request.get('/cate/cate/lists', data); +} + +export const storeProductListApi = (data) => { + return request.get('/product/product/store_lists', data); } \ No newline at end of file diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue index d710b7e..18d87d9 100644 --- a/pageQuota/vipUser/index.vue +++ b/pageQuota/vipUser/index.vue @@ -318,6 +318,11 @@ {{ popPhone }} + + + + + \ No newline at end of file diff --git a/pagesOrder/settle/settle.vue b/pagesOrder/settle/settle.vue index 8ab6b1b..7f88f92 100644 --- a/pagesOrder/settle/settle.vue +++ b/pagesOrder/settle/settle.vue @@ -548,25 +548,34 @@ onLoad(options => { if (uni.getStorageSync('location')) { - location = JSON.parse(uni.getStorageSync('location')) - checkOrder(); + try { + location = JSON.parse(uni.getStorageSync('location')) + checkOrder(); + } catch (e) { + getLocation() + } + } else { - uni.getLocation({ - type: "gcj02", - success(res) { - location.lat = res.latitude; - location.long = res.longitude; - uni.setStorageSync('location', JSON.stringify(location)) - checkOrder(); - }, - fail() { - uni.$u.toast('获取位置当前失败,为你推荐当前门店') - checkOrder(STORE_INFO.id); - }, - complete() {} - }) + getLocation() } }) + + const getLocation = () => { + uni.getLocation({ + type: "gcj02", + success(res) { + location.lat = res.latitude; + location.long = res.longitude; + uni.setStorageSync('location', JSON.stringify(location)) + checkOrder(); + }, + fail() { + uni.$u.toast('获取位置当前失败,为你推荐当前门店') + checkOrder(STORE_INFO.id); + }, + complete() {} + }) + } onShow(() => { getAddressList(); })