升级逻辑完善

This commit is contained in:
kron
2025-07-19 00:03:12 +08:00
parent c8728786e6
commit b9aff0082b
5 changed files with 35 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import AppFooter from "@/components/AppFooter.vue";
import AppBackground from "@/components/AppBackground.vue";
@@ -52,37 +53,36 @@ const toRankListPage = () => {
});
};
onMounted(async () => {
try {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
const config = await getAppConfig();
updateConfig(config);
console.log("全局配置:", config);
const result = await getHomeData();
updateRank(result);
console.log("首页数据:", result);
if (result.user) {
updateUser(result.user);
if (result.user.trio <= 0) {
showGuide.value = true;
setTimeout(() => {
showGuide.value = false;
}, 3000);
}
const devices = await getMyDevicesAPI();
if (devices.bindings && devices.bindings.length) {
updateDevice(
devices.bindings[0].deviceId,
devices.bindings[0].deviceName
);
}
onShow(async () => {
const result = await getHomeData();
updateRank(result);
console.log("首页数据:", result);
if (result.user) {
updateUser(result.user);
if (result.user.trio <= 0) {
showGuide.value = true;
setTimeout(() => {
showGuide.value = false;
}, 3000);
}
const devices = await getMyDevicesAPI();
if (devices.bindings && devices.bindings.length) {
updateDevice(
devices.bindings[0].deviceId,
devices.bindings[0].deviceName
);
}
} catch (error) {
console.error("获取配置失败:", error);
}
});
onMounted(async () => {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
const config = await getAppConfig();
updateConfig(config);
console.log("全局配置:", config);
});
const comingSoon = () => {
uni.showToast({
title: "敬请期待",