Comments (6)
贴一下必要的代码吧
from weapp-qrcode.
// 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);
//问题:二维码绘制没问题,但是手机上调试二维码上的图片始终显示不出来,微信开发者工具上可以显示
from weapp-qrcode.
图片是远程地址的问题,使用本地图片,或者把远程图片保存在本地。
from weapp-qrcode.
不支持用远程图片地址吗?可不可以做一下兼容呀大佬?我这是详情页图片地址都是从后端拿的url, 很多图片呢保存到本地不实际呀😢
from weapp-qrcode.
尝试获取一下图片的临时地址
from weapp-qrcode.
请问解决了吗
from weapp-qrcode.
Related Issues (20)
- 汉字内容用微信扫码无法识别
- text传的值有长度限制 过长生成报错 跳过生成出的二维码扫不出 还以为是code长度有限制,结果其他的正常,建议更新一波
- iphone5型号中的二维码无法识别
- 希望适配下百度智能小程序
- 在新版本wepy中无法显示二维码 HOT 6
- 当宽高设置为200时,微信无法识别 HOT 2
- 图片不能显示呀
- 华为 nova 5i Pro 二维码出不来 HOT 4
- 默认计算模式文本中有表情会乱码 HOT 1
- 安卓手机生成的二维码有问题 微信无法扫描 请慎用 HOT 3
- 把自己坑惨了 必须是字符串才能生成二维码 数字不行
- 个别安卓手机无法生成二维码的解决方案,回调再次调用,重复渲染即可 HOT 2
- 解决个别华为不显示二维码,在drawQrcode的callback里再次执行drawQrcode
- 为啥没有设置padding参数了
- 没有声明文件,导致在ts文件中使用报错 HOT 2
- 能够在小程序的循环中使用不?新手不知道如何使用........
- mpvue开发的微信小程序使用weapp.qrcode插件,在真机中logo无法显示
- mpvue开发的小程序,使用这个生成的二维码没有固定在我想要的位置,而是跟着页面上下滑动在滚动 HOT 1
- 手机端怎么下载代码
- 建议添加是否清空画布参数
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weapp-qrcode.