aa
This commit is contained in:
@@ -176,15 +176,11 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PrinterHandler) getOrderContentByTemplate(order *model.GoodsOrder, storeTel string, storeDetail *dao.StoreDetail) (content string) {
|
func (c *PrinterHandler) getOrderContentByTemplate(order *model.GoodsOrder, storeTel string, storeDetail *dao.StoreDetail) (content string) {
|
||||||
orderParams := []interface{}{}
|
|
||||||
orderFmt := ""
|
orderFmt := ""
|
||||||
if storeDetail != nil {
|
if storeDetail != nil {
|
||||||
//开头加上语音
|
//开头加上语音
|
||||||
if storeDetail.PrinterSound != "" {
|
if storeDetail.PrinterSound != "" {
|
||||||
orderFmt += `
|
orderFmt += "<sound>" + storeDetail.PrinterSound + "</sound><br>"
|
||||||
<sound>%s</sound><br>
|
|
||||||
`
|
|
||||||
orderParams = append(orderParams, storeDetail.PrinterSound)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//把带有${}的变量换成实际值
|
//把带有${}的变量换成实际值
|
||||||
@@ -233,11 +229,12 @@ func (c *PrinterHandler) getOrderContentByTemplate(order *model.GoodsOrder, stor
|
|||||||
skuParams = append(skuParams, jxutils.IntPrice2StandardCurrencyString(order.Skus[i].SalePrice))
|
skuParams = append(skuParams, jxutils.IntPrice2StandardCurrencyString(order.Skus[i].SalePrice))
|
||||||
skuParams = append(skuParams, jxutils.IntPrice2StandardCurrencyString(order.Skus[i].SalePrice*int64(order.Skus[i].Count)))
|
skuParams = append(skuParams, jxutils.IntPrice2StandardCurrencyString(order.Skus[i].SalePrice*int64(order.Skus[i].Count)))
|
||||||
}
|
}
|
||||||
template = strings.ReplaceAll(template, v[0], fmt.Sprintf(skus, skuParams))
|
skus = fmt.Sprintf(skus, skuParams...)
|
||||||
|
template = strings.ReplaceAll(template, v[0], skus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
orderFmt += template
|
orderFmt += template
|
||||||
return fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...)
|
return strings.Replace(orderFmt, "\n", "", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user