Documentation ¶
Index ¶
- Variables
- type Address
- type CapCityResponse
- type Capacity
- type Cart
- type CommitPayPram
- type Config
- type CouponInfo
- type DeliveryInfoVO
- type DingdongSession
- func (s *DingdongSession) CheckCart() error
- func (s *DingdongSession) CheckGoods() (map[string]NormalGoods, error)
- func (s *DingdongSession) CheckSettleInfo() (*SettleInfo, error)
- func (s *DingdongSession) CheckStore() ([]Store, error)
- func (s *DingdongSession) CommitPay(info SettleDeliveryInfo) (*Order, error)
- func (s *DingdongSession) GetAddress() (error, []Address)
- func (s *DingdongSession) GetCapacity(storeDeliveryTemplateId string) (*Capacity, error)
- func (s *DingdongSession) GetCart(result gjson.Result) error
- func (s *DingdongSession) GetOrderInfo(result gjson.Result) *Order
- func (s *DingdongSession) GetStoreList(result gjson.Result) []Store
- func (s *DingdongSession) InitSession(conf Config) error
- func (s *DingdongSession) NewRequest(method, url string, dataStr []byte) *http.Request
- func (s *DingdongSession) PushSuccess(msg string) error
- func (s *DingdongSession) SaveDeliveryAddress() error
- type FloorInfo
- type GetCartPram
- type Goods
- type List
- type NormalGoods
- type Order
- type PayInfo
- type SettleDelivery
- type SettleDeliveryInfo
- type SettleInfo
- type SettleParam
- type Store
- type StoreListParam
Constants ¶
This section is empty.
Variables ¶
View Source
var CapacityErr = errors.New("获取履约时间异常")
View Source
var CartGoodChangeErr = errors.New("购物车商品发生变化,请返回购物车页面重新结算")
View Source
var CloseOrderTimeExceptionErr = errors.New("尊敬的会员,您选择的配送时间已失效,请重新选择")
View Source
var CloudGoodsOverWightErr = errors.New("出于交通安全考虑,极速达订单限重30公斤,您的订单已超重,请分开下单")
View Source
var DecreaseCapacityCountError = errors.New("扣减运力失败")
View Source
var GetDeliveryInfoErr = errors.New("获取履约配送信息异常")
View Source
var GoodsExceedLimitErr = errors.New("商品超过限购数量")
View Source
var LimitedErr = errors.New("服务器正忙,请稍后再试")
View Source
var LimitedErr1 = errors.New("当前购物火爆,请稍后再试")
View Source
var NoMatchDeliverMode = errors.New("当前区域不支持配送,请重新选择地址")
View Source
var NotDeliverCapCityErr = errors.New("当前配送时间段已约满,请重新选择配送时段")
View Source
var OOSErr = errors.New("部分商品已缺货")
View Source
var PreGoodNotStartSellErr = errors.New("商品还未开始正式售卖,无法购买")
View Source
var StoreHasClosedError = errors.New("门店已打烊")
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { AddressId string `json:"addressId"` Mobile string `json:"mobile"` Phone string `json:"phone"` Name string `json:"name"` CountryName string `json:"countryName"` ProvinceName string `json:"provinceName"` CityName string `json:"cityName"` //上海市 DistrictName string `json:"districtName"` //浦东新区 ReceiverAddress string `json:"receiverAddress"` //xx路 DetailAddress string `json:"detailAddress"` //xx楼xx号 Latitude string `json:"latitude"` Longitude string `json:"longitude"` }
type CapCityResponse ¶
type Capacity ¶
type Capacity struct { Data string `json:"data"` CapCityResponseList []CapCityResponse `json:"capcityResponseList"` PortalPerformanceTemplate string `json:"getPortalPerformanceTemplateResponse"` }
type CommitPayPram ¶
type CommitPayPram struct { GoodsList []Goods `json:"goodsList"` InvoiceInfo map[int]interface{} `json:"invoiceInfo"` DeliveryType int `json:"cartDeliveryType"` FloorId int `json:"floorId"` Amount string `json:"amount"` PurchaserName string `json:"purchaserName"` SettleDeliveryInfo SettleDeliveryInfo `json:"settleDeliveryInfo"` TradeType string `json:"tradeType"` //"APP" PurchaserId string `json:"purchaserId"` PayType int `json:"payType"` Currency string `json:"currency"` // CNY Channel string `json:"channel"` // wechat ShortageId int `json:"shortageId"` //1 IsSelfPickup int `json:"isSelfPickup"` //0 OrderType int `json:"orderType"` //0 CouponList []CouponInfo `json:"couponList,omitempty"` Uid string `json:"uid"` //273583094, AppId string `json:"appId"` //wx57364320cb03dfba AddressId string `json:"addressId"` DeliveryInfoVO DeliveryInfoVO `json:"deliveryInfoVO"` Remark string `json:"remark"` StoreInfo Store `json:"storeInfo"` ShortageDesc string `json:"shortageDesc"` PayMethodId string `json:"payMethodId"` }
type Config ¶
type Config struct { AuthToken string BarkId string FloorId int //1,普通商品 2,全球购保税 3,特殊订购自提 4,大件商品 5,厂家直供商品 6,特殊订购商品 7,失效商品 DeliveryType int //1 急速达,2, 全程配送 Longitude string Latitude string Deviceid string Trackinfo string PromotionId []string AddressId string PayMethod int //支付方式 DeliveryFee bool StoreConf string IsSelected bool }
type CouponInfo ¶
type DeliveryInfoVO ¶
type DingdongSession ¶
type DingdongSession struct { Conf Config Address Address `json:"address"` Uid string `json:"uid"` Capacity Capacity `json:"capacity"` SettleDeliveryInfo map[int]SettleDeliveryInfo `json:"settleDeliveryInfo"` GoodsList []Goods `json:"goods"` FloorInfo FloorInfo `json:"floorInfo"` StoreList map[string]Store `json:"store"` Client *http.Client `json:"client"` Cart Cart `json:"cart"` }
func (*DingdongSession) CheckCart ¶
func (s *DingdongSession) CheckCart() error
func (*DingdongSession) CheckGoods ¶
func (s *DingdongSession) CheckGoods() (map[string]NormalGoods, error)
func (*DingdongSession) CheckSettleInfo ¶
func (s *DingdongSession) CheckSettleInfo() (*SettleInfo, error)
func (*DingdongSession) CheckStore ¶
func (s *DingdongSession) CheckStore() ([]Store, error)
func (*DingdongSession) CommitPay ¶
func (s *DingdongSession) CommitPay(info SettleDeliveryInfo) (*Order, error)
func (*DingdongSession) GetAddress ¶
func (s *DingdongSession) GetAddress() (error, []Address)
func (*DingdongSession) GetCapacity ¶
func (s *DingdongSession) GetCapacity(storeDeliveryTemplateId string) (*Capacity, error)
func (*DingdongSession) GetOrderInfo ¶
func (s *DingdongSession) GetOrderInfo(result gjson.Result) *Order
func (*DingdongSession) GetStoreList ¶
func (s *DingdongSession) GetStoreList(result gjson.Result) []Store
func (*DingdongSession) InitSession ¶
func (s *DingdongSession) InitSession(conf Config) error
func (*DingdongSession) NewRequest ¶
func (s *DingdongSession) NewRequest(method, url string, dataStr []byte) *http.Request
func (*DingdongSession) PushSuccess ¶
func (s *DingdongSession) PushSuccess(msg string) error
func (*DingdongSession) SaveDeliveryAddress ¶
func (s *DingdongSession) SaveDeliveryAddress() error
type FloorInfo ¶
type FloorInfo struct { FloorId int `json:"floorId"` DeliveryType int `json:"deliveryType"` NormalGoodsList []NormalGoods `json:"normalGoodsList"` ShortageStockGoodsList []NormalGoods `json:"ShortageStockGoodsList"` AllOutOfStockGoodsList []NormalGoods `json:"allOutOfStockGoodsList"` Amount string `json:"amount"` Quantity int `json:"quantity"` StoreId string `json:"storeId"` }
type GetCartPram ¶
type List ¶
type List struct { StartTime string `json:"startTime"` EndTime string `json:"endTime"` TimeISFull bool `json:"timeISFull"` Disabled bool `json:"disabled"` CloseDate string `json:"closeDate"` CloseTime string `json:"closeTime"` StartRealTime string `json:"startRealTime"` //1649984400000 EndRealTime string `json:"endRealTime"` //1650016800000 }
type NormalGoods ¶
type NormalGoods struct { StoreId string `json:"storeId"` StoreType int `json:"storeType"` SpuId string `json:"spuId"` SkuId string `json:"skuId"` BrandId string `json:"brandId"` GoodsName string `json:"goodsName"` Price int `json:"price"` InvalidReason string `json:"invalidReason"` Quantity int `json:"quantity"` StockQuantity int `json:"stockQuantity"` StockStatus bool `json:"stockStatus"` IsPutOnSale bool `json:"isPutOnSale"` IsAvailable bool `json:"isAvailable"` LimitNum int `json:"limitNum"` ResiduePurchaseNum int `json:"residuePurchaseNum"` IsSelected bool `json:"IsSelected"` Weight float64 `json:"-"` }
func (NormalGoods) ToGoods ¶
func (this NormalGoods) ToGoods() Goods
type SettleDelivery ¶
type SettleDelivery struct { DeliveryType int `json:"deliveryType"` // 1,极速达 2, 全城配 3, 物流配送 DeliveryName string `json:"deliveryName"` DeliveryDesc string `json:"deliveryDesc"` ExpectArrivalTime string `json:"expectArrivalTime"` ExpectArrivalEndTime string `json:"expectArrivalEndTime"` StoreDeliveryTemplateId string `json:"storeDeliveryTemplateId"` DeliveryModeIdList []string `json:"deliveryModeIdList"` AreaBlockId string `json:"areaBlockId"` AreaBlockName string `json:"areaBlockName"` FirstPeriod int `json:"firstPeriod"` }
type SettleDeliveryInfo ¶
type SettleInfo ¶
type SettleParam ¶
type SettleParam struct { Uid string `json:"uid"` AddressId string `json:"addressId"` DeliveryInfoVO DeliveryInfoVO `json:"deliveryInfoVO"` DeliveryType int `json:"cartDeliveryType"` StoreInfo Store `json:"storeInfo"` CouponList []CouponInfo `json:"couponList,omitempty"` IsSelfPickup int `json:"isSelfPickup"` FloorId int `json:"floorId"` GoodsList []Goods `json:"goodsList"` }
type Store ¶
type Store struct { StoreId string `json:"storeId"` StoreName string `json:"-"` StoreType string `json:"storeType"` AreaBlockId string `json:"areaBlockId"` StoreDeliveryTemplateId string `json:"storeDeliveryTemplateId"` DeliveryModeId string `json:"deliveryModeId"` DeliveryType int `json:"deliveryType"` Capacity *Capacity `json:"-"` }
type StoreListParam ¶
Click to show internal directories.
Click to hide internal directories.