<script>
	//#ifdef APP-PLUS
	const jpushModule = uni.requireNativePlugin("JG-JPush");
	// #endif
	export default {
		onLaunch: async function() {

			console.log('App Launch')
			try {
				if (!this.$store.state.app.token) uni.redirectTo({
					url: '/pages/oaLogin/oaLogin'
				})
			} catch (e) {
				uni.redirectTo({
					url: '/pages/oaLogin/oaLogin'
				})
			}
		},
		onShow: function() {
			console.log('App Show')
			// 创建内部音频对象
			const audioContext = uni.createInnerAudioContext()

			// 设置音频文件地址
			audioContext.src = './static/mp3/order.mp3'

			// 播放音频
			//#ifdef APP-PLUS
			jpushModule.addNotificationListener(res => {
				console.log("监听成功")
				audioContext.play()
			})
			// #endif
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import 'static/css/base.css';
	@import 'static/css/style.scss';

	view {
		box-sizing: border-box;
	}
</style>