From 22b6b75ab024f1503a3c54d33825b7594166a016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E6=9D=B0?= <> Date: Tue, 12 Mar 2024 09:49:37 +0800 Subject: [PATCH] no message --- src/pages/booking/booking.vue | 66 ++++++-------------- src/pages/booking/components/SitePanel.vue | 8 +-- src/pages/index/components/CategoryPanel.vue | 6 +- src/pages/index/index.vue | 40 +++++++----- src/pages/my/my.vue | 4 +- src/pages/orderDetail/orderDetail.vue | 38 ++++++----- src/pages/orderList/components/OrderList.vue | 18 +++--- src/pages/serviceSite/serviceSite.vue | 11 ++-- src/pagesOrder/list/components/OrderList.vue | 8 +-- src/utils/http.ts | 4 +- 10 files changed, 92 insertions(+), 111 deletions(-) diff --git a/src/pages/booking/booking.vue b/src/pages/booking/booking.vue index bda2d38..47fa508 100644 --- a/src/pages/booking/booking.vue +++ b/src/pages/booking/booking.vue @@ -12,8 +12,10 @@ const activeMenuKey = ref(0) const activeWeightKey = ref(0) // 经纬度 -const longitude = ref(121.404032) -const latitude = ref(31.163973) +let location = reactive({ + longitude: '', + latitude: '', +}) // 弹出层组件是否展示 const isShowTimePop = ref(false) const isShowAddressPop = ref(false) @@ -114,35 +116,15 @@ const getLocationInfo = () => { // highAccuracyExpireTime: 5000, success(res) { console.log(res) - longitude.value = res.longitude - latitude.value = res.latitude - }, - fail(err) { - console.log(err) - uni.showModal({ - content: '检测到您没打开获取定位功能权限,是否去设置打开?', - confirmText: '确认', - cancelText: '取消', - success: function (res) { - if (res.confirm) { - uni.openSetting({ - success() { - getLocationInfo() - }, - }) - } - }, + location = Object.assign(location, { + longitude: res.longitude, + latitude: res.latitude, }) - }, - }) -} -const getAuthorizeInfo = () => { - uni.authorize({ - scope: 'scope.userLocation', - success(res) { - getLocationInfo() + uni.setStorageSync('location', location) + }, fail(err) { + console.log(err) uni.showModal({ content: '检测到您没打开获取定位功能权限,是否去设置打开?', confirmText: '确认', @@ -160,20 +142,8 @@ const getAuthorizeInfo = () => { }, }) } -// 微信 - 获取设置信息 -const getSettingInfo = () => { - uni.getSetting({ - success(res) { - if (res.authSetting['scope.userLocation']) { - getLocationInfo() - } else { - getAuthorizeInfo() - } - }, - }) -} onReady(() => { - getSettingInfo() + getLocationInfo() }) // 预约回收 @@ -191,10 +161,8 @@ const handleBooking = async () => { appointmentTimeStart, appointmentTimeEnd, location: { - // longitude: longitude.value, - // latitude: latitude.value, - latitude: '31.163973', - longitude: '121.444032', + longitude: longitude.value, + latitude: latitude.value, }, orderDetails: orderDetailsFilter, recycleAddress: recycleAddress.value, @@ -271,7 +239,13 @@ const bindPickerChange = (e, item) => {