mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-10-18 16:33:43 +08:00
优化二维码生成交互逻辑
This commit is contained in:
@@ -198,7 +198,8 @@
|
||||
<div class="layui-col-xs9">
|
||||
<div class="list">
|
||||
<a href="javascript:;" class="layui-font-blue" lay-on="getQrcode"
|
||||
data-qrcode="<?php echo $qrcode ?>"><span class="icon pear-icon"></span></a>
|
||||
data-qrcode="<?php echo $qrcode ?>" data-type="<?php echo $url_type ?>"><span
|
||||
class="icon pear-icon"></span></a>
|
||||
<?php echo $qrcode ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -215,16 +216,28 @@
|
||||
util.on({
|
||||
getQrcode: function () {
|
||||
(async () => {
|
||||
const qrcode_data = this.getAttribute("data-qrcode")
|
||||
const qrcode_img = await getQrcode(qrcode_data, QR);
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['200px', '200px'],
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
shadeClose: true,
|
||||
content: `<img width="100%" src="${qrcode_img}">`
|
||||
});
|
||||
const type_data = this.getAttribute("data-type");
|
||||
const qrcode_data = this.getAttribute("data-qrcode");
|
||||
if (type_data == 1) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['200px', '200px'],
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
shadeClose: true,
|
||||
content: `<img width="100%" src="${qrcode_data}">`
|
||||
});
|
||||
} else if (type_data == 0) {
|
||||
const qrcode_img = await getQrcode(qrcode_data, QR);
|
||||
layer.open({
|
||||
type: 1,
|
||||
area: ['200px', '200px'],
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
shadeClose: true,
|
||||
content: `<img width="100%" src="${qrcode_img}">`
|
||||
});
|
||||
}
|
||||
})()
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user