This commit is contained in:
richboo111
2023-04-25 10:39:28 +08:00
57 changed files with 1242 additions and 260 deletions

View File

@@ -47,6 +47,7 @@ func NotifyNewOrder(order *model.GoodsOrder) {
msg.OrderSqs = utils.Int2Str(order.OrderSeq)
msg.StoreTitle = storeDetail.Name
msg.Context = "老板,你有新的订单了!"
msg.VendorOrderId = order.VendorOrderID
context, _ := json.Marshal(msg)
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs)
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder)
@@ -175,11 +176,12 @@ func GetStoreBoosCID(storeId int) ([]string, error) {
}
type MsgContext struct {
MsgType string `json:"msg_type"` // 订单类型[新订单/售后单/取消单]
StoreTitle string `json:"store_title"` // 门店名称
Context string `json:"context"` // 消息文本
VendorName string `json:"vendor_name"` // 平台名称
OrderSqs string `json:"order_sqs"` // 订单流水号
MsgType string `json:"msg_type"` // 订单类型[新订单/售后单/取消单]
StoreTitle string `json:"store_title"` // 门店名称
Context string `json:"context"` // 消息文本
VendorName string `json:"vendor_name"` // 平台名称
OrderSqs string `json:"order_sqs"` // 订单流水号
VendorOrderId string `json:"vendor_order_id"` // 订单id
}
func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, body string, soundsFileName string) {