From 8d113584af6c8a38a73e1c30196fe95acfc99304 Mon Sep 17 00:00:00 2001 From: Searchstars Date: Sun, 23 Mar 2025 10:35:13 +0800 Subject: [PATCH] =?UTF-8?q?new=20feature:=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=B5=B7=E5=A7=8B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/common/loading-blue.gif | Bin 0 -> 9440 bytes src/common/settings_startuppage.png | Bin 0 -> 1535 bytes src/components/Video/Video.ux | 24 ++-- src/i18n/en.json | 1 + src/i18n/zh.json | 1 + src/pages/app/entry/prepage/prepage.ux | 23 +++- src/pages/app/features/settings/settings.ux | 115 +++++++++++--------- src/settings.ts | 2 + 9 files changed, 100 insertions(+), 68 deletions(-) create mode 100644 src/common/loading-blue.gif create mode 100644 src/common/settings_startuppage.png diff --git a/package.json b/package.json index c9aaf4f..27ffdd9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "license": "GPL-3.0-only", "scripts": { - "start": "aiot server --watch --open-nuttx --enable-protobuf true", + "start": "aiot server --watch --open-nuttx", "build": "aiot build --enable-jsc --enable-protobuf", "release": "aiot release --enable-jsc --enable-protobuf --enable-image-png8", "watch": "aiot watch --open-nuttx", diff --git a/src/common/loading-blue.gif b/src/common/loading-blue.gif new file mode 100644 index 0000000000000000000000000000000000000000..3891edd9ba19706e7d9adc84714553207b9935e3 GIT binary patch literal 9440 zcmeHNXIN9|w%#-iMUbKtJrF}jN`TOUpmZXF^g1em1PBm<5Tu9=0}6-;qYhn~B1&&c z1XNIz0HPGfLBx^X1P_i474A+#LKyX&@Kgy}tFm3k#IFt{z$v zkOW={KRX7J5czMeQPA(4W`x0*iJ{XEY6Vc%N()Ng8w08iO z2=&7H;(`odb2o0npg4>H%tgx@ZXIlb^}|_4gZ4pRtEuM&m zM&JX3LXi;$Ff@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Sy2a@2B=7cS*BJ$ z-_$M2Sb;pS4!#qtfVoq#|AI_|?r` r*rg7rq<0Pq3!SsM>fn#yy)4J_{4mrVUG8y38D*Ju-tPl88v6eQ0Pr~3 literal 0 HcmV?d00001 diff --git a/src/common/settings_startuppage.png b/src/common/settings_startuppage.png new file mode 100644 index 0000000000000000000000000000000000000000..ba58158e970f0630163b39b94632629de7fb69f7 GIT binary patch literal 1535 zcmVPx#1am@3R0s$N2z&@+hyVZusYygZRA_{cY4HA76;Zedm`F?n24Dt;*+?7& zTY!V?Kc=*2iALSgNsG|2h-_?_xKxqiI)ZABr7Y+_q`0@PgV9{f$)En3r`Z1iSjtOC z1T3Un6>E!D)&(*#rz9m-m<&^4SQKSlG#2f&6ANi4$mRPhxT3@1Fa}V?6&<;Je}E!~`+(U^hS98^LY;!A3J3ND-;NU}Vue%m|nsIA83feH!h{@)Lh%k3R& zbBgfkslmJ6K5V{J(n&gY^JPAJbPE;n>o;2vl$;Q$V>e*5U9~%ksVHf*o+~D5=Mw}0}vcDt+Ac+?(# z|5ZhulW8Eub%26wGz~~m8aNp`+oz}C%&CLwnFYoSoQQ}W`~V;+1XbB+8YNZCNiork zIJ?TTaPyK<%Pih*`V-|yYUiTAM=>0S_s6OwuS%7U5Fgt+P(D6z=~=wpC~v#H17}aA zB5eqwaIr+5;CS;tWg|gvH$A27WWKDvjq-LU47m2i=pzL3F$ZP|$$YLFSkT+m<_1ij zG}KWMJ{sbp7~d)7wPA@_(iZ*OU1)Ya+nF1vYIzpE|8k(FVY`|{5Dg$OO6abOY`#>g z6?71O^by9mC?-G5=zK0OdhZm`Z96*p&=n}hAa&g`6?}UPdd_wSHl9qJF;L9e6W^t` zKX^U_raagMBwBA)jtnGD0dWYD`xp>x9gbRl95@AJ|8c4*`l?pr5j@1R>?!+?3zYV( zRFhu38a!Y5Tu(L-hB2c;I3HOO*3zC;5RJNn#7aD=^JX}dx_L!f8d2Uk}NGim77JU?kJqKe$&S^dEv>ASzhiuldQJ=~re}Lo!|(mj%U9X9SI~}2d9osK>oZ(V z&ni71ez_oAaE*h{RQ}NHgVZ2gPA|$;T(OjS>0mYxrE+2DPI-#59{fAmTb@z&=R|Oq&KIY>)CT zCLeG#x*Hs%Tu9Q*m#+6qbvexEA}t?min5lp_bYX+S?f8NYU6|FSRC^7TQ*5^^_3m# z6y<7`e#?BFvdR`$m<*HaxP?Fb%ljm=u literal 0 HcmV?d00001 diff --git a/src/components/Video/Video.ux b/src/components/Video/Video.ux index dd8a1a3..9872682 100644 --- a/src/components/Video/Video.ux +++ b/src/components/Video/Video.ux @@ -4,10 +4,9 @@
-
- +
+
{{ video.title }}
@@ -34,10 +33,8 @@ export default { data: { useColumnTitle: false, vidpicture_style: { - "min-width": "160px", - "min-height": "100px", - "max-width": "160px", - "max-height": "100px" + width: "160px", + height: "100px" }, onlineimg_width: "160", onlineimg_height: "100", @@ -56,10 +53,8 @@ export default { }, // 在线图片展示大小(UI层) SetOnlineImageSize(width, height) { - this.vidpicture_style["min-width"] = width + "px" - this.vidpicture_style["max-width"] = width + "px" - this.vidpicture_style["min-height"] = height + "px" - this.vidpicture_style["max-height"] = height + "px" + this.vidpicture_style["width"] = width + "px" + this.vidpicture_style["height"] = height + "px" }, // 在线图片加载大小(组件层) // 使用比展示大小更小的加载大小可以节省设备RAM、降低渲染压力、节省流量等 @@ -142,6 +137,11 @@ export default { align-items: center; } +.vidpicture_img { + border-radius: 30px; + object-fit: scale-down; +} + .vidtitle { padding-left: 20px; width: 145px; diff --git a/src/i18n/en.json b/src/i18n/en.json index 2356aae..d771fdd 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -114,6 +114,7 @@ "videoPushRelevance": "Video Recommendation Relevance", "videoPushCount": "Number of Recommended Videos on Homepage", "enableFullAnimation": "Enable Full Animation", + "startupPage": "Startup Page", "clearTemp": "Clear Cache", "logOut": "Log Out", "donation": "Donate", diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 5e6c8bb..c05d754 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -116,6 +116,7 @@ "videoPushRelevance": "视频推荐相关性", "videoPushCount": "首页视频推荐数", "enableFullAnimation": "启用完整动画", + "startupPage": "起始页面", "clearTemp": "清除缓存", "logOut": "退出登录", "donation": "捐赠", diff --git a/src/pages/app/entry/prepage/prepage.ux b/src/pages/app/entry/prepage/prepage.ux index e9a23df..020c441 100644 --- a/src/pages/app/entry/prepage/prepage.ux +++ b/src/pages/app/entry/prepage/prepage.ux @@ -20,9 +20,26 @@ export default { }, async PreLogin() { await global.biliclient.login(false, null) - router.replace({ - uri: "pages/app/features/main" - }) + switch (global.settings.SETTINGS.startupPage) { + case "主页": + router.replace({ + uri: "pages/app/features/main" + }) + break; + case "私信": + router.replace({ + uri: "pages/app/features/mypage" + }) + router.push({ + uri: "pages/message/dmlist" + }) + break; + case "菜单": + router.replace({ + uri: "pages/app/arealist" + }) + break; + } }, ReLogin(){ global.biliclient.logOut() diff --git a/src/pages/app/features/settings/settings.ux b/src/pages/app/features/settings/settings.ux index f73eb12..848272f 100644 --- a/src/pages/app/features/settings/settings.ux +++ b/src/pages/app/features/settings/settings.ux @@ -5,21 +5,26 @@ -
+
{{ $t("settings.videoPushRelevance") }} {{ fresh_type }}
-
+
{{ $t("settings.videoPushCount") }} {{ home_vid_count }}
-
+
{{ $t("settings.enableFullAnimation") }} {{ enableFullAnimation ? "开" : "关" }}
+
+ + {{ $t("settings.startupPage") }} + {{ startupPage }} +
{{ $t("settings.clearTemp") }} @@ -59,8 +64,7 @@ export default { fresh_type: 3, home_vid_count: 10, enableFullAnimation: false, - switchset_name: ["enable_full_anim"], - countset_name: ["fresh_type", "home_vid_count"], + startupPage: "主页", countset: { fresh_type_max: 3, fresh_type_min: 1, @@ -90,56 +94,62 @@ export default { }) }, SwitchSet(name) { - switch (name) { - case "enable_full_anim": - if (this.enableFullAnimation) { - this.enableFullAnimation = false - global.settings.saveSettings({ - enableFullAnimation: this.enableFullAnimation - }) - } else { - this.enableFullAnimation = true - global.settings.saveSettings({ - enableFullAnimation: this.enableFullAnimation - }) - prompt.showToast({ - message: "开启此选项会导致首页等页面在低性能设备上严重卡顿,因此建议保持关闭!", - duration: 6000 - }) - } - this.UpdateNumView() + if (name === "enable_full_anim") { + this.enableFullAnimation = !this.enableFullAnimation; + global.settings.saveSettings({ enableFullAnimation: this.enableFullAnimation }); + + if (this.enableFullAnimation) { + prompt.showToast({ + message: "开启此选项会导致首页等页面在低性能设备上严重卡顿,因此建议保持关闭!", + duration: 6000 + }); + } + this.UpdateNumView(); } }, ClickCountSet(name) { - switch (name) { - case "fresh_type": - var new_fresh_type = null - if (this.fresh_type < this.countset.fresh_type_max) { - new_fresh_type = this.fresh_type + 1 - } else { - new_fresh_type = this.countset.fresh_type_min - } - global.settings.saveSettings({ - fresh_type: new_fresh_type - }) - setTimeout(() => { - this.UpdateNumView() - }, 100) - break - case "home_vid_count": - var new_home_vid_count = null - if (this.home_vid_count < this.countset.home_vid_count_max) { - new_home_vid_count = this.home_vid_count + 1 - } else { - new_home_vid_count = this.countset.home_vid_count_min - } - global.settings.saveSettings({ - home_vid_count: new_home_vid_count - }) - setTimeout(() => { - this.UpdateNumView() - }, 100) - break + const mapping = { + "fresh_type": { + current: this.fresh_type, + max: this.countset.fresh_type_max, + min: this.countset.fresh_type_min, + key: "fresh_type" + }, + "home_vid_count": { + current: this.home_vid_count, + max: this.countset.home_vid_count_max, + min: this.countset.home_vid_count_min, + key: "home_vid_count" + } + }; + + if (mapping[name]) { + const { current, max, min, key } = mapping[name]; + const newValue = current < max ? current + 1 : min; + global.settings.saveSettings({ [key]: newValue }); + + // 延时更新视图 + setTimeout(() => { + this.UpdateNumView(); + }, 100); + } + }, + ItemsChangeSet(name) { + if (name === "startup_page") { + const pages = ["主页", "私信", "菜单"]; + // 新建变量 startupPage 用于存储当前启动页状态,若未初始化则默认取 "主页" + if (!this.startupPage) { + this.startupPage = pages[0]; + } else { + // 获取当前 startupPage 在 pages 数组中的索引,然后切换到下一个项(循环) + let index = pages.indexOf(this.startupPage); + index = (index + 1) % pages.length; + this.startupPage = pages[index]; + } + global.settings.saveSettings({ + startupPage: this.startupPage + }); + this.UpdateNumView(); } }, logout() { @@ -153,6 +163,7 @@ export default { this.fresh_type = global.settings.SETTINGS.fresh_type this.home_vid_count = global.settings.SETTINGS.home_vid_count this.enableFullAnimation = global.settings.SETTINGS.enableFullAnimation + this.startupPage = global.settings.SETTINGS.startupPage }, onInit() { this.UpdateNumView() diff --git a/src/settings.ts b/src/settings.ts index d64bc6d..30b7ac7 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -6,6 +6,7 @@ interface SettingsInterface { // 专栏articleshow的每页dom节点裁切数量(单页最大dom数) article_split_dom_count: number; enableFullAnimation: boolean; + startupPage: string; // 下面的设置项将不在设置页面中展示 agreedAllAgreements: boolean; @@ -20,6 +21,7 @@ export let SETTINGS: SettingsInterface = { home_vid_count: 10, article_split_dom_count: 9999, enableFullAnimation: false, + startupPage: "主页", agreedAllAgreements: false, // 是否已同意所有协议(用户协议 隐私协议 etc.) enableUserTracker: true,