From c5b5706cd645440a877c546978751b63bf40d008 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期五, 20 九月 2024 10:13:11 +0800 Subject: [PATCH] ll --- h5_meeting/pages/index/index.vue | 38 +++++++++++++++++++++++++++++--------- 1 files changed, 29 insertions(+), 9 deletions(-) diff --git a/h5_meeting/pages/index/index.vue b/h5_meeting/pages/index/index.vue index 91910e4..b93eb84 100644 --- a/h5_meeting/pages/index/index.vue +++ b/h5_meeting/pages/index/index.vue @@ -28,7 +28,8 @@ <text>棰勭害浜猴細{{meetingInfo.bookingUser }}</text> </view> </view> - <vueQr v-if="meetingInfo.id" :text="meetingInfo.id" class="qrcode" /> + <canvas id="qrcode" canvas-id="qrcode" class="qrcode"></canvas> + <!-- <vueQr v-if="meetingInfo.id" :text="meetingInfo.id" class="qrcode" /> --> </view> <view class="meeting_wrap"> <view class="title">浠婃棩浼氳锛坽{ info.meetingListResponseList && info.meetingListResponseList.length > 0 ? info.meetingListResponseList.length : 0 }}锛�</view> @@ -63,12 +64,13 @@ <script> import dayjs from 'dayjs' - import vueQr from 'vue-qr/src/packages/vue-qr.vue' + // import vueQr from 'vue-qr/src/packages/vue-qr.vue' + import UQRCode from 'uqrcodejs' import { meetScreenData } from '@/api/index.js' export default { - components: {vueQr}, + // components: {vueQr}, data() { return { time: '', @@ -87,7 +89,7 @@ meetingInfo: {} } }, - onLoad() { + onShow() { this.initDatetime() this.param = uni.getStorageSync('param') || {} if (!this.param.code) { @@ -96,6 +98,8 @@ }) } this.getData() + }, + onReady() { }, methods: { getData() { @@ -105,9 +109,25 @@ this.info = res.data if(this.info.meetingListResponseList && this.info.meetingListResponseList.length > 0){ this.meetingInfo = this.info.meetingListResponseList[0] - this.$forceUpdate() + this.qrcodeCreate() } }) + }, + qrcodeCreate(){ + // 鑾峰彇uQRCode瀹炰緥 + var qr = new UQRCode(); + // 璁剧疆浜岀淮鐮佸唴瀹� + qr.data = "https://uqrcode.cn/doc"; + // 璁剧疆浜岀淮鐮佸ぇ灏忥紝蹇呴』涓巆anvas璁剧疆鐨勫楂樹竴鑷� + qr.size = 83; + // 璋冪敤鍒朵綔浜岀淮鐮佹柟娉� + qr.make(); + // 鑾峰彇canvas涓婁笅鏂� + var canvasContext = uni.createCanvasContext('qrcode', this); // 濡傛灉鏄粍浠讹紝this蹇呴』浼犲叆 + // 璁剧疆uQRCode瀹炰緥鐨刢anvas涓婁笅鏂� + qr.canvasContext = canvasContext; + // 璋冪敤缁樺埗鏂规硶灏嗕簩缁寸爜鍥炬缁樺埗鍒癱anvas涓� + qr.drawCanvas(); }, touchend() { this.touchNum++ @@ -169,7 +189,7 @@ display: flex; flex-direction: column; justify-content: space-between; - padding-bottom: 35rpx; + padding-bottom: 42rpx; color: #fff; overflow: hidden; .meeting_wrap { @@ -260,8 +280,8 @@ } .qrcode { - width: 166rpx; - height: 166rpx; + width: 83px; + height: 83px; } } @@ -285,7 +305,7 @@ } .header_wrap { - padding: 34rpx 34rpx 0 0; + padding: 42rpx 34rpx 0 0; display: flex; justify-content: space-between; align-items: center; -- Gitblit v1.9.3