diff --git a/src/pages.json b/src/pages.json index df53b6e..992ffcd 100644 --- a/src/pages.json +++ b/src/pages.json @@ -11,7 +11,14 @@ "^Xtx(.*)": "@/components/Xtx$1.vue" } }, - "pages": [ + "pages": [{ + "path": "pages/my/my", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "我的" + } + }, { "path": "pages/booking/booking", "style": { @@ -25,7 +32,7 @@ } }, - + //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", @@ -35,12 +42,6 @@ "navigationBarTitleText": "首页" } }, - { - "path": "pages/serviceSite/serviceSite", - "style": { - "navigationBarTitleText": "服务站列表" - } - }, { "path": "pages/siteDetail/siteDetail", "style": { @@ -54,20 +55,7 @@ "navigationBarTitleText": "商品分类" } }, - { - "path": "pages/orerdList/orerdList", - "style": { - "navigationBarTitleText": "订单列表" - } - }, - { - "path": "pages/my/my", - "style": { - "navigationStyle": "custom", - "navigationBarTextStyle": "white", - "navigationBarTitleText": "我的" - } - }, + { "path": "pages/login/login", "style": { @@ -91,7 +79,19 @@ "style": { "navigationBarTitleText": "商品详情" } - } + }, + { + "path": "pages/serviceSite/serviceSite", + "style": { + "navigationBarTitleText": "服务站" + } + }, + { + "path": "pages/orerdList/orerdList", + "style": { + "navigationBarTitleText": "订单" + } + }, ], "globalStyle": { "navigationBarTextStyle": "black", @@ -105,31 +105,30 @@ "selectedColor": "#3775F6", "backgroundColor": "#fff", "borderStyle": "white", - "list": [ - { + "list": [{ "text": "首页", "pagePath": "pages/index/index", "iconPath": "static/tabs/home_default.png", "selectedIconPath": "static/tabs/home_selected.png" }, - { - "text": "服务站", - "pagePath": "pages/serviceSite/serviceSite", - "iconPath": "static/tabs/category_default.png", - "selectedIconPath": "static/tabs/category_selected.png" - }, + // { + // "text": "服务站", + // "pagePath": "pages/serviceSite/serviceSite", + // "iconPath": "static/tabs/site_default.png", + // "selectedIconPath": "static/tabs/site_selected.png" + // }, { "text": "一键预约", "pagePath": "pages/booking/booking", - "iconPath": "static/tabs/cart_default.png", - "selectedIconPath": "static/tabs/cart_selected.png" - }, - { - "text": "订单", - "pagePath": "pages/orerdList/orerdList", - "iconPath": "static/tabs/cart_default.png", - "selectedIconPath": "static/tabs/cart_selected.png" + "iconPath": "static/tabs/booking_default.png", + "selectedIconPath": "static/tabs/booking_selected.png" }, + // { + // "text": "订单", + // "pagePath": "pages/orerdList/orerdList", + // "iconPath": "static/tabs/cart_default.png", + // "selectedIconPath": "static/tabs/cart_selected.png" + // }, { "text": "我的", "pagePath": "pages/my/my", @@ -139,13 +138,11 @@ ] }, // 分包加载规则 - "subPackages": [ - { + "subPackages": [{ // 子包的根目录 "root": "pagesMember", // 页面路径和窗口表现 - "pages": [ - { + "pages": [{ "path": "settings/settings", "style": { "navigationBarTitleText": "设置" @@ -175,8 +172,7 @@ }, { "root": "pagesOrder", - "pages": [ - { + "pages": [{ "path": "create/create", "style": { "navigationBarTitleText": "填写订单" diff --git a/src/pages/booking/booking.vue b/src/pages/booking/booking.vue index 207c444..3d0e9ed 100644 --- a/src/pages/booking/booking.vue +++ b/src/pages/booking/booking.vue @@ -3,6 +3,8 @@ import { computed, ref } from 'vue' import { onLoad, onReady } from '@dcloudio/uni-app' import TimePopup from './components/timePopup.vue' import AddressPopup from './components/addressPopup.vue' +import { postBookingAPI } from '@/services/booking' + const activeMenuKey = ref(0) const activeWeightKey = ref(0) @@ -10,12 +12,10 @@ const activeWeightKey = ref(0) // 地图 const longitude = ref(0) const latitude = ref(0) - // 弹出层组件 const timeChildPopup = ref() const addressChildPopup = ref() - const addressLabel = ref('取件地址') const timdeLabel = ref('取件时间') @@ -63,10 +63,13 @@ const handleMenuChange = (val) => { const handleWeightChange = (val) => { activeWeightKey.value = val } -const handleToto = () => { - uni.navigateTo({ url: '/pages/booking/booking-success' }) +const handleBooking = async () => { + const params = {} + const res = await postBookingAPI(params) + if (res.code) { + uni.navigateTo({ url: '/pages/booking/booking-success' }) + } } - // 微信 - 获取当前经纬度 const getLocationInfo = () => { uni.getLocation({ @@ -205,7 +208,7 @@ const handleAddressPopChange = (val) => { - 立即预约回收 + 立即预约回收 diff --git a/src/pages/index/components/CustomNavbar.vue b/src/pages/index/components/CustomNavbar.vue index ab47575..5ab8332 100644 --- a/src/pages/index/components/CustomNavbar.vue +++ b/src/pages/index/components/CustomNavbar.vue @@ -1,3 +1,11 @@ + @@ -344,9 +397,27 @@ page { } } -/* 猜你喜欢 */ -.guess { - background-color: #f7f7f8; - margin-top: 20rpx; +.module { + margin: 40rpx 0; + .module-title { + font-size: 30rpx; + margin: 20rpx; + } + .module-list { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + .item { + width: 160rpx; + height: 160rpx; + margin: 0 10rpx; + background: #F2F2FA; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + } } diff --git a/src/pages/serviceSite/serviceSite.vue b/src/pages/serviceSite/serviceSite.vue index 17fa340..193001b 100644 --- a/src/pages/serviceSite/serviceSite.vue +++ b/src/pages/serviceSite/serviceSite.vue @@ -29,7 +29,6 @@ const isLoading = ref(false) const isFinish = ref(false) const getDataList = async () => { - debugger // 如果数据出于加载中,退出函数 if (isLoading.value) return // 退出分页判断 diff --git a/src/services/booking.ts b/src/services/booking.ts new file mode 100644 index 0000000..b503c7f --- /dev/null +++ b/src/services/booking.ts @@ -0,0 +1,21 @@ +/* + * @Author: 王文杰 + * @Date: 2024-03-05 17:18:02 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-05 17:44:43 + * @FilePath: /app-nx-personal/src/services/booking.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { PageResult } from '@/types/global' +import { http } from '@/utils/http' +/** + * 一键预约 + * @param data orderState 订单状 + */ +export const postBookingAPI = (data: any) => { + return http({ + method: 'POST', + url: `/order/create`, + data, + }) +} diff --git a/src/static/images/cart_selected.png b/src/static/images/cart_selected.png index 130bd91..d16efb1 100644 Binary files a/src/static/images/cart_selected.png and b/src/static/images/cart_selected.png differ diff --git a/src/static/images/site_selected.png b/src/static/images/site_selected.png new file mode 100644 index 0000000..565be97 Binary files /dev/null and b/src/static/images/site_selected.png differ diff --git a/src/static/tabs/booking_default.png b/src/static/tabs/booking_default.png new file mode 100644 index 0000000..13e16a1 Binary files /dev/null and b/src/static/tabs/booking_default.png differ diff --git a/src/static/tabs/booking_selected.png b/src/static/tabs/booking_selected.png new file mode 100644 index 0000000..26440e7 Binary files /dev/null and b/src/static/tabs/booking_selected.png differ diff --git a/src/static/tabs/category_selected.png b/src/static/tabs/category_selected.png deleted file mode 100644 index 2f32af1..0000000 Binary files a/src/static/tabs/category_selected.png and /dev/null differ diff --git a/src/static/tabs/home_selected.png b/src/static/tabs/home_selected.png index 82e787b..a1486f2 100644 Binary files a/src/static/tabs/home_selected.png and b/src/static/tabs/home_selected.png differ diff --git a/src/static/tabs/category_default.png b/src/static/tabs/site_default.png similarity index 100% rename from src/static/tabs/category_default.png rename to src/static/tabs/site_default.png diff --git a/src/static/tabs/site_selected.png b/src/static/tabs/site_selected.png new file mode 100644 index 0000000..565be97 Binary files /dev/null and b/src/static/tabs/site_selected.png differ diff --git a/src/utils/http.ts b/src/utils/http.ts index e4c02d2..630b0ab 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -30,7 +30,6 @@ const httpInterceptor = { // 4. 添加 token 请求头标识 const memberStore = useMemberStore() const token = memberStore.profile?.token - debugger if (token) { options.header.authorization = token }