部分问题修复,修改数据统计接口
This commit is contained in:
@@ -1,30 +1,40 @@
|
||||
<template>
|
||||
<view class="mask" v-if="show" @tap="close">
|
||||
<view class="box" @tap.stop="nullFunction">
|
||||
<view class="u-flex u-relative u-row-center u-p-30 top">
|
||||
<view class="font-bold u-font-32">筛选日期时间</view>
|
||||
<view class="close" @tap="close">
|
||||
<uni-icons type="closeempty" size="24"></uni-icons>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="u-p-30 u-flex u-flex-wrap gap-20 fastTime">
|
||||
<view class="mask" v-if="show" @tap="close">
|
||||
<view class="box" @tap.stop="nullFunction">
|
||||
<view class="u-flex u-relative u-row-center u-p-30 top">
|
||||
<view class="font-bold u-font-32">筛选日期时间</view>
|
||||
<view class="close" @tap="close">
|
||||
<uni-icons type="closeempty" size="24"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="u-p-30 u-flex u-flex-wrap gap-20 fastTime">
|
||||
<view class="item" v-for="(item,index) in fastTime" :key="index" @tap="changeTime(item.key)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view> -->
|
||||
<picker-view :immediate-change="true" @pickend="pickend" :value="value" @change="bindChange"
|
||||
class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
<picker-view
|
||||
:immediate-change="true"
|
||||
@pickend="pickend"
|
||||
:value="value"
|
||||
@change="bindChange"
|
||||
class="picker-view"
|
||||
>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in years" :key="index"
|
||||
>{{ item }}年</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in months" :key="index"
|
||||
>{{ item }}月</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in days" :key="index"
|
||||
>{{ item }}日</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
@@ -33,20 +43,31 @@
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>
|
||||
</picker-view-column> -->
|
||||
</picker-view>
|
||||
<view class="u-text-center color-999">至</view>
|
||||
<picker-view :immediate-change="true" :value="value1" @pickend="pickend1" @change="bindChange1"
|
||||
class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in days1" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
</picker-view>
|
||||
<view class="u-text-center color-999">至</view>
|
||||
<picker-view
|
||||
:immediate-change="true"
|
||||
:value="value1"
|
||||
@pickend="pickend1"
|
||||
@change="bindChange1"
|
||||
class="picker-view"
|
||||
>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in years" :key="index"
|
||||
>{{ item }}年</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in months" :key="index"
|
||||
>{{ item }}月</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item, index) in days1" :key="index"
|
||||
>{{ item }}日</view
|
||||
>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
@@ -55,394 +76,402 @@
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>
|
||||
</picker-view-column> -->
|
||||
</picker-view>
|
||||
|
||||
<!-- 站位 -->
|
||||
<view style="height: 80px;"></view>
|
||||
<view class="fixed_b">
|
||||
<my-button shape="circle" @tap="confirm">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</picker-view>
|
||||
|
||||
<!-- 站位 -->
|
||||
<view style="height: 80px"></view>
|
||||
<view class="fixed_b">
|
||||
<my-button shape="circle" @tap="confirm">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import myButton from "@/components/my-components/my-button.vue"
|
||||
import {
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
const $nowDate = new Date()
|
||||
const nowDate = {
|
||||
year: $nowDate.getFullYear(),
|
||||
month: $nowDate.getMonth() + 1,
|
||||
day: $nowDate.getDate(),
|
||||
hours: $nowDate.getHours(),
|
||||
minutes: $nowDate.getMinutes(),
|
||||
seconds: $nowDate.getSeconds()
|
||||
}
|
||||
const yearsLen = 30
|
||||
const years = new Array(yearsLen).fill(1).map((v, index) => {
|
||||
return nowDate.year - index
|
||||
}).reverse()
|
||||
const months = new Array(12).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
})
|
||||
const days = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
}))
|
||||
const days1 = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
}))
|
||||
const hours = new Array(24).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const minutes = new Array(60).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const seconds = new Array(60).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const fastTime = reactive([{
|
||||
title: '今日',
|
||||
key: 'now'
|
||||
},
|
||||
{
|
||||
title: '昨日',
|
||||
key: 'prve'
|
||||
},
|
||||
{
|
||||
title: '本月',
|
||||
key: 'nowMonth'
|
||||
},
|
||||
{
|
||||
title: '上月',
|
||||
key: 'prveMonth'
|
||||
}
|
||||
])
|
||||
import dayjs from "dayjs";
|
||||
import myButton from "@/components/my-components/my-button.vue";
|
||||
import { reactive, ref } from "vue";
|
||||
const $nowDate = new Date();
|
||||
const nowDate = {
|
||||
year: $nowDate.getFullYear(),
|
||||
month: $nowDate.getMonth() + 1,
|
||||
day: $nowDate.getDate(),
|
||||
hours: $nowDate.getHours(),
|
||||
minutes: $nowDate.getMinutes(),
|
||||
seconds: $nowDate.getSeconds(),
|
||||
};
|
||||
const yearsLen = 30;
|
||||
const years = new Array(yearsLen)
|
||||
.fill(1)
|
||||
.map((v, index) => {
|
||||
return nowDate.year - index;
|
||||
})
|
||||
.reverse();
|
||||
const months = new Array(12).fill(1).map((v, index) => {
|
||||
return index + 1;
|
||||
});
|
||||
const days = ref(
|
||||
new Array(getMonthArea($nowDate, "end").getDate()).fill(1).map((v, index) => {
|
||||
return index + 1;
|
||||
})
|
||||
);
|
||||
const days1 = ref(
|
||||
new Array(getMonthArea($nowDate, "end").getDate()).fill(1).map((v, index) => {
|
||||
return index + 1;
|
||||
})
|
||||
);
|
||||
const hours = new Array(24).fill(1).map((v, index) => {
|
||||
return index;
|
||||
});
|
||||
const minutes = new Array(60).fill(1).map((v, index) => {
|
||||
return index;
|
||||
});
|
||||
const seconds = new Array(60).fill(1).map((v, index) => {
|
||||
return index;
|
||||
});
|
||||
const fastTime = reactive([
|
||||
{
|
||||
title: "今日",
|
||||
key: "now",
|
||||
},
|
||||
{
|
||||
title: "昨日",
|
||||
key: "prve",
|
||||
},
|
||||
{
|
||||
title: "本月",
|
||||
key: "nowMonth",
|
||||
},
|
||||
{
|
||||
title: "上月",
|
||||
key: "prveMonth",
|
||||
},
|
||||
]);
|
||||
|
||||
function setPrveDay() {}
|
||||
|
||||
function setNowMoneth() {}
|
||||
|
||||
function setPrveDay() {
|
||||
function setprveMoneth() {}
|
||||
|
||||
}
|
||||
function setDay(start, end) {
|
||||
value.value = [start.year, start.month, start.day, 0, 0, 0];
|
||||
value1.value = [end.year, end.month, end.day, 23, 59, 59];
|
||||
}
|
||||
|
||||
function setNowMoneth() {
|
||||
function changeTime(key) {
|
||||
const yearIndex = years.findIndex((v) => v == nowDate.year);
|
||||
const prveyearIndex = years.findIndex((v) => v == nowDate.year) - 1;
|
||||
const nowMonthIndex = nowDate.month - 1;
|
||||
const nowDayIndex = nowDate.day - 1;
|
||||
const dataMap = {
|
||||
now: function () {
|
||||
return {
|
||||
start: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex,
|
||||
},
|
||||
end: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex,
|
||||
},
|
||||
};
|
||||
},
|
||||
prve: function () {
|
||||
const oneDay = 1000 * 60 * 60 * 24;
|
||||
const date = new Date(
|
||||
new Date(nowDate.year, nowDate.month, nowDate.day, 0, 0, 0).getTime() -
|
||||
oneDay
|
||||
);
|
||||
return {
|
||||
start: {
|
||||
year: years.findIndex((v) => v == date.getFullYear()),
|
||||
month: date.getMonth() - 1 < 0 ? 11 : date.getMonth() - 1,
|
||||
day: date.getDate() - 1,
|
||||
},
|
||||
end: {
|
||||
year: years.findIndex((v) => v == date.getFullYear()),
|
||||
month: date.getMonth() - 1 < 0 ? 11 : date.getMonth() - 1,
|
||||
day: date.getDate() - 1,
|
||||
},
|
||||
};
|
||||
},
|
||||
nowMonth: function () {
|
||||
return {
|
||||
start: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: 0,
|
||||
},
|
||||
end: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: new Date(nowDate.year, nowDate.month, 0).getDate() - 1,
|
||||
},
|
||||
};
|
||||
},
|
||||
prveMonth: function () {
|
||||
const oneDay = 1000 * 60 * 60 * 24;
|
||||
const date = new Date(
|
||||
new Date(nowDate.year, nowDate.month - 1, 0, 0, 0).getTime() - oneDay
|
||||
);
|
||||
console.log(date.getMonth());
|
||||
return {
|
||||
start: {
|
||||
year: years.findIndex((v) => v == date.getFullYear()),
|
||||
month: date.getMonth(),
|
||||
day: 0,
|
||||
},
|
||||
end: {
|
||||
year: years.findIndex((v) => v == date.getFullYear()),
|
||||
month: date.getMonth(),
|
||||
day: date.getDate(),
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
const data = dataMap[key]();
|
||||
setDay(data.start, data.end);
|
||||
changeDays(false, value.value);
|
||||
changeDays(true, value1.value);
|
||||
|
||||
}
|
||||
console.log(value1.value);
|
||||
const start = returnDateString(value.value);
|
||||
const end = returnDateString(value1.value);
|
||||
|
||||
function setprveMoneth() {
|
||||
emits("confirm", {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end,
|
||||
});
|
||||
close();
|
||||
}
|
||||
let value = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
]);
|
||||
let value1 = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
]);
|
||||
|
||||
}
|
||||
let show = ref(false);
|
||||
const emits = defineEmits("close", "open", "confirm");
|
||||
|
||||
function toggle() {
|
||||
show.value = !show.value;
|
||||
if (show.value) {
|
||||
emits("open", true);
|
||||
} else {
|
||||
emits("close", false);
|
||||
}
|
||||
}
|
||||
|
||||
function setDay(start, end) {
|
||||
value.value = [
|
||||
start.year,
|
||||
start.month,
|
||||
start.day,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
]
|
||||
value1.value = [
|
||||
end.year,
|
||||
end.month,
|
||||
end.day,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
]
|
||||
}
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits("close", false);
|
||||
}
|
||||
|
||||
function changeTime(key) {
|
||||
const yearIndex = years.findIndex(v => v == nowDate.year)
|
||||
const prveyearIndex = years.findIndex(v => v == nowDate.year) - 1
|
||||
const nowMonthIndex = nowDate.month - 1
|
||||
const nowDayIndex = nowDate.day - 1
|
||||
const dataMap = {
|
||||
now: function() {
|
||||
return {
|
||||
start: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex
|
||||
},
|
||||
end: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex
|
||||
}
|
||||
}
|
||||
},
|
||||
prve: function() {
|
||||
const oneDay=1000*60*60*24
|
||||
const date=new Date(new Date(nowDate.year,nowDate.month,nowDate.day,0,0,0).getTime()-oneDay)
|
||||
return {
|
||||
start: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth()-1<0?11:date.getMonth()-1,
|
||||
day: date.getDate()-1
|
||||
},
|
||||
end: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth()-1<0?11:date.getMonth()-1,
|
||||
day: date.getDate()-1
|
||||
}
|
||||
}
|
||||
},
|
||||
nowMonth: function() {
|
||||
return {
|
||||
start: {
|
||||
year:yearIndex,
|
||||
month:nowMonthIndex,
|
||||
day: 0
|
||||
},
|
||||
end: {
|
||||
year:yearIndex,
|
||||
month:nowMonthIndex,
|
||||
day:new Date(nowDate.year, nowDate.month , 0).getDate() - 1
|
||||
}
|
||||
}
|
||||
},
|
||||
prveMonth: function() {
|
||||
const oneDay=1000*60*60*24
|
||||
const date=new Date(new Date(nowDate.year, nowDate.month-1,0,0,0).getTime()-oneDay)
|
||||
console.log(date.getMonth());
|
||||
return {
|
||||
start: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth(),
|
||||
day: 0
|
||||
},
|
||||
end: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth(),
|
||||
day: date.getDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = dataMap[key]()
|
||||
setDay(data.start, data.end)
|
||||
changeDays(false,value.value)
|
||||
changeDays(true,value1.value)
|
||||
|
||||
console.log(value1.value);
|
||||
const start = returnDateString(value.value)
|
||||
const end = returnDateString(value1.value)
|
||||
|
||||
emits('confirm', {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end
|
||||
})
|
||||
close()
|
||||
}
|
||||
let value = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
])
|
||||
let value1 = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
])
|
||||
function open() {
|
||||
show.value = true;
|
||||
emits("open", true);
|
||||
}
|
||||
|
||||
let show = ref(false)
|
||||
const emits = defineEmits('close', 'open', 'confirm')
|
||||
function returnDateString(arr) {
|
||||
const year = years[arr[0]];
|
||||
const month = ("0" + (arr[1] + 1)).slice(-2);
|
||||
const day = ("0" + (arr[2] + 1)).slice(-2);
|
||||
const hour = ("0" + arr[3]).slice(-2);
|
||||
const min = ("0" + arr[4]).slice(-2);
|
||||
const sen = ("0" + arr[5]).slice(-2);
|
||||
|
||||
function toggle() {
|
||||
show.value = !show.value
|
||||
if (show.value) {
|
||||
emits('open', true)
|
||||
} else {
|
||||
emits('close', false)
|
||||
}
|
||||
}
|
||||
return `${year}-${month}-${day} ${hour}:${min}:${sen}`;
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
emits('close', false)
|
||||
}
|
||||
function confirm(e) {
|
||||
const start = returnDateString(value.value);
|
||||
const end = returnDateString(value1.value);
|
||||
console.log(start);
|
||||
console.log(end);
|
||||
//如果结尾时间小于开始时间
|
||||
if (new Date(start).getTime() > new Date(end).getTime()) {
|
||||
return uni.showToast({
|
||||
title: "结束时间不能小于开始时间",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
emits("confirm", {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end,
|
||||
});
|
||||
close();
|
||||
}
|
||||
|
||||
function open() {
|
||||
show.value = true
|
||||
emits('open', true)
|
||||
}
|
||||
function returnMonthStart(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]] - 1, 1).getDate();
|
||||
}
|
||||
|
||||
function returnDateString(arr) {
|
||||
const year = years[arr[0]]
|
||||
const month = arr[1] + 1
|
||||
const day = arr[2] + 1
|
||||
const hour = ('0' + arr[3]).slice(-2)
|
||||
const min = ('0' + arr[4]).slice(-2)
|
||||
const sen = ('0' + arr[5]).slice(-2)
|
||||
return `${year}-${month}-${day} ${hour}:${min}:${sen}`
|
||||
}
|
||||
function returnMonthEnd(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]], 0).getDate();
|
||||
}
|
||||
|
||||
function changeDays(isDays1, arr) {
|
||||
const end = returnMonthEnd(arr);
|
||||
if (end) {
|
||||
if (isDays1) {
|
||||
days1.value = new Array(end).fill(1).map((v, index) => {
|
||||
return index + 1;
|
||||
});
|
||||
} else {
|
||||
days.value = new Array(end).fill(1).map((v, index) => {
|
||||
return index + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function confirm(e) {
|
||||
const start = returnDateString(value.value)
|
||||
const end = returnDateString(value1.value)
|
||||
console.log(start);
|
||||
console.log(end);
|
||||
emits('confirm', {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end
|
||||
})
|
||||
close()
|
||||
}
|
||||
function bindChange(e) {
|
||||
value.value = e.detail.value;
|
||||
changeDays(false, e.detail.value);
|
||||
}
|
||||
|
||||
function returnMonthStart(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]] - 1, 1).getDate();
|
||||
}
|
||||
function bindChange1(e) {
|
||||
value1.value = e.detail.value;
|
||||
changeDays(true, e.detail.value);
|
||||
}
|
||||
|
||||
function returnMonthEnd(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]], 0).getDate();
|
||||
}
|
||||
|
||||
function changeDays(isDays1,arr){
|
||||
const end = returnMonthEnd(arr)
|
||||
if (end) {
|
||||
if(isDays1){
|
||||
days1.value= new Array(end).fill(1).map((v,
|
||||
index) => {
|
||||
return index + 1
|
||||
})
|
||||
}else{
|
||||
days.value= new Array(end).fill(1).map((v,
|
||||
index) => {
|
||||
return index + 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function getDayDate(date = new Date(), type) {
|
||||
const now = date;
|
||||
if (type === "start") {
|
||||
const startOfDay = new Date(
|
||||
now.getFullYear(),
|
||||
now.getMonth(),
|
||||
now.getDate()
|
||||
);
|
||||
return startOfDay;
|
||||
}
|
||||
if (type === "end") {
|
||||
const endOfDay = new Date(
|
||||
now.getFullYear(),
|
||||
now.getMonth(),
|
||||
now.getDate(),
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
);
|
||||
return endOfDay;
|
||||
}
|
||||
}
|
||||
|
||||
function bindChange(e) {
|
||||
value.value = e.detail.value
|
||||
changeDays(false, e.detail.value)
|
||||
}
|
||||
function getMonthArea(date = new Date(), type) {
|
||||
let now = date;
|
||||
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
let currentMonthEnd = new Date(
|
||||
now.getFullYear(),
|
||||
now.getMonth() + 1,
|
||||
0,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
);
|
||||
if (type === "start") {
|
||||
return currentMonthStart;
|
||||
}
|
||||
if (type === "end") {
|
||||
return currentMonthEnd;
|
||||
}
|
||||
return {
|
||||
start: currentMonthStart,
|
||||
end: currentMonthEnd,
|
||||
};
|
||||
}
|
||||
|
||||
function bindChange1(e) {
|
||||
value1.value = e.detail.value
|
||||
changeDays(true, e.detail.value)
|
||||
}
|
||||
function nullFunction() {}
|
||||
|
||||
function getDayDate(date = new Date(), type) {
|
||||
const now = date
|
||||
if (type === 'start') {
|
||||
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
return startOfDay
|
||||
}
|
||||
if (type === 'end') {
|
||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
||||
return endOfDay;
|
||||
}
|
||||
}
|
||||
function pickend(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function getMonthArea(date = new Date(), type) {
|
||||
let now = date
|
||||
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
let currentMonthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999);
|
||||
if (type === 'start') {
|
||||
return currentMonthStart
|
||||
}
|
||||
if (type === 'end') {
|
||||
return currentMonthEnd;
|
||||
}
|
||||
return {
|
||||
start: currentMonthStart,
|
||||
end: currentMonthEnd
|
||||
};
|
||||
}
|
||||
|
||||
function nullFunction() {
|
||||
|
||||
}
|
||||
|
||||
function pickend(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function pickend1(e) {
|
||||
console.log(e);
|
||||
}
|
||||
defineExpose({
|
||||
close,
|
||||
open,
|
||||
confirm,
|
||||
toggle
|
||||
})
|
||||
function pickend1(e) {
|
||||
console.log(e);
|
||||
}
|
||||
defineExpose({
|
||||
close,
|
||||
open,
|
||||
confirm,
|
||||
toggle,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fastTime {
|
||||
.item {
|
||||
background-color: rgb(247, 247, 247);
|
||||
padding: 6rpx 40rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
.fastTime {
|
||||
.item {
|
||||
background-color: rgb(247, 247, 247);
|
||||
padding: 6rpx 40rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.top {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 30rpx;
|
||||
}
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 30rpx;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .7);
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, 0.7);
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.fixed_b {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
z-index: 100;
|
||||
background-color: #fff;
|
||||
}
|
||||
.fixed_b {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
z-index: 100;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
width: 750rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
.picker-view {
|
||||
width: 750rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
line-height: 34px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
.item {
|
||||
line-height: 34px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,426 +1,401 @@
|
||||
<template>
|
||||
<view class="time-wrapper">
|
||||
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
|
||||
<view class="time-item" @tap="changeTime(v.value)" :class="{ 'time-selected':v.value==selected }">
|
||||
{{v.label}}
|
||||
</view>
|
||||
<view class="xian" v-if="v.value==selected "> </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time-wrapper">
|
||||
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
|
||||
<view
|
||||
class="time-item"
|
||||
@tap="changeTime(v.value)"
|
||||
:class="[v.value == selected ? 'time-selected' : '']"
|
||||
>
|
||||
{{ v.label }}
|
||||
</view>
|
||||
<view class="xian" v-if="v.value == selected"> </view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pageSalesSummaryContent">
|
||||
<view class="">
|
||||
<view class=""> 实收金额(元) </view>
|
||||
<view class=""> {{list.saleAmount?list.saleAmount:0}} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 优惠金额(元) </view>
|
||||
<view class=""> {{list.discountAmount?list.discountAmount:0}} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 客单价(元) </view>
|
||||
<view class=""> {{list.customerUnitPrice?list.customerUnitPrice:0}} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 会员消费(元) </view>
|
||||
<view class=""> {{list.memberPayAmount?list.memberPayAmount:0}} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 新增会员(人) </view>
|
||||
<view class=""> {{list.newMemberCount?list.newMemberCount:0}} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 翻台率(%) </view>
|
||||
<view class=""> {{list.tableTurnoverRate?list.tableTurnoverRate:0}} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-scroll">
|
||||
<template>
|
||||
<view class="color-333 u-font-28 bg-gray default-box-padding" style="padding-top:80px;">
|
||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
|
||||
<view class="constantbox">
|
||||
<view class="constantboxitem">
|
||||
<view class="head">商品名称</view>
|
||||
<view class="head">总数量</view>
|
||||
<view class="head">金额</view>
|
||||
</view>
|
||||
<view class="constantboxitem" v-for="(item,index) in tableList" :key="index"
|
||||
@click="toDetail(item)">
|
||||
<view class="head" style="padding-left: 16rpx;">
|
||||
<image v-if="index==0" src="../pageTable/index/images/1.png"
|
||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<image v-else-if="index==1" src="../pageTable/index/images/2.png"
|
||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<image v-else-if="index==2" src="../pageTable/index/images/3.png"
|
||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
{{item.productName}}
|
||||
</view>
|
||||
<view class="head">{{item.number}}</view>
|
||||
<view class="head">{{item.amount || '无'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="bottombtn" @tap="toUrl">
|
||||
更多 <uni-icons type="right" size="16"></uni-icons>
|
||||
</view>
|
||||
<datePickerview @confirm="datePickerConfirm" ref="datePicker"></datePickerview>
|
||||
<view class="pageSalesSummaryContent">
|
||||
<view class="">
|
||||
<view class=""> 实收金额(元) </view>
|
||||
<view class=""> {{ list.saleAmount ? list.saleAmount : 0 }} </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 优惠金额(元) </view>
|
||||
<view class="">
|
||||
{{ list.discountAmount ? list.discountAmount : 0 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 客单价(元) </view>
|
||||
<view class="">
|
||||
{{ list.customerUnitPrice ? list.customerUnitPrice : 0 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 会员消费(元) </view>
|
||||
<view class="">
|
||||
{{ list.memberPayAmount ? list.memberPayAmount : 0 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 新增会员(人) </view>
|
||||
<view class="">
|
||||
{{ list.newMemberCount ? list.newMemberCount : 0 }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=""> 翻台率(%) </view>
|
||||
<view class="">
|
||||
{{ list.tableTurnoverRate ? list.tableTurnoverRate : 0 }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table-scroll">
|
||||
<view class="color-333 u-font-28 bg-gray default-box-padding">
|
||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
|
||||
<view class="constantbox">
|
||||
<view class="constantboxitem">
|
||||
<view class="head">商品名称</view>
|
||||
<view class="head">总数量</view>
|
||||
<view class="head">金额</view>
|
||||
</view>
|
||||
<view
|
||||
class="constantboxitem"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="toDetail(item)"
|
||||
>
|
||||
<view class="head" style="padding-left: 16rpx">
|
||||
<image
|
||||
v-if="index == 0"
|
||||
src="../pageTable/index/images/1.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<image
|
||||
v-else-if="index == 1"
|
||||
src="../pageTable/index/images/2.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<image
|
||||
v-else-if="index == 2"
|
||||
src="../pageTable/index/images/3.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
{{ item.productName }}
|
||||
</view>
|
||||
<view class="head">{{ item.saleCount || 0 }}</view>
|
||||
<view class="head">{{ item.saleAmount || 0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottombtn" @tap="toUrl">
|
||||
更多 <uni-icons type="right" size="16"></uni-icons>
|
||||
</view>
|
||||
<datePickerview
|
||||
@confirm="datePickerConfirm"
|
||||
ref="datePicker"
|
||||
></datePickerview>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import datePickerview from './components/my-date-pickerview.vue'
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { getTrade, productSaleDate } from '@/http/api/summary.js'
|
||||
|
||||
const datePicker=ref()
|
||||
const timeList = [{
|
||||
label: '今天',
|
||||
value: 'today'
|
||||
},
|
||||
{
|
||||
label: '昨天',
|
||||
value: 'yesterday'
|
||||
},
|
||||
{
|
||||
label: '本周',
|
||||
value: 'circumference'
|
||||
}, {
|
||||
label: '本月',
|
||||
value: 'moon'
|
||||
},
|
||||
{
|
||||
label: '自定义',
|
||||
value: 'custom'
|
||||
}
|
||||
]
|
||||
let selected = ref('today')
|
||||
let list = ref({})
|
||||
let tableList = ref([])
|
||||
let day = ref(1)
|
||||
onMounted(() => {
|
||||
getlist()
|
||||
gettableData()
|
||||
})
|
||||
|
||||
/**
|
||||
* 获取营业数据
|
||||
* @param {Object} start
|
||||
* @param {Object} end
|
||||
*/
|
||||
function getlist(start, end) {
|
||||
let startTime, endTime;
|
||||
if (selected.value == 'today') {
|
||||
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (selected.value == 'yesterday') {
|
||||
startTime = formatTime() + ' 00:00:00'
|
||||
endTime = formatTime() + ' 23:59:59'
|
||||
} else if (selected.value == 'circumference') {
|
||||
var now = new Date();
|
||||
var nowTime = now.getTime();
|
||||
var day = now.getDay();
|
||||
var oneDayTime = 24 * 60 * 60 * 1000;
|
||||
//显示周一
|
||||
var MondayTime = nowTime - (day - 1) * oneDayTime;
|
||||
//显示周日
|
||||
var SundayTime = nowTime + (7 - day) * oneDayTime;
|
||||
startTime = dayjs(MondayTime).format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs(SundayTime).format('YYYY-MM-DD 23:59:59')
|
||||
} else if (selected.value == 'moon') {
|
||||
startTime = dayjs().startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (selected.value == 'custom') {
|
||||
let s = start.substring(0, start.indexOf(' '))
|
||||
let e = end.substring(0, end.indexOf(' '))
|
||||
startTime = s + ' 00:00:00'
|
||||
endTime = e + ' 23:59:59'
|
||||
}
|
||||
getTrade({
|
||||
beginDate: startTime,
|
||||
endDate: endTime,
|
||||
}).then((res) => {
|
||||
list.value = res
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售数据
|
||||
*/
|
||||
function gettableData() {
|
||||
if (selected.value == 'today') {
|
||||
day.value = 1
|
||||
} else if (selected.value == 'yesterday') {
|
||||
day.value = 1
|
||||
} else if (selected.value == 'circumference') {
|
||||
day.value = 7
|
||||
} else if (selected.value == 'moon') {
|
||||
day.value = 30
|
||||
} else if (selected.value == 'custom') {
|
||||
day.value = 30
|
||||
}
|
||||
productSaleDate({
|
||||
day: day.value,
|
||||
page: 1,
|
||||
size: 5
|
||||
}).then((res) => {
|
||||
tableList.value = res.records
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间
|
||||
*/
|
||||
function getdate() {
|
||||
const dt = new Date();
|
||||
const y = dt.getFullYear();
|
||||
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
||||
const d = (dt.getDate() + "").padStart(2, "0");
|
||||
const hh = (dt.getHours() + "").padStart(2, "0");
|
||||
const mm = (dt.getMinutes() + "").padStart(2, "0");
|
||||
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
||||
return `${y}-${m}-${d}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取昨天时间
|
||||
*/
|
||||
const formatTime = () => {
|
||||
let strDate = getdate()
|
||||
let dateFormat = new Date(strDate);
|
||||
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
|
||||
dateFormat = new Date(dateFormat);
|
||||
let y = dateFormat.getFullYear()
|
||||
let m = (dateFormat.getMonth() + 1).toString().padStart(2, '0')
|
||||
let d = dateFormat.getDate().toString().padStart(2, '0')
|
||||
return `${y}-${m}-${d}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间切换
|
||||
* @param {Object} e
|
||||
*/
|
||||
function changeTime(e) {
|
||||
selected.value = e
|
||||
if (e == 'custom') {
|
||||
datePicker.value.toggle()
|
||||
} else {
|
||||
getlist()
|
||||
gettableData()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义确认
|
||||
* @param {Object} e
|
||||
*/
|
||||
function datePickerConfirm(e) {
|
||||
console.log(e)
|
||||
getlist(e.start, e.end)
|
||||
gettableData()
|
||||
}
|
||||
|
||||
/**
|
||||
* 更多
|
||||
*/
|
||||
function toUrl() {
|
||||
go.to('PAGES_PRODUCT_SALES_RANKING', {
|
||||
day: day.value
|
||||
})
|
||||
}
|
||||
import { onMounted, ref } from "vue";
|
||||
import datePickerview from "./components/my-date-pickerview.vue";
|
||||
import dayjs from "dayjs"; //时间格式库
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { getTrade } from "@/http/api/summary.js";
|
||||
import { saleSummaryPage } from "@/http/api/order/summary.js";
|
||||
import { timeList } from "@/data/index.js";
|
||||
|
||||
const datePicker = ref();
|
||||
|
||||
let selected = ref("today");
|
||||
let list = ref({});
|
||||
let tableList = ref([]);
|
||||
let day = ref(1);
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
||||
/**
|
||||
* 获取营业数据
|
||||
* @param {Object} beginDate
|
||||
* @param {Object} endDate
|
||||
*/
|
||||
function getlist(beginDate, endDate) {
|
||||
getTrade({
|
||||
beginDate,
|
||||
endDate,
|
||||
rangeType: selected.value,
|
||||
}).then((res) => {
|
||||
list.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售数据
|
||||
* @param {Object} beginDate
|
||||
* @param {Object} endDate
|
||||
*/
|
||||
function gettableData(beginDate, endDate) {
|
||||
saleSummaryPage({
|
||||
beginDate,
|
||||
endDate,
|
||||
rangeType: selected.value,
|
||||
}).then((res) => {
|
||||
tableList.value = (res || []).slice(0, 5);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间切换
|
||||
* @param {Object} e
|
||||
*/
|
||||
function changeTime(e) {
|
||||
selected.value = e;
|
||||
if (e == "custom") {
|
||||
datePicker.value.toggle();
|
||||
} else {
|
||||
getData();
|
||||
}
|
||||
}
|
||||
|
||||
const datePickerData = ref({
|
||||
beginDate: "",
|
||||
endDate: "",
|
||||
});
|
||||
/**
|
||||
* 自定义确认
|
||||
* @param {Object} e
|
||||
*/
|
||||
function datePickerConfirm(e) {
|
||||
datePickerData.value.beginDate = e.start;
|
||||
datePickerData.value.endDate = e.end;
|
||||
getData(e.start, e.end);
|
||||
}
|
||||
function getData(start, end) {
|
||||
let beginDate, endDate;
|
||||
if (selected.value == "custom") {
|
||||
beginDate = start.substring(0, start.indexOf(" "));
|
||||
endDate = end.substring(0, end.indexOf(" "));
|
||||
} else {
|
||||
beginDate = timeList.find((item) => item.value == selected.value).beginDate;
|
||||
endDate = timeList.find((item) => item.value == selected.value).endDate;
|
||||
}
|
||||
getlist(beginDate, endDate);
|
||||
gettableData(beginDate, endDate);
|
||||
}
|
||||
/**
|
||||
* 更多
|
||||
*/
|
||||
function toUrl() {
|
||||
let beginDate, endDate;
|
||||
if (selected.value == "custom") {
|
||||
beginDate = datePickerData.value.beginDate.substring(
|
||||
0,
|
||||
datePickerData.value.beginDate.indexOf(" ")
|
||||
);
|
||||
endDate = datePickerData.value.endDate.substring(
|
||||
0,
|
||||
datePickerData.value.endDate.indexOf(" ")
|
||||
);
|
||||
} else {
|
||||
beginDate = timeList.find((item) => item.value == selected.value).beginDate;
|
||||
endDate = timeList.find((item) => item.value == selected.value).endDate;
|
||||
}
|
||||
go.to("PAGES_PRODUCT_SALES_RANKING", {
|
||||
beginDate,
|
||||
endDate,
|
||||
rangeType: selected.value,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.fixed-top {
|
||||
padding: 32rpx 28rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.fixed-top {
|
||||
padding: 32rpx 28rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
.bottom {
|
||||
background-color: transparent;
|
||||
bottom: 84rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background-color: transparent;
|
||||
bottom: 84rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
.table {
|
||||
border-radius: 12rpx 12rpx 0rpx 0rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
|
||||
.table {
|
||||
border-radius: 12rpx 12rpx 0rpx 0rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
.constantbox {
|
||||
.constantboxitem {
|
||||
display: flex;
|
||||
|
||||
.constantbox {
|
||||
.constantboxitem {
|
||||
display: flex;
|
||||
.head {
|
||||
width: 220rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
|
||||
.head {
|
||||
width: 220rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
.head:nth-child(4) {
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.head:nth-child(4) {
|
||||
width: 300rpx;
|
||||
}
|
||||
.head:nth-child(5) {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.head:nth-child(5) {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
.constantboxitem:nth-child(even) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(even) {
|
||||
background: #fff;
|
||||
}
|
||||
.constantboxitem:nth-child(odd) {
|
||||
background: #f7f6fb;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(odd) {
|
||||
background: #F7F6FB;
|
||||
}
|
||||
.constantboxitem:nth-child(1) {
|
||||
background: #aebad2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(1) {
|
||||
background: #AEBAD2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-of-type(2n+1) {
|
||||
background-color: rgb(249, 249, 249);
|
||||
}
|
||||
}
|
||||
.item:nth-of-type(2n + 1) {
|
||||
background-color: rgb(249, 249, 249);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="less">
|
||||
.time-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-bottom: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
background-color: #fff;
|
||||
.time-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-bottom: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.timelistbox {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.timelistbox {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.time-item {
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.time-item {
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.xian {
|
||||
width: 40rpx;
|
||||
height: 3rpx;
|
||||
background-color: #318AFE;
|
||||
// position: absolute;
|
||||
// left: 16rpx;
|
||||
// bottom: 0;
|
||||
}
|
||||
}
|
||||
.xian {
|
||||
width: 40rpx;
|
||||
height: 3rpx;
|
||||
background-color: #318afe;
|
||||
// position: absolute;
|
||||
// left: 16rpx;
|
||||
// bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.time-selected {
|
||||
color: #318afe;
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
}
|
||||
.time-selected {
|
||||
color: #318afe;
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.pageSalesSummaryContent {
|
||||
height: 320rpx;
|
||||
margin: 20rpx 28rpx;
|
||||
background-image: url('./svg/bgimg.svg');
|
||||
background-size: 694rpx 320rpx;
|
||||
padding: 48rpx 28rpx;
|
||||
.df;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
.pageSalesSummaryContent {
|
||||
height: 320rpx;
|
||||
margin: 20rpx 28rpx;
|
||||
background-image: url("./svg/bgimg.svg");
|
||||
background-size: 694rpx 320rpx;
|
||||
padding: 48rpx 28rpx;
|
||||
.df;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
>view {
|
||||
padding-right: 52rpx;
|
||||
color: #fff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
> view {
|
||||
padding-right: 52rpx;
|
||||
color: #fff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格
|
||||
.table-scroll {
|
||||
// width: calc(100% - 5px);
|
||||
overflow-x: scroll;
|
||||
white-space: nowrap;
|
||||
margin: 32rpx 28rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
// 表格
|
||||
.table-scroll {
|
||||
// width: calc(100% - 5px);
|
||||
overflow-x: scroll;
|
||||
white-space: nowrap;
|
||||
margin: 32rpx 28rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
}
|
||||
|
||||
}
|
||||
.table-scroll .table {
|
||||
table-layout: fixed;
|
||||
// width: calc(100% - 10rpx);
|
||||
}
|
||||
|
||||
.table-scroll .table {
|
||||
table-layout: fixed;
|
||||
// width: calc(100% - 10rpx);
|
||||
}
|
||||
.table-scroll .thead {
|
||||
display: table-row;
|
||||
background-color: bisque;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.table-scroll .thead {
|
||||
display: table-row;
|
||||
background-color: bisque;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.table-scroll .tbody {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
display: block;
|
||||
// width: 1040rpx;
|
||||
width: 100%;
|
||||
// width: calc(100% );
|
||||
}
|
||||
|
||||
.table-scroll .tbody {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
display: block;
|
||||
// width: 1040rpx;
|
||||
width: 100%;
|
||||
// width: calc(100% );
|
||||
}
|
||||
// .table-scroll th,
|
||||
// td {
|
||||
// height: 82rpx;
|
||||
// overflow: hidden;
|
||||
// text-overflow: ellipsis;
|
||||
// width: 250rpx;
|
||||
// // border: 0.7rpx solid red;
|
||||
// border: 0.7rpx solid rgba(126, 155, 212, 0.27);
|
||||
// }
|
||||
|
||||
// .table-scroll th,
|
||||
// td {
|
||||
// height: 82rpx;
|
||||
// overflow: hidden;
|
||||
// text-overflow: ellipsis;
|
||||
// width: 250rpx;
|
||||
// // border: 0.7rpx solid red;
|
||||
// border: 0.7rpx solid rgba(126, 155, 212, 0.27);
|
||||
// }
|
||||
.bottombtn {
|
||||
width: 694rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin: 0rpx auto;
|
||||
background: #f1f1f1;
|
||||
font-size: 24rpx;
|
||||
border-radius: 0rpx 0rpx 28rpx 28rpx;
|
||||
}
|
||||
|
||||
.bottombtn {
|
||||
width: 694rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin: 0rpx auto;
|
||||
background: #F1F1F1;
|
||||
font-size: 24rpx;
|
||||
border-radius: 0rpx 0rpx 28rpx 28rpx;
|
||||
}
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.min-page{
|
||||
height: 20vh;
|
||||
}
|
||||
</style>
|
||||
.min-page {
|
||||
height: 20vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,153 +1,156 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="color-333 u-font-28 bg-gray default-box-padding" >
|
||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
|
||||
<view class="constantbox">
|
||||
<view class="constantboxitem">
|
||||
<view class="head">商品名称</view>
|
||||
<view class="head">总数量</view>
|
||||
<view class="head">金额</view>
|
||||
</view>
|
||||
<view class="constantboxitem" v-for="(item,index) in tableList" :key="index"
|
||||
@click="toDetail(item)">
|
||||
<view class="head">{{item.productName}}</view>
|
||||
<view class="head">{{item.number}}</view>
|
||||
<view class="head">{{item.amount || '无'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="color-333 u-font-28 bg-gray default-box-padding">
|
||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
|
||||
<view class="constantbox">
|
||||
<view class="constantboxitem">
|
||||
<view class="head">商品名称</view>
|
||||
<view class="head">总数量</view>
|
||||
<view class="head">金额</view>
|
||||
</view>
|
||||
<view
|
||||
class="constantboxitem"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="toDetail(item)"
|
||||
>
|
||||
<view class="head">{{ item.productName }}</view>
|
||||
<view class="head">{{ item.saleCount || 0 }}</view>
|
||||
<view class="head">{{ item.saleAmount || 0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { productSaleDate } from '@/http/api/summary.js'
|
||||
|
||||
let tableList = ref([])
|
||||
let props = defineProps({
|
||||
day: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
gettableData()
|
||||
})
|
||||
|
||||
/**
|
||||
* 获取销售数据
|
||||
*/
|
||||
function gettableData() {
|
||||
productSaleDate({
|
||||
day: props.day,
|
||||
page: 1,
|
||||
size: 50
|
||||
}).then((res) => {
|
||||
tableList.value = res.records
|
||||
})
|
||||
}
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { saleSummaryPage } from "@/http/api/order/summary.js";
|
||||
|
||||
let tableList = ref([]);
|
||||
let props = defineProps({
|
||||
day: {
|
||||
type: Number,
|
||||
},
|
||||
});
|
||||
const options = reactive({
|
||||
beginDate: "",
|
||||
endDate: "",
|
||||
rangeType: "",
|
||||
});
|
||||
onLoad((opt) => {
|
||||
console.log(opt);
|
||||
Object.assign(options, opt);
|
||||
gettableData();
|
||||
});
|
||||
|
||||
/**
|
||||
* 获取销售数据
|
||||
*/
|
||||
function gettableData() {
|
||||
saleSummaryPage(options).then((res) => {
|
||||
tableList.value = res || [];
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.table-scroll {
|
||||
overflow-x: scroll;
|
||||
white-space: nowrap;
|
||||
margin: 32rpx 28rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
|
||||
}
|
||||
|
||||
.table-scroll table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.table-scroll thead {
|
||||
display: table-row;
|
||||
background-color: bisque;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.table-scroll tbody {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-scroll th,
|
||||
td {
|
||||
height: 82rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 250rpx;
|
||||
border: 0.7rpx solid rgba(126, 155, 212, 0.27);
|
||||
}
|
||||
.table-scroll {
|
||||
overflow-x: scroll;
|
||||
white-space: nowrap;
|
||||
margin: 32rpx 28rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
}
|
||||
|
||||
.table-scroll table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.table-scroll thead {
|
||||
display: table-row;
|
||||
background-color: bisque;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.table-scroll tbody {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-scroll th,
|
||||
td {
|
||||
height: 82rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 250rpx;
|
||||
border: 0.7rpx solid rgba(126, 155, 212, 0.27);
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.fixed-top {
|
||||
padding: 32rpx 28rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.fixed-top {
|
||||
padding: 32rpx 28rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
.bottom {
|
||||
background-color: transparent;
|
||||
bottom: 84rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background-color: transparent;
|
||||
bottom: 84rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
.table {
|
||||
border-radius: 12rpx 12rpx 0rpx 0rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
|
||||
.table {
|
||||
border-radius: 12rpx 12rpx 0rpx 0rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
.constantbox {
|
||||
.constantboxitem {
|
||||
display: flex;
|
||||
|
||||
.constantbox {
|
||||
.constantboxitem {
|
||||
display: flex;
|
||||
.head {
|
||||
width: 220rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
|
||||
.head {
|
||||
width: 220rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
.head:nth-child(4) {
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.head:nth-child(4) {
|
||||
width: 300rpx;
|
||||
}
|
||||
.head:nth-child(5) {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.head:nth-child(5) {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
.constantboxitem:nth-child(even) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(even) {
|
||||
background: #fff;
|
||||
}
|
||||
.constantboxitem:nth-child(odd) {
|
||||
background: #f7f6fb;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(odd) {
|
||||
background: #F7F6FB;
|
||||
}
|
||||
.constantboxitem:nth-child(1) {
|
||||
background: #aebad2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(1) {
|
||||
background: #AEBAD2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-of-type(2n+1) {
|
||||
background-color: rgb(249, 249, 249);
|
||||
}
|
||||
}
|
||||
.item:nth-of-type(2n + 1) {
|
||||
background-color: rgb(249, 249, 249);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
346
pageSalesSummary/table.vue
Normal file
346
pageSalesSummary/table.vue
Normal file
@@ -0,0 +1,346 @@
|
||||
<template>
|
||||
<view class="time-wrapper">
|
||||
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
|
||||
<view
|
||||
class="time-item"
|
||||
@tap="changeTime(v.value)"
|
||||
:class="[v.value == selected ? 'time-selected' : '']"
|
||||
>
|
||||
{{ v.label }}
|
||||
</view>
|
||||
<view class="xian" v-if="v.value == selected"> </view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="table-scroll">
|
||||
<view class="color-333 u-font-28 bg-gray">
|
||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
|
||||
<view class="constantbox">
|
||||
<view class="constantboxitem">
|
||||
<view class="head">区域名称</view>
|
||||
<view class="head">台桌号</view>
|
||||
<view class="head">订单数量</view>
|
||||
<view class="head">订单金额</view>
|
||||
</view>
|
||||
<view
|
||||
class="constantboxitem"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="toDetail(item)"
|
||||
>
|
||||
<view class="head" style="padding-left: 16rpx">
|
||||
<image
|
||||
v-if="index == 0"
|
||||
src="../pageTable/index/images/1.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<image
|
||||
v-else-if="index == 1"
|
||||
src="../pageTable/index/images/2.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<image
|
||||
v-else-if="index == 2"
|
||||
src="../pageTable/index/images/3.png"
|
||||
style="width: 22rpx; height: 30rpx"
|
||||
mode=""
|
||||
></image>
|
||||
{{ item.areaName }}
|
||||
</view>
|
||||
<view class="head">{{ item.tableName || "" }}</view>
|
||||
<view class="head">{{ item.orderCount || 0 }}</view>
|
||||
<view class="head">{{ item.orderAmount || 0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 80rpx;"></view>
|
||||
<!-- <view class="bottombtn" @tap="toUrl">
|
||||
更多 <uni-icons type="right" size="16"></uni-icons>
|
||||
</view> -->
|
||||
<datePickerview
|
||||
@confirm="datePickerConfirm"
|
||||
ref="datePicker"
|
||||
></datePickerview>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import datePickerview from "./components/my-date-pickerview.vue";
|
||||
import dayjs from "dayjs"; //时间格式库
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { getTrade, productSaleDate } from "@/http/api/summary.js";
|
||||
import { timeList } from "@/data/index.js";
|
||||
import { tableSummaryList } from "@/http/api/order/summary.js";
|
||||
|
||||
const datePicker = ref();
|
||||
|
||||
let selected = ref("today");
|
||||
let list = ref({});
|
||||
let tableList = ref([]);
|
||||
let day = ref(1);
|
||||
onMounted(() => {
|
||||
gettableData();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取销售数据
|
||||
*/
|
||||
function gettableData(start, end) {
|
||||
let beginDate, endDate;
|
||||
if (selected.value == "custom") {
|
||||
beginDate = start.substring(0, start.indexOf(" "));
|
||||
endDate = end.substring(0, end.indexOf(" "));
|
||||
} else {
|
||||
beginDate = timeList.find((item) => item.value == selected.value).beginDate;
|
||||
endDate = timeList.find((item) => item.value == selected.value).endDate;
|
||||
}
|
||||
tableSummaryList({
|
||||
beginDate: beginDate,
|
||||
endDate: endDate,
|
||||
rangeType: selected.value,
|
||||
}).then((res) => {
|
||||
tableList.value = res || [];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间
|
||||
*/
|
||||
function getdate() {
|
||||
const dt = new Date();
|
||||
const y = dt.getFullYear();
|
||||
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
||||
const d = (dt.getDate() + "").padStart(2, "0");
|
||||
const hh = (dt.getHours() + "").padStart(2, "0");
|
||||
const mm = (dt.getMinutes() + "").padStart(2, "0");
|
||||
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
||||
return `${y}-${m}-${d}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 时间切换
|
||||
* @param {Object} e
|
||||
*/
|
||||
function changeTime(e) {
|
||||
selected.value = e;
|
||||
if (e == "custom") {
|
||||
datePicker.value.toggle();
|
||||
} else {
|
||||
gettableData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义确认
|
||||
* @param {Object} e
|
||||
*/
|
||||
function datePickerConfirm(e) {
|
||||
console.log(e);
|
||||
gettableData(e.start, e.end);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更多
|
||||
*/
|
||||
function toUrl() {
|
||||
go.to("PAGES_PRODUCT_SALES_RANKING", {
|
||||
day: day.value,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.fixed-top {
|
||||
padding: 32rpx 28rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background-color: transparent;
|
||||
bottom: 84rpx;
|
||||
left: 28rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
|
||||
.table {
|
||||
border-radius: 12rpx 12rpx 0rpx 0rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
|
||||
.constantbox {
|
||||
.constantboxitem {
|
||||
display: flex;
|
||||
|
||||
.head {
|
||||
width: 220rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
|
||||
.head:nth-child(4) {
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.head:nth-child(5) {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(even) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(odd) {
|
||||
background: #f7f6fb;
|
||||
}
|
||||
|
||||
.constantboxitem:nth-child(1) {
|
||||
background: #aebad2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-of-type(2n + 1) {
|
||||
background-color: rgb(249, 249, 249);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="less">
|
||||
.time-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-bottom: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.timelistbox {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.time-item {
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.xian {
|
||||
width: 40rpx;
|
||||
height: 3rpx;
|
||||
background-color: #318afe;
|
||||
// position: absolute;
|
||||
// left: 16rpx;
|
||||
// bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.time-selected {
|
||||
color: #318afe;
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.pageSalesSummaryContent {
|
||||
height: 320rpx;
|
||||
margin: 20rpx 28rpx;
|
||||
background-image: url("./svg/bgimg.svg");
|
||||
background-size: 694rpx 320rpx;
|
||||
padding: 48rpx 28rpx;
|
||||
.df;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
> view {
|
||||
padding-right: 52rpx;
|
||||
color: #fff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格
|
||||
.table-scroll {
|
||||
// width: calc(100% - 5px);
|
||||
overflow-x: scroll;
|
||||
white-space: nowrap;
|
||||
margin: 32rpx 28rpx;
|
||||
margin-right: 30rpx;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
}
|
||||
|
||||
.table-scroll .table {
|
||||
table-layout: fixed;
|
||||
// width: calc(100% - 10rpx);
|
||||
}
|
||||
|
||||
.table-scroll .thead {
|
||||
display: table-row;
|
||||
background-color: bisque;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.table-scroll .tbody {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
display: block;
|
||||
// width: 1040rpx;
|
||||
width: 100%;
|
||||
// width: calc(100% );
|
||||
}
|
||||
|
||||
// .table-scroll th,
|
||||
// td {
|
||||
// height: 82rpx;
|
||||
// overflow: hidden;
|
||||
// text-overflow: ellipsis;
|
||||
// width: 250rpx;
|
||||
// // border: 0.7rpx solid red;
|
||||
// border: 0.7rpx solid rgba(126, 155, 212, 0.27);
|
||||
// }
|
||||
|
||||
.bottombtn {
|
||||
width: 694rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin: 0rpx auto;
|
||||
background: #f1f1f1;
|
||||
font-size: 24rpx;
|
||||
border-radius: 0rpx 0rpx 28rpx 28rpx;
|
||||
}
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.min-page {
|
||||
height: 20vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user