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

View File

@@ -1,5 +1,45 @@
<template>
<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"
@@ -106,13 +146,19 @@
import {
fetchDayOrderList,
} from '@/api/index';
const date = ref('');
const day = ref('');
onLoad((options) => {
date.value = options.date
console.log(date.value);
day.value = options.date
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([]);
@@ -123,11 +169,11 @@
// 获取订单列表
const queryList = (pageNo = 1, pageSize = 10) => {
console.log(date.value);
console.log(day.value);
const params = {
page: pageNo,
pageSize: 10,
date: date.value,
date: day.value,
}
fetchDayOrderList(params).then(res => {
console.log(res);
@@ -161,43 +207,59 @@
background-color: #f2f3f5;
}
.title-list {
display: flex;
justify-content: space-around;
.top-bar {
background: #fff;
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;
}
}
text-align: center;
padding: 20rpx 60rpx;
}
.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 {
display: flex;