Commit 5372dfcd by liimin

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

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