Commit 5372dfcd by liimin

feat(HomeFrame): 添加订单组件并优化样式布局

- 在HomeFrame中引入Order组件
- 重构OrderList的顶部筛选区域,使用PageTabs组件
- 调整RecordList和OrderList的内边距和背景样式
- 为滚动容器增加底部内边距,优化用户体验
1 parent ecee1012
......@@ -2,13 +2,13 @@
<view>
<view class="study-right">
<view class="data-container">
<view :class="['type-box']">
<view class="tab-item" v-for="(i, index) in typeList" :key="index" @click="changeType(index)"
:class="{ active: firstIndex == index }">
<view class="label">{{ i.tabName }}</view>
<view class="count">{{ i.num() }}</view>
</view>
<!-- 顶部筛选区域 -->
<view class="control-box">
<view :class="['type-box']">
<page-tabs :list="pageTabList" :current="firstIndex" @changeTab="changeType" />
</view>
</view>
<template v-if="list.length > 0">
<scroll-view scroll-y class="content-scroll" @scrolltolower="loadMore" lower-threshold="60">
......@@ -53,9 +53,11 @@
</template>
<script>
import tag from 'uview-ui/libs/config/props/tag';
import PageTabs from '@/components/PageTabs.vue'
export default {
components: {
PageTabs
},
data() {
return {
......@@ -67,6 +69,12 @@ export default {
{ tabName: '已支付', num: () => '' },
{ tabName: '待支付', num: () => '' }
],
// 适配 PageTabs 的数据格式
pageTabList: [
{ text: '全部' },
{ text: '已支付' },
{ text: '待支付' }
],
page: {
pageNum: 1,
pageSize: 12
......@@ -153,63 +161,54 @@ export default {
.data-container {
margin-top: toRpx(80);
// background: #ffffff;
border-radius: toRpx(48);
height: calc(100vh - #{toRpx(192)});
height: calc(100vh - #{toRpx(162)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
overflow: hidden;
padding: toRpx(40) toRpx(48);
padding: 0; /* 移除内边距,改由内部元素控制 */
display: flex;
flex-direction: column;
.type-box {
position: relative;
.control-box {
margin: toRpx(24) toRpx(32) 0;
background: rgba(255, 255, 255, 0.6); /* 调整为半透明白色,融入背景 */
backdrop-filter: blur(10px); /* 增加毛玻璃效果 */
border-radius: toRpx(24);
padding: toRpx(16) toRpx(24);
box-shadow: 0 toRpx(2) toRpx(8) rgba(0, 0, 0, 0.02);
border: 1px solid rgba(255, 255, 255, 0.4); /* 边框也调淡 */
flex-shrink: 0;
z-index: 10;
height: auto;
display: flex;
align-items: center;
width: 100%;
// background-color: #eef4fe;
height: toRpx(72);
border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0;
.tab-item {
display: inline-flex;
align-items: center;
height: 100%;
width: toRpx(164);
padding: 0 toRpx(24);
background: #fff;
border-radius: toRpx(16);
font-weight: 500;
font-size: toRpx(28);
color: #596170;
margin-right: toRpx(16);
.label {
width: 100%;
text-align: center;
font-size: toRpx(28);
}
.count {
margin-left: toRpx(8);
font-size: toRpx(26);
color: #8B97A3;
}
&.active {
background: linear-gradient(90deg, #5AA2FF 0%, #3B73FF 100%);
color: #FFFFFF;
.count {
color: rgba(255, 255, 255, 0.9);
}
}
align-items: center;
box-sizing: border-box;
/* width: fit-content; */ /* 恢复铺满 */
.type-box {
display: flex;
background: transparent;
padding: 0;
border-radius: 0;
width: auto;
min-width: toRpx(500);
height: toRpx(88);
}
}
.content-scroll {
flex: 1;
height: 0;
padding-top: toRpx(20);
padding-left: toRpx(48);
padding-right: toRpx(48);
box-sizing: border-box;
}
/* 之前的 type-box 样式可能需要覆盖或删除 */
}
}
......
......@@ -433,13 +433,12 @@ export default {
width: 100%;
height: 100%;
box-sizing: border-box;
.data-container {
width: 100%;
height: 100%;
position: relative;
border-radius: toRpx(24);
background: #ffffff;
// background: #ffffff;
/* padding: toRpx(32); 移除容器内边距,改由内部元素控制 */
box-sizing: border-box;
display: flex;
......@@ -455,7 +454,7 @@ export default {
position: relative;
/* 新增设计样式 */
background: #ffffff;
// background: #ffffff;
border-radius: toRpx(24);
padding: toRpx(24) toRpx(32);
box-shadow: 0 toRpx(4) toRpx(16) rgba(0, 0, 0, 0.04); /* 减轻投影 */
......@@ -501,6 +500,7 @@ export default {
height: 0; /* 配合 flex: 1 启用滚动 */
position: relative;
z-index: 4;
padding-bottom: toRpx(20); /* 在滚动容器层级增加底部内边距 */
.record-tips {
height: toRpx(76);
......@@ -520,7 +520,7 @@ export default {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(32) toRpx(32) 0; /* 调整内边距,给顶部留出空间 */
padding: toRpx(32) toRpx(32) toRpx(20); /* 增加底部内边距 */
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
......
......@@ -39,9 +39,10 @@ import versionCheck from '@/mixin/versionCheck.js'
import LeftSide from './components/LeftSide.vue'
import Material from '@/components/MaterialIndex.vue'
import HomeSlot from './components/HomeSlot.vue'
import Order from './components/Order/index.vue'
export default {
mixins: [recorder, uploader, timeout, versionCheck],
components: { LeftSide, Material, ReceptionCenter, FinishReceptionDialog, StoreAddress, HomeSlot },
components: { LeftSide, Material, ReceptionCenter, FinishReceptionDialog, StoreAddress, HomeSlot, Order },
props: {
id: [String, Number],
finishDoneText: String,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!