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 @@
@@ -31,12 +39,7 @@ orderTabs.value[activeIndex.value].isRender = true
class="item"
v-for="(item, index) in orderTabs"
:key="item.title"
- @tap="
- () => {
- activeIndex = index
- item.isRender = true
- }
- "
+ @tap="handleIndexChange(index)"
>
{{ item.title }}
@@ -44,7 +47,11 @@ orderTabs.value[activeIndex.value].isRender = true
-
+
diff --git a/src/utils/http.ts b/src/utils/http.ts
index 0417d8a..b043226 100644
--- a/src/utils/http.ts
+++ b/src/utils/http.ts
@@ -11,8 +11,8 @@
* 4. 添加 token 请求头标识
*/
import { useMemberStore } from '@/stores'
-const baseURL = 'http://192.168.0.166:8808/api'
-// const baseURL = 'http://222.71.165.188:8808/api'
+// const baseURL = 'http://192.168.0.166:8808/api'
+const baseURL = 'http://222.71.165.188:8808/api'
// 添加拦截器
const httpInterceptor = {
// 拦截前触发