Help us shape the future of Go! Take the 2026 Go Developer Survey

qrcode

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	R string `json:"r"`
	G string `json:"g"`
	B string `json:"b"`
}

Color QRCode color

type QRCode

type QRCode struct {
	*context.Context
}

QRCode struct

func NewQRCode

func NewQRCode(context *context.Context) *QRCode

NewQRCode 实例

func (*QRCode) CreateWXAQRCode

func (qrCode *QRCode) CreateWXAQRCode(coderParams QRCoder) (response []byte, err error)

CreateWXAQRCode 获取小程序二维码,适用于需要的码数量较少的业务场景 文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/createWXAQRCode.html

func (*QRCode) GetWXACode

func (qrCode *QRCode) GetWXACode(coderParams QRCoder) (response []byte, err error)

GetWXACode 获取小程序码,适用于需要的码数量较少的业务场景 文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/getWXACode.html

func (*QRCode) GetWXACodeUnlimit

func (qrCode *QRCode) GetWXACodeUnlimit(coderParams QRCoder) (response []byte, err error)

GetWXACodeUnlimit 获取小程序码,适用于需要的码数量极多的业务场景 文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/getWXACodeUnlimit.html

type QRCoder

type QRCoder struct {
	// page 必须是已经发布的小程序存在的页面,根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面
	Page string `json:"page,omitempty"`
	// path 扫码进入的小程序页面路径
	Path string `json:"path,omitempty"`
	// width 图片宽度
	Width int `json:"width,omitempty"`
	// scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
	Scene string `json:"scene,omitempty"`
	// autoColor 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
	AutoColor bool `json:"auto_color,omitempty"`
	// lineColor AutoColor 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"},十进制表示
	LineColor Color `json:"line_color,omitempty"`
	// isHyaline 是否需要透明底色
	IsHyaline bool `json:"is_hyaline,omitempty"`
}

QRCoder 小程序码参数

Jump to

Keyboard shortcuts

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