dazhuang\
This commit is contained in:
@@ -3,14 +3,14 @@ package mtpsapi
|
|||||||
import (
|
import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi"
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi"
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -57,10 +57,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DeliveryServiceCodeSuperRapid = 4002 // 飞速达
|
DeliveryServiceCodeSuperRapid = 4002 // 飞速达
|
||||||
DeliveryServiceCodeRapid = 100004 // 快速达
|
DeliveryServiceCodeRapid = 4011 // 快速达
|
||||||
DeliveryServiceCodeIntime = 4012 // 及时达
|
DeliveryServiceCodeIntime = 4012 // 及时达
|
||||||
DeliveryServiceCodeTogether = 4013 // 集中送
|
DeliveryServiceCodeTogether = 4013 // 集中送
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -439,12 +439,12 @@ type PreCreateByShopParam struct {
|
|||||||
// 期望送达时间,时区为GMT+8,当前距离Epoch(1970年1月1日) 以秒计算的时间,即unix-timestamp
|
// 期望送达时间,时区为GMT+8,当前距离Epoch(1970年1月1日) 以秒计算的时间,即unix-timestamp
|
||||||
// 即时单:以发单时间 + 服务包时效作为期望送达时间(当天送服务包需客户指定期望送达时间)
|
// 即时单:以发单时间 + 服务包时效作为期望送达时间(当天送服务包需客户指定期望送达时间)
|
||||||
// 预约单:以客户传参数据为准(预约时间必须大于当前下单时间+服务包时效+3分钟)
|
// 预约单:以客户传参数据为准(预约时间必须大于当前下单时间+服务包时效+3分钟)
|
||||||
OrderType int `json:"order_type,omitempty"`
|
OrderType int `json:"order_type,omitempty"`
|
||||||
PoiSeq string `json:"poi_seq,omitempty"`
|
PoiSeq string `json:"poi_seq,omitempty"`
|
||||||
Note string `json:"note,omitempty"`
|
Note string `json:"note,omitempty"`
|
||||||
CashOnDelivery float64 `json:"cash_on_delivery,omitempty"`
|
CashOnDelivery float64 `json:"cash_on_delivery,omitempty"`
|
||||||
CashOnPickup float64 `json:"cash_on_pickup,omitempty"`
|
CashOnPickup float64 `json:"cash_on_pickup,omitempty"`
|
||||||
InvoiceTitle string `json:"invoice_title,omitempty"`
|
InvoiceTitle string `json:"invoice_title,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 美团预发单
|
// 美团预发单
|
||||||
@@ -455,8 +455,17 @@ func (a *API) PreCreateByShop(basicParams *PreCreateByShopParam) (deliveryFee, b
|
|||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
deliveryFee = utils.Float64TwoInt64(utils.MustInterface2Float64(result.Data["delivery_fee"]) * 100) // 订单配送价格
|
c, err1 := utils.TryInterface2Float64(result.Data["delivery_fee"])
|
||||||
baseDeliveryFee = utils.Float64TwoInt64(utils.MustInterface2Float64(result.Data["base_delivery_fee"]) * 100) // 订单优惠价格
|
b, err2 := utils.TryInterface2Float64(result.Data["base_delivery_fee"])
|
||||||
|
//{"code":0,"data":{"base_delivery_fee":7.2,"coupons_amount":0.0,"delivery_distance":775,"delivery_fee":7.2},"message":"success"}
|
||||||
|
globals.SugarLogger.Info("美团运费返回值err1:=============", err1)
|
||||||
|
globals.SugarLogger.Info("美团运费返回值err2:=============", err2)
|
||||||
|
|
||||||
|
deliveryFee = utils.Float64TwoInt64(c * 100) // 订单配送价格
|
||||||
|
baseDeliveryFee = utils.Float64TwoInt64(b * 100) // 订单优惠价格
|
||||||
|
globals.SugarLogger.Info("美团运费返回值deliveryFee:=============", deliveryFee)
|
||||||
|
globals.SugarLogger.Info("美团运费返回值baseDeliveryFee:=============", baseDeliveryFee)
|
||||||
|
|
||||||
return deliveryFee, baseDeliveryFee, nil
|
return deliveryFee, baseDeliveryFee, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user