- add changePriceType to model.Store
- send weixin msg when op request handled.
This commit is contained in:
@@ -18,6 +18,7 @@ const (
|
||||
// WX_TO_ORDER_PAGE_URL = "http://www.jxc4.com/jx/h5/#/?jxStoreId="
|
||||
// WX_TO_SHOW_COMMENTS_DETAIL_URL = "http://www.jxc4.com/jx/h5/#/assess-list?jxStoreId=" //展示差评详情的页面
|
||||
WX_TO_ORDER_PAGE_URL = "http://wx.jxc4.com/#/?jxStoreId="
|
||||
WX_TO_STORE_SKU_PAGE_URL = "http://wx.jxc4.com/#/shop?jxStoreId="
|
||||
WX_TO_SHOW_COMMENTS_DETAIL_URL = "http://wx.jxc4.com/#/assess-list?jxStoreId=" //展示差评详情的页面
|
||||
//新订单模板消息文字颜色
|
||||
WX_NEW_ORDER_TEMPLATE_COLOR = "#173177"
|
||||
@@ -289,6 +290,53 @@ func NotifySaleBill(storeID int, fileURL string) (err error) {
|
||||
return SendMsgToStore(storeID, WX_SALE_BILL_TEMPLATE_ID, fileURL, data)
|
||||
}
|
||||
|
||||
func NotifyStoreOpRequestStatus(isAccepted bool, storeID, nameID int, spuName string, originalUnitPrice, unitPrice int, rejectReason string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyStoreOpRequestStatus isAccepted:%t, storeID:%d, nameID:%d, spuName:%s, originalUnitPrice:%d, unitPrice:%d, rejectReason:%s", isAccepted, storeID, nameID, spuName, originalUnitPrice, unitPrice, rejectReason)
|
||||
templateID := ""
|
||||
fileURL := fmt.Sprintf("%s%d", WX_TO_STORE_SKU_PAGE_URL, storeID)
|
||||
data := make(map[string]interface{})
|
||||
if isAccepted {
|
||||
templateID = "gIG2olBZtQbjXmp6doNB_dESu60By5xuXYOGxksLv3Y"
|
||||
data = map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
"value": fmt.Sprintf("%s%s元,修改为%s元,已经通过审核。^_^", spuName, jxutils.IntPrice2StandardString(int64(originalUnitPrice)), jxutils.IntPrice2StandardString(int64(unitPrice))),
|
||||
"color": "#333333",
|
||||
},
|
||||
"keyword1": map[string]interface{}{
|
||||
"value": "审核通过",
|
||||
"color": "#2E408E",
|
||||
},
|
||||
"keyword2": map[string]interface{}{
|
||||
"value": utils.Time2Str(time.Now()),
|
||||
"color": "#2E408E",
|
||||
},
|
||||
"remark": map[string]interface{}{
|
||||
"value": "点击查看详情",
|
||||
},
|
||||
}
|
||||
} else {
|
||||
templateID = "tn2QXWi4HtSIwaztmtN6Bb2uzNL-jBxWltCZTDNJuYE"
|
||||
data = map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
"value": fmt.Sprintf("您好!抱歉的通知您。%s%s元,修改为%s元,未通过审核。原因:%s", spuName, jxutils.IntPrice2StandardString(int64(originalUnitPrice)), jxutils.IntPrice2StandardString(int64(unitPrice)), rejectReason),
|
||||
"color": "#E80000",
|
||||
},
|
||||
"keyword1": map[string]interface{}{
|
||||
"value": "1",
|
||||
"color": "#2E408E",
|
||||
},
|
||||
"keyword2": map[string]interface{}{
|
||||
"value": utils.Time2Str(time.Now()),
|
||||
"color": "#2E408E",
|
||||
},
|
||||
"remark": map[string]interface{}{
|
||||
"value": "请您及时到商品管理修改价格,修改后请重新提交。",
|
||||
},
|
||||
}
|
||||
}
|
||||
return SendMsgToStore(storeID, templateID, fileURL, data)
|
||||
}
|
||||
|
||||
func FormatDeliveryTime(order *model.GoodsOrder) string {
|
||||
var tmpTime time.Time
|
||||
if order.ExpectedDeliveredTime == utils.DefaultTimeValue {
|
||||
|
||||
Reference in New Issue
Block a user