chenjj пре 3 месеци
родитељ
комит
1741071cd4
2 измењених фајлова са 21 додато и 47 уклоњено
  1. 19 45
      src/views/index.vue
  2. 2 2
      vite.config.js

+ 19 - 45
src/views/index.vue

@@ -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})

+ 2 - 2
vite.config.js

@@ -37,10 +37,10 @@ export default defineConfig(({ mode, command }) => {
         },
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          // target: 'http://192.168.100.139:9527',
+          target: 'http://192.168.100.139:9527',
           // target: 'https://zybooks.tech/prod-api', 
           // target: 'http://192.168.100.127:9527',
-          target: 'http://192.168.100.122:9527',
+          // target: 'http://192.168.100.122:9527',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         },