From ed39f5e8cb15ece064c45ee6ee0f370fc740244d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 04 六月 2026 17:11:30 +0800
Subject: [PATCH] 马铃薯app 1.白屏问题解决
---
src/App.vue | 200 +++++++++++++++++++++++++-------------------------
1 files changed, 100 insertions(+), 100 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index d427b1e..6cf062d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,111 +1,111 @@
<template>
- <Splash v-if="showSplash" />
- <div v-else>
- <router-view />
- </div>
+ <Splash v-if="showSplash" />
+ <view v-else>
+ <router-view />
+ </view>
</template>
<script setup>
- import { ref, onMounted } from "vue";
- import Splash from "./components/Splash.vue";
- import { confirmMessage } from "@/api/login.js";
+import { ref, onMounted } from "vue";
+import Splash from "./components/Splash.vue";
+import { confirmMessage } from "@/api/login.js";
- const showSplash = ref(true);
+const showSplash = ref(true);
- onMounted(() => {
- setTimeout(() => {
- showSplash.value = false;
- }, 5000);
+onMounted(() => {
+ setTimeout(() => {
+ showSplash.value = false;
+ }, 5000);
+
+ // 鍒濆鍖栨帹閫佹湇鍔�,鏆傛椂娉ㄩ噴锛屽鎴烽渶瑕佹墦寮�
+ // initPushService();
+});
+// 鍒濆鍖栨帹閫佹湇鍔★紙uni-push 1.0锛�
+const initPushService = () => {
+ // #ifdef APP-PLUS
+ console.log("寮�濮嬪垵濮嬪寲鎺ㄩ�佹湇鍔★紙uni-push 1.0锛�");
+ if (typeof plus !== "undefined" && plus.push) {
+ console.log("plus.push 瀛樺湪:", plus.push);
+
+ // 鑾峰彇瀹㈡埛绔帹閫佹爣璇�
+ console.log("浣跨敤 plus.push.getClientInfo 鑾峰彇瀹㈡埛绔爣璇�");
+ plus.push.getClientInfoAsync(info => {
+ console.log("瀹㈡埛绔帹閫佹爣璇�:", info);
+ uni.setStorageSync("clientid", info.clientid);
+
+ // 杩欓噷鍙互灏嗗鎴风鏍囪瘑鍙戦�佸埌鏈嶅姟鍣�
+ });
+ setTimeout(() => {
+ console.log("浣跨敤 plus.push.getClientInfoAsync 鑾峰彇瀹㈡埛绔爣璇�");
+ plus.push.getClientInfoAsync(info => {
+ console.log("瀹㈡埛绔帹閫佹爣璇�:", info);
+ // 杩欓噷鍙互灏嗗鎴风鏍囪瘑鍙戦�佸埌鏈嶅姟鍣�
+ });
+ }, 1000);
+
+ // 鐩戝惉鎺ㄩ�佹秷鎭偣鍑讳簨浠�
+ plus.push.addEventListener("click", handlePushClick, false);
+ // 鐩戝惉鎺ㄩ�佹秷鎭帴鏀朵簨浠�
+ plus.push.addEventListener("receive", handlePushReceive, false);
+ console.log("鎺ㄩ�佹湇鍔℃敞鍐屾垚鍔�");
+ } else {
+ console.log("鎺ㄩ�佹湇鍔′笉鍙敤");
+ }
+ // #endif
+};
- // 鍒濆鍖栨帹閫佹湇鍔�,鏆傛椂娉ㄩ噴锛屽鎴烽渶瑕佹墦寮�
- // initPushService();
- });
- // 鍒濆鍖栨帹閫佹湇鍔★紙uni-push 1.0锛�
- const initPushService = () => {
- // #ifdef APP-PLUS
- console.log("寮�濮嬪垵濮嬪寲鎺ㄩ�佹湇鍔★紙uni-push 1.0锛�");
- if (typeof plus !== "undefined" && plus.push) {
- console.log("plus.push 瀛樺湪:", plus.push);
+// 澶勭悊鎺ㄩ�佹秷鎭偣鍑讳簨浠�
+const handlePushClick = msg => {
+ console.log("鐐瑰嚮鎺ㄩ�佹秷鎭�:", msg);
+ console.log("瑙f瀽鍚�:", msg.payload.noticeId);
+ try {
+ if (msg.payload.needMarkRead) {
+ confirmMessage(msg.payload.noticeId, 1).then(res => {
+ if (msg.payload.url) {
+ if (msg.payload.url.indexOf("/") === 0) {
+ uni.navigateTo({
+ url: msg.payload.url,
+ });
+ } else {
+ uni.navigateTo({
+ url: "/" + msg.payload.url,
+ });
+ }
+ }
+ });
+ } else {
+ if (msg.payload.url) {
+ if (msg.payload.url.indexOf("/") === 0) {
+ uni.navigateTo({
+ url: msg.payload.url,
+ });
+ } else {
+ uni.navigateTo({
+ url: "/" + msg.payload.url,
+ });
+ }
+ }
+ }
+ } catch (error) {
+ uni.showToast({
+ title: "璺緞:" + msg.payload,
+ icon: "none",
+ });
+ uni.showToast({
+ title: "璺宠浆澶辫触:" + error.message,
+ icon: "none",
+ });
+ }
+ // 瑙f瀽骞跺鐞嗘帹閫佹秷鎭�...
+};
- // 鑾峰彇瀹㈡埛绔帹閫佹爣璇�
- console.log("浣跨敤 plus.push.getClientInfo 鑾峰彇瀹㈡埛绔爣璇�");
- plus.push.getClientInfoAsync(info => {
- console.log("瀹㈡埛绔帹閫佹爣璇�:", info);
- uni.setStorageSync("clientid", info.clientid);
-
- // 杩欓噷鍙互灏嗗鎴风鏍囪瘑鍙戦�佸埌鏈嶅姟鍣�
- });
- setTimeout(() => {
- console.log("浣跨敤 plus.push.getClientInfoAsync 鑾峰彇瀹㈡埛绔爣璇�");
- plus.push.getClientInfoAsync(info => {
- console.log("瀹㈡埛绔帹閫佹爣璇�:", info);
- // 杩欓噷鍙互灏嗗鎴风鏍囪瘑鍙戦�佸埌鏈嶅姟鍣�
- });
- }, 1000);
-
- // 鐩戝惉鎺ㄩ�佹秷鎭偣鍑讳簨浠�
- plus.push.addEventListener("click", handlePushClick, false);
- // 鐩戝惉鎺ㄩ�佹秷鎭帴鏀朵簨浠�
- plus.push.addEventListener("receive", handlePushReceive, false);
- console.log("鎺ㄩ�佹湇鍔℃敞鍐屾垚鍔�");
- } else {
- console.log("鎺ㄩ�佹湇鍔′笉鍙敤");
- }
- // #endif
- };
-
- // 澶勭悊鎺ㄩ�佹秷鎭偣鍑讳簨浠�
- const handlePushClick = msg => {
- console.log("鐐瑰嚮鎺ㄩ�佹秷鎭�:", msg);
- console.log("瑙f瀽鍚�:", msg.payload.noticeId);
- try {
- if (msg.payload.needMarkRead) {
- confirmMessage(msg.payload.noticeId, 1).then(res => {
- if (msg.payload.url) {
- if (msg.payload.url.indexOf("/") === 0) {
- uni.navigateTo({
- url: msg.payload.url,
- });
- } else {
- uni.navigateTo({
- url: "/" + msg.payload.url,
- });
- }
- }
- });
- } else {
- if (msg.payload.url) {
- if (msg.payload.url.indexOf("/") === 0) {
- uni.navigateTo({
- url: msg.payload.url,
- });
- } else {
- uni.navigateTo({
- url: "/" + msg.payload.url,
- });
- }
- }
- }
- } catch (error) {
- uni.showToast({
- title: "璺緞:" + msg.payload,
- icon: "none",
- });
- uni.showToast({
- title: "璺宠浆澶辫触:" + error.message,
- icon: "none",
- });
- }
- // 瑙f瀽骞跺鐞嗘帹閫佹秷鎭�...
- };
-
- // 澶勭悊鎺ㄩ�佹秷鎭帴鏀朵簨浠�
- const handlePushReceive = msg => {
- console.log("鏀跺埌鎺ㄩ�佹秷鎭�:", msg);
- // 澶勭悊鎺ユ敹鐨勬帹閫佹秷鎭�...
- };
+// 澶勭悊鎺ㄩ�佹秷鎭帴鏀朵簨浠�
+const handlePushReceive = msg => {
+ console.log("鏀跺埌鎺ㄩ�佹秷鎭�:", msg);
+ // 澶勭悊鎺ユ敹鐨勬帹閫佹秷鎭�...
+};
</script>
<style lang="scss">
- @import "uview-plus/index.scss";
- @import "@/static/scss/index.scss";
+@import "uview-plus/index.scss";
+@import "@/static/scss/index.scss";
</style>
\ No newline at end of file
--
Gitblit v1.9.3