From f9c3da2f7839c100623841ef16bafd933f3d91a7 Mon Sep 17 00:00:00 2001 From: Zyronon Date: Wed, 19 Nov 2025 20:01:03 +0800 Subject: [PATCH] wip --- package.json | 2 + src/apis/member.ts | 39 ++ src/apis/user.ts | 1 + src/assets/css/style.scss | 9 + src/components/PopConfirm.vue | 67 ++- src/config/env.ts | 1 + .../article/components/TypingArticle.vue | 18 +- src/pages/user/Pay.vue | 217 -------- src/pages/user/User.vue | 39 +- src/pages/user/VipIntro.vue | 463 +++++++++++++----- src/pages/user/login.vue | 51 +- src/router.ts | 4 +- src/stores/auth.ts | 17 +- src/stores/base.ts | 4 +- src/utils/index.ts | 13 +- uno.config.ts | 1 + 16 files changed, 556 insertions(+), 390 deletions(-) delete mode 100644 src/pages/user/Pay.vue diff --git a/package.json b/package.json index 13438bf0..67aca91b 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,9 @@ "@iconify-json/qlementine-icons": "^1.2.11", "@iconify-json/ri": "^1.2.5", "@iconify-json/simple-icons": "^1.2.48", + "@iconify-json/streamline": "^1.2.5", "@iconify-json/system-uicons": "^1.2.4", + "@iconify-json/uiw": "^1.2.3", "@types/file-saver": "^2.0.7", "@types/lodash-es": "^4.17.12", "@types/md5": "^2.1.33", diff --git a/src/apis/member.ts b/src/apis/member.ts index 0403c257..4674b6c3 100644 --- a/src/apis/member.ts +++ b/src/apis/member.ts @@ -25,6 +25,45 @@ export type LevelBenefits = { }[] } +export type CouponInfo = { + "id": number, + "code": string, + "name": string, + "type": string, + "value"?: string, + "min_amount"?: string, + "max_discount"?: string, + "applicable_levels": { + code: string, + name: string, + level: string, + }[] + "usage_limit": number, + "total_usage": number, + "start_date": string + "end_date": string + "is_active": number, + "created_at": string + "updated_at": string + "is_valid": boolean, +} + export function levelBenefits(params) { return http('member/levelBenefits', null, params, 'get') } + +export function orderCreate(params) { + return http<{ orderNo: string }>('/member/orderCreate', params, null, 'post') +} + +export function orderStatus(params) { + return http('/member/orderStatus', null, params, 'get') +} + +export function couponInfo(params) { + return http('/member/couponInfo', null, params, 'get') +} + +export function setAutoRenewApi(params) { + return http('/member/setAutoRenew', params, null, 'post') +} diff --git a/src/apis/user.ts b/src/apis/user.ts index 29bfdc0f..b6c90482 100644 --- a/src/apis/user.ts +++ b/src/apis/user.ts @@ -24,6 +24,7 @@ export interface User { endDate: number, autoRenew: boolean, plan: string, + planDesc: string, } } diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index a9283b4e..125ff330 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -73,6 +73,8 @@ --color-label-bg: whitesmoke; --color-link: #2563EB; + + --color-card-bg: white; } .footer { @@ -124,6 +126,8 @@ html.dark { --color-label-bg: rgb(10, 10, 10); + --color-card-bg: rgb(30, 31, 34); + .footer { &.hide { --color-progress-bar: var(--color-third) !important; @@ -403,6 +407,11 @@ a { background: var(--color-second); } +.card-white { + @extend .card; + background: var(--color-card-bg); +} + .inline-center { @apply inline-flex justify-center items-center; } diff --git a/src/components/PopConfirm.vue b/src/components/PopConfirm.vue index ed06eca5..2e6b8782 100644 --- a/src/components/PopConfirm.vue +++ b/src/components/PopConfirm.vue @@ -11,9 +11,21 @@ export default { }, props: { title: { - type: String, + type: [String, Array], default() { return '' + }, + validator(value) { + // Validate that array items have the correct structure + if (Array.isArray(value)) { + return value.every(item => + typeof item === 'object' && + item !== null && + typeof item.text === 'string' && + ['normal', 'bold', 'red', 'redBold'].includes(item.type) + ) + } + return typeof value === 'string' } }, disabled: { @@ -23,6 +35,17 @@ export default { } } }, + computed: { + titleItems() { + if (typeof this.title === 'string') { + return [{ text: this.title, type: 'normal' }] + } + if (Array.isArray(this.title)) { + return this.title + } + return [] + } + }, data() { return { show: false @@ -37,6 +60,27 @@ export default { }) }, methods: { + getTextStyle(type) { + const styles = { + normal: { + fontWeight: 'normal', + color: 'inherit' + }, + bold: { + fontWeight: 'bold', + color: 'inherit' + }, + red: { + fontWeight: 'normal', + color: 'red' + }, + redBold: { + fontWeight: 'bold', + color: 'red' + } + } + return styles[type] || styles.normal + }, showPop(e) { if (this.disabled) return this.$emit('confirm') e?.stopPropagation() @@ -68,8 +112,16 @@ export default { { this.show && (
-
- {this.title} +
+ {this.titleItems.map((item, index) => ( +
+ {item.text} +
+ ))}
this.show = false}>取消 @@ -95,6 +147,15 @@ export default { transform: translate(-50%, calc(-100% - .6rem)); z-index: 999; + .title-content { + .title-item { + margin-bottom: 0.25rem; + + &:last-child { + margin-bottom: 0; + } + } + } .options { margin-top: .9rem; diff --git a/src/config/env.ts b/src/config/env.ts index 0a3b1f47..a1b3b61b 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -24,6 +24,7 @@ export let AppEnv = { AppEnv.IS_LOGIN = !!AppEnv.TOKEN AppEnv.CAN_REQUEST = AppEnv.IS_LOGIN && AppEnv.IS_OFFICIAL +// console.log('AppEnv.CAN_REQUEST',AppEnv.CAN_REQUEST) export const RESOURCE_PATH = ENV.API + 'static' diff --git a/src/pages/article/components/TypingArticle.vue b/src/pages/article/components/TypingArticle.vue index 8f9d7137..3d239c46 100644 --- a/src/pages/article/components/TypingArticle.vue +++ b/src/pages/article/components/TypingArticle.vue @@ -437,15 +437,15 @@ function onContextMenu(e: MouseEvent, sentence: Sentence, i, j, w) { onClick: () => { let word = props.article.sections[i][j].words[w] let text = word.word - // let doc = nlp(text) - // // 优先判断是不是动词 - // if (doc.verbs().found) { - // text = doc.verbs().toInfinitive().text() - // } - // // 如果是名词(复数 → 单数) - // if (doc.nouns().found) { - // text = doc.nouns().toSingular().text() - // } + let doc = nlp(text) + // 优先判断是不是动词 + if (doc.verbs().found) { + text = doc.verbs().toInfinitive().text() + } + // 如果是名词(复数 → 单数) + if (doc.nouns().found) { + text = doc.nouns().toSingular().text() + } if (!text.length) text = word.word console.log('text', text) toggleWordCollect(getDefaultWord({word: text, id: nanoid()})) diff --git a/src/pages/user/Pay.vue b/src/pages/user/Pay.vue deleted file mode 100644 index 9b22bf36..00000000 --- a/src/pages/user/Pay.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/user/User.vue b/src/pages/user/User.vue index 29b5da90..7fbac5e9 100644 --- a/src/pages/user/User.vue +++ b/src/pages/user/User.vue @@ -246,13 +246,17 @@ function subscribe() { } +function onFileChange(e) { + console.log('e', e) + +}