xuqiaoying 3 vuotta sitten
vanhempi
commit
be85642d29

+ 105 - 0
src/pages/bank-report/index.vue

@@ -151,6 +151,40 @@
             >全部解析</el-button
           >
         </div>
+
+        <div v-if="courseList.length" class="course_list">
+          <div class="course__header">
+            <div class="title">相关推荐</div>
+          </div>
+          <div class="course__body">
+            <!-- <p
+              v-if="
+                !courseList.length
+              "
+              class="text_align"
+            >
+              无推荐课程
+            </p> -->
+            <ul class="list clearfix">
+              <template v-for="(item, index) in courseList">
+                <li class="course-item" :key="index">
+                  <GoodsItem :item="item"></GoodsItem>
+                </li>
+              </template>
+            </ul>
+          </div>
+
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChangeCou"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </div>
+        </div>
       </div>
     </section>
     <ToolBar></ToolBar>
@@ -162,6 +196,7 @@
 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 { mapGetters } from "vuex";
 export default {
   name: "BankExplain",
@@ -169,6 +204,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    GoodsItem,
   },
   data() {
     return {
@@ -182,6 +218,10 @@ export default {
       examId: 0,
       recordId: 0,
       orderGoodsId: "",
+      courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
     };
   },
   computed: {
@@ -195,12 +235,33 @@ export default {
     this.orderGoodsId = this.$route.query.orderGoodsId || "";
     this.goodsId = this.$route.params.goodsId;
 
+    this.getcourList()
     this.examWrongRecordWrongNum();
     this.bankExamNextExam();
     await this.bankExam();
     await this.examReport();
   },
   methods: {
+    getcourList() {
+        this.$axios({
+            url: '/apply/recommend/goodsList',
+            method: 'post',
+            data: {
+                examId: this.examId,
+                pageNum: this.pageNum,
+                pageSize: this.pageSize,
+            }
+        }).then((res) => {
+            if (res.code == 200) {
+              this.courseList = res.rows || []
+              this.total = res.total
+            }
+        })
+    },
+    currentChangeCou(val) {
+      this.pageNum = val
+      this.getcourList()
+    },
     back() {
       // this.$router.replace({
       //   path: "/person-center/my-bank/bank-detail/" + this.goodsId,
@@ -625,5 +686,49 @@ export default {
       }
     }
   }
+
+  .course_list {
+      .course {
+        background: #f5f7fa;
+        padding-top: 40px;
+
+        &__header {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .title {
+            background: url("~@/assets/video.png") no-repeat left center;
+            padding-left: 36px;
+            font-size: 24px;
+            font-family: YouSheBiaoTiHei;
+            font-weight: 400;
+            color: #333333;
+            text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
+          }
+
+          
+        }
+
+        
+
+        &__body {
+          .list {
+            width: 100%;
+
+            .course-item {
+              float: left;
+            }
+          }
+        }
+
+      }
+      .pagination {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin: 20px 0px;
+      }
+    }
 }
 </style>

+ 3 - 0
src/pages/course-exam/index.vue

@@ -2293,6 +2293,9 @@ export default {
             this.setExamResult(result);
             this.$router.replace({
               path: "/course-report",
+              query: {
+                examId: this.examId,
+              }
             });
           }, 1000);
         })

+ 113 - 2
src/pages/course-report/index.vue

@@ -90,6 +90,40 @@
           <el-button type="primary" class="btn">错题解析</el-button>
           <el-button type="primary" class="btn">全部解析</el-button>
         </div> -->
+
+        <div v-if="courseList.length" class="course_list">
+          <div class="course__header">
+            <div class="title">相关推荐</div>
+          </div>
+          <div class="course__body">
+            <!-- <p
+              v-if="
+                !courseList.length
+              "
+              class="text_align"
+            >
+              无推荐课程
+            </p> -->
+            <ul class="list clearfix">
+              <template v-for="(item, index) in courseList">
+                <li class="course-item" :key="index">
+                  <GoodsItem :item="item"></GoodsItem>
+                </li>
+              </template>
+            </ul>
+          </div>
+
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChangeCou"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </div>
+        </div>
       </div>
     </section>
     <ToolBar></ToolBar>
