package tiktok_api

const CallbackShipmentInfoChange = "15000" //小时达运力状态变更标识

const (
	DispatcherFeeTypeCall   = 1 //呼叫运力
	DispatcherFeeTypeCancel = 2 //取消运力

	InquiryTypeDelivery = 1 //配送 默认
	InquiryTypeCancel   = 2 //取消
	//抖音运力相关常量
	ServiceTypeCallNow   = 0       //立即呼叫(用户支付成功节点)
	ServiceTypeDelayCall = 1       //延迟呼叫[1-15]min
	AutoCallRiderOpen    = "open"  //开启自动呼叫运力
	AutoCallRiderClose   = "close" //关闭自动呼叫运力
	AutoCallDelayTime15  = 15      //默认延后15分钟
	ServiceStatusClose   = 1       //自动呼叫运力设置关闭
	ServiceStatusOpen    = 2       //自动呼叫运力设置开启

	ShipmentTypeInvoice     = 1 //发货单
	ShipmentTypeVisitInDoor = 2 //上门取

)

const (
	ShipmentStatusCalling    = 101
	ShipmentStatusReceived   = 102
	ShipmentStatusArrived    = 103
	ShipmentStatusDelivering = 104
	ShipmentStatusRejected   = 5
	ShipmentStatusReturning  = 6
	ShipmentStatusReturned   = 7
	ShipmentStatusDelivered  = 200
	ShipmentStatusCanceled   = 300
)

var ShipmentStatus = map[int64]string{
	ShipmentStatusCalling:    "骑手呼叫中",
	ShipmentStatusReceived:   "骑手已接单",
	ShipmentStatusArrived:    "骑手已到取货点",
	ShipmentStatusDelivering: "骑手配送中",
	ShipmentStatusRejected:   "收货人已拒收",
	ShipmentStatusReturning:  "返回中",
	ShipmentStatusReturned:   "返回完成",
	ShipmentStatusDelivered:  "订单妥投",
	ShipmentStatusCanceled:   "订单取消",
}

const (
	ShipmentErrorMerchantDeliverSlow     = 1001
	ShipmentErrorMerchantDeliverError    = 1002
	ShipmentErrorMerchantStockOut        = 1003
	ShipmentErrorGoodsDamaged            = 2001
	ShipmentErrorGoodsLost               = 2002
	ShipmentErrorRiderWrongGoods         = 2003
	ShipmentErrorRiderUndeliverable      = 2004
	ShipmentErrorWrongReceiptCode        = 3001
	ShipmentErrorMerchantWrongAddress    = 3002
	ShipmentErrorConsumerWrongAddress    = 3003
	ShipmentErrorWeightDeviationTooLarge = 3004
	ShipmentErrorConsumerCallNoAnswer    = 4002
	ShipmentErrorConsumerStayOut         = 4003
	ShipmentErrorConsumerModifyAddress   = 4004
	ShipmentErrorOther                   = 5001
)

var ShipmentError = map[int]string{
	ShipmentErrorMerchantDeliverSlow:     "商家出货慢",
	ShipmentErrorMerchantDeliverError:    "商家出错货",
	ShipmentErrorMerchantStockOut:        "商家缺货",
	ShipmentErrorGoodsDamaged:            "破损",
	ShipmentErrorGoodsLost:               "丢失",
	ShipmentErrorRiderWrongGoods:         "骑手取错货",
	ShipmentErrorRiderUndeliverable:      "骑手无法送达",
	ShipmentErrorWrongReceiptCode:        "小票码错误",
	ShipmentErrorMerchantWrongAddress:    "商家地址错误",
	ShipmentErrorConsumerWrongAddress:    "消费者地址错误",
	ShipmentErrorWeightDeviationTooLarge: "订单重量偏差过大",
	ShipmentErrorConsumerCallNoAnswer:    "消费者电话未接通",
	ShipmentErrorConsumerStayOut:         "消费者不在家",
	ShipmentErrorConsumerModifyAddress:   "消费者线下联系修改地址",
	ShipmentErrorOther:                   "其他",
}

//小时达运力状态变更消息体
type ShipmentInfoData struct {
	RiderPhone  string `json:"rider_phone"`   //骑手电话
	RiderLng    string `json:"rider_lng"`     //骑手经度
	RiderLat    string `json:"rider_lat"`     //骑手纬度
	OperateTime string `json:"operate_time"`  //状态变更时间
	ShopID      int64  `json:"shop_id"`       //抖店门店ID
	RiderName   string `json:"rider_name"`    //骑手名称
	CancelCode  int64  `json:"cancel_code"`   //取消原因
	ShopOrderID int64  `json:"shop_order_id"` //店铺订单号
	Status      int64  `json:"status"`        //运力状态
	//AfterSaleID    int64  `json:"aftersale_id"`    //上门取运力对应售后单号
	//TrackNo        string `json:"track_no"`        //骑手配送运单号
	//RiderName      string `json:"rider_name"`      //骑手名称
	//RiderPhone     string `json:"rider_phone"`     //骑手电话
	//RiderLatitude  string `json:"rider_latitude"`  //骑手坐标纬度
	//RiderLongitude string `json:"rider_longitude"` //骑手坐标经度
	//ShopOrderID    int64  `json:"shop_order_id"`   //店铺订单号
	//ShopID         int64  `json:"shop_id"`         //抖店门店ID
	//ShipmentStatus int64  `json:"shipment_status"` //运单状态
	//OccurredTime   string `json:"occurred_time"`   //当前状态变更时间
}
