33 lines
8.5 KiB
JavaScript
33 lines
8.5 KiB
JavaScript
|
"use weex:vue";
|
||
|
|
||
|
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||
|
Promise.prototype.finally = function(callback) {
|
||
|
const promise = this.constructor
|
||
|
return this.then(
|
||
|
value => promise.resolve(callback()).then(() => value),
|
||
|
reason => promise.resolve(callback()).then(() => {
|
||
|
throw reason
|
||
|
})
|
||
|
)
|
||
|
}
|
||
|
};
|
||
|
|
||
|
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||
|
const global = uni.requireGlobal()
|
||
|
ArrayBuffer = global.ArrayBuffer
|
||
|
Int8Array = global.Int8Array
|
||
|
Uint8Array = global.Uint8Array
|
||
|
Uint8ClampedArray = global.Uint8ClampedArray
|
||
|
Int16Array = global.Int16Array
|
||
|
Uint16Array = global.Uint16Array
|
||
|
Int32Array = global.Int32Array
|
||
|
Uint32Array = global.Uint32Array
|
||
|
Float32Array = global.Float32Array
|
||
|
Float64Array = global.Float64Array
|
||
|
BigInt64Array = global.BigInt64Array
|
||
|
BigUint64Array = global.BigUint64Array
|
||
|
};
|
||
|
|
||
|
|
||
|
(()=>{var E=Object.create;var g=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var y=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var S=(e,a,s,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of D(a))!v.call(e,l)&&l!==s&&g(e,l,{get:()=>a[l],enumerable:!(o=_(a,l))||o.enumerable});return e};var B=(e,a,s)=>(s=e!=null?E(w(e)):{},S(a||!e||!e.__esModule?g(s,"default",{value:e,enumerable:!0}):s,e));var b=y((N,m)=>{m.exports=Vue});var d={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let a={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},s=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),o=s[1];o&&(s[1]=a[o]||o),s.length=s.length>2?2:s.length,this.locale=s.join("-")},localize(e){let a=this.locale,s=a.split("-")[0],o=this.fallbackLocale,l=n=>Object.assign({},this.localization[n],(this.localizationTemplate||{})[n]);return l("messages")[e]||l(a)[e]||l(s)[e]||l(o)[e]||e}}},p={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:a,runtime:s,data:o={},useGlobalEvent:l}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=s,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=l,this.data=JSON.parse(JSON.stringify(o)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let n=this,r=function(c){let f=c.data&&c.data.__message;!f||n.__onMessageCallback&&n.__onMessageCallback(f.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",r);else{let c=new BroadcastChannel(this.__page);c.onmessage=r}},postMessage(e={},a=!1){let s=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:a}})),o=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(s,o):new BroadcastChannel(o).postMessage(s);else{let l=plus.webview.getWebviewById(o);l&&l.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:s})})`)}},onMessage(e){this.__onMessageCallback=e}}};var i=B(b());var C=(e,a)=>{let s=e.__vccOpts||e;for(let[o,l]of a)s[o]=l;return s};var k={content:{"":{flex:1,alignItems:"center",justifyContent:"center",backgroundColor:"#000000"}},barcode:{"":{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:1}},"set-flash":{"":{alignItems:"center",justifyContent:"center",transform:"translateY(80px)",zIndex:2}},"image-flash":{"":{width:26,height:26,marginBottom:2}},"image-flash-text":{"":{fontSize:10,color:"#FFFFFF"}}},t=plus.barcode,A={qrCode:[t.QR,t.AZTEC,t.MAXICODE],barCode:[t.EAN13,t.EAN8,t.UPCA,t.UPCE,t.CODABAR,t.CODE128,t.CODE39,t.CODE93,t.ITF,t.RSS14,t.RSSEXPANDED],datamatrix:[t.DATAMATRIX],pdf417:[t.PDF417]},O={[t.QR]:"QR_CODE",[t.EAN13]:"EAN_13",[t.EAN8]:"EAN_8",[t.DATAMATRIX]:"DATA_MATRIX",[t.UPCA]:"UPC_A",[t.UPCE]:"UPC_E",[t.CODABAR]:"CODABAR",[t.CODE39]:"CODE_39",[t.CODE93]:"CODE_93",[t.CODE128]:"CODE_128",[t.ITF]:"CODE_25",[t.PDF417]:"PDF_417",[t.AZTEC]:"AZTEC",[t.RSS14]:"RSS_14",[t.RSSEXPANDED]:"RSSEXPANDED"},M={mixins:[p,d],data:{filters:[0,2,1],backgroud:"#000000",frameColor:"#118ce9",scanbarColor:"#118ce9",enabledFlash:!1,flashImage0:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABjklEQVRoQ+1ZbVHEQAx9TwE4ABTcOQAknANQAKcAUAAOAAXgAHAACsDCKQiTmbYDzJZtNt2bFrJ/m6+Xl2yyU2LmhzOPH/8PgIjcADirxNyapNoffMwMiMgzgMPBHmyCLySPLCoBwJKtAbJbYaBmD1yRvBwAtBMxl5DF+DZkiwCIyBLAzsgBbki+Wm2WAlCaL6zOMvKnJO+sNksB7ALQbO1ZHfbIv5FUVs2nCIB6EZETALdmj2mFY5I6X8ynGEADQllYmL1+VzBfnV/VvQB0aj45ARyQ/Ci14QLQsOBZLe5JaikWn
|