This commit is contained in:
2026-01-16 05:02:55 +08:00
parent 15d5dc5255
commit 578189d316

View File

@@ -1,6 +1,46 @@
<template> <template>
<view class="page-content"> <view class="page-content">
<nut-sticky>
<view class="top-bar">
<view class="top-inner-price">
<view style="display: flex;">{{day}}日营业额
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view>
<view style="display: flex;">{{formatDate(day)}}月营业额
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view>
<!-- <view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view> -->
</view>
<view class="top-inner-price">
<view style="display: flex;">优惠
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view>
<view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view>
<view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
</view>
</view>
</view>
</nut-sticky>
<z-paging ref="paging" :fixed="false" style="height: 88vh;" class="order-list" v-model="dataList" <z-paging ref="paging" :fixed="false" style="height: 88vh;" class="order-list" v-model="dataList"
@query="queryList"> @query="queryList">
@@ -106,28 +146,34 @@
import { import {
fetchDayOrderList, fetchDayOrderList,
} from '@/api/index'; } from '@/api/index';
const date = ref(''); const day = ref('');
onLoad((options) => { onLoad((options) => {
date.value = options.date day.value = options.date
console.log(date.value); console.log(day.value);
}) })
// 格式化日期为 Y-m 格式
const formatDate = (date) => {
const d = new Date(date)
const year = d.getFullYear(); // 获取年份
const month = (d.getMonth() + 1).toString().padStart(2, '0'); // 获取月份并确保是两位数
return `${year}-${month}`;
};
// 订单列表数据 // 订单列表数据
const dataList = ref([]); const dataList = ref([]);
// zp // zp
const paging = ref(null); const paging = ref(null);
// 获取订单列表 // 获取订单列表
const queryList = (pageNo = 1, pageSize = 10) => { const queryList = (pageNo = 1, pageSize = 10) => {
console.log(date.value); console.log(day.value);
const params = { const params = {
page: pageNo, page: pageNo,
pageSize: 10, pageSize: 10,
date: date.value, date: day.value,
} }
fetchDayOrderList(params).then(res => { fetchDayOrderList(params).then(res => {
console.log(res); console.log(res);
@@ -161,43 +207,59 @@
background-color: #f2f3f5; background-color: #f2f3f5;
} }
.title-list { .top-bar {
display: flex; background: #fff;
justify-content: space-around;
align-items: center; align-items: center;
width: 100%; text-align: center;
padding: 20rpx 60rpx;
.title-item {
display: flex;
justify-content: space-around;
align-items: center;
position: relative;
}
.tabs-active {
font-weight: bold;
color: $tabs-titles-item-active-color;
opacity: $tabs-titles-item-line-opacity;
transition: width 0.3s ease;
.item__line {
position: absolute;
bottom: -10%;
left: 50%;
overflow: hidden;
content: ' ';
border-radius: $tabs-titles-item-line-border-radius;
opacity: $tabs-titles-item-line-opacity;
transition: width 0.3s ease;
transform: translate(-50%, 0);
width: $tabs-horizontal-titles-item-active-line-width;
height: 3px;
content: ' ';
background: $tabs-horizontal-tab-line-color;
}
}
} }
.top-inner-price {
display: flex;
flex-direction: column;
justify-content: space-evenly;
padding: 20rpx;
font-size: 26rpx;
align-items: center;
}
// .title-list {
// display: flex;
// justify-content: space-around;
// align-items: center;
// width: 100%;
// .title-item {
// display: flex;
// justify-content: space-around;
// align-items: center;
// position: relative;
// }
// .tabs-active {
// font-weight: bold;
// color: $tabs-titles-item-active-color;
// opacity: $tabs-titles-item-line-opacity;
// transition: width 0.3s ease;
// .item__line {
// position: absolute;
// bottom: -10%;
// left: 50%;
// overflow: hidden;
// content: ' ';
// border-radius: $tabs-titles-item-line-border-radius;
// opacity: $tabs-titles-item-line-opacity;
// transition: width 0.3s ease;
// transform: translate(-50%, 0);
// width: $tabs-horizontal-titles-item-active-line-width;
// height: 3px;
// content: ' ';
// background: $tabs-horizontal-tab-line-color;
// }
// }
// }
.order-list { .order-list {
display: flex; display: flex;