Tang 2 роки тому
батько
коміт
c92fd599fa

+ 8 - 5
build/webpack.prod.conf.js

@@ -22,17 +22,20 @@ switch (process.env.ENV_ID) {
   case '962':
     env = require('../config/962.env')
     break;
-  case '680':
-    env = require('../config/680.env')
+  case 'prod':
+    env = require('../config/prod.env')
     break;
-  case 'test':
-    env = require('../config/test.env')
+  case 'stage':
+    env = require('../config/stage.env')
+    break;
+  case 'prd':
+    env = require('../config/prd.env')
     break;
   case 'zz':
     env = require('../config/zz.env')
     break;
   default:
-    env = require('../config/680.env')
+    env = require('../config/prod.env')
     break;
 }
 const webpackConfig = merge(baseWebpackConfig, {

+ 11 - 0
config/prd.env.js

@@ -0,0 +1,11 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"',
+  BASE_IMG_URL: '"https://file.xyyxt.net/"', //图片上传api
+  BASE_URL: '"https://test.xyyxt.net"',//预发布
+  TENANT_ID: '"867735392558919680"',
+  ENV_ID: '"prd"',//预发布环境
+  WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片
+  WEAPP_STATUS: true,//小程序相关显示
+  TENANT_NANE: '"祥粤云学堂"',
+}

+ 2 - 2
config/680.env.js → config/prod.env.js

@@ -2,9 +2,9 @@
 module.exports = {
   NODE_ENV: '"production"',
   BASE_IMG_URL: '"https://file.xyyxt.net/"', //图片上传api
-  BASE_URL: '"https://api.xyyxt.net"',
+  BASE_URL: '"https://api.xyyxt.net"',//正式
   TENANT_ID: '"867735392558919680"',
-  ENV_ID: '"680"',//生产环境
+  ENV_ID: '"prod"',//生产环境
   WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片
   WEAPP_STATUS: true,//小程序相关显示
   TENANT_NANE: '"祥粤云学堂"',

+ 1 - 1
config/test.env.js → config/stage.env.js

@@ -5,7 +5,7 @@ module.exports = {
     BASE_URL: '"https://testapi.xyyxt.net"',
     // BASE_URL: '"http://120.79.166.78:19012"',
     TENANT_ID: '"867735392558919680"',
-    ENV_ID: '"test"',//测试环境
+    ENV_ID: '"stage"',//测试环境
     WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片
     TENANT_NANE: '"祥粤云学堂"'
 }

+ 3 - 2
package.json

@@ -11,8 +11,9 @@
     "build:145": "cross-env NODE_ENV=production ENV_ID=145 node build/build.js",
     "build:520": "cross-env NODE_ENV=production ENV_ID=520 node build/build.js",
     "build:962": "cross-env NODE_ENV=production ENV_ID=962 node build/build.js",
-    "build:test": "cross-env NODE_ENV=production ENV_ID=test node build/build.js",
-    "build:prod": "cross-env NODE_ENV=production ENV_ID=680 node build/build.js",
+    "build:stage": "cross-env NODE_ENV=production ENV_ID=stage node build/build.js",
+    "build:prod": "cross-env NODE_ENV=production ENV_ID=prod node build/build.js",
+    "build:prd": "cross-env NODE_ENV=production ENV_ID=prd node build/build.js",
     "build:zz": "cross-env NODE_ENV=production ENV_ID=zz node build/build.js"
   },
   "dependencies": {

+ 1 - 1
src/axios.js

@@ -2,7 +2,7 @@ import axios from 'axios'
 import store from './store'
 import { Notification, Message } from 'element-ui'
 export const BASE_URL = process.env.BASE_URL    //测试-外网
-// export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
+// export const BASE_URL = "https://test.xyyxt.net"    //测试-外网
 export const tenantId = process.env.TENANT_ID
 import tools from './common/tools'
 import router from './router'

+ 116 - 102
src/pages/person-center/mock-record/index.vue

@@ -2,6 +2,7 @@
   <div class="bank-record">
     <div class="bank-record__header">
       <div class="title">模考记录</div>
+
       <!-- <div class="content">
         <el-select
           clearable
@@ -33,73 +34,85 @@
         </el-select>
       </div> -->
     </div>
-
-    <div class="bank-record__body">
-      <div class="bank-item" v-for="(record, index) in recordList" :key="index">
-        <div class="bank-item__header">
-          <div class="note" v-if="record.paperName">{{ record.paperName }}</div>
-          {{ record.examName }}
-        </div>
-        <div class="bank-item__body">
-          <div class="list">
-            <div class="exam-item">
-              <div class="exam-item__body">
-                <div class="text">
-                  <span class="title">{{
-                    $tools.timestampToTime(record.updateTime, false)
-                  }}</span>
-                  <span class="desc"
-                    >总{{ record.totalQuestionNum }}题/对{{
-                      record.rightQuestionNum
-                    }}题</span
-                  >
-                </div>
-                <div class="btns-wrap">
-                  <div class="btns">
-                    <div class="btn-line">
-                      <div class="btn-line__in" @click="doRepeat(record)" v-if="false">
-                        <div>重新做题</div>
-                      </div>
-                      <div
-                        class="btn-line__in"
-                        @click="
-                          go('/mock-exam-all-explain/' + record.recordId, {
-                            examId: record.examId,
-                            simulateStatus: record.doMode === 3 ? 1 : 0,
-                          })
-                        "
-                      >
-                        <div>解析</div>
-                      </div>
-
-                      <div
-                        class="btn-line__in"
-                        @click="
-                          go('/mock-report', {
-                            subscribeId: record.subscribeId,
-                            eachExamId: record.eachExamId,
-                            examId: record.examId,
-                            recordId: record.recordId,
-                          })
-                        "
-                      >
-                        <div>做题报告</div>
-                      </div>
-                      <div
-                      v-if="false"
-                        class="btn-line__in"
-                        @click="
-                          go(
-                            '/person-center/mock-record-list/' + record.goodsId,
-                            {
+    <div class="play-record__body" v-if="total > 0">
+      <div class="bank-record__body">
+        <div
+          class="bank-item"
+          v-for="(record, index) in recordList"
+          :key="index"
+        >
+          <div class="bank-item__header">
+            <div class="note" v-if="record.paperName">
+              {{ record.paperName }}
+            </div>
+            {{ record.examName }}
+          </div>
+          <div class="bank-item__body">
+            <div class="list">
+              <div class="exam-item">
+                <div class="exam-item__body">
+                  <div class="text">
+                    <span class="title">{{
+                      $tools.timestampToTime(record.updateTime, false)
+                    }}</span>
+                    <span class="desc"
+                      >总{{ record.totalQuestionNum }}题/对{{
+                        record.rightQuestionNum
+                      }}题</span
+                    >
+                  </div>
+                  <div class="btns-wrap">
+                    <div class="btns">
+                      <div class="btn-line">
+                        <div
+                          class="btn-line__in"
+                          @click="doRepeat(record)"
+                          v-if="false"
+                        >
+                          <div>重新做题</div>
+                        </div>
+                        <div
+                          class="btn-line__in"
+                          @click="
+                            go('/mock-exam-all-explain/' + record.recordId, {
                               examId: record.examId,
-                              recordId: record.recordId,
+                              simulateStatus: record.doMode === 3 ? 1 : 0
+                            })
+                          "
+                        >
+                          <div>解析</div>
+                        </div>
+
+                        <div
+                          class="btn-line__in"
+                          @click="
+                            go('/mock-report', {
+                              subscribeId: record.subscribeId,
                               eachExamId: record.eachExamId,
-                            }
-                          )
-                        "
-                      >
-                        <div>更多记录</div>
+                              examId: record.examId,
+                              recordId: record.recordId
+                            })
+                          "
+                        >
+                          <div>做题报告</div>
+                        </div>
+                        <div
+                          v-if="false"
+                          class="btn-line__in"
+                          @click="
+                            go(
+                              '/person-center/mock-record-list/' +
+                                record.goodsId,
+                              {
+                                examId: record.examId,
+                                recordId: record.recordId,
+                                eachExamId: record.eachExamId
+                              }
+                            )
+                          "
+                        >
+                          <div>更多记录</div>
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -109,21 +122,22 @@
           </div>
         </div>
       </div>
-    </div>
 
-    <div class="bank-record__footer">
-      <div class="pagination">
-        <el-pagination
-          @current-change="currentChange"
-          background
-          layout="prev, pager, next"
-          :total="total"
-          :pager-count="5"
-          :page-size="param.pageSize"
-        >
-        </el-pagination>
+      <div class="bank-record__footer">
+        <div class="pagination">
+          <el-pagination
+            @current-change="currentChange"
+            background
+            layout="prev, pager, next"
+            :total="total"
+            :pager-count="5"
+            :page-size="param.pageSize"
+          >
+          </el-pagination>
+        </div>
       </div>
     </div>
+    <el-empty description="暂无模考记录" v-else></el-empty>
   </div>
 </template>
 
@@ -138,10 +152,10 @@ export default {
         pageNum: 1,
         pageSize: 10,
         goodsId: "",
-        paperId: "",
+        paperId: ""
       },
       recordList: [],
-      total: 0,
+      total: 0
     };
   },
   mounted() {
@@ -155,28 +169,28 @@ export default {
       this.mockRecordGroupList();
     },
     examaperList() {
-      this.$request.examaperList().then((res) => {
+      this.$request.examaperList().then(res => {
         this.list1 = res.rows;
         this.list1.unshift({
           paperId: "",
-          paperName: "全部试卷类型",
+          paperName: "全部试卷类型"
         });
       });
     },
 
     listGoodsUserQuestion() {
-      this.$request.listGoodsUserQuestion().then((res) => {
+      this.$request.listGoodsUserQuestion().then(res => {
         this.list = res.rows;
         this.list.unshift({
           goodsId: "",
-          goodsName: "全部题库记录",
+          goodsName: "全部题库记录"
         });
       });
     },
     go(path, query) {
       this.$router.push({
         path,
-        query,
+        query
       });
     },
     currentChange(e) {
@@ -184,7 +198,7 @@ export default {
       this.mockRecordGroupList();
     },
     mockRecordGroupList() {
-      this.$request.mockRecordGroupList(this.param).then((res) => {
+      this.$request.mockRecordGroupList(this.param).then(res => {
         this.recordList = res.rows;
         this.total = res.total;
       });
@@ -198,8 +212,8 @@ export default {
           eachExamId: section.eachExamId,
           subscribeId: section.subscribeId,
           goodsId: section.goodsId,
-          orderGoodsId: section.orderGoodsId,
-        },
+          orderGoodsId: section.orderGoodsId
+        }
       });
 
       return;
@@ -209,7 +223,7 @@ export default {
       if (answerNum > 0 && count >= answerNum) {
         this.$message({
           type: "warning",
-          message: "该试卷只能答题" + answerNum + "次!",
+          message: "该试卷只能答题" + answerNum + "次!"
         });
         return;
       }
@@ -220,20 +234,20 @@ export default {
         closeOnClickModal: false,
         closeOnPressEscape: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       })
-        .then((_) => {
+        .then(_ => {
           this.$router.push({
             path: "/bank-exam/" + section.goodsId,
             query: {
               orderGoodsId: section.orderGoodsId,
               examId: section.examId,
               moduleId: section.moduleExamId || 0,
-              chapterId: section.chapterExamId || 0,
-            },
+              chapterId: section.chapterExamId || 0
+            }
           });
         })
-        .catch((_) => {
+        .catch(_ => {
           this.$router.push({
             path: "/bank-exam-all-explain/" + section.recordId,
             query: {
@@ -241,8 +255,8 @@ export default {
               moduleId: section.moduleExamId || 0,
               chapterId: section.chapterExamId || 0,
               goodsId: section.goodsId,
-              orderGoodsId: section.orderGoodsId,
-            },
+              orderGoodsId: section.orderGoodsId
+            }
           });
         });
     },
@@ -251,13 +265,13 @@ export default {
      * 查询试卷历史做题次数
      */
     examRecordCount(examId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .examRecordCount({
             examId: examId,
-            goodsId: this.id,
+            goodsId: this.id
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
@@ -267,13 +281,13 @@ export default {
      * 获取试卷可以做的次数
      */
     getExamDetail(exam_id) {
-      return new Promise((resolve) => {
-        this.$request.getExamDetail(exam_id).then((res) => {
+      return new Promise(resolve => {
+        this.$request.getExamDetail(exam_id).then(res => {
           resolve(res.data.answerNum);
         });
       });
-    },
-  },
+    }
+  }
 };
 </script>