refactor: 重构二维码弹窗组件为命令式调用
This commit is contained in:
@@ -6,9 +6,7 @@ Page({
|
||||
data: {
|
||||
isLoggedIn: false,
|
||||
loginFailed: false,
|
||||
latestRecord: null,
|
||||
qrcodeVisible: false,
|
||||
qrcodeId: ''
|
||||
latestRecord: null
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -82,11 +80,6 @@ Page({
|
||||
},
|
||||
|
||||
showQrcode(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
this.setData({ qrcodeVisible: true, qrcodeId: id })
|
||||
},
|
||||
|
||||
hideQrcode() {
|
||||
this.setData({ qrcodeVisible: false, qrcodeId: '' })
|
||||
this.selectComponent('#qrcodeModal').show(e.currentTarget.dataset.id)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -83,5 +83,5 @@
|
||||
</view>
|
||||
|
||||
<!-- 二维码弹窗 -->
|
||||
<qrcode-modal visible="{{qrcodeVisible}}" qrcode-id="{{qrcodeId}}" bind:close="hideQrcode" />
|
||||
<qrcode-modal id="qrcodeModal" />
|
||||
</view>
|
||||
Reference in New Issue
Block a user