├── BluetoothPrinter-master
├── App.vue
├── CPCL 指令手册.pdf
├── README.md
├── components
│ └── gprint
│ │ ├── encoding-indexes.js
│ │ ├── encoding.js
│ │ ├── esc.js
│ │ └── tsc.js
├── demo.jpg
├── main.js
├── manifest.json
├── package-lock.json
├── pages.json
├── pages
│ └── index
│ │ └── index.vue
├── static
│ └── logo.png
├── uni.scss
├── unpackage
│ └── dist
│ │ └── dev
│ │ ├── .sourcemap
│ │ └── mp-weixin
│ │ │ ├── common
│ │ │ ├── main.js.map
│ │ │ ├── runtime.js.map
│ │ │ └── vendor.js.map
│ │ │ └── pages
│ │ │ ├── bule
│ │ │ └── bule.js.map
│ │ │ ├── index
│ │ │ └── index.js.map
│ │ │ └── tab
│ │ │ └── tab.js.map
│ │ ├── .tmp
│ │ └── app-plus
│ │ │ ├── app.js
│ │ │ ├── app.json
│ │ │ ├── app.wxss
│ │ │ ├── common
│ │ │ ├── main.js
│ │ │ ├── main.wxss
│ │ │ ├── runtime.js
│ │ │ └── vendor.js
│ │ │ ├── manifest.json
│ │ │ ├── pages
│ │ │ ├── bule
│ │ │ │ ├── bule.js
│ │ │ │ ├── bule.json
│ │ │ │ └── bule.wxml
│ │ │ ├── index
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ │ └── tab
│ │ │ │ ├── tab.js
│ │ │ │ ├── tab.json
│ │ │ │ ├── tab.wxml
│ │ │ │ └── tab.wxss
│ │ │ └── static
│ │ │ └── logo.png
│ │ ├── app-plus
│ │ ├── __uniappchooselocation.html
│ │ ├── __uniappes6.js
│ │ ├── __uniappmarker@3x.png
│ │ ├── __uniappopenlocation.html
│ │ ├── __uniapppicker.html
│ │ ├── __uniappscan.html
│ │ ├── __uniappsuccess.png
│ │ ├── __uniapptabbar.html
│ │ ├── __uniappview.html
│ │ ├── app-config.js
│ │ ├── app-service.js
│ │ ├── app-view.js
│ │ ├── manifest.json
│ │ ├── pages
│ │ │ ├── bule
│ │ │ │ └── bule.js
│ │ │ ├── index
│ │ │ │ └── index.js
│ │ │ └── tab
│ │ │ │ └── tab.js
│ │ └── static
│ │ │ └── logo.png
│ │ └── mp-weixin
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── app.wxss
│ │ ├── common
│ │ ├── main.js
│ │ ├── main.wxss
│ │ ├── runtime.js
│ │ └── vendor.js
│ │ ├── pages
│ │ └── index
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ └── index.wxml
│ │ ├── project.config.json
│ │ ├── sitemap.json
│ │ ├── sitemap58.json
│ │ ├── sitemap64.json
│ │ ├── sitemap69.json
│ │ └── static
│ │ └── logo.png
├── 佳博打印机自定义指令手册 v1.0.0.pdf
├── 佳博标签打印机编程手册tspl v1.0.7.pdf
├── 佳博票据打印机编程手册esc v1.0.6.pdf
└── 佳博面单打印机编程手册cpcl v1.0.3.pdf
└── PrinterSDK_20200514
├── .gitignore
├── app.js
├── app.json
├── app.wxss
├── imags
├── car.jpg
├── flower2.jpg
├── ic_close.png
├── ic_unvisiable.png
├── ic_visiable.png
├── wechat.jpg
└── wechat.png
├── jsconfig.json
├── pages
├── bleConnect
│ ├── bleConnect.js
│ ├── bleConnect.json
│ ├── bleConnect.wxml
│ └── bleConnect.wxss
├── home
│ ├── home.js
│ ├── home.json
│ ├── home.wxml
│ └── home.wxss
├── label
│ ├── label.js
│ ├── label.json
│ ├── label.wxml
│ └── label.wxss
├── net
│ ├── net.js
│ ├── net.json
│ ├── net.wxml
│ └── net.wxss
├── receipt
│ ├── receipt.js
│ ├── receipt.json
│ ├── receipt.wxml
│ └── receipt.wxss
├── sendCommand
│ ├── sendCommand.js
│ ├── sendCommand.json
│ ├── sendCommand.wxml
│ └── sendCommand.wxss
└── ticket
│ ├── ticket.js
│ ├── ticket.json
│ ├── ticket.wxml
│ └── ticket.wxss
├── project.config.json
├── sitemap.json
├── utils
├── base64.js
├── encoding-indexes.js
├── encoding.js
├── esc.js
├── tsc.js
└── util.js
└── 佳博标签打印机编程手册tspl v1.0.8.pdf
/BluetoothPrinter-master/App.vue:
--------------------------------------------------------------------------------
1 |
14 |
15 |
18 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/CPCL 指令手册.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/CPCL 指令手册.pdf
--------------------------------------------------------------------------------
/BluetoothPrinter-master/README.md:
--------------------------------------------------------------------------------
1 | # BluetoothPrinter
2 | vue.js uni-app 跨平台app框架 蓝牙连接打印机 demo , ESC TSPL 协议与打印机交互, 鉴于网上资料太少,深知踩坑之痛苦,以此开源分享,如果对你有帮助 请点个Satrt,谢谢。开源万岁
3 |
4 | ------对接蓝牙打印,有很多坑要踩,以下罗列几个大坑,希望大家少走弯路-----
5 |
6 | 1. 手机蓝牙向打印机发送成功: uni.writeBLECharacteristicValue:ok , 但是就是不打印, 这时候大部分原因, 应该是发送的数据不符合 esc(账单模式)或 tsc(标签模式)数据格式 ,请检查自己的数据格式 还有编码格式应为 gb18030
7 |
8 | 2. 蓝牙模块有许多服务,每个服务下面有许多特征值,不知道哪个可以用,按我的理解以及踩坑经验,特征值里面write=true (properties.write == true) 代表可以给蓝牙设备写数据。 如果有多个write=true蓝牙特征值,可以任取其中一个都能发送打印数据
9 |
10 | 3. 苹果手机ios可以打印, 安卓手机Android不能打印,是因为安卓 Android 底层貌似做了限制只能接受20个字节,所以数据包要拆分成20字节一组,多组多次发送 demo里面有拆分操作可以自己查看
11 |
12 | -----demo界面简单勿喷-_-
13 |
14 | 
15 |
16 |
17 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/components/gprint/esc.js:
--------------------------------------------------------------------------------
1 | var encode = require("./encoding.js")
2 | // var app = getApp();
3 | var jpPrinter = {
4 | createNew: function () {
5 | var jpPrinter = {};
6 | var data = [];
7 |
8 | var bar = ["UPC-A", "UPC-E", "EAN13", "EAN8", "CODE39", "ITF", "CODABAR", "CODE93", "CODE128"];
9 |
10 | jpPrinter.name = "账单模式";
11 |
12 | jpPrinter.init = function () { //初始化打印机
13 | data.push(27)
14 | data.push(64)
15 | };
16 |
17 | jpPrinter.setText = function (content) { //设置文本内容
18 | var code = new encode.TextEncoder(
19 | 'gb18030', {
20 | NONSTANDARD_allowLegacyEncoding: true
21 | }).encode(content)
22 | for (var i = 0; i < code.length; ++i) {
23 | data.push(code[i])
24 | }
25 | }
26 |
27 | jpPrinter.setBarcodeWidth = function (width) { //设置条码宽度
28 | data.push(29)
29 | data.push(119)
30 | if (width > 6) {
31 | width = 6;
32 | }
33 | if (width < 2) {
34 | width = 1;
35 | }
36 | data.push(width)
37 | }
38 |
39 | jpPrinter.setBarcodeHeight = function (height) { //设置条码高度
40 | data.push(29)
41 | data.push(104)
42 | data.push(height)
43 | }
44 |
45 | jpPrinter.setBarcodeContent = function (t, content) {
46 | var ty = 73;
47 | data.push(29)
48 | data.push(107)
49 | switch (t) {
50 | case bar[0]:
51 | ty = 65;
52 | break;
53 | case bar[1]:
54 | ty = 66;
55 | break;
56 | case bar[2]:
57 | ty = 67;
58 | break;
59 | case bar[3]:
60 | ty = 68;
61 | break;
62 | case bar[4]:
63 | ty = 69;
64 | break;
65 | case bar[5]:
66 | ty = 70;
67 | break;
68 | case bar[6]:
69 | ty = 71;
70 | break;
71 | case bar[7]:
72 | ty = 72;
73 | break;
74 | case bar[8]:
75 | ty = 73;
76 | break;
77 | }
78 | data.push(ty)
79 | }
80 |
81 | jpPrinter.setSelectSizeOfModuleForQRCode = function (n) { //设置二维码大小
82 | data.push(29)
83 | data.push(40)
84 | data.push(107)
85 | data.push(3)
86 | data.push(0)
87 | data.push(49)
88 | data.push(67)
89 | if (n > 15) {
90 | n = 15
91 | }
92 | if (n < 1) {
93 | n = 1
94 | }
95 | data.push(n)
96 | }
97 |
98 | jpPrinter.setSelectErrorCorrectionLevelForQRCode = function (n) { //设置纠错等级
99 | /*
100 | n 功能 纠错能力
101 | 48 选择纠错等级 L 7
102 | 49 选择纠错等级 M 15
103 | 50 选择纠错等级 Q 25
104 | 51 选择纠错等级 H 30
105 | */
106 | data.push(29)
107 | data.push(40)
108 | data.push(107)
109 | data.push(3)
110 | data.push(0)
111 | data.push(49)
112 | data.push(69)
113 | data.push(n)
114 | }
115 |
116 | jpPrinter.setStoreQRCodeData = function (content) { //设置二维码内容
117 | var code = new encode.TextEncoder(
118 | 'gb18030', {
119 | NONSTANDARD_allowLegacyEncoding: true
120 | }).encode(content)
121 | data.push(29)
122 | data.push(40)
123 | data.push(107)
124 | data.push(parseInt((code.length + 3) % 256))
125 | data.push(parseInt((code.length + 3) / 256))
126 | data.push(49)
127 | data.push(80)
128 | data.push(48)
129 |
130 | for (var i = 0; i < code.length; ++i) {
131 | data.push(code[i])
132 | }
133 | }
134 |
135 | jpPrinter.setPrintQRCode = function () { //打印二维码
136 | data.push(29)
137 | data.push(40)
138 | data.push(107)
139 | data.push(3)
140 | data.push(0)
141 | data.push(49)
142 | data.push(81)
143 | data.push(48)
144 | }
145 |
146 | jpPrinter.setHorTab = function () { //移动打印位置到下一个水平定位点的位置
147 | data.push(9)
148 | }
149 |
150 | jpPrinter.setAbsolutePrintPosition = function (where) { //设置绝对打印位置
151 | data.push(27)
152 | data.push(36)
153 | data.push(parseInt(where % 256))
154 | data.push(parseInt(where / 256))
155 | }
156 |
157 | jpPrinter.setRelativePrintPositon = function (where) { //设置相对横向打印位置
158 | data.push(27)
159 | data.push(92)
160 | data.push(parseInt(where % 256))
161 | data.push(parseInt(where / 256))
162 | }
163 |
164 | jpPrinter.setSelectJustification = function (which) { //对齐方式
165 | /*
166 | 0, 48 左对齐
167 | 1, 49 中间对齐
168 | 2, 50 右对齐
169 | */
170 | data.push(27)
171 | data.push(97)
172 | data.push(which)
173 | }
174 |
175 | jpPrinter.setLeftMargin = function (n) { //设置左边距
176 | data.push(29)
177 | data.push(76)
178 | data.push(parseInt(n % 256))
179 | data.push(parseInt(n / 256))
180 | }
181 |
182 | jpPrinter.setPrintingAreaWidth = function (width) { //设置打印区域宽度
183 | data.push(29)
184 | data.push(87)
185 | data.push(parseInt(width % 256))
186 | data.push(parseInt(width / 256))
187 | }
188 |
189 | jpPrinter.setSound = function (n, t) { //设置蜂鸣器
190 | data.push(27)
191 | data.push(66)
192 | if (n < 0) {
193 | n = 1;
194 | } else if (n > 9) {
195 | n = 9;
196 | }
197 |
198 | if (t < 0) {
199 | t = 1;
200 | } else if (t > 9) {
201 | t = 9;
202 | }
203 | data.push(n)
204 | data.push(t)
205 | }
206 |
207 | jpPrinter.setBitmap = function (res) { //参数,画布的参数
208 | console.log(res)
209 | var width = parseInt((res.width + 7) / 8 * 8 / 8)
210 | var height = res.height;
211 | var time = 1;
212 | var temp = res.data.length - width * 32;
213 | var point_list = []
214 | console.log(width + "--" + height)
215 | data.push(29)
216 | data.push(118)
217 | data.push(48)
218 | data.push(0)
219 | data.push((parseInt((res.width + 7) / 8) * 8) / 8)
220 | data.push(0)
221 | data.push(parseInt(res.height % 256))
222 | data.push(parseInt(res.height / 256))
223 | console.log(res.data.length)
224 | console.log("temp=" + temp)
225 | for (var i = 0; i < height; ++i) {
226 | for (var j = 0; j < width; ++j) {
227 | for (var k = 0; k < 32; k += 4) {
228 | var po = {}
229 | if (res.data[temp] == 0 && res.data[temp + 1] == 0 && res.data[temp + 2] == 0 && res.data[temp + 3] == 0) {
230 | po.point = 0;
231 | } else {
232 | po.point = 1;
233 | }
234 | point_list.push(po)
235 | temp += 4
236 | }
237 | }
238 | time++
239 | temp = res.data.length - width * 32 * time
240 | }
241 | for (var i = 0; i < point_list.length; i += 8) {
242 | var p = point_list[i].point * 128 + point_list[i + 1].point * 64 + point_list[i + 2].point * 32 + point_list[i + 3].point * 16 + point_list[i + 4].point * 8 + point_list[i + 5].point * 4 + point_list[i + 6].point * 2 + point_list[i + 7].point
243 | data.push(p)
244 | }
245 | }
246 |
247 | jpPrinter.setPrint = function () { //打印并换行
248 | data.push(10)
249 | }
250 |
251 | jpPrinter.setPrintAndFeed = function (feed) { //打印并走纸feed个单位
252 | data.push(27)
253 | data.push(74)
254 | data.push(feed)
255 | }
256 |
257 | jpPrinter.setPrintAndFeedRow = function (row) { //打印并走纸row行
258 | data.push(27)
259 | data.push(100)
260 | data.push(row)
261 | }
262 |
263 | jpPrinter.getData = function () { //获取打印数据
264 | return data;
265 | };
266 |
267 |
268 | return jpPrinter;
269 | },
270 |
271 | Query: function () {
272 | var queryStatus = {};
273 | var buf;
274 | var dateView;
275 | queryStatus.getRealtimeStatusTransmission = function (n) { //查询打印机实时状态
276 | /*
277 | n = 1:传送打印机状态
278 | n = 2:传送脱机状态
279 | n = 3:传送错误状态
280 | n = 4:传送纸传感器状态
281 | */
282 | buf = new ArrayBuffer(3)
283 | dateView = new DataView(buf)
284 | dateView.setUint8(0, 16)
285 | dateView.setUint8(1, 4)
286 | dateView.setUint8(2, n)
287 | queryStatus.query(buf)
288 | }
289 |
290 | queryStatus.query = function (buf) {
291 | wx.writeBLECharacteristicValue({
292 | deviceId: app.BLEInformation.deviceId,
293 | serviceId: app.BLEInformation.writeServiceId,
294 | characteristicId: app.BLEInformation.writeCharaterId,
295 | value: buf,
296 | success: function (res) {
297 |
298 | },
299 | complete: function (res) {
300 | console.log(res)
301 | buf = null
302 | dateView = null;
303 | }
304 | })
305 | }
306 | return queryStatus;
307 | }
308 |
309 | };
310 |
311 | module.exports.jpPrinter = jpPrinter;
--------------------------------------------------------------------------------
/BluetoothPrinter-master/components/gprint/tsc.js:
--------------------------------------------------------------------------------
1 | // var app = getApp();
2 | var encode = require("./encoding.js");
3 | var jpPrinter = {
4 | createNew: function () {
5 | var jpPrinter = {};
6 | var data = "";
7 | var command = []
8 |
9 | jpPrinter.name = "标签模式";
10 |
11 | jpPrinter.init = function () { };
12 |
13 | jpPrinter.addCommand = function (content) { //将指令转成数组装起
14 | var code = new encode.TextEncoder(
15 | 'gb18030', {
16 | NONSTANDARD_allowLegacyEncoding: true
17 | }).encode(content)
18 | for (var i = 0; i < code.length; ++i) {
19 | command.push(code[i])
20 | }
21 | }
22 |
23 | jpPrinter.setSize = function (pageWidght, pageHeight) { //设置页面大小
24 | data = "SIZE " + pageWidght.toString() + " mm" + "," + pageHeight.toString() + " mm" + "\r\n";
25 | jpPrinter.addCommand(data)
26 | };
27 |
28 | jpPrinter.setSpeed = function (printSpeed) { //设置打印机速度
29 | data = "SPEED " + printSpeed.toString() + "\r\n";
30 | jpPrinter.addCommand(data)
31 | };
32 |
33 | jpPrinter.setDensity = function (printDensity) { //设置打印机浓度
34 | data = "DENSITY " + printDensity.toString() + "\r\n";
35 | jpPrinter.addCommand(data)
36 | };
37 |
38 | jpPrinter.setGap = function (printGap) { //传感器
39 | data = "GAP " + printGap.toString() + " mm\r\n";
40 | jpPrinter.addCommand(data)
41 | };
42 |
43 | jpPrinter.setCountry = function (country) { //选择国际字符集
44 | /*
45 | 001:USA
46 | 002:French
47 | 003:Latin America
48 | 034:Spanish
49 | 039:Italian
50 | 044:United Kingdom
51 | 046:Swedish
52 | 047:Norwegian
53 | 049:German
54 | */
55 | data = "COUNTRY " + country + "\r\n";
56 | jpPrinter.addCommand(data)
57 | };
58 |
59 | jpPrinter.setCodepage = function (codepage) { //选择国际代码页
60 | /*
61 | 8-bit codepage 字符集代表
62 | 437:United States
63 | 850:Multilingual
64 | 852:Slavic
65 | 860:Portuguese
66 | 863:Canadian/French
67 | 865:Nordic
68 | Windows code page
69 | 1250:Central Europe
70 | 1252:Latin I
71 | 1253:Greek
72 | 1254:Turkish
73 | 以下代码页仅限于 12×24 dot 英数字体
74 | WestEurope:WestEurope
75 | Greek:Greek
76 | Hebrew:Hebrew
77 | EastEurope:EastEurope
78 | Iran:Iran
79 | IranII:IranII
80 | Latvian:Latvian
81 | Arabic:Arabic
82 | Vietnam:Vietnam
83 | Uygur:Uygur
84 | Thai:Thai
85 | 1252:Latin I
86 | 1257:WPC1257
87 | 1251:WPC1251
88 | 866:Cyrillic
89 | 858:PC858
90 | 747:PC747
91 | 864:PC864
92 | 1001:PC100
93 | */
94 | data = "CODEPAGE " + codepage + "\r\n";
95 | jpPrinter.addCommand(data)
96 | }
97 |
98 | jpPrinter.setCls = function () { //清除打印机缓存
99 | data = "CLS" + "\r\n";
100 | jpPrinter.addCommand(data)
101 | };
102 |
103 | jpPrinter.setFeed = function (feed) { //将纸向前推出n
104 | data = "FEED " + feed + "\r\n";
105 | jpPrinter.addCommand(data)
106 | };
107 |
108 | jpPrinter.setBackFeed = function (backup) { //将纸向后回拉n
109 | data = "BACKFEED " + backup + "\r\n";
110 | jpPrinter.addCommand(data)
111 | }
112 |
113 | jpPrinter.setDirection = function (direction) { //设置打印方向,参考编程手册
114 | data = "DIRECTION " + direction + "\r\n";
115 | jpPrinter.addCommand(data)
116 | };
117 |
118 | jpPrinter.setReference = function (x, y) { //设置坐标原点,与打印方向有关
119 | data = "REFERENCE " + x + "," + y + "\r\n";
120 | jpPrinter.addCommand(data)
121 | };
122 |
123 | jpPrinter.setFromfeed = function () { //根据Size进一张标签纸
124 | data = "FORMFEED \r\n";
125 | jpPrinter.addCommand(data)
126 | };
127 |
128 | jpPrinter.setHome = function () { //根据Size找到下一张标签纸的位置
129 | data = "HOME \r\n";
130 | jpPrinter.addCommand(data)
131 | };
132 |
133 | jpPrinter.setSound = function (level, interval) { //控制蜂鸣器
134 | data = "SOUND " + level + "," + interval + "\r\n";
135 | jpPrinter.addCommand(data)
136 | };
137 |
138 | jpPrinter.setLimitfeed = function (limit) { // 检测垂直间距
139 | data = "LIMITFEED " + limit + "\r\n";
140 | jpPrinter.addCommand(data)
141 | };
142 |
143 | jpPrinter.setBar = function (x, y, width, height) { //绘制线条
144 | data = "BAR " + x + "," + y + "," + width + "," + height + "\r\n"
145 | jpPrinter.addCommand(data)
146 | };
147 |
148 | jpPrinter.setBox = function (x_start, y_start, x_end, y_end, thickness) { //绘制方框
149 | data = "BOX " + x_start + "," + y_start + "," + x_end + "," + y_end + "," + thickness + "\r\n";
150 | jpPrinter.addCommand(data)
151 | };
152 |
153 | jpPrinter.setErase = function (x_start, y_start, x_width, y_height) { //清除指定区域的数据
154 | data = "ERASE " + x_start + "," + y_start + "," + x_width + "," + y_height + "\r\n";
155 | jpPrinter.addCommand(data)
156 | };
157 |
158 | jpPrinter.setReverse = function (x_start, y_start, x_width, y_height) { //将指定的区域反相打印
159 | data = "REVERSE " + x_start + "," + y_start + "," + x_width + "," + y_height + "\r\n";
160 | jpPrinter.addCommand(data)
161 | };
162 |
163 | jpPrinter.setText = function (x, y, font, x_, y_, str) { //打印文字
164 | data = "TEXT " + x + "," + y + ",\"" + font + "\"," + 0 + "," + x_ + "," + y_ + "," + "\"" + str + "\"\r\n"
165 | jpPrinter.addCommand(data)
166 | };
167 |
168 | jpPrinter.setQR = function (x, y, level, width, mode, content) { //打印二维码
169 | data = "QRCODE " + x + "," + y + "," + level + "," + width + "," + mode + "," + 0 + ",\"" + content + "\"\r\n"
170 | jpPrinter.addCommand(data)
171 | };
172 |
173 | jpPrinter.setBarCode = function (x, y, codetype, height, readable, narrow, wide, content) { //打印条形码
174 | data = "BARCODE " + x + "," + y + ",\"" + codetype + "\"," + height + "," + readable + "," + 0 + "," + narrow + "," + wide + ",\"" + content + "\"\r\n"
175 | jpPrinter.addCommand(data)
176 | };
177 |
178 | jpPrinter.setBitmap = function (x, y, mode, res) { //添加图片,res为画布参数
179 | console.log(res)
180 | var width = parseInt((res.width + 7) / 8 * 8 / 8)
181 | var height = res.height;
182 | var time = 1;
183 | var temp = res.data.length - width * 32;
184 | var pointList = []
185 | console.log(width + "--" + height)
186 | data = "BITMAP " + x + "," + y + "," + width + "," + height + "," + mode + ","
187 | jpPrinter.addCommand(data)
188 | for (var i = 0; i < height; ++i) {
189 | console.log(temp)
190 | for (var j = 0; j < width; ++j) {
191 | for (var k = 0; k < 32; k += 4) {
192 | if (res.data[temp] == 0 && res.data[temp + 1] == 0 && res.data[temp + 2] == 0 && res.data[temp + 3] == 0) {
193 | pointList.push(1)
194 | } else {
195 | pointList.push(0)
196 | }
197 | temp += 4
198 | }
199 | }
200 | time++
201 | temp = res.data.length - width * 32 * time
202 | }
203 | for (var i = 0; i < pointList.length; i += 8) {
204 | var p = pointList[i] * 128 + pointList[i + 1] * 64 + pointList[i + 2] * 32 + pointList[i + 3] * 16 + pointList[i + 4] * 8 + pointList[i + 5] * 4 + pointList[i + 6] * 2 + pointList[i + 7]
205 | command.push(p)
206 | }
207 | }
208 |
209 | jpPrinter.setPagePrint = function () { //打印页面
210 | data = "PRINT 1,1\r\n"
211 | jpPrinter.addCommand(data)
212 | };
213 | //获取打印数据
214 | jpPrinter.getData = function () {
215 | return command;
216 | };
217 |
218 | return jpPrinter;
219 | }
220 | };
221 |
222 | module.exports.jpPrinter = jpPrinter;
--------------------------------------------------------------------------------
/BluetoothPrinter-master/demo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/demo.jpg
--------------------------------------------------------------------------------
/BluetoothPrinter-master/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 |
4 | Vue.config.productionTip = false
5 |
6 | App.mpType = 'app'
7 |
8 | const app = new Vue({
9 | ...App
10 | })
11 | app.$mount()
12 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "http",
3 | "appid" : "",
4 | "description" : "",
5 | "versionName" : "1.0.0",
6 | "versionCode" : "100",
7 | "transformPx" : false,
8 | "app-plus" : {
9 | /* 5+App特有相关 */
10 | "usingComponents" : true,
11 | "splashscreen" : {
12 | "alwaysShowBeforeRender" : true,
13 | "waiting" : true,
14 | "autoclose" : true,
15 | "delay" : 0
16 | },
17 | "modules" : {},
18 | /* 模块配置 */
19 | "distribute" : {
20 | /* 应用发布信息 */
21 | "android" : {
22 | /* android打包配置 */
23 | "permissions" : [
24 | "",
25 | "",
26 | "",
27 | "",
28 | "",
29 | "",
30 | "",
31 | "",
32 | "",
33 | "",
34 | "",
35 | "",
36 | "",
37 | "",
38 | "",
39 | "",
40 | "",
41 | "",
42 | "",
43 | "",
44 | "",
45 | ""
46 | ]
47 | },
48 | "ios" : {},
49 | /* ios打包配置 */
50 | "sdkConfigs" : {}
51 | }
52 | },
53 | /* SDK配置 */
54 | "quickapp" : {},
55 | /* 快应用特有相关 */
56 | "mp-weixin" : {
57 | /* 小程序特有相关 */
58 | "appid" : "wxd1fc88d98e6b3015",
59 | "setting" : {
60 | "urlCheck" : false
61 | },
62 | "usingComponents" : true
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": true,
3 | "lockfileVersion": 1,
4 | "dependencies": {
5 | "text-encoding": {
6 | "version": "0.7.0",
7 | "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz",
8 | "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA=="
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
3 | {
4 | "path": "pages/index/index",
5 | "style": {
6 | "navigationBarTitleText": "蓝牙打印demo"
7 | }
8 | }
9 | ],
10 | "globalStyle": {
11 | "navigationBarTextStyle": "black",
12 | "navigationBarTitleText": "uni-app",
13 | "navigationBarBackgroundColor": "#F8F8F8",
14 | "backgroundColor": "#F8F8F8"
15 | },
16 | "condition" : { //模式配置,仅开发期间生效
17 | "current": 0, //当前激活的模式(list 的索引项)
18 | "list": [
19 | {
20 | "name": "", //模式名称
21 | "path": "", //启动页面,必选
22 | "query": "" //启动参数,在页面的onLoad函数里面得到
23 | }
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
262 |
263 |
266 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/static/logo.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/uni.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * 这里是uni-app内置的常用样式变量
3 | *
4 | * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
5 | * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
6 | *
7 | */
8 |
9 | /**
10 | * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
11 | *
12 | * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
13 | */
14 |
15 | /* 颜色变量 */
16 |
17 | /* 行为相关颜色 */
18 | $uni-color-primary: #007aff;
19 | $uni-color-success: #4cd964;
20 | $uni-color-warning: #f0ad4e;
21 | $uni-color-error: #dd524d;
22 |
23 | /* 文字基本颜色 */
24 | $uni-text-color:#333;//基本色
25 | $uni-text-color-inverse:#fff;//反色
26 | $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
27 | $uni-text-color-placeholder: #808080;
28 | $uni-text-color-disable:#c0c0c0;
29 |
30 | /* 背景颜色 */
31 | $uni-bg-color:#ffffff;
32 | $uni-bg-color-grey:#f8f8f8;
33 | $uni-bg-color-hover:#f1f1f1;//点击状态颜色
34 | $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
35 |
36 | /* 边框颜色 */
37 | $uni-border-color:#c8c7cc;
38 |
39 | /* 尺寸变量 */
40 |
41 | /* 文字尺寸 */
42 | $uni-font-size-sm:24upx;
43 | $uni-font-size-base:28upx;
44 | $uni-font-size-lg:32upx;
45 |
46 | /* 图片尺寸 */
47 | $uni-img-size-sm:40upx;
48 | $uni-img-size-base:52upx;
49 | $uni-img-size-lg:80upx;
50 |
51 | /* Border Radius */
52 | $uni-border-radius-sm: 4upx;
53 | $uni-border-radius-base: 6upx;
54 | $uni-border-radius-lg: 12upx;
55 | $uni-border-radius-circle: 50%;
56 |
57 | /* 水平间距 */
58 | $uni-spacing-row-sm: 10px;
59 | $uni-spacing-row-base: 20upx;
60 | $uni-spacing-row-lg: 30upx;
61 |
62 | /* 垂直间距 */
63 | $uni-spacing-col-sm: 8upx;
64 | $uni-spacing-col-base: 16upx;
65 | $uni-spacing-col-lg: 24upx;
66 |
67 | /* 透明度 */
68 | $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
69 |
70 | /* 文章场景相关 */
71 | $uni-color-title: #2C405A; // 文章标题颜色
72 | $uni-font-size-title:40upx;
73 | $uni-color-subtitle: #555555; // 二级标题颜色
74 | $uni-font-size-subtitle:36upx;
75 | $uni-color-paragraph: #3F536E; // 文章段落颜色
76 | $uni-font-size-paragraph:30upx;
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/main.js","webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/App.vue?db13","webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/App.vue?044c","webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/App.vue","webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/App.vue?93d3","webpack:///C:/Users/user/Desktop/BluetoothPrinter-master/App.vue?c36e"],"names":["Vue","config","productionTip","App","mpType","app","$mount"],"mappings":";;;;;;;;;iDAAA,wCAAmB;AACnB;AACA,uE;;AAEAA,aAAIC,MAAJ,CAAWC,aAAX,GAA2B,KAA3B;;AAEAC,aAAIC,MAAJ,GAAa,KAAb;;AAEA,IAAMC,GAAG,GAAG,IAAIL,YAAJ;AACLG,YADK,EAAZ;;AAGA,UAAAE,GAAG,EAACC,MAAJ,G;;;;;;;;;;;;;;;;;;;;ACXA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACuD;AACL;AACa;;;AAG/D;AACgL;AAChL,gBAAgB,yLAAU;AAC1B,EAAE,yEAAM;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,KAAU,EAAE,YAYf;AACD;AACe,gF;;;;;;;;;;;ACrCf;AAAA;AAAA;AAAA;AAAopB,CAAgB,yqBAAG,EAAC,C;;;;;;;;;;;;ACCzpB;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATc,C;;;;;;;;;;;ACDf;AAAA;AAAA;AAAA;AAAw7B,CAAgB,m7BAAG,EAAC,C;;;;;;;;;;ACA58B,uC","file":"common/main.js","sourcesContent":["import 'uni-pages';import '@dcloudio/uni-stat';\nimport Vue from 'vue'\nimport App from './App'\n\nVue.config.productionTip = false\n\nApp.mpType = 'app'\n\nconst app = new Vue({\n ...App\n})\napp.$mount()","var render, staticRenderFns, recyclableRender, components\nvar renderjs\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('23e9d69f')) {\n api.createRecord('23e9d69f', component.options)\n } else {\n api.reload('23e9d69f', component.options)\n }\n \n }\n}\ncomponent.options.__file = \"C:/Users/user/Desktop/BluetoothPrinter-master/App.vue\"\nexport default component.exports","import mod from \"-!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./App.vue?vue&type=script&lang=js&\"","\nexport default {\n\t// onLaunch: function() {\n\t// \tconsole.log('App Launch')\n\t// },\n\t// onShow: function() {\n\t// \tconsole.log('App Show')\n\t// },\n\t// onHide: function() {\n\t// \tconsole.log('App Hide')\n\t// }\n}\n","import mod from \"-!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-1!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\index.js??ref--6-oneOf-1-2!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./App.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-1!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\index.js??ref--6-oneOf-1-2!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./App.vue?vue&type=style&index=0&lang=css&\"","// extracted by mini-css-extract-plugin"],"sourceRoot":""}
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/bootstrap"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAiB,4BAA4B;AAC7C;AACA;AACA,0BAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAgB,uBAAuB;AACvC;;;AAGA;AACA","file":"common/runtime.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"common/runtime\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \tvar jsonpArray = global[\"webpackJsonp\"] = global[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.sourcemap/mp-weixin/pages/bule/bule.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue?f41d","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue?60a6","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue?6d31","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue?7034"],"names":["data","msg1","onLoad","methods","initBule","console","log","uni","openBluetoothAdapter","success","res","initBule2","startBluetoothDevicesDiscovery","onDevice","ab2hex","buffer","hexArr","Array","prototype","map","call","Uint8Array","bit","toString","slice","join","onBluetoothDeviceFound","devices","dir","advertisData","onBluetoothAdapterStateChange"],"mappings":";;;;;;;;;;mIAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACdA,MADc,kBACP;AACN,WAAO;AACNC,UAAI,EAAE,IADA,EAAP;;AAGA,GALa;AAMdC,QAAM,EAAE,kBAAW;;AAElB,GARa;AASdC,SAAO,EAAE;AACRC,YADQ,sBACG;;AAEVC,aAAO,CAACC,GAAR,CAAY,UAAZ;AACAC,SAAG,CAACC,oBAAJ,CAAyB;AACxBC,eADwB,mBAChBC,GADgB,EACX;AACZL,iBAAO,CAACC,GAAR,CAAY,yBAAZ;AACAD,iBAAO,CAACC,GAAR,CAAYI,GAAZ;AACA,eAAKT,IAAL,GAAYS,GAAZ;AACA,SALuB,EAAzB;;AAOA,KAXO;;AAaRC,aAbQ,uBAaI;AACXJ,SAAG,CAACK,8BAAJ,CAAmC;AAClC;AACAH,eAFkC,mBAE1BC,GAF0B,EAErB;AACZL,iBAAO,CAACC,GAAR,CAAY,iCAAZ;AACAD,iBAAO,CAACC,GAAR,CAAYI,GAAZ;AACA,SALiC,EAAnC;;AAOA,KArBO;AAsBRG,YAtBQ,sBAsBG;AACVR,aAAO,CAACC,GAAR,CAAY,yBAAZ;;AAEA,eAASQ,MAAT,CAAgBC,MAAhB,EAAwB;AACvB,YAAMC,MAAM,GAAGC,KAAK,CAACC,SAAN,CAAgBC,GAAhB,CAAoBC,IAApB;AACd,YAAIC,UAAJ,CAAeN,MAAf,CADc;AAEd,kBAASO,GAAT,EAAc;AACb,iBAAO,CAAC,OAAOA,GAAG,CAACC,QAAJ,CAAa,EAAb,CAAR,EAA0BC,KAA1B,CAAgC,CAAC,CAAjC,CAAP;AACA,SAJa,CAAf;;AAMA,eAAOR,MAAM,CAACS,IAAP,CAAY,EAAZ,CAAP;AACA;AACDlB,SAAG,CAACmB,sBAAJ,CAA2B,UAASC,OAAT,EAAkB;AAC5CtB,eAAO,CAACC,GAAR,CAAY,6BAAZ;AACAD,eAAO,CAACuB,GAAR,CAAYD,OAAZ;AACAtB,eAAO,CAACC,GAAR,CAAYQ,MAAM,CAACa,OAAO,CAAC,CAAD,CAAP,CAAWE,YAAZ,CAAlB;AACA,OAJD;;AAMAtB,SAAG,CAACuB,6BAAJ,CAAkC,UAASpB,GAAT,EAAc;AAC/CL,eAAO,CAACC,GAAR,CAAY,8BAAZ,EAA4CI,GAA5C;AACA,OAFD;AAGA,KA3CO,EATK,E;;;;;;;;;;;;;ACdf;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAAA;AAAmF;AAC3B;AACL;;;AAGnD;AACmI;AACnI,gBAAgB,gJAAU;AAC1B,EAAE,0EAAM;AACR,EAAE,+EAAM;AACR,EAAE,wFAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACtCf;AAAA;AAAA;AAAA;AAA+e,CAAgB,mhBAAG,EAAC,C;;;;;;;;;;;;ACAngB;AAAA;AAAA;AAAA;AAAA;AAAA","file":"pages/bule/bule.js","sourcesContent":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tmsg1: '22',\n\t\t}\n\t},\n\tonLoad: function() {\n\n\t},\n\tmethods: {\n\t\tinitBule() {\n\n\t\t\tconsole.log(\"initBule\")\n\t\t\tuni.openBluetoothAdapter({\n\t\t\t\tsuccess(res) {\n\t\t\t\t\tconsole.log(\"打开 openBluetoothAdapter\")\n\t\t\t\t\tconsole.log(res)\n\t\t\t\t\tthis.msg1 = res\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tinitBule2() {\n\t\t\tuni.startBluetoothDevicesDiscovery({\n\t\t\t\t// services: ['FEE7'],\n\t\t\t\tsuccess(res) {\n\t\t\t\t\tconsole.log(\" startBluetoothDevicesDiscovery\")\n\t\t\t\t\tconsole.log(res)\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tonDevice() {\n\t\t\tconsole.log(\"onDevice---------------\")\n\n\t\t\tfunction ab2hex(buffer) {\n\t\t\t\tconst hexArr = Array.prototype.map.call(\n\t\t\t\t\tnew Uint8Array(buffer),\n\t\t\t\t\tfunction(bit) {\n\t\t\t\t\t\treturn ('00' + bit.toString(16)).slice(-2)\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t\treturn hexArr.join('')\n\t\t\t}\n\t\t\tuni.onBluetoothDeviceFound(function(devices) {\n\t\t\t\tconsole.log('new device list has founded')\n\t\t\t\tconsole.dir(devices)\n\t\t\t\tconsole.log(ab2hex(devices[0].advertisData))\n\t\t\t})\n\n\t\t\tuni.onBluetoothAdapterStateChange(function(res) {\n\t\t\t\tconsole.log('adapterState changed, now is', res)\n\t\t\t})\n\t\t}\n\n\t}\n}\n","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./bule.vue?vue&type=template&id=36145266&\"\nimport script from \"./bule.vue?vue&type=script&lang=js&\"\nexport * from \"./bule.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!module.hot.data) {\n api.createRecord('36145266', component.options)\n } else {\n api.reload('36145266', component.options)\n }\n module.hot.accept(\"./bule.vue?vue&type=template&id=36145266&\", function () {\n api.rerender('36145266', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"D:/用户目录/我的文档/HBuilderProjects/http/pages/bule/bule.vue\"\nexport default component.exports","import mod from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./bule.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./bule.vue?vue&type=script&lang=js&\"","export * from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--17-0!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./bule.vue?vue&type=template&id=36145266&\""],"sourceRoot":""}
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.sourcemap/mp-weixin/pages/tab/tab.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?9f47","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?3b5e","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?435d","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?1a56","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?dca6","webpack:///D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue?66b7"],"names":["onLaunch","console","log","onShow","onHide","data","methods","scroll","e","old","scrollTop","detail"],"mappings":";;;;;;;;;;wFAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACdA,UAAQ,EAAE,oBAAW;AACpBC,WAAO,CAACC,GAAR,CAAY,YAAZ;AACA,GAHa;AAIdC,QAAM,EAAE,kBAAW;AAClBF,WAAO,CAACC,GAAR,CAAY,cAAZ;AACA,GANa;AAOdE,QAAM,EAAE,kBAAW;AAClBH,WAAO,CAACC,GAAR,CAAY,cAAZ;AACA,GATa;AAUXG,MAVW,kBAUJ;AACH,WAAO,EAAP;;AAEH,GAbU;AAcXC,SAAO,EAAE;;AAELC,UAAM,EAAE,gBAASC,CAAT,EAAY;AAChBP,aAAO,CAACC,GAAR,CAAYM,CAAZ;AACA,WAAKC,GAAL,CAASC,SAAT,GAAqBF,CAAC,CAACG,MAAF,CAASD,SAA9B;AACH,KALI,EAdE,E;;;;;;;;;;;ACbf,uC;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkF;AAC3B;AACL;AACa;;;AAG/D;AACmI;AACnI,gBAAgB,gJAAU;AAC1B,EAAE,yEAAM;AACR,EAAE,8EAAM;AACR,EAAE,uFAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACvCf;AAAA;AAAA;AAAA;AAA8e,CAAgB,khBAAG,EAAC,C;;;;;;;;;;;;ACAlgB;AAAA;AAAA;AAAA;AAAiuB,CAAgB,+uBAAG,EAAC,C;;;;;;;;;;;;ACArvB;AAAA;AAAA;AAAA;AAAA;AAAA","file":"pages/tab/tab.js","sourcesContent":["//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n\r\nexport default {\r\n\tonLaunch: function() {\r\n\t\tconsole.log('App Launch')\r\n\t},\r\n\tonShow: function() {\r\n\t\tconsole.log('App Show tab')\r\n\t},\r\n\tonHide: function() {\r\n\t\tconsole.log('App Hide tab')\r\n\t},\r\n data() {\r\n return {\r\n }\r\n },\r\n methods: {\r\n \r\n scroll: function(e) {\r\n console.log(e)\r\n this.old.scrollTop = e.detail.scrollTop\r\n },\r\n \r\n }\r\n}\r\n","// extracted by mini-css-extract-plugin","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./tab.vue?vue&type=template&id=54b21c39&\"\nimport script from \"./tab.vue?vue&type=script&lang=js&\"\nexport * from \"./tab.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tab.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!module.hot.data) {\n api.createRecord('54b21c39', component.options)\n } else {\n api.reload('54b21c39', component.options)\n }\n module.hot.accept(\"./tab.vue?vue&type=template&id=54b21c39&\", function () {\n api.rerender('54b21c39', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"D:/用户目录/我的文档/HBuilderProjects/http/pages/tab/tab.vue\"\nexport default component.exports","import mod from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./tab.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./tab.vue?vue&type=script&lang=js&\"","import mod from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\index.js??ref--6-oneOf-1-2!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./tab.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-1!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\index.js??ref--6-oneOf-1-2!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./tab.vue?vue&type=style&index=0&lang=css&\"","export * from \"-!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--17-0!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!C:\\\\tools\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!./tab.vue?vue&type=template&id=54b21c39&\""],"sourceRoot":""}
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/app.js:
--------------------------------------------------------------------------------
1 |
2 | require('./common/runtime.js')
3 | require('./common/vendor.js')
4 | require('./common/main.js')
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/bule/bule",
4 | "pages/index/index",
5 | "pages/tab/tab"
6 | ],
7 | "subPackages": [],
8 | "window": {
9 | "navigationBarTextStyle": "black",
10 | "navigationBarTitleText": "uni-app",
11 | "navigationBarBackgroundColor": "#F8F8F8",
12 | "backgroundColor": "#F8F8F8"
13 | },
14 | "nvueCompiler": "weex",
15 | "splashscreen": {
16 | "alwaysShowBeforeRender": true,
17 | "autoclose": false
18 | },
19 | "appname": "http",
20 | "compilerVersion": "2.0.1",
21 | "usingComponents": {}
22 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/app.wxss:
--------------------------------------------------------------------------------
1 | @import './common/main.wxss';
2 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/common/main.js:
--------------------------------------------------------------------------------
1 | (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/main"],{
2 |
3 | /***/ "./node_modules/babel-loader/lib/index.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/vue-loader/lib/index.js?!D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=script&lang=js&":
4 | /*!********************************************************************************************************************************************************************************************************************************************************************************************************************!*\
5 | !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/vue-loader/lib??vue-loader-options!D:/用户目录/我的文档/HBuilderProjects/http/App.vue?vue&type=script&lang=js& ***!
6 | \********************************************************************************************************************************************************************************************************************************************************************************************************************/
7 | /*! no static exports found */
8 | /***/ (function(module, exports, __webpack_require__) {
9 |
10 | "use strict";
11 | Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default =
12 | {
13 | // onLaunch: function() {
14 | // console.log('App Launch')
15 | // },
16 | // onShow: function() {
17 | // console.log('App Show')
18 | // },
19 | // onHide: function() {
20 | // console.log('App Hide')
21 | // }
22 | };exports.default = _default;
23 |
24 | /***/ }),
25 |
26 | /***/ "./node_modules/mini-css-extract-plugin/dist/loader.js?!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=style&index=0&lang=css&":
27 | /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
28 | !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-1!./node_modules/css-loader??ref--6-oneOf-1-2!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-3!./node_modules/vue-loader/lib??vue-loader-options!D:/用户目录/我的文档/HBuilderProjects/http/App.vue?vue&type=style&index=0&lang=css& ***!
29 | \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
30 | /*! no static exports found */
31 | /***/ (function(module, exports, __webpack_require__) {
32 |
33 | // extracted by mini-css-extract-plugin
34 |
35 | /***/ }),
36 |
37 | /***/ "D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue":
38 | /*!**************************************************!*\
39 | !*** D:/用户目录/我的文档/HBuilderProjects/http/App.vue ***!
40 | \**************************************************/
41 | /*! no static exports found */
42 | /***/ (function(module, __webpack_exports__, __webpack_require__) {
43 |
44 | "use strict";
45 | __webpack_require__.r(__webpack_exports__);
46 | /* harmony import */ var _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./App.vue?vue&type=script&lang=js& */ "D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=script&lang=js&");
47 | /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
48 | /* harmony import */ var _App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./App.vue?vue&type=style&index=0&lang=css& */ "D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=style&index=0&lang=css&");
49 | /* harmony import */ var _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
50 | var render, staticRenderFns
51 |
52 |
53 |
54 |
55 |
56 | /* normalize component */
57 |
58 | var component = Object(_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
59 | _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"],
60 | render,
61 | staticRenderFns,
62 | false,
63 | null,
64 | null,
65 | null
66 |
67 | )
68 |
69 | /* hot reload */
70 | if (false) { var api; }
71 | component.options.__file = "D:/用户目录/我的文档/HBuilderProjects/http/App.vue"
72 | /* harmony default export */ __webpack_exports__["default"] = (component.exports);
73 |
74 | /***/ }),
75 |
76 | /***/ "D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=script&lang=js&":
77 | /*!***************************************************************************!*\
78 | !*** D:/用户目录/我的文档/HBuilderProjects/http/App.vue?vue&type=script&lang=js& ***!
79 | \***************************************************************************/
80 | /*! no static exports found */
81 | /***/ (function(module, __webpack_exports__, __webpack_require__) {
82 |
83 | "use strict";
84 | __webpack_require__.r(__webpack_exports__);
85 | /* harmony import */ var _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/vue-loader/lib??vue-loader-options!./App.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/vue-loader/lib/index.js?!D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=script&lang=js&");
86 | /* harmony import */ var _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
87 | /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
88 | /* harmony default export */ __webpack_exports__["default"] = (_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
89 |
90 | /***/ }),
91 |
92 | /***/ "D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=style&index=0&lang=css&":
93 | /*!***********************************************************************************!*\
94 | !*** D:/用户目录/我的文档/HBuilderProjects/http/App.vue?vue&type=style&index=0&lang=css& ***!
95 | \***********************************************************************************/
96 | /*! no static exports found */
97 | /***/ (function(module, __webpack_exports__, __webpack_require__) {
98 |
99 | "use strict";
100 | __webpack_require__.r(__webpack_exports__);
101 | /* harmony import */ var _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-1!./node_modules/css-loader??ref--6-oneOf-1-2!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-3!./node_modules/vue-loader/lib??vue-loader-options!./App.vue?vue&type=style&index=0&lang=css& */ "./node_modules/mini-css-extract-plugin/dist/loader.js?!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!D:\\用户目录\\我的文档\\HBuilderProjects\\http\\App.vue?vue&type=style&index=0&lang=css&");
102 | /* harmony import */ var _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
103 | /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
104 | /* harmony default export */ __webpack_exports__["default"] = (_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_6_oneOf_1_1_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_index_js_ref_6_oneOf_1_2_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_loaders_stylePostLoader_js_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_C_tools_HBuilderX_plugins_uniapp_cli_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
105 |
106 | /***/ })
107 |
108 | },[["D:\\用户目录\\我的文档\\HBuilderProjects\\http\\main.js","common/runtime","common/vendor"]]]);
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/common/main.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | /*每个页面公共css */
17 |
18 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/common/runtime.js:
--------------------------------------------------------------------------------
1 | /******/ (function(modules) { // webpackBootstrap
2 | /******/ // install a JSONP callback for chunk loading
3 | /******/ function webpackJsonpCallback(data) {
4 | /******/ var chunkIds = data[0];
5 | /******/ var moreModules = data[1];
6 | /******/ var executeModules = data[2];
7 | /******/
8 | /******/ // add "moreModules" to the modules object,
9 | /******/ // then flag all "chunkIds" as loaded and fire callback
10 | /******/ var moduleId, chunkId, i = 0, resolves = [];
11 | /******/ for(;i < chunkIds.length; i++) {
12 | /******/ chunkId = chunkIds[i];
13 | /******/ if(installedChunks[chunkId]) {
14 | /******/ resolves.push(installedChunks[chunkId][0]);
15 | /******/ }
16 | /******/ installedChunks[chunkId] = 0;
17 | /******/ }
18 | /******/ for(moduleId in moreModules) {
19 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
20 | /******/ modules[moduleId] = moreModules[moduleId];
21 | /******/ }
22 | /******/ }
23 | /******/ if(parentJsonpFunction) parentJsonpFunction(data);
24 | /******/
25 | /******/ while(resolves.length) {
26 | /******/ resolves.shift()();
27 | /******/ }
28 | /******/
29 | /******/ // add entry modules from loaded chunk to deferred list
30 | /******/ deferredModules.push.apply(deferredModules, executeModules || []);
31 | /******/
32 | /******/ // run deferred modules when all chunks ready
33 | /******/ return checkDeferredModules();
34 | /******/ };
35 | /******/ function checkDeferredModules() {
36 | /******/ var result;
37 | /******/ for(var i = 0; i < deferredModules.length; i++) {
38 | /******/ var deferredModule = deferredModules[i];
39 | /******/ var fulfilled = true;
40 | /******/ for(var j = 1; j < deferredModule.length; j++) {
41 | /******/ var depId = deferredModule[j];
42 | /******/ if(installedChunks[depId] !== 0) fulfilled = false;
43 | /******/ }
44 | /******/ if(fulfilled) {
45 | /******/ deferredModules.splice(i--, 1);
46 | /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
47 | /******/ }
48 | /******/ }
49 | /******/ return result;
50 | /******/ }
51 | /******/
52 | /******/ // The module cache
53 | /******/ var installedModules = {};
54 | /******/
55 | /******/ // object to store loaded and loading chunks
56 | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
57 | /******/ // Promise = chunk loading, 0 = chunk loaded
58 | /******/ var installedChunks = {
59 | /******/ "common/runtime": 0
60 | /******/ };
61 | /******/
62 | /******/ var deferredModules = [];
63 | /******/
64 | /******/ // The require function
65 | /******/ function __webpack_require__(moduleId) {
66 | /******/
67 | /******/ // Check if module is in cache
68 | /******/ if(installedModules[moduleId]) {
69 | /******/ return installedModules[moduleId].exports;
70 | /******/ }
71 | /******/ // Create a new module (and put it into the cache)
72 | /******/ var module = installedModules[moduleId] = {
73 | /******/ i: moduleId,
74 | /******/ l: false,
75 | /******/ exports: {}
76 | /******/ };
77 | /******/
78 | /******/ // Execute the module function
79 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
80 | /******/
81 | /******/ // Flag the module as loaded
82 | /******/ module.l = true;
83 | /******/
84 | /******/ // Return the exports of the module
85 | /******/ return module.exports;
86 | /******/ }
87 | /******/
88 | /******/
89 | /******/ // expose the modules object (__webpack_modules__)
90 | /******/ __webpack_require__.m = modules;
91 | /******/
92 | /******/ // expose the module cache
93 | /******/ __webpack_require__.c = installedModules;
94 | /******/
95 | /******/ // define getter function for harmony exports
96 | /******/ __webpack_require__.d = function(exports, name, getter) {
97 | /******/ if(!__webpack_require__.o(exports, name)) {
98 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
99 | /******/ }
100 | /******/ };
101 | /******/
102 | /******/ // define __esModule on exports
103 | /******/ __webpack_require__.r = function(exports) {
104 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
105 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
106 | /******/ }
107 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
108 | /******/ };
109 | /******/
110 | /******/ // create a fake namespace object
111 | /******/ // mode & 1: value is a module id, require it
112 | /******/ // mode & 2: merge all properties of value into the ns
113 | /******/ // mode & 4: return value when already ns object
114 | /******/ // mode & 8|1: behave like require
115 | /******/ __webpack_require__.t = function(value, mode) {
116 | /******/ if(mode & 1) value = __webpack_require__(value);
117 | /******/ if(mode & 8) return value;
118 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
119 | /******/ var ns = Object.create(null);
120 | /******/ __webpack_require__.r(ns);
121 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
122 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
123 | /******/ return ns;
124 | /******/ };
125 | /******/
126 | /******/ // getDefaultExport function for compatibility with non-harmony modules
127 | /******/ __webpack_require__.n = function(module) {
128 | /******/ var getter = module && module.__esModule ?
129 | /******/ function getDefault() { return module['default']; } :
130 | /******/ function getModuleExports() { return module; };
131 | /******/ __webpack_require__.d(getter, 'a', getter);
132 | /******/ return getter;
133 | /******/ };
134 | /******/
135 | /******/ // Object.prototype.hasOwnProperty.call
136 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
137 | /******/
138 | /******/ // __webpack_public_path__
139 | /******/ __webpack_require__.p = "/";
140 | /******/
141 | /******/ var jsonpArray = global["webpackJsonp"] = global["webpackJsonp"] || [];
142 | /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
143 | /******/ jsonpArray.push = webpackJsonpCallback;
144 | /******/ jsonpArray = jsonpArray.slice();
145 | /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
146 | /******/ var parentJsonpFunction = oldJsonpFunction;
147 | /******/
148 | /******/
149 | /******/ // run deferred modules from other chunks
150 | /******/ checkDeferredModules();
151 | /******/ })
152 | /************************************************************************/
153 | /******/ ([]);
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "@platforms": [
3 | "android",
4 | "iPhone",
5 | "iPad"
6 | ],
7 | "id": "",
8 | "name": "http",
9 | "version": {
10 | "name": "1.0.0",
11 | "code": "100"
12 | },
13 | "description": "",
14 | "launch_path": "__uniappview.html",
15 | "developer": {
16 | "name": "",
17 | "email": "",
18 | "url": ""
19 | },
20 | "permissions": {
21 | "UniNView": {
22 | "description": "UniNView原生渲染"
23 | }
24 | },
25 | "plus": {
26 | "useragent": {
27 | "value": "uni-app appservice",
28 | "concatenate": true
29 | },
30 | "splashscreen": {
31 | "target": "id:1",
32 | "autoclose": true,
33 | "waiting": true,
34 | "delay": 0
35 | },
36 | "popGesture": "close",
37 | "launchwebview": {
38 | "render": "always",
39 | "id": "1",
40 | "kernel": "WKWebview"
41 | },
42 | "statusbar": {
43 | "immersed": "supportedDevice",
44 | "style": "dark",
45 | "background": "#F8F8F8"
46 | },
47 | "usingComponents": true,
48 | "distribute": {
49 | "google": {
50 | "permissions": [
51 | "",
52 | "",
53 | "",
54 | "",
55 | "",
56 | "",
57 | "",
58 | "",
59 | "",
60 | "",
61 | "",
62 | "",
63 | "",
64 | "",
65 | "",
66 | "",
67 | "",
68 | "",
69 | "",
70 | "",
71 | "",
72 | ""
73 | ]
74 | },
75 | "apple": {},
76 | "plugins": {
77 | "audio": {
78 | "mp3": {
79 | "description": "Android平台录音支持MP3格式文件"
80 | }
81 | }
82 | }
83 | },
84 | "arguments": "{\"id\":1,\"name\":\"pages/bule/bule\",\"pathName\":\"pages/bule/bule\",\"query\":\"\"}",
85 | "allowsInlineMediaPlayback": true,
86 | "uni-app": {
87 | "compilerVersion": "2.0.1",
88 | "control": "v8",
89 | "nvueCompiler": "weex"
90 | }
91 | }
92 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/bule/bule.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/bule/bule.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "uni-app",
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 | {{''+text+''}}websocket
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 |
2 | .content {
3 | text-align: center;
4 | height: 400rpx;
5 | }
6 | .logo {
7 | height: 500rpx;
8 | width: 600rpx;
9 | margin-top: 20rpx;
10 | }
11 | .title {
12 | font-size: 36rpx;
13 | color: #8f8f94;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/tab/tab.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/tab/tab.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/pages/tab/tab.wxss:
--------------------------------------------------------------------------------
1 |
2 | .scroll-view_H {
3 | width: 750rpx;
4 | white-space: nowrap;
5 | }
6 | .scroll-view-item_H {
7 | width: 750rpx;
8 | height: 100rpx;
9 | background-color: #0081FF;
10 | display: inline-block;
11 | overflow: hidden;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/unpackage/dist/dev/.tmp/app-plus/static/logo.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappmarker@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappmarker@3x.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappopenlocation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
282 |
283 |
284 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappscan.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
14 | 扫码
15 |
29 |
30 |
31 |
32 |
33 |
34 |
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappsuccess.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappsuccess.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniapptabbar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TabBar
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/__uniappview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
13 | View
14 |
24 |
27 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/app-config.js:
--------------------------------------------------------------------------------
1 | // { "framework": "Vue"}
2 | var __wxConfig = {"debug":false,"appname":"http","entryPagePath":"pages/bule/bule.html","page":{"pages/bule/bule.html":{"window":{"usingComponents":{}}},"pages/index/index.html":{"window":{"navigationBarTitleText":"uni-app","usingComponents":{}}},"pages/tab/tab.html":{"window":{"usingComponents":{}}}},"global":{"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"}},"tabBar":{"color":"","selectedColor":"","backgroundColor":"","borderStyle":"black","list":[],"position":"bottom"},"networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"platform":"devtools","pages":["pages/bule/bule","pages/index/index","pages/tab/tab"],"subPackages":[],"nvueCompiler":"weex","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"compilerVersion":"2.0.1","usingComponents":{}};
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/manifest.json:
--------------------------------------------------------------------------------
1 | {"@platforms":["android","iPhone","iPad"],"name":"http","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app appservice","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"distribute":{"google":{"permissions":["\u003cuses-permission android:name\u003d\"android.permission.CHANGE_NETWORK_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.READ_CONTACTS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.VIBRATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.READ_LOGS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_WIFI_STATE\"/\u003e","\u003cuses-feature android:name\u003d\"android.hardware.camera.autofocus\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.WRITE_CONTACTS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_NETWORK_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.CAMERA\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.RECORD_AUDIO\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.GET_ACCOUNTS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.MODIFY_AUDIO_SETTINGS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.READ_PHONE_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.CHANGE_WIFI_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.WAKE_LOCK\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.CALL_PHONE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.FLASHLIGHT\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_COARSE_LOCATION\"/\u003e","\u003cuses-feature android:name\u003d\"android.hardware.camera\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_FINE_LOCATION\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.WRITE_SETTINGS\"/\u003e"]},"apple":{},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"2.0.1","control":"v8","nvueCompiler":"weex"},"arguments":"{\"pathName\":\"pages/bule/bule\",\"query\":\"\"}"},"id":"__UNI__temp__"}
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/pages/bule/bule.js:
--------------------------------------------------------------------------------
1 | document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/bule/bule.wxml') } }));
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/pages/index/index.js:
--------------------------------------------------------------------------------
1 | setCssToHead([".",[1],"content { text-align: center; height: ",[0,400],"; }\n.",[1],"logo { height: ",[0,500],"; width: ",[0,600],"; margin-top: ",[0,20],"; }\n.",[1],"title { font-size: ",[0,36],"; color: #8f8f94; }\n",],undefined,{path:"./pages/index/index.wxss"})();
2 | document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/index/index.wxml') } }));
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/pages/tab/tab.js:
--------------------------------------------------------------------------------
1 | setCssToHead([".",[1],"scroll-view_H { width: ",[0,750],"; white-space: nowrap; }\n.",[1],"scroll-view-item_H { width: ",[0,750],"; height: ",[0,100],"; background-color: #0081FF; display: inline-block; overflow: hidden; }\n",],undefined,{path:"./pages/tab/tab.wxss"})();
2 | document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/tab/tab.wxml') } }));
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/app-plus/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/unpackage/dist/dev/app-plus/static/logo.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/app.js:
--------------------------------------------------------------------------------
1 |
2 | require('./common/runtime.js')
3 | require('./common/vendor.js')
4 | require('./common/main.js')
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index"
4 | ],
5 | "subPackages": [],
6 | "window": {
7 | "navigationBarTextStyle": "black",
8 | "navigationBarTitleText": "uni-app",
9 | "navigationBarBackgroundColor": "#F8F8F8",
10 | "backgroundColor": "#F8F8F8"
11 | },
12 | "usingComponents": {},
13 | "sitemapLocation": "sitemap58.json"
14 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/app.wxss:
--------------------------------------------------------------------------------
1 | @import './common/main.wxss';
2 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/common/main.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | /*每个页面公共css */
17 |
18 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/common/runtime.js:
--------------------------------------------------------------------------------
1 |
2 | !function(){try{var a=Function("return this")();a&&!a.Math&&(Object.assign(a,{isFinite:isFinite,Array:Array,Date:Date,Error:Error,Function:Function,Math:Math,Object:Object,RegExp:RegExp,String:String,TypeError:TypeError,setTimeout:setTimeout,clearTimeout:clearTimeout,setInterval:setInterval,clearInterval:clearInterval}),"undefined"!=typeof Reflect&&(a.Reflect=Reflect))}catch(a){}}();
3 | /******/ (function(modules) { // webpackBootstrap
4 | /******/ // install a JSONP callback for chunk loading
5 | /******/ function webpackJsonpCallback(data) {
6 | /******/ var chunkIds = data[0];
7 | /******/ var moreModules = data[1];
8 | /******/ var executeModules = data[2];
9 | /******/
10 | /******/ // add "moreModules" to the modules object,
11 | /******/ // then flag all "chunkIds" as loaded and fire callback
12 | /******/ var moduleId, chunkId, i = 0, resolves = [];
13 | /******/ for(;i < chunkIds.length; i++) {
14 | /******/ chunkId = chunkIds[i];
15 | /******/ if(installedChunks[chunkId]) {
16 | /******/ resolves.push(installedChunks[chunkId][0]);
17 | /******/ }
18 | /******/ installedChunks[chunkId] = 0;
19 | /******/ }
20 | /******/ for(moduleId in moreModules) {
21 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
22 | /******/ modules[moduleId] = moreModules[moduleId];
23 | /******/ }
24 | /******/ }
25 | /******/ if(parentJsonpFunction) parentJsonpFunction(data);
26 | /******/
27 | /******/ while(resolves.length) {
28 | /******/ resolves.shift()();
29 | /******/ }
30 | /******/
31 | /******/ // add entry modules from loaded chunk to deferred list
32 | /******/ deferredModules.push.apply(deferredModules, executeModules || []);
33 | /******/
34 | /******/ // run deferred modules when all chunks ready
35 | /******/ return checkDeferredModules();
36 | /******/ };
37 | /******/ function checkDeferredModules() {
38 | /******/ var result;
39 | /******/ for(var i = 0; i < deferredModules.length; i++) {
40 | /******/ var deferredModule = deferredModules[i];
41 | /******/ var fulfilled = true;
42 | /******/ for(var j = 1; j < deferredModule.length; j++) {
43 | /******/ var depId = deferredModule[j];
44 | /******/ if(installedChunks[depId] !== 0) fulfilled = false;
45 | /******/ }
46 | /******/ if(fulfilled) {
47 | /******/ deferredModules.splice(i--, 1);
48 | /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
49 | /******/ }
50 | /******/ }
51 | /******/ return result;
52 | /******/ }
53 | /******/
54 | /******/ // The module cache
55 | /******/ var installedModules = {};
56 | /******/
57 | /******/ // object to store loaded and loading chunks
58 | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
59 | /******/ // Promise = chunk loading, 0 = chunk loaded
60 | /******/ var installedChunks = {
61 | /******/ "common/runtime": 0
62 | /******/ };
63 | /******/
64 | /******/ var deferredModules = [];
65 | /******/
66 | /******/ // The require function
67 | /******/ function __webpack_require__(moduleId) {
68 | /******/
69 | /******/ // Check if module is in cache
70 | /******/ if(installedModules[moduleId]) {
71 | /******/ return installedModules[moduleId].exports;
72 | /******/ }
73 | /******/ // Create a new module (and put it into the cache)
74 | /******/ var module = installedModules[moduleId] = {
75 | /******/ i: moduleId,
76 | /******/ l: false,
77 | /******/ exports: {}
78 | /******/ };
79 | /******/
80 | /******/ // Execute the module function
81 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
82 | /******/
83 | /******/ // Flag the module as loaded
84 | /******/ module.l = true;
85 | /******/
86 | /******/ // Return the exports of the module
87 | /******/ return module.exports;
88 | /******/ }
89 | /******/
90 | /******/
91 | /******/ // expose the modules object (__webpack_modules__)
92 | /******/ __webpack_require__.m = modules;
93 | /******/
94 | /******/ // expose the module cache
95 | /******/ __webpack_require__.c = installedModules;
96 | /******/
97 | /******/ // define getter function for harmony exports
98 | /******/ __webpack_require__.d = function(exports, name, getter) {
99 | /******/ if(!__webpack_require__.o(exports, name)) {
100 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
101 | /******/ }
102 | /******/ };
103 | /******/
104 | /******/ // define __esModule on exports
105 | /******/ __webpack_require__.r = function(exports) {
106 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
107 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
108 | /******/ }
109 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
110 | /******/ };
111 | /******/
112 | /******/ // create a fake namespace object
113 | /******/ // mode & 1: value is a module id, require it
114 | /******/ // mode & 2: merge all properties of value into the ns
115 | /******/ // mode & 4: return value when already ns object
116 | /******/ // mode & 8|1: behave like require
117 | /******/ __webpack_require__.t = function(value, mode) {
118 | /******/ if(mode & 1) value = __webpack_require__(value);
119 | /******/ if(mode & 8) return value;
120 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
121 | /******/ var ns = Object.create(null);
122 | /******/ __webpack_require__.r(ns);
123 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
124 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
125 | /******/ return ns;
126 | /******/ };
127 | /******/
128 | /******/ // getDefaultExport function for compatibility with non-harmony modules
129 | /******/ __webpack_require__.n = function(module) {
130 | /******/ var getter = module && module.__esModule ?
131 | /******/ function getDefault() { return module['default']; } :
132 | /******/ function getModuleExports() { return module; };
133 | /******/ __webpack_require__.d(getter, 'a', getter);
134 | /******/ return getter;
135 | /******/ };
136 | /******/
137 | /******/ // Object.prototype.hasOwnProperty.call
138 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
139 | /******/
140 | /******/ // __webpack_public_path__
141 | /******/ __webpack_require__.p = "/";
142 | /******/
143 | /******/ var jsonpArray = global["webpackJsonp"] = global["webpackJsonp"] || [];
144 | /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
145 | /******/ jsonpArray.push = webpackJsonpCallback;
146 | /******/ jsonpArray = jsonpArray.slice();
147 | /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
148 | /******/ var parentJsonpFunction = oldJsonpFunction;
149 | /******/
150 | /******/
151 | /******/ // run deferred modules from other chunks
152 | /******/ checkDeferredModules();
153 | /******/ })
154 | /************************************************************************/
155 | /******/ ([]);
156 | //# sourceMappingURL=../../.sourcemap/mp-weixin/common/runtime.js.map
157 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "蓝牙打印demo",
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": false
8 | },
9 | "compileType": "miniprogram",
10 | "libVersion": "2.9.2",
11 | "appid": "wxd1fc88d98e6b3015",
12 | "projectname": "http",
13 | "simulatorType": "wechat",
14 | "simulatorPluginLibVersion": {},
15 | "condition": {
16 | "search": {
17 | "current": -1,
18 | "list": []
19 | },
20 | "conversation": {
21 | "current": -1,
22 | "list": []
23 | },
24 | "game": {
25 | "current": -1,
26 | "list": []
27 | },
28 | "miniprogram": {
29 | "current": 0,
30 | "list": [
31 | {
32 | "name": "",
33 | "path": "",
34 | "query": "",
35 | "id": 0
36 | }
37 | ]
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/sitemap58.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/sitemap64.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/sitemap69.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/unpackage/dist/dev/mp-weixin/static/logo.png
--------------------------------------------------------------------------------
/BluetoothPrinter-master/佳博打印机自定义指令手册 v1.0.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/佳博打印机自定义指令手册 v1.0.0.pdf
--------------------------------------------------------------------------------
/BluetoothPrinter-master/佳博标签打印机编程手册tspl v1.0.7.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/佳博标签打印机编程手册tspl v1.0.7.pdf
--------------------------------------------------------------------------------
/BluetoothPrinter-master/佳博票据打印机编程手册esc v1.0.6.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/佳博票据打印机编程手册esc v1.0.6.pdf
--------------------------------------------------------------------------------
/BluetoothPrinter-master/佳博面单打印机编程手册cpcl v1.0.3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/BluetoothPrinter-master/佳博面单打印机编程手册cpcl v1.0.3.pdf
--------------------------------------------------------------------------------
/PrinterSDK_20200514/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows
2 | [Dd]esktop.ini
3 | Thumbs.db
4 | $RECYCLE.BIN/
5 |
6 | # macOS
7 | .DS_Store
8 | .fseventsd
9 | .Spotlight-V100
10 | .TemporaryItems
11 | .Trashes
12 |
13 | # Node.js
14 | node_modules/
15 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | this.globalData.sysinfo = wx.getSystemInfoSync()
5 | },
6 | getModel: function () { //获取手机型号
7 | return this.globalData.sysinfo["model"]
8 | },
9 | getVersion: function () { //获取微信版本号
10 | return this.globalData.sysinfo["version"]
11 | },
12 | getSystem: function () { //获取操作系统版本
13 | return this.globalData.sysinfo["system"]
14 | },
15 | getPlatform: function () { //获取客户端平台
16 | return this.globalData.sysinfo["platform"]
17 | },
18 | getSDKVersion: function () { //获取客户端基础库版本
19 | return this.globalData.sysinfo["SDKVersion"]
20 | },
21 | globalData: {
22 | userInfo: null,
23 | platform:"",
24 | screenWidth:wx.getSystemInfoSync().screenWidth,
25 | screenHeight:wx.getSystemInfoSync().screenHeight,
26 | },
27 | BLEInformation:{
28 | platform: "",
29 | deviceId:"",
30 | writeCharaterId: "",
31 | writeServiceId: "",
32 | notifyCharaterId: "",
33 | notifyServiceId: "",
34 | readCharaterId: "",
35 | readServiceId: "",
36 | }
37 |
38 | })
--------------------------------------------------------------------------------
/PrinterSDK_20200514/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/home/home",
4 | "pages/bleConnect/bleConnect",
5 | "pages/sendCommand/sendCommand",
6 | "pages/net/net",
7 | "pages/ticket/ticket",
8 | "pages/receipt/receipt",
9 | "pages/label/label"
10 | ],
11 | "window": {
12 | "backgroundTextStyle": "light",
13 | "navigationBarBackgroundColor": "#54bec2",
14 | "navigationBarTitleText": "WeChat",
15 | "navigationBarTextStyle": "white"
16 |
17 | },
18 | "sitemapLocation": "sitemap.json"
19 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: space-between;
8 | padding: 200rpx 0;
9 | box-sizing: border-box;
10 | background-color: #54bec2
11 | }
12 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/car.jpg
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/flower2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/flower2.jpg
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/ic_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/ic_close.png
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/ic_unvisiable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/ic_unvisiable.png
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/ic_visiable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/ic_visiable.png
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/wechat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/wechat.jpg
--------------------------------------------------------------------------------
/PrinterSDK_20200514/imags/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/imags/wechat.png
--------------------------------------------------------------------------------
/PrinterSDK_20200514/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 |
4 | },
5 | "exclude": [
6 | ]
7 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/bleConnect/bleConnect.js:
--------------------------------------------------------------------------------
1 | // pages/blueconn/blueconn.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | list: [],
10 | services: [],
11 | serviceId: 0,
12 | writeCharacter: false,
13 | readCharacter: false,
14 | notifyCharacter: false,
15 | isScanning:false
16 | },
17 | //搜索设备
18 | startSearch: function () {
19 | var that = this
20 | wx.openBluetoothAdapter({
21 | success: function (res) {
22 | wx.getBluetoothAdapterState({
23 | success: function (res) {
24 | console.log('openBluetoothAdapter success', res)
25 | if (res.available) {
26 | if (res.discovering) {
27 | wx.stopBluetoothDevicesDiscovery({
28 | success: function (res) {
29 | console.log(res)
30 | }
31 | })
32 | }else{
33 | // that.startBluetoothDevicesDiscovery()
34 | that.getBluetoothDevices()
35 | }
36 | // that.checkPemission()
37 | } else {
38 | wx.showModal({
39 | title: '提示',
40 | content: '本机蓝牙不可用',
41 | showCancel: false
42 | })
43 | }
44 | },
45 | })
46 | }, fail: function () {
47 |
48 | // if (res.errCode === 10001) {
49 | // wx.onBluetoothAdapterStateChange(function (res) {
50 | // console.log('onBluetoothAdapterStateChange', res)
51 | // if (res.available) {
52 | // this.startBluetoothDevicesDiscovery()
53 | // }
54 | // })
55 | // }
56 |
57 | wx.showModal({
58 | title: '提示',
59 | content: '蓝牙初始化失败,请到设置打开蓝牙',
60 | showCancel: false
61 | })
62 | }
63 | })
64 | },
65 | checkPemission: function () { //android 6.0以上需授权地理位置权限
66 | var that = this
67 | var platform = app.BLEInformation.platform
68 | if (platform == "ios") {
69 | app.globalData.platform = "ios"
70 | that.getBluetoothDevices()
71 | } else if (platform == "android") {
72 | app.globalData.platform = "android"
73 | console.log(app.getSystem().substring(app.getSystem().length - (app.getSystem().length - 8), app.getSystem().length - (app.getSystem().length - 8) + 1))
74 | if (app.getSystem().substring(app.getSystem().length - (app.getSystem().length - 8), app.getSystem().length - (app.getSystem().length - 8) + 1) > 5) {
75 | wx.getSetting({
76 | success: function (res) {
77 | console.log(res)
78 | if (!res.authSetting['scope.userLocation']) {
79 | wx.authorize({
80 | scope: 'scope.userLocation',
81 | complete: function (res) {
82 | that.getBluetoothDevices()
83 | }
84 | })
85 | } else {
86 | that.getBluetoothDevices()
87 | }
88 | }
89 | })
90 | }
91 | }
92 | },
93 | getBluetoothDevices: function () { //获取蓝牙设备信息
94 | var that = this
95 | console.log("start search")
96 | wx.showLoading({
97 | title: '正在加载',
98 | icon: 'loading',
99 | })
100 | that.setData({
101 | isScanning:true
102 | })
103 | wx.startBluetoothDevicesDiscovery({
104 | success: function (res) {
105 | console.log(res)
106 | setTimeout(function () {
107 | wx.getBluetoothDevices({
108 | success: function (res) {
109 | var devices = []
110 | var num = 0
111 | for (var i = 0; i < res.devices.length; ++i) {
112 | if (res.devices[i].name != "未知设备") {
113 | devices[num] = res.devices[i]
114 | num++
115 | }
116 | }
117 | that.setData({
118 | list: devices,
119 | isScanning:false
120 | })
121 | wx.hideLoading()
122 | wx.stopPullDownRefresh()
123 | wx.stopBluetoothDevicesDiscovery({
124 | success: function (res) {
125 | console.log("停止搜索蓝牙")
126 | }
127 | })
128 | },
129 | })
130 | }, 5000)
131 | },
132 | })
133 | },
134 | bindViewTap: function (e) {
135 | var that = this
136 | wx.stopBluetoothDevicesDiscovery({
137 | success: function (res) { console.log(res) },
138 | })
139 | that.setData({
140 | serviceId: 0,
141 | writeCharacter: false,
142 | readCharacter: false,
143 | notifyCharacter: false
144 | })
145 | console.log(e.currentTarget.dataset.title)
146 | wx.showLoading({
147 | title: '正在连接',
148 |
149 | })
150 | wx.createBLEConnection({
151 | deviceId: e.currentTarget.dataset.title,
152 | success: function (res) {
153 | console.log(res)
154 | app.BLEInformation.deviceId = e.currentTarget.dataset.title
155 | that.getSeviceId()
156 | }, fail: function (e) {
157 | wx.showModal({
158 | title: '提示',
159 | content: '连接失败',
160 | showCancel: false
161 | })
162 | console.log(e)
163 | wx.hideLoading()
164 | }, complete: function (e) {
165 | console.log(e)
166 | }
167 | })
168 | },
169 | getSeviceId: function () {
170 | var that = this
171 | var platform = app.BLEInformation.platform
172 | console.log(app.BLEInformation.deviceId)
173 | wx.getBLEDeviceServices({
174 | deviceId: app.BLEInformation.deviceId,
175 | success: function (res) {
176 | console.log(res)
177 | // var realId = ''
178 | // if (platform == 'android') {
179 | // // for(var i=0;i 搜索蓝牙设备
2 | (Android8.0+系统需开启定位)
3 |
4 |
11 | {{item.name}}
12 | {{item.deviceId}}
13 | 信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/bleConnect/bleConnect.wxss:
--------------------------------------------------------------------------------
1 | .button {
2 | margin-top: 20px;
3 | width: 90%;
4 | background-color: #54bec2;
5 | color: white;
6 | border-radius: 98rpx;
7 | background: bg_red;
8 | }
9 |
10 | /* 按下变颜色 */
11 | .hover {
12 | background: #DCDCDC;
13 | }
14 |
15 | .device_list {
16 | height: auto;
17 | margin-left: 20px;
18 | margin-right: 20px;
19 | margin-top: 10px;
20 | margin-bottom: 20px;
21 | border: 1px solid #EEE;
22 | border-radius: 5px;
23 | width: auto;
24 | }
25 | .td {
26 | display: flex;
27 | align-items: center;
28 | justify-content: center;
29 | margin-top: 10px;
30 | }
31 | /* .item {
32 | padding-top: 10px;
33 | padding-bottom: 10px;
34 | height: 130rpx;
35 | width: 100%;
36 | } */
37 | .item{
38 | display: block;
39 | /* font-family: Arial, Helvetica, sans-serif;
40 | font-size:14px;
41 | margin: 0 10px;
42 | margin-top:10px;
43 | margin-bottom: 10px;
44 | background-color:#FFA850;
45 | border-radius: 5px;
46 | border-bottom: 2px solid #68BAEA; */
47 | border-bottom: 1px solid #EEE;
48 | padding: 4px;
49 | color: #666;
50 | }
51 | .item_hover {
52 | background-color: rgba(0, 0, 0, .1);
53 | }
54 | .block{
55 | display: block;
56 | color:#ffffff;
57 | padding: 5px;
58 | }/* pages/bleConnect/bleConnect.wxss */
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/home/home.js:
--------------------------------------------------------------------------------
1 | // pages/blueconn/blueconn.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | list: [],
10 | },
11 | blueTooth:function(){
12 | wx.navigateTo({
13 | url: '../bleConnect/bleConnect',
14 | })
15 | },
16 | //打印指令页面
17 | printTest: function () {
18 | wx.navigateTo({
19 | url: '../sendCommand/sendCommand',
20 | })
21 | },
22 | //小票案例
23 | recipt: function () {
24 | wx.navigateTo({
25 | url: '../receipt/receipt',
26 | })
27 | },
28 | //标签案例
29 | label: function () {
30 | wx.navigateTo({
31 | url: '../label/label',
32 | })
33 | },
34 | //蓝牙配网页面
35 | blueToothNet: function () {
36 | wx.navigateTo({
37 | url: '../net/net',
38 | })
39 | },
40 | //打印彩票
41 | lotteryTicket: function () {
42 | wx.navigateTo({
43 | url: '../ticket/ticket',
44 | })
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面加载
49 | */
50 | onLoad: function (options) {
51 | app.BLEInformation.platform = app.getPlatform()
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面初次渲染完成
56 | */
57 | onReady: function () {
58 |
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面显示
63 | */
64 | onShow: function () {
65 |
66 | },
67 |
68 | /**
69 | * 生命周期函数--监听页面隐藏
70 | */
71 | onHide: function () {
72 |
73 | },
74 |
75 | /**
76 | * 生命周期函数--监听页面卸载
77 | */
78 | onUnload: function () {
79 | wx.closeBLEConnection({
80 | deviceId: app.BLEInformation.deviceId,
81 | success: function(res) {
82 | console.log("关闭蓝牙成功")
83 | },
84 | })
85 | },
86 |
87 | // /**
88 | // * 页面相关事件处理函数--监听用户下拉动作
89 | // */
90 | // onPullDownRefresh: function () {
91 | // var that = this
92 | // wx.startPullDownRefresh({})
93 | // that.startSearch()
94 | // },
95 |
96 | /**
97 | * 页面上拉触底事件的处理函数
98 | */
99 | onReachBottom: function () {
100 |
101 | },
102 |
103 | /**
104 | * 用户点击右上角分享
105 | */
106 | onShareAppMessage: function () {
107 |
108 | }
109 | })
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/home/home.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "主页",
3 | "enablePullDownRefresh": true,
4 | "navigationBarBackgroundColor": "#54bec2",
5 | "navigationBarTextStyle": "white"
6 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/home/home.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/home/home.wxss:
--------------------------------------------------------------------------------
1 |
2 | .button {
3 | margin-top: 20px;
4 | width: 90%;
5 | background-color: #54bec2;
6 | color: white;
7 | border-radius: 98rpx;
8 | background: bg_red;
9 | }
10 |
11 | /* 按下变颜色 */
12 | .hover {
13 | background: #DCDCDC;
14 | }
15 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/label/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "标签"
3 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/label/label.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 当前每次发送字节数为(点击可更换):{{buffSize[buffIndex]}}
10 |
11 |
12 | 当前打印份数(点击可更换):{{printNum[printNumIndex]}}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/label/label.wxss:
--------------------------------------------------------------------------------
1 | .button {
2 | margin-top: 20px;
3 | width: 90%;
4 | background-color: #54bec2;
5 | color: white;
6 | border-radius: 98rpx;
7 | background: bg_red;
8 | }
9 |
10 | /* 按下变颜色 */
11 | .hover {
12 | background: #DCDCDC;
13 | }
14 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/net/net.js:
--------------------------------------------------------------------------------
1 | // pages/sendCommand/sendCommand.js
2 |
3 | /**
4 | * 此Demo仅供参考,可打印数字,英文,符号,中文,
5 | * 小程序支持的蓝牙为低功耗蓝牙(BLE),数据量大需分包发送
6 | */
7 |
8 | var app = getApp();
9 | var tsc = require("../../utils/tsc.js");
10 | var esc = require("../../utils/esc.js");
11 | var encode = require("../../utils/encoding.js");//GB18030
12 |
13 | Page({
14 |
15 | /**
16 | * 页面的初始数据
17 | */
18 | data: {
19 | ssid:"",
20 | password:"",
21 | looptime: 0,
22 | currentTime: 1,
23 | lastData: 0,
24 | oneTimeData: 60,
25 | returnResult: "",
26 | buffSize: [],
27 | buffIndex: 0,
28 | printNum: [],
29 | printerNum: 1,
30 | currentPrint: 1,
31 | netCommand: [31, 27,31, 27, 0, 17, 34, 80],
32 | selfCommand: [126, 87, 67],//斑马指令自检页
33 | end:[0],
34 | isNet:false,//标记是否为配网
35 | defaultType: true,
36 | passwordType: true
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面加载
41 | */
42 | onLoad: function (options) {
43 | var that = this;
44 | wx.notifyBLECharacteristicValueChange({
45 | deviceId: app.BLEInformation.deviceId,
46 | serviceId: app.BLEInformation.notifyServiceId,
47 | characteristicId: app.BLEInformation.notifyCharaterId,
48 | state: true,
49 | success: function (res) {
50 | wx.onBLECharacteristicValueChange(function (r) {
51 | console.log(`characteristic ${r.characteristicId} has changed, now is ${r}`)
52 | })
53 | },
54 | fail: function (e) {
55 | console.log(e)
56 | },
57 | complete: function (e) {
58 | console.log(e)
59 | }
60 | })
61 | },
62 |
63 | ssid: function (e) { //获取输入SSID
64 | this.setData({
65 | ssid: e.detail.value
66 | })
67 | // console.log("字符长度:" + data.name.length)
68 | },
69 | clear:function(){//清空输入
70 | this.setData({
71 | ssid: ""
72 | })
73 | },
74 | password: function (e) { //获取输入password
75 | this.setData({
76 | password: e.detail.value
77 | })
78 | },
79 | //defaultType:眼睛状态 passwordType:密码可见与否状态
80 | eyeStatus: function () {
81 | if (this.data.defaultType) {
82 | this.setData({
83 | passwordType: false,
84 | defaultType: false,
85 | })
86 | } else {
87 | this.setData({
88 | passwordType: true,
89 | defaultType: true,
90 | })
91 | }
92 | },
93 |
94 | settiing: function () { //设置
95 | console.log("SSID长度:" + this.data.ssid.length)
96 | if (this.data.ssid.length == 0 ) {
97 | wx.showModal({
98 | title: '提示',
99 | content: '名称SSID不能为空!',
100 | showCancel: false,
101 | })
102 | }else {
103 | wx.setStorageSync("ssid", this.data.ssid)
104 | wx.setStorageSync("password", this.data.password)
105 | var t_ssid = "\"" + this.data.ssid +"\""
106 | var t_password = "\""+this.data.password + "\""
107 | this.setData({
108 | looptime: 0,
109 | isNet:true,
110 | })
111 | var SSID = new encode.TextEncoder(
112 | 'utf-8', {
113 | NONSTANDARD_allowLegacyEncoding: true
114 | }).encode(t_ssid);
115 | var PASSWORD = new encode.TextEncoder(
116 | 'utf-8', {
117 | NONSTANDARD_allowLegacyEncoding: true
118 | }).encode(t_password);
119 | var data = [];
120 | for (var i = 0; i < this.data.netCommand.length;i++){
121 | data.push(this.data.netCommand[i]);
122 | }
123 | for (var i = 0; i < SSID.length; i++) {
124 | data.push(SSID[i]);
125 | }
126 | data.push(0);
127 | for (var i = 0; i < PASSWORD.length; i++) {
128 | data.push(PASSWORD[i]);
129 | }
130 | data.push(0);
131 | this.prepareSend(data)
132 | }
133 | },
134 | receiptTest: function () { //打印自检页
135 | this.prepareSend(this.data.selfCommand)
136 | },
137 |
138 | prepareSend: function (buff) { //准备发送,根据每次发送字节数来处理分包数量
139 | console.log(buff)
140 | var that = this
141 | var time = that.data.oneTimeData
142 | var looptime = parseInt(buff.length / time);
143 | var lastData = parseInt(buff.length % time);
144 | console.log(looptime + "---" + lastData)
145 | that.setData({
146 | looptime: looptime + 1,
147 | lastData: lastData,
148 | currentTime: 1,
149 | })
150 | that.Send(buff)
151 | },
152 |
153 | Send: function (buff) { //分包发送
154 | var that = this
155 | var currentTime = that.data.currentTime
156 | var loopTime = that.data.looptime
157 | var lastData = that.data.lastData
158 | var onTimeData = that.data.oneTimeData
159 | var printNum = that.data.printerNum
160 | var currentPrint = that.data.currentPrint
161 | var buf
162 | var dataView
163 | if (currentTime < loopTime) {
164 | buf = new ArrayBuffer(onTimeData)
165 | dataView = new DataView(buf)
166 | for (var i = 0; i < onTimeData; ++i) {
167 | dataView.setUint8(i, buff[(currentTime - 1) * onTimeData + i])
168 | }
169 | } else {
170 | buf = new ArrayBuffer(lastData)
171 | dataView = new DataView(buf)
172 | for (var i = 0; i < lastData; ++i) {
173 | dataView.setUint8(i, buff[(currentTime - 1) * onTimeData + i])
174 | }
175 | }
176 | console.log("第" + currentTime + "次发送数据大小为:" + buf.byteLength)
177 | wx.writeBLECharacteristicValue({
178 | deviceId: app.BLEInformation.deviceId,
179 | serviceId: app.BLEInformation.writeServiceId,
180 | characteristicId: app.BLEInformation.writeCharaterId,
181 | value: buf,
182 | success: function (res) {
183 | if(that.data.isNet){
184 | wx.showModal({
185 | title: '发送成功',
186 | content: '请耐心等待配网...\r\n配网成功打印:Config SUCCESS!\r\n配网失败打印:Config Fail!!!',
187 | showCancel: false,
188 | confirmText: '知道啦',
189 | success: function (res) {
190 | if (res.confirm) {
191 | that.setData({
192 | isNet: false,
193 | })
194 | that.onShow();
195 | } else if (res.cancel) {
196 | console.log('用户点击关闭')
197 | }
198 | }
199 | })
200 | console.log("配网")
201 | }else{
202 | console.log("不配网")
203 | }
204 | console.log("发送成功")
205 | console.log(res)
206 | },
207 | fail: function (e) {
208 | console.log("发送失败")
209 | wx.showModal({
210 | title: '提示',
211 | content: '发送失败',
212 | showCancel: false
213 | })
214 | console.log(e)
215 | return;
216 | },
217 | complete: function () {
218 | currentTime++
219 | if (currentTime <= loopTime) {
220 | that.setData({
221 | currentTime: currentTime
222 | })
223 | that.Send(buff)
224 | } else {
225 |
226 | if (currentPrint == printNum) {
227 | that.setData({
228 | looptime: 0,
229 | lastData: 0,
230 | currentTime: 1,
231 | currentPrint: 1
232 | })
233 | } else {
234 | currentPrint++
235 | that.setData({
236 | currentPrint: currentPrint,
237 | currentTime: 1,
238 | })
239 | that.Send(buff)
240 | }
241 | }
242 | }
243 | })
244 |
245 | },
246 |
247 | /**
248 | * 生命周期函数--监听页面初次渲染完成
249 | */
250 | onReady: function () {
251 | var list = []
252 | var numList = []
253 | var j = 0
254 | for (var i = 60; i < 200; i += 10) {
255 | list[j] = i;
256 | j++
257 | }
258 | for (var i = 1; i < 10; i++) {
259 | numList[i - 1] = i
260 | }
261 | this.setData({
262 | buffSize: list,
263 | oneTimeData: list[0],
264 | printNum: numList,
265 | printerNum: numList[0]
266 | })
267 | },
268 |
269 | /**
270 | * 生命周期函数--监听页面显示
271 | */
272 | onShow: function () {
273 | var that = this
274 | //获取本地数据
275 | var ssid = wx.getStorageSync('ssid');
276 | var password = wx.getStorageSync('password');
277 | console.log("已保存"+ssid);
278 | console.log("已保存" + password);
279 | if (ssid) {
280 | this.setData({
281 | ssid: ssid
282 | });
283 | }
284 | if (password) {
285 | this.setData({
286 | password: password
287 | });
288 | }
289 | },
290 |
291 | buffBindChange: function (res) { //更改打印字节数
292 | var index = res.detail.value
293 | var time = this.data.buffSize[index]
294 | console.log("index" + index);
295 | console.log("time" + time);
296 | this.setData({
297 | buffIndex: index,
298 | oneTimeData: time
299 | })
300 | },
301 | /**
302 | * 生命周期函数--监听页面隐藏
303 | */
304 | onHide: function () {
305 |
306 | },
307 |
308 | /**
309 | * 生命周期函数--监听页面卸载
310 | */
311 | onUnload: function () {
312 | // wx.closeBLEConnection({
313 | // deviceId: app.BLEInformation.deviceId,
314 | // success: function (res) {
315 | // console.log("关闭蓝牙成功")
316 | // },
317 | // })
318 | },
319 |
320 | /**
321 | * 页面相关事件处理函数--监听用户下拉动作
322 | */
323 | onPullDownRefresh: function () {
324 |
325 | },
326 |
327 | /**
328 | * 页面上拉触底事件的处理函数
329 | */
330 | onReachBottom: function () {
331 |
332 | },
333 |
334 | /**
335 | * 用户点击右上角分享
336 | */
337 | onShareAppMessage: function () {
338 |
339 | }
340 | })
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/net/net.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "配网"
3 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/net/net.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 名称:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 密码:
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/net/net.wxss:
--------------------------------------------------------------------------------
1 | /* blecontrol.wxss */
2 |
3 | page{
4 | width: 100%;
5 | min-height: 100%;
6 | background: blanchedalmond;
7 | }
8 | .parentstyle {
9 | margin-left: 38rpx;
10 | margin-top: 30rpx;
11 | margin-right: 38rpx;
12 | }
13 | .centerStyle {
14 | display: flex;
15 | align-items: center;
16 | justify-content: space-between;
17 | }
18 | .input{
19 | align-items: center;
20 | margin-left: 4px;
21 | padding: 4px;
22 | width: 80%;
23 | height: 30px;
24 | color: green;
25 | border: 1px solid slategray;
26 | border-radius: 8px;
27 | }
28 | .pwd{
29 | align-items: center;
30 | padding: 4px;
31 | width: 75%;
32 | height: 30px;
33 | color: green;
34 | border: 1px solid slategray;
35 | border-radius: 8px;
36 | }
37 | .pwdinput{
38 | align-items: center;
39 | padding: 4px;
40 | width: 90%;
41 | height: 30px;
42 | color: #54bec2;
43 | }
44 | .imageStyle{
45 | width: 25px;
46 | height: 25px;
47 | }
48 | .text{
49 | font-size: 30rpx;
50 | color: #54bec2;
51 | display: flex;
52 | align-items: center;
53 | justify-content: center;
54 | }
55 |
56 | .receiver_info_scroll_view{
57 | width: 90%;
58 | height: 200px;
59 | margin-left: 4%;
60 | margin-right: 4%;
61 | margin-top: 10px;
62 | margin-bottom: 25px;
63 | border: 1px solid black;
64 | }
65 |
66 | .result{
67 | width: 90%;
68 | height: 150px;
69 | border: 1px solid black;
70 | margin-left: 4%;
71 | margin-bottom: 4%;
72 | margin-top: 5%
73 | }
74 |
75 | button{
76 | width: 90%;
77 | margin-left: 5%;
78 | margin-right: 5%;
79 | }
80 |
81 | .switch{
82 | float: right;
83 | margin-right: 20px;
84 | margin-bottom: 16px;
85 | }
86 |
87 | text{
88 | color: #fff;
89 | display: block;
90 | }
91 |
92 | input{
93 | color: gainsboro;
94 | float: left;
95 | }
96 |
97 | .v_net_ssid{
98 | width: 100%;
99 | background: #fff;
100 | }
101 |
102 | .v_net_passw{
103 | width: 100%;
104 | background: antiquewhite;
105 | }
106 |
107 | .swiper{
108 | width: 100%;
109 | height: 100%;
110 | }
111 | .button {
112 | margin-top: 20px;
113 | width: 90%;
114 | background-color: #54bec2;
115 | color: white;
116 | border-radius: 98rpx;
117 | background: bg_red;
118 | }
119 |
120 | /* 按下变颜色 */
121 | .hover {
122 | background: rgb(247, 176, 176);
123 | }
124 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/receipt/receipt.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小票"
3 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/receipt/receipt.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 当前每次发送字节数为(点击可更换):{{buffSize[buffIndex]}}
10 |
11 |
12 | 当前打印份数(点击可更换):{{printNum[printNumIndex]}}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/receipt/receipt.wxss:
--------------------------------------------------------------------------------
1 | /* pages/receipt/receipt.wxss */
2 | .button {
3 | margin-top: 20px;
4 | width: 90%;
5 | background-color: #54bec2;
6 | color: white;
7 | border-radius: 98rpx;
8 | background: bg_red;
9 | }
10 |
11 | /* 按下变颜色 */
12 | .hover {
13 | background: #DCDCDC;
14 | }
15 | .canvas {
16 | display:flex;
17 | margin-top: 15px;
18 | height: 100%;
19 | justify-content: center;
20 | align-items: center;
21 | }
22 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/sendCommand/sendCommand.js:
--------------------------------------------------------------------------------
1 | // pages/sendCommand/sendCommand.js
2 |
3 | /**
4 | * 此Demo仅供参考,可打印数字,英文,符号,中文,
5 | * 小程序支持的蓝牙为低功耗蓝牙(BLE),数据量大需分包发送
6 | */
7 |
8 | var app = getApp();
9 | var tsc = require("../../utils/tsc.js");
10 | var esc = require("../../utils/esc.js");
11 | var encode = require("../../utils/encoding.js");
12 |
13 | function convertToGrayscale(data) {
14 | let g = 0
15 | for (let i = 0; i < data.length; i += 4) {
16 | g = (data[i] * 0.3 + data[i + 1] * 0.59 + data[i + 2] * 0.11)
17 | data[i] = g
18 | data[i + 1] = g
19 | data[i + 2] = g
20 | }
21 | return data
22 | }
23 |
24 | function setPixel(data, offset, value) {
25 | data[offset] = value;
26 | data[offset+1] = value;
27 | data[offset+2] = value;
28 | }
29 |
30 | function adjustPixel(data, offset, value) {
31 | data[offset] += value;
32 | }
33 |
34 | // 彩色图转成单色图
35 | function convertToMonoImage(width, height, data, shake) {
36 | let g = 0
37 | let e = 0
38 |
39 | for(let i=0; i= 150) { // 灰色转黑白的阈值, 可以调整打印效果
48 | e = g - 255;
49 | setPixel(data, dataOffset, 255);
50 | } else {
51 | e = g;
52 | setPixel(data, dataOffset, 0);
53 | }
54 |
55 | if(!shake)
56 | continue;
57 |
58 | if (x < width - 1 && y < height - 1) {
59 | //右边像素处理
60 | data[(width * y + x + 1)*4] += 7 * e / 16;
61 | //下
62 | data[(width * (y + 1) + x)*4] += 5 * e / 16;
63 | //右下
64 | data[(width * (y + 1) + x + 1)*4] += e / 16;
65 | //左下
66 | if (x > 0) {
67 | data[(width * (y + 1) + x - 1)*4] += 3 * e / 16;
68 | }
69 | } else if (x == width - 1 && y < height - 1) {
70 | //下方像素处理
71 | data[(width * (y + 1) + x)*4] += 5 * e / 16;
72 | } else if (x < width - 1 && y == height - 1) {
73 | //右边像素处理
74 | data[(width * y + x + 1)*4] += 7 * e / 16;
75 | }
76 | }
77 | }
78 | return data
79 | }
80 |
81 | Page({
82 |
83 | /**
84 | * 页面的初始数据
85 | */
86 | data: {
87 | sendContent: "",
88 | looptime: 0,
89 | currentTime: 1,
90 | lastData: 0,
91 | oneTimeData: 0,
92 | returnResult: "",
93 | canvasWidth: 180,
94 | canvasHeight: 180,
95 | imageSrc: '../../imags/abc_ic_star_black_16dp.png',
96 | buffSize: [],
97 | buffIndex: 0,
98 | printNum: [],
99 | printNumIndex: 0,
100 | printerNum: 1,
101 | currentPrint: 1,
102 | isReceiptSend: false,
103 | isLabelSend: false
104 | },
105 |
106 | /**
107 | * 生命周期函数--监听页面加载
108 | */
109 | onLoad: function (options) {
110 | var that = this;
111 | wx.notifyBLECharacteristicValueChange({
112 | deviceId: app.BLEInformation.deviceId,
113 | serviceId: app.BLEInformation.notifyServiceId,
114 | characteristicId: app.BLEInformation.notifyCharaterId,
115 | state: true,
116 | success: function (res) {
117 | wx.onBLECharacteristicValueChange(function (r) {
118 | console.log(`characteristic ${r.characteristicId} has changed, now is ${r}`)
119 | })
120 | },
121 | fail: function (e) {
122 | console.log(e)
123 | },
124 | complete: function (e) {
125 | console.log(e)
126 | }
127 | })
128 | },
129 |
130 | inputEvent: function (e) { //获取输入内容
131 | this.setData({
132 | sendContent: e.detail.value
133 | })
134 | },
135 |
136 | sendData: function () { //输入框点击发送
137 | var data = this.data.sendContent + "\n"
138 |
139 | this.setData({
140 | looptime: 0
141 | })
142 | var content = new encode.TextEncoder(
143 | 'gb18030', {
144 | NONSTANDARD_allowLegacyEncoding: true
145 | }).encode(data);
146 |
147 | this.prepareSend(content)
148 | },
149 |
150 | labelTest: function () { //标签测试
151 | var that = this;
152 | var canvasWidth = that.data.canvasWidth
153 | var canvasHeight = that.data.canvasHeight
154 | var command = tsc.jpPrinter.createNew()
155 | command.setSize(48, 40)
156 | command.setGap(0)
157 | command.setCls()
158 | // command.setText(0, 30, "TSS24.BF2", 1, 1, "图片")
159 | // command.setQrcode(40, 120, "L", 4, "A", "www.gainscha.com佳博浩盛")
160 | // command.setText(60, 90, "TSS24.BF2", 1, 1, "佳博浩盛")
161 | // command.setText(170, 50, "TSS24.BF2", 1, 1, "小程序测试")
162 | // command.setText(170, 90, "TSS24.BF2", 1, 1, "测试数字12345678")
163 | // command.setText(170, 120, "TSS24.BF2", 1, 1, "测试英文abcdefg")
164 | // command.setText(170, 150, "TSS24.BF2", 1, 1, "测试符号/*-+!@#$")
165 | // command.setBarCode(170, 180, "EAN8", 64, 1, 0,3, 3, "1234567")
166 |
167 | wx.canvasGetImageData({
168 | canvasId: 'canvasOut',
169 | x: 0,
170 | y: 0,
171 | width: canvasWidth,
172 | height: canvasHeight,
173 | success: function (res) {
174 | console.log('res len= ' + res.data.length)
175 | command.setBitmap(60, 0, 1, res)
176 | command.setPrint(1)
177 | that.prepareSend(command.getData())
178 | },
179 | complete: function () {
180 | command.setPagePrint()
181 | that.setData({
182 | isLabelSend: true
183 | })
184 | }
185 | })
186 |
187 | },
188 |
189 | receiptTest: function () { //票据测试
190 | var that = this;
191 | var canvasWidth = that.data.canvasWidth
192 | var canvasHeight = that.data.canvasHeight
193 | var command = esc.jpPrinter.createNew()
194 | command.init()
195 | command.setText("票据测试!");
196 | command.setPrint()
197 | command.setText("This is a receipt test!!!")
198 | command.setPrint()
199 | command.setText("二维码测试:")
200 | command.setPrint()
201 | command.setSelectSizeOfModuleForQRCode(5)
202 | command.setSelectErrorCorrectionLevelForQRCode(49)
203 | command.setStoreQRCodeData("佳博浩盛打印机")
204 | command.setPrintQRCode()
205 | command.setPrint()
206 | command.setSelectJustification(0)
207 | command.setText("向左对齐")
208 | command.setPrint()
209 | command.setSelectJustification(1)
210 | command.setText("居中对齐")
211 | command.setPrint()
212 | command.setSelectJustification(2)
213 | command.setText("向右对齐")
214 | command.setPrint()
215 | command.setSelectJustification(0)
216 | command.setText("图片测试")
217 | command.setPrint()
218 |
219 | wx.canvasGetImageData({
220 | canvasId: 'canvasOut',
221 | x: 0,
222 | y: 0,
223 | width: canvasWidth,
224 | height: canvasHeight,
225 | success: function (res) {
226 | command.setBitmap(res)
227 | that.prepareSend(command.getData())
228 | },
229 | complete: function (res) {
230 | console.log("finish")
231 | command.setPrint()
232 | that.setData({
233 | isReceiptSend: true
234 | })
235 | //that.prepareSend(command.getData())
236 | }
237 | })
238 |
239 | // this.send(buff)
240 | },
241 |
242 | openAndDraw() {
243 | var that = this
244 | const MAX_WIDTH = 384; // 58打印宽度
245 | //const MAX_WIDTH = 576; // 80打印宽度
246 | const MAX_HEIGHT = 256;
247 | wx.chooseImage({
248 | success: (res) => {
249 | const ctx_in = wx.createCanvasContext('canvasIn', this);
250 | const ctx_out = wx.createCanvasContext('canvasOut', this);
251 | wx.getImageInfo({
252 | src: res.tempFilePaths[0],
253 | success(info) {
254 | console.log('origin width: ' + info.width)
255 | console.log('origin height: ' + info.height)
256 | var imgWidth = info.width;
257 | var imgHeight = info.height;
258 | var canWidth = imgWidth;
259 | var canHeight = imgHeight;
260 | var canScale = 1.0;
261 |
262 | // 按 MAX_WIDTH 调整图片宽度
263 | if(imgWidth > MAX_WIDTH) {
264 | canWidth = MAX_WIDTH;
265 | canScale = canWidth / imgWidth;
266 | canHeight = parseInt(canScale * imgHeight);
267 | console.log("scale = "+canScale);
268 | console.log('scale canvas width: ' + canWidth);
269 | console.log('scale canvas height: ' + canHeight);
270 | }
271 |
272 | // 按 MAX_HEIGHT 截取高度 (过多的部分会被裁剪掉)
273 | if(canHeight > MAX_HEIGHT) {
274 | canHeight = MAX_HEIGHT;
275 | imgHeight = parseInt(canHeight / canScale);
276 | }
277 |
278 | that.setData({
279 | canvasWidth: canWidth,
280 | canvasHeight: canHeight,
281 | });
282 | ctx_in.drawImage(res.tempFilePaths[0], 0, 0, imgWidth, imgHeight, 0, 0, canWidth, canHeight)
283 | ctx_in.draw()
284 | ctx_out.clearRect(0, 0, imgWidth, imgHeight)
285 | ctx_out.draw()
286 | }
287 | })
288 | }
289 | })
290 | },
291 |
292 | process() {
293 | var that = this
294 |
295 | const cfg = {
296 | x: 0,
297 | y: 0,
298 | width: that.data.canvasWidth,
299 | height: that.data.canvasHeight,
300 | }
301 | wx.canvasGetImageData({
302 | canvasId: 'canvasIn',
303 | ...cfg,
304 | success: (res) => {
305 | //const data = convertToGrayscale(res.data)
306 | const data = convertToMonoImage(res.width, res.height, res.data, true);
307 | wx.canvasPutImageData({
308 | canvasId: 'canvasOut',
309 | data,
310 | ...cfg,
311 | success: (res) => {
312 | console.log(res)
313 | console.log('deal graphic width: ' + cfg.width)
314 | console.log('deal graphic width: ' + cfg.height)
315 | },
316 | fail: (err) => {
317 | console.error(err)
318 | }
319 | })
320 | },
321 | fail: (err) => {
322 | console.error(err)
323 | }
324 | })
325 | },
326 |
327 | prepareSend: function (buff) { //准备发送,根据每次发送字节数来处理分包数量
328 | //console.log(buff)
329 | var that = this
330 | var time = that.data.oneTimeData
331 | var looptime = parseInt(buff.length / time);
332 | var lastData = parseInt(buff.length % time);
333 | //console.log(looptime + "---" + lastData)
334 | that.setData({
335 | looptime: looptime + 1,
336 | lastData: lastData,
337 | currentTime: 1,
338 | })
339 | that.Send(buff)
340 | },
341 |
342 | queryStatus: function () { //查询打印机状态
343 | var command = esc.jpPrinter.Query();
344 | command.getRealtimeStatusTransmission(1);
345 | },
346 |
347 | Send: function (buff) { //分包发送
348 | var that = this
349 | var currentTime = that.data.currentTime
350 | var loopTime = that.data.looptime
351 | var lastData = that.data.lastData
352 | var onTimeData = that.data.oneTimeData
353 | var printNum = that.data.printerNum
354 | var currentPrint = that.data.currentPrint
355 | var buf
356 | var dataView
357 | if (currentTime < loopTime) {
358 | buf = new ArrayBuffer(onTimeData)
359 | dataView = new DataView(buf)
360 | for (var i = 0; i < onTimeData; ++i) {
361 | dataView.setUint8(i, buff[(currentTime - 1) * onTimeData + i])
362 | }
363 | } else {
364 | buf = new ArrayBuffer(lastData)
365 | dataView = new DataView(buf)
366 | for (var i = 0; i < lastData; ++i) {
367 | dataView.setUint8(i, buff[(currentTime - 1) * onTimeData + i])
368 | }
369 | }
370 | //console.log("第" + currentTime + "次发送数据大小为:" + buf.byteLength)
371 | wx.writeBLECharacteristicValue({
372 | deviceId: app.BLEInformation.deviceId,
373 | serviceId: app.BLEInformation.writeServiceId,
374 | characteristicId: app.BLEInformation.writeCharaterId,
375 | value: buf,
376 | success: function (res) {
377 | wx.showToast({
378 | title: '已打印第' + currentPrint + '张成功',
379 | })
380 | //console.log(res)
381 | },
382 | fail: function (e) {
383 | wx.showToast({
384 | title: '打印第' + currentPrint + '张失败',
385 | icon: 'none',
386 | })
387 | //console.log(e)
388 | },
389 | complete: function () {
390 | currentTime++
391 | if (currentTime <= loopTime) {
392 | that.setData({
393 | currentTime: currentTime
394 | })
395 | that.Send(buff)
396 | } else {
397 | // wx.showToast({
398 | // title: '已打印第' + currentPrint + '张',
399 | // })
400 | if (currentPrint == printNum) {
401 | that.setData({
402 | looptime: 0,
403 | lastData: 0,
404 | currentTime: 1,
405 | isReceiptSend: false,
406 | isLabelSend: false,
407 | currentPrint: 1
408 | })
409 | } else {
410 | currentPrint++
411 | that.setData({
412 | currentPrint: currentPrint,
413 | currentTime: 1,
414 | })
415 | that.Send(buff)
416 | }
417 | }
418 | }
419 | })
420 |
421 | },
422 |
423 | /**
424 | * 生命周期函数--监听页面初次渲染完成
425 | */
426 | onReady: function () {
427 | var list = []
428 | var numList = []
429 | var j = 0
430 | for (var i = 20; i < 200; i += 10) {
431 | list[j] = i;
432 | j++
433 | }
434 | for (var i = 1; i < 10; i++) {
435 | numList[i - 1] = i
436 | }
437 | this.setData({
438 | buffSize: list,
439 | oneTimeData: list[0],
440 | printNum: numList,
441 | printerNum: numList[0]
442 | })
443 | },
444 |
445 | /**
446 | * 生命周期函数--监听页面显示
447 | */
448 | onShow: function () {
449 |
450 | },
451 |
452 |
453 | buffBindChange: function (res) { //更改打印字节数
454 | var index = res.detail.value
455 | var time = this.data.buffSize[index]
456 | this.setData({
457 | buffIndex: index,
458 | oneTimeData: time
459 | })
460 | },
461 | printNumBindChange: function (res) { //更改打印份数
462 | var index = res.detail.value
463 | var num = this.data.printNum[index]
464 | this.setData({
465 | printNumIndex: index,
466 | printerNum: num
467 | })
468 | },
469 |
470 | /**
471 | * 生命周期函数--监听页面隐藏
472 | */
473 | onHide: function () {
474 |
475 | },
476 |
477 | /**
478 | * 生命周期函数--监听页面卸载
479 | */
480 | onUnload: function () {
481 | // wx.closeBLEConnection({
482 | // deviceId: app.BLEInformation.deviceId,
483 | // success: function(res) {
484 | // console.log("关闭蓝牙成功")
485 | // },
486 | // })
487 | },
488 |
489 | /**
490 | * 页面相关事件处理函数--监听用户下拉动作
491 | */
492 | onPullDownRefresh: function () {
493 |
494 | },
495 |
496 | /**
497 | * 页面上拉触底事件的处理函数
498 | */
499 | onReachBottom: function () {
500 |
501 | },
502 |
503 | /**
504 | * 用户点击右上角分享
505 | */
506 | onShareAppMessage: function () {
507 |
508 | }
509 | })
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/sendCommand/sendCommand.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "发送测试"
3 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/sendCommand/sendCommand.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 | 当前每次发送字节数为(点击可更换):{{buffSize[buffIndex]}}
37 |
38 |
39 | 当前打印份数(点击可更换):{{printNum[printNumIndex]}}
40 |
41 |
42 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/sendCommand/sendCommand.wxss:
--------------------------------------------------------------------------------
1 | /* blecontrol.wxss */
2 |
3 | page{
4 | width: 100%;
5 | min-height: 100%;
6 | background: blanchedalmond;
7 | }
8 |
9 | .input{
10 | text-align: top;
11 | width: 90%;
12 | height: 150px;
13 | margin-left: 4%;
14 | margin-right: 4%;
15 | margin-top: 10px;
16 | margin-bottom: 12px;
17 | border: 1px solid slategray;
18 | }
19 |
20 | .receiver_info_scroll_view{
21 | width: 90%;
22 | height: 200px;
23 | margin-left: 4%;
24 | margin-right: 4%;
25 | margin-top: 10px;
26 | margin-bottom: 25px;
27 | border: 1px solid black;
28 | }
29 |
30 | .result{
31 | width: 90%;
32 | height: 150px;
33 | border: 1px solid black;
34 | margin-left: 4%;
35 | margin-bottom: 4%;
36 | margin-top: 5%
37 | }
38 |
39 | button{
40 | width: 90%;
41 | margin-left: 5%;
42 | margin-right: 5%;
43 | }
44 |
45 | .switch{
46 | float: right;
47 | margin-right: 20px;
48 | margin-bottom: 16px;
49 | }
50 |
51 | text{
52 | color: #fff;
53 | display: block;
54 | }
55 |
56 | input{
57 | color: gainsboro;
58 | float: left;
59 | }
60 |
61 | .v_net_ssid{
62 | width: 100%;
63 | background: #fff;
64 | }
65 |
66 | .v_net_passw{
67 | width: 100%;
68 | background: antiquewhite;
69 | }
70 |
71 | .swiper{
72 | width: 100%;
73 | height: 100%;
74 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/ticket/ticket.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "彩票",
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/ticket/ticket.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 当前每次发送字节数为(点击可更换):{{buffSize[buffIndex]}}
9 |
10 |
11 | 当前打印份数(点击可更换):{{printNum[printNumIndex]}}
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/pages/ticket/ticket.wxss:
--------------------------------------------------------------------------------
1 | /* pages/ticket/ticket.wxss */
2 |
3 | .button {
4 | margin-top: 20px;
5 | width: 90%;
6 | background-color: #54bec2;
7 | color: white;
8 | border-radius: 98rpx;
9 | background: bg_red;
10 | }
11 |
12 | /* 按下变颜色 */
13 | .hover {
14 | background: #DCDCDC;
15 | }
16 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": false,
5 | "es6": true,
6 | "enhance": false,
7 | "postcss": true,
8 | "preloadBackgroundData": false,
9 | "minified": true,
10 | "newFeature": true,
11 | "coverView": true,
12 | "autoAudits": false,
13 | "showShadowRootInWxmlPanel": true,
14 | "scopeDataCheck": false,
15 | "checkInvalidKey": true,
16 | "checkSiteMap": true,
17 | "uploadWithSourceMap": true,
18 | "babelSetting": {
19 | "ignore": [],
20 | "disablePlugins": [],
21 | "outputPath": ""
22 | }
23 | },
24 | "compileType": "miniprogram",
25 | "libVersion": "2.11.0",
26 | "projectname": "NetTools",
27 | "isGameTourist": false,
28 | "appid": "wx5107c6587d0d93b2",
29 | "simulatorType": "wechat",
30 | "simulatorPluginLibVersion": {},
31 | "condition": {
32 | "search": {
33 | "current": -1,
34 | "list": []
35 | },
36 | "conversation": {
37 | "current": -1,
38 | "list": []
39 | },
40 | "plugin": {
41 | "current": -1,
42 | "list": []
43 | },
44 | "game": {
45 | "currentL": -1,
46 | "list": []
47 | },
48 | "miniprogram": {
49 | "current": 3,
50 | "list": [
51 | {
52 | "id": -1,
53 | "name": "send",
54 | "pathName": "pages/sendCommand/sendCommand",
55 | "query": ""
56 | },
57 | {
58 | "id": -1,
59 | "name": "pages/net/net",
60 | "pathName": "pages/net/net",
61 | "query": "",
62 | "scene": null
63 | },
64 | {
65 | "id": -1,
66 | "name": "bleConnect",
67 | "pathName": "pages/bleConnect/bleConnect",
68 | "query": "",
69 | "scene": null
70 | },
71 | {
72 | "id": -1,
73 | "name": "pages /home/home",
74 | "pathName": "pages/home/home",
75 | "query": "",
76 | "scene": null
77 | },
78 | {
79 | "id": -1,
80 | "name": "pages /ticket/ticket",
81 | "pathName": "pages/ticket/ticket",
82 | "query": "",
83 | "scene": null
84 | },
85 | {
86 | "id": -1,
87 | "name": "pages /receipt/receipt",
88 | "pathName": "pages/receipt/receipt",
89 | "query": "",
90 | "scene": null
91 | },
92 | {
93 | "id": -1,
94 | "name": "pages /label/label",
95 | "pathName": "pages/label/label",
96 | "query": "",
97 | "scene": null
98 | }
99 | ]
100 | }
101 | }
102 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/PrinterSDK_20200514/utils/base64.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | var BASE64_MAPPING = [
4 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
5 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
6 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
7 | 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
8 | 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
9 | 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
10 | 'w', 'x', 'y', 'z', '0', '1', '2', '3',
11 | '4', '5', '6', '7', '8', '9', '+', '/'
12 | ];
13 |
14 | /**
15 | *ascii convert to binary
16 | */
17 | var _toBinary = function (ascii) {
18 | var binary = new Array();
19 | while (ascii > 0) {
20 | var b = ascii % 2;
21 | ascii = Math.floor(ascii / 2);
22 | binary.push(b);
23 | }
24 | /*
25 | var len = binary.length;
26 | if(6-len > 0){
27 | for(var i = 6-len ; i > 0 ; --i){
28 | binary.push(0);
29 | }
30 | }*/
31 | binary.reverse();
32 | return binary;
33 | };
34 |
35 | /**
36 | *binary convert to decimal
37 | */
38 | var _toDecimal = function (binary) {
39 | var dec = 0;
40 | var p = 0;
41 | for (var i = binary.length - 1; i >= 0; --i) {
42 | var b = binary[i];
43 | if (b == 1) {
44 | dec += Math.pow(2, p);
45 | }
46 | ++p;
47 | }
48 | return dec;
49 | };
50 |
51 | /**
52 | *unicode convert to utf-8
53 | */
54 | var _toUTF8Binary = function (c, binaryArray) {
55 | var mustLen = (8 - (c + 1)) + ((c - 1) * 6);
56 | var fatLen = binaryArray.length;
57 | var diff = mustLen - fatLen;
58 | while (--diff >= 0) {
59 | binaryArray.unshift(0);
60 | }
61 | var binary = [];
62 | var _c = c;
63 | while (--_c >= 0) {
64 | binary.push(1);
65 | }
66 | binary.push(0);
67 | var i = 0, len = 8 - (c + 1);
68 | for (; i < len; ++i) {
69 | binary.push(binaryArray[i]);
70 | }
71 |
72 | for (var j = 0; j < c - 1; ++j) {
73 | binary.push(1);
74 | binary.push(0);
75 | var sum = 6;
76 | while (--sum >= 0) {
77 | binary.push(binaryArray[i++]);
78 | }
79 | }
80 | return binary;
81 | };
82 |
83 | var __BASE64 = {
84 | /**
85 | *BASE64 Encode
86 | */
87 | encoder: function (str) {
88 | var base64_Index = [];
89 | var binaryArray = [];
90 | for (var i = 0, len = str.length; i < len; ++i) {
91 | var unicode = str.charCodeAt(i);
92 | var _tmpBinary = _toBinary(unicode);
93 | if (unicode < 0x80) {
94 | var _tmpdiff = 8 - _tmpBinary.length;
95 | while (--_tmpdiff >= 0) {
96 | _tmpBinary.unshift(0);
97 | }
98 | binaryArray = binaryArray.concat(_tmpBinary);
99 | } else if (unicode >= 0x80 && unicode <= 0x7FF) {
100 | binaryArray = binaryArray.concat(_toUTF8Binary(2, _tmpBinary));
101 | } else if (unicode >= 0x800 && unicode <= 0xFFFF) {//UTF-8 3byte
102 | binaryArray = binaryArray.concat(_toUTF8Binary(3, _tmpBinary));
103 | } else if (unicode >= 0x10000 && unicode <= 0x1FFFFF) {//UTF-8 4byte
104 | binaryArray = binaryArray.concat(_toUTF8Binary(4, _tmpBinary));
105 | } else if (unicode >= 0x200000 && unicode <= 0x3FFFFFF) {//UTF-8 5byte
106 | binaryArray = binaryArray.concat(_toUTF8Binary(5, _tmpBinary));
107 | } else if (unicode >= 4000000 && unicode <= 0x7FFFFFFF) {//UTF-8 6byte
108 | binaryArray = binaryArray.concat(_toUTF8Binary(6, _tmpBinary));
109 | }
110 | }
111 |
112 | var extra_Zero_Count = 0;
113 | for (var i = 0, len = binaryArray.length; i < len; i += 6) {
114 | var diff = (i + 6) - len;
115 | if (diff == 2) {
116 | extra_Zero_Count = 2;
117 | } else if (diff == 4) {
118 | extra_Zero_Count = 4;
119 | }
120 | //if(extra_Zero_Count > 0){
121 | // len += extra_Zero_Count+1;
122 | //}
123 | var _tmpExtra_Zero_Count = extra_Zero_Count;
124 | while (--_tmpExtra_Zero_Count >= 0) {
125 | binaryArray.push(0);
126 | }
127 | base64_Index.push(_toDecimal(binaryArray.slice(i, i + 6)));
128 | }
129 |
130 | var base64 = '';
131 | for (var i = 0, len = base64_Index.length; i < len; ++i) {
132 | base64 += BASE64_MAPPING[base64_Index[i]];
133 | }
134 |
135 | for (var i = 0, len = extra_Zero_Count / 2; i < len; ++i) {
136 | base64 += '=';
137 | }
138 | return base64;
139 | },
140 | /**
141 | *BASE64 Decode for UTF-8
142 | */
143 | decoder: function (_base64Str) {
144 | var _len = _base64Str.length;
145 | var extra_Zero_Count = 0;
146 | /**
147 | *计算在进行BASE64编码的时候,补了几个0
148 | */
149 | if (_base64Str.charAt(_len - 1) == '=') {
150 | //alert(_base64Str.charAt(_len-1));
151 | //alert(_base64Str.charAt(_len-2));
152 | if (_base64Str.charAt(_len - 2) == '=') {//两个等号说明补了4个0
153 | extra_Zero_Count = 4;
154 | _base64Str = _base64Str.substring(0, _len - 2);
155 | } else {//一个等号说明补了2个0
156 | extra_Zero_Count = 2;
157 | _base64Str = _base64Str.substring(0, _len - 1);
158 | }
159 | }
160 |
161 | var binaryArray = [];
162 | for (var i = 0, len = _base64Str.length; i < len; ++i) {
163 | var c = _base64Str.charAt(i);
164 | for (var j = 0, size = BASE64_MAPPING.length; j < size; ++j) {
165 | if (c == BASE64_MAPPING[j]) {
166 | var _tmp = _toBinary(j);
167 | /*不足6位的补0*/
168 | var _tmpLen = _tmp.length;
169 | if (6 - _tmpLen > 0) {
170 | for (var k = 6 - _tmpLen; k > 0; --k) {
171 | _tmp.unshift(0);
172 | }
173 | }
174 | binaryArray = binaryArray.concat(_tmp);
175 | break;
176 | }
177 | }
178 | }
179 |
180 | if (extra_Zero_Count > 0) {
181 | binaryArray = binaryArray.slice(0, binaryArray.length - extra_Zero_Count);
182 | }
183 |
184 | var unicode = [];
185 | var unicodeBinary = [];
186 | for (var i = 0, len = binaryArray.length; i < len;) {
187 | if (binaryArray[i] == 0) {
188 | unicode = unicode.concat(_toDecimal(binaryArray.slice(i, i + 8)));
189 | i += 8;
190 | } else {
191 | var sum = 0;
192 | while (i < len) {
193 | if (binaryArray[i] == 1) {
194 | ++sum;
195 | } else {
196 | break;
197 | }
198 | ++i;
199 | }
200 | unicodeBinary = unicodeBinary.concat(binaryArray.slice(i + 1, i + 8 - sum));
201 | i += 8 - sum;
202 | while (sum > 1) {
203 | unicodeBinary = unicodeBinary.concat(binaryArray.slice(i + 2, i + 8));
204 | i += 8;
205 | --sum;
206 | }
207 | unicode = unicode.concat(_toDecimal(unicodeBinary));
208 | unicodeBinary = [];
209 | }
210 | }
211 | return unicode;
212 | }
213 | };
214 |
215 | //window.BASE64 = __BASE64;
216 | module.exports = {
217 | CusBASE64: __BASE64
218 | }
219 | })();
220 |
221 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/utils/tsc.js:
--------------------------------------------------------------------------------
1 | var app = getApp();
2 | var encode = require("./encoding.js");
3 | var jpPrinter = {
4 | createNew: function() {
5 | var jpPrinter = {};
6 | var data = "";
7 | var command = []
8 |
9 | jpPrinter.name = "蓝牙打印机";
10 |
11 | jpPrinter.init = function() {};
12 |
13 | jpPrinter.addCommand = function(content) { //将指令转成数组装起
14 | var code = new encode.TextEncoder(
15 | 'gb18030', {
16 | NONSTANDARD_allowLegacyEncoding: true
17 | }).encode(content)
18 | for (var i = 0; i < code.length; ++i) {
19 | command.push(code[i])
20 | }
21 | };
22 | /**
23 | * 该指令用于设定卷标纸的宽度和长度
24 | * 传入参数说明
25 | * pageWidght:标签宽度 单位mm
26 | * pageHeight:标签高度 单位mm
27 | */
28 | jpPrinter.setSize = function(pageWidght, pageHeight) {
29 | data = "SIZE " + pageWidght.toString() + " mm" + "," + pageHeight.toString() + " mm" + "\r\n";
30 | jpPrinter.addCommand(data)
31 | };
32 | /**
33 | * 该指令用于定义两张卷标纸间的垂直间距距离
34 | * 传入参数说明
35 | * 标签间隙 单位mm
36 | */
37 | jpPrinter.setGap = function (printGap) {
38 | data = "GAP " + printGap.toString() + " mm,0 mm\r\n";
39 | jpPrinter.addCommand(data)
40 | };
41 | /**
42 | * 该指令用于设定黑标高度及定义标签印完后标签额外送出的长度
43 | * 传入参数说明
44 | * 黑标高度 单位mm
45 | */
46 | jpPrinter.setBline = function (printBline) {
47 | data = "BLINE " + printBline.toString() + " mm,0 mm\r\n";
48 | jpPrinter.addCommand(data)
49 | };
50 | /**
51 | * 该指令用于控制在剥离模式时(peel-off mode)每张卷标停止的位置,在打印
52 | * 下一张时打印机会将原先多推出或少推出的部分以回拉方式补偿回来。该指令仅
53 | * 适用于剥离模式。
54 | * 传入参数说明
55 | * 纸张停止的距离 单位mm
56 | */
57 | jpPrinter.setOffset = function (offset) {
58 | data = "OFFSET " + offset.toString() + " mm,0 mm\r\n";
59 | jpPrinter.addCommand(data)
60 | };
61 | /**
62 | * 该指令用于控制打印速度
63 | * 传入参数说明
64 | * 1<=printSpeed<=6
65 | * 实际支持速度以自检页为准
66 | */
67 | jpPrinter.setSpeed = function(printSpeed) {
68 | data = "SPEED " + printSpeed.toString() + "\r\n";
69 | jpPrinter.addCommand(data)
70 | };
71 | /**
72 | * 该指令用于控制打印时的浓度
73 | 传入参数说明
74 | * 1<=printDensity<=15
75 | */
76 | jpPrinter.setDensity = function(printDensity) {
77 | data = "DENSITY " + printDensity.toString() + "\r\n";
78 | jpPrinter.addCommand(data)
79 | }
80 |
81 | /**
82 | * 该指令用于定义打印时出纸和打印字体的方向
83 | * 传入参数说明
84 | * direction=0或direction=1
85 | */
86 | jpPrinter.setDirection = function (direction) {
87 | data = "DIRECTION " + direction + "\r\n";
88 | jpPrinter.addCommand(data)
89 | };
90 | /**
91 | * 该指令用于定义卷标的参考坐标原点。坐标原点位置和打印方向有关
92 | * 传入参数说明
93 | * x 水平方向的坐标位置,单位dots
94 | * y 垂直方向的坐标位置,单位dots
95 | * 打印机分辨率200 DPI: 1 mm = 8 dots
96 | * 打印机分辨率300 DPI: 1 mm = 12 dots
97 | */
98 | jpPrinter.setReference = function (x, y) {
99 | data = "REFERENCE " + x + "," + y + "\r\n";
100 | jpPrinter.addCommand(data)
101 | };
102 | /**
103 | * 该指令表示标签打印偏移量多少设置
104 | * 传入参数说明 点数dot
105 | * n 偏移量 ,单位dot 1mm=8 dots
106 | * 打印机分辨率200 DPI: 1 mm = 8 dots
107 | * 打印机分辨率300 DPI: 1 mm = 12 dots
108 | */
109 | jpPrinter.setShift = function (n) {
110 | data = "SHIFT " + n +"\r\n";
111 | jpPrinter.addCommand(data)
112 | };
113 | /**
114 | * 该指令用于选择对应的国际字符集
115 | * 传入参数说明
116 | * 001:USA
117 | * 002:French
118 | * 003:Latin America
119 | * 034:Spanish
120 | * 039:Italian
121 | * 044:United Kingdom
122 | * 046:Swedish
123 | * 047:Norwegian
124 | * 049:German
125 | */
126 | jpPrinter.setCountry = function(country) {
127 | data = "COUNTRY " + country + "\r\n";
128 | jpPrinter.addCommand(data)
129 | };
130 | /**
131 | * 该指令用于选择对应的国际代码页
132 | * 传入参数说明
133 | * 8-bit codepage 字符集代表
134 | * 437:United States
135 | * 850:Multilingual
136 | * 852:Slavic
137 | * 860:Portuguese
138 | * 863:Canadian/French
139 | * 865:Nordic
140 | *
141 | * Windows code page
142 | * 1250:Central Europe
143 | * 1252:Latin I
144 | * 1253:Greek
145 | * 1254:Turkish
146 | *
147 | * 以下代码页仅限于12×24 dot 英数字体
148 | * WestEurope:WestEurope
149 | * Greek:Greek
150 | * Hebrew:Hebrew
151 | * EastEurope:EastEurope
152 | * Iran:Iran
153 | * IranII:IranII
154 | * Latvian:Latvian
155 | * Arabic:Arabic
156 | * Vietnam:Vietnam
157 | * Uygur:Uygur
158 | * Thai:Thai
159 | * 1252:Latin I
160 | * 1257:WPC1257
161 | * 1251:WPC1251
162 | * 866:Cyrillic
163 | * 858:PC858
164 | * 747:PC747
165 | * 864:PC864
166 | * 1001:PC1001
167 | */
168 | jpPrinter.setCodepage = function(codepage) {
169 | data = "CODEPAGE " + codepage + "\r\n";
170 | jpPrinter.addCommand(data)
171 | }
172 | /**
173 | * 该指令用于清除图像缓冲区(image buffer)的数据
174 | */
175 | jpPrinter.setCls = function() {
176 | data = "CLS\r\n";
177 | jpPrinter.addCommand(data)
178 | };
179 | /**
180 | * 该指令用于将标签纸向前推送指定的长度
181 | * 传入参数说明 点数dots
182 | * 打印机分辨率200 DPI:1 mm = 8 dots
183 | * 打印机分辨率300 DPI:1 mm = 12 dots
184 | */
185 | jpPrinter.setFeed = function(feed) {
186 | data = "FEED " + feed + "\r\n";
187 | jpPrinter.addCommand(data)
188 | };
189 | /**
190 | * 该指令用于将标签纸向后回拉指定的长度
191 | * 传入参数说明 点数dots
192 | * 打印机分辨率200 DPI:1 mm = 8 dots
193 | * 打印机分辨率300 DPI:1 mm = 12 dots
194 | */
195 | jpPrinter.setBackFeed = function(backup) {
196 | data = "BACKFEED " + backup + "\r\n";
197 | jpPrinter.addCommand(data)
198 | }
199 | /**
200 | * 该指令用于控制打印机进一张标签纸
201 | */
202 | jpPrinter.setFromfeed = function() {
203 | data = "FORMFEED\r\n";
204 | jpPrinter.addCommand(data)
205 | };
206 | /**
207 | * 在使用含有间隙或黑标的标签纸时,若不能确定第一张标签纸是否在正确打印位
208 | * 置时,此指令可将标签纸向前推送至下一张标签纸的起点开始打印。标签尺寸和
209 | * 间隙需要在本条指令前设置
210 | * 注:使用该指令时,纸张高度大于或等于30 mm
211 | */
212 | jpPrinter.setHome = function() { //根据Size找到下一张标签纸的位置
213 | data = "HOME\r\n";
214 | jpPrinter.addCommand(data)
215 | };
216 | /**
217 | * 该指令用于打印出存储于影像缓冲区内的数据
218 | */
219 | jpPrinter.setPagePrint = function() {
220 | data = "PRINT 1,1\r\n"
221 | jpPrinter.addCommand(data)
222 | };
223 | /**
224 | * 该指令用于打印出存储于影像缓冲区内的数据
225 | * 传入参数说明 打印份数
226 | * 1≤n≤65535
227 | */
228 | jpPrinter.setPrint = function (n) {
229 | data = "PRINT "+n+",1\r\n"
230 | jpPrinter.addCommand(data)
231 | };
232 | /**
233 | * 该指令用于控制蜂鸣器的频率,可设定10 阶的声音,每阶声音的长短由第二个参数控制
234 | * 传入参数说明
235 | * level 音阶:0-9
236 | * interval 间隔时间:1-4095
237 | */
238 | jpPrinter.setSound = function(level, interval) { //控制蜂鸣器
239 | data = "SOUND " + level + "," + interval + "\r\n";
240 | jpPrinter.addCommand(data)
241 | };
242 | /**
243 | * 该指令用于设定打印机进纸时,若经过所设定的长度仍无法侦测到垂直间距,则打印机在连续纸模式工作
244 | * 传入参数说明 点数dots
245 | */
246 | jpPrinter.setLimitfeed = function(limit) { // 检测垂直间距
247 | data = "LIMITFEED " + limit + "mm\r\n";
248 | jpPrinter.addCommand(data)
249 | };
250 | /**
251 | * 打印自检页
252 | */
253 | jpPrinter.setSelfTest=function(){
254 | data = "SELFTEST\r\n";
255 | jpPrinter.addCommand(data)
256 | }
257 | /**
258 | * 该指令用于在标签上画线
259 | * 传入参数说明
260 | * x 线条左上角X 坐标,单位dots
261 | * y 线条左上角Y 坐标,单位dots
262 | * width 线宽,单位dots
263 | * height 线高,单位dots
264 | */
265 | jpPrinter.setBar = function(x, y, width, height) { //绘制线条
266 | data = "BAR " + x + "," + y + "," + width + "," + height + "\r\n"
267 | jpPrinter.addCommand(data)
268 | };
269 | /**
270 | * 该指令用于在卷标上绘制矩形方框
271 | * x_start 方框左上角X 坐标,单位dots
272 | * y_start 方框左上角Y 坐标,单位dots
273 | * x_end 方框右下角X 坐标,单位dots
274 | * y_end 方框右下角Y 坐标,单位dots
275 | * thickness 方框线宽,单位dots
276 | */
277 | jpPrinter.setBox = function (x_start, y_start, x_end, y_end, thickness) {
278 | data = "BOX " + x_start + "," + y_start + "," + x_end + "," + y_end + "," + thickness + "\r\n";
279 | jpPrinter.addCommand(data)
280 | };
281 | /**
282 | * 该指令用来画一维条码
283 | * 传入参数说明
284 | * x 左上角水平坐标起点,以点(dot)表示
285 | * y 左上角垂直坐标起点,以点(dot)表示
286 | * height 条形码高度,以点(dot)表示
287 | *readable 0 表示人眼不可识,1 表示人眼可识
288 | *rotation 条形码旋转角度,顺时针方向 0,90,180,270
289 | * narrow 窄bar 宽度,以点(dots)表示
290 | * wide 宽bar 宽度,以点(dot)表示
291 | * content 打印内容
292 | */
293 | jpPrinter.setBarCode = function (x, y, codetype, height, readable, rotation, narrow, wide, content) {
294 | data = "BARCODE " + x + "," + y + ",\"" + codetype + "\"," + height + "," + readable + "," + rotation + "," + narrow + "," + wide + ",\"" + content + "\"\r\n"
295 | jpPrinter.addCommand(data)
296 | };
297 |
298 | /**
299 | * 打印图片(单色图片)
300 | * res为画布参数
301 | */
302 | jpPrinter.setBitmap = function (x, y, mode, res) {
303 | console.log(res)
304 | var w = res.width;
305 | var h = res.height;
306 | var bitw = parseInt((w + 7) / 8) * 8;
307 | // var bitw = (parseInt(w) % 8) == 0 ? (parseInt(w) / 8) :( parseInt(w) / 8+1);
308 | var pitch = parseInt(bitw / 8);
309 | var bits = new Uint8Array(h * pitch);
310 | console.log("w=" + w + ", h=" + h + ", bitw=" + bitw + ", pitch=" + pitch + ", bits=" + bits.length);
311 | var cmd = "BITMAP " + x + "," + y + "," + pitch + "," + h + "," + mode + ",";
312 | console.log("add cmd: " + cmd);
313 | jpPrinter.addCommand(cmd);
314 | // for (var i=0; i> (x % 8));
322 | }
323 | }
324 | }
325 | for (var i = 0; i < bits.length; i++) {
326 | command.push((~bits[i]) & 0xFF);
327 | }
328 | console.log(command);
329 | };
330 |
331 | /**
332 | * 将指定的区域反相打印
333 | * 传入参数说明
334 | * x_start 反相区域左上角X 坐标,单位dot
335 | * y_start 反相区域左上角Y 坐标,单位dot
336 | * x_width 反相区域宽度,单位dot
337 | * y_height 反相区域高度,单位dot
338 | */
339 | jpPrinter.setErase = function(x_start, y_start, x_width, y_height) {
340 | data = "ERASE " + x_start + "," + y_start + "," + x_width + "," + y_height + "\r\n";
341 | jpPrinter.addCommand(data)
342 | };
343 | /**
344 | * 将指定的区域反相打印
345 | * 传入参数说明
346 | * x_start 反相区域左上角X 坐标,单位dot
347 | * y_start 反相区域左上角Y 坐标,单位dot
348 | * x_width 反相区域宽度,单位dot
349 | * y_height 反相区域高度,单位dot
350 | */
351 | jpPrinter.setReverse = function(x_start, y_start, x_width, y_height) {
352 | data = "REVERSE " + x_start + "," + y_start + "," + x_width + "," + y_height + "\r\n";
353 | jpPrinter.addCommand(data)
354 | };
355 | /**
356 | * 该指令用于打印字符串
357 | * 传入参数说明
358 | * x 文字X 方向起始点坐标
359 | * y 文字Y 方向起始点坐标
360 | * font 字体名称
361 | * 1 8×12 dot 英数字体
362 | * 2 12×20 dot 英数字体
363 | * 3 16×24 dot 英数字体
364 | * 4 24×32 dot 英数字体
365 | * 5 32×48 dot 英数字体
366 | * 6 14×19 dot 英数字体OCR-B
367 | * 7 21×27 dot 英数字体OCR-B
368 | * 8 14×25 dot 英数字体OCR-A
369 | * 9 9×17 dot 英数字体
370 | * 10 12×24 dot 英数字体
371 | * TSS16.BF2 简体中文16×16(GB 码)
372 | * TSS20.BF2 简体中文20×20(GB 码)
373 | * TST24.BF2 繁体中文24×24(大五码)
374 | * TSS24.BF2 简体中文24×24(GB 码)
375 | * K 韩文24×24Font(KS 码)
376 | * TSS32.BF2 简体中文32×32(GB 码)
377 | * rotation 文字旋转角度(顺时针方向) 0, 90, 180, 270
378 | */
379 | jpPrinter.setText = function(x, y, font, rotation,x_, y_, str) {
380 | data = "TEXT " + x + "," + y + ",\"" + font + "\"," + rotation + "," + x_ + "," + y_ + "," + "\"" + str + "\"\r\n"
381 | jpPrinter.addCommand(data)
382 | };
383 | /**
384 | * 该指令用来打印二维码
385 | * x 二维码水平方向起始点坐标
386 | * y 二维码垂直方向起始点坐标
387 | * ECC level 选择QRCODE 纠错等级
388 | * L 7%
389 | * M 15%
390 | * Q 25%
391 | * H 30%
392 | * cell width 二维码宽度1-10
393 | * mode 手动/自动编码
394 | * A Auto
395 | * M Manual
396 | * rotation 旋转角度(顺时针方向) 0,90,180,270
397 | * content 内容
398 | */
399 | jpPrinter.setQrcode = function(x, y, level, width, mode, content) {
400 | data = "QRCODE " + x + "," + y + "," + level + "," + width + "," + mode + "," + 0 + ",\"" + content +"\"\r\n"
401 | jpPrinter.addCommand(data)
402 | };
403 | /**
404 | * 该指令用来起动Key1 的预设功能
405 | * 传入参数说明
406 | * ON 开启按键
407 | * OFF 关闭按键
408 | */
409 | jpPrinter.setKey1=function(n){
410 | data = "SET KYE1 "+n.toString+"\r\n"
411 | jpPrinter.addCommand(data)
412 | };
413 | /**
414 | * 该指令用来起动Key2 的预设功能
415 | * 传入参数说明
416 | * ON 开启按键
417 | * OFF 关闭按键
418 | */
419 | jpPrinter.setKey2 = function (n) {
420 | data = "SET KYE2 " + n.toString + "\r\n"
421 | jpPrinter.addCommand(data)
422 | };
423 | /**
424 | * 该指令用来启动/关闭剥离模式,默认值为关闭
425 | * 传入参数说明
426 | * ON 起动剥离模式
427 | * OFF 关闭剥离模式
428 | */
429 | jpPrinter.setPeel = function (n) {
430 | data = "SET PEEL " + n.toString + "\r\n"
431 | jpPrinter.addCommand(data)
432 | };
433 | /**
434 | * 此命令是用来启用/禁用撕纸位置走到撕纸处,此设置关掉电源后将保存在打印机内
435 | * 传入参数说明
436 | * ON 启用撕纸位置走到撕纸处
437 | * OFF 禁用撕纸位置走到撕纸处,命令在起始位置有效
438 | */
439 | jpPrinter.setTear = function (n) {
440 | data = "SET TEAR " + n.toString + "\r\n"
441 | jpPrinter.addCommand(data)
442 | };
443 | /**
444 | * 此命令是用来启用/禁用撕纸位置走到撕纸处,此设置关掉电源后将保存在打印机内
445 | * 传入参数说明
446 | * ON 启用撕纸位置走到撕纸处
447 | * OFF 禁用撕纸位置走到撕纸处,命令在起始位置有效
448 | */
449 | jpPrinter.setStripper = function (n) {
450 | data = "SET STRIPPER " + n.toString + "\r\n"
451 | jpPrinter.addCommand(data)
452 | };
453 | /**
454 | * 此设置用于启用/禁用打印头合盖传感器。如果禁用合盖传感器,打印机头被打开时,将不会传回错误信息。
455 | * 此设置将保存在打印机内存。
456 | * 传入参数说明
457 | * ON 启用打印头合盖传感器
458 | * OFF 禁用打印头合盖传感器
459 | */
460 | jpPrinter.setHead = function (n) {
461 | data = "SET HEAD " + n.toString + "\r\n"
462 | jpPrinter.addCommand(data)
463 | };
464 | /**
465 | * 此命令将禁用/启用标签机在无纸或开盖错误发生后,上纸或合盖后重新打印一次标签内容
466 | * 传入参数说明
467 | * OFF 禁止此功能
468 | * ON 启用此功能
469 | */
470 | jpPrinter.setReprint = function (n) {
471 | data = "SET REPRINT " + n.toString + "\r\n"
472 | jpPrinter.addCommand(data)
473 | };
474 |
475 | /**
476 | * 设定开启/关闭碳带感应器,即切换热转式/热感印式打印。通常打印机于开启电
477 | *源时,碳带感应器即会自动检测打印机是否已装上碳带,并藉此决定使用热感式
478 | *或热转式打印。此项设定并不会存于打印机中。此方法仅适用于热转式机器。
479 | * 传入参数说明
480 | * OFF 禁止此功能
481 | * ON 启用此功能
482 | */
483 | jpPrinter.setRibbon = function (n) {
484 | data = "SET RIBBON " + n.toString + "\r\n"
485 | jpPrinter.addCommand(data)
486 | };
487 | /**
488 | * 此命令用于设置切刀状态,关闭打印机电源后,该设置将会被存储在打印机内存中。
489 | * 传入参数说明
490 | * OFF 关闭切刀功能
491 | * BATCH 在PRINT 命令结束后切纸
492 | * pieces 0-65535,用于设置每几个标签进行切纸
493 | */
494 | jpPrinter.setCut = function (n) {
495 | data = "SET CUTTER " + n.toString + "\r\n"
496 | jpPrinter.addCommand(data)
497 | };
498 | //获取打印数据
499 | jpPrinter.getData = function() {
500 | return command;
501 | };
502 | return jpPrinter;
503 | }
504 | };
505 |
506 | module.exports.jpPrinter = jpPrinter;
--------------------------------------------------------------------------------
/PrinterSDK_20200514/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/PrinterSDK_20200514/佳博标签打印机编程手册tspl v1.0.8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sbcdyb123/BluetoothPrinter-miniprogram-uniapp/97f98549ad2285649a4fcc7b82686449db0fb5b3/PrinterSDK_20200514/佳博标签打印机编程手册tspl v1.0.8.pdf
--------------------------------------------------------------------------------