shopping

package
v0.0.0-...-0eb9a37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2015 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EXP_BIT float32
)

Functions

func NewShopping

func NewShopping(partnerId int, partnerRep partner.IPartnerRep,
	rep shopping.IShoppingRep, saleRep sale.ISaleRep,
	promRep promotion.IPromotionRep, memberRep member.IMemberRep,
	deliveryRep delivery.IDeliveryRep) shopping.IShopping

Types

type Cart

type Cart struct {
	// contains filtered or unexported fields
}

func (*Cart) AddItem

func (this *Cart) AddItem(goodsId, num int) *shopping.ValueCartItem

添加项

func (*Cart) BindOrder

func (this *Cart) BindOrder(orderNo string) error

绑定订单

func (*Cart) Combine

func (this *Cart) Combine(c shopping.ICart) (shopping.ICart, error)

合并购物车,并返回新的购物车

func (*Cart) GetDomainId

func (this *Cart) GetDomainId() int

func (*Cart) GetFee

func (this *Cart) GetFee() (totalFee float32, orderFee float32)

获取订单金额,返回totalFee为总额, orderFee为实际订单的金额(扣去促销优惠等后的金额)

func (*Cart) GetSettleData

func (this *Cart) GetSettleData() (s partner.IShop, d member.IDeliver, paymentOpt, deliverOpt int)

获取结算数据

func (*Cart) GetSummary

func (this *Cart) GetSummary() string

获取总览信息

func (*Cart) GetValue

func (this *Cart) GetValue() shopping.ValueCart

func (*Cart) RemoveItem

func (this *Cart) RemoveItem(goodsId, num int) error

移出项

func (*Cart) Save

func (this *Cart) Save() (int, error)

保存购物车

func (*Cart) SetBuyer

func (this *Cart) SetBuyer(buyerId int) error

设置购买会员

func (*Cart) SettlePersist

func (this *Cart) SettlePersist(shopId, paymentOpt, deliverOpt, deliverId int) error

结算数据持久化

type Order

type Order struct {
	// contains filtered or unexported fields
}

func (*Order) AddRemark

func (this *Order) AddRemark(remark string)

添加备注

func (*Order) AppendLog

func (this *Order) AppendLog(t enum.OrderLogType, system bool, message string) error

添加日志

func (*Order) ApplyCoupon

func (this *Order) ApplyCoupon(coupon promotion.ICoupon) error

func (*Order) Cancel

func (this *Order) Cancel(reason string) error

取消订单

func (*Order) Complete

func (this *Order) Complete() error

完成订单

func (*Order) Confirm

func (this *Order) Confirm() error

确认订单

func (*Order) Deliver

func (this *Order) Deliver() error

配送订单

func (*Order) GetCoupons

func (this *Order) GetCoupons() []promotion.ICoupon

获取应用的优惠券

func (*Order) GetDomainId

func (this *Order) GetDomainId() int

func (*Order) GetValue

func (this *Order) GetValue() shopping.ValueOrder

func (*Order) IsOver

func (this *Order) IsOver() bool

订单是否已完成

func (*Order) Process

func (this *Order) Process() error

处理订单

func (*Order) Save

func (this *Order) Save() (int, error)

保存订单

func (*Order) SetDeliver

func (this *Order) SetDeliver(deliverAddrId int) error

设置配送地址

func (*Order) SetPayment

func (this *Order) SetPayment(payment int)

设置支付方式

func (*Order) SetShop

func (this *Order) SetShop(shopId int) error

设置Shop

func (*Order) SignPaid

func (this *Order) SignPaid() error

标记已支付

func (*Order) SignReceived

func (this *Order) SignReceived() error

标记收货

func (*Order) Submit

func (this *Order) Submit() (string, error)

提交订单,返回订单号。如有错误则返回

func (*Order) Suspend

func (this *Order) Suspend(reason string) error

挂起

type Shopping

type Shopping struct {
	// contains filtered or unexported fields
}

func (*Shopping) BindCartBuyer

func (this *Shopping) BindCartBuyer(cartKey string, buyerId int) error

绑定购物车会员编号

func (*Shopping) BuildOrder

func (this *Shopping) BuildOrder(memberId int, couponCode string) (shopping.IOrder, shopping.ICart, error)

生成订单

func (*Shopping) CreateOrder

func (this *Shopping) CreateOrder(val *shopping.ValueOrder, cart shopping.ICart) shopping.IOrder

func (*Shopping) GetAggregateRootId

func (this *Shopping) GetAggregateRootId() int

func (*Shopping) GetCart

func (this *Shopping) GetCart(key string) (shopping.ICart, error)

根据数据获取购物车

func (*Shopping) GetFreeOrderNo

func (this *Shopping) GetFreeOrderNo() string

func (*Shopping) GetNotBoughtCart

func (this *Shopping) GetNotBoughtCart(buyerId int) (shopping.ICart, error)

获取没有结算的购物车

func (*Shopping) GetOrderByNo

func (this *Shopping) GetOrderByNo(orderNo string) (shopping.IOrder, error)

func (*Shopping) NewCart

func (this *Shopping) NewCart(buyerId int) shopping.ICart

创建购物车 @buyerId 为购买会员ID,0表示匿名购物车

func (*Shopping) OrderAutoSetup

func (this *Shopping) OrderAutoSetup(f func(error))

自动设置订单

func (*Shopping) ParseShoppingCart

func (this *Shopping) ParseShoppingCart(memberId int) (shopping.IOrder,
	member.IMember, shopping.ICart, error)

将购物车转换为订单

func (*Shopping) SmartChoiceShop

func (this *Shopping) SmartChoiceShop(address string) (partner.IShop, error)

智能选择门店

func (*Shopping) SubmitOrder

func (this *Shopping) SubmitOrder(memberId int, couponCode string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL