diff --git a/src/pages.json b/src/pages.json
index 34291d5..c2f266a 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -12,6 +12,12 @@
}
},
"pages": [
+ {
+ "path": "pages/booking/booking",
+ "style": {
+ "navigationBarTitleText": "一键预约"
+ }
+ },
{
"path": "pages/login/login",
"style": {
@@ -32,12 +38,7 @@
"navigationBarTitleText": "我的"
}
},
- {
- "path": "pages/booking/booking",
- "style": {
- "navigationBarTitleText": "一键预约"
- }
- },
+
{
"path": "pages/booking/booking-success",
"style": {
diff --git a/src/pages/booking/booking.vue b/src/pages/booking/booking.vue
index ea4b75f..5ebe014 100644
--- a/src/pages/booking/booking.vue
+++ b/src/pages/booking/booking.vue
@@ -5,7 +5,9 @@ import TimePopup from './components/timePopup.vue'
import AddressPopup from './components/addressPopup.vue'
import SitePopup from './components/sitePopup.vue'
import { postBookingAPI } from '@/services/booking'
-
+import AddressPanel from './components/AddressPanel.vue'
+import TimePanel from './components/TimePanel.vue'
+import SitePanel from './components/SitePanel.vue'
const activeMenuKey = ref(0)
const activeWeightKey = ref(0)
@@ -18,9 +20,9 @@ const isShowAddressPop = ref(false)
const isShowSitePop = ref(false)
// 回收地址、回收时间、 回收站点
-const recycleAddress = ref('')
-const appointmentTime = ref('')
-const siteLabel = ref('')
+const recycleAddress = ref('请选择回收地址')
+const appointmentTime = ref('请选择回收时间')
+const siteLabel = ref('请选择回收站点')
const recycleStationId = ref('521632060801030597')
// 是否可以预约
@@ -196,17 +198,37 @@ const handleBooking = async () => {
}
}
+// uni-ui 弹出层组件 ref
+const popup = ref<{
+ open: (type?: UniHelper.UniPopupType) => void
+ close: () => void
+}>()
+
+// 弹出层条件渲染
+const popupName = ref<'address' | 'time' | 'site'>()
+const openPopup = (name: typeof popupName.value) => {
+ // 修改弹出层名称
+ popupName.value = name
+ popup.value?.open()
+}
+const handlePopClose = (item) => {
+ if (popupName.value == 'time') {
+ appointmentTime.value = item
+ }
+ if (popupName.value == 'address') {
+ recycleAddress.value = item.location
+ }
+ if (popupName.value == 'site') {
+ recycleAddress.value = item.name
+ }
+
+ popup.value?.close()
+}
-
+
取件信息
-
-
-
-
+
+
+
+ 时间:
+ {{ appointmentTime }}
+
+
+ 地址:
+ {{ recycleAddress }}
+
+
+ 站点:
+ {{ siteLabel }}
+
+
-
-
-
+
+
+
+
+
+
+
立即预约回收
@@ -375,6 +412,44 @@ page {
}
}
}
+
+ .action {
+ padding-left: 20rpx;
+ .item {
+ height: 90rpx;
+ padding-right: 60rpx;
+ border-bottom: 1rpx solid #eaeaea;
+ font-size: 26rpx;
+ color: #333;
+ position: relative;
+ display: flex;
+ align-items: center;
+ &:last-child {
+ border-bottom: 0 none;
+ }
+ }
+ .label {
+ width: 100rpx;
+ color: #898b94;
+ margin: 0 16rpx 0 10rpx;
+ }
+ .text {
+ flex: 1;
+ -webkit-line-clamp: 1;
+ }
+ .arrow {
+ &::after {
+ position: absolute;
+ top: 50%;
+ right: 30rpx;
+ content: '\e6c2';
+ color: #ccc;
+ font-family: 'erabbit' !important;
+ font-size: 32rpx;
+ transform: translateY(-50%);
+ }
+ }
+ }
.submit {
display: flex;
flex-direction: column;
diff --git a/src/pages/booking/components/AddressPanel.vue b/src/pages/booking/components/AddressPanel.vue
new file mode 100644
index 0000000..5e55306
--- /dev/null
+++ b/src/pages/booking/components/AddressPanel.vue
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+ 配送至
+
+
+
+ {{ item.name }}
+ {{ item.location }}
+
+
+
+
+
+
+
+
diff --git a/src/pages/booking/components/sitePopup.vue b/src/pages/booking/components/SitePanel.vue
similarity index 91%
rename from src/pages/booking/components/sitePopup.vue
rename to src/pages/booking/components/SitePanel.vue
index b7f79a9..7e52883 100644
--- a/src/pages/booking/components/sitePopup.vue
+++ b/src/pages/booking/components/SitePanel.vue
@@ -22,8 +22,14 @@ const dataList = ref([])
const isLoading = ref(false)
// 是否分页结束
const isFinish = ref(false)
-// 定义返回给父组件的方法
-const emit = defineEmits(['change'])
+// 子调父
+const emit = defineEmits<{
+ (event: 'close'): void
+}>()
+
+const handleClose = () => {
+ emit('close', siteSelected.value)
+}
const getDataList = async () => {
// 如果数据出于加载中,退出函数
@@ -49,13 +55,6 @@ const getDataList = async () => {
isFinish.value = true
}
}
-const show = async ()=> {
- await getDataList()
- sitePopup.value?.open?.()
-}
-const hide = ()=> {
- emit('change', siteSelected.value)
-}
const isTriggered = ref(false)
// 自定义下拉刷新被触发
@@ -74,21 +73,19 @@ const onRefresherrefresh = async () => {
const handleSelected = (e) => {
const item = e.target.dataset.val
siteSelected.value = item
- hide()
}
// 页面加载
onReady(async () => {
- show()
})
-
+
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index f13edaf..24528d8 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -24,12 +24,6 @@ const bannerList = ref([
hrefUrl: '1019000',
type: '1',
},
- {
- hrefUrl: '1005000',
- id: '3',
- imgUrl: '/static/images/banner3.jpg',
- type: '1',
- },
])
// 获取前台分类数据
const categoryList = ref([
diff --git a/src/pages/siteDetail/siteDetail.vue b/src/pages/siteDetail/siteDetail.vue
index 3e303ea..4e550dc 100644
--- a/src/pages/siteDetail/siteDetail.vue
+++ b/src/pages/siteDetail/siteDetail.vue
@@ -15,12 +15,6 @@ const bannerList = [
hrefUrl: '1019000',
type: '1',
},
- {
- hrefUrl: '1005000',
- id: '3',
- imgUrl: '/static/images/banner3.jpg',
- type: '1',
- },
]
const leiList = [
{
diff --git a/src/static/images/banner3.jpg b/src/static/images/banner3.jpg
deleted file mode 100644
index 266c481..0000000
Binary files a/src/static/images/banner3.jpg and /dev/null differ
diff --git a/src/utils/http.ts b/src/utils/http.ts
index 462cfae..5993ffa 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 = {
// 拦截前触发