ll
liukangdong
2024-09-20 c5b5706cd645440a877c546978751b63bf40d008
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";
              // 设置二维码大小,必须与canvas设置的宽高一致
              qr.size = 83;
              // 调用制作二维码方法
              qr.make();
              // 获取canvas上下文
              var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
              // 设置uQRCode实例的canvas上下文
              qr.canvasContext = canvasContext;
              // 调用绘制方法将二维码图案绘制到canvas上
              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;