This commit is contained in:
suyl
2021-08-02 17:16:15 +08:00
parent a441c28bf5
commit 5231be8236
2 changed files with 44 additions and 12 deletions

View File

@@ -68,6 +68,7 @@ const (
hexSignQrEnd = "000a1b40" //000a0a0a1b40
hexSignSound = "1d6b40"
//起始标签
byteSignBR = "3c62723e" //换行
byteSignCenter = "3c63656e7465723e" //居中
byteSignLeft = "3c6c6566743e" //居左
@@ -80,6 +81,7 @@ const (
byteSignQrRight = "3c7172723e"
byteSignSound = "3c736f756e643e"
//结束标签
byteSignCenterE = "3c2f63656e7465723e" //居中
byteSignLeftE = "3c2f6c6566743e" //居左
byteSignRightE = "3c2f72696768743e" //居右
@@ -106,7 +108,7 @@ var (
regexpQrr = regexp.MustCompile(byteSignQrRight + "(.*?)" + byteSignQrRightE)
regexpSound = regexp.MustCompile(byteSignSound + "(.*?)" + byteSignSoundE)
timeoutChan = make(chan int, 10)
timeoutChan = make(chan int)
)
type PrintInfo struct {
@@ -326,6 +328,7 @@ func changePrinterStatus(printNo string, status int) {
}
}
//按打印机方提供的文档来的
func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) {
var (
content = printMsg.Content
@@ -349,6 +352,7 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) {
return jxutils.Hextob(dataStr + check), err
}
//替换特殊字符上面那个hextob转不了先替换一下
func replaceContentOther(content string) string {
return strings.ReplaceAll(content, "⃣️", " ")
}