diff --git a/src/api/index.ts b/src/api/index.ts index 0e466a5..ccf3ca3 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -62,3 +62,8 @@ export const searchNews = (data: any) => { return Request.post("/news/search", data); }; +// 微信授权 +export const doWxAuth = (data: any) => { + return Request.post("/common/auth", data); +}; + diff --git a/src/components/article/index.vue b/src/components/article/index.vue index eeb2efe..20c6199 100644 --- a/src/components/article/index.vue +++ b/src/components/article/index.vue @@ -24,7 +24,11 @@ - + @@ -43,7 +47,7 @@ import { const props = defineProps({ data: { type: Object, - default: () => { }, + default: () => {}, }, }); diff --git a/src/components/article/indexNewsInfo.vue b/src/components/article/indexNewsInfo.vue index bb4ca33..3e41c80 100644 --- a/src/components/article/indexNewsInfo.vue +++ b/src/components/article/indexNewsInfo.vue @@ -16,17 +16,31 @@ - + - {{ item }} + {{ item }} - + - {{ item }} + {{ item }} @@ -42,15 +56,17 @@ - - + - - + - + {{ - !isLoginStatus - ? "未登录用户" - : maskPhoneNumber() + !isLoginStatus ? "未登录用户" : maskPhoneNumber() }} - + }" + @click="handleClick(-1)" + > - + }" + @click="handleClick(0)" + > - + }" + @click="handleClick(1)" + > - + }" + @click="handleClick(2)" + > @@ -103,26 +131,23 @@ const isLoginStatus = ref(false); const LoginShow = ref(false); onMounted(() => { - console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync('token')) + console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync("token")); - if (uni.getStorageSync('token')) { + if (uni.getStorageSync("token")) { isLoginStatus.value = true; } }); // 将手机号的中间四位用 * 代替 const maskPhoneNumber = (phoneNumber: string) => { - if (!phoneNumber && uni.getStorageSync('userPhone')) { - phoneNumber = uni.getStorageSync('userPhone') + if (!phoneNumber && uni.getStorageSync("userPhone")) { + phoneNumber = uni.getStorageSync("userPhone"); } if (phoneNumber) { return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); - } else { return "未登录用户"; - } - }; // 关闭弹框 @@ -146,7 +171,10 @@ const loginBtnStatus = () => { // 登录状态,点击就是退出登录 loginOut(); } else { - LoginShow.value = true; + // LoginShow.value = true; + uni.navigateTo({ + url: "/pages/login/indexMini", + }); } }; diff --git a/src/components/mini/Tabbar.vue b/src/components/mini/Tabbar.vue index 49988ce..ad96270 100644 --- a/src/components/mini/Tabbar.vue +++ b/src/components/mini/Tabbar.vue @@ -1,25 +1,30 @@ + + diff --git a/src/pages/news/index.vue b/src/pages/news/index.vue index 32a6732..ca45a86 100644 --- a/src/pages/news/index.vue +++ b/src/pages/news/index.vue @@ -9,13 +9,22 @@ - + @@ -32,7 +41,12 @@ - + @@ -88,8 +102,7 @@ function back() { }); } -onShow(() => { -}); +onShow(() => {}); function handleSubListItem(id: any) { uni.setStorageSync("newsItem", id);