feat(order): add order detail and list pages with components for order management
- Implemented order detail page with components for displaying order status, user info, and refund options. - Created order list page with pagination and order cards for displaying all orders. - Added styles for order detail and list pages. - Developed a prompt document outlining component requirements for the order management system. - Introduced a new Card component for quick booking with a responsive design. - Enhanced Tabs component for better navigation between different categories. - Integrated z-paging for efficient data loading and management in order and quick booking lists. - Added service order card component for displaying service requests with call functionality. - Updated main CSS for improved viewport handling.
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="index-page w-full h-screen overflow-hidden bg-liner">
|
||||
<ChatMainList @showDrawer="showDrawer" />
|
||||
|
||||
<!-- 日历组件 -->
|
||||
<Calender
|
||||
:visible="calendarVisible"
|
||||
mode="single"
|
||||
:default-value="selectedDate"
|
||||
@close="handleCalendarClose"
|
||||
@select="handleDateSelect"
|
||||
/>
|
||||
|
||||
<!-- 更多服务 -->
|
||||
<MoreService />
|
||||
|
||||
<!-- 抽屉组件 -->
|
||||
<DrawerSection ref="drawerRef" @close="closeDrawer" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { ref, onUnmounted, onMounted } from "vue";
|
||||
import { getUrlParams } from "@/utils/UrlParams";
|
||||
import { useAppStore } from "@/store";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
import ChatMainList from "../ChatMain/ChatMainList/index.vue";
|
||||
import MoreService from "../ChatModule/MoreService/index.vue";
|
||||
import DrawerSection from "../DrawerSection/index.vue";
|
||||
import Calender from "@/components/Calender/index.vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const calendarVisible = ref(false);
|
||||
const selectedDate = ref("");
|
||||
|
||||
// 处理日历关闭
|
||||
const handleCalendarClose = () => {
|
||||
calendarVisible.value = false;
|
||||
};
|
||||
|
||||
// 处理日期选择
|
||||
const handleDateSelect = (data) => {
|
||||
selectedDate.value = data.date;
|
||||
calendarVisible.value = false;
|
||||
console.log("选择的日期:", data.date);
|
||||
uni.$emit("selectCalendarDate", selectedDate.value); // 传回父组件
|
||||
};
|
||||
|
||||
const openCalendar = () => {
|
||||
calendarVisible.value = true;
|
||||
};
|
||||
|
||||
// 打开窗口
|
||||
const drawerRef = ref(null);
|
||||
const showDrawer = async (e) => {
|
||||
await checkToken();
|
||||
|
||||
drawerRef.value?.open?.();
|
||||
};
|
||||
// 关闭窗口
|
||||
const closeDrawer = (e) => drawerRef.value?.close?.();
|
||||
|
||||
///获取到二维码原始链接内容
|
||||
const getWeixinMiniProgramParams = (e) => {
|
||||
console.log("Params:", e);
|
||||
if (e.q && e.q != "undefined") {
|
||||
const qrUrl = decodeURIComponent(e.q);
|
||||
const params = getUrlParams(qrUrl);
|
||||
appStore.setSceneId(params.sceneId || params.tagId);
|
||||
}
|
||||
};
|
||||
|
||||
onLoad((e) => {
|
||||
getWeixinMiniProgramParams(e);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
uni.$on("openCalendar", openCalendar);
|
||||
uni.$on("SHOW_DRAWER", showDrawer);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off("openCalendar", openCalendar);
|
||||
uni.$off("SHOW_DRAWER", showDrawer);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index-page {
|
||||
position: relative;
|
||||
min-height: 0;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
.top {
|
||||
margin-top: 150px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user