Fix iOS scan QR code issue (#35)

This commit is contained in:
AceDataCloud committed 2024-01-07 12:47:26 +00:00
1 parent 0605fc13e7
commit a93076aa7f
6 files changed
+201 -10

No files matched your search

+35 -1
View File
@@ -8,6 +8,15 @@
:close-on-click-modal="false"
>
<iframe width="360" height="560" :src="iframeUrl" frameborder="0" />
<qr-code
v-if="qrLink"
:value="qrLink"
:width="230"
:height="230"
class="qrcode"
:type="'image/jpeg'"
:color="{ dark: '#000000ff', light: '#ffffffff' }"
/>
</el-dialog>
</template>
@@ -16,11 +25,18 @@ import { defineComponent } from 'vue';
import { ElDialog } from 'element-plus';
import { getBaseUrlAuth } from '@/utils';
import { getCookie } from 'typescript-cookie';
import QrCode from 'vue-qrcode';
export default defineComponent({
name: 'AuthPanel',
components: {
ElDialog
ElDialog,
QrCode
},
data() {
return {
qrLink: ''
};
},
computed: {
iframeUrl() {
@@ -47,6 +63,7 @@ export default defineComponent({
if (event.origin !== getBaseUrlAuth()) {
return;
}
console.debug('received from child page', event);
if (event.data.name === 'login') {
const data = event.data.data;
const token = {
@@ -58,6 +75,13 @@ export default defineComponent({
await this.$store.dispatch('getUser');
window.location.reload();
}
if (event.data.name === 'show_qr') {
const data = event.data.data;
this.qrLink = data.qrLink;
}
if (event.data.name === 'hide_qr') {
this.qrLink = '';
}
});
}
});
@@ -68,4 +92,14 @@ export default defineComponent({
width: 400px;
height: 600px;
}
.qrcode {
width: 320px;
height: 320px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0.001;
}
</style>
+6 -2
View File
@@ -3,7 +3,7 @@
<el-row class="paycodes">
<el-col :span="12">
<div class="paycode wechat">
<qr-code v-if="modelValue?.pay_url" :value="modelValue?.pay_url" :size="200" class="m-auto" />
<qr-code v-if="modelValue?.pay_url" :value="modelValue?.pay_url" :size="200" class="qrcode m-auto" />
<p class="help-text">{{ $t('order.message.wechatPayHelp') }}</p>
</div>
</el-col>
@@ -20,7 +20,7 @@
import { IOrder, IOrderDetailResponse, orderOperator, OrderState } from '@/operators';
import { defineComponent } from 'vue';
import { ElDialog, ElRow, ElCol } from 'element-plus';
import QrCode from 'qrcode.vue';
import QrCode from 'vue-qrcode';
interface IData {
refreshTimer: number | undefined;
@@ -95,6 +95,10 @@ export default defineComponent({
width: 500px;
margin: auto;
.wechat {
.qrcode {
width: 200px;
height: 200px;
}
.help-text {
display: block;
background-color: #00c800;
+1 -1
View File
@@ -205,7 +205,7 @@ import {
} from '@/operators';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { IUser, userOperator } from '@/operators';
import QrCode from 'qrcode.vue';
import QrCode from 'vue-qrcode';
import { ROUTE_DISTRIBUTION_HISTORY, ROUTE_DISTRIBUTION_INVITEES } from '@/router';
interface IData {