Tang 3 лет назад
Родитель
Сommit
9949a346ba

+ 5 - 0
package-lock.json

@@ -10110,6 +10110,11 @@
         "renderkid": "^2.0.4"
       }
     },
+    "print-js": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz",
+      "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
+    },
     "private": {
       "version": "0.1.8",
       "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "axios": "^0.26.1",
     "element-ui": "^2.15.6",
     "moment": "^2.29.2",
+    "print-js": "^1.6.0",
     "swiper": "^6.8.4",
     "v-distpicker": "^1.2.13",
     "vue": "^2.5.2",

+ 12 - 4
src/apis/answer.js

@@ -1,15 +1,23 @@
 import request from '@/axios'
 export default {
-
-  answerList(data) {
+	/**新增答疑 */
+	addAnswer(data) {
+		return request({
+			url: '/app/answer',
+			method: 'post',
+			data: data
+		})
+	},
+	/**答疑列表 */
+	answerList(data) {
 		return request({
 			url: '/app/answer/list',
 			method: 'get',
 			params: data
 		})
 	},
-
-  delAnswer(data) {
+	/**修改答疑 */
+	delAnswer(data) {
 		return request({
 			url: '/app/answer/edit',
 			method: 'post',

+ 6 - 0
src/pages/bank-list/index.vue

@@ -185,6 +185,12 @@ export default {
   },
   mounted() {
     this.params.searchKey = this.$route.query.searchKey || "";
+    this.params.educationTypeId = this.$route.query.educationId || "";
+    this.params.projectId = this.$route.query.projectId || "";
+    this.params.businessId = this.$route.query.businessId || "";
+    if (this.params.businessId) {
+      this.getSubjectList();
+    }
     this.getEducationTypeList();
     this.changeSubject();
   },

+ 187 - 35
src/pages/course-detail/index.vue

@@ -1132,7 +1132,10 @@
                               placeholder=""
                             ></el-input>
                           </div>
-                          <el-button type="primary" class="submit"
+                          <el-button
+                            type="primary"
+                            class="submit"
+                            @click="addAnswer"
                             >提出疑问</el-button
                           >
                         </div>
@@ -1163,24 +1166,10 @@
                               </div>
                               <div class="question-list__item__content">
                                 <div class="nickname">
-                                  <template v-if="item.assignRealname">
-                                    {{ item.assignRealname }}
-                                  </template>
-                                  <template v-else>
-                                    {{
-                                      item.assignUserId > 0 && !item.realname
-                                        ? "祥粤老师"
-                                        : item.realname
-                                    }}
-                                  </template>
+                                  {{ item.realname }}
                                 </div>
                                 <div class="desc">
-                                  <template v-if="item.assignRealname"
-                                    >我猜这堂课没人听了不会做美梦吧。</template
-                                  >
-                                  <template v-else>
-                                    {{ item.answerText }}
-                                  </template>
+                                  {{ item.answerText }}
                                 </div>
                                 <div class="time">
                                   {{
@@ -1192,45 +1181,71 @@
                                   <div
                                     class="del"
                                     @click="del(item)"
-                                    v-if="item.userId != userInfo.userId"
+                                    v-if="item.userId === userInfo.userId"
                                   >
                                     删除
                                   </div>
                                 </div>
                                 <div
                                   class="reply-list"
-                                  v-if="item.assignRealname"
+                                  v-if="
+                                    item.newArraysAnswerList &&
+                                    item.newArraysAnswerList.length
+                                  "
                                 >
-                                  <div class="reply-list__item">
+                                  <div
+                                    class="reply-list__item"
+                                    v-for="(
+                                      items, indexs
+                                    ) in item.newArraysAnswerList"
+                                    :key="indexs"
+                                  >
                                     <div class="reply-list__item__avatar">
                                       <img
-                                        :src="$tools.splitImgHost(item.avatar)"
+                                        :src="$tools.splitImgHost(items.avatar)"
                                         alt=""
                                       />
                                     </div>
                                     <div class="reply-list__item__content">
                                       <div class="nickname">
-                                        {{
-                                          item.assignUserId > 0 &&
-                                          !item.realname
-                                            ? "祥粤老师"
-                                            : item.realname
-                                        }}
+                                        {{ items.realname }}
                                       </div>
                                       <div class="desc">
-                                        {{ item.answerText }}
+                                        回复
+                                        <span
+                                          style="
+                                            margin: 0px 4px;
+                                            color: #409eff;
+                                          "
+                                          >@{{ items.assignRealname }}</span
+                                        >
+                                        {{ items.answerText }}
                                       </div>
                                       <div class="time">
                                         {{
                                           $tools.timestampToTime(
-                                            item.createTime,
+                                            items.createTime,
                                             false
                                           )
                                         }}
-                                        <!-- <div class="del" v-if="index % 2 == 0">
+                                        <div
+                                          class="del"
+                                          @click="del(items)"
+                                          v-if="
+                                            items.userId === userInfo.userId
+                                          "
+                                        >
                                           删除
                                         </div>
-                                        <div class="reply" v-else>回复</div> -->
+                                        <div
+                                          class="reply"
+                                          v-if="
+                                            items.userId !== userInfo.userId
+                                          "
+                                          @click="answerBack(items)"
+                                        >
+                                          回复
+                                        </div>
                                       </div>
                                     </div>
                                   </div>
@@ -1347,6 +1362,18 @@
                                       >
                                         预览
                                       </div>
+                                      <div
+                                        class="btn"
+                                        @click="
+                                          printView(
+                                            $tools.splitImgHost(
+                                              courseHandoutsData.handoutsUrl
+                                            )
+                                          )
+                                        "
+                                      >
+                                        打印
+                                      </div>
                                       <div
                                         class="btn"
                                         @click="
@@ -1955,7 +1982,7 @@
         >
       </span>
     </el-dialog>
-
+    <div id="printTable"></div>
     <ToolBar></ToolBar>
     <Footer></Footer>
   </div>
@@ -1968,6 +1995,7 @@ import ToolBar from "@/components/toolbar/index";
 import { mapGetters } from "vuex";
 import * as baseUrls from "@/axios.js";
 import pdf from "vue-pdf";
+import print from "print-js";
 export default {
   name: "CourseDetail",
   components: {
@@ -2043,7 +2071,7 @@ export default {
       uidzb: "egsxlptzdq",
       menuList: [],
       reMenuList: [],
-      answerList: [],
+      answerList: [{ newArraysAnswerList: [] }],
       noteList: [],
       photoList: [],
       noteTotal: 0,
@@ -5066,7 +5094,7 @@ export default {
               },
             ];
 
-            if (courseTabIndex == "2") {
+            if (this.courseTabIndex == "2") {
               return;
             }
             this.courseTabIndex = "1";
@@ -5110,12 +5138,101 @@ export default {
         this.businessData = res.data;
       });
     },
+    /**提出答疑 */
+    addAnswer() {
+      if (!this.textarea) {
+        this.$message.warning("请输入疑问内容");
+        return;
+      }
+      let data = {
+        courseId: this.courseId,
+        goodsId: this.goodsId,
+        orderGoodsId: this.orderGoodsId,
+        answerText: this.textarea,
+      };
+      this.$request.addAnswer(data).then((res) => {
+        this.textarea = "";
+        this.getAnswerList();
+      });
+    },
+    /**回复 */
+    answerBack(row) {
+      this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+      })
+        .then(({ value }) => {
+          if (!value) {
+            this.$message.warning("请输入回复内容");
+            return;
+          }
+
+          let data = {
+            assignUserId: row.userId,
+            assignAnswerId: row.answerId,
+            courseId: this.courseId,
+            goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId,
+            answerText: value,
+            assignAnswerText: row.assignAnswerText,
+          };
+          this.$request.addAnswer(data).then((res) => {
+            this.getAnswerList();
+          });
+        })
+        .catch(() => {});
+    },
     getAnswerList() {
       let self = this;
       this.$request
         .answerList({ courseId: this.courseId, goodsId: this.goodsId })
         .then((res) => {
-          self.answerList = res.rows;
+          let data1 = [];
+          let data2 = [];
+          let copydata2 = [];
+          res.rows.forEach((item) => {
+            if (!item.assignAnswerId) {
+              data1.push(item);
+            } else {
+              data2.push(item);
+              copydata2.push(item);
+            }
+          });
+          data2.forEach((item, index) => {
+            //回复层
+            data1.forEach((items) => {
+              //提问层
+              if (items.answerId === item.assignAnswerId) {
+                if (
+                  items.newArraysAnswerList &&
+                  items.newArraysAnswerList.length
+                ) {
+                  items.newArraysAnswerList.push(item);
+                } else {
+                  items.newArraysAnswerList = [item];
+                }
+                let indexInd = copydata2.findIndex((itemsxs) => {
+                  return itemsxs.answerId === item.answerId;
+                });
+                if (indexInd !== -1) {
+                  copydata2.splice(indexInd, 1);
+                }
+              }
+            });
+          });
+          console.log(copydata2)
+          copydata2.forEach((it) => {
+            for (let i = 0; i < data1.length; i++) {
+              const STATUS = data1[i].newArraysAnswerList.some((items) => {
+                return items.answerId === it.assignAnswerId;
+              });
+              if (STATUS) {
+                data1[i].newArraysAnswerList.push(it);
+                break;
+              }
+            }
+          });
+          self.answerList = data1;
         });
     },
     courseCourseList() {
@@ -5245,6 +5362,39 @@ export default {
         this.getAnswerList();
       });
     },
+    /**
+     * 打印
+     */
+    printView(url) {
+      console.log("触发打印", url);
+      printJS({
+        printable: url,
+        type: "pdf",
+        header: null,
+        targetStyles: ["*"],
+        style: "@page {margin:0 10mm}",
+      });
+      // this.print(url);
+    },
+    // 打印方法
+    print(filePath) {
+      console.log("执行打印");
+      let iframe = document.createElement("iframe");
+      iframe.style.border = "0px";
+      iframe.style.position = "absolute";
+      iframe.style.width = "0px";
+      iframe.style.height = "0px";
+      iframe.style.right = "0px";
+      iframe.style.top = "0px";
+      iframe.setAttribute("src", filePath);
+      iframe.onload = () => {
+        iframe.contentWindow.print();
+        // setTimeout(() => {
+        //     document.body.removeChild(iframe);
+        // });
+      };
+      document.body.append(iframe);
+    },
   },
 };
 </script>
@@ -5838,6 +5988,8 @@ export default {
                               color: #3f8dfd;
                               line-height: 24px;
                               margin-right: 20px;
+                              cursor: pointer;
+                              user-select: none;
                             }
 
                             .del {

+ 7 - 2
src/pages/course-list/index.vue

@@ -109,7 +109,7 @@
                   class="course-item"
                   v-for="(item, index) in goodsList"
                   :key="index"
-                  @click="goodsDetail(item)"
+                  @click="toGoodsDetail(item)"
                 >
                   <div class="course-item__img">
                     <img
@@ -186,6 +186,11 @@ export default {
   mounted() {
     this.params.searchKey = this.$route.query.searchKey || "";
     this.params.educationTypeId = this.$route.query.educationId || "";
+    this.params.projectId = this.$route.query.projectId || "";
+    this.params.businessId = this.$route.query.businessId || "";
+    if (this.params.businessId) {
+      this.getSubjectList();
+    }
     this.getEducationTypeList();
     this.changeSubject();
   },
@@ -207,7 +212,7 @@ export default {
       this.params.pageNum = e;
       this.changeSubject();
     },
-    goodsDetail(item) {
+    toGoodsDetail(item) {
       this.$router.push({
         path: "/course-detail/" + item.goodsId,
       });

+ 74 - 8
src/pages/goods-detail/bank-detail.vue

@@ -215,7 +215,8 @@
           </div>
         </div>
 
-        <div class="section__footer">
+        <div class="section__footer"
+          v-if="recommendList.goodsList && recommendList.goodsList.length">
           <div class="recommend">
             <div class="recommend__header">
               <div class="title">相关推荐</div>
@@ -224,25 +225,36 @@
               <ul class="list clearfix">
                 <li
                   class="recommend-item"
-                  v-for="(item, index) in 4"
+                  v-for="(itemy, index) in compyRecommend(
+                    recommendList.goodsList
+                  )"
                   :key="index"
                 >
-                  <div class="recommend-item__img">
-                    <div class="note">2022</div>
+                  <div
+                    class="recommend-item__img"
+                    :style="`background-image:url(${$tools.splitImgHost(
+                      itemy.coverUrl,
+                      true
+                    )})`"
+                    @click="toGoodsDetail(itemy)"
+                  >
+                    <div class="note" v-if="itemy.year">{{ itemy.year }}</div>
                   </div>
                   <div class="recommend-item__title">
-                    2022年二建建设工程法规及相关知识(黄金基础班)
+                    {{ itemy.goodsName }}
                   </div>
                   <div class="recommend-item__desc">
-                    <div class="price">¥100</div>
-                    <a class="add">加购物车</a>
+                    <div class="price">¥{{ itemy.standPrice }}</div>
+                    <a class="add" @click="addCart(true, itemy.goodsId)"
+                      >加购物车</a
+                    >
                   </div>
                 </li>
               </ul>
             </div>
 
             <div class="recommend__footer">
-              <div class="btn">查看更多</div>
+              <div class="btn" @click="comeMoreList">查看更多</div>
             </div>
           </div>
         </div>
@@ -1020,8 +1032,24 @@ export default {
       },
       judge: ["错误", "正确"],
       ast: ["A", "B", "C", "D", "E", "F", "G"],
+      recommendList:[]
     };
   },
+  computed: {
+    compyRecommend: function () {
+      return function (array) {
+        let ary = [];
+        for (let i = 0; i < array.length; i++) {
+          if (i >= 4) {
+            break;
+          } else {
+            ary.push(array[i]);
+          }
+        }
+        return ary;
+      };
+    },
+  },
   mounted() {
     this.goodsId = this.$route.params.goodsId;
     this.getGoodsDetail();
@@ -1029,6 +1057,41 @@ export default {
   },
   methods: {
     ...mapMutations(["setCheckGoodsList", "setCurrentRouter"]),
+    toGoodsDetail(item) {
+      this.$router.push({
+        path: "/bank-detail/" + item.goodsId,
+      });
+      location.reload();
+    },
+    /**
+     * 查看更多
+     */
+    comeMoreList() {
+      this.$router.push({
+        path: "/bank-list",
+        query: {
+          educationId: this.goodsDetail.educationTypeId,
+          projectId: this.goodsDetail.projectId,
+          businessId: this.goodsDetail.businessId,
+        },
+      });
+    },
+    /**
+     * 
+     获取推荐列表
+     */
+    getRecommend() {
+      this.$request
+        .appCommonActivityRecommendList({
+          businessId: this.goodsDetail.businessId,
+          type: 2,
+        })
+        .then((res) => {
+          if (res.rows.length) {
+            this.recommendList = res.rows[0];
+          }
+        });
+    },
     /**
      * @param {Object}
      * 单选点击确认
@@ -1642,6 +1705,7 @@ export default {
       this.$request.commonGoodsDetail(this.goodsId).then((res) => {
         this.goodsDetail = res.data;
         this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
+        this.getRecommend();
       });
     },
     /**
@@ -2032,6 +2096,8 @@ export default {
                 top: -78px;
                 background: rgba(122, 136, 246, 1);
                 overflow: hidden;
+                background: no-repeat center center;
+                background-size: 280px 178px;
 
                 .note {
                   width: 80px;

+ 79 - 13
src/pages/goods-detail/course-detail.vue

@@ -250,7 +250,10 @@
           </div>
         </div>
 
-        <div class="section__footer">
+        <div
+          class="section__footer"
+          v-if="recommendList.goodsList && recommendList.goodsList.length"
+        >
           <div class="recommend">
             <div class="recommend__header">
               <div class="title">相关推荐</div>
@@ -259,25 +262,36 @@
               <ul class="list clearfix">
                 <li
                   class="recommend-item"
-                  v-for="(item, index) in 4"
+                  v-for="(itemy, index) in compyRecommend(
+                    recommendList.goodsList
+                  )"
                   :key="index"
                 >
-                  <div class="recommend-item__img">
-                    <div class="note">2022</div>
+                  <div
+                    class="recommend-item__img"
+                    :style="`background-image:url(${$tools.splitImgHost(
+                      itemy.coverUrl,
+                      true
+                    )})`"
+                    @click="toGoodsDetail(itemy)"
+                  >
+                    <div class="note" v-if="itemy.year">{{ itemy.year }}</div>
                   </div>
                   <div class="recommend-item__title">
-                    2022年二建建设工程法规及相关知识(黄金基础班)
+                    {{ itemy.goodsName }}
                   </div>
                   <div class="recommend-item__desc">
-                    <div class="price">¥100</div>
-                    <a class="add">加购物车</a>
+                    <div class="price">¥{{ itemy.standPrice }}</div>
+                    <a class="add" @click="addCart(true, itemy.goodsId)"
+                      >加购物车</a
+                    >
                   </div>
                 </li>
               </ul>
             </div>
 
             <div class="recommend__footer">
-              <div class="btn">查看更多</div>
+              <div class="btn" @click="comeMoreList">查看更多</div>
             </div>
           </div>
         </div>
@@ -443,6 +457,7 @@ export default {
       },
       applyAreas: [],
       provinceList: [],
+      recommendList: {}, //推荐课程
     };
   },
   mounted() {
@@ -453,8 +468,42 @@ export default {
       this.getProvinceList();
     }
   },
+  computed: {
+    compyRecommend: function () {
+      return function (array) {
+        let ary = [];
+        for (let i = 0; i < array.length; i++) {
+          if (i >= 4) {
+            break;
+          } else {
+            ary.push(array[i]);
+          }
+        }
+        return ary;
+      };
+    },
+  },
   methods: {
     ...mapMutations(["setCheckGoodsList", "setCurrentRouter"]),
+    toGoodsDetail(item) {
+      this.$router.push({
+        path: "/course-detail/" + item.goodsId,
+      });
+      location.reload();
+    },
+    /**
+     * 查看更多
+     */
+    comeMoreList() {
+      this.$router.push({
+        path: "/course-list",
+        query: {
+          educationId: this.goodsDetail.educationTypeId,
+          projectId: this.goodsDetail.projectId,
+          businessId: this.goodsDetail.businessId,
+        },
+      });
+    },
     /**
      * 点击课程大目录
      */
@@ -465,7 +514,22 @@ export default {
         this.getMenuList(course);
       }
     },
-
+    /**
+     * 
+     获取推荐列表
+     */
+    getRecommend() {
+      this.$request
+        .appCommonActivityRecommendList({
+          businessId: this.goodsDetail.businessId,
+          type: 1,
+        })
+        .then((res) => {
+          if (res.rows.length) {
+            this.recommendList = res.rows[0];
+          }
+        });
+    },
     /**
      * 获取模块列表
      */
@@ -1193,7 +1257,7 @@ export default {
         path: "/payment",
       });
     },
-    addCart() {
+    addCart(status, goodsId) {
       if (!this.$tools.isLogin()) {
         this.setCurrentRouter(this.$route);
         this.$router.push({
@@ -1202,7 +1266,7 @@ export default {
         return;
       }
       this.$request
-        .addCart({ goodsId: this.goodsId })
+        .addCart({ goodsId: status ? goodsId : this.goodsId })
         .then((res) => {
           this.$message({
             message: "加入购物车成功",
@@ -1226,7 +1290,7 @@ export default {
         if (res.data.pcDetailHtml) {
           res.data.pcDetailHtml = res.data.pcDetailHtml.replace(
             /<img/gi,
-            '<img style="max-width:100%;max-height:400px;"'
+            '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
           );
         }
         this.goodsDetail = res.data;
@@ -1241,6 +1305,7 @@ export default {
             this.goodsAuditionConfigIdList.push(itemChild.sectionId); //存储试听节ID
           }
         }
+        this.getRecommend();
       });
     },
     /**
@@ -1651,7 +1716,8 @@ export default {
                 top: -78px;
                 background: rgba(122, 136, 246, 1);
                 overflow: hidden;
-
+                background: no-repeat center center;
+                background-size: 280px 178px;
                 .note {
                   width: 80px;
                   height: 24px;

+ 61 - 4
src/pages/home/index.vue

@@ -282,10 +282,29 @@
 
               <div class="history">
                 <div class="btn">上次播放</div>
-                <div class="title">2022年二级建造师建设工程施工管理</div>
+                <div
+                  class="title"
+                  @click="
+                    go('/my-course-detail/' + recordList.goodsId, {
+                      gradeId: recordList.gradeId,
+                      orderGoodsId: recordList.orderGoodsId,
+                      courseId: recordList.courseId,
+                    })
+                  "
+                >
+                  {{ recordList.goodsName }}
+                </div>
                 <div class="progress">
-                  <span>已学70%</span>
-                  <span>2022-02-17</span>
+                  <span
+                    >已学{{
+                      toFixed(
+                        (recordList.videoCurrentTime /
+                          recordList.durationTime) *
+                          100
+                      )
+                    }}%</span
+                  >
+                  <span>{{ recordList.date }}</span>
                 </div>
               </div>
             </div>
@@ -555,18 +574,56 @@ export default {
       active2: 0, //推荐题库index
       searchKey: "",
       type: "1",
+      recordList: {},
     };
   },
   mounted() {
+    if (this.userInfo) {
+      this.getRecord();
+    }
     this.getActivityList();
     // this.color = this.colors[0];
     this.advertisingList();
     this.educationTypeList();
     this.advertisingHomeLocation();
   },
+  watch: {
+    userInfo(val) {
+      if (val) {
+        this.getRecord();
+      }
+    },
+  },
   methods: {
+    toFixed(num) {
+      if (num) {
+        let str = String(num).indexOf(".");
+
+        if (str != -1) {
+          return +num.toFixed(2);
+        } else {
+          return num;
+        }
+      } else {
+        return 0;
+      }
+    },
     ...mapMutations(["setUserInfo"]),
-
+    /**
+     * 播放记录
+     */
+    getRecord() {
+      this.$request
+        .studRrecordListUserRecord({
+          pageNum: 1,
+          pageSize: 1,
+        })
+        .then((res) => {
+          if (res.rows.length) {
+            this.recordList = res.rows[0];
+          }
+        });
+    },
     search() {
       if (!this.searchKey.trim()) {
         this.$message({

+ 85 - 9
src/pages/person-center/my-bank/bank-detail/index.vue

@@ -544,7 +544,10 @@
               </div>
             </div>
           </div>
-          <div class="right-box__body">
+          <div
+            class="right-box__body"
+            v-if="recommendList.goodsList && recommendList.goodsList.length"
+          >
             <div class="title">
               推荐题库
               <span class="more" @click="go('/bank-list')">更多></span>
@@ -552,19 +555,29 @@
             <ul class="list">
               <li
                 class="course-item"
-                v-for="(item, index) in 5"
+                v-for="(itemy, index) in compyRecommend(
+                  recommendList.goodsList
+                )"
                 :key="index"
-                @click="goodsDetail()"
+                @click="toGoodsDetail(itemy)"
               >
-                <div class="course-item__img">
-                  <div class="note">2022</div>
+                <div
+                  class="course-item__img"
+                  :style="`background-image:url(${$tools.splitImgHost(
+                    itemy.coverUrl,
+                    true
+                  )})`"
+                >
+                  <div class="note" v-if="itemy.year">{{ itemy.year }}</div>
                 </div>
                 <div class="course-item__title">
-                  2022年二建建设工程法规及相关知识(黄金基础班)
+                  {{ itemy.goodsName }}
                 </div>
                 <div class="course-item__desc">
-                  <div class="price">¥100</div>
-                  <a class="add">加购物车</a>
+                  <div class="price">¥{{ itemy.standPrice }}</div>
+                  <a class="add" @click.stop="addCart(true, itemy.goodsId)"
+                    >加购物车</a
+                  >
                 </div>
               </li>
             </ul>
@@ -599,6 +612,7 @@ export default {
       wrongExamList: [],
       collectTotal: 0,
       wrongTotal: 0,
+      recommendList: [],
     };
   },
   mounted() {
@@ -609,7 +623,67 @@ export default {
     this.getDetail();
     this.examaperList();
   },
+  computed: {
+    compyRecommend: function () {
+      return function (array) {
+        let ary = [];
+        for (let i = 0; i < array.length; i++) {
+          if (i >= 4) {
+            break;
+          } else {
+            ary.push(array[i]);
+          }
+        }
+        return ary;
+      };
+    },
+  },
   methods: {
+    /**
+     * 跳转
+     */
+    toGoodsDetail(item){
+      this.$router.push({
+        path: "/bank-detail/" + item.goodsId,
+        query: {
+          orderGoodsId: item.orderGoodsId,
+        },
+      });
+    },
+    addCart(status, goodsId) {
+      this.$request
+        .addCart({ goodsId: status ? goodsId : this.goodsId })
+        .then((res) => {
+          this.$message({
+            message: "加入购物车成功",
+            type: "success",
+          });
+        })
+        .catch((err) => {
+          if (err.code == 500) {
+            this.$message({
+              message: err.msg,
+              type: "warning",
+            });
+          }
+        });
+    },
+    /**
+     * 
+     获取推荐列表
+     */
+    getRecommend() {
+      this.$request
+        .appCommonActivityRecommendList({
+          businessId: this.goodsDetail.businessId,
+          type: 1,
+        })
+        .then((res) => {
+          if (res.rows.length) {
+            this.recommendList = res.rows[0];
+          }
+        });
+    },
     go(path, query = {}) {
       console.log(path, query);
       this.$router.push({
@@ -634,8 +708,8 @@ export default {
 
     getDetail() {
       this.$request.commonGoodsDetail(this.goodsId).then((res) => {
-        console.log(res);
         this.goodsDetail = res.data;
+        this.getRecommend();
       });
     },
 
@@ -1289,6 +1363,8 @@ export default {
                 top: -78px;
                 background: rgba(122, 136, 246, 1);
                 overflow: hidden;
+                background: no-repeat center center;
+                background-size: 280px 178px;
 
                 .note {
                   width: 80px;

+ 3 - 0
src/pages/person-center/my-bank/index/index.vue

@@ -139,6 +139,9 @@ export default {
         param.educationTypeId = this.activeName;
       }
       this.$request.listGoodsUserQuestion(param).then((res) => {
+        res.rows.forEach(item => {
+          console.log(`${item.goodsName}:${item.doNum}/${item.totalNum}`)
+        })
         this.list = res.rows;
         this.total = res.total;
       });

+ 14 - 3
src/pages/person-center/my-classhour/appointment-add-kp/index.vue

@@ -34,7 +34,11 @@
             </el-select>
           </el-form-item>
           <el-form-item label="考前培训时间:">
-            <el-select v-model="timeIndex" placeholder="请选择">
+            <el-select
+              v-model="timeIndex"
+              placeholder="请选择"
+              v-if="activeList && activeList.length"
+            >
               <el-option
                 :label="
                   item.dataTime + ' ' + item.startTime + ' ~ ' + item.endTime
@@ -44,6 +48,9 @@
                 :key="index"
               ></el-option>
             </el-select>
+            <span v-if="addressId && !activeList.length"
+              >该考培地点暂无考试时间,建议重新选择考培地点</span
+            >
           </el-form-item>
         </div>
 
@@ -76,7 +83,7 @@
                 <div class="icon">✔</div>
                 <div class="text">考试预约成功</div>
               </div>
-              <div class="confirm">查看预约</div>
+              <div class="confirm" @click="viewAppointment">查看预约</div>
             </div>
           </div>
         </div>
@@ -137,7 +144,11 @@ export default {
     cancel() {
       this.$router.go(-1);
     },
-
+    viewAppointment() {
+      this.$router.push({
+        path: "/person-center/my-examination",
+      });
+    },
     addressChange() {
       var self = this;
       const index = this.listData.findIndex(

+ 12 - 3
src/pages/person-center/my-classhour/appointment-add/index.vue

@@ -34,7 +34,11 @@
             </el-select>
           </el-form-item>
           <el-form-item label="考试时间:">
-            <el-select v-model="timeIndex" placeholder="请选择">
+            <el-select
+              v-if="activeList && activeList.length"
+              v-model="timeIndex"
+              placeholder="请选择"
+            >
               <el-option
                 :label="
                   item.dataTime +
@@ -55,6 +59,7 @@
                 :key="index"
               ></el-option>
             </el-select>
+            <span v-if="addressId && !activeList.length">该考试地点暂无考试时间,建议重新选择考试地点</span>
           </el-form-item>
         </div>
 
@@ -89,7 +94,7 @@
                 <div class="icon">✔</div>
                 <div class="text">考试预约成功</div>
               </div>
-              <div class="confirm">查看预约</div>
+              <div class="confirm" @click="viewAppointment">查看预约</div>
             </div>
           </div>
         </div>
@@ -132,7 +137,11 @@ export default {
     cancel() {
       this.$router.go(-1);
     },
-
+    viewAppointment(){
+      this.$router.push({
+        path:"/person-center/my-examination"
+      })
+    },
     addressChange() {
       var arrays = [];
       var self = this;

+ 3 - 1
src/pages/subject/wrong-bank.vue

@@ -1056,11 +1056,13 @@ export default {
         this.questionList[questionIndex].ans
       ) {
       } else {
+        console.log(this.questionList[questionIndex])
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
+            orderGoodsId: this.$route.query.orderGoodsId,
             questionId: this.questionList[questionIndex].questionId,
+            goodsId:this.questionList[questionIndex].goodsId
           })
           .then((res) => {});
       }

+ 6 - 3
src/pages/subject/wrong-type-bank.vue

@@ -1058,8 +1058,9 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
+            orderGoodsId: this.$route.query.orderGoodsId,
             questionId: this.questionList[questionIndex].questionId,
+            goodsId: this.questionList[questionIndex].goodsId,
           })
           .then((res) => {});
       }
@@ -1111,8 +1112,9 @@ export default {
           this.$request
             .wrongRecordDelete({
               examId: question.examId,
-              orderGoodsId: question.orderGoodsId,
+              orderGoodsId: this.$route.query.orderGoodsId,
               questionId: question.questionId,
+              goodsId: question.goodsId,
             })
             .then((res) => {});
         }
@@ -1159,8 +1161,9 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
+            orderGoodsId: this.$route.query.orderGoodsId,
             questionId: this.questionList[questionIndex].questionId,
+            goodsId: this.questionList[questionIndex].goodsId,
           })
           .then((res) => {});
       }