- enable elm user urge order.

- delay 4 minutes when got new elm order.
This commit is contained in:
gazebo
2018-07-11 09:12:46 +08:00
parent c6a3066daf
commit ac2d4214e5
2 changed files with 8 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package controller
import (
"strings"
"time"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi/elmapi"
@@ -56,7 +57,9 @@ func (o *OrderController) OrderMessage(msg *elmapi.CallbackMsg) (retVal *elmapi.
func OnNewOrder(orderID string, userMobile string) {
controllers.OnNewOrder(orderID, controllers.ELM_VENDORID, userMobile, 0, nil, func(acceptIt bool) {
if acceptIt {
api.ElmAPI.ConfirmOrder(orderID)
time.AfterFunc(4*time.Minute, func() {
api.ElmAPI.ConfirmOrder(orderID)
})
} else {
api.ElmAPI.CancelOrder(orderID, elmapi.CancelOrderTypeOthers, "")
}