货无忧
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.

82 lines
1.9 KiB

2 years ago
<script>
import {
onLaunch,
onShow,
onHide
} from '@dcloudio/uni-app'
1 year ago
import {
inject
} from "vue"
2 years ago
export default {
1 year ago
setup() {
onLaunch(() => {
2 years ago
// #ifdef APP
1 year ago
setting()
const utils = inject('utils')
2 years ago
console.log(utils);
utils.inittts()
// setTimeout(()=>{
1 year ago
// utils.ttsspke('12313123')
2 years ago
// },5000)
// #endif
1 year ago
// setTimeout(()=>{
// uni.hideTabBar({})
// },1200)
2 years ago
console.log('onLaunch');
1 year ago
2 years ago
})
1 year ago
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 );
1 year ago
main.sendBroadcast(intentSetting)
}
onShow(() => {
2 years ago
console.log('onshow');
1 year ago
2 years ago
})
return {
1 year ago
2 years ago
}
}
}
</script>
<style lang="scss">
@import '@/uni_modules/fant-mini-plus/libs/iconfont/iconfont.css';
@import "@/uni_modules/uview-plus/index.scss";
1 year ago
input{
font-size: 28upx;
}
2 years ago
/*每个页面公共css */
// page{
// // background-image: url('/static/bg.png');
// background-repeat: no-repeat;
// background-size: 100% 100%;
// }
1 year ago
page {
2 years ago
background-color: #F5F5F6;
1 year ago
// background-image: url('/static/bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
2 years ago
}
.golink{
color: #0086F1 !important;
text-decoration: underline;
}
1 year ago
</style>