96 lines
4.1 KiB
Go
96 lines
4.1 KiB
Go
package mtwmapi
|
|
|
|
import (
|
|
"fmt"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
type DistributeOrderDetail struct {
|
|
WmOrderID int `json:"wm_order_id"`
|
|
WmPoiID int `json:"wm_poi_id"`
|
|
LogisticsStatus int `json:"logistics_status"`
|
|
LogisticsCode string `json:"logistics_code"`
|
|
LogisticsID int `json:"logistics_id"`
|
|
LogisticsName string `json:"logistics_name"`
|
|
PoiShippingFee float64 `json:"poi_shipping_fee"`
|
|
TipAmount float64 `json:"tip_amount"`
|
|
SelfDispatch int `json:"self_dispatch"`
|
|
DispatchCancelAllow int `json:"dispatch_cancel_allow"`
|
|
DispatcherName string `json:"dispatcher_name"`
|
|
DispatcherPhone interface{} `json:"dispatcher_phone"`
|
|
OrgLeaderPhone interface{} `json:"org_leader_phone"`
|
|
OrgEmergencyPhone interface{} `json:"org_emergency_phone"`
|
|
LatestDeliveryTime int `json:"latest_delivery_time"`
|
|
WaitingTime int `json:"waiting_time"`
|
|
IsThirdPartShipping int `json:"is_third_part_shipping"`
|
|
ThirdPartShippingName interface{} `json:"third_part_shipping_name"`
|
|
ThirdPartShippingPhone interface{} `json:"third_part_shipping_phone"`
|
|
IsKS int `json:"isKS"`
|
|
DispatchTeam interface{} `json:"dispatchTeam"`
|
|
HhKS bool `json:"hhKS"`
|
|
PreCheckJuHeMsg interface{} `json:"preCheckJuHeMsg"`
|
|
HasJuheAndZB bool `json:"hasJuheAndZB"`
|
|
PtGray int `json:"ptGray"`
|
|
ShippingFeeDetailVo interface{} `json:"shippingFeeDetailVo"`
|
|
AssignTime int `json:"assignTime"`
|
|
AssignDegrade bool `json:"assignDegrade"`
|
|
CurrentTime int `json:"currentTime"`
|
|
SubLogisticsCode int `json:"subLogisticsCode"`
|
|
DelayPushSecond int `json:"delay_push_second"`
|
|
}
|
|
|
|
//美团骑手修改小费,单位为元,最多小数点后一位
|
|
//order/receive/processed/w/distribute/tipAmount/v2?ignoreSetRouterProxy=true
|
|
func (a *API) OrderModityTips(orderID, poiCode string, tipAmount float64) (err error) {
|
|
params := map[string]interface{}{
|
|
"wmOrderViewId": orderID,
|
|
"wmPoiId": poiCode,
|
|
"tipAmount": tipAmount,
|
|
}
|
|
_, err = a.AccessUserPage2("v2/order/receive/processed/w/distribute/tipAmount/v2", params, true)
|
|
return err
|
|
}
|
|
|
|
//获取美团订单小费
|
|
//https://shangoue.meituan.com/v2/order/receive/processed/r/distribute/list/v2
|
|
func (a *API) GetDistributeOrderDetail(orderID, poiCode string) (distributeOrderDetail *DistributeOrderDetail, err error) {
|
|
params1 := map[string]interface{}{
|
|
"wmOrderViewId": orderID,
|
|
"wmPoiId": poiCode,
|
|
}
|
|
params := map[string]interface{}{
|
|
"orderInfos": []string{string(utils.MustMarshal(params1))},
|
|
}
|
|
result, err2 := a.AccessUserPage2("v2/order/receive/processed/r/distribute/list/v2", params, false)
|
|
if err2 != nil {
|
|
return distributeOrderDetail, err
|
|
}
|
|
err = utils.Map2StructByJson(result[orderID], &distributeOrderDetail, true)
|
|
return distributeOrderDetail, err
|
|
}
|
|
|
|
type RecommendSkuGet struct {
|
|
WmPoiId int64 `json:"wmPoiId"` // 平台门店id
|
|
PageNum int64 `json:"pageNum"` // 页数
|
|
PageSize int64 `json:"pageSize"` // 页码
|
|
NeedTag int64 `json:"needTag"`
|
|
Name string `json:"name"`
|
|
BrandId int64 `json:"brandId"`
|
|
TagId int64 `json:"tagId"`
|
|
SearchWord string `json:"searchWord"`
|
|
State int64 `json:"state"`
|
|
LabelIds int64 `json:"labelIds"`
|
|
SaleStatus int64 `json:"saleStatus"`
|
|
LimitSale int64 `json:"limitSale"`
|
|
NeedCombinationSpu int64 `json:"needCombinationSpu"`
|
|
NoStockAutoClear int64 `json:"noStockAutoClear"`
|
|
MedicareType int64 `json:"medicareType"`
|
|
}
|
|
|
|
// GetRecommendSku 获取美团力荐商品
|
|
func (a *API) GetRecommendSku(params *RecommendSkuGet, cookie string) {
|
|
result, err2 := a.AccessUserPage2("reuse/sc/product/retail/r/searchListPage", utils.Struct2MapByJson(params), true)
|
|
fmt.Println(result)
|
|
fmt.Println(err2)
|
|
}
|