Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes-pad
Commits
55eea5b0
Commit
55eea5b0
authored
Aug 05, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试蓝牙打印
parent
e06cf83d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
42 deletions
+14
-42
$u.mixin.js
store/$u.mixin.js
+14
-42
No files found.
store/$u.mixin.js
View file @
55eea5b0
...
...
@@ -134,49 +134,21 @@ module.exports = {
this
.
$u
.
toast
(
'请绑定打印机'
);
return
;
}
await
CTPL
.
init
();
await
CTPL
.
discovery
(
(
res
)
=>
{
if
(
res
.
name
===
'CT-428D'
)
{
this
.
device
=
res
console
.
log
(
this
.
device
)
}
});
const
$this
=
this
setTimeout
(()
=>
{
CTPL
.
connect
(
$this
.
device
,
function
success
(
res1
)
{
console
.
log
(
'扫描到的打印机'
,
res1
)
CTPL
.
setSize
(
$this
.
pageObj
.
width
,
$this
.
pageObj
.
height
)
CTPL
.
clearCache
()
$this
.
getImageData
((
response
)
=>
{
console
.
log
(
'response'
,
response
)
const
imageRes
=
response
// CTPL.drawBitMap(
// 0,
// 0,
// imageRes.width,
// imageRes.height,
// 0,
// response.data
// )
// CTPL.setPrintCopies(1, 1)
// CTPL.execute((res) => {
// console.log('res', res)
// })
})
},
function
fail
(
e
)
{
console
.
log
(
'报错'
,
e
)
if
(
this
.
vuex_printConnect
)
{
this
.
$u
.
api
.
getPrintDown
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
getApp
().
globalData
.
printSocket
.
emit
(
'news'
,
{
client
:
null
,
printer
:
this
.
vuex_printerInfo
.
printerName
,
type
:
'url_pdf'
,
// pdf_path: 'http://192.168.3.91:8082/static/123.pdf',
pdf_path
:
res
.
fileUrl
,
});
}
)
uni
.
onBLEConnectionStateChange
(
function
(
res
)
{
console
.
log
(
'sadsada'
,
res
)
})
},
6000
)
return
});
}
else
{
this
.
$u
.
toast
(
'打印机连接失败'
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment