|
@@ -1,5 +1,5 @@
|
|
|
const { default: activity } = require("../../api/activity");
|
|
|
-import drawQrcode from '../../utils/weapp.qrcode.js'
|
|
|
+import QRCode from '../../utils/weapp-qrcode.js'
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -130,19 +130,17 @@ Page({
|
|
|
_self.setData({
|
|
|
codeId:res.codeId,
|
|
|
})
|
|
|
-
|
|
|
//根据codeId 生成二维码
|
|
|
- drawQrcode({
|
|
|
- width: 200,
|
|
|
- height: 200,
|
|
|
- canvasId: 'myQrcode',
|
|
|
- text: 'https://oapi.shpr.top?id='+_self.data.codeId,
|
|
|
- image: {
|
|
|
- imageResource: '../../images/logo.png',
|
|
|
- dx: 70,
|
|
|
- dy: 70,
|
|
|
- dWidth: 60,
|
|
|
- dHeight: 60
|
|
|
+ new QRCode('myQrcode',{
|
|
|
+ // text: 'https://oapi.shpr.top?id='+_self.data.codeId,
|
|
|
+ text: 'https://oapi.shpr.top?id=Bg5740r78w',
|
|
|
+ width: 150,
|
|
|
+ height:150,
|
|
|
+ padding: 10, // 生成二维码四周自动留边宽度,不传入默认为0
|
|
|
+ correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
|
|
|
+ callback: (res) => {
|
|
|
+ console.log(res.path)
|
|
|
+ // 接下来就可以直接调用微信小程序的api保存到本地或者将这张二维码直接画在海报上面去,看各自需求
|
|
|
}
|
|
|
})
|
|
|
}
|