33 lines
9.3 KiB
JavaScript
33 lines
9.3 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 w=Object.create;var g=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var k=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var M=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!B.call(e,s)&&s!==t&&g(e,s,{get:()=>a[s],enumerable:!(n=y(a,s))||n.enumerable});return e};var N=(e,a,t)=>(t=e!=null?w(O(e)):{},M(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e));var D=k((x,_)=>{_.exports=Vue});var I=Object.prototype.toString,p=e=>I.call(e),d=e=>p(e).slice(8,-1);function T(){return typeof __channelId__=="string"&&__channelId__}function v(e,a){switch(d(a)){case"Function":return"function() { [native code] }";default:return a}}function F(e,a,t){return T()?(t.push(a.replace("at ","uni-app:///")),console[e].apply(console,t)):t.map(function(s){let i=p(s).toLowerCase();if(["[object object]","[object array]","[object module]"].indexOf(i)!==-1)try{s="---BEGIN:JSON---"+JSON.stringify(s,v)+"---END:JSON---"}catch(l){s=i}else if(s===null)s="---NULL---";else if(s===void 0)s="---UNDEFINED---";else{let l=d(s).toUpperCase();l==="NUMBER"||l==="BOOLEAN"?s="---BEGIN:"+l+"---"+s+"---END:"+l+"---":s=String(s)}return s}).join("---COMMA---")+" "+a}function m(e,a,...t){let n=F(e,a,t);n&&console[e](n)}var b=(e,a)=>{let t=e.__vccOpts||e;for(let[n,s]of a)t[n]=s;return t};var C={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"},t=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),n=t[1];n&&(t[1]=a[n]||n),t.length=t.length>2?2:t.length,this.locale=t.join("-")},localize(e){let a=this.locale,t=a.split("-")[0],n=this.fallbackLocale,s=i=>{let l=Object.assign({},this.localization[i],(this.localizationTemplate||{})[i]);return m("log","at mixins/i18n.js:78","********** o :>> ",l),l};return s("messages")[e]||s(a)[e]||s(t)[e]||s(n)[e]||e}}},E={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:a,runtime:t,data:n={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=t,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(n)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let i=this,l=function(c){let h=c.data&&c.data.__message;!h||i.__onMessageCallback&&i.__onMessageCallback(h.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",l);else{let c=new BroadcastChannel(this.__page);c.onmessage=l}},postMessage(e={},a=!1){let t=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:a}})),n=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(t,n):new BroadcastChannel(n).postMessage(t);else{let s=plus.webview.getWebviewById(n);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:t})})`)}},onMessage(e){this.__onMessageCallback=e}}};var r=N(D());var R={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"}}},o=plus.barcode,A={qrCode:[o.QR,o.AZTEC,o.MAXICODE],barCode:[o.EAN13,o.EAN8,o.UPCA,o.UPCE,o.CODABAR,o.CODE128,o.CODE39,o.CODE93,o.ITF,o.RSS14,o.RSSEXPAND
|