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.
1 lines
970 B
1 lines
970 B
"use strict";const e=require("../common/vendor.js"),t={setup(){let t=e.reactive({activity:null,receiver:null,intentFilter:null});function n(){if(plus){t.activity=plus.android.runtimeMainActivity();var n=plus.android.importClass("android.content.IntentFilter");t.intentFilter=new n,t.intentFilter.addAction("nlscan.action.SCANNER_RESULT"),t.receiver=plus.android.implements("io.dcloud.feature.internal.reflect.BroadcastReceiver",{onReceive:function(t,n){console.log("intent",n),plus.android.importClass(n);let i=n.getStringExtra("SCAN_BARCODE1");e.index.$emit("scancodedate",i.replace(/\n/g,""))}})}}function i(){t.activity.registerReceiver(t.receiver,t.intentFilter)}function r(){t.activity.unregisterReceiver(t.receiver)}return e.onLoad((()=>{n(),i()})),e.onHide((()=>{r()})),e.onUnload((()=>{t.stopScan(),e.index.$off("scancodedate")})),{startScan:i,stopScan:r,initScan:n}}};const n=e._export_sfc(t,[["render",function(e,t,n,i,r,c){return{}}]]);wx.createComponent(n);
|
|
|