feat: 新增预约二维码弹窗功能

This commit is contained in:
ws
2026-04-24 17:28:43 +08:00
parent 590ba65ea4
commit 2cc7d75b08
14 changed files with 236 additions and 9 deletions
+48
View File
@@ -0,0 +1,48 @@
const drawQrcode = require('../../utils/weapp.qrcode.esm.js').default
Component({
properties: {
visible: {
type: Boolean,
value: false
},
qrcodeId: {
type: String,
value: ''
}
},
data: {
loading: true
},
observers: {
'visible'(val) {
if (val && this.data.qrcodeId) {
this.setData({ loading: true })
this.draw()
}
}
},
methods: {
draw() {
wx.nextTick(() => {
drawQrcode({
width: 200,
height: 200,
canvasId: 'qrcodeCanvas',
_this: this,
text: this.data.qrcodeId,
callback: () => {
this.setData({ loading: false })
}
})
})
},
onClose() {
this.triggerEvent('close')
}
}
})