153.99ba55feee214f09ec24.1706754571694+.js 3.6 KB

1
  1. webpackJsonp([153],{RDnR:function(e,t){},k0kE:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});s("ssJA");var a=s("prsZ");s("7+uW").a.use(a.a);var i={name:"scan_qr",data:function(){return{qr_scan_mark:!1,plus_show:!1,barcode:null,set_flash:!1,isBarcode:!1}},watch:{$route:function(e,t){"/home"==e.path&&this.barcode&&this.barcode.close()}},methods:{routeBack:function(e){var t=this;this.barcode.close(),this.$nextTick(function(){t.$route_back()})},backButtons:function(){this.barcode.close()},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,a=t.split("#");if("screen"==a[0]&&"0"==e)return this.$router.push({name:"screenLogin",query:{code:a[1]}}),this.close_scan(),!1;var i="未知: ";switch(e){case plus.barcode.QR:i="QR: ";break;case plus.barcode.EAN13:i="EAN13: ";break;case plus.barcode.EAN8:i="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 n=plus.webview.create(t,t);n.setStyle({titleNView:{titleColor:"#000",autoBackButton:!0}}),plus.storage.setItem("qr_scaning","1"),plus.key.addEventListener("backbutton",function(){n.canBack(function(e){e.canBack?n.back():(n.close(),s.$route_back(),plus.storage.removeItem("qr_scaning"))})}),n.show()}else"未知: "==i&&this.$toast(i+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()},openText:function(){var e=this;this.$dialog.confirm({title:"权限获取",message:"功道云需要使用摄像头权限,以便为您提供上传图片、发送图片、扫码等服务。"}).then(function(){e.$setCache("isBarcode",!0),e.createBarcode()}).catch(function(){e.$route_back()})}},created:function(){setTimeout(function(){plus.navigator.setStatusBarStyle("light")},500),window.$ajax_update=function(){plus.webview.currentWebview().close(plus.webview.currentWebview().id,"none")}},activated:function(){this.$getCache("isBarcode")?this.createBarcode():this.openText()}},n={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:function(t){return e.routeBack()}}},[e._v("关闭")])],1)]):e._e()])},staticRenderFns:[]};var o=s("VU/8")(i,n,!1,function(e){s("RDnR")},"data-v-364b49ab",null);t.default=o.exports}});