From c1535f07ba42ea096c68148e545083c120b5f72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E6=9D=B0?= <> Date: Wed, 13 Mar 2024 10:42:14 +0800 Subject: [PATCH] 1 --- src/pages.json | 8 +-- src/pages/booking/booking.vue | 66 ++++++-------------- src/pages/booking/components/SitePanel.vue | 38 +++++------ src/pages/booking/components/TimePanel.vue | 2 +- src/pages/index/index.vue | 13 ++-- src/pages/index/styles/category.scss | 4 +- src/pages/index/styles/category.wxss | 49 +++++++++++++++ src/pages/orderList/components/OrderList.vue | 20 +++--- src/pages/orderList/list.vue | 21 ++++--- src/utils/http.ts | 4 +- 10 files changed, 132 insertions(+), 93 deletions(-) create mode 100644 src/pages/index/styles/category.wxss diff --git a/src/pages.json b/src/pages.json index 94d825f..77e2e23 100644 --- a/src/pages.json +++ b/src/pages.json @@ -13,15 +13,15 @@ }, "pages": [ { - "path": "pages/login/login", + "path": "pages/index/index", "style": { - "navigationBarTitleText": "登录" + "navigationStyle": "custom" } }, { - "path": "pages/index/index", + "path": "pages/login/login", "style": { - "navigationStyle": "custom" + "navigationBarTitleText": "登录" } }, { diff --git a/src/pages/booking/booking.vue b/src/pages/booking/booking.vue index 67988c5..74abac0 100644 --- a/src/pages/booking/booking.vue +++ b/src/pages/booking/booking.vue @@ -11,19 +11,23 @@ import SitePanel from './components/SitePanel.vue' const activeMenuKey = ref(0) const activeWeightKey = ref(0) + +const locationStorge = uni.getStorageSync('location') + // 经纬度 let location = reactive({ - longitude: 0, - latitude: 0, + longitude: locationStorge.longitude, + latitude: locationStorge.latitude, }) + // 弹出层组件是否展示 const isShowTimePop = ref(false) const isShowAddressPop = ref(false) const isShowSitePop = ref(false) // 回收地址、回收时间、 回收站点{} -const recycleAddress = ref('请选择回收地址') -const appointmentTime = ref('请选择回收时间') +const recycleAddress = ref('') +const appointmentTime = ref('') const siteObj = ref({}) // 回收订单添加明细 @@ -90,15 +94,15 @@ const categoryList = ref([ const weightMenuList = [ { val: 'I', - name: '10kg以下', + name: '10Kg以下', }, { val: 'II', - name: '10-20kg', + name: '10Kg-20Kg', }, { val: 'III', - name: '20kg以上', + name: '20Kg以上', }, ] @@ -108,44 +112,7 @@ const handleMenuChange = (val) => { const handleWeightChange = (val) => { activeWeightKey.value = val } -// 微信 - 获取当前经纬度 -const getLocationInfo = () => { - uni.getLocation({ - type: 'gcj02', - // isHighAccuracy: true, - // highAccuracyExpireTime: 5000, - success(res) { - console.log(res) - const longitude = res.longitude.toFixed(6) - const latitude = res.latitude.toFixed(6) - location = Object.assign(location, { - longitude: longitude, - latitude: latitude, - }) - uni.setStorageSync('location', location) - - }, - fail(err) { - console.log(err) - uni.showModal({ - content: '检测到您没打开获取定位功能权限,是否去设置打开?', - confirmText: '确认', - cancelText: '取消', - success: function (res) { - if (res.confirm) { - uni.openSetting({ - success() { - getLocationInfo() - }, - }) - } - }, - }) - }, - }) -} onReady(() => { - getLocationInfo() }) // 预约回收 @@ -243,6 +210,13 @@ const handlePointer = () => { uni.chooseLocation({ success: async function (res) { recycleAddress.value = res.address + const longitude = res.longitude.toFixed(6) + const latitude = res.latitude.toFixed(6) + location = Object.assign(location, { + longitude: longitude, + latitude: latitude, + }) + uni.setStorageSync('location', location) console.log(res, '返回地址') }, fail: function (e) { @@ -268,11 +242,11 @@ const handlePointer = () => { 时间: - {{ appointmentTime }} + {{ appointmentTime || '请选择回收时间' }} 地址: - {{ recycleAddress }} + {{ recycleAddress || '请选择回收地址' }} + + + + { {{ item.address }} - - - - + + @@ -151,17 +151,17 @@ page { text-align: center; } } - .content { + .scroll-view { min-height: 300rpx; max-height: 540rpx; overflow: auto; - padding: 20rpx; + padding: 20rpx 10rpx; margin-bottom: 40rpx; .item { padding: 30rpx 50rpx 30rpx 60rpx; position: relative; box-shadow: 0px -2px 8px 0px rgba(133, 155, 180, 0.4); - margin: 10rpx 0; + margin: 10rpx; border-radius: 10rpx; } .location { diff --git a/src/pages/booking/components/TimePanel.vue b/src/pages/booking/components/TimePanel.vue index ea80f84..af84351 100644 --- a/src/pages/booking/components/TimePanel.vue +++ b/src/pages/booking/components/TimePanel.vue @@ -120,7 +120,7 @@ const selectLDate = (val) => { t[3].disabled = true t[4].disabled = true timeList = t - } else if (nowH <= 21) { + } else if (nowH <= 21 || nowH > 21) { t[0].disabled = true t[1].disabled = true t[2].disabled = true diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 21db650..4797538 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,6 +1,6 @@