mp

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppID string // AppID appid

	AppSecret string // AppSecret app secret

	SessionKey string // SessionKey sessionKey
)

Functions

This section is empty.

Types

type Content added in v1.3.3

type Content struct{}

func NewContent added in v1.3.3

func NewContent() *Content

func (*Content) Image added in v1.3.3

func (c *Content) Image(args *Image) ([]byte, error)

Image image

func (*Content) Message added in v1.3.3

func (c *Content) Message(args *Message) ([]byte, error)

Message message

type DeliveryInfo added in v1.4.0

type DeliveryInfo struct {
	DeliveryID   string `json:"delivery_id,omitempty"`   // 是 运力公司 id
	DeliveryName string `json:"delivery_name,omitempty"` // 否 运力公司名称
}

type DetailItem added in v1.4.0

type DetailItem struct {
	GoodsName   string `json:"goods_name,omitempty"`    // 是 商品名称
	GoodsImgURL string `json:"goods_img_url,omitempty"` // 是 商品图片url
	GoodsDesc   string `json:"goods_desc,omitempty"`    // 否 商品详情描述,不传默认取“商品名称”值,最多40汉字
}

type DetailList added in v1.4.0

type DetailList struct {
	DetailList []*DetailItem `json:"detail_list,omitempty"` // 是 商品信息
}

type Error added in v1.3.3

type Error struct {
	ErrCode int    `json:"errcode"` // 错误代码
	ErrMsg  string `json:"errmsg"`  // 错误消息
}

Error Error

type Image

type Image struct {
	Media []byte `json:"media"` // 媒体
}

Image image

type MP

type MP struct{}

MP mp

func NewMP

func NewMP() *MP

NewMP new mini program

func (*MP) Phone

func (m *MP) Phone(code string) (*Phone, error)

Phone phone

func (*MP) User

func (m *MP) User(encryptedData, iv string) (*User, error)

User user

type Message

type Message struct {
	Content string `json:"content"` // 内容
}

Message message

type Phone

type Phone struct {
	PhoneNumber     string    `json:"phoneNumber"`     // 用户绑定的手机号
	PurePhoneNumber string    `json:"purePhoneNumber"` // 没有区号的手机号
	CountryCode     string    `json:"countryCode"`     // 区号
	Watermark       Watermark `json:"watermark"`       // 水印
}

Phone phone

type QR

type QR struct {
	Scene     string                 `json:"scene"`      // 场景
	Page      string                 `json:"page"`       // 页面
	Width     int                    `json:"width"`      // 宽度
	AutoColor bool                   `json:"auto_color"` // 默认颜色
	LineColor map[string]interface{} `json:"line_color"` // 线条颜色
}

QR qr

func NewQR added in v1.4.0

func NewQR() *QR

NewQR new qr

func (*QR) Generate added in v1.3.3

func (q *QR) Generate(args *QR) ([]byte, error)

Generate qr generate

type Session

type Session struct {
	OpenID     string `json:"openid"`      // openid
	SessionKey string `json:"session_key"` // session
	UnionID    string `json:"unionid"`     // unionid
	Error
}

Session session

func NewSession

func NewSession() *Session

NewSession new session

func (*Session) Get

func (s *Session) Get(code string) (*Session, error)

Get get

type ShopInfo added in v1.4.0

type ShopInfo struct {
	GoodsInfo DetailList `json:"goods_info,omitempty"` // 店铺信息
}

type Token

type Token struct {
	AccessToken  string `json:"access_token"`  // 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同
	ExpiresIn    int    `json:"expires_in"`    // access_token接口调用凭证超时时间,单位(秒)
	RefreshToken string `json:"refresh_token"` // 用户刷新access_token
	OpenID       string `json:"openid"`        // 用户唯一标识
	Scope        string `json:"scope"`         // 用户授权的作用域,使用逗号(,)分隔
	Error
}

Token token

func NewToken

func NewToken() *Token

NewToken new token

func (*Token) Access

func (t *Token) Access() (string, error)

Access access token

func (*Token) Get added in v1.3.3

func (t *Token) Get() (*Token, error)

type Trace added in v1.4.0

type Trace struct{}

func NewTrace added in v1.4.0

func NewTrace() *Trace

func (*Trace) Query added in v1.4.0

func (t *Trace) Query(waybillToken string) (*TraceResponse, error)

Query query trace

func (*Trace) Waybill added in v1.4.0

func (t *Trace) Waybill(args *TraceRequest) (*TraceResponse, error)

type TraceRequest added in v1.4.0

type TraceRequest struct {
	OpenID          string     `json:"openid,omitempty"`            // 是 用户openid
	SenderPhone     string     `json:"sender_phone,omitempty"`      // 否 寄件人手机号
	ReceiverPhone   string     `json:"receiver_phone,omitempty"`    // 是 收件人手机号,部分运力需要用户手机号作为查单依据
	DeliveryID      string     `json:"delivery_id,omitempty"`       // 否	运力id(运单号所属运力公司id),该字段从 get_delivery_list 获取。
	WaybillID       string     `json:"waybill_id,omitempty"`        // 是 运单号
	TransID         string     `json:"trans_id,omitempty"`          // 是 微信支付id
	OrderTetailTath string     `json:"order_detail_path,omitempty"` // 否 点击落地页商品卡片跳转路径(建议为订单详情页path),不传默认跳转小程序首页。
	GoodsInfo       DetailList `json:"goods_info,omitempty"`        // 是	商品信息
}

type TraceResponse added in v1.4.0

type TraceResponse struct {
	Error
	WaybillToken string        `json:"waybill_token,omitempty"` // 运单token
	WaybillInfo  *WaybillInfo  `json:"waybill_info,omitempty"`  // 运单信息
	ShopInfo     *ShopInfo     `json:"shop_info,omitempty"`     // 店铺信息
	DeliveryInfo *DeliveryInfo `json:"delivery_info,omitempty"` // 运力信息
}

type User

type User struct {
	NickName  string    `json:"nickName"`          // 用户昵称
	Gender    int       `json:"gender"`            // 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
	Language  string    `json:"language"`          // 语言
	City      string    `json:"city"`              // 普通用户个人资料填写的城市
	Province  string    `json:"province"`          // 用户个人资料填写的省份
	Country   string    `json:"country"`           // 国家,如中国为CN
	AvatarURL string    `json:"avatarUrl"`         // 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。若用户更换头像,原有头像URL将失效。
	OpenID    string    `json:"openid,omitempty"`  // 用户的唯一标识
	UnionID   string    `json:"unionid,omitempty"` // 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。详见:获取用户个人信息(UnionID机制)
	OpenGID   string    `json:"openGId"`           // 群对当前小程序的唯一 ID
	Watermark Watermark `json:"watermark"`         // 水印
}

User user

type WP

type WP struct {
	Error
	PhoneInfo Phone `json:"phone_info"` // 手机
}

WP wechat mobile

type Watermark

type Watermark struct {
	AppID     string `json:"appid,omitempty"`
	TimeStamp int    `json:"timestamp,omitempty"`
}

Watermark watermark

type WaybillInfo added in v1.4.0

type WaybillInfo struct {
	Status    int32  `json:"status,omitempty"`     // 是 运单状态,见运单状态
	WaybillID string `json:"waybill_id,omitempty"` // 是 运单号
}

Jump to

Keyboard shortcuts

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