Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0版本 真机上显示不出来二维码上的image图片 #28

Closed
fml077 opened this issue Jan 11, 2019 · 6 comments
Closed

1.0.0版本 真机上显示不出来二维码上的image图片 #28

fml077 opened this issue Jan 11, 2019 · 6 comments

Comments

@fml077
Copy link

fml077 commented Jan 11, 2019

Description

1.0.0版本 真机上显示不出来二维码上的image图片,微信开发者工具上能显示图片

Environment

  • Platform: [iOS/Andriod]
  • Wechat version: [7.0]
  • weapp-qrcode version: [weapp.qrcode.min.js]
  • other version: [如果在某一设备下出现该问题,请填写设备号]

Reproduce

问题复现步骤:

  1. [第一步]
  2. [第二步]
  3. [其他步骤...]

期望的表现:

[在这里描述期望的表现]

观察到的表现:

[在这里描述观察到的表现]

屏幕截图和动态 GIF 图

微信开发者工具上的,能正常显示image图片:
image
下面是手机上的,显示不出图片,iOS和Andriod都不显示:
image

Relevant Code / Logs

// TODO(you): code or logs here to reproduce the problem
@yingye
Copy link
Owner

yingye commented Jan 11, 2019

贴一下必要的代码吧

@fml077
Copy link
Author

fml077 commented Jan 14, 2019

// util.js文件里方法定义:
/**

  • width:二维码宽度, heigh:二维码高度, domid:二维码DOM元素, text:二维码内容, imgurl:自定义二维码中的图片
    */
    const drawCode = (width, heigh, domid, text, imgurl) => {
    drawQrcode({
    width: width,
    height: heigh,
    canvasId: domid,
    text: text,
    // v1.0.0+版本支持在二维码上绘制图片
    image: {
    imageResource: imgurl,
    dx: 37.5, // 图片x轴偏移量(单位px,下同)
    dy: 37.5, // 图片y轴偏移量
    dWidth: 60, // 图片宽
    dHeight: 60 // 图片高
    }
    })
    }

// index.js文件里 方法调用

// _this.data.giftIcon为图片地址:https://bigshowcdn.cmcm.com/upload/image/20190109/l9HfnArh037998.jpeg
util.drawCode('135', '135', 'myQrcode', _this.data.codeInfo);

//问题:二维码绘制没问题,但是手机上调试二维码上的图片始终显示不出来,微信开发者工具上可以显示

@yingye
Copy link
Owner

yingye commented Jan 14, 2019

图片是远程地址的问题,使用本地图片,或者把远程图片保存在本地。

@fml077
Copy link
Author

fml077 commented Jan 14, 2019

不支持用远程图片地址吗?可不可以做一下兼容呀大佬?我这是详情页图片地址都是从后端拿的url, 很多图片呢保存到本地不实际呀😢

@yingye
Copy link
Owner

yingye commented Jan 14, 2019

尝试获取一下图片的临时地址

@yingye yingye closed this as completed Feb 18, 2019
@Fantasy77777
Copy link

请问解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants