1
This commit is contained in:
@@ -358,6 +358,17 @@ type RiderRealPhoneNumberInfo struct {
|
||||
RiderRealPhoneNumber string `json:"rider_real_phone_number"` // 骑手真实手机号
|
||||
}
|
||||
|
||||
// GetRiderDeliveryPath 获取骑手坐标
|
||||
type GetRiderDeliveryPath struct {
|
||||
//Code int64 `json:"code"`
|
||||
//Msg string `json:"msg"`
|
||||
//Data []struct {
|
||||
Longitude int `json:"longitude"`
|
||||
Latitude int `json:"latitude"`
|
||||
Time int64 `json:"time"`
|
||||
//} `json:"data"`
|
||||
}
|
||||
|
||||
func (a *API) OrderReceived(orderID int64) (err error) {
|
||||
_, err = a.AccessAPI("order/poi_received", true, map[string]interface{}{
|
||||
KeyOrderID: orderID,
|
||||
@@ -570,6 +581,27 @@ func (a *API) OrderLogisticsStatus(orderID int64) (status *utils.RiderInfo, err
|
||||
return logistics, err
|
||||
}
|
||||
|
||||
func (a *API) GetDeliveryPath(orderId int64, appPoiCode string) (lng, lat int, err error) {
|
||||
result, err := a.AccessAPI("order/getDeliveryPath", true, map[string]interface{}{
|
||||
KeyOrderID: orderId,
|
||||
KeyAppPoiCode: appPoiCode,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
if result == nil {
|
||||
return 0, 0, nil
|
||||
}
|
||||
|
||||
path, _ := json.Marshal(result)
|
||||
riderPath := make([]*GetRiderDeliveryPath, 0, 0)
|
||||
if err := json.Unmarshal(path, &riderPath); err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil
|
||||
}
|
||||
|
||||
// OrderLogisticsFee 获取订单配送费
|
||||
func (a *API) OrderLogisticsFee(orderID int64) (payFee float64, err error) {
|
||||
result, err := a.AccessAPI("order/logistics/status", true, map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user