|
@@ -91,38 +91,38 @@ import { computed } from 'vue'
|
|
|
import { onMounted } from 'vue'
|
|
|
import {formatDate} from '@/utils/index'
|
|
|
|
|
|
-const queryKey = ref('')
|
|
|
+const queryKey = ref('4')
|
|
|
const userKey = ref(1)
|
|
|
|
|
|
-const queryparmasTimes = computed(() => {
|
|
|
- if(queryKey.value === 'today'){
|
|
|
- return getToday();
|
|
|
- }
|
|
|
- if(queryKey.value === 'yesterday'){
|
|
|
- return getYesterday();
|
|
|
- }
|
|
|
- if(queryKey.value === 'week'){
|
|
|
- return getThisWeek();
|
|
|
- }
|
|
|
- return ''
|
|
|
-})
|
|
|
+// const queryparmasTimes = computed(() => {
|
|
|
+// if(queryKey.value === 'today'){
|
|
|
+// return getToday();
|
|
|
+// }
|
|
|
+// if(queryKey.value === 'yesterday'){
|
|
|
+// return getYesterday();
|
|
|
+// }
|
|
|
+// if(queryKey.value === 'week'){
|
|
|
+// return getThisWeek();
|
|
|
+// }
|
|
|
+// return ''
|
|
|
+// })
|
|
|
|
|
|
const btns = [
|
|
|
{
|
|
|
name: '今日',
|
|
|
- key: 'today'
|
|
|
+ key: '2'
|
|
|
},
|
|
|
{
|
|
|
name: '昨日',
|
|
|
- key: 'yesterday'
|
|
|
+ key: '1'
|
|
|
},
|
|
|
{
|
|
|
- name: '本周',
|
|
|
- key: 'week'
|
|
|
+ name: '本月',
|
|
|
+ key: '3'
|
|
|
},
|
|
|
{
|
|
|
name: '全部',
|
|
|
- key: ''
|
|
|
+ key: '4'
|
|
|
},
|
|
|
]
|
|
|
const userbtns = [
|
|
@@ -172,32 +172,6 @@ const userReview = [
|
|
|
key: 'monthAdd'
|
|
|
},
|
|
|
]
|
|
|
-// 获取今日日期(00:00:00)
|
|
|
-const getToday = () => {
|
|
|
- const today = new Date();
|
|
|
- // today.setHours(0, 0, 0, 0);
|
|
|
- return formatDate(today,false);
|
|
|
-};
|
|
|
-
|
|
|
-// 获取昨日日期(00:00:00)
|
|
|
-const getYesterday = () => {
|
|
|
- const yesterday = new Date();
|
|
|
- yesterday.setDate(yesterday.getDate() - 1);
|
|
|
- // yesterday.setHours(0, 0, 0, 0);
|
|
|
- return formatDate(yesterday,false);
|
|
|
-};
|
|
|
-
|
|
|
-// 获取本周一日期(00:00:00)
|
|
|
-const getThisWeek = () => {
|
|
|
- const today = new Date();
|
|
|
- const dayOfWeek = today.getDay(); // 0 是周日
|
|
|
- const diffToMonday = today.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1);
|
|
|
- const monday = new Date(today);
|
|
|
- monday.setDate(diffToMonday);
|
|
|
- // monday.setHours(0, 0, 0, 0);
|
|
|
- return formatDate(monday,false);
|
|
|
-};
|
|
|
-
|
|
|
|
|
|
const data = ref({
|
|
|
order: 388
|
|
@@ -207,7 +181,7 @@ const data = ref({
|
|
|
const init = async () => {
|
|
|
try {
|
|
|
const parmas = {
|
|
|
- startDate:queryparmasTimes.value
|
|
|
+ pageType:queryKey.value
|
|
|
}
|
|
|
const res1 = await orderSummary(parmas)
|
|
|
const res2 = await userSummary({...parmas,userType: userKey.value})
|