From b12de2ec57a2b1e3d81b00a62ce89e73a4ff2c8d Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Fri, 24 Jan 2025 13:35:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- package-lock.json | 5 +- package.json | 1 + src/App.vue | 3 +- src/assets/return.svg | 1 + src/eventBus.ts | 6 ++ src/router/index.ts | 6 +- src/stores/counter.ts | 12 +++ src/stores/index.ts | 0 src/views/Simple.vue | 12 +-- src/views/Test.vue | 83 +++++++++++++++++++ src/views/components/Header.vue | 31 ++++++-- src/views/components/SimpleCard.vue | 118 +++++++++++++++------------- src/views/components/SimpleCardVertical.vue | 36 +++++++++ src/views/components/index.ts | 3 +- src/views/components/simple.ts | 8 ++ src/views/style/simpleCard.css | 54 +++++++++++++ src/views/style/simpleCardVertical.css | 81 +++++++++++++++++++ 18 files changed, 384 insertions(+), 78 deletions(-) create mode 100644 src/assets/return.svg create mode 100644 src/eventBus.ts create mode 100644 src/stores/index.ts create mode 100644 src/views/Test.vue create mode 100644 src/views/components/SimpleCardVertical.vue create mode 100644 src/views/components/simple.ts create mode 100644 src/views/style/simpleCard.css create mode 100644 src/views/style/simpleCardVertical.css diff --git a/index.html b/index.html index 8df736f..f98d55d 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Vite App + 辅助加样
diff --git a/package-lock.json b/package-lock.json index 5e1bbf2..36a00bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^1.7.9", "dayjs": "^1.11.13", + "mitt": "^3.0.1", "pinia": "^2.3.0", "ramda": "^0.30.1", "rxjs": "^7.8.1", @@ -3263,9 +3264,7 @@ "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", - "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", - "dev": true, - "license": "MIT" + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" }, "node_modules/mrmime": { "version": "2.0.0", diff --git a/package.json b/package.json index 1331cc5..0731011 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "axios": "^1.7.9", "dayjs": "^1.11.13", + "mitt": "^3.0.1", "pinia": "^2.3.0", "ramda": "^0.30.1", "rxjs": "^7.8.1", diff --git a/src/App.vue b/src/App.vue index d4ee7c2..e72bdc4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,10 @@ diff --git a/src/assets/return.svg b/src/assets/return.svg new file mode 100644 index 0000000..9bcb096 --- /dev/null +++ b/src/assets/return.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/eventBus.ts b/src/eventBus.ts new file mode 100644 index 0000000..f839d01 --- /dev/null +++ b/src/eventBus.ts @@ -0,0 +1,6 @@ +import mitt from 'mitt' +type Events = { + menuId: number, +} + +export const eventBus = mitt() \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 709ed8e..1cbe1dc 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,5 @@ import { createRouter, createWebHistory } from 'vue-router' import Simple from '../views/Simple.vue' - const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ @@ -10,6 +9,11 @@ const router = createRouter({ component: Simple, }, { + path: '/test', + name: 'test', + component: () => import('../views/Test.vue'), + }, + { path: '/about', name: 'about', // route level code-splitting diff --git a/src/stores/counter.ts b/src/stores/counter.ts index b6757ba..5f2de4d 100644 --- a/src/stores/counter.ts +++ b/src/stores/counter.ts @@ -10,3 +10,15 @@ export const useCounterStore = defineStore('counter', () => { return { count, doubleCount, increment } }) + + +export const useMenuStore = defineStore('menu', ()=>{ + const menuId = ref(0) + const setMenuId = (id:number)=> { + menuId.value = id + } + return { + menuId, + setMenuId + } +}) \ No newline at end of file diff --git a/src/stores/index.ts b/src/stores/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/views/Simple.vue b/src/views/Simple.vue index 969a937..248377b 100644 --- a/src/views/Simple.vue +++ b/src/views/Simple.vue @@ -1,12 +1,10 @@ + \ No newline at end of file diff --git a/src/views/components/Header.vue b/src/views/components/Header.vue index 79333d7..7169530 100644 --- a/src/views/components/Header.vue +++ b/src/views/components/Header.vue @@ -5,14 +5,17 @@
- +
\ No newline at end of file diff --git a/src/views/components/SimpleCardVertical.vue b/src/views/components/SimpleCardVertical.vue new file mode 100644 index 0000000..8f380a3 --- /dev/null +++ b/src/views/components/SimpleCardVertical.vue @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/src/views/components/index.ts b/src/views/components/index.ts index b107441..e79061a 100644 --- a/src/views/components/index.ts +++ b/src/views/components/index.ts @@ -1,2 +1,3 @@ import { default as SimpleCard } from './SimpleCard.vue' -import { default as Header } from './Header.vue' \ No newline at end of file +import { default as Header } from './Header.vue' +import { default as SimpleCardVertical } from './SimpleCardVertical.vue' \ No newline at end of file diff --git a/src/views/components/simple.ts b/src/views/components/simple.ts new file mode 100644 index 0000000..b6cfa28 --- /dev/null +++ b/src/views/components/simple.ts @@ -0,0 +1,8 @@ + +const clearTime = () => { + console.log('12') +} + +export { + clearTime +} \ No newline at end of file diff --git a/src/views/style/simpleCard.css b/src/views/style/simpleCard.css new file mode 100644 index 0000000..73397d5 --- /dev/null +++ b/src/views/style/simpleCard.css @@ -0,0 +1,54 @@ +.simple_card{ + width: 100px; + height: 137px; + background: #FFFFFF; + border-radius: 8px; + opacity: 1; + .simple_pos{ + text-align: center; + font-family: HarmonyOS Sans SC; + font-size: 22px; + font-weight: bold; + line-height: normal; + color: #1871F8; + + } + + .simple_time{ + width: 90px; + height: 70px; + border-radius: 6px; + opacity: 1; + background: #1871F8; + padding-top:2px; + margin-left: 5px; + .simple_remaining_time{ + display: flex; + color: #FFFFFF; + text-align: center; + font-size: 12px; + font-weight: bold; + padding-top: 10px; + padding-left: 10px; + } + + .simple_countdown{ + width: 84px; + height: 32px; + border-radius: 6px; + opacity: 1; + background: #195DC4; + color: #FFFFFF; + padding-top: 5px; + text-align: center; + margin-left:3px; + margin-top:2px; + } + } + + .simple_btn{ + border-radius: 6px; + width: 90px; + margin-left:5px; + } +} \ No newline at end of file diff --git a/src/views/style/simpleCardVertical.css b/src/views/style/simpleCardVertical.css new file mode 100644 index 0000000..a789e59 --- /dev/null +++ b/src/views/style/simpleCardVertical.css @@ -0,0 +1,81 @@ +.simple_card{ + width: 310px; + height: 42px; + background: #FFFFFF; + border-radius: 8px; + opacity: 1; + display: flex; + gap: 5px; + + .simple_content{ + width: 198px; + height: 37px; + border-radius: 8px; + background: #5BE881; + margin: auto; + margin-left: 2px; + display:flex; + .simple_seq{ + color: #ffffff; + padding-left: 15px; + padding-top: 5px; + width: 35px; + } + + .simple_time_icon{ + display: flex; + img{ + width: 15px; + height: 15px; + margin: auto; + } + + .simple_remaining_time{ + display: flex; + color: #FFFFFF; + text-align: center; + font-size: 13px; + font-weight: bold; + padding-top: 10px; + padding-left: 5px; + } + } + + .simple_pos{ + height: 25px; + font-size: 22px; + font-weight: bold; + } + + + + .simple_countdown{ + width: 84px; + height: 32px; + border-radius: 6px; + opacity: 1; + background: #52D375; + color: #FFFFFF; + padding-top: 5px; + text-align: center; + margin-left:3px; + margin-top:2px; + } + } + + .simple_btn{ + border-radius: 6px; + width: 107px; + height: 37px; + margin-top:3px; + background: #5BE881; + font-weight: bold; + display: flex; + justify-content: center; + align-items: center; + + .simple_clear{ + color:#FFFFFF; + } + } +} \ No newline at end of file