- 调整网络打印机的打印格式
This commit is contained in:
@@ -193,6 +193,10 @@ func IntPrice2StandardString(value int64) string {
|
||||
return fmt.Sprintf("%.2f", IntPrice2Standard(value))
|
||||
}
|
||||
|
||||
func IntPrice2StandardCurrencyString(value int64) string {
|
||||
return fmt.Sprintf("¥%.2f", IntPrice2Standard(value))
|
||||
}
|
||||
|
||||
func CallMsgHandler(handler func(), primaryID string) {
|
||||
routinePool.CallFun(func() {
|
||||
handler()
|
||||
|
||||
@@ -62,7 +62,7 @@ func GetFeieOrderContent(order *model.GoodsOrder, storeTel string) (content stri
|
||||
<BOLD>实际支付:</BOLD>%.2f<BR>
|
||||
<BR>
|
||||
商品明细: <BR>
|
||||
品名 数量 单价 小计
|
||||
品名 数量 单价 小计
|
||||
--------------------------------<BR>`
|
||||
orderParams := []interface{}{
|
||||
utils.Time2Str(order.OrderCreatedAt),
|
||||
@@ -80,8 +80,8 @@ func GetFeieOrderContent(order *model.GoodsOrder, storeTel string) (content stri
|
||||
|
||||
for _, sku := range order.Skus {
|
||||
orderFmt += `%s<BR>`
|
||||
orderFmt += `%10d%10.2f%10.2f<BR>`
|
||||
orderParams = append(orderParams, sku.SkuName, sku.Count, jxutils.IntPrice2Standard(sku.SalePrice), jxutils.IntPrice2Standard(sku.SalePrice*int64(sku.Count)))
|
||||
orderFmt += `%10s%10s%10s<BR>`
|
||||
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
|
||||
}
|
||||
orderFmt += `<BR>
|
||||
<BOLD>共%d种%d件商品</BOLD>
|
||||
|
||||
Reference in New Issue
Block a user