Explorar o código

fix(shareDialog): restore and enable qrcode generation feature

restore the commented qrcode component and related logic, enable the download qrcode function in share dialog
lsc hai 2 semanas
pai
achega
4ab2cfa0b4
Modificáronse 1 ficheiros con 14 adicións e 14 borrados
  1. 14 14
      src/components/pptEasyClass/shareDialog.vue

+ 14 - 14
src/components/pptEasyClass/shareDialog.vue

@@ -19,8 +19,8 @@
             </div></template
           >
         </el-input>
-        <!-- <div class="qrcode" ref="qrCodeRef"></div>
-				<el-link class="qrcodeBtn" type="primary" @click="downloadQrCode()">下载二维码</el-link> -->
+        <div class="qrcode" ref="qrCodeRef"></div>
+				<el-link class="qrcodeBtn" type="primary" @click="downloadQrCode()">下载二维码</el-link>
       </div>
       <!-- <span slot="footer" class="shareFooter">
         <el-button @click="close()">{{ lang.ssCancelBtn }}</el-button>
@@ -55,18 +55,18 @@ export default {
   watch: {
     "form.url"(newValue) {
       console.log(newValue)
-      // this.$nextTick(() => {
-      //   this.$refs.qrCodeRef.innerHTML = "";
-      //   if (!newValue) return;
-      //   new QRCode(this.$refs.qrCodeRef, {
-      //     text: `https://beta.cloud.cocorobo.cn/#/?shareCourseId=${this.courseId}`, // 需要转换为二维码的内容
-      //     width: 100,
-      //     height: 100,
-      //     colorDark: "#000000",
-      //     colorLight: "#ffffff",
-      //     correctLevel: QRCode.CorrectLevel.H
-      //   });
-      // });
+      this.$nextTick(() => {
+        this.$refs.qrCodeRef.innerHTML = "";
+        if (!newValue) return;
+        new QRCode(this.$refs.qrCodeRef, {
+          text: `https://beta.cloud.cocorobo.cn/#/?shareCourseId=${this.courseId}`, // 需要转换为二维码的内容
+          width: 100,
+          height: 100,
+          colorDark: "#000000",
+          colorLight: "#ffffff",
+          correctLevel: QRCode.CorrectLevel.H
+        });
+      });
     }
   },
   methods: {