Skip to content

Commit

Permalink
templates(base): remove save qrcode image
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhan005 committed Aug 31, 2024
1 parent 32617f9 commit d5f1694
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion templates/base/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/dayjs/1.10.8/dayjs.min.js"></script>
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js"
type="application/javascript"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/dom-to-image/2.6.0/dom-to-image.min.js" type="application/javascript"></script>
<script defer src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/alpinejs/3.9.0/cdn.min.js"/></script>
{{ if .VConsole }}
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vConsole/3.12.1/vconsole.min.js" type="application/javascript"></script>
Expand Down
18 changes: 2 additions & 16 deletions templates/question/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3>{{ .PageUser.Name }}</h3>
</div>

<div id="qrcode-modal" class="uk-flex-top" uk-modal>
<div class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical" style="max-width: 440px !important" x-data="{loading: false}">
<div class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical" style="max-width: 440px !important">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div style="width: 100%;padding-top: 100%;position: relative;">
<div id="qrcode_background"
Expand All @@ -45,21 +45,7 @@ <h3>{{ .PageUser.Name }}</h3>
</div>
</div>
</div>
<button class="uk-button uk-margin-small-top uk-button-primary uk-width-1-1 uk-margin-small-bottom" x-on:click.debounce="()=>{
loading = true;
domtoimage.toPng(document.getElementById('qrcode_background'), {
useCors: true
}).then(function (dataURL) {
const link = document.createElement('a');
link.href = dataURL;
link.download = '提问箱二维码.png';
link.click();
}).finally(() => {
loading = false;
});
}">
下载二维码 <div uk-spinner="ratio: 0.5" x-show="loading"></div>
</button>
<div class="uk-text-center uk-text-small uk-text-muted uk-margin-top">截图保存二维码</div>
</div>
</div>

Expand Down

0 comments on commit d5f1694

Please sign in to comment.