'创建鸿蒙应用'

This commit is contained in:
wtq
2025-12-08 17:49:35 +08:00
commit 09b59aa8c2
625 changed files with 78727 additions and 0 deletions

63
src/App.vue Normal file
View File

@@ -0,0 +1,63 @@
<script setup lang="ts">
import jxMOdal from '@/components/dialog/dialogUtil'
// import { onLaunch, onShow } from '@dcloudio/uni-app'
import App from './App'
import globalAlert from '@/components/globalAlert/globalAlert'
import useGlobalFunc from './composables/useGlobalFunc'
// import { isOpenNotice } from './utils/android_ios'
import { getStorage, setStorage } from './utils/storage'
import { store } from "@/store";
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const {
appKeepAlive, // 应用保活
listenMsg, // 监听消息
} = App()
const { watchVersion } = useGlobalFunc() // 监听版本
// 三端通用
const {
SystemInfo, //获取本机设备信息
onNetWorkStatusChange, // 监听网络状态
onPrinterChange, // 监听打印机状态
} = App()
onLaunch(() => {
SystemInfo() // 获取本机设备信息
uni['jxAlert'] = jxMOdal.alert // 全局挂载 jxMOdal
uni['jxConfirm'] = jxMOdal.confirm // 全局挂载 jxMOdal
onNetWorkStatusChange() // 监听网络状态
onPrinterChange() // 监听打印机状态
// appKeepAlive() // 应用保活
// listenMsg() // 监听消息穿透
uni['globalAlert'] = globalAlert // 挂载全局可覆盖tabar弹窗
// plus.device.setWakelock(true) //打开程序后一直保持唤醒状态(常亮)
watchVersion((isUpdate: boolean) => {
// 检查是否更新版本
if (isUpdate) {
// uni.globalAlert({
// data: {
// type: 3,
// },
// })
}
})
// 初始化平台
if (!getStorage('terrace')) setStorage('terrace', 'jxcs')
store.dispatch('serveInfo/get_services')
});
onShow(() => {
console.log("App Show");
});
onHide(() => {
console.log("App Hide");
});
</script>
<style>
@import './static/font/iconfont.css';
page {
background-color: #efefef;
}
</style>