瀏覽代碼

添加考生App下载

Michael Wang 5 年之前
父節點
當前提交
2b2051ad9b
共有 4 個文件被更改,包括 42 次插入7 次删除
  1. 32 6
      src/components/MainLayout/MainLayout.vue
  2. 2 1
      src/features/Login/Login.vue
  3. 4 0
      src/plugins/iview.js
  4. 4 0
      src/store.js

+ 32 - 6
src/components/MainLayout/MainLayout.vue

@@ -1,12 +1,24 @@
 <template>
 <template>
   <div class="main-layout">
   <div class="main-layout">
     <header class="header qm-primary-text">
     <header class="header qm-primary-text">
-      <Poptip v-if="ifShowQr" trigger="hover" width="240">
+      <Poptip v-if="ifShowQr" trigger="hover" width="280">
         <span class="name-arrow">手机端登录(Android)</span>
         <span class="name-arrow">手机端登录(Android)</span>
         <div slot="content">
         <div slot="content">
-          <div class="qm-primary-text">
-            <qrcode :value="qrValue" :options="{ width: 200 }"></qrcode>
-          </div>
+          <Tabs type="card">
+            <TabPane label="下载安卓apk">
+              <div class="qm-primary-text flex-center">
+                <qrcode
+                  :value="qrValue"
+                  :options="{ width: 200 }"
+                ></qrcode></div
+            ></TabPane>
+            <TabPane label="绑定用户">
+              <div class="qm-primary-text flex-center">
+                <qrcode :value="qrValue" :options="{ width: 200 }"></qrcode>
+                <div>请使用“云考”App扫描</div>
+              </div></TabPane
+            >
+          </Tabs>
         </div>
         </div>
       </Poptip>
       </Poptip>
       <span v-if="ifShowQr" style="margin: auto 20px">|</span>
       <span v-if="ifShowQr" style="margin: auto 20px">|</span>
@@ -107,15 +119,23 @@ import SiteMessagePopup from "./SiteMessagePopup.vue";
 export default {
 export default {
   name: "MainLayout",
   name: "MainLayout",
   data() {
   data() {
-    return {};
+    return {
+      appDownloadUrl: "fetching...",
+    };
   },
   },
   methods: {
   methods: {
     goChangePwd() {
     goChangePwd() {
       this.$router.push("/password");
       this.$router.push("/password");
     },
     },
   },
   },
+  async created() {
+    const r = await this.$http.get(
+      "/api/ecs_core/systemProperty/APP_DOWNLOAD_URL"
+    );
+    this.appDownloadUrl = r.data;
+  },
   computed: {
   computed: {
-    ...mapState(["user", "siteMessages"]),
+    ...mapState(["user", "siteMessages", "QECSConfig"]),
     messageUnread() {
     messageUnread() {
       return this.siteMessages.filter(v => v.hasRead === false).length;
       return this.siteMessages.filter(v => v.hasRead === false).length;
     },
     },
@@ -216,6 +236,12 @@ export default {
   margin: 30px auto;
   margin: 30px auto;
 }
 }
 
 
+.flex-center {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
 .link {
 .link {
   background-image: url(./link.png);
   background-image: url(./link.png);
   background-repeat: no-repeat;
   background-repeat: no-repeat;

+ 2 - 1
src/features/Login/Login.vue

@@ -268,7 +268,7 @@ export default {
     clearInterval(this.checkNewVersionInterval);
     clearInterval(this.checkNewVersionInterval);
   },
   },
   methods: {
   methods: {
-    ...mapMutations(["updateUser", "updateTimeDifference"]),
+    ...mapMutations(["updateUser", "updateTimeDifference", "updateQECSConfig"]),
     async login() {
     async login() {
       if (this.disableLoginBtn) {
       if (this.disableLoginBtn) {
         return;
         return;
@@ -424,6 +424,7 @@ export default {
         if (res.ok) {
         if (res.ok) {
           const json = await res.json();
           const json = await res.json();
           this.QECSConfig = json;
           this.QECSConfig = json;
+          this.updateQECSConfig(json);
         } else {
         } else {
           this.$Message.error({
           this.$Message.error({
             content: "获取远程配置文件出错,请重新刷新网页!",
             content: "获取远程配置文件出错,请重新刷新网页!",

+ 4 - 0
src/plugins/iview.js

@@ -21,6 +21,8 @@ import {
   Alert,
   Alert,
   Table,
   Table,
   Badge,
   Badge,
+  Tabs,
+  TabPane,
 } from "iview";
 } from "iview";
 Vue.component("Button", Button);
 Vue.component("Button", Button);
 Vue.component("Form", Form);
 Vue.component("Form", Form);
@@ -41,6 +43,8 @@ Vue.component("Progress", Progress);
 Vue.component("Alert", Alert);
 Vue.component("Alert", Alert);
 Vue.component("Table", Table);
 Vue.component("Table", Table);
 Vue.component("Badge", Badge);
 Vue.component("Badge", Badge);
+Vue.component("Tabs", Tabs);
+Vue.component("TabPane", TabPane);
 
 
 Vue.prototype.$Message = Message;
 Vue.prototype.$Message = Message;
 Vue.prototype.$Modal = Modal;
 Vue.prototype.$Modal = Modal;

+ 4 - 0
src/store.js

@@ -200,6 +200,7 @@ export default new Vuex.Store({
     timeDifference: 0,
     timeDifference: 0,
     siteMessages: [],
     siteMessages: [],
     siteMessagesTimeStamp: Date.now(),
     siteMessagesTimeStamp: Date.now(),
+    QECSConfig: {},
   },
   },
   mutations: {
   mutations: {
     updateUser(state, payload) {
     updateUser(state, payload) {
@@ -214,6 +215,9 @@ export default new Vuex.Store({
     updateSiteMessagesTimeStamp(state, payload) {
     updateSiteMessagesTimeStamp(state, payload) {
       state = Object.assign(state, { siteMessagesTimeStamp: payload });
       state = Object.assign(state, { siteMessagesTimeStamp: payload });
     },
     },
+    updateQECSConfig(state, payload) {
+      state = Object.assign(state, { QECSConfig: payload });
+    },
   },
   },
   actions: {},
   actions: {},
   modules: {
   modules: {