修复bug

This commit is contained in:
田岩
2025-07-22 10:46:18 +08:00
parent cecc98b70e
commit d3fcc11fce
8 changed files with 46 additions and 33 deletions
+22 -15
View File
@@ -2,22 +2,29 @@
import {getUserInfo} from "@/common/common.js"
import common from "@/common/common.js"
export const setMascot = () => {
const mascotState = common.getValue('mascotState') || false
console.log('设置科技鹿', mascotState);
// const mascotState = common.getValue('mascotState') || false
const mascotState = false
// console.log('设置科技鹿', mascotState);
if (!mascotState) {
const userInfo = getUserInfo()
const mascotInfo = userInfo['mascotInfo']
uni.setTabBarStyle({
midButton: {
iconPath: "/static/images/icon/fawn-" + (mascotInfo?.mascotNo || '1') + ".png",
width: "86px",
height: "86px",
iconWidth: "90px"
},
success: () => {
common.setValue('mascotState', true)
}
})
try{
const userInfo = getUserInfo()
const mascotInfo = userInfo?.mascotInfo
console.log('设置科技鹿', mascotInfo);
uni.setTabBarStyle({
midButton: {
iconPath: "/static/images/icon/fawn-" + (mascotInfo?.mascotNo || '1') + ".png",
width: "86px",
height: "86px",
iconWidth: "90px"
},
success: () => {
common.setValue('mascotState', true)
}
})
} catch(e){
}
}
return mascotState
}