public class WxMaQrcodeServiceImpl extends Object implements WxMaQrcodeService
CREATE_QRCODE_URL, GET_WXACODE_UNLIMIT_URL, GET_WXACODE_URL| 构造器和说明 |
|---|
WxMaQrcodeServiceImpl(WxMaService wxMaService) |
| 限定符和类型 | 方法和说明 |
|---|---|
File |
createQrcode(String path) |
File |
createQrcode(String path,
int width)
接口C: 获取小程序页面二维码.
|
File |
createWxCode(String path) |
File |
createWxCode(String path,
int width) |
File |
createWxCode(String path,
int width,
boolean autoColor,
WxMaCodeLineColor lineColor)
接口A: 获取小程序码.
|
File |
createWxCodeLimit(String scene,
String page) |
File |
createWxCodeLimit(String scene,
String page,
int width,
boolean autoColor,
WxMaCodeLineColor lineColor)
接口B: 获取小程序码(永久有效、数量暂无限制).
|
public WxMaQrcodeServiceImpl(WxMaService wxMaService)
public File createQrcode(String path, int width) throws WxErrorException
WxMaQrcodeService适用于需要的码数量较少的业务场景 通过该接口,仅能生成已发布的小程序的二维码。 可以在开发者工具预览时生成开发版的带参二维码。 带参二维码只有 100000 个,请谨慎调用。
createQrcode 在接口中 WxMaQrcodeServicepath - 不能为空,最大长度 128 字节width - 默认430 二维码的宽度WxErrorExceptionpublic File createQrcode(String path) throws WxErrorException
createQrcode 在接口中 WxMaQrcodeServiceWxErrorExceptionpublic File createWxCode(String path, int width, boolean autoColor, WxMaCodeLineColor lineColor) throws WxErrorException
WxMaQrcodeServicecreateWxCode 在接口中 WxMaQrcodeServicepath - 不能为空,最大长度 128 字节width - 默认430 二维码的宽度autoColor - 默认true 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调lineColor - auth_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"}WxErrorExceptionpublic File createWxCode(String path, int width) throws WxErrorException
createWxCode 在接口中 WxMaQrcodeServiceWxErrorExceptionpublic File createWxCode(String path) throws WxErrorException
createWxCode 在接口中 WxMaQrcodeServiceWxErrorExceptionpublic File createWxCodeLimit(String scene, String page, int width, boolean autoColor, WxMaCodeLineColor lineColor) throws WxErrorException
WxMaQrcodeService通过该接口生成的小程序码,永久有效,数量暂无限制。 用户扫描该码进入小程序后,将统一打开首页,开发者需在对应页面根据获取的码中 scene 字段的值,再做处理逻辑。 使用如下代码可以获取到二维码中的 scene 字段的值。 调试阶段可以使用开发工具的条件编译自定义参数 scene=xxxx 进行模拟,开发工具模拟时的 scene 的参数值需要进行 urlencode
createWxCodeLimit 在接口中 WxMaQrcodeServicescene - 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)page - 必须是已经发布的小程序页面,例如 "pages/index/index" ,如果不填写这个字段,默认跳主页面width - 默认false 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调autoColor - 默认true 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调lineColor - auth_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"}WxErrorExceptionpublic File createWxCodeLimit(String scene, String page) throws WxErrorException
createWxCodeLimit 在接口中 WxMaQrcodeServiceWxErrorExceptionCopyright © 2018. All rights reserved.