You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
<script>
|
|
import { useDeviceStore } from './stores/modules/deviceInfo'
|
|
export default {
|
|
onLaunch: function() {
|
|
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
|
|
console.log('App Launch')
|
|
// 初始化设备信息,避免请求拦截器读取为空
|
|
// const deviceStore = useDeviceStore()
|
|
// try {
|
|
// const sys = uni.getSystemInfoSync()
|
|
// let deviceId = ''
|
|
// // #ifdef APP-PLUS
|
|
// try { deviceId = plus?.device?.uuid || '' } catch(e) {}
|
|
// // #endif
|
|
// if (!deviceId) deviceId = uni.getStorageSync('device_id')
|
|
// if (!deviceId) {
|
|
// deviceId = `web_${Date.now()}_${Math.random().toString(36).slice(2,10)}`
|
|
// uni.setStorageSync('device_id', deviceId)
|
|
// }
|
|
// deviceStore.setDeviceInfo({ deviceId, platform: sys.platform, model: sys.model })
|
|
// console.log('Device init:', deviceStore.deviceInfo)
|
|
// } catch(e) { console.warn('Init device info failed:', e) }
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
/*每个页面公共css */
|
|
@import '@/uni_modules/uni-scss/index.scss';
|
|
/* #ifndef APP-NVUE */
|
|
@import '@/static/customicons.css';
|
|
// 设置整个项目的背景色
|
|
page {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
/* #endif */
|
|
.example-info {
|
|
font-size: 14px;
|
|
color: #333;
|
|
padding: 10px;
|
|
}
|
|
</style>
|