<script>
	import {
		onLaunch,
		onShow,
		onHide
	} from '@dcloudio/uni-app'
	import {
		inject
	} from "vue"
	export default {
		setup() {
			onLaunch(() => {
				// #ifdef APP
				setting()
				const utils = inject('utils')
				console.log(utils);
				utils.inittts()
				// setTimeout(()=>{
				// utils.ttsspke('12313123')
				// },5000)
				// #endif
				// setTimeout(()=>{
				// 	uni.hideTabBar({})
				// },1200)
				console.log('onLaunch');

			})

			function setting() {
				let main=plus.android.runtimeMainActivity()
				let deviceAction = 'com.android.server.scannerservice.broadcast'
				let strdata='scannerdata'
				let Intent = plus.android.importClass('android.content.Intent')
				let intentSetting = new Intent("com.android.scanner.service_settings")
				//设置条码发送方式
				//"FOCUS":焦点录入
				//"BROADCAST":广播
				//"EMUKEY":模拟按键
				//"CLIPBOARD":剪贴板
				intentSetting.putExtra("barcode_send_mode", "BROADCAST");
				//设置Action
				intentSetting.putExtra("action_barcode_broadcast", deviceAction)
				//设置返回状态: getstringExtra键值
				intentSetting.putExtra("key_barcode_broadcast", strdata)
				// 提交设置
				console.log('广播动作：'+deviceAction+',接受的标签值：'+strdata);
				main.sendBroadcast(intentSetting)
			}
			onShow(() => {
				console.log('onshow');

			})
			return {

			}
		}
	}
</script>

<style lang="scss">
	@import '@/uni_modules/fant-mini-plus/libs/iconfont/iconfont.css';
	@import "@/uni_modules/uview-plus/index.scss";

	/*每个页面公共css */
	// page{
	// 	// background-image: url('/static/bg.png');
	// 	background-repeat: no-repeat;
	// 	background-size: 100% 100%;
	// }
	page {
		background-color: #F5F5F6;
		// background-image: url('/static/bg.png');
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
</style>