From cf3cd6e263b43895480e61ac49fd445584f85566 Mon Sep 17 00:00:00 2001
From: zzp <34701892@qq.com>
Date: Tue, 9 Sep 2025 15:46:49 +0800
Subject: [PATCH] =?UTF-8?q?feat(login):=20=E6=B7=BB=E5=8A=A0H5=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=E5=BC=B9=E7=AA=97=E6=94=AF=E6=8C=81=E5=B9=B6=E9=9B=86?=
=?UTF-8?q?=E6=88=90jweixin-module?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增H5环境下的登录弹窗组件及逻辑
- 添加jweixin-module依赖用于微信相关功能
- 修改baseUrl配置为本地开发环境
- 优化登录组件代码结构和样式
---
package-lock.json | 7 +++
package.json | 3 +-
src/components/RankListMini.vue | 90 ++++++-----------------------
src/components/loginPopup/index.vue | 54 ++++-------------
src/config/index.ts | 4 +-
src/pages/login/indexMini.vue | 49 +++++++++-------
6 files changed, 69 insertions(+), 138 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 87b87f2..f6047f5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -28,6 +28,7 @@
"echarts": "^5.6.0",
"js-cookie": "^3.0.5",
"js-md5": "^0.8.3",
+ "jweixin-module": "^1.6.0",
"pinia": "^2.0.36",
"qs": "^6.11.2",
"vue": "^3.2.45",
@@ -9510,6 +9511,12 @@
"graceful-fs": "^4.1.6"
}
},
+ "node_modules/jweixin-module": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
+ "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
+ "license": "ISC"
+ },
"node_modules/kleur": {
"version": "3.0.3",
"resolved": "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz",
diff --git a/package.json b/package.json
index ca2cb47..e0c0320 100644
--- a/package.json
+++ b/package.json
@@ -59,6 +59,7 @@
"echarts": "^5.6.0",
"js-cookie": "^3.0.5",
"js-md5": "^0.8.3",
+ "jweixin-module": "^1.6.0",
"pinia": "^2.0.36",
"qs": "^6.11.2",
"vue": "^3.2.45",
@@ -84,4 +85,4 @@
"engines": {
"node": ">=14.0.0"
}
-}
\ No newline at end of file
+}
diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue
index 36cad52..17c6684 100644
--- a/src/components/RankListMini.vue
+++ b/src/components/RankListMini.vue
@@ -1,34 +1,17 @@
-
+
-
+
-
+
-
+
-
+
{{ index + 1 }}
@@ -37,56 +20,32 @@
{{ item.title.slice(0, 3) }}
- {{
- item.title.slice(3, item.title.length)
- }}
+ {{ item.title.slice(3, item.title.length) }}
- {{
- item.summary
- }}
+ {{ item.summary }}
-
+
{{ item.source }}
- {{
- dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss")
- }}
+ {{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}
-
+
{{ item.viewCount }}
-
+
{{ item.likeCount }}
-
+
{{ item.shareCount }}
-
-
- 海外独家资讯内容,登录后可查阅全文
+
+ 海外独家资讯内容,登录后可查阅全文
@@ -104,6 +63,7 @@ const isExp = ref(true);
const rankListLocal = ref([]);
const loading = ref(true);
const isLogin = ref(uni.getStorageSync("token"));
+console.log(`🚀 ~ uni.getStorageSync("token"):`, uni.getStorageSync("token"));
watch(
() => isExp.value,
@@ -139,28 +99,16 @@ watch(
let viewCount = 0;
let favCount = 0;
if (item.likeCount) {
- likeCount =
- item.likeCount > 10000
- ? Number(item.likeCount / 10000).toFixed(1) + "万"
- : item.likeCount;
+ likeCount = item.likeCount > 10000 ? Number(item.likeCount / 10000).toFixed(1) + "万" : item.likeCount;
}
if (item.shareCount) {
- shareCount =
- item.shareCount > 10000
- ? Number(item.shareCount / 10000).toFixed(1) + "万"
- : item.shareCount;
+ shareCount = item.shareCount > 10000 ? Number(item.shareCount / 10000).toFixed(1) + "万" : item.shareCount;
}
if (item.viewCount) {
- viewCount =
- item.viewCount > 10000
- ? Number(item.viewCount / 10000).toFixed(1) + "万"
- : item.viewCount;
+ viewCount = item.viewCount > 10000 ? Number(item.viewCount / 10000).toFixed(1) + "万" : item.viewCount;
}
if (item.favCount) {
- favCount =
- item.favCount > 10000
- ? Number(item.favCount / 10000).toFixed(1) + "万"
- : item.viewCount;
+ favCount = item.favCount > 10000 ? Number(item.favCount / 10000).toFixed(1) + "万" : item.viewCount;
}
rankListLocal.value.push({
diff --git a/src/components/loginPopup/index.vue b/src/components/loginPopup/index.vue
index 09a0697..7ee592e 100644
--- a/src/components/loginPopup/index.vue
+++ b/src/components/loginPopup/index.vue
@@ -1,56 +1,24 @@
-