2025-07-21 16:47:04 +08:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { useStore } from "@/cool";
|
|
|
|
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
import TouchEmulator from "hammer-touchemulator";
|
2025-07-27 22:27:53 +08:00
|
|
|
// 模拟移动端调试的触摸事件
|
2025-07-21 16:47:04 +08:00
|
|
|
TouchEmulator();
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
onLaunch: function () {
|
|
|
|
|
console.log("App Launch");
|
|
|
|
|
},
|
|
|
|
|
onShow: function () {
|
|
|
|
|
console.log("App Show");
|
|
|
|
|
|
2025-08-11 19:13:43 +08:00
|
|
|
// 根据业务情况判断是否要预先调用
|
2025-08-27 19:27:52 +08:00
|
|
|
const { user } = useStore();
|
2025-07-21 16:47:04 +08:00
|
|
|
|
|
|
|
|
// 获取用户信息,未登录不执行
|
2025-08-27 19:27:52 +08:00
|
|
|
user.get();
|
2025-07-21 16:47:04 +08:00
|
|
|
},
|
|
|
|
|
onHide: function () {
|
|
|
|
|
console.log("App Hide");
|
|
|
|
|
},
|
|
|
|
|
onExit: function () {
|
|
|
|
|
console.log("App Exit");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import url("static/index.scss");
|
2025-09-01 12:32:08 +08:00
|
|
|
@import url("icons/index.scss");
|
2025-07-21 16:47:04 +08:00
|
|
|
|
|
|
|
|
.safe-area-top {
|
|
|
|
|
margin-top: env(safe-area-inset-top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.uni-tabbar {
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
display: none;
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
.uni-tabbar__icon {
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-11 09:54:23 +08:00
|
|
|
|
|
|
|
|
.uni-toast {
|
|
|
|
|
border-radius: 32rpx;
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.8) !important;
|
|
|
|
|
}
|
2025-07-21 16:47:04 +08:00
|
|
|
</style>
|