Przeglądaj źródła

组卷问题修复及退款优化及动态TenId

Tang 2 lat temu
rodzic
commit
696002eb79

+ 9 - 9
src/App.vue

@@ -9,17 +9,17 @@ export default {
   name: "App",
   data() {
     return {
-      isDesktop: false,
+      // isDesktop: false
     };
   },
-  created() {
-    this.$store.dispatch("getCommonBaseHomeList");
-    if (!this.$store.state.isDesktop) {
-      this.$request.getWeAppLink().then((res) => {
-        res.msg && (window.location.href = res.msg);
-      });
-    }
-  },
+  mounted() {
+    // this.$store.dispatch("getCommonBaseHomeList");
+    // if (!this.$store.state.isDesktop) {
+    //   this.$request.getWeAppLink().then(res => {
+    //     res.msg && (window.location.href = res.msg);
+    //   });
+    // }
+  }
 };
 </script>
 

+ 2 - 1
src/apis/bank.js

@@ -147,7 +147,8 @@ export default {
 
   examWrongRecordWrongNum(data) {
     return request({
-      url: `/exam/wwrong/record/wrongNum/${data}`,
+      url: `/exam/wwrong/record/wrongNum`,
+      params: data,
       method: 'get'
     })
   },

+ 1 - 0
src/apis/login.js

@@ -150,6 +150,7 @@ export default {
 			url: '/app/common/dual_auth',
 			method: 'get',
       params:data,
+			noToken: true
 		})
 	},
 }

+ 2 - 3
src/axios.js

@@ -32,8 +32,7 @@ request.interceptors.request.use(config => {
   if (token && !config.noToken) {
     config.headers['AuthorizationToken'] = 'WX ' + token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }
-  config.headers['TenantId'] = tenantId
-
+  config.headers['TenantId'] = store.state && store.state.TENANT_NANE ? store.state.TENANT_NANE : ""
   return config
 }, err)
 
