<script>
	//#ifdef APP-PLUS
	const jpushModule = uni.requireNativePlugin("JG-JPush");
	// #endif

	import Cache from '@/utils/cache';

	export default {
		onLaunch: function() {
			console.log('App Launch')
			// #ifdef APP-PLUS
			// 锁定屏幕方向 横屏正方向
			plus.screen.lockOrientation('landscape-primary');
			// #endif 

		},
		onLoad() {


		},
		onShow: function() {

		

			console.log('App Show')
			const audioContext = uni.createInnerAudioContext()
			// 设置音频文件地址
			audioContext.src = '/static/mp3/order.mp3'
			// 播放音频
			//#ifdef APP-PLUS
			jpushModule.addNotificationListener(res => {
				// console.log(res, '111111')
				if (res.notificationEventType == 'notificationOpened') return
				audioContext.play()
				uni.vibrateLong();
				console.log("app的监听")
			})
			// #endif
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	* {
		margin: 0;
		padding: 0;
	}

	page {
		background: #F3F4F8;
	}

	@import "static/css/base.css";
	@import url('static/iconfont/iconfont.css')
</style>