| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <script setup>
- import { onLaunch, onShow, onHide, onUnload } from "@dcloudio/uni-app";
- import { store } from "@/store/index.js";
- import { useGlobalEventRemove, useInit, updateActivePageOnShow } from "@/utils/useBarcodeModule.js";
- import { useRouteMonitor } from "@/utils/useRouteMonitor.js";
- import { playClickSound } from "@/config/audioUtil.js";
- onLaunch(() => {
- // 尝试去获取本地的 token 和用户信息,填充到 store 中
- let token = uni.getStorageSync("token");
- if (token) {
- let userInfo = uni.getStorageSync("userInfo");
- if (userInfo) {
- if (userInfo.userId) {
- store.setUserInfo(userInfo);
- }
- }
- }
- // #ifdef APP-PLUS
- // 初始化扫码模块
- useInit();
- // #endif
- });
- onShow(() => {});
- </script>
- <style lang="scss">
- @import "@/uni_modules/uview-plus/index.scss";
- @import "@/static/css/mystyle.css";
- @import "@/static/css/common.scss";
- /*每个页面公共css */
- page {
- background: #f5f6fa;
- height: 100%;
- }
- </style>
|