145.1ee3affabac63ee9e4a8.js 2.9 KB

1
  1. webpackJsonp([145],{GVW6:function(e,t){},rZWK:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});s("ssJA");var a=s("prsZ"),i=s("7+uW");s("vLgD");i.a.use(a.a);var n={name:"scan_qr",data:function(){return{qr_scan_mark:!1,plus_show:!1,barcode:null,set_flash:!1}},methods:{set_flash_true:function(){this.set_flash=!0,this.barcode.setFlash(!0)},set_flash_false:function(){this.set_flash=!1,this.barcode.setFlash(!1)},close_scan:function(){this.barcode.close(),this.set_flash=!1,this.qr_scan_mark=!1},onmarked:function(e,t){var s=this;if(0==e||"0"==e)return this.$router.push({name:"examineList",query:{doc_id:t.split("#")[1]}}),!1;var a="未知: ";switch(e){case plus.barcode.QR:a="QR: ";break;case plus.barcode.EAN13:a="EAN13: ";break;case plus.barcode.EAN8:a="EAN8: "}if(t.indexOf("join_company")>=0)s.$router.push({path:t.split("#")[1]});else if(t.indexOf("chat?touser")>=0)s.$router.push({path:t.split("#")[1]});else if(t.indexOf("invite_reg")>=0)s.$router.push({path:t.split("#")[1]});else if(t.indexOf("login_token")>=0)s.$router.push({path:t.split("#")[1]});else if(0==t.indexOf("http://")||0==t.indexOf("https://")){var i=plus.webview.create(t,t);i.setStyle({titleNView:{titleColor:"#000",autoBackButton:!0}}),plus.storage.setItem("qr_scaning","1"),plus.key.addEventListener("backbutton",function(){i.canBack(function(e){e.canBack?i.back():(i.close(),s.$route_back(),plus.storage.removeItem("qr_scaning"))})}),i.show()}else"未知: "==a&&this.$toast(a+t);this.close_scan()},createBarcode:function(){this.barcode=plus.barcode.create("barcode",[plus.barcode.QR],{top:"0",left:"0px",width:"100%",height:window.innerHeight-150+"px",position:"static",frameColor:"#999999",scanbarColor:"#999999"}),this.barcode.onmarked=this.onmarked,plus.webview.currentWebview().append(this.barcode),this.qr_scan_mark=!0,this.barcode.start()}},created:function(){this.createBarcode(),setTimeout(function(){plus.navigator.setStatusBarStyle("light")},500),window.$ajax_update=function(){plus.webview.currentWebview().close(plus.webview.currentWebview().id,"none")}}},r={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticStyle:{height:"100%"}},[s("div",{staticClass:"work_body_com"}),e._v(" "),e.qr_scan_mark?s("div",{staticStyle:{background:"#000",top:"0",bottom:"0",left:"0",right:"0","z-index":"9999",position:"fixed"}},[s("div",{staticStyle:{background:"#000",bottom:"1rem",left:"0",right:"0","z-index":"999",position:"fixed","text-align":"center"}},[s("van-button",{directives:[{name:"show",rawName:"v-show",value:!e.set_flash,expression:"!set_flash"}],on:{click:e.set_flash_true}},[e._v("开灯")]),e._v(" "),s("van-button",{directives:[{name:"show",rawName:"v-show",value:e.set_flash,expression:"set_flash"}],on:{click:e.set_flash_false}},[e._v("关灯")]),e._v(" "),s("van-button",{on:{click:e.$route_back}},[e._v("关闭")])],1)]):e._e()])},staticRenderFns:[]};var o=s("VU/8")(n,r,!1,function(e){s("GVW6")},"data-v-504a2c8e",null);t.default=o.exports}});