From 8dd85f205dc89436c97b14c0df8dc5892a0f3b20 Mon Sep 17 00:00:00 2001 From: Megghy Date: Sat, 20 Jan 2024 23:51:21 +0800 Subject: [PATCH] update eventfetcher info display --- package.json | 42 +- src/App.vue | 14 +- src/Utils.ts | 9 + src/api/api-models.ts | 17 + src/components/EventFetcherStatusCard.vue | 24 +- src/components/VideoCollectInfoCard.vue | 5 + src/components/manage/PointGoodsItem.vue | 20 + src/data/constants.ts | 1 + src/router/index.ts | 9 + src/views/BiliAuthView.vue | 165 ++++++ src/views/ManageLayout.vue | 2 +- src/views/manage/PointManage.vue | 215 +++++++- src/views/manage/VideoCollectDetailView.vue | 4 +- vite.config.mts | 13 +- yarn.lock | 537 +++++++++++--------- 15 files changed, 783 insertions(+), 294 deletions(-) create mode 100644 src/components/manage/PointGoodsItem.vue create mode 100644 src/views/BiliAuthView.vue diff --git a/package.json b/package.json index dc7b9ad..cb33cba 100644 --- a/package.json +++ b/package.json @@ -8,50 +8,52 @@ "lint": "vite lint" }, "dependencies": { - "@types/node": "^20.10.6", - "@typescript-eslint/eslint-plugin": "^6.16.0", + "@types/node": "^20.11.5", + "@typescript-eslint/eslint-plugin": "^6.19.0", "@vicons/fluent": "^0.12.0", - "@vitejs/plugin-vue": "^5.0.1", - "@vueuse/core": "^10.7.1", - "@vueuse/router": "^10.7.1", - "date-fns": "^3.0.6", - "easy-speech": "^2.2.0", + "@vitejs/plugin-vue": "^5.0.3", + "@vueuse/core": "^10.7.2", + "@vueuse/router": "^10.7.2", + "date-fns": "^3.2.0", + "easy-speech": "^2.3.1", "echarts": "^5.4.3", "eslint": "^8.56.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-oxlint": "^0.2.0", - "eslint-plugin-prettier": "^5.1.2", - "fast-xml-parser": "^4.3.2", + "eslint-plugin-oxlint": "^0.2.1", + "eslint-plugin-prettier": "^5.1.3", + "fast-xml-parser": "^4.3.3", "file-saver": "^2.0.5", "grapheme-splitter": "^1.0.4", "html2canvas": "^1.4.1", "linqts": "^1.15.0", "mitt": "^3.0.1", "pinia": "^2.1.7", - "prettier": "^3.1.1", + "prettier": "^3.2.4", "qrcode.vue": "^3.4.1", "queue-typescript": "^1.0.1", - "vite": "^5.0.10", + "uuid": "^9.0.1", + "vite": "^5.0.12", "vite-svg-loader": "^5.1.0", - "vue": "^3.4.1", + "vue": "^3.4.15", "vue-echarts": "^6.6.8", "vue-request": "^2.0.4", "vue-router": "^4.2.5", - "vue-turnstile": "^1.0.6", + "vue-turnstile": "^1.0.7", "vue3-aplayer": "^1.7.3", - "vue3-marquee": "^4.1.0", + "vue3-marquee": "^4.2.0-beta.1", "vueuc": "^0.4.58", - "worker-timers": "^7.0.80" + "worker-timers": "^7.1.1" }, "devDependencies": { - "@types/eslint": "^8", - "@typescript-eslint/parser": "^6.16.0", + "@types/eslint": "^8.56.2", + "@types/uuid": "^9", + "@typescript-eslint/parser": "^6.19.0", "@vicons/ionicons5": "^0.12.0", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/eslint-config-typescript": "^12.0.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-vue": "^9.19.2", - "naive-ui": "^2.36.0", + "eslint-plugin-vue": "^9.20.1", + "naive-ui": "^2.37.3", "stylus": "^0.62.0", "typescript": "^5.3.3" }, diff --git a/src/App.vue b/src/App.vue index 1d4db85..5916eaa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,12 +6,14 @@ - - - - + + + + + + diff --git a/src/Utils.ts b/src/Utils.ts index 5b7c13a..1f10c7d 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -71,3 +71,12 @@ export function downloadImage(imageSrc: string, filename: string) { } image.src = imageSrc } +export function getBase64(file: File | undefined | null): Promise { + if (!file) return new Promise((resolve) => resolve(undefined)) + return new Promise((resolve, reject) => { + const reader = new FileReader() + reader.readAsDataURL(file) + reader.onload = () => resolve(reader.result?.toString().split(',')[1] || undefined) + reader.onerror = (error) => reject(error) + }) +} diff --git a/src/api/api-models.ts b/src/api/api-models.ts index 9381b79..054177f 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -43,6 +43,8 @@ export interface AccountInfo extends UserInfo { eventFetcherOnline: boolean eventFetcherStatus: string eventFetcherStatusV3: { [errorCode: string]: string } + eventFetcherTodayReceive: number + eventFetcherVersion?: string nextSendEmailTime?: number isServerFetcherOnline: boolean @@ -525,4 +527,19 @@ export interface ResponsePointGoodModel { images: string[] status: GoodsStatus type: GoodsTypes +} + +export interface PointGoodsModel { + id?: number + name: string + count: number + price: number + tags: TagInfo[] + coverImageBase64?: string + status: GoodsStatus + type: GoodsTypes + collectUrl?: string + embedCollectUrl?: boolean + description: string + content?: string } \ No newline at end of file diff --git a/src/components/EventFetcherStatusCard.vue b/src/components/EventFetcherStatusCard.vue index 9b37361..7ca6dd9 100644 --- a/src/components/EventFetcherStatusCard.vue +++ b/src/components/EventFetcherStatusCard.vue @@ -1,7 +1,7 @@ + + diff --git a/src/data/constants.ts b/src/data/constants.ts index 20b71fa..c60ef0c 100644 --- a/src/data/constants.ts +++ b/src/data/constants.ts @@ -34,6 +34,7 @@ export const FEEDBACK_API_URL = { toString: () => `${BASE_API()}feedback/` } export const MUSIC_REQUEST_API_URL = { toString: () => `${BASE_API()}music-request/` } export const VTSURU_API_URL = { toString: () => `${BASE_API()}vtsuru/` } export const POINT_API_URL = { toString: () => `${BASE_API()}point/` } +export const BILI_AUTH_API_URL = { toString: () => `${BASE_API()}bili-auth/` } export const ScheduleTemplateMap = { '': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')) }, diff --git a/src/router/index.ts b/src/router/index.ts index f1358db..7411f1e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -66,6 +66,15 @@ const routes: Array = [ keepAlive: true, }, }, + { + path: '/bili-auth', + name: 'bili-auth', + component: () => import('@/views/BiliAuthView.vue'), + meta: { + title: 'Bilibili 账户认证', + keepAlive: true, + }, + }, manage, user, obs, diff --git a/src/views/BiliAuthView.vue b/src/views/BiliAuthView.vue new file mode 100644 index 0000000..c4064aa --- /dev/null +++ b/src/views/BiliAuthView.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/views/ManageLayout.vue b/src/views/ManageLayout.vue index 27e3df8..49bb108 100644 --- a/src/views/ManageLayout.vue +++ b/src/views/ManageLayout.vue @@ -550,7 +550,7 @@ onMounted(() => { diff --git a/src/views/manage/PointManage.vue b/src/views/manage/PointManage.vue index 04afc3b..2bb77aa 100644 --- a/src/views/manage/PointManage.vue +++ b/src/views/manage/PointManage.vue @@ -1,19 +1,100 @@ diff --git a/src/views/manage/VideoCollectDetailView.vue b/src/views/manage/VideoCollectDetailView.vue index a3d89de..c3c2c8c 100644 --- a/src/views/manage/VideoCollectDetailView.vue +++ b/src/views/manage/VideoCollectDetailView.vue @@ -153,7 +153,7 @@ const gridRender = (type: 'padding' | 'reject' | 'accept') => { cover: () => h('div', { style: 'position: relative;height: 150px;' }, [ h('img', { - src: v.video.cover, + src: v.video.cover.replace('http://', 'https://'), referrerpolicy: 'no-referrer', style: 'max-height: 100%; object-fit: contain;cursor: pointer', onClick: () => window.open('https://www.bilibili.com/video/' + v.info.bvid, '_blank'), @@ -307,7 +307,7 @@ function saveQRCode() { 分享 更新 {{ videoDetail.table.isFinish ? '开启表' : '关闭表' }} - 结果表 + 结果页面