Quellcode durchsuchen

退款订单查询修复+答疑逻辑修复

En route vor 1 Jahr
Ursprung
Commit
1b00d12554

+ 36 - 5
src/pages/course-detail/components/AnswerQuestions.vue

@@ -119,11 +119,20 @@
 <script>
 import { mapGetters } from "vuex";
 export default {
+  props: {
+    activeSection: {
+      type: Object,
+      default: () => {
+        return {};
+      } //当前节数据
+    }
+  },
   inject: ["getGoodsData"],
   data() {
     return {
       textarea: "",
-      answerList: []
+      answerList: [],
+      setInter: null
     };
   },
   computed: {
@@ -134,6 +143,19 @@ export default {
   },
   created() {
     this.getAnswerList();
+    this.setInter = setInterval(() => {
+      this.getAnswerList();
+    }, 10000);
+  },
+  mounted() {
+    this.$bus.$on("toPlay", item => {
+      this.getAnswerList();
+    });
+  },
+  beforeDestroy() {
+    this.$bus.$off("toPlay");
+    clearInterval(this.setInter);
+    console.log("销毁答疑");
   },
   methods: {
     /**提出答疑 */
@@ -143,10 +165,13 @@ export default {
         return;
       }
       let data = {
-        courseId: this.goodsData.courseId,
+        courseId: this.activeSection.courseId,
         goodsId: this.goodsData.goodsId,
         orderGoodsId: this.goodsData.orderGoodsId,
-        answerText: this.textarea
+        answerText: this.textarea,
+        moduleId: this.activeSection.moduleId,
+        chapterId: this.activeSection.chapterId,
+        sectionId: this.activeSection.sectionId
       };
       this.$request.addAnswer(data).then(res => {
         this.textarea = "";
@@ -163,7 +188,10 @@ export default {
       this.$request
         .answerList({
           courseId: this.goodsData.courseId,
-          goodsId: this.goodsData.goodsId
+          goodsId: this.goodsData.goodsId,
+          moduleId: this.activeSection.moduleId,
+          chapterId: this.activeSection.chapterId,
+          sectionId: this.activeSection.sectionId
         })
         .then(res => {
           let data1 = [];
@@ -218,7 +246,7 @@ export default {
     },
     /**回复 */
     answerBack(row) {
-      this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
+      this.$prompt(`${row.realname || '教务人员'}:${row.answerText}`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         inputErrorMessage: "输入不能为空",
@@ -236,6 +264,9 @@ export default {
             assignAnswerId: row.answerId,
             courseId: this.goodsData.courseId,
             goodsId: this.goodsData.goodsId,
+            moduleId: this.activeSection.moduleId,
+            chapterId: this.activeSection.chapterId,
+            sectionId: this.activeSection.sectionId,
             orderGoodsId: this.goodsData.orderGoodsId,
             answerText: value,
             assignAnswerText: row.assignAnswerText

+ 4 - 1
src/pages/course-detail/components/coreContent.vue

@@ -61,7 +61,10 @@
             </course-tree>
           </template>
           <template v-if="tab.name == '3'">
-            <answer-questions ref="answerQuestions"></answer-questions>
+            <answer-questions
+              ref="answerQuestions"
+              :activeSection.sync="activeSection"
+            ></answer-questions>
           </template>
           <template v-if="tab.name == '4'">
             <Notes ref="notes"></Notes>

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

@@ -386,6 +386,7 @@ export default {
 
       this.$request
         .orderRefundList({
+          periodStatus:3,
           pageNum: 1,
           pageSize: 1
         })
@@ -559,8 +560,10 @@ export default {
     orderRefundList() {
       this.showLoading();
       this.formData.orderStatus = "";
+      let data = JSON.parse(JSON.stringify(this.formData))
+      data.periodStatus = 3
       this.$request
-        .orderRefundList(this.formData)
+        .orderRefundList(data)
         .then(res => {
           this.hideLoading();
           this.orderList = res.rows;