- 将“京西菜市”常量尽量替换为配置变量

This commit is contained in:
gazebo
2019-05-15 17:09:23 +08:00
parent e395c7c891
commit 2d3ed62d15
8 changed files with 30 additions and 18 deletions

View File

@@ -33,7 +33,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour)
}
orderFmt := `
<CB>京西菜市</CB><BR><BR>
<CB>%s</CB><BR><BR>
<C>手机买菜上京西</C><BR>
<C>极速到家送惊喜</C><BR>
--------------------------------<BR>
@@ -59,6 +59,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
品名 数量 单价 小计<BR>
--------------------------------<BR>`
orderParams := []interface{}{
globals.StoreName,
utils.Time2Str(order.OrderCreatedAt),
utils.Time2Str(expectedDeliveryTime),
order.VendorOrderID,
@@ -84,7 +85,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<C><L><BOLD>商品质量问题请联系:</BOLD></L><BR></C>
<C><L><BOLD>%s:%s</BOLD></L><BR></C><BR>
<BR>
更多信息请关注官方微信: 京西菜市<BR>
更多信息请关注官方微信: %s<BR>
<BR>
<BR><BR>
--------------------------------<BR>
@@ -92,7 +93,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
<BR><BR>
`
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, order.StoreName, storeTel)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, order.StoreName, storeTel, globals.StoreName)
return fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...)
}