升级逻辑完善
This commit is contained in:
@@ -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: "敬请期待",
|
||||
|
||||
Reference in New Issue
Block a user