This commit is contained in:
邹宗楠
2023-03-21 17:46:15 +08:00
parent 10ad46ea29
commit 8394029380

View File

@@ -16,9 +16,9 @@ import (
)
const (
SoundsFileNewOrder = "pushsound.caf"
SoundsFileNewAfsOrder = "pushsound.caf"
SoundsFileNewCancelOrder = "pushsound.caf"
SoundsFileNewOrder = "newOrder.caf"
SoundsFileNewAfsOrder = "afsOrder.caf"
SoundsFileNewCancelOrder = "cancelOrder.caf"
)
// NotifyNewOrder 推送新订单
@@ -46,7 +46,7 @@ func NotifyNewOrder(order *model.GoodsOrder) {
msg.StoreTitle = storeDetail.Name
msg.Context = "老板,你有新的订单了!"
context, _ := json.Marshal(msg)
body := msg.Context + model.VendorChineseNames[order.VendorID] + "#" + msg.OrderSqs
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs)
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder)
}
@@ -74,7 +74,7 @@ func NotifyAfsOrder(afsOrder *model.AfsOrder) (err error) {
msg.StoreTitle = storeDetail.Name
msg.Context = "老板订单申请退款了!"
context, _ := json.Marshal(msg)
body := msg.Context + model.VendorChineseNames[afsOrder.VendorID] + "#" + msg.OrderSqs
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[afsOrder.VendorID]+"#"+msg.OrderSqs)
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewAfsOrder)
return err
}
@@ -103,7 +103,7 @@ func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
msg.StoreTitle = storeDetail.Name
msg.Context = "老板订单被取消了!"
context, _ := json.Marshal(msg)
body := msg.Context + model.VendorChineseNames[order.VendorID] + "#" + msg.OrderSqs
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs)
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewCancelOrder)
return err
}