qrcode.js 1.1 KB

1234567891011121314151617181920
  1. import request from '@/utils/request'
  2. // 获取不限制的小程序码
  3. export function getUnlimitedQRCode(data) {
  4. return request({
  5. url: '/wx/qrcode/unlimited',
  6. method: 'post',
  7. data: {
  8. scene: data.scene, // 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符
  9. page: data.page, // 默认是主页,页面 page,例如 pages/index/index
  10. check_path: data.check_path || true, // 默认是true,检查page 是否存在
  11. env_version: data.env_version || 'release', // 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"
  12. width: data.width || 430, // 二维码的宽度,单位 px,最小 280px,最大 1280px
  13. auto_color: data.auto_color || false, // 自动配置线条颜色
  14. line_color: data.line_color || { r: 0, g: 0, b: 0 }, // 使用 rgb 设置颜色
  15. is_hyaline: data.is_hyaline || false // 是否需要透明底色
  16. },
  17. responseType: 'arraybuffer' // 设置响应类型为arraybuffer,因为返回的是图片二进制内容
  18. })
  19. }