@@ -103,7 +102,7 @@ async function refreshToken(response) {
     var userInfo = {
       url: '/app/user/getInfo',
       method: 'get',
-      params: {fromPlat: 2}, // 来源平台 1小程序 2PC网站
+      params: { fromPlat: 2 }, // 来源平台 1小程序 2PC网站
     }
     const resUser = await request(userInfo)
     if (resUser.data.code === 200) {

+ 1 - 1
src/components/common/CollectionBox.vue

@@ -56,7 +56,7 @@ export default {
 <style scoped lang="scss">
 .col-box {
   width: 970px;
-  position: absolute;
+  // position: absolute;
   bottom: 0;
   padding: 12px 0;
   border-top: 1px solid #eeeeee;

+ 17 - 13
src/components/footer/index.vue

@@ -19,13 +19,8 @@
       </div>
 
       <div class="footer__footer">
-        <p>
-          Copyright©2016-2022 {{ recodeMsg.name }} 版权所有
-          <a href="https://beian.miit.gov.cn/" target="_blank">
-            {{ recodeMsg.no }}</a
-          >
-        </p>
-        <p>技术支持:{{ recodeMsg.support }}</p>
+        <p v-html="recodeMsg.footerRecordNo"></p>
+        <p v-html="recodeMsg.footerTip"></p>
         <p v-if="recodeMsg.tips1">{{ recodeMsg.tips1 }}</p>
         <p v-if="recodeMsg.tips2">{{ recodeMsg.tips2 }}</p>
       </div>
@@ -35,28 +30,37 @@
 
 <script>
 import { mapGetters } from "vuex";
-import config from "@/apis/config";
+// import config from "@/apis/config";
 export default {
   name: "Footer",
   data() {
     return {
-      recodeMsg: config,
+      recodeMsg: {}
     };
   },
   computed: {
     ...mapGetters(["footer", "links"]),
-    showList: function () {
-      return function (list) {
+    showList: function() {
+      return function(list) {
         let showList = [];
         if (list) {
-          showList = list.filter((item) => {
+          showList = list.filter(item => {
             return item.status == 1;
           });
         }
         return showList;
       };
-    },
+    }
   },
+  created() {
+    this.$request.getCommonBaseHomeList().then(res => {
+      res.rows.forEach(item => {
+        if (item.configKey === "home.footer.record") {
+          this.recodeMsg = JSON.parse(item.configValue);
+        }
+      });
+    });
+  }
 };
 </script>
 

+ 2 - 1
src/pages/bank-exam-continue/index.vue

@@ -1840,7 +1840,8 @@ export default {
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
           type: 1,
-          doMode: this.doMode
+          doMode: this.doMode,
+          courseType:1
         })
         .then((res) => {})
         .catch((err) => {});

Plik diff jest za duży
+ 331 - 308
src/pages/bank-exam/index.vue


+ 58 - 44
src/pages/bank-report/index.vue

@@ -150,17 +150,26 @@
               @click="backBank"
               >练习下一节</el-button
             >
-            <el-button type="primary" class="btn" @click="doRepeat(reportdata)" v-if="examData.simulateStatus != 1"
+            <el-button
+              type="primary"
+              class="btn"
+              @click="doRepeat(reportdata)"
+              v-if="examData.simulateStatus != 1"
               >重新做题</el-button
             >
           </template>
           <template v-else>
             <el-button type="primary" @click="back" class="btn">返回</el-button>
-            <el-button type="primary" @click="back" class="btn" v-if="examData.simulateStatus != 1"
+            <el-button
+              type="primary"
+              @click="back"
+              class="btn"
+              v-if="examData.simulateStatus != 1"
               >继续练习</el-button
             >
           </template>
           <el-button
+            v-if="wrongRecordWrongNum"
             type="primary"
             class="btn"
             @click="wrongExplain(reportdata)"
@@ -223,7 +232,7 @@ export default {
     Footer,
     Header,
     ToolBar,
-    GoodsItem,
+    GoodsItem
   },
   data() {
     return {
@@ -241,11 +250,11 @@ export default {
       pageNum: 1,
       pageSize: 10,
       total: 0,
-      examType: 0,
+      examType: 0
     };
   },
   computed: {
-    ...mapGetters(["examResult"]),
+    ...mapGetters(["examResult"])
   },
   async mounted() {
     this.chapterId = this.$route.query.chapterId;
@@ -276,9 +285,9 @@ export default {
           examId: this.examId,
           pageNum: this.pageNum,
           pageSize: this.pageSize,
-          platform: 2,
-        },
-      }).then((res) => {
+          platform: 2
+        }
+      }).then(res => {
         if (res.code == 200) {
           this.courseList = res.rows || [];
           this.total = res.total;
@@ -299,8 +308,8 @@ export default {
       this.$router.replace({
         path: "/person-center/my-bank/index",
         query: {
-          examType: this.examType * 1 || undefined,
-        },
+          examType: this.examType * 1 || undefined
+        }
       });
     },
     /**
@@ -317,7 +326,7 @@ export default {
       if (answerNum > 0 && count >= answerNum) {
         this.$message({
           type: "warning",
-          message: "该试卷只能答题" + answerNum + "次!",
+          message: "该试卷只能答题" + answerNum + "次!"
         });
         return;
       }
@@ -328,8 +337,8 @@ export default {
           orderGoodsId: this.orderGoodsId,
           examId: reportdata.examId,
           moduleId: reportdata.moduleId || 0,
-          chapterId: reportdata.chapterId || 0,
-        },
+          chapterId: reportdata.chapterId || 0
+        }
       });
     },
 
@@ -338,8 +347,8 @@ export default {
      * 获取试卷可以做的次数
      */
     getExamDetail(exam_id) {
-      return new Promise((resolve) => {
-        this.$request.getExamDetail(exam_id).then((res) => {
+      return new Promise(resolve => {
+        this.$request.getExamDetail(exam_id).then(res => {
           resolve(res.data.answerNum);
         });
       });
@@ -349,35 +358,40 @@ export default {
      * 查询试卷历史做题次数
      */
     examRecordCount(examId, goodsId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .examRecordCount({
             examId: examId,
-            goodsId: goodsId,
+            goodsId: goodsId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
     getDetail(goodsId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .orderInfo({
-            orderGoodsId: this.orderGoodsId,
+            orderGoodsId: this.orderGoodsId
           })
-          .then((res) => {
+          .then(res => {
             this.goodsData = res.data;
             resolve();
           });
       });
     },
     examWrongRecordWrongNum() {
-      return new Promise((resolve) => {
-        this.$request.examWrongRecordWrongNum(this.recordId).then((res) => {
-          this.wrongRecordWrongNum = res.data || 0;
-          resolve();
-        });
+      return new Promise(resolve => {
+        this.$request
+          .examWrongRecordWrongNum({
+            recordId: this.recordId,
+            courseType: 1
+          })
+          .then(res => {
+            this.wrongRecordWrongNum = res.data || 0;
+            resolve();
+          });
       });
     },
 
@@ -388,8 +402,8 @@ export default {
           orderGoodsId: this.orderGoodsId,
           examId: this.nextExamId,
           moduleId: this.moduleId || 0,
-          chapterId: this.chapterId || 0,
-        },
+          chapterId: this.chapterId || 0
+        }
       });
     },
 
@@ -400,27 +414,27 @@ export default {
           examId: this.examId,
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
-          moduleExamId: this.moduleId,
+          moduleExamId: this.moduleId
         })
-        .then((res) => {
+        .then(res => {
           this.nextExamId = res.data.examId;
         })
-        .catch((err) => {
+        .catch(err => {
           this.nextExamId = "";
         });
     },
 
     bankExam() {
-      return new Promise((resolve) => {
-        this.$request.bankExam(this.examId).then((res) => {
+      return new Promise(resolve => {
+        this.$request.bankExam(this.examId).then(res => {
           this.examData = res.data;
           resolve();
         });
       });
     },
     bankTempExam() {
-      return new Promise((resolve) => {
-        this.$request.bankTempExam(this.examId).then((res) => {
+      return new Promise(resolve => {
+        this.$request.bankTempExam(this.examId).then(res => {
           res.data.doType = 1;
           this.examData = res.data;
           resolve();
@@ -428,8 +442,8 @@ export default {
       });
     },
     examReport() {
-      return new Promise((resolve) => {
-        this.$request.examReport(this.recordId).then((res) => {
+      return new Promise(resolve => {
+        this.$request.examReport(this.recordId).then(res => {
           this.reportdata = res.data;
           resolve();
         });
@@ -444,8 +458,8 @@ export default {
           moduleId: reportdata.moduleId || 0,
           chapterId: reportdata.chapterId || 0,
           goodsId: this.goodsId,
-          orderGoodsId: this.orderGoodsId,
-        },
+          orderGoodsId: this.orderGoodsId
+        }
       });
     },
 
@@ -453,15 +467,15 @@ export default {
       this.$router.push({
         path: "/bank-exam-all-explain/" + reportdata.recordId,
         query: {
-          simulateStatus:this.examData.simulateStatus,
+          simulateStatus: this.examData.simulateStatus,
           examId: reportdata.examId,
           moduleId: reportdata.moduleId || 0,
           chapterId: reportdata.chapterId || 0,
-          goodsId: this.goodsId,
-        },
+          goodsId: this.goodsId
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 23 - 1
src/pages/course-exam/index.vue

@@ -1177,6 +1177,7 @@ export default {
         "Y",
         "Z",
       ],
+      mustBack:false,
       needPhoto: false,
       lastTime: 0, //剩余考试时长
       allTimes: 0, //总考试时长
@@ -1432,7 +1433,19 @@ export default {
         this.lastCount = this.questionList.length;
         this.getCollectInfo(this.current);
         await this.examRecord();
-      });
+      }).catch(err => {
+          if (this.doMode == 3) {
+            this.$alert("你已做完所有题目", "提示", {
+              confirmButtonText: "确定,并且返回上一页",
+              showClose: false,
+              callback: action => {
+                this.mustBack = true;
+                this.$router.go(-1);
+                return;
+              }
+            });
+          }
+        });
     },
     //拍照
     openPhoto() {
@@ -2556,6 +2569,7 @@ export default {
           recordId: this.recordId,
           type: 2, // 视频课程的传2
           doMode: this.doMode,
+          courseType:2
         })
         .then((res) => {})
         .catch((err) => {});
@@ -2717,6 +2731,12 @@ export default {
     },
   },
   beforeRouteLeave(to, from, next) {
+
+    if (this.mustBack) {
+      next()
+    }else
+    {
+
     if (this.isSubmit) {
       //交卷
       next();
@@ -2800,6 +2820,8 @@ export default {
         }
       }
     }
+      
+    }
   },
 };
 </script>

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

@@ -98,7 +98,7 @@
           <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="wrongExplain(reportdata)">错题解析</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>
 

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

@@ -201,6 +201,7 @@
             >重新做题</el-button
           > -->
           <el-button
+          v-if="wrongRecordWrongNum"
             type="primary"
             class="btn"
             @click="wrongExplain(reportdata)"

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

@@ -20,7 +20,7 @@
           @click="jumpExternalLink"
           size="mini"
           type="primary"
-          >进入外链</el-button
+          >进入学习</el-button
         >
       </h4>
       <bank-detail-copy

+ 76 - 69
src/pages/person-center/my-classhour/index/index.vue

@@ -49,8 +49,8 @@
                     <template
                       v-if="
                         item.educationName == '继续教育' &&
-                        item.businessName == '二级' &&
-                        item.projectName == '建造师'
+                          item.businessName == '二级' &&
+                          item.projectName == '建造师'
                       "
                     >
                       机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
@@ -79,17 +79,18 @@
                       class="btn"
                       v-if="
                         item.periodStatus === -1 &&
-                        !(
-                          sysTime <= item.serviceStartTime ||
-                          sysTime >= item.serviceEndTime ||
-                          (item.classStartTime &&
-                            sysTime <= item.classStartTime) ||
-                          (item.classEndTime && sysTime >= item.classEndTime) ||
-                          item.learningStatus == 2 ||
-                          item.classStatus == 0 ||
-                          (item.learningStatus == 3 &&
-                            sysTime < item.learningTimeStart)
-                        )
+                          !(
+                            sysTime <= item.serviceStartTime ||
+                            sysTime >= item.serviceEndTime ||
+                            (item.classStartTime &&
+                              sysTime <= item.classStartTime) ||
+                            (item.classEndTime &&
+                              sysTime >= item.classEndTime) ||
+                            item.learningStatus == 2 ||
+                            item.classStatus == 0 ||
+                            (item.learningStatus == 3 &&
+                              sysTime < item.learningTimeStart)
+                          )
                       "
                       @click="goCourseDetail(item)"
                     >
@@ -100,18 +101,19 @@
                       class="btn"
                       v-if="
                         item.periodStatus === 1 &&
-                        item.applyStatus === 1 &&
-                        !(
-                          sysTime <= item.serviceStartTime ||
-                          sysTime >= item.serviceEndTime ||
-                          (item.classStartTime &&
-                            sysTime <= item.classStartTime) ||
-                          (item.classEndTime && sysTime >= item.classEndTime) ||
-                          item.learningStatus == 2 ||
-                          item.classStatus == 0 ||
-                          (item.learningStatus == 3 &&
-                            sysTime < item.learningTimeStart)
-                        )
+                          item.applyStatus === 1 &&
+                          !(
+                            sysTime <= item.serviceStartTime ||
+                            sysTime >= item.serviceEndTime ||
+                            (item.classStartTime &&
+                              sysTime <= item.classStartTime) ||
+                            (item.classEndTime &&
+                              sysTime >= item.classEndTime) ||
+                            item.learningStatus == 2 ||
+                            item.classStatus == 0 ||
+                            (item.learningStatus == 3 &&
+                              sysTime < item.learningTimeStart)
+                          )
                       "
                       @click="appointment(item)"
                     >
@@ -122,18 +124,19 @@
                       class="btn"
                       v-if="
                         item.periodStatus === 1 &&
-                        item.beforeStatus === 1 &&
-                        !(
-                          sysTime <= item.serviceStartTime ||
-                          sysTime >= item.serviceEndTime ||
-                          (item.classStartTime &&
-                            sysTime <= item.classStartTime) ||
-                          (item.classEndTime && sysTime >= item.classEndTime) ||
-                          item.learningStatus == 2 ||
-                          item.classStatus == 0 ||
-                          (item.learningStatus == 3 &&
-                            sysTime < item.learningTimeStart)
-                        )
+                          item.beforeStatus === 1 &&
+                          !(
+                            sysTime <= item.serviceStartTime ||
+                            sysTime >= item.serviceEndTime ||
+                            (item.classStartTime &&
+                              sysTime <= item.classStartTime) ||
+                            (item.classEndTime &&
+                              sysTime >= item.classEndTime) ||
+                            item.learningStatus == 2 ||
+                            item.classStatus == 0 ||
+                            (item.learningStatus == 3 &&
+                              sysTime < item.learningTimeStart)
+                          )
                       "
                       @click="appBeforeAddress(item)"
                     >
@@ -305,10 +308,10 @@ export default {
   components: {
     RebuildModal,
     ElImageViewer,
-    ExercisesModal,
+    ExercisesModal
   },
   computed: {
-    ...mapGetters(["sysTime", "userInfo"]),
+    ...mapGetters(["sysTime", "userInfo"])
   },
   data() {
     return {
@@ -332,10 +335,10 @@ export default {
       rebuildItem: {},
       param: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 10
       },
       url: "",
-      total: 0,
+      total: 0
     };
   },
   mounted() {
@@ -352,6 +355,10 @@ export default {
       this.showViewer = false;
     },
     async goCourseDetail(item) {
+      if (item.externalLinkStatus) {
+        window.open(item.externalLink, "_blank");
+        return
+      }
       this.activeItem = item;
       var confirmDetail = true;
       if (item.educationName == "继续教育") {
@@ -370,8 +377,8 @@ export default {
         path: `/my-course-detail/${item.goodsId}`,
         query: {
           gradeId: item.gradeId,
-          orderGoodsId: item.orderGoodsId,
-        },
+          orderGoodsId: item.orderGoodsId
+        }
       });
     },
 
@@ -384,14 +391,14 @@ export default {
       let infoJson = {
         realname: this.userInfo.realname,
         idCard: this.userInfo.idCard,
-        telphone: this.userInfo.telphone,
+        telphone: this.userInfo.telphone
       };
       this.$request
         .userConfirminfo({
           infoJson: JSON.stringify(infoJson),
-          orderGoodsId: this.activeItem.orderGoodsId,
+          orderGoodsId: this.activeItem.orderGoodsId
         })
-        .then((res) => {
+        .then(res => {
           if (res.data.pushInfo) {
             this.$message.success("提交成功");
           } else {
@@ -404,11 +411,11 @@ export default {
                 closeOnPressEscape: false,
                 distinguishCancelAndClose: false,
                 showClose: false,
-                showCancelButton: false,
+                showCancelButton: false
               }
             )
-              .then((_) => {})
-              .catch((_) => {});
+              .then(_ => {})
+              .catch(_ => {});
           }
           this.showConfirm = false;
           this.confirmLoading = false;
@@ -416,12 +423,12 @@ export default {
     },
 
     userConfirmInfoDetail(item) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .userConfirmInfoDetail({
-            orderGoodsId: this.activeItem.orderGoodsId,
+            orderGoodsId: this.activeItem.orderGoodsId
           })
-          .then((res) => {
+          .then(res => {
             if (!res.data) {
               clearInterval(this.confirmTimer);
               this.confirmCount = 10;
@@ -446,11 +453,11 @@ export default {
                     closeOnPressEscape: false,
                     distinguishCancelAndClose: false,
                     showClose: false,
-                    showCancelButton: false,
+                    showCancelButton: false
                   }
                 )
-                  .then((_) => {})
-                  .catch((_) => {});
+                  .then(_ => {})
+                  .catch(_ => {});
                 resolve(false);
               }
             }
@@ -519,25 +526,25 @@ export default {
         goodsId: this.appointItem.goodsId,
         gradeId: this.appointItem.gradeId,
         applyId: this.applyId,
-        orderGoodsId: this.appointItem.orderGoodsId,
+        orderGoodsId: this.appointItem.orderGoodsId
       };
       this.$request
         .getApplysubscribe(data)
-        .then((res) => {
+        .then(res => {
           this.$router.push({
             path: "/person-center/my-classhour/appointment",
             query: {
               goodsId: this.appointItem.goodsId,
               gradeId: this.appointItem.gradeId,
               orderGoodsId: this.appointItem.orderGoodsId,
-              applyId: this.applyId,
-            },
+              applyId: this.applyId
+            }
           });
         })
-        .catch((err) => {
+        .catch(err => {
           this.$message({
             type: "warning",
-            message: err.msg,
+            message: err.msg
           });
         });
     },
@@ -547,28 +554,28 @@ export default {
         path: `/my-course-detail/${item.goodsId}`,
         query: {
           gradeId: item.gradeId,
-          orderGoodsId: item.orderGoodsId,
-        },
+          orderGoodsId: item.orderGoodsId
+        }
       });
     },
     getcourseperiodlistGoods() {
       this.$request
         .getcourseperiodlistGoods(this.param)
-        .then((res) => {
+        .then(res => {
           this.listData = [...res.rows];
           this.total = res.total;
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
 
     getUserCertificateList() {
       this.$request
         .getUserCertificateList(this.param)
-        .then((res) => {
+        .then(res => {
           this.listData1 = [...res.rows];
           this.total = res.total;
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
 
     getcourseperiodcheat(item) {
@@ -603,8 +610,8 @@ export default {
       } catch (err) {
         this.$message.error("复制失败,请检查浏览器兼容");
       }
-    },
-  },
+    }
+  }
 };
 </script>
 

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

@@ -13,7 +13,7 @@
           style="margin-left: 14px"
           @click="changeCourse"
           >切换科目</el-button
-        ><el-button v-if="outerChain()" @click="jumpExternalLink" size="mini" type="primary">进入外链</el-button>
+        ><el-button v-if="outerChain()" @click="jumpExternalLink" size="mini" type="primary">进入学习</el-button>
 
         <el-button
           v-if="

+ 72 - 68
src/pages/person-center/my-order/index.vue

@@ -60,17 +60,17 @@
                     @click="refund(item.orderSn, items.goodsId)"
                     v-if="
                       items.periodStatus !== 0 &&
-                      items.periodStatus !== 1 &&
-                      items.periodStatus !== 2 &&
-                      items.refundStatus === 0&&
-                      (item.orderFrom === 2 || item.orderFrom === 3) &&
-                      (item.orderStatus === 1 ||
-                        item.orderStatus === 2 ||
-                        item.orderStatus === 3) &&
-                      (items.goodsType == '1' ||
-                        items.goodsType == '2' ||
-                        items.goodsType == '6') &&
-                      items.goodsPrice > 0
+                        items.periodStatus !== 1 &&
+                        items.periodStatus !== 2 &&
+                        items.refundStatus === 0 &&
+                        (item.orderFrom === 2 || item.orderFrom === 3) &&
+                        (item.orderStatus === 1 ||
+                          item.orderStatus === 2 ||
+                          item.orderStatus === 3) &&
+                        (items.goodsType == '1' ||
+                          items.goodsType == '2' ||
+                          items.goodsType == '6') &&
+                        items.goodsPrice > 0
                     "
                   >
                     申请退款
@@ -91,8 +91,8 @@
                 v-if="
                   (item.orderStatus === 0 &&
                     (item.orderFrom === 2 || item.orderFrom === 3)) ||
-                  ((item.orderStatus === -1 || item.orderStatus === -2) &&
-                    (item.orderFrom === 2 || item.orderFrom === 3))
+                    ((item.orderStatus === -1 || item.orderStatus === -2) &&
+                      (item.orderFrom === 2 || item.orderFrom === 3))
                 "
               >
                 <div class="btns">
@@ -101,7 +101,7 @@
                     class="btn"
                     v-if="
                       item.orderStatus === 0 &&
-                      (item.orderFrom === 2 || item.orderFrom === 3)
+                        (item.orderFrom === 2 || item.orderFrom === 3)
                     "
                     @click="pay(item)"
                   >
@@ -111,7 +111,7 @@
                     class="btn btn--nobg"
                     v-if="
                       item.orderStatus === 0 &&
-                      (item.orderFrom === 2 || item.orderFrom === 3)
+                        (item.orderFrom === 2 || item.orderFrom === 3)
                     "
                     @click="cancelOrder(item)"
                   >
@@ -121,7 +121,7 @@
                     class="btn btn--nobg"
                     v-if="
                       (item.orderStatus === -1 || item.orderStatus === -2) &&
-                      (item.orderFrom === 2 || item.orderFrom === 3)
+                        (item.orderFrom === 2 || item.orderFrom === 3)
                     "
                     @click="delOrder(item)"
                   >
@@ -189,7 +189,7 @@ export default {
       formData: {
         status: "0,1",
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 10
       },
       total: 0,
       loading: null,
@@ -197,29 +197,29 @@ export default {
         {
           label: "待支付",
           count: 0,
-          name: "1",
+          name: "1"
         },
         {
           label: "已支付",
           count: 0,
-          name: "2",
+          name: "2"
         },
         {
           label: "已取消",
           count: 0,
-          name: "3",
+          name: "3"
         },
         {
           label: "已退款",
           count: 0,
-          name: "4",
-        },
-      ],
+          name: "4"
+        }
+      ]
     };
   },
   computed: {
-    periodStatusName: function () {
-      return function (val) {
+    periodStatusName: function() {
+      return function(val) {
         // ("审批状态 0 待审核 1初审通过 2复审通过待退款  -1初审不通过 -2复审不通过 3已退款")
         var status = "";
         switch (val) {
@@ -246,7 +246,7 @@ export default {
         }
         return status;
       };
-    },
+    }
   },
   mounted() {
     if (this.$route.query.state) {
@@ -262,9 +262,9 @@ export default {
           status: "0,1",
           pageNum: 1,
           pageSize: 1,
-          orderStatus: "0",
+          orderStatus: "0"
         })
-        .then((res) => {
+        .then(res => {
           this.list[0].count = res.total;
         });
 
@@ -273,9 +273,9 @@ export default {
           status: "0,1",
           pageNum: 1,
           pageSize: 1,
-          orderStatus: "1,2,3,4",
+          orderStatus: "1,2,3,4"
         })
-        .then((res) => {
+        .then(res => {
           this.list[1].count = res.total;
         });
 
@@ -284,18 +284,18 @@ export default {
           status: "0,1",
           pageNum: 1,
           pageSize: 1,
-          orderStatus: "-1,-2",
+          orderStatus: "-1,-2"
         })
-        .then((res) => {
+        .then(res => {
           this.list[2].count = res.total;
         });
 
       this.$request
         .orderRefundList({
           pageNum: 1,
-          pageSize: 1,
+          pageSize: 1
         })
-        .then((res) => {
+        .then(res => {
           this.list[3].count = res.total;
         })
         .catch(this.hideLoading);
@@ -340,42 +340,46 @@ export default {
         name: "支付",
         params: {
           total: item.payPrice,
-          orderSn: item.orderSn,
-        },
+          orderSn: item.orderSn
+        }
       });
     },
 
     refund(orderSn, goodsId) {
-      this.$confirm("确定要退款吗?", "提示", {
-        confirmButtonText: "确认",
+
+      this.$prompt("确定要退款吗?", "提示", {
+        confirmButtonText: "确定",
         cancelButtonText: "取消",
-        closeOnClickModal: false,
-        closeOnPressEscape: false,
-        distinguishCancelAndClose: false,
-        showClose: false,
+        inputErrorMessage: "请输入退款原因"
       })
-        .then((_) => {
+        .then(({ value }) => {
           this.showLoading();
           this.$request
-            .refundSmallOrder({ orderSn: orderSn, goodsId: goodsId })
-            .then((res) => {
+            .refundSmallOrder({
+              orderSn: orderSn,
+              goodsId: goodsId,
+              applyReason: value
+            })
+            .then(res => {
               this.hideLoading();
               this.$message({
                 type: "success",
-                message: "退款成功",
+                message: "申请退款成功"
               });
               this.getOrderNum();
               this.getOrderList();
             })
-            .catch((err) => {
+            .catch(err => {
               this.hideLoading();
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             });
         })
-        .catch((err) => {});
+        .catch(() => {
+          
+        });
     },
 
     delOrder(item) {
@@ -385,30 +389,30 @@ export default {
         closeOnClickModal: false,
         closeOnPressEscape: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       })
-        .then((_) => {
+        .then(_ => {
           this.showLoading();
           this.$request
             .eddOrder({ orderId: item.orderId, status: -1 })
-            .then((res) => {
+            .then(res => {
               this.$message({
                 type: "success",
-                message: "订单删除成功",
+                message: "订单删除成功"
               });
               this.hideLoading();
               this.getOrderNum();
               this.getOrderList();
             })
-            .catch((err) => {
+            .catch(err => {
               this.hideLoading();
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             });
         })
-        .catch((err) => {
+        .catch(err => {
           this.hideLoading();
         });
     },
@@ -418,7 +422,7 @@ export default {
       this.formData.orderStatus = "";
       this.$request
         .orderRefundList(this.formData)
-        .then((res) => {
+        .then(res => {
           this.hideLoading();
           this.orderList = res.rows;
           this.total = res.total;
@@ -436,30 +440,30 @@ export default {
         closeOnClickModal: false,
         closeOnPressEscape: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       })
-        .then((_) => {
+        .then(_ => {
           this.showLoading();
           this.$request
             .eddOrder({ orderId: item.orderId, orderStatus: -1 })
-            .then((res) => {
+            .then(res => {
               this.hideLoading();
               this.getOrderNum();
               this.$message({
                 type: "success",
-                message: "订单取消成功",
+                message: "订单取消成功"
               });
               this.getOrderList();
             })
-            .catch((err) => {
+            .catch(err => {
               this.hideLoading();
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             });
         })
-        .catch((_) => {});
+        .catch(_ => {});
     },
 
     showLoading(obj) {
@@ -468,7 +472,7 @@ export default {
         text: (obj && obj.text) || "loading",
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0)",
-        target: document.querySelector(".my-order__body"),
+        target: document.querySelector(".my-order__body")
       });
     },
 
@@ -490,14 +494,14 @@ export default {
       }
       this.$request
         .getorderlists(this.formData)
-        .then((res) => {
+        .then(res => {
           this.orderList = res.rows;
           this.total = res.total;
           this.hideLoading();
         })
         .catch(this.hideLoading);
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 13 - 0
src/router/index.js

@@ -643,6 +643,19 @@ Router.prototype.push = function push(location) {
 }
 
 router.beforeEach(async (to, from, next) => {
+  if (!store.state.TENANT_NANE) {
+    await store.dispatch('findTenantId')
+  }
+  if (!store.state.footer.length) {
+    store.dispatch("getCommonBaseHomeList");
+  }
+  if (!store.state.isDesktop) {
+    request.getWeAppLink().then(res => {
+      console.log("isDesktop")
+      res.msg && (window.location.href = res.msg);
+    });
+  }
+  console.log(5)
   if (to.meta.content) {
     let head = document.getElementsByTagName('head');
     let meta = document.createElement('meta');

+ 24 - 0
src/store/index.js

@@ -5,12 +5,14 @@ import order from '@/apis/order'
 import user from '@/apis/user'
 import common from '@/apis/common'
 import tools from '@/common/tools'
+import axios from 'axios'
 
 Vue.use(Vuex);
 
 export default new Vuex.Store({
   //所有的数据都放在state中
   state: {
+    TENANT_NANE: "",
     msgCount: 0,
     cartCount: 0,
     applyData: {}, //预约考试数据存放
@@ -50,6 +52,9 @@ export default new Vuex.Store({
 
   //操作数据,唯一的通道是mutations
   mutations: {
+    setTENANT_NANE(state, id) {
+      state.TENANT_NANE = id
+    },
     setBusinessList(state, list) {
       state.businessList = list
     },
@@ -106,6 +111,25 @@ export default new Vuex.Store({
 
   //actions,可以来做异步操作,然后提交给mutations,而后再对state(数据)进行操作
   actions: {
+    findTenantId({
+      commit
+    }) {
+      return new Promise(resolve => {
+        var urlReg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;  
+        var urls=urlReg.exec(location.origin); 
+        if (location.origin.includes("192.168.1") || location.origin.includes("120.79.166.78")) {
+          urls = "web.xyyxt.net"
+        }
+        axios.get(process.env.BASE_URL + '/app/common/findTenantId?hostPc=' + urls)
+          .then(function (response) {
+            commit('setTENANT_NANE', response.data.data)
+            resolve()
+          })
+          .catch(function (error) {
+            console.log("TenantIDerror:", error);
+          });
+      })
+    },
     /**
      * 设置系统时间
      */

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików