shopping

package
v0.0.0-...-1960156 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2015 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : cash_back
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : log_info
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : util
  • author : jarryliu
  • date : -- :
  • description :
  • history :

Index

Constants

This section is empty.

Variables

View Source
var (
	EXP_BIT float32
)

Functions

func HandleCashBackDataTag

func HandleCashBackDataTag(m member.IMember, order *shopping.ValueOrder,
	c promotion.ICashBackPromotion, memberRep member.IMemberRep)

func NewShopping

func NewShopping(partnerId int, partnerRep partner.IPartnerRep,
	rep shopping.IShoppingRep, saleRep sale.ISaleRep, goodsRep sale.IGoodsRep,
	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, error)

添加项

func (*Cart) Combine

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

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

func (*Cart) Destroy

func (this *Cart) Destroy() (err error)

销毁购物车

func (*Cart) GetCartGoods

func (this *Cart) GetCartGoods() []sale.IGoods

获取购物车中的商品

func (*Cart) GetDomainId

func (this *Cart) GetDomainId() int

func (*Cart) GetFee

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

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

func (*Cart) GetJsonItems

func (this *Cart) GetJsonItems() []byte

获取Json格式的商品数据

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.ICouponPromotion) error

应用优惠券

func (*Order) Cancel

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

取消订单

func (*Order) CmPaymentWithBalance

func (this *Order) CmPaymentWithBalance() 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) GetAvailableOrderPromotions

func (this *Order) GetAvailableOrderPromotions() []promotion.IPromotion

获取可用的促销,不包含优惠券

func (*Order) GetBestSavePromotion

func (this *Order) GetBestSavePromotion() (p promotion.IPromotion, saveFee float32, integral int)

获取最省的促销

func (*Order) GetCoupons

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

获取应用的优惠券

func (*Order) GetDomainId

func (this *Order) GetDomainId() int

func (*Order) GetOrderNo

func (this *Order) GetOrderNo() string

获取订单号

func (*Order) GetPaymentFee

func (this *Order) GetPaymentFee() float32

获取支付金额

func (*Order) GetPromotionBinds

func (this *Order) GetPromotionBinds() []*shopping.OrderPromotionBind

获取促销绑定

func (*Order) GetValue

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

func (*Order) IsOver

func (this *Order) IsOver() bool

订单是否已完成

func (*Order) PaymentForOnlineTrade

func (this *Order) PaymentForOnlineTrade(serverProvider string, tradeNo string) error

在线交易支付

func (*Order) PaymentWithBalance

func (this *Order) PaymentWithBalance() error

使用余额支付

func (*Order) Process

func (this *Order) Process() error

处理订单

func (*Order) Save

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

保存订单

func (*Order) SetDeliver

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

设置配送地址

func (*Order) SetPayment

func (this *Order) SetPayment(payment int)

设置支付方式

func (*Order) SetShop

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

设置Shop

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

挂起

func (*Order) UseBalanceDiscount

func (this *Order) UseBalanceDiscount()

使用余额支付

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) CheckCart

func (this *Shopping) CheckCart(cart 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) GetCartByKey

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

根据数据获取购物车

func (*Shopping) GetCurrentCart

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

获取没有结算的购物车

func (*Shopping) GetFreeOrderNo

func (this *Shopping) GetFreeOrderNo() string

func (*Shopping) GetOrderByNo

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

func (*Shopping) GetShoppingCart

func (this *Shopping) GetShoppingCart(buyerId int, cartKey string) shopping.ICart

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) SmartConfirmOrder

func (this *Shopping) SmartConfirmOrder(order shopping.IOrder) error

func (*Shopping) SubmitOrder

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

Jump to

Keyboard shortcuts

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