blue.js 5.5 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["admin/tools/blue"],{1883:function(t,n,e){"use strict";e.r(n);var o=e("92de"),i=e("523b");for(var r in i)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(r);e("5c55");var c,a=e("7702"),u=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],c);n["default"]=u.exports},"523b":function(t,n,e){"use strict";e.r(n);var o=e("b917"),i=e.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(r);n["default"]=i.a},5519:function(t,n,e){"use strict";(function(t){e("6cdc");o(e("dda7"));var n=o(e("1883"));function o(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("255a")["createPage"])},"5c55":function(t,n,e){"use strict";var o=e("9953"),i=e.n(o);i.a},"92de":function(t,n,e){"use strict";var o;e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return o}));var i=function(){var t=this,n=t.$createElement;t._self._c},r=[]},9953:function(t,n,e){},b917:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e=t.requireNativePlugin("Html5app-Gprinter"),o={data:function(){return{tip:""}},onLoad:function(){},methods:{openDefault:function(){var t=this;e.BluetoothPort({setBackgroundColor:"#2088d2"},(function(n){t.tip=JSON.stringify(n)}))},open:function(){t.navigateTo({url:"./Bluetooth"})},connectIP:function(){var t=this;e.connectIP({},(function(n){t.tip=JSON.stringify(n),console.log(t.tip)}))},connectUSB:function(){var t=this;e.connectUSB({setBackgroundColor:"#2088d2"},(function(n){t.tip=JSON.stringify(n),console.log(t.tip)}))},state:function(){var t=this;e.state({},(function(n){t.tip=JSON.stringify(n),console.log(t.tip)}))},dis:function(){var t=this;e.disconnect({},(function(n){t.tip=JSON.stringify(n)}))},printer:function(){var t=this;console.log(JSON.stringify(t.setDate())),e.printer({ESC:t.setDate()},(function(n){t.tip=JSON.stringify(n),console.log(t.tip)}))},printerLable:function(){var t=this;e.printer({TSC:t.OrderLable("粉红雪山","11054")},(function(n){t.tip=JSON.stringify(n)}))},writePDFToTsc:function(){var t=plus.io.convertLocalFileSystemURL("static/pdfFile.pdf");e.writePDFToTsc({filePath:t,width:400},(function(t){}))},writePDFToEsc:function(){var t=plus.io.convertLocalFileSystemURL("static/pdfFile.pdf");e.writePDFToEsc({filePath:t,width:400},(function(t){}))},writeTSC:function(){var t=plus.io.convertLocalFileSystemURL("static/gprinter.png"),n=this,o="SIZE 40 mm,15 mm \n";o+="GAP 2 mm,0 mm \n",o+="CLS \n",o+='TEXT 50,50,"3",0,1,1,"DEMO FOR TEXT" \n',o+="BITMAP 20,20,100,"+t+" \n",o+=" PRINT 1 \n",e.writeTSC({tsc:o},(function(t){console.log(JSON.stringify(t)),n.tip=JSON.stringify(t)}))},setDate:function(){var t=[],n={},e=plus.io.convertLocalFileSystemURL("static/gprinter.png"),o=e;n.image=o,n.width="350",n.center="center",n.bottom="1",t.push(n),n={},n.text="万达广场欢迎您",n.center="center",n.font="max",n.bottom="3",t.push(n),n={},n.text="收银员:00056",n.center="left",n.font="bold",n.bottom="2",t.push(n),n={},n.text="单号:00256933",n.center="left",n.font="normal",n.bottom="2",t.push(n),n={},n.text="业务日期:2019-05-30 18:15:25",n.center="left",n.font="normal",n.bottom="1",t.push(n),n={},n.text="------------------------------",n.center="left",n.font="normal",n.bottom="1",t.push(n);for(var i=0;i<4;i++)n={},n.text="商品名称:小黑瓶眼霜",n.center="left",n.font="normal",n.bottom="1",t.push(n),n={},n.title=["数量:1","单价:305","金额:305"],n.left=[0,30,60],n.center="left",n.font="normal",n.bottom="2",t.push(n);return n={},n.text="------------------------------",n.center="left",n.font="normal",n.bottom="2",t.push(n),n={},n.text="数量:4 ,金额:¥1220.00",n.center="left",n.font="bold",n.bottom="1",t.push(n),n={},n.text="实收金额:¥1220.00",n.center="left",n.font="bold",n.bottom="2",t.push(n),n={},n.text="活动期间满500送100",n.center="left",n.font="normal",n.bottom="1",t.push(n),n={},n.text="折让金额500",n.center="left",n.font="normal",n.bottom="1",t.push(n),n={},n.text="折后金额2029",n.center="left",n.font="normal",n.bottom="3",t.push(n),n={},n.text="30天内可凭小票换开发票",n.center="left",n.font="normal",n.bottom="2",t.push(n),n={},n.text="活动商品,不退不换",n.center="left",n.font="normal",n.bottom="2",t.push(n),n={},n.barcode="2019563352660",n.type="CODE128",n.height="100",n.position="BELOW",n.width="2",n.center="center",n.bottom="2",t.push(n),n={},n.qrcode="d68242b5e540aa7f21173c2d65b2c5ad",n.size="10",n.center="center",n.bottom="0",n.errorlevel="L",t.push(n),console.log("printdata:"+JSON.stringify(t)),t},OrderLable:function(t,n){var e=[],o={};return o={},o.width=30,o.height=20,o.gap=2,o.page=1,e.push(o),o={},o.text=t,o.rotation=0,o.x=35,o.y=20,o.xscal=1,o.yscal=1,e.push(o),o={},o.barcode=n,o.x=35,o.y=55,o.type="CODE128",o.height=50,o.readable=!0,o.rotation=0,e.push(o),e},Lable:function(){var t=[],n={};return n={},n.width=40,n.height=30,n.gap=3,n.page=1,t.push(n),n={},n.image="http://www.html5-app.com/gprinter.png",n.x=30,n.y=20,n.width=70,t.push(n),n={},n.text="HTML5+混合APP开发社区",n.rotation=0,n.x=30,n.y=90,n.xscal=1,n.yscal=1,t.push(n),n={},n.barcode="2019563352660",n.x=30,n.y=130,n.type="CODE128",n.height=50,n.readable=!0,n.rotation=0,t.push(n),n={},n.qrcode="1234566",n.x=190,n.y=20,n.width=3,n.rotation=0,t.push(n),n={},n.addBar={x:25,y:2,width:300,height:3},t.push(n),n={},n.addBox={x:25,y:15,xend:300,yend:120,thickness:2},t.push(n),t}}};n.default=o}).call(this,e("255a")["default"])}},[["5519","common/runtime","common/vendor"]]]);