Browse Source

完整版

Tang 2 năm trước cách đây
mục cha
commit
54cfac10b3

+ 97 - 4
config/index.js

@@ -2,8 +2,14 @@
 // Template version: 1.3.1
 // see http://vuejs-templates.github.io/webpack for documentation.
 
-const path = require('path')
+const path = require('path') 
 
+const webpack = require('webpack')
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
+const CompressionWebpackPlugin = require('compression-webpack-plugin')
+function resolve(dir) {
+    return path.join(__dirname, dir);
+}
 module.exports = {
   dev: {
 
@@ -58,7 +64,7 @@ module.exports = {
      * Source Maps
      */
 
-    productionSourceMap: true,
+    // productionSourceMap: true,
     // https://webpack.js.org/configuration/devtool/#production
     devtool: '#source-map',
 
@@ -73,6 +79,93 @@ module.exports = {
     // View the bundle analyzer report after build finishes:
     // `npm run build --report`
     // Set to `true` or `false` to always turn it on or off
-    bundleAnalyzerReport: process.env.npm_config_report
-  }
+    bundleAnalyzerReport: process.env.npm_config_report,
+    
+  lintOnSave: false,//禁用代码检测
+  productionSourceMap: false,
+  chainWebpack: config => {
+      // ============压缩图片 start============
+      // config.module
+      //     .rule('images') 
+      //     .use('image-webpack-loader')
+      //     .loader('image-webpack-loader')
+      //     .options({ bypassOnDebug: true })
+      //     .end();
+      // ============压缩图片 end============
+      // 移除 prefetch 插件
+      config.plugins.delete('prefetch')
+      // 移除 preload 插件
+      config.plugins.delete('preload');
+      config.plugin('provide').use(webpack.ProvidePlugin, [{
+          'window.Quill': 'quill'
+      }])
+  },
+  configureWebpack: config => {
+          // 代码压缩
+          config.plugins.push(
+              new UglifyJsPlugin({
+                  uglifyOptions: {
+                      //生产环境自动删除console
+                      compress: {
+                          drop_debugger: true,
+                          drop_console: true,
+                          pure_funcs: ['console.log']
+                      },
+                      warnings: false, // 若打包错误,则注释这行
+                  },
+                  sourceMap: false,
+                  parallel: true
+              })
+          )
+          // gzip压缩
+          const productionGzipExtensions = ['html', 'js', 'css']
+          config.plugins.push(
+              new CompressionWebpackPlugin({
+                  filename: '[path].gz[query]',
+                  algorithm: 'gzip',
+                  test: new RegExp(
+                      '\\.(' + productionGzipExtensions.join('|') + ')$'
+                  ),
+                  threshold: 10240, // 只有大小大于该值的资源会被处理 10240
+                  minRatio: 0.8, // 只有压缩率小于这个值的资源才会被处理
+                  deleteOriginalAssets: false // 删除原文件
+              })
+          )
+          // 公共代码抽离
+          config.optimization = {
+              splitChunks: {
+                  cacheGroups: {
+                      vendor: {
+                          chunks: 'all',
+                          test: /node_modules/,
+                          name: 'vendor',
+                          minChunks: 1,
+                          maxInitialRequests: 5,
+                          minSize: 0,
+                          priority: 100
+                      },
+                      common: {
+                          chunks: 'all',
+                          test: /[\\/]src[\\/]js[\\/]/,
+                          name: 'common',
+                          minChunks: 2,
+                          maxInitialRequests: 5,
+                          minSize: 0,
+                          priority: 60
+                      },
+                      styles: {
+                          name: 'styles',
+                          test: /\.(sa|sc|c)ss$/,
+                          chunks: 'all',
+                          enforce: true
+                      },
+                      runtimeChunk: {
+                          name: 'manifest'
+                      }
+                  }
+              }
+          }
+      
+  },
+  },
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 843 - 29
package-lock.json


+ 2 - 0
package.json

@@ -37,9 +37,11 @@
     "vue-pdf": "^4.3.0",
     "vue-router": "^3.0.1",
     "vuex": "^3.6.2",
+    "compression-webpack-plugin": "^6.1.1",
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
+    "image-webpack-loader": "^8.1.0",
     "autoprefixer": "^7.1.2",
     "babel-core": "^6.22.1",
     "babel-helper-vue-jsx-merge-props": "^2.0.3",

+ 15 - 0
src/apis/course.js

@@ -180,6 +180,14 @@ export default {
 			params: data
 		})
 	},
+	// 查询商品所有子目录带试卷结构列表
+	studyrecordgoodsAllListWithExam(data) {
+		return request({
+			url: '/study/record/goodsAllListWithExam',
+			method: 'get',
+			params: data
+		})
+	},
 	// 重修课程目录
 	getRebuildCourse(data) {
 		return request({
@@ -211,6 +219,13 @@ export default {
 			params: data
 		})
 	},
+	studyRecordMenuAllListWithExam(data) {
+		return request({
+			url: '/study/record/menuAllListWithExam',
+			method: 'get',
+			params: data
+		})
+	},
 
 	gradeCheckGoodsStudy(data) {
 		return request({

+ 1 - 1
src/axios.js

@@ -1,7 +1,7 @@
 import axios from 'axios'
 import store from './store'
 export const BASE_URL = process.env.BASE_URL    //测试-外网
-// export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
+// export const BASE_URL = "http://192.168.1.24:5055"    //测试-外网
 export const tenantId = process.env.TENANT_ID
 import tools from './common/tools'
 import router from './router'

+ 6 - 0
src/components/header/index.vue

@@ -38,6 +38,12 @@
               :style="$route.path === '/bank-list' ? 'color:red;' : ''"
               >题库</a
             >
+            <a
+              v-if="item.name == '积分商城'"
+              @click="go('/points-list')"
+              :style="$route.path === '/points-list' ? 'color:red;' : ''"
+              >积分商城</a
+            >
           </li>
         </ul>
       </nav>

+ 176 - 110
src/pages/course-detail/components/CourseTree.vue

@@ -20,7 +20,7 @@
         <i
           :class="{
             'el-icon-caret-right': !courseItem.showList,
-            'el-icon-caret-bottom': courseItem.showList,
+            'el-icon-caret-bottom': courseItem.showList
           }"
         ></i>
         {{ courseItem.courseName }}
@@ -35,13 +35,11 @@
               <i
                 :class="{
                   'el-icon-caret-right': !menu.showList,
-                  'el-icon-caret-bottom': menu.showList,
+                  'el-icon-caret-bottom': menu.showList
                 }"
               ></i>
               <div class="MenuNames">
-                {{
-                  menu.menuName
-                }}
+                {{ menu.menuName }}
               </div>
             </div>
             <div class="item__content">
@@ -59,7 +57,7 @@
                     <i
                       :class="{
                         'el-icon-caret-right': !chapter.showList,
-                        'el-icon-caret-bottom': chapter.showList,
+                        'el-icon-caret-bottom': chapter.showList
                       }"
                     ></i
                     >{{ chapter.name }}
@@ -70,9 +68,10 @@
                     v-if="chapter.showList && chapter.type == 1"
                   >
                     <div
+                    :id="'section-'+section.typeId"
                       class="bank-section__item"
                       :class="{
-                        active: isActive(section),
+                        active: isActive(section)
                       }"
                       v-for="(section, sectionIndex) in chapter.list"
                       :key="sectionIndex"
@@ -106,8 +105,8 @@
                                   section.liveStartTime,
                                   (isDay = false)
                                 )
-                              }}</span
-                              > -
+                              }}</span>
+                              -
                               <span>{{
                                 $tools.timestampToTime(
                                   section.liveEndTime,
@@ -154,7 +153,7 @@
                             class="live-btn live-btn--yellow"
                             v-if="
                               section.liveStartTime <= nowTime &&
-                              section.liveEndTime > nowTime
+                                section.liveEndTime > nowTime
                             "
                           >
                             直播中
@@ -278,7 +277,7 @@
                     <i
                       :class="{
                         'el-icon-caret-right': !menu.showList,
-                        'el-icon-caret-bottom': menu.showList,
+                        'el-icon-caret-bottom': menu.showList
                       }"
                     ></i
                     >{{ menu.menuName }}
@@ -286,9 +285,10 @@
 
                   <div class="bank-section" v-if="menu.showList">
                     <div
+                      :id="'section-'+menu.typeId"
                       class="bank-section__item"
                       :class="{
-                        active: isActive(section),
+                        active: isActive(section)
                       }"
                       v-for="(section, sectionIndex) in menu.list"
                       :key="sectionIndex"
@@ -323,8 +323,8 @@
                                 section.liveStartTime,
                                 (isDay = false)
                               )
-                            }}</span
-                            > -
+                            }}</span>
+                            -
                             <span>{{
                               $tools.timestampToTime(
                                 section.liveEndTime,
@@ -369,7 +369,7 @@
                             class="live-btn live-btn--yellow"
                             v-if="
                               section.liveStartTime <= nowTime &&
-                              section.liveEndTime > nowTime
+                                section.liveEndTime > nowTime
                             "
                           >
                             直播中
@@ -450,9 +450,10 @@
             <div class="item__content">
               <div class="bank-section">
                 <div
+                :id="'section-'+menu.typeId"
                   class="bank-section__item"
                   :class="{
-                    active: isActive(menu),
+                    active: isActive(menu)
                   }"
                   @click="getResource(menu, 1, courseIndex)"
                 >
@@ -475,8 +476,8 @@
                             menu.liveStartTime,
                             (isDay = false)
                           )
-                        }}</span
-                        > -
+                        }}</span>
+                        -
                         <span>{{
                           $tools.timestampToTime(
                             menu.liveEndTime,
@@ -513,7 +514,7 @@
                       class="live-btn live-btn--yellow"
                       v-if="
                         menu.liveStartTime <= nowTime &&
-                        menu.liveEndTime > nowTime
+                          menu.liveEndTime > nowTime
                       "
                     >
                       直播中
@@ -551,7 +552,7 @@
       :close-on-press-escape="false"
       :show-close="false"
     >
-      <template v-if="!isLastVideo">
+      <template v-if="isLastVideo == 0">
         <p>当前视频已学完,继续学习下一个视频?</p>
         <div class="btn1">
           <el-button type="info" plain round @click="dialogPalyVisible = false"
@@ -560,6 +561,19 @@
           <el-button type="primary" @click="comfirm" round>确定</el-button>
         </div>
       </template>
+      <template v-else-if="isLastVideo == 2">
+        <p>
+          本章视频已学习完成,继续进行下一个考试?
+        </p>
+        <div class="btn2" style="display: flex;">
+          <el-button type="primary" round @click="dialogPalyVisible = false"
+            >取消</el-button
+          >
+          <el-button type="primary" round @click="gotoExamination"
+            >确定</el-button
+          >
+        </div>
+      </template>
       <template v-else>
         <p>
           当前是最后一个视频并已学习完,请检查所有章节的视频是否已学习完成。
@@ -581,24 +595,24 @@ export default {
       type: Array,
       default: () => {
         return [];
-      },
+      }
     },
     goodsLearningOrder: {
-      type: Number,
+      type: Number
     },
     sectionMaxNum: {
-      type: Number,
+      type: Number
     },
     sectionItem: {
       type: Object,
       default: () => {
         return {};
-      },
+      }
     },
     rebuild: {
       type: Number,
-      default: 0,
-    },
+      default: 0
+    }
   },
   data() {
     return {
@@ -608,19 +622,42 @@ export default {
       sectionExam: [],
       sectionExamList: [],
       dialogPalyVisible: false,
-      allSectionList: [],
+      allSectionList: []
     };
   },
   created() {
     this.init();
   },
   methods: {
+    gotoExamination() {
+      let A = this.allSectionList.findIndex(
+        i =>
+          i.moduleId == this.sectionItem.moduleId &&
+          i.chapterId == this.sectionItem.chapterId &&
+          i.sectionId == this.sectionItem.sectionId
+      );
+      if(A !== -1){
+        var a = 'section-'+this.allSectionList[A+1].examId
+        const btn = document.getElementById(a)
+        btn.onclick = () => {
+          //
+        };
+        const event = new MouseEvent("click", {
+          view: window,
+          bubbles: true,
+          cancelable: true,
+        });
+        btn.dispatchEvent(event);
+        console.log(a)
+      }
+      return;
+    },
     async init() {
       this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
       await this.getAllSectionList();
       this.treeList = await this.getDoubleTeacherList();
       let sectionItem = await this.backNextItem(
-        this.treeList.find((e) => e.courseId == this.activeCourseId),
+        this.treeList.find(e => e.courseId == this.activeCourseId),
         0,
         false
       );
@@ -636,7 +673,7 @@ export default {
       if (courseId == nowCourseId) {
         return;
       }
-      let course = this.courseList.find((e) => e.courseId == courseId);
+      let course = this.courseList.find(e => e.courseId == courseId);
       if (course) {
         course.courseList = courseList;
         course.list = [];
@@ -655,14 +692,14 @@ export default {
         .reSectionExamList({
           chapterId: 0,
           courseId,
-          gradeId: this.gradeId,
+          gradeId: this.gradeId
         })
-        .then((res) => {
+        .then(res => {
           this.sectionExamList = res.data;
         });
       return this.$request
         .reMenuList({ courseId, gradeId: this.gradeId })
-        .then((res) => {
+        .then(res => {
           for (let i = 0; i < res.rows.length; i++) {
             let item = res.rows[i];
             item.id = item.menuId;
@@ -688,9 +725,9 @@ export default {
           moduleId: id,
           gradeId: this.gradeId,
           courseId: courseId,
-          rebuild: isRebuild ? 1 : undefined,
+          rebuild: isRebuild ? 1 : undefined
         })
-        .then((res) => {
+        .then(res => {
           for (let i = 0; i < res.data.length; i++) {
             let item = res.data[i];
             item.id = item.chapterId;
@@ -712,7 +749,7 @@ export default {
         id,
         isRebuild,
         courseId,
-        showList,
+        showList
       } = chapter;
       if (!isFresh) {
         chapter.showList = !showList;
@@ -723,9 +760,9 @@ export default {
         .reSectionExamList({
           chapterId: chapterId || menuId,
           courseId,
-          gradeId: this.gradeId,
+          gradeId: this.gradeId
         })
-        .then((res) => {
+        .then(res => {
           this.sectionExam = [...this.sectionExam, ...res.data];
         });
       return this.$request
@@ -734,13 +771,13 @@ export default {
           gradeId: this.gradeId,
           courseId,
           rebuild: isRebuild ? 1 : undefined,
-          moduleId: moduleId || 0,
+          moduleId: moduleId || 0
         })
-        .then((res) => {
+        .then(res => {
           chapter.canLearn = res.data
-            .filter((item) => item.type != 2)
-            .every((item) => item.learning == 1);
-          res.data.forEach((section) => {
+            .filter(item => item.type != 2)
+            .every(item => item.learning == 1);
+          res.data.forEach(section => {
             section.parent = chapter;
             section.courseId = courseId;
           });
@@ -750,12 +787,12 @@ export default {
     },
     getAllSectionList() {
       return this.$request
-        .getAllSectionList({
+        .studyrecordgoodsAllListWithExam({
           gradeId: this.gradeId,
           goodsId: this.goodsId,
-          rebuild: this.rebuild,
+          rebuild: this.rebuild
         })
-        .then((res) => {
+        .then(res => {
           let { skipPort } = this.query;
           if (skipPort) {
             let { moduleId, chapterId, sectionId } = res.data[0];
@@ -764,10 +801,10 @@ export default {
             query.chapterId = chapterId;
             query.sectionId = sectionId;
             query.skipPort = undefined;
-            console.log("route",{ path: this.$route.path, query })
+            console.log("route", { path: this.$route.path, query });
             this.$router.push({ path: this.$route.path, query });
           }
-          this.allSectionList = res.data;
+          this.allSectionList = res.data.filter(i => i.doType != 1);
           return Promise.resolve(res.data);
         });
     },
@@ -794,14 +831,13 @@ export default {
     // 自动播放下一个视频
     async playNextVideo(sectionItem = this.sectionItem) {
       let { menuId, parent, courseId, projectId } = sectionItem;
-      let list = (
-        menuId
-          ? this.treeList.find((e) => e.courseId == courseId).list
-          : projectId
-          ? this.treeList
-          : parent.list
-      ).filter((e) => !e.doType);
-      let index = list.findIndex((e) => e.id == sectionItem.id);
+      let list = (menuId
+        ? this.treeList.find(e => e.courseId == courseId).list
+        : projectId
+        ? this.treeList
+        : parent.list
+      ).filter(e => !e.doType);
+      let index = list.findIndex(e => e.id == sectionItem.id);
       let nextItem = {};
       if (list.length - 1 > index) {
         nextItem = list[index + 1];
@@ -820,11 +856,11 @@ export default {
         ? nextItem.list
         : await this[key](nextItem);
       if (isNext) {
-        nextItem = type == 2 ? list.find((e) => e.type == 1) : list[0];
+        nextItem = type == 2 ? list.find(e => e.type == 1) : list[0];
       } else {
         // 初始化 获取播放位置
         let { moduleId, chapterId, sectionId } = this.query;
-        nextItem = list.find((e) => {
+        nextItem = list.find(e => {
           if (moduleId * 1 && type == 0) {
             return e.menuId == moduleId;
           }
@@ -839,6 +875,11 @@ export default {
       return this.backNextItem(nextItem, nextItem.menuType, isNext);
     },
     async getResource(section, type, courseIndex) {
+      console.error(section, "section");
+      if (section.doType != 1 && section.learning == 1 && section.type == 2) {
+        this.$message.warning("考试已通过,请勿重复考试");
+        return false;
+      }
       if (
         section.type != 2 &&
         this.isActive(section) &&
@@ -858,7 +899,7 @@ export default {
           message:
             section.type == 2
               ? "请学完视频课程再进行练习和测试"
-              : "请按顺序学习视频课程",
+              : "请按顺序学习视频课程"
         });
         return false;
       }
@@ -867,7 +908,7 @@ export default {
         if (!section.recordingUrl) {
           this.$message({
             type: "warning",
-            message: `暂无播放地址数据`,
+            message: `暂无播放地址数据`
           });
           return false;
         }
@@ -877,7 +918,7 @@ export default {
         if (!section.liveUrl) {
           this.$message({
             type: "warning",
-            message: `暂无直播地址数据`,
+            message: `暂无直播地址数据`
           });
           return false;
         }
@@ -885,7 +926,7 @@ export default {
         if (data.watchStatus == "end" || data.watchStatus == "playback") {
           this.$message({
             type: "warning",
-            message: `直播已结束`,
+            message: `直播已结束`
           });
           return false;
         }
@@ -893,7 +934,7 @@ export default {
         if (data.watchStatus == "waiting") {
           this.$message({
             type: "warning",
-            message: `直播未开始`,
+            message: `直播未开始`
           });
           return false;
         }
@@ -928,13 +969,13 @@ export default {
             learning: section.learning,
             type: type,
             chapterId: section.chapterId || 0,
-            orderGoodsId: this.orderGoodsId,
-          },
+            orderGoodsId: this.orderGoodsId
+          }
         });
       } else {
         this.$message({
           type: "warning",
-          message: "该试卷只能答题" + section.answerNum + "次",
+          message: "该试卷只能答题" + section.answerNum + "次"
         });
         return;
       }
@@ -944,7 +985,7 @@ export default {
       if (type == 3) {
         //节卷
         let data = this.sectionExamList.filter(
-          (x) => x.sectionId == section.menuId
+          x => x.sectionId == section.menuId
         );
         if (data && data.length > 0) {
           section = data[0];
@@ -952,7 +993,7 @@ export default {
       } else if (type == 2) {
         //节卷
         let data = this.sectionExam.filter(
-          (x) => x.sectionId == section.sectionId
+          x => x.sectionId == section.sectionId
         );
 
         if (data && data.length > 0) {
@@ -970,8 +1011,8 @@ export default {
           learning: section.learning,
           type: type,
           chapterId: section.chapterId || 0,
-          orderGoodsId: this.orderGoodsId,
-        },
+          orderGoodsId: this.orderGoodsId
+        }
       });
     },
     async exceedLearnNum(section) {
@@ -983,7 +1024,7 @@ export default {
         if (learnNum >= this.sectionMaxNum && !hasLearn) {
           this.$message({
             type: "warning",
-            message: `每天最多学习${this.sectionMaxNum}节`,
+            message: `每天最多学习${this.sectionMaxNum}节`
           });
           return false;
         }
@@ -991,34 +1032,34 @@ export default {
       return true;
     },
     goodsTodayStudySectionNum() {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .goodsTodayStudySectionNum({
             goodsId: this.goodsId,
-            gradeId: this.gradeId,
+            gradeId: this.gradeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
     gradeCheckGoodsStudy(option) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .gradeCheckGoodsStudy({
             goodsId: this.goodsId,
             gradeId: this.gradeId,
             moduleId: option.moduleId || 0,
             chapterId: option.chapterId || 0,
-            sectionId: option.sectionId || option.menuId,
+            sectionId: option.sectionId || option.menuId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
     bankRecordDoNum(section) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .bankRecordDoNum({
             goodsId: this.goodsId,
@@ -1026,9 +1067,9 @@ export default {
             chapterId: section.chapterId,
             courseId: this.courseId,
             moduleId: 0,
-            examId: section.typeId,
+            examId: section.typeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
@@ -1039,17 +1080,17 @@ export default {
     //获取商品双师资模板
     getDoubleTeacherList() {
       let rows = JSON.parse(JSON.stringify(this.courseList));
-      rows.forEach((e) => {
+      rows.forEach(e => {
         e.list = [];
         e.showList = false;
         e.id = e.courseId;
       });
       return this.$request
         .courseTeacherList({
-          goodsId: this.$route.params.goodsId,
+          goodsId: this.$route.params.goodsId
         })
         .then(({ data }) => {
-          data.forEach((ele) => {
+          data.forEach(ele => {
             rows.forEach((e, i) => {
               let actvieIndex = ele.courseIds.indexOf(this.activeCourseId);
               let index = ele.courseIds.indexOf(e.courseId);
@@ -1069,7 +1110,7 @@ export default {
               }
             });
           });
-          return Promise.resolve(rows.filter((e) => e));
+          return Promise.resolve(rows.filter(e => e));
         });
     },
     async orderTopTobottom(section, type, courseIndex) {
@@ -1082,7 +1123,7 @@ export default {
       if (this.treeList.length > 1 && courseIndex > 0) {
         let isAllLear = this.treeList
           .filter((e, i) => i < courseIndex)
-          .every((ele) => ele.stuAllNum == ele.secAllNum);
+          .every(ele => ele.stuAllNum == ele.secAllNum);
         if (!isAllLear) return false;
       }
       let list = await this.studyRecordMenuAllList(
@@ -1091,7 +1132,7 @@ export default {
       type = type == 1 && section.type == 2 ? 2 : type;
       if (type == 1) {
         if (parentId >= 0 && menuId >= 0) {
-          var index = list.findIndex((e) => {
+          var index = list.findIndex(e => {
             return parentId
               ? e.moduleId == moduleId &&
                   e.chapterId == chapterId &&
@@ -1100,7 +1141,7 @@ export default {
           });
         } else {
           var index = list.findIndex(
-            (e) =>
+            e =>
               e.moduleId == moduleId &&
               e.chapterId == chapterId &&
               e.id == section.sectionId
@@ -1109,20 +1150,27 @@ export default {
         list = list.slice(0, index);
       } else if (type != 3) {
         list = list.filter(
-          (e) => e.moduleId == moduleId && e.chapterId == chapterId
+          e => e.moduleId == moduleId && e.chapterId == chapterId
+        );
+        var index = list.findIndex(
+          e =>
+            e.moduleId == moduleId &&
+            e.chapterId == chapterId &&
+            e.examId == section.typeId
         );
+        list = list.slice(0, index);
       }
-      return list.every((item) => item.studyStatus == 1);
+      return list.every(item => item.studyStatus == 1);
     },
     studyRecordMenuAllList(courseId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
-          .studyRecordMenuAllList({
+          .studyRecordMenuAllListWithExam({
             courseId,
             gradeId: this.gradeId,
-            goodsId: this.goodsId,
+            goodsId: this.goodsId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
@@ -1133,7 +1181,7 @@ export default {
       if (_data.length == 0) {
         return false;
       }
-      return _data.some((section) => section.sectionId == sectionId);
+      return _data.some(section => section.sectionId == sectionId);
     },
     // 刷新数据
     refreshList() {
@@ -1145,17 +1193,17 @@ export default {
       }
     },
     studyRecordGetChannelBasicInfo(channelId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .studyRecordGetChannelBasicInfo({
-            channelId,
+            channelId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           })
-          .catch((err) => {});
+          .catch(err => {});
       });
-    },
+    }
   },
   computed: {
     query() {
@@ -1178,27 +1226,45 @@ export default {
       return this.sectionItem.courseId;
     },
     playCourse() {
-      return this.treeList.find((e) => e.courseId == this.playCourseId);
+      return this.treeList.find(e => e.courseId == this.playCourseId);
     },
     isLastVideo() {
       try {
-        let sectionId = this.sectionItem.sectionId || this.sectionItem.menuId || 0
-        let chapterId = this.sectionItem.chapterId || 0
-        let courseId = this.sectionItem.courseId || 0
+        let sectionId =
+          this.sectionItem.sectionId || this.sectionItem.menuId || 0;
+        let chapterId = this.sectionItem.chapterId || 0;
+        let courseId = this.sectionItem.courseId || 0;
         let lastVideo = this.allSectionList.slice(-1)[0];
-        return (
+        if (
           sectionId == lastVideo.sectionId &&
           chapterId == lastVideo.chapterId &&
           courseId == lastVideo.courseId
-        );
+        ) {
+          return 1;
+        } else {
+          const index = this.allSectionList.findIndex(
+            i =>
+              i.sectionId == sectionId &&
+              i.chapterId == chapterId &&
+              i.courseId == courseId
+          );
+          if (
+            this.allSectionList[index + 1].type == 4 ||
+            this.allSectionList[index + 1].type == 5
+          ) {
+            return 2;
+          } else {
+            return 0;
+          }
+        }
       } catch (error) {
-        return false;
+        return 0;
       }
     },
     orderGoodsId() {
       return this.query.orderGoodsId;
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -1301,8 +1367,8 @@ export default {
             .el-icon-caret-bottom {
               color: #999;
             }
-            & > div > span  {
-              font-size: 12px!important;
+            & > div > span {
+              font-size: 12px !important;
             }
           }
 
@@ -1452,4 +1518,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 178 - 161
src/pages/course-detail/index.vue

@@ -40,9 +40,7 @@
                     :class="!switchBox ? 'smallBox overStyle' : 'switchPdf'"
                     :style="!switchBox && hideBox ? 'display:none;' : ''"
                   >
-                    <div
-                      v-if="ShowAlist !== ''"
-                    >
+                    <div v-if="ShowAlist !== ''">
                       <vue-office-docx
                         style="width:808px;height: 452px!important;"
                         v-if="ShowAlist === 'docx'"
@@ -78,7 +76,7 @@
                     您上次看{{
                       $tools.secondToTime(recordObj.videoCurrentTime)
                     }},正在自动续播
-                    <span 
+                    <span
                       style="
                         display: inline-block;
                         width: 50px;
@@ -864,6 +862,21 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      title="提示"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+      :visible.sync="errorCodeDialog"
+      width="400px"
+    >
+      <span>{{ errorCodeMsg }}</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="$router.back(-1)"
+          >返回上一页</el-button
+        >
+      </span>
+    </el-dialog>
     <div id="printTable"></div>
     <!-- <ToolBar></ToolBar> -->
     <Footer></Footer>
@@ -908,6 +921,8 @@ export default {
   },
   data() {
     return {
+      errorCodeDialog: false,
+      errorCodeMsg: "",
       hideBox: false, //隐藏窗口
       switchBox: false, //切换窗口
       switchPdf: {}, //pdf数据
@@ -1239,6 +1254,7 @@ export default {
       takeSetInt: null,
       videoPause: null,
       confirmStatus: false,
+      failToRegister: false, //报名是否不通过
       openPhotoStatus: 0,
       readerResult: null
     };
@@ -1376,6 +1392,8 @@ export default {
     this.dictList();
 
     this.getbaseprofiletplists().then(async res => {
+      
+      console.log('tanglian2')
       await this.courseCourseList();
       this.getRebuildCourse();
     });
@@ -1389,6 +1407,7 @@ export default {
     clearInterval(this.livingTimer);
     document.removeEventListener("visibilitychange", this.pauseVideo);
     try {
+      console.log("自动关闭");
       this.$msgbox.close();
     } catch (err) {}
     if (this.playSectionId && this.hasStart) {
@@ -1443,7 +1462,7 @@ export default {
       return false;
     },
     pauseVideo() {
-      if (this.takePhotoModal || this.confirmStatus) {
+      if (this.takePhotoModal || this.confirmStatus || this.failToRegister) {
         return;
       }
       let _p = this.player;
@@ -1521,7 +1540,7 @@ export default {
       });
     },
     /**
-     * 
+     *
      获取推荐列表
      */
     getRecommend() {
@@ -1973,7 +1992,6 @@ export default {
           0
         );
       }
-
       this.uploadDatas(data);
     },
 
@@ -2107,8 +2125,6 @@ export default {
         let base = await this.$tools.imageToBase64(
           this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
         );
-        console.log(base);
-        console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
 
         let resData = {};
         try {
@@ -2130,16 +2146,24 @@ export default {
         }
         this.veryIdCard = resData.data.IdNum;
         this.veryIdName = resData.data.IdName;
-
-        // if (this.infoForm.idcard) {
-        //   if (this.infoForm.idcard != this.veryIdCard) {
-        //     this.$message.warning(
-        //       "输入的身份证号和身份证人像面照片身份证号不匹配"
-        //     );
-        //     this.uploading = false;
-        //     return;
-        //   }
-        // }
+        if (this.infoForm.name) {
+          if (this.infoForm.name != this.veryIdName) {
+            this.$message.warning(
+              "输入的姓名和身份证人像面照片姓名不匹配,请联系客服"
+            );
+            this.uploading = false;
+            return;
+          }
+        }
+        if (this.infoForm.idcard) {
+          if (this.infoForm.idcard != this.veryIdCard) {
+            this.$message.warning(
+              "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服"
+            );
+            this.uploading = false;
+            return;
+          }
+        }
 
         let base64 = await this.$tools.imageToBase64(
           this.$tools.splitImgHost(this.infoForm.recent_photos)
@@ -2149,7 +2173,6 @@ export default {
           urlA: this.infoForm.idcard_face_photo,
           oneInchPhotos: base64
         };
-
         this.$request
           .faceCertificationIdCardCompareFace(newData)
           .then(res1 => {
@@ -2423,153 +2446,129 @@ export default {
     },
 
     getbaseprofiletplists() {
-      return new Promise(resolve => {
+      return new Promise(async resolve => {
         let self = this;
-        this.$request
-          .getbaseprofiletplists({
-            goodsId: this.goodsId,
-            orderGoodsId: this.orderGoodsId || ""
-          })
-          .then(res => {
-            if (res.code === 200 && res.rows.length) {
-              if (res.rows[0].keyValue) {
-                self.$request.getbaseprofiletpId(self.goodsId).then(baseRes => {
-                  if (baseRes.code === 200) {
-                    if (baseRes.data) {
-                      self.$request
-                        .getbaseprofiletpgetInfo({
-                          goodsId: self.goodsId,
-                          orderGoodsId: self.orderGoodsId
+        let res = await this.$request.getbaseprofiletplists({
+          goodsId: this.goodsId,
+          orderGoodsId: this.orderGoodsId
+        });
+        if (res.code === 200 && res.rows.length) {
+          if (res.rows[0].keyValue) {
+            let baseRes = await self.$request.getbaseprofiletpId(self.goodsId);
+            if (baseRes.code === 200) {
+              if (baseRes.data) {
+                let result = await self.$request.getbaseprofiletpgetInfo({
+                  goodsId: self.goodsId,
+                  orderGoodsId: self.orderGoodsId
+                });
+                if (result.code === 200) {
+                  if (
+                    !result.data ||
+                    (result.data.status === 3 && result.data.changeStatus === 1)
+                  ) {
+                    if (!result.data) {
+                      self.needProfileModal = true;
+                      this.$confirm(`请填写资料`, "提示", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "返回",
+                        closeOnClickModal: false,
+                        closeOnPressEscape: false,
+                        distinguishCancelAndClose: false,
+                        showClose: false
+                      })
+                        .then(_ => {
+                          this.showAgreementModal = true;
+                          this.getInfo();
                         })
-                        .then(result => {
-                          console.log(result, "result");
-                          if (result.code === 200) {
-                            if (
-                              !result.data ||
-                              (result.data.status === 3 &&
-                                result.data.changeStatus === 1)
-                            ) {
-                              if (!result.data) {
-                                self.needProfileModal = true;
-                                this.$confirm(`请填写资料`, "提示", {
-                                  confirmButtonText: "确定",
-                                  cancelButtonText: "返回",
-                                  closeOnClickModal: false,
-                                  closeOnPressEscape: false,
-                                  distinguishCancelAndClose: false,
-                                  showClose: false
-                                })
-                                  .then(_ => {
-                                    this.showAgreementModal = true;
-                                    this.getInfo();
-                                  })
-                                  .catch(_ => {
-                                    this.$router.back(-1);
-                                  });
-                              } else {
-                                this.$confirm(
-                                  `资料审核不通过,请前往重新填写`,
-                                  "提示",
-                                  {
-                                    confirmButtonText: "确定",
-                                    cancelButtonText: "返回",
-                                    closeOnClickModal: false,
-                                    closeOnPressEscape: false,
-                                    distinguishCancelAndClose: false,
-                                    showClose: false
-                                  }
-                                )
-                                  .then(_ => {
-                                    this.showInfoDetailModal = true;
-                                    this.getInfo();
-                                  })
-                                  .catch(_ => {
-                                    this.$router.back(-1);
-                                  });
-                              }
-                            } else if (
-                              result.data.status === 1 &&
-                              JSON.parse(res.rows[0].keyValue2)[0]
-                            ) {
-                              console.log(8);
-                              self.$request
-                                .getbaseprofileStampgetInfo({
-                                  goodsId: self.goodsId,
-                                  orderGoodsId: self.orderGoodsId
-                                })
-                                .then(k => {
-                                  if (k.code === 200) {
-                                    if (
-                                      !k.data ||
-                                      (k.data.status === 3 &&
-                                        k.data.changeStatus === 1)
-                                    ) {
-                                      if (!k.data) {
-                                        console.log(9);
-                                        this.$confirm(
-                                          `请前往填写盖章资料`,
-                                          "提示",
-                                          {
-                                            confirmButtonText: "确定",
-                                            cancelButtonText: "返回",
-                                            closeOnClickModal: false,
-                                            closeOnPressEscape: false,
-                                            distinguishCancelAndClose: false,
-                                            showClose: false
-                                          }
-                                        )
-                                          .then(_ => {
-                                            this.showStampDetailModail = true;
-                                            this.getInfoStamp();
-                                          })
-                                          .catch(_ => {
-                                            this.$router.back(-1);
-                                          });
-                                      } else {
-                                        console.log(10);
-                                        self.needProfileModal = true;
-                                        this.$confirm(
-                                          `资料盖章审核不通过,请前往重新填写`,
-                                          "提示",
-                                          {
-                                            confirmButtonText: "确定",
-                                            cancelButtonText: "返回",
-                                            closeOnClickModal: false,
-                                            closeOnPressEscape: false,
-                                            distinguishCancelAndClose: false,
-                                            showClose: false
-                                          }
-                                        )
-                                          .then(_ => {
-                                            this.showStampDetailModail = true;
-                                            this.getInfoStamp();
-                                          })
-                                          .catch(_ => {
-                                            this.$router.back(-1);
-                                          });
-                                      }
-                                    } else {
-                                      resolve();
-                                    }
-                                  }
-                                });
-                            } else {
-                              resolve();
-                            }
-                          }
+                        .catch(_ => {
+                          this.$router.back(-1);
                         });
                     } else {
-                      resolve();
+                      this.$confirm(`资料审核不通过,请前往重新填写`, "提示", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "返回",
+                        closeOnClickModal: false,
+                        closeOnPressEscape: false,
+                        distinguishCancelAndClose: false,
+                        showClose: false
+                      })
+                        .then(_ => {
+                          this.showInfoDetailModal = true;
+                          this.getInfo();
+                        })
+                        .catch(_ => {
+                          this.$router.back(-1);
+                        });
+                    }
+                  } else if (
+                    result.data.status === 1 &&
+                    JSON.parse(res.rows[0].keyValue2)[0]
+                  ) {
+                    let k = await self.$request.getbaseprofileStampgetInfo({
+                      goodsId: self.goodsId,
+                      orderGoodsId: self.orderGoodsId
+                    });
+                    if (k.code === 200) {
+                      if (
+                        !k.data ||
+                        (k.data.status === 3 && k.data.changeStatus === 1)
+                      ) {
+                        if (!k.data) {
+                          this.$confirm(`请前往填写盖章资料`, "提示", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "返回",
+                            closeOnClickModal: false,
+                            closeOnPressEscape: false,
+                            distinguishCancelAndClose: false,
+                            showClose: false
+                          })
+                            .then(_ => {
+                              this.showStampDetailModail = true;
+                              this.getInfoStamp();
+                            })
+                            .catch(_ => {
+                              this.$router.back(-1);
+                            });
+                        } else {
+                          self.needProfileModal = true;
+                          this.$confirm(
+                            `资料盖章审核不通过,请前往重新填写`,
+                            "提示",
+                            {
+                              confirmButtonText: "确定",
+                              cancelButtonText: "返回",
+                              closeOnClickModal: false,
+                              closeOnPressEscape: false,
+                              distinguishCancelAndClose: false,
+                              showClose: false
+                            }
+                          )
+                            .then(_ => {
+                              this.showStampDetailModail = true;
+                              this.getInfoStamp();
+                            })
+                            .catch(_ => {
+                              this.$router.back(-1);
+                            });
+                        }
+                      } else {
+                        resolve();
+                      }
                     }
+                  } else {
+                    resolve();
                   }
-                });
+                }
               } else {
                 resolve();
               }
-            } else {
-              resolve();
             }
-          });
+          } else {
+            resolve();
+          }
+        } else {
+          resolve();
+        }
         if (this.gradeId > 0) {
           //提交完资料返回判断是否已开班
 
@@ -3282,6 +3281,7 @@ export default {
         let self = this;
         this.$request.goodsDetail(this.goodsId).then(res => {
           self.goodsData = res.data;
+          console.log('tanglian1')
           self.gradeId = self.goodsData.gradeId;
           if (this.goodsData.categoryName) {
             this.infoForm.apply_post = this.goodsData.categoryName;
@@ -3328,9 +3328,8 @@ export default {
               self.photoNum = self.goodsPhotographConfig.photoNum;
             }
           }
+          resolve();
         });
-
-        resolve();
       });
     },
     // 新增用户视频学习日志
@@ -3499,7 +3498,7 @@ export default {
     studyRecordMenuAllList() {
       return new Promise(resolve => {
         this.$request
-          .studyRecordMenuAllList({
+          .studyRecordMenuAllListWithExam({
             courseId: this.courseId,
             gradeId: this.gradeId,
             goodsId: this.goodsId
@@ -4032,6 +4031,7 @@ export default {
         chapterId,
         moduleId,
         videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
+        erJianErZao: this.goodsData.erJianErZao,
         orderGoodsId: parseInt(this.orderGoodsId)
       };
 
@@ -4064,6 +4064,13 @@ export default {
           }
         })
         .catch(err => {
+          if (err.code === 600) {
+            polyvPlayerContext.j2s_pauseVideo();
+            this.failToRegister = true;
+            this.errorCodeDialog = true;
+            this.errorCodeMsg = err.msg;
+            return;
+          }
           if (err.code === 559) {
             this.$message.error(err.msg);
             console.log("拍照不够触发");
@@ -4495,7 +4502,17 @@ export default {
       });
     },
     courseCourseList() {
-      return new Promise(resolve => {
+      return new Promise(async (resolve, reject) => {
+        if (this.goodsData.erJianErZao) {
+          let info = await this.$request.userConfirmInfoDetail({
+            orderGoodsId: this.orderGoodsId
+          });
+          if (!info.data || info.data.pushInfo !== 1) {
+            this.errorCodeDialog = true;
+            this.errorCodeMsg = "开通信息推送不成功,无法进入学习!";
+            return;
+          }
+        }
         this.$request
           .courseCourseList({ goodsId: this.goodsId, gradeId: this.gradeId })
           .then(async res => {

+ 1 - 1
src/pages/course-report/index.vue

@@ -97,7 +97,7 @@
         <div class="section__footer">
           <el-button type="primary" class="btn"  @click="backList()">返回列表</el-button>
           <!-- <el-button type="primary" class="btn">练习下一节</el-button> -->
-          <el-button type="primary" class="btn" @click="doRepeat(reportdata)" v-if="reportdata.doMode != 3">重新做题</el-button>
+          <el-button type="primary" class="btn" @click="doRepeat(reportdata)" v-if="reportdata.doMode != 3 && !reportdata.reportStatus">重新做题</el-button>
           <el-button type="primary" class="btn" @click="wrongExplain(reportdata)" v-if="doWrongQuestionNum">错题解析</el-button>
           <el-button type="primary" class="btn" @click="allExplain(reportdata)">全部解析</el-button>
         </div>

+ 7 - 0
src/pages/home/index.vue

@@ -137,6 +137,13 @@
               @click="go('/live-list')"
               >直播</a
             >
+            <a
+              v-if="item.name === '积分商城'"
+              :key="index"
+              class="tab"
+              @click="go('/points-list')"
+              >积分商城</a
+            >
           </template>
         </div>
       </div>

+ 1 - 1
src/pages/live-detail/index.vue

@@ -5380,7 +5380,7 @@ export default {
     studyRecordMenuAllList() {
       return new Promise((resolve) => {
         this.$request
-          .studyRecordMenuAllList({
+          .studyRecordMenuAllListWithExam({
             courseId: this.courseId,
             gradeId: this.gradeId,
             goodsId: this.goodsId,

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 729 - 377
src/pages/person-center/my-course/index copy.vue


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 371 - 266
src/pages/person-center/my-course/index.vue


+ 4 - 1
src/pages/person-center/my-invoice/add/index.vue

@@ -78,7 +78,10 @@
           <el-form-item label="邮箱号:" required prop="email">
             <el-input v-model="form.email"></el-input>
           </el-form-item>
-
+          <el-form-item label="发票备注:">
+            <el-input v-model="form.invoiceRemark" type="textarea" rows="4"></el-input>
+          </el-form-item>
+          
           <template v-if="form.subject == 2">
             <el-form-item
               label="纳税登记号:"

+ 40 - 30
src/pages/person-center/play-record/index.vue

@@ -14,7 +14,15 @@
               v-for="(sectionItem, sectionIndex) in v.list"
               :key="'section' + sectionIndex"
             >
-              <div class="course-item__header">{{ sectionItem.goodsName }}</div>
+              <div class="course-item__header">
+                {{ sectionItem.goodsName
+                }}<el-tag
+                  type="success"
+                  style="margin-left: 10px;"
+                  v-if="sectionItem.learning == 1"
+                  >已学完</el-tag
+                >
+              </div>
               <div class="course-item__body">
                 <div class="img" @click="goCourse(sectionItem)">
                   <img
@@ -86,7 +94,7 @@ import RebuildModal from "@/components/rebuildModal";
 export default {
   name: "MyCourse",
   components: {
-    RebuildModal,
+    RebuildModal
   },
   data() {
     return {
@@ -97,9 +105,9 @@ export default {
       rebuildItem: {},
       params: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 10
       },
-      sysTime: 0,
+      sysTime: 0
     };
   },
   mounted() {
@@ -127,8 +135,8 @@ export default {
         query: {
           gradeId: item.gradeId,
           orderGoodsId: item.orderGoodsId,
-          rebuild: 1,
-        },
+          rebuild: 1
+        }
       });
     },
     currentChange(e) {
@@ -136,10 +144,10 @@ export default {
       this.studRrecordListUserRecord();
     },
     studRrecordListUserRecord() {
-      this.$request.studRrecordListUserRecord(this.params).then((res) => {
+      this.$request.studRrecordListUserRecord(this.params).then(res => {
         let dateObj = {};
 
-        res.rows.forEach((row) => {
+        res.rows.forEach(row => {
           if (!dateObj[row.date]) {
             dateObj[row.date] = { title: row.goodsName, list: [] };
             dateObj[row.date].list.push(row);
@@ -156,6 +164,8 @@ export default {
         console.log(dateObj, "dateObj");
         this.recordList = dateObj;
         this.total = res.total;
+        document.body.scrollTop = 0;
+        document.documentElement.scrollTop = 0;
       });
     },
 
@@ -163,9 +173,9 @@ export default {
       this.sysTime = this.$tools.timest();
       this.$request
         .orderInfo({
-          orderGoodsId: sectionItem.orderGoodsId,
+          orderGoodsId: sectionItem.orderGoodsId
         })
-        .then(async (res) => {
+        .then(async res => {
           let item = res.data;
           console.log(item, "item");
           // if (item.interfacePushId > 0 && item.officialStatus != 1) {
@@ -182,7 +192,7 @@ export default {
           ) {
             this.$message({
               type: "warning",
-              message: "不在学习服务期,不能进入学习",
+              message: "不在学习服务期,不能进入学习"
             });
             return;
           }
@@ -193,7 +203,7 @@ export default {
           ) {
             this.$message({
               type: "warning",
-              message: "不在班级有效期,不能进入学习",
+              message: "不在班级有效期,不能进入学习"
             });
             return;
           }
@@ -201,7 +211,7 @@ export default {
           if (item.learningStatus == 2) {
             this.$message({
               type: "warning",
-              message: "开放学习时间待定,不能进入学习",
+              message: "开放学习时间待定,不能进入学习"
             });
             return;
           }
@@ -209,7 +219,7 @@ export default {
           if (item.classStatus == 0) {
             this.$message({
               type: "warning",
-              message: "尚未开班,不能进入学习",
+              message: "尚未开班,不能进入学习"
             });
             return;
           }
@@ -219,7 +229,7 @@ export default {
           ) {
             this.$message({
               type: "warning",
-              message: "不在开放学习时间,不能进入学习",
+              message: "不在开放学习时间,不能进入学习"
             });
             return;
           }
@@ -239,25 +249,25 @@ export default {
           // if (item.educationName == "继续教育") {
           this.$request
             .lockLockStatus({
-              action: "jxjy",
+              action: "jxjy"
             })
-            .then((res) => {
+            .then(res => {
               //有其他端在操作,不能学习
               this.$message({
                 type: "warning",
-                message: res.msg,
+                message: res.msg
               });
             })
-            .catch((err) => {
+            .catch(err => {
               //可以学习
               this.$request
                 .courseCourseList({
                   pageNum: 1,
                   pageSize: 1,
                   goodsId: item.goodsId,
-                  gradeId: item.gradeId,
+                  gradeId: item.gradeId
                 })
-                .then((res) => {
+                .then(res => {
                   if (res.rows.length) {
                     // this.go("/my-course-detail/" + sectionItem.goodsId, {
                     //   gradeId: sectionItem.gradeId,
@@ -277,13 +287,13 @@ export default {
                         liveUrl: sectionItem.liveUrl,
                         sectionType: sectionItem.sectionType,
                         liveStartTime: sectionItem.liveStartTime,
-                        liveEndTime: sectionItem.liveEndTime,
-                      },
+                        liveEndTime: sectionItem.liveEndTime
+                      }
                     });
                   } else {
                     this.$message({
                       type: "warning",
-                      message: "课程内暂无可以学习的科目",
+                      message: "课程内暂无可以学习的科目"
                     });
                   }
                 });
@@ -316,7 +326,7 @@ export default {
     go(path, query) {
       this.$router.push({
         path,
-        query,
+        query
       });
     },
 
@@ -325,18 +335,18 @@ export default {
      * 查询商品重修状态
      */
     courseGoodsRebuildStatus(goodsId, gradeId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .courseGoodsRebuildStatus({
             goodsId: goodsId,
-            gradeId: gradeId,
+            gradeId: gradeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 244 - 0
src/pages/points-list/index.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class="payment">
+    <Header @search="search($event)"></Header>
+    <section class="section">
+      <div class="section__header">
+        <div class="container">
+          <el-breadcrumb separator="/">
+            <el-breadcrumb-item :to="{ path: '/index' }"
+              >首页</el-breadcrumb-item
+            >
+            <el-breadcrumb-item>积分商城</el-breadcrumb-item>
+          </el-breadcrumb>
+        </div>
+      </div>
+      <div class="section__footer">
+        <div class="container">
+          <div class="course-list">
+            <div class="course-list__header">
+              <div class="sort-list">
+                <div
+                  class="sort-list__item"
+                  @click="changeSort(1)"
+                  :class="{ active: params.sortType == 1 ? true : false }"
+                >
+                  综合排序
+                </div>
+                <div
+                  class="sort-list__item"
+                  @click="changeSort(2)"
+                  :class="{ active: params.sortType == 2 ? true : false }"
+                >
+                  低价优先
+                </div>
+                <div
+                  class="sort-list__item"
+                  @click="changeSort(3)"
+                  :class="{ active: params.sortType == 3 ? true : false }"
+                >
+                  高价优先
+                </div>
+              </div>
+            </div>
+            <div class="course-list__body">
+              <LoadingBox v-if="loading"></LoadingBox>
+              <ul v-else class="list clearfix">
+                <li
+                  class="course-item"
+                  v-for="(item, index) in goodsList"
+                  :key="index"
+                >
+                  <GoodsItem :item="item"></GoodsItem>
+                </li>
+              </ul>
+            </div>
+          </div>
+
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChange"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :pager-count="5"
+              :page-size="params.pageSize"
+            >
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+    </section>
+
+    <ToolBar></ToolBar>
+    <Footer></Footer>
+  </div>
+</template>
+
+<script>
+import { cancel } from "@/apis/common.js";
+import LoadingBox from "@/components/loadingBox/index";
+import Footer from "@/components/footer/index";
+import Header from "@/components/header/index";
+import ToolBar from "@/components/toolbar/index";
+import GoodsItem from "@/components/goodsItem/index";
+import { mapMutations } from "vuex";
+export default {
+  name: "pointsList",
+  components: {
+    Footer,
+    Header,
+    ToolBar,
+    GoodsItem,
+    LoadingBox
+  },
+  data() {
+    return {
+      projectId: "",
+      total: 0,
+      params: {
+        pageNum: 1,
+        pageSize: 15,
+        sortType: 1,
+      },
+      goodsList: [],
+      loading: false
+    };
+  },
+  mounted() {
+  },
+  methods: {
+    ...mapMutations(["getCartCount"]),
+    search() {
+      if (cancel) {
+        cancel("取消请求");
+      }
+      this.loading = true;
+      this.$request
+        .goodsList(this.params)
+        .then(res => {
+          this.goodsList = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    changeSort(sortType) {
+      if (this.params.sortType == sortType) return;
+      this.params.sortType = sortType;
+      this.search()
+    },
+    currentChange(e) {
+      this.params.pageNum = e;
+    },
+    toGoodsDetail(item) {
+      this.$router.push({
+        path: "/course-detail/" + item.goodsId
+      });
+    },
+
+    addCart(item) {
+      this.$request
+        .addCart({ goodsId: item.goodsId })
+        .then(res => {
+          this.getCartCount();
+          this.$message({
+            message: "加入购物车成功",
+            type: "success"
+          });
+        })
+        .catch(err => {
+          if (err.code == 500) {
+            this.$message({
+              message: err.msg,
+              type: "warning"
+            });
+          }
+        });
+    },
+
+  }
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="scss">
+.payment {
+  .section {
+    &__header {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      padding: 0 20px;
+    }
+
+    &__footer {
+      .course-list {
+        &__header {
+          margin-top: 32px;
+          .sort-list {
+            display: flex;
+            align-items: center;
+            &__item {
+              cursor: pointer;
+              width: 96px;
+              height: 32px;
+              border-radius: 16px;
+              background: #ffffff;
+              border: 1px solid #bfbfbf;
+              border-radius: 16px;
+              text-align: center;
+              line-height: 30px;
+              font-size: 16px;
+              margin-right: 20px;
+
+              &.active {
+                background: #ebf2fc;
+                border: 1px solid #3f8dfd;
+                border-radius: 16px;
+                color: #3f8dfd;
+              }
+            }
+          }
+        }
+
+        &__body {
+          .list {
+            width: 100%;
+
+            .course-item {
+              float: left;
+            }
+          }
+        }
+
+        &__footer {
+          overflow: hidden;
+          .btn {
+            cursor: pointer;
+            width: 146px;
+            height: 40px;
+            background: #e3eaf7;
+            border-radius: 8px;
+            margin: 20px auto 40px;
+            color: #3f8dfd;
+            text-align: center;
+            line-height: 40px;
+
+            &:hover {
+              color: #fff;
+              box-shadow: 0px 8px 4px 0px rgba(7, 82, 208, 0.08);
+              background: #3f8dfd;
+            }
+          }
+        }
+      }
+
+      .pagination {
+        padding: 30px 0;
+        text-align: center;
+      }
+    }
+  }
+}
+</style>

+ 12 - 0
src/router/index.js

@@ -102,6 +102,18 @@ const router = new Router({
         }
       }
     },
+    {
+      path: '/points-list',
+      name: '积分商城列表',
+      component: resolve => require(['@/pages/points-list/index'], resolve),
+      meta: {
+        title: + '-一二级建造师、工程师、建筑师视频课程、免费直播课',
+        content: {
+          keywords: + '-一级建造师视频课件,二级建造师视频课件,建筑师工程师学习视频课程',
+          description: + '-提供一二级建造师视频学习、免费直播公开课  ,免费试听,建造师内部习题资料、工程师教学辅导视频、建筑考试课件视频等资料。'
+        }
+      }
+    },
     {
       path: '/bank-list',
       name: '题库列表',

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác