|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-printSet-printSet"],{"1b5e":function(t,e,r){"use strict";var n=r("4ea4");r("d3b7"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("96cf");var i=n(r("1da1")),o=n(r("b85c")),a=n(r("d4ec")),u=n(r("bee2")),c=function(){function t(){(0,a.default)(this,t),this.isOpenBle=!1,this.deviceId="",this.serviceId="",this.writeId="",this.notifyId="",this.openBluetoothAdapter()}return(0,u.default)(t,[{key:"showToast",value:function(t){uni.showToast({title:t,icon:"none",duration:2e3})}},{key:"openBluetoothAdapter",value:function(){var t=this;return new Promise((function(e,r){uni.openBluetoothAdapter({success:function(r){t.isOpenBle=!0,t.showToast("初始化蓝牙模块成功"),e(r)},fail:function(e){t.showToast("初始化蓝牙模块失败"+JSON.stringify(e)),r(e)}})}))}},{key:"startBluetoothDevicesDiscovery",value:function(){if(this.isOpenBle){var t=this;return uni.showLoading({title:"蓝牙搜索中"}),new Promise((function(e,r){setTimeout((function(){uni.startBluetoothDevicesDiscovery({success:function(t){e(t)},fail:function(e){t.showToast("搜索设备失败"+JSON.stringify(err)),r(err)}})}),300)}))}this.showToast("初始化蓝牙模块失败")}},{key:"stopBluetoothDevicesDiscovery",value:function(){var t=this;return new Promise((function(e,r){uni.stopBluetoothDevicesDiscovery({success:function(t){uni.hideLoading()},fail:function(e){uni.hideLoading(),t.showToast("停止搜索蓝牙设备失败"+JSON.stringify(err))}})}))}},{key:"createBLEConnection",value:function(){var t=this.deviceId,e=this;return uni.showLoading({mask:!0,title:"设别连接中,请稍候..."}),console.log(this.deviceId),new Promise((function(r,n){uni.createBLEConnection({deviceId:t,success:function(t){console.log("res:createBLEConnection "+JSON.stringify(t)),r(t)},fail:function(t){uni.hideLoading(),e.showToast("停止搜索蓝牙设备失败"+JSON.stringify(t)),n(t)}})}))}},{key:"getBLEDeviceServices",value:function(){var t=[],e=this.deviceId,r=this;return new Promise((function(n,i){setTimeout((function(){uni.getBLEDeviceServices({deviceId:e,success:function(e){var r,i=(0,o.default)(e.services);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.isPrimary&&t.push(a)}}catch(err){i.e(err)}finally{i.f()}uni.hideLoading(),console.log("_serviceList: "+JSON.stringify(t)),n(t)},fail:function(t){uni.hideLoading(),r.showToast("获取设备Services"+JSON.stringify(t)),i(t)}})}),500)}))}},{key:"getBLEDeviceCharacteristics",value:function(){var t=this.deviceId,e=this.serviceId,r=this;return new Promise((function(n,i){uni.getBLEDeviceCharacteristics({deviceId:t,serviceId:e,success:function(t){var e,i=(0,o.default)(t.characteristics);try{for(i.s();!(e=i.n()).done;){var a=e.value;a.properties.notify&&(r.notifyId=a.uuid,uni.setStorageSync("notifyId",r.notifyId)),a.properties.write&&(r.writeId=a.uuid,uni.setStorageSync("writeId",r.writeId))}}catch(err){i.e(err)}finally{i.f()}var u={notifyId:r.notifyId,writeId:r.writeId};r.showToast("获取服务中所有特征值OK,".concat(JSON.stringify(u))),n(u)},fail:function(t){r.showToast("getBLEDeviceCharacteristics"+JSON.stringify(t)),i(t)}})}))}},{key:"closeBLEConnection",value:function(){var t=this.deviceId;uni.closeBLEConnection({deviceId:t,success:function(t){console.log(t)}})}},{key:"notifyBLECharacteristicValue",value:function(){var t=this.deviceId,e=this.serviceId,r=this.notifyId;uni.notifyBLECharacteristicValueChange({state:!0,deviceId:t,serviceId:e,characteristicId:r,success:function(t){uni.onBLECharacteristicValueChange((function(t){}))},fail:function(t){console.log("notifyBLECharacteristicValueChange failed:"+t.errMsg)}})}},{key:"writeBLECharacteristicValue",value:function(t){var e=this.deviceId,r=this.serviceId,n=this.writeId;return console.log("this: "+JSON.stringify(this)),new Promise((function(i,o){uni.writeBLECharacteristicValue({deviceId:e,serviceId:r,characteristicId:n,value:t,success:function(t){console.log("message发送成功",JSON.stringify(t)),i(t)},fail:function(t){console.log("message发送失败",JSON.stringify(t)),o(t)}})}))}},{key:"closeBluetoothAdapter",value:function(){uni.closeBluetoothAdapter({success:function(t){console.log(t)}})}},{key:"reconnect",value:function(){var t=this;(0,i.default)(regeneratorRuntime.mark((function e(){var r,n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.deviceId=t.deviceId||uni.getStorageSync("deviceId"),t.serviceId=t.serviceId||uni.getStorageSync("serviceId"),e.next=5,t.createBLEConnection();case 5:return r=e.sent,console.log("createBLEConnection: "+JSON.stringify(r)),e.next=9,t.getBLEDeviceServices();case 9:return n=e.sent,console.log("getBLEDeviceServices: "+JSON.stringify(n)),e.next=13,t.getBLEDeviceCharacteristics();case 13:i=e.sent,console.log("getBLEDeviceCharacteristics: "+JSON.stringify(i)),e.next=20;break;case 17:e.prev=17,e.t0=e["catch"](0),console.log("err: "+JSON.stringify(e.t0));case 20:case"end":return e.stop()}}),e,null,[[0,17]])})))()}}]),t}(),s=c;e.default=s},"1da1":function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){try{var u=t[o](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function u(t){n(a,i,o,u,c,"next",t)}function c(t){n(a,i,o,u,c,"throw",t)}u(void 0)}))}}r("d3b7"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},"2bec":function(t,e,r){r("99af"),r("d81d"),r("ace4"),r("d3b7"),r("25f0"),r("5cc6"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("2954"),r("649e"),r("219c"),r("b39a"),r("72f7");var n=function(t){var e=t.getFullYear(),r=t.getMonth()+1,n=t.getDate(),o=t.getHours(),a=t.getMinutes(),u=t.getSeconds();return[e,r,n].map(i).join("/")+" "+[o,a,u].map(i).join(":")},i=function(t){return t=t.toString(),t[1]?t:"0"+t};function o(t){for(var e=[],r=0;r<t.length;r++)if(r%4==0){var n=.299*t[r]+.587*t[r+1]+.114*t[r+2];t[r]=n>200?0:1,e.push(t[r])}return e}function a(t){for(var e=[],r=0;r<t.length;r+=8){var n=128*t[r]+64*t[r+1]+32*t[r+2]+16*t[r+3]+8*t[r+4]+4*t[r+5]+2*t[r+6]+1*t[r+7];e.push(n)}return e}function u(t){var e=o(t.data),r=a(e),n=[].concat([27,97,1],[29,118,48,0,30,0,240,0],r,[27,74,3],[27,64]);return new Uint8Array(n).buffer}function c(t){var e=o(t.data),r=a(e);return r}t.exports={formatTime:n,toArrayBuffer:u,zip_image:c}},4313:function(t,e,r){"use strict";var n;r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-uni-view",{staticClass:"content"},[r("v-uni-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.startBluetoothDeviceDiscovery.apply(void 0,arguments)}}},[t._v("搜索周边设备")]),r("v-uni-button",{attrs:{size:"mini",type:"warn"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.stopBluetoothDevicesDiscovery.apply(void 0,arguments)}}},[t._v("停止搜索")]),r("v-uni-button",{attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.pickUpOnce.apply(void 0,arguments)}}},[t._v("测试打印")]),r("v-uni-scroll-view",{staticClass:"device_list",attrs:{"scroll-y":"true","show-scrollbar":"true"}},[r("v-uni-radio-group",t._l(t.devicesList,(function(e,n){return e.name.length>0?r("v-uni-view",{key:n,staticClass:"device_item"},[r("v-uni-view",{staticStyle:{"font-size":"32rpx",color:"#333"}},[r("v-uni-radio",{attrs:{value:e.deviceId},on:{click:function(r){arguments[0]=r=t.$handleEvent(r),t.select_deviceId(e)}}}),t._v(t._s(e.name))],1),r("v-uni-view",{staticStyle:{"font-size":"20rpx"}},[t._v("信号强度: "+t._s(e.RSSI)+"dBm ("+t._s(Math.max(100+e.RSSI,0))+"%)")]),r("v-uni-view",{staticStyle:{"font-size":"20rpx"}},[t._v("deviceId: "+t._s(e.deviceId))]),r("v-uni-view",{staticStyle:{"font-size":"20rpx"}},[t._v("Service数量: "+t._s(e.advertisServiceUUIDs.length||0))]),t.deviceId===e.deviceId?r("v-uni-radio-group",t._l(t.serviceList,(function(e,n){return r("v-uni-view",{key:n,staticStyle:{"font-size":"20rpx"}},[r("v-uni-radio",{staticStyle:{transform:"scale(0.7)"},attrs:{value:e.uuid},on:{click:function(r){arguments[0]=r=t.$handleEvent(r),t.select_service(e)}}}),t._v(t._s(e.uuid))],1)})),1):t._e()],1):t._e()})),1)],1),r("v-uni-canvas",{staticStyle:{width:"240px",height:"240px"},attrs:{"canvas-id":"shareCanvas"}})],1)},o=[]},"4cda":function(t,e){var r={LF:[10],FS:[28],FF:[12],GS:[29],DLE:[16],EOT:[4],NUL:[0],ESC:[27],EOL:"\n",FEED_CONTROL_SEQUENCES:{CTL_LF:[10],CTL_GLF:[74,0],CTL_FF:[12],CTL_CR:[13],CTL_HT:[9],CTL_VT:[11]},CHARACTER_SPACING:{CS_DEFAULT:[27,32,0],CS_SET:[27,32]},LINE_SPACING:{LS_DEFAULT:[27,50],LS_SET:[27,51]},HARDWARE:{HW_INIT:[27,64],HW_SELECT:[27,61,1],HW_RESET:[27,63,10,0]},CASH_DRAWER:{CD_KICK_2:[27,112,0],CD_KICK_5:[27,112,1]},MARGINS:{BOTTOM:[27,79],LEFT:[27,108],RIGHT:[27,81]},PAPER:{PAPER_FULL_CUT:[29,86,0],PAPER_PART_CUT:[29,86,1],PAPER_CUT_A:[29,86,65],PAPER_CUT_B:[29,86,66]},TEXT_FORMAT:{TXT_NORMAL:[27,33,0],TXT_2HEIGHT:[27,33,16],TXT_2WIDTH:[27,33,32],TXT_4SQUARE:[27,33,48],TXT_UNDERL_OFF:[27,45,0],TXT_UNDERL_ON:[27,45,1],TXT_UNDERL2_ON:[27,45,2],TXT_BOLD_OFF:[27,69,0],TXT_BOLD_ON:[27,69,1],TXT_ITALIC_OFF:[27,53],TXT_ITALIC_ON:[27,52],TXT_FONT_A:[27,77,0],TXT_FONT_B:[27,77,1],TXT_FONT_C:[27,77,2],TXT_ALIGN_LT:[27,97,0],TXT_ALIGN_CT:[27,97,1],TXT_ALIGN_RT:[27,97,2]},BARCODE_FORMAT:{BARCODE_TXT_OFF:[29,72,0],BARCODE_TXT_ABV:[29,72,1],BARCODE_TXT_BLW:[29,72,2],BARCODE_TXT_BTH:[29,72,3],BARCODE_FONT_A:[29,102,0],BARCODE_FONT_B:[29,102,1],BARCODE_HEIGHT:function(t){return[29,104,t]},BARCODE_WIDTH:function(t){return[29,119,t]},BARCODE_HEIGHT_DEFAULT:[29,104,100],BARCODE_WIDTH_DEFAULT:[29,119,1],BARCODE_UPC_A:[29,107,0],BARCODE_UPC_E:[29,107,1],BARCODE_EAN13:[29,107,2],BARCODE_EAN8:[29,107,3],BARCODE_CODE39:[29,107,4],BARCODE_ITF:[29,107,5],BARCODE_NW7:[29,107,6],BARCODE_CODE93:[29,107,72],BARCODE_CODE128:[29,107,73]},IMAGE_FORMAT:{S_RASTER_N:[29,118,48,0],S_RASTER_2W:[29,118,48,1],S_RASTER_2H:[29,118,48,2],S_RASTER_Q:[29,118,48,3]},BITMAP_FORMAT:{BITMAP_S8:[27,42,0],BITMAP_D8:[27,42,1],BITMAP_S24:[27,42,32],BITMAP_D24:[27,42,33]},GSV0_FORMAT:{GSV0_NORMAL:[29,118,48,0],GSV0_DW:[29,118,48,1],GSV0_DH:[29,118,48,2],GSV0_DWDH:[29,118,48,3]},BEEP:[27,66],COLOR:{0:[27,114,0],1:[27,114,1]}};t.exports=r},"5a47":function(t,e,r){"use strict";r("e439"),r("d3b7"),r("25f0"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},c=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,r=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!o)return!1;for(e in t);return void 0===e||n.call(t,e)},s=function(t,e){o&&"__proto__"===e.name?o(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},f=function(t,e){if("__proto__"===e){if(!n.call(t,e))return;if(a)return a(t,e).value}return t[e]},l=function t(){var e,r,n,i,o,a,l=arguments[0],h=1,d=arguments.length,v=!1;for("boolean"==typeof l&&(v=l,l=arguments[1]||{},h=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});h<d;++h)if(null!=(e=arguments[h]))for(r in e)n=f(l,r),l!==(i=f(e,r))&&(v&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=n&&u(n)?n:[]):a=n&&c(n)?n:{},s(l,{name:r,newValue:t(v,a,i)})):void 0!==i&&s(l,{name:r,newValue:i}));return l};function h(t){this.mode=v.MODE_8BIT_BYTE,this.data=t}function d(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}h.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}},d.prototype={addData:function(t){var e=new h(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=E.getRSBlocks(t,this.errorCorrectLevel),r=new A,n=0,i=0;i<e.length;i++)n+=e[i].dataCount;for(i=0;i<this.dataList.length;i++){var o=this.dataList[i];r.put(o.mode,4),r.put(o.getLength(),_.getLengthInBits(o.mode,t)),o.write(r)}if(r.getLengthInBits()<=8*n)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=d.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=_.getLostPoint(this);(0==r||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,a=0;a<this.modules[i].length;a++){var u=1*a;this.modules[i][a]&&(n.beginFill(0,100),n.moveTo(u,o),n.lineTo(u+1,o),n.lineTo(u+1,o+1),n.lineTo(u,o+1),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=_.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(null==this.modules[n][i])for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)this.modules[n+o][i+a]=-2==o||2==o||-2==a||2==a||0==o&&0==a}},setupTypeNumber:function(t){for(var e=_.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&1==(e>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++)n=!t&&1==(e>>r&1),this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=_.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&1==(n>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++)o=!t&&1==(n>>i&1),i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var u=0;u<2;u++)if(null==this.modules[n][a-u]){var c=!1;o<t.length&&(c=1==(t[o]>>>i&1)),_.getMask(e,n,a-u)&&(c=!c),this.modules[n][a-u]=c,-1==--i&&(o++,i=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},d.PAD0=236,d.PAD1=17,d.createData=function(t,e,r){for(var n=E.getRSBlocks(t,e),i=new A,o=0;o<r.length;o++){var a=r[o];i.put(a.mode,4),i.put(a.getLength(),_.getLengthInBits(a.mode,t)),a.write(i)}var u=0;for(o=0;o<n.length;o++)u+=n[o].dataCount;if(i.getLengthInBits()>8*u)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*u+")");for(i.getLengthInBits()+4<=8*u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*u||(i.put(d.PAD0,8),i.getLengthInBits()>=8*u));)i.put(d.PAD1,8);return d.createBytes(i,n)},d.createBytes=function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),a=new Array(e.length),u=0;u<e.length;u++){var c=e[u].dataCount,s=e[u].totalCount-c;n=Math.max(n,c),i=Math.max(i,s),o[u]=new Array(c);for(var f=0;f<o[u].length;f++)o[u][f]=255&t.buffer[f+r];r+=c;var l=_.getErrorCorrectPolynomial(s),h=new m(o[u],l.getLength()-1).mod(l);for(a[u]=new Array(l.getLength()-1),f=0;f<a[u].length;f++){var d=f+h.getLength()-a[u].length;a[u][f]=d>=0?h.get(d):0}}var v=0;for(f=0;f<e.length;f++)v+=e[f].totalCount;var g=new Array(v),p=0;for(f=0;f<n;f++)for(u=0;u<e.length;u++)f<o[u].length&&(g[p++]=o[u][f]);for(f=0;f<i;f++)for(u=0;u<e.length;u++)f<a[u].length&&(g[p++]=a[u][f]);return g};for(var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},g={L:1,M:0,Q:3,H:2},p={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},_={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;_.getBCHDigit(e)-_.getBCHDigit(_.G15)>=0;)e^=_.G15<<_.getBCHDigit(e)-_.getBCHDigit(_.G15);return(t<<10|e)^_.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;_.getBCHDigit(e)-_.getBCHDigit(_.G18)>=0;)e^=_.G18<<_.getBCHDigit(e)-_.getBCHDigit(_.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return _.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case p.PATTERN000:return(e+r)%2==0;case p.PATTERN001:return e%2==0;case p.PATTERN010:return r%3==0;case p.PATTERN011:return(e+r)%3==0;case p.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case p.PATTERN101:return e*r%2+e*r%3==0;case p.PATTERN110:return(e*r%2+e*r%3)%2==0;case p.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new m([1],0),r=0;r<t;r++)e=e.multiply(new m([1,T.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:case v.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,a=t.isDark(n,i),u=-1;u<=1;u++)if(!(n+u<0||e<=n+u))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||0==u&&0==c||a==t.isDark(n+u,i+c)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var s=0;t.isDark(n,i)&&s++,t.isDark(n+1,i)&&s++,t.isDark(n,i+1)&&s++,t.isDark(n+1,i+1)&&s++,0!=s&&4!=s||(r+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);var f=0;for(i=0;i<e;i++)for(n=0;n<e;n++)t.isDark(n,i)&&f++;return r+Math.abs(100*f/e/e-50)/5*10}},T={glog:function(t){if(t<1)throw new Error("glog("+t+")");return T.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return T.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},y=0;y<8;y++)T.EXP_TABLE[y]=1<<y;for(y=8;y<256;y++)T.EXP_TABLE[y]=T.EXP_TABLE[y-4]^T.EXP_TABLE[y-5]^T.EXP_TABLE[y-6]^T.EXP_TABLE[y-8];for(y=0;y<255;y++)T.LOG_TABLE[T.EXP_TABLE[y]]=y;function m(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&0==t[r];)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}function E(t,e){this.totalCount=t,this.dataCount=e}function A(){this.buffer=new Array,this.length=0}function C(t){var e,r,n,i;for(e="",n=t.length,r=0;r<n;r++)(i=t.charCodeAt(r))>=1&&i<=127?e+=t.charAt(r):i>2047?(e+=String.fromCharCode(224|i>>12&15),e+=String.fromCharCode(128|i>>6&63),e+=String.fromCharCode(128|i>>0&63)):(e+=String.fromCharCode(192|i>>6&31),e+=String.fromCharCode(128|i>>0&63));return e}function w(t){t=t||{},(t=l(!0,{width:256,height:256,x:0,y:0,typeNumber:-1,correctLevel:g.H,background:"#ffffff",foreground:"#000000",image:{imageResource:"",dx:0,dy:0,dWidth:100,dHeight:100}},t)).canvasId||t.ctx?function(){var e,r=new d(t.typeNumber,t.correctLevel);r.addData(C(t.text)),r.make(),e=t.ctx?t.ctx:t._this?wx.createCanvasContext&&wx.createCanvasContext(t.canvasId,t._this):wx.createCanvasContext&&wx.createCanvasContext(t.canvasId);for(var n=t.width/r.getModuleCount(),i=t.height/r.getModuleCount(),o=0;o<r.getModuleCount();o++)for(var a=0;a<r.getModuleCount();a++){var u=r.isDark(o,a)?t.foreground:t.background;e.setFillStyle(u);var c=Math.ceil((a+1)*n)-Math.floor(a*n),s=Math.ceil((o+1)*n)-Math.floor(o*n);e.fillRect(Math.round(a*n)+t.x,Math.round(o*i)+t.y,c,s)}t.image.imageResource&&e.drawImage(t.image.imageResource,t.image.dx,t.image.dy,t.image.dWidth,t.image.dHeight),e.draw(!1,(function(e){t.callback&&t.callback(e)}))}():console.warn("please set canvasId or ctx!")}m.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=T.gexp(T.glog(this.get(r))+T.glog(t.get(n)));return new m(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=T.glog(this.get(0))-T.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<t.getLength();n++)r[n]^=T.gexp(T.glog(t.get(n))+e);return new m(r,0).mod(t)}},E.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],E.getRSBlocks=function(t,e){var r=E.getRsBlockTable(t,e);if(void 0==r)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=new Array,o=0;o<n;o++)for(var a=r[3*o+0],u=r[3*o+1],c=r[3*o+2],s=0;s<a;s++)i.push(new E(u,c));return i},E.getRsBlockTable=function(t,e){switch(e){case g.L:return E.RS_BLOCK_TABLE[4*(t-1)+0];case g.M:return E.RS_BLOCK_TABLE[4*(t-1)+1];case g.Q:return E.RS_BLOCK_TABLE[4*(t-1)+2];case g.H:return E.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},A.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var L=w;e.default=L},6473:function(t,e,r){"use strict";var n=r("d429"),i=r.n(n);i.a},"7af2":function(t,e,r){r("99af"),r("cb29"),r("a630"),r("ace4"),r("d3b7"),r("3ca3"),r("5cc6"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("2954"),r("649e"),r("219c"),r("b39a"),r("72f7");var n=r("4cda"),i=r("ff49"),o=function(){this._queue=Array.from(n.HARDWARE.HW_INIT),this._enqueue=function(t){this._queue.push.apply(this._queue,t)}};o.prototype.text=function(t){if(t){var e=i.encode(t),r=Array.from(e);this._enqueue(r)}return this},o.prototype.print=function(t){return this.text(t),this._enqueue(n.LF),this},o.prototype.printQrcode=function(t){if(t){var e=[].concat([27,97,1],[29,118,48,0,30,0,240,0],t,[27,74,3],[27,64]);this._enqueue(e),this._enqueue(n.LF)}return this},o.prototype.println=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.print(t+n.EOL)},o.prototype.setAlign=function(t){return this._enqueue(n.TEXT_FORMAT["TXT_ALIGN_"+t.toUpperCase()]),this},o.prototype.setFont=function(t){return this._enqueue(n.TEXT_FORMAT["TXT_FONT_"+t.toUpperCase()]),this},o.prototype.setSize=function(t,e){return 2>=t&&2>=e&&(this._enqueue(n.TEXT_FORMAT.TXT_NORMAL),2===t&&2===e?this._enqueue(n.TEXT_FORMAT.TXT_4SQUARE):1===t&&2===e?this._enqueue(n.TEXT_FORMAT.TXT_2HEIGHT):2===t&&1===e&&this._enqueue(n.TEXT_FORMAT.TXT_2WIDTH)),this},o.prototype.setBold=function(t){return"boolean"!==typeof t&&(t=!0),this._enqueue(t?n.TEXT_FORMAT.TXT_BOLD_ON:n.TEXT_FORMAT.TXT_BOLD_OFF),this},o.prototype.setUnderline=function(t){return"boolean"!==typeof t&&(t=!0),this._enqueue(t?n.TEXT_FORMAT.TXT_UNDERL_ON:n.TEXT_FORMAT.TXT_UNDERL_OFF),this},o.prototype.setLineSpacing=function(t){return void 0===t||null===t?this._enqueue(n.LINE_SPACING.LS_DEFAULT):(this._enqueue(n.LINE_SPACING.LS_SET),this._enqueue([t])),this},o.prototype.lineFeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.print(new Array(t).fill(n.EOL).join(""))},o.prototype.setColor=function(t){return this._enqueue(n.COLOR[1===t?1:0]),this},o.prototype.beep=function(t,e){return this._enqueue(n.BEEP),this._enqueue([t,e]),this},o.prototype.clear=function(){return this._queue=Array.from(n.HARDWARE.HW_INIT),this},o.prototype.buffer=function(){return new Uint8Array(this._queue).buffer},t.exports=o},"96cf":function(t,e){!function(e){"use strict";var r,n=Object.prototype,i=n.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",s="object"===typeof t,f=e.regeneratorRuntime;if(f)s&&(t.exports=f);else{f=e.regeneratorRuntime=s?t.exports:{},f.wrap=m;var l="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[a]=function(){return this};var _=Object.getPrototypeOf,T=_&&_(_(x([])));T&&T!==n&&i.call(T,a)&&(p=T);var y=w.prototype=A.prototype=Object.create(p);C.prototype=y.constructor=w,w.constructor=C,w[c]=C.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(y),t},f.awrap=function(t){return{__await:t}},L(b.prototype),b.prototype[u]=function(){return this},f.AsyncIterator=b,f.async=function(t,e,r,n){var i=new b(m(t,e,r,n));return f.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(y),y[c]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},f.values=x,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return u.type="throw",u.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}}}function m(t,e,r,n){var i=e&&e.prototype instanceof A?e:A,o=Object.create(i.prototype),a=new O(n||[]);return o._invoke=D(t,r,a),o}function E(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(err){return{type:"throw",arg:err}}}function A(){}function C(){}function w(){}function L(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function b(t){function e(r,n,o,a){var u=E(t[r],t,n);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"===typeof s&&i.call(s,"__await")?Promise.resolve(s.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(s).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,a)}))}a(u.arg)}var r;function n(t,n){function i(){return new Promise((function(r,i){e(t,n,r,i)}))}return r=r?r.then(i,i):i()}this._invoke=n}function D(t,e,r){var n=l;return function(i,o){if(n===d)throw new Error("Generator is already running");if(n===v){if("throw"===i)throw o;return R()}r.method=i,r.arg=o;while(1){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=E(t,e,r);if("normal"===c.type){if(n=r.done?v:h,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=v,r.method="throw",r.arg=c.arg)}}}function S(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=E(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function x(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){while(++n<t.length)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}return{next:R}}function R(){return{value:r,done:!0}}}(function(){return this||"object"===typeof self&&self}()||Function("return this")())},"9aa5":function(t,e,r){"use strict";var n=r("4ea4");r("fb6a"),r("45fc"),r("d3b7"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("96cf");var i=n(r("1da1")),o=n(r("7af2")),a=n(r("fad6")),u=n(r("2bec")),c=n(r("5a47")),s=n(r("1b5e")),f=new s.default,l={components:{},data:function(){return{isOpenBle:!1,devicesList:[],serviceList:[],deviceId:"",canvas_width:240,canvas_height:240}},onUnload:function(){f.closeBLEConnection(),f.closeBluetoothAdapter()},onLoad:function(){uni.getLocation({type:"wgs84",success:function(t){console.log("当前位置的经度:"+t.longitude),console.log("当前位置的纬度:"+t.latitude)}}),f.openBluetoothAdapter()},methods:{startBluetoothDeviceDiscovery:function(){uni.showLoading({title:"蓝牙搜索中"});var t=this;t.devicesList=[],setTimeout((function(){uni.startBluetoothDevicesDiscovery({success:function(e){uni.onBluetoothDeviceFound((function(e){console.log("发现设备: "+JSON.stringify(e)),t.devicesList.some((function(t){return t.deviceId===e.devices[0].deviceId}))||t.devicesList.push(e.devices[0])}))},fail:function(e){uni.hideLoading(),t.showToast("搜索设备失败"+JSON.stringify(err))}})}),200)},stopBluetoothDevicesDiscovery:function(){uni.hideLoading(),f.stopBluetoothDevicesDiscovery()},select_deviceId:function(t){var e=this;return(0,i.default)(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.deviceId=t.deviceId,f.deviceId=t.deviceId,uni.setStorageSync("deviceId",f.deviceId),e.serviceList=[],r.prev=4,r.next=7,f.createBLEConnection();case 7:return r.sent,r.next=10,f.getBLEDeviceServices();case 10:n=r.sent,console.log("获取服务: "+JSON.stringify(n)),e.serviceList=n,r.next=18;break;case 15:r.prev=15,r.t0=r["catch"](4),console.log("e: "+JSON.stringify(r.t0));case 18:case"end":return r.stop()}}),r,null,[[4,15]])})))()},select_service:function(t){return(0,i.default)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return f.serviceId=t.uuid,uni.setStorageSync("serviceId",t.uuid),e.prev=2,e.next=5,f.getBLEDeviceCharacteristics();case 5:e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](2),console.log("e: "+JSON.stringify(e.t0));case 11:case"end":return e.stop()}}),e,null,[[2,8]])})))()},pickUpOnce:function(){f.notifyBLECharacteristicValue();var t=this;setTimeout((function(){t.writeBLECharacteristicValue()}),500)},writeBLECharacteristicValue:function(){var t=this;return(0,i.default)(regeneratorRuntime.mark((function e(){var r,n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.get_Qrcode();case 2:r=e.sent,console.log(r),n=new o.default,n.print(u.default.formatTime(new Date)).print(a.default.fillLine()).setAlign("ct").setSize(2,2).print("#20外卖").setSize(1,1).print("切尔西Chelsea").setSize(2,2).print("在线支付(已支付)").setSize(1,1).print("订单号:5415221202244734").print("下单时间:"+u.default.formatTime(new Date)).setAlign("lt").print(a.default.fillAround("一号口袋")).print(a.default.inline("意大利茄汁一面 * 1","15")).print(a.default.fillAround("其他")).print("餐盒费:1").print("[赠送康师傅冰红茶] * 1").print(a.default.fillLine()).setAlign("rt").print("原价:¥16").print("总价:¥16").setAlign("lt").print(a.default.fillLine()).print("备注").print("无").print(a.default.fillLine()).printQrcode(r).println(),i=n.buffer(),t.printbuffs(i);case 8:case"end":return e.stop()}}),e)})))()},printbuffs:function(t){for(var e=20,r=20,n=0,i=0,o=t.byteLength;n<o;n+=e,i++){var a=t.slice(n,n+e<=o?n+e:o);setTimeout(this.printbuff,i*r,a)}},printbuff:function(t){f.writeBLECharacteristicValue(t)},get_Qrcode:function(){var t=this;return new Promise((function(e,r){var n=uni.createCanvasContext("shareCanvas");console.log(t.canvas_width),n.clearRect(0,0,t.canvas_width,t.canvas_height),(0,c.default)({canvasId:"shareCanvas",text:String("xiaonibaba.com"),width:t.canvas_width,height:t.canvas_height,callback:function(r){setTimeout((function(){console.log(t.canvas_width),uni.canvasGetImageData({canvasId:"shareCanvas",x:0,y:0,width:t.canvas_width,height:t.canvas_height,success:function(t){e(u.default.zip_image(t))}})}),1e3)}})}))}}};e.default=l},b07a:function(t,e,r){"use strict";r.r(e);var n=r("9aa5"),i=r.n(n);for(var o in n)"default"!==o&&function(t){r.d(e,t,(function(){return n[t]}))}(o);e["default"]=i.a},b85c:function(t,e,r){"use strict";r("a4d3"),r("e01a"),r("d28b"),r("d3b7"),r("3ca3"),r("ddb0"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(r("06c5"));function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var r;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=(0,n.default)(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r["return"]||r["return"]()}finally{if(c)throw a}}}}},bd01:function(t,e,r){"use strict";r.r(e);var n=r("4313"),i=r("b07a");for(var o in i)"default"!==o&&function(t){r.d(e,t,(function(){return i[t]}))}(o);r("6473");var a,u=r("f0c5"),c=Object(u["a"])(i["default"],n["b"],n["c"],!1,null,"19139306",null,!1,n["a"],a);e["default"]=c.exports},bdab:function(t,e,r){var n=r("24fb");e=n(!1),e.push([t.i,"uni-page-body[data-v-19139306]{color:#333}uni-button[data-v-19139306]{margin:%?10?%}.devices_summary[data-v-19139306]{margin-top:%?5?%;padding:%?20?%;font-size:%?30?%}.device_list[data-v-19139306]{margin:%?5?% %?20?% %?5?% %?20?%;border:%?1?% solid #ddd;border-radius:%?10?%;background-color:#fdfdfd;min-height:%?0?%;max-height:%?400?%;width:%?700?%}.device_item[data-v-19139306]{border-bottom:%?1?% solid #ddd;padding:%?20?%;color:#666}.device_item_hover[data-v-19139306]{background-color:rgba(0,0,0,.1)}.connected_info[data-v-19139306]{position:fixed;bottom:0;width:100%;background-color:#f0f0f0;padding:10px;padding-bottom:20px;margin-bottom:env(safe-area-inset-bottom);font-size:14px;min-height:100px;box-shadow:0 0 3px 0}.connected_info .operation[data-v-19139306]{position:absolute;display:inline-block;right:30px}",""]),t.exports=e},cb29:function(t,e,r){var n=r("23e7"),i=r("81d5"),o=r("44d2");n({target:"Array",proto:!0},{fill:i}),o("fill")},d429:function(t,e,r){var n=r("bdab");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=r("4f06").default;i("2f6a7372",n,!0,{sourceMap:!1,shadowMode:!1})},fad6:function(t,e,r){r("cb29"),r("d81d"),r("fb6a"),r("ace4"),r("d3b7"),r("25f0"),r("5cc6"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("2954"),r("649e"),r("219c"),r("b39a"),r("72f7");var n=32;function i(t){return/^[\u4e00-\u9fa5]$/.test(t)}function o(t){for(var e=0,r=0,n=t.length;r<n;r++)e+=i(t.charAt(r))?2:1;return e}function a(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=n/i,u=a-(o(t)+o(e))%a,c=new Array(u).fill(r.charAt(0)).join("");return t+c+e}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"-",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=n/e;return new Array(r).fill(t.charAt(0)).join("")}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n/r,a=o(t);if(a>=i)return t;var u=i-a,c=Math.round(u/2),s=new Array(c).fill(e.charAt(0)).join("");return s+t+s.substr(0,u-c)}function s(t){var e=Array.prototype.map.call(new Uint8Array(t),(function(t){return("00"+t.toString(16)).slice(-2)}));return e.join(",")}t.exports={inline:a,fillLine:u,fillAround:c,ab2hex:s}},ff49:function(t,e,r){r("c975"),r("4e82"),r("d3b7"),r("e25e"),r("ac1f"),r("25f0"),r("466d"),r("5319"),r("1276"),
|