@@ -101,6 +135,7 @@
 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 { mapGetters } from "vuex";
 export default {
   name: "BankExplain",
@@ -108,19 +143,51 @@ export default {
     Footer,
     Header,
     ToolBar,
+    GoodsItem,
   },
   data() {
-    return {};
+    return {
+      examId: '',
+      courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
+    };
   },
   computed: {
     ...mapGetters(["examResult"]),
   },
+  created() {
+    this.examId = this.$route.query.examId
+    this.getcourList()
+  },
   mounted() {
     if (JSON.stringify(this.examResult) == "{}") {
       this.$router.back(-1);
     }
   },
-  methods: {},
+  methods: {
+    getcourList() {
+        this.$axios({
+            url: '/apply/recommend/goodsList',
+            method: 'post',
+            data: {
+                examId: this.examId,
+                pageNum: this.pageNum,
+                pageSize: this.pageSize,
+            }
+        }).then((res) => {
+            if (res.code == 200) {
+              this.courseList = res.rows || []
+              this.total = res.total
+            }
+        })
+    },
+    currentChangeCou(val) {
+      this.pageNum = val
+      this.getcourList()
+    },
+  },
 };
 </script>
 
@@ -380,5 +447,49 @@ export default {
       }
     }
   }
+
+  .course_list {
+      .course {
+        background: #f5f7fa;
+        padding-top: 40px;
+
+        &__header {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .title {
+            background: url("~@/assets/video.png") no-repeat left center;
+            padding-left: 36px;
+            font-size: 24px;
+            font-family: YouSheBiaoTiHei;
+            font-weight: 400;
+            color: #333333;
+            text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
+          }
+
+          
+        }
+
+        
+
+        &__body {
+          .list {
+            width: 100%;
+
+            .course-item {
+              float: left;
+            }
+          }
+        }
+
+      }
+      .pagination {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin: 20px 0px;
+      }
+    }
 }
 </style>

+ 102 - 1
src/pages/mock-report/index.vue

@@ -198,8 +198,38 @@
           >
         </div>
 
-        <div class="course_list">
+        <div v-if="courseList.length" class="course_list">
+          <div class="course__header">
+            <div class="title">相关推荐</div>
+          </div>
+          <div class="course__body">
+            <!-- <p
+              v-if="
+                !courseList.length
+              "
+              class="text_align"
+            >
+              无推荐课程
+            </p> -->
+            <ul class="list clearfix">
+              <template v-for="(item, index) in courseList">
+                <li class="course-item" :key="index">
+                  <GoodsItem :item="item"></GoodsItem>
+                </li>
+              </template>
+            </ul>
+          </div>
 
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChangeCou"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </div>
         </div>
       </div>
     </section>
@@ -246,6 +276,7 @@
 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 { mapGetters, mapActions } from "vuex";
 export default {
   name: "BankExplain",
@@ -253,6 +284,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    GoodsItem,
   },
   data() {
     return {
@@ -267,6 +299,10 @@ export default {
       eachExamId: 0,
       subscribeId: 0,
       subscribeInfo: {},
+      courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
     };
   },
   computed: {
@@ -277,6 +313,7 @@ export default {
     this.examId = this.$route.query.examId;
     this.recordId = this.$route.query.recordId;
     this.subscribeId = this.$route.query.subscribeId;
+    this.getcourList()
     this.setSystemTime();
     this.mockSubscribeInfo();
     this.mockWrongRecordWrongNum();
@@ -285,6 +322,26 @@ export default {
   },
   methods: {
     ...mapActions(["setSystemTime"]),
+      getcourList() {
+        this.$axios({
+            url: '/apply/recommend/goodsList',
+            method: 'post',
+            data: {
+                examId: this.examId,
+                pageNum: this.pageNum,
+                pageSize: this.pageSize,
+            }
+        }).then((res) => {
+            if (res.code == 200) {
+              this.courseList = res.rows || []
+              this.total = res.total
+            }
+        })
+    },
+    currentChangeCou(val) {
+      this.pageNum = val
+      this.getcourList()
+    },
     goLive() {
       this.$router.push({
         path: "/living-room/" + this.subscribeInfo.liveUrl,
@@ -732,6 +789,50 @@ export default {
         margin: 0 4px;
       }
     }
+
+    .course_list {
+      .course {
+        background: #f5f7fa;
+        padding-top: 40px;
+
+        &__header {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .title {
+            background: url("~@/assets/video.png") no-repeat left center;
+            padding-left: 36px;
+            font-size: 24px;
+            font-family: YouSheBiaoTiHei;
+            font-weight: 400;
+            color: #333333;
+            text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
+          }
+
+          
+        }
+
+        
+
+        &__body {
+          .list {
+            width: 100%;
+
+            .course-item {
+              float: left;
+            }
+          }
+        }
+
+      }
+      .pagination {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin: 20px 0px;
+      }
+    }
   }
 
   .info {

+ 1 - 1
src/pages/person-center/my-bank/bank-detailCopy/index.vue

@@ -1165,7 +1165,7 @@ export default {
     },
     // 新增用户视频学习日志
 		studyLog(courseId, moduleId, chapterId, examId) {
-			this.$http({
+			this.$axios({
 				url: '/user/study/log',
 				method: 'post',
 				data: {