Browse Source

修复测试

1
mo 4 years ago
parent
commit
d447649190
1 changed files with 32 additions and 27 deletions
  1. 32 27
      src/views/reaplceMusicPlayer/index.vue

+ 32 - 27
src/views/reaplceMusicPlayer/index.vue

@@ -22,11 +22,12 @@
       </div>
       <save-form
         :inline="true"
+        ref='searchForm'
         :model="searchForm"
         @submit="search"
         @reset="onReSet"
       >
-        <el-form-item>
+        <el-form-item prop="search">
           <el-input
             v-model.trim="searchForm.search"
             clearable
@@ -171,9 +172,13 @@
         >
       </div>
     </el-dialog>
-    <el-dialog :title="qrcodeName" :visible.sync="qrcodeStatus" width="300px">
+
+      <qr-code v-model="qrcodeStatus"
+             :title="qrcodeName"
+             :codeUrl="codeUrl" />
+
+    <!-- <el-dialog :title="qrcodeName" :visible.sync="qrcodeStatus" width="300px">
       <div class="left-code">
-        <!-- <h2>学员报名连接</h2> -->
         <div id="qrcode" class="qrcode code" ref="qrCodeUrl"></div>
         <p class="code-url" v-if="codeUrl">
           <copy-text>
@@ -181,7 +186,7 @@
           </copy-text>
         </p>
       </div>
-    </el-dialog>
+    </el-dialog> -->
   </div>
 </template>
 
@@ -195,9 +200,9 @@ import addUrl from "./modals/addUrl";
 import detail from "./modals/detail";
 import load from "@/utils/loading";
 import { getReplacementList, openPayReplacement } from "./api";
-import QRCode from "qrcodejs2";
+import QrCode from "@/components/QrCode/index";
 export default {
-  components: { pagination, addUrl, detail },
+  components: { pagination, addUrl, detail, QrCode, },
   data() {
     return {
       searchForm: {
@@ -255,7 +260,10 @@ export default {
       this.rules.page = 1;
       this.getList();
     },
-    onReSet() {},
+    onReSet() {
+      this.$refs.searchForm.resetFields()
+      this.search()
+    },
     makeUrl() {
       this.makeUrlVisible = true;
     },
@@ -279,32 +287,29 @@ export default {
       if (this.qrcodes) {
         this.qrcodes = false;
 
-        setTimeout(() => {
-          document.getElementById("qrcode").innerHTML = "";
-          this.qrcode = new QRCode("qrcode", {
-            width: 260,
-            height: 260,
-            colorDark: "#000000",
-            colorLight: "#ffffff",
-            correctLevel: QRCode.CorrectLevel.H,
-          });
+        // setTimeout(() => {
+        //   document.getElementById("qrcode").innerHTML = "";
+        //   this.qrcode = new QRCode("qrcode", {
+        //     width: 260,
+        //     height: 260,
+        //     colorDark: "#000000",
+        //     colorLight: "#ffffff",
+        //     correctLevel: QRCode.CorrectLevel.H,
+        //   });
           let str;
           if (name == "调查链接") {
-            str = vaildStudentUrl();
+            str = vaildStudentUrl()+`/#/questionnaire?o=${row.organId}&c=${row.cooperationOrganId}`;
           } else if (name == "统计链接") {
-            str = vaildTeachingUrl();
+            str = vaildTeachingUrl()+`/#/questionStatistics?o=${row.organId}&c=${row.cooperationOrganId}`;
           }
-          console.log(str);
           // vaildTeachingUrl
-          this.qrcode.makeCode(
-            str +
-              `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`
-          );
-          this.codeUrl =
-            str +
-            `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`;
+          // this.qrcode.makeCode(
+          //   str +
+          //     `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`
+          // );
+          this.codeUrl =str;
           this.qrcodes = true;
-        }, 500);
+        // }, 100);
       }
     },
     openPay(row) {