mo преди 5 години
родител
ревизия
76ffdb56fc
променени са 7 файла, в които са добавени 120 реда и са изтрити 22 реда
  1. 0 0
      dist/index.html
  2. 0 0
      dist/static/css/app.5c68d45f.css
  3. 0 0
      dist/static/js/app.94117421.js
  4. 0 0
      dist/static/js/app.cbaee525.js
  5. 0 0
      dist/static/js/chunk-libs.3cf2b7f2.js
  6. 1 0
      package.json
  7. 119 22
      src/views/dashboard/index.vue

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/index.html


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/app.5c68d45f.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.94117421.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.cbaee525.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/chunk-libs.3cf2b7f2.js


+ 1 - 0
package.json

@@ -22,6 +22,7 @@
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
+    "qrcodejs2": "0.0.2",
     "qs": "^6.8.0",
     "save-dev": "^2.0.0",
     "vue": "2.6.10",

+ 119 - 22
src/views/dashboard/index.vue

@@ -73,10 +73,15 @@
                    plain
                    v-if="majorStatus == 1 || majorStatus == 2"
                    @click="showFade('','','','')">批量调剂</el-button>
+
+        <!--  v-if="majorStatus == 1" -->
         <el-button type='danger'
                    icon='el-icon-position'
-                   v-if="majorStatus == 1"
                    @click="getMoney">开启缴费</el-button>
+        <el-button type='warning'
+                   icon="el-icon-news"
+                   v-if='this.majorId'
+                   @click='openUrl'>打开二维码</el-button>
       </el-form>
       <!-- 提示语 -->
       <p class="subMsg"
@@ -180,12 +185,51 @@
         </div>
       </div>
     </div>
+    <el-dialog title="二维码"
+               :visible.sync="code"
+               width="30%">
+      <div class="wrap">
+        <div id="qrCode"
+             ref="qrCodeDiv"></div>
+      </div>
+
+    </el-dialog>
+
+    <!-- 弹出框 -->
+    <el-dialog title="提示:请输入短信模板"
+               :visible.sync="isDialog"
+               width="30%">
+      <el-form v-model="dialogForm">
+        <el-form-item>
+          <el-input type="textarea"
+                    :disabled="isRadioDisabled"
+                    :rows="3"
+                    v-model="dialogForm.text"
+                    placeholder="请输入短信模板"></el-input>
+        </el-form-item>
+      </el-form>
+      <div class="radioWrap"
+           style="margin-top:20px">
+        <el-radio v-model="radio"
+                  :label="1">线上</el-radio>
+        <el-radio v-model="radio"
+                  :label="2">线下</el-radio>
+      </div>
+
+      <span slot="footer"
+            class="dialog-footer">
+        <el-button type="primary"
+                   @click="gotoMoneyok">确 定</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 <script>
 import qs from "qs";
 // import { loading } from "element-ui";
 import { scrollTo } from '@/utils/scroll-to'
+import QRCode from 'qrcodejs2'
 import {
   getAllMajor,
   getMusicTeams,
@@ -230,6 +274,15 @@ export default {
       disabled: true, // 判断单个调剂按钮能否点击
       activeMarjorId: '-1', // 选中乐团的id
       studentStatus: '-1', //单个学生调剂时学生状态
+      isDialog: false, // 显示隐藏弹框
+      radio: 2, // 线上线下的选择框
+      isRadioDisabled: false,
+      dialogForm: {
+        text: ''
+      },
+      code: false,
+      first: true,
+      qrcodes: ''
     };
   },
   methods: {
@@ -256,7 +309,7 @@ export default {
           }
         })
         .catch(res => {
-          console.log(res);
+
         });
     },
     // 获取所有乐团列表
@@ -376,26 +429,7 @@ export default {
     },
     // 点击开始缴费 1报名中,2缴费中,3报名截止,4已开团
     getMoney () {
-      // 开启缴费按钮 新增配置短信文案参数 smsMsg
-      this.$prompt('请输入短信模板', '提示', {
-        confirmButtonText: '确定',
-        inputType: 'textarea',
-        showCancelButton: false,
-        inputPattern: /\S/,
-        inputErrorMessage: '短信模板不能为空'
-      }).then(({ value }) => {
-        updateClass(qs.stringify({ id: this.majorId, smsMsg: value })).then(res => {
-          if (res.code == 200) {
-            this.$message.success("乐团报名成功请尽快缴费");
-            setTimeout(() => {
-              this.getstudentList();
-              this.majorStatus = 2;
-            }, 1000);
-          } else {
-            this.$message.error(res.msg)
-          }
-        });
-      })
+      this.isDialog = true;
     },
     handleCurrentChange (val) {
       this.page = val;
@@ -428,6 +462,63 @@ export default {
       } else {
         return true;
       }
+    },
+    // 点击打开报名链接
+    openUrl () {
+      // debugger
+      this.code = true;
+      this.qrcode();
+      // window.open(`https://pay.dayaedu.com/#/order?classId=${this.majorId}&schoolName=${this.actionTearm}`)
+    },
+    gotoMoneyok () {      
+      let val = this.dialogForm.text;
+      if (this.radio != 1) {
+        // 线上
+
+        if (!val.trim()) {
+          this.$message.error('请输入短信模板');
+          return;
+        }
+      }
+
+      updateClass(qs.stringify({ id: this.majorId, smsMsg: val, type: this.radio })).then(res => {
+        if (res.code == 200) {
+          this.$message.success("乐团报名成功请尽快缴费");
+          setTimeout(() => {
+            this.getstudentList();
+            this.majorStatus = 2;
+            this.isDialog = false;
+            this.dialogForm.text = '';
+          }, 1000);
+        } else {
+          this.$message.error(res.msg)
+        }
+      });
+    },
+    qrcode () {
+
+      setTimeout(() => {
+        this.qrcodes = new QRCode(document.getElementById("qrCode"), {
+          width: 200, // 设置宽度,单位像素
+          height: 200, // 设置高度,单位像素
+          text: `https://pay.dayaedu.com/#/order?classId=${this.majorId}&schoolName=${this.actionTearm}` // 设置二维码内容或跳转地址
+        })
+      }, 100)
+      if (document.getElementById("qrCode")) {
+        document.getElementById("qrCode").innerHTML = ''
+      }
+
+    },
+    // hidecode () {
+    // }
+  },
+  watch: {
+    radio (val) {
+      if (val == 1) {
+        this.isRadioDisabled = true;
+      } else {
+        this.isRadioDisabled = false;
+      }
     }
   },
   computed: {
@@ -530,4 +621,10 @@ export default {
   color: #ccc;
   margin-top: 100px;
 }
+.wrap {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
 </style>

Някои файлове не бяха показани, защото твърде много файлове са промени