Browse Source

我的课程

chenxiong 3 năm trước cách đây
mục cha
commit
8df4a55b37

+ 46 - 0
src/apis/apply.js

@@ -0,0 +1,46 @@
+import request from '@/axios'
+export default {
+  //点击预约报考按钮
+  getApplysubscribe(data) {
+    return request({
+      url: '/apply/subscribe',
+      method: 'get',
+      params: data
+    })
+  },
+
+  //预约报考下一步按钮 1 进入有考陪有考试地点得预约考试 2进入无考陪有考试地点预约考试 3无考试次数购买商品
+  getApplysubscribeNext(data) {
+    return request({
+      url: '/apply/subscribeNext',
+      method: 'get',
+      params: data
+    })
+  },
+
+  //获得考试的考试地点
+	getApplysubscribeApplySite(data) {
+		return request({
+			url: '/apply/subscribeApplySite',
+			method: 'get',
+			params: data
+		})
+	},
+  //获得考试的考培地点
+	getApplysubscribeApplySiteTrain(data) {
+		return request({
+			url: '/apply/subscribeApplySiteTrain',
+			method: 'get',
+			params: data
+		})
+	},
+
+  //新增用户预约考试
+	addApply(data) {
+		return request({
+			url: '/apply',
+			method: 'post',
+			data: data
+		})
+	},
+}

+ 41 - 0
src/apis/order.js

@@ -0,0 +1,41 @@
+import request from '@/axios'
+export default {
+  //查询订单列表
+	getorderlists(data) {
+		return request({
+			url: '/order/list',
+			method: 'get',
+			params: data
+		})
+	},
+
+  /**
+	 * @param {Object} data
+	 * 查询订单商品退款列表
+	 */
+	orderRefundList(data) {
+		return request({
+			url: '/order/refund/list',
+			method: 'get',
+			params: data
+		})
+	},
+
+  
+	refundSmallOrder(data) {
+		return request({
+			url: '/order/refund',
+			method: 'post',
+			data: data
+		})
+	},
+
+  eddOrder(data) {
+		return request({
+			url: '/order/edit',
+			method: 'post',
+			data: data
+		})
+	},
+  
+}

+ 38 - 0
src/apis/user.js

@@ -114,5 +114,43 @@ export default {
 			data: data
 		})
 	},
+
+  getApplysubscribe(data) {
+		return request({
+			url: '/apply/subscribe',
+			method: 'get',
+			params: data
+		})
+	},
+
+  courseperiodrebuild(data) {
+		return request({
+			url: '/course/period/rebuild',
+			method: 'post',
+			data: data
+		})
+	},
+
+  
+	//查询用户拥有商品的学时记录
+	getcourseperiodlistGoods(data) {
+		return request({
+			url: '/course/period/listGoods',
+			method: 'get',
+			params: data
+		})
+	},
+
+  /**
+	 * @param {Object} data
+	 * 查询用户证书列表
+	 */
+	getUserCertificateList(data) {
+		return request({
+			url: '/user/certificate/list',
+			method: 'get',
+			params: data
+		})
+	},
   
 }

+ 17 - 3
src/pages/person-center/index.vue

@@ -4,10 +4,20 @@
     <section class="section">
       <div class="container">
         <div class="section__header">
-          <img src="@/assets/qrcode.png" class="img" alt="" />
+          <img
+            :src="
+              userInfo
+                ? userInfo.avatar
+                  ? $tools.splitImgHost(userInfo.avatar, true)
+                  : '@/assets/qrcode.png'
+                : ''
+            "
+            class="img"
+            alt=""
+          />
           <div class="text">
-            <div class="title">倪虹洁</div>
-            <div class="desc">倪虹洁</div>
+            <div class="title">{{ userInfo && userInfo.realname }}</div>
+            <div class="desc">你好</div>
           </div>
         </div>
 
@@ -78,6 +88,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import { mapGetters } from "vuex";
 export default {
   name: "PersonCenter",
   components: {
@@ -88,6 +99,9 @@ export default {
   data() {
     return {};
   },
+  computed: {
+    ...mapGetters(["userInfo"]),
+  },
   mounted() {},
   methods: {},
 };

+ 423 - 0
src/pages/person-center/my-classhour/appointment-add-kp/index.vue

@@ -0,0 +1,423 @@
+<template>
+  <div class="appointment-add">
+    <div class="appointment-add__header">
+      <el-breadcrumb separator="/">
+        <el-breadcrumb-item
+          v-for="(item, index) in $route.matched"
+          :key="index"
+          :to="{ path: item.path }"
+          >{{ item.name }}</el-breadcrumb-item
+        >
+      </el-breadcrumb>
+    </div>
+    <div class="appointment-add__body">
+      <el-form
+        class="appointment-content"
+        ref="form"
+        :model="form"
+        label-width="100px"
+      >
+        <div class="appointment-content__body">
+          <el-descriptions
+            title="这是一个考试标题这是一个考试标题"
+          ></el-descriptions>
+          <el-form-item label="考试地点:">
+            <el-select
+              v-model="addressId"
+              placeholder="请选择"
+              @change="addressChange"
+            >
+              <el-option
+                :label="item.siteAddress"
+                :value="item.id"
+                v-for="(item, index) in listData"
+                :key="index"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="考试时间:">
+            <el-select v-model="timeIndex" placeholder="请选择">
+              <el-option
+                :label="
+                  item.dataTime + ' ' + item.startTime + ' ~ ' + item.endTime
+                "
+                :value="index"
+                v-for="(item, index) in activeList"
+                :key="index"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </div>
+
+        <div class="appointment-content__footer">
+          <div class="btns">
+            <div class="cancel" @click="cancel">上一步</div>
+            <div class="ok" @click="sureOppoint">确定预约</div>
+          </div>
+        </div>
+      </el-form>
+    </div>
+
+    <el-dialog
+      width="400px"
+      class="appointment-modal"
+      :visible.sync="showDetailModal"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+    >
+      <div class="appointment-modal__content">
+        <div class="appointment-modal__close" @click="showDetailModal = false">
+          X
+        </div>
+        <div class="appointment-modal__header">提示</div>
+        <div class="appointment-modal__body">
+          <div class="content">
+            <div class="content__body">
+              <div class="icon-text">
+                <div class="icon">✔</div>
+                <div class="text">考试预约成功</div>
+              </div>
+              <div class="confirm">查看预约</div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+export default {
+  name: "Myappointment",
+  data() {
+    return {
+      form: {},
+      showDetailModal: false,
+      addressId: "", //当前选中考试点ID
+      timeIndex: "", //当前选中考试点ID
+      listData: [], //考试地点数据
+      activeList: [], //选中考试地点列表
+      applyId: "",
+      goodsId: "",
+      applyStatus: "",
+      dataId: "",
+      orderGoodsId: "",
+      addressName: "",
+      applyDs: {},
+    };
+  },
+  computed: {
+    ...mapGetters(["getApplyData"]),
+  },
+  mounted() {
+    this.applyId = this.$route.query.applyId;
+    this.goodsId = this.$route.query.goodsId;
+    this.applyStatus = this.$route.query.applyStatus;
+    this.dataId = this.$route.query.dataId;
+    this.orderGoodsId = this.$route.query.orderGoodsId;
+    this.applyDs = this.getApplyData;
+    this.getApplysubscribeApplySiteTrain();
+  },
+  methods: {
+    cancel() {
+      this.$router.go(-1);
+    },
+
+    addressChange() {
+      var self = this;
+      const index = this.listData.findIndex(
+        (item) => item.id == this.addressId
+      );
+      if (index === -1) {
+        // uni.showToast({
+        // 	title: '请选择考前培训地点',
+        // 	icon: 'none'
+        // });
+        // return;
+      }
+
+      this.addressName = this.listData[index].siteAddress;
+      this.addressId = this.listData[index].id;
+      var arrays = [];
+      this.listData[index].examUserApplySiteTime.forEach((item) => {
+        if (item.examTime < self.applyDs.applySiteExamTime) {
+          item.examApplySiteTimeTwoVo.forEach((items) => {
+            arrays.push({
+              examTime: item.examTime,
+              startTimeC: items.startTime,
+              endTimeC: items.endTime,
+              dataTime: self.$tools
+                .timestampToTime(item.examTime)
+                .replace(/-/g, "/"),
+              startTime: items.startTime,
+              endTime: items.endTime,
+              num: items.num,
+              registration: items.registration,
+              checked: false,
+              status:
+                items.status === 1
+                  ? items.status
+                  : items.registration >= items.num
+                  ? 2
+                  : items.status,
+            });
+          });
+        }
+      });
+      this.activeList = arrays.filter((item, index) => {
+        const newTime = parseInt(new Date().getTime() / 1000);
+        const liTime = parseInt(
+          new Date(item.dataTime + "" + item.startTime + ":00").getTime() / 1000
+        );
+        if (liTime > newTime) {
+          return item;
+        }
+      });
+
+      console.log(this.activeList);
+    },
+
+    //获取考培地点
+    getApplysubscribeApplySiteTrain() {
+      this.$request
+        .getApplysubscribeApplySiteTrain({ applyId: this.applyId })
+        .then((res) => {
+          res.data.forEach((item, index) => {
+            item.checked = false;
+          });
+          this.listData = res.data;
+        });
+    },
+
+    sureOppoint() {
+      var self = this;
+      if (self.addressId) {
+        if (this.timeIndex !== "") {
+          var copyData = JSON.parse(JSON.stringify(self.activeList));
+          const index = copyData.findIndex(
+            (item, index) => index == this.timeIndex
+          );
+          var data = {
+            orderGoodsId: self.orderGoodsId,
+            applySiteAddressTrain: self.addressName,
+            applySiteExamTrainTime: copyData[index].examTime,
+            applySiteStartTrainTime: copyData[index].startTimeC,
+            applySiteEndTrainTime: copyData[index].endTimeC,
+          };
+          let newObj = {};
+          Object.assign(newObj, data, self.applyDs);
+          self.$request
+            .addApply(newObj)
+            .then((res) => {
+              this.showDetailModal = true;
+            })
+            .catch((err) => {
+              this.$message({
+                type: "warning",
+                message: err.msg,
+              });
+            });
+        } else {
+          var data = JSON.parse(JSON.stringify(self.applyDs));
+          self.$request
+            .addApply(data)
+            .then((res) => {
+              this.showDetailModal = true;
+            })
+            .catch((err) => {
+              this.$message({
+                type: "warning",
+                message: err.msg,
+              });
+            });
+        }
+      } else {
+        var data = JSON.parse(JSON.stringify(self.applyDs));
+        self.$request.addApply(data).then((res) => {
+          this.showDetailModal = true;
+        });
+      }
+    },
+  },
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="scss">
+.appointment-add {
+  overflow: hidden;
+  &__header {
+    border-bottom: 1px solid #eee;
+    margin-top: 24px;
+    padding-bottom: 20px;
+  }
+  &__body {
+    .appointment-content {
+      &__header {
+        margin-top: 20px;
+        width: 1110px;
+        padding: 10px 12px;
+        background: #fafbfc;
+        border: 1px solid #eeeeee;
+        box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.04);
+        border-radius: 8px;
+
+        .select {
+          width: 1000px;
+        }
+
+        .total {
+          margin-top: 10px;
+          margin-left: 80px;
+          font-size: 14px;
+
+          .note {
+            color: #ff3b30;
+          }
+        }
+      }
+
+      &__body {
+        margin-top: 20px;
+        width: 1110px;
+        padding: 10px 12px;
+        background: #fafbfc;
+        border: 1px solid #eeeeee;
+        box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.04);
+        border-radius: 8px;
+      }
+
+      &__footer {
+        margin-top: 20px;
+        padding-bottom: 40px;
+
+        .appointment-price {
+          border-top: 1px solid #eee;
+          border-bottom: 1px solid #eee;
+          line-height: 50px;
+          font-size: 18px;
+          font-family: Microsoft YaHei;
+          font-weight: 400;
+          color: #333333;
+          .note {
+            font-size: 18px;
+            color: #ff3b30;
+            font-weight: bold;
+            margin-left: 10px;
+          }
+        }
+
+        .btns {
+          margin-top: 20px;
+          .cancel {
+            display: inline-block;
+            margin: 0 10px;
+            cursor: pointer;
+            width: 122px;
+            height: 32px;
+            background: #ffffff;
+            border: 1px solid #3f8dfd;
+            border-radius: 16px;
+            text-align: center;
+            font-size: 16px;
+            line-height: 30px;
+            color: #3f8dfd;
+          }
+
+          .ok {
+            display: inline-block;
+            margin: 0 10px;
+            cursor: pointer;
+            width: 122px;
+            height: 32px;
+            background: #3f8dfd;
+            border-radius: 16px;
+            color: #fff;
+            text-align: center;
+            line-height: 32px;
+            font-size: 16px;
+          }
+        }
+      }
+    }
+  }
+
+  .appointment-modal {
+    /deep/ .el-dialog__header {
+      display: none;
+    }
+    /deep/ .el-dialog__body {
+      padding: 0;
+      overflow: unset;
+    }
+
+    &__close {
+      cursor: pointer;
+      position: absolute;
+      right: 0;
+      top: 0;
+      width: 24px;
+      height: 24px;
+      line-height: 24px;
+      text-align: center;
+      color: #999999;
+    }
+
+    &__header {
+      height: 40px;
+      line-height: 40px;
+      font-size: 16px;
+      font-family: Microsoft YaHei;
+      font-weight: bold;
+      color: #333333;
+      padding-left: 24px;
+    }
+
+    &__body {
+      height: 200px;
+      padding: 0 24px;
+
+      .content {
+        &__body {
+          .icon-text {
+            .icon {
+              margin: 0 auto;
+              border-radius: 50%;
+              width: 64px;
+              height: 64px;
+              background: #34c759;
+              text-align: center;
+              line-height: 64px;
+              font-size: 50px;
+              color: #fff;
+              font-weight: bold;
+            }
+
+            .text {
+              font-size: 14px;
+              font-family: Microsoft YaHei;
+              font-weight: bold;
+              color: #666666;
+              text-align: center;
+              margin-top: 15px;
+            }
+          }
+          .confirm {
+            margin: 35px auto 0;
+            cursor: pointer;
+            width: 96px;
+            height: 40px;
+            background: #3f8dfd;
+            border-radius: 4px;
+            text-align: center;
+            line-height: 40px;
+            color: #fff;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 157 - 11
src/pages/person-center/my-classhour/appointment-add/index.vue

@@ -22,15 +22,29 @@
             title="这是一个考试标题这是一个考试标题"
           ></el-descriptions>
           <el-form-item label="考试地点:">
-            <el-select v-model="form.region" placeholder="请选择">
-              <el-option label="区域一" value="shanghai"></el-option>
-              <el-option label="区域二" value="beijing"></el-option>
+            <el-select
+              v-model="addressId"
+              placeholder="请选择"
+              @change="addressChange"
+            >
+              <el-option
+                :label="item.siteAddress"
+                :value="item.id"
+                v-for="(item, index) in listData"
+                :key="index"
+              ></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="考试时间:">
-            <el-select v-model="form.region" placeholder="请选择">
-              <el-option label="区域一" value="shanghai"></el-option>
-              <el-option label="区域二" value="beijing"></el-option>
+            <el-select v-model="timeIndex" placeholder="请选择">
+              <el-option
+                :label="
+                  item.dataTime + ' ' + item.startTime + ' ~ ' + item.endTime
+                "
+                :value="index"
+                v-for="(item, index) in activeList"
+                :key="index"
+              ></el-option>
             </el-select>
           </el-form-item>
         </div>
@@ -38,7 +52,9 @@
         <div class="appointment-content__footer">
           <div class="btns">
             <div class="cancel" @click="cancel">上一步</div>
-            <div class="ok" @click="showDetailModal = true">确定预约</div>
+            <div class="ok" @click="sureOppoint">
+              {{ dataId == 1 ? "下一步" : dataId == 2 ? "确定预约" : "异常" }}
+            </div>
           </div>
         </div>
       </el-form>
@@ -74,22 +90,152 @@
 </template>
 
 <script>
+import { mapMutations } from "vuex";
 export default {
   name: "Myappointment",
   data() {
     return {
       form: {},
       showDetailModal: false,
-      value1: [],
-      radio1: "",
-      radio2: "",
+      addressId: "", //当前选中考试点ID
+      timeIndex: "", //当前选中考试点ID
+      listData: [], //考试地点数据
+      activeList: [], //选中考试地点列表
+      applyId: "",
+      goodsId: "",
+      applyStatus: "",
+      dataId: "",
+      orderGoodsId: "",
+      addressName: "",
     };
   },
-  mounted() {},
+  mounted() {
+    this.applyId = this.$route.query.applyId;
+    this.goodsId = this.$route.query.goodsId;
+    this.applyStatus = this.$route.query.applyStatus;
+    this.dataId = this.$route.query.dataId;
+    this.orderGoodsId = this.$route.query.orderGoodsId;
+
+    this.getApplysubscribeApplySite();
+  },
   methods: {
+    ...mapMutations(["updateApplyData"]),
     cancel() {
       this.$router.go(-1);
     },
+
+    addressChange() {
+      var arrays = [];
+      var self = this;
+      const index = this.listData.findIndex(
+        (item) => item.id == this.addressId
+      );
+      this.addressName = this.listData[index].siteAddress;
+      this.listData[index].examUserApplySiteTime.forEach((item) => {
+        item.examApplySiteTimeTwoVo.forEach((items) => {
+          arrays.push({
+            examTime: item.examTime,
+            startTimeC: items.startTime,
+            endTimeC: items.endTime,
+            dataTime: self.$tools
+              .timestampToTime(item.examTime)
+              .replace(/-/g, "/"),
+            startTime: items.startTime,
+            endTime: items.endTime,
+            num: items.num,
+            registration: items.registration,
+            checked: false,
+            status:
+              items.status === 1
+                ? items.status
+                : items.registration >= items.num
+                ? 2
+                : items.status,
+          });
+        });
+      });
+      this.timeIndex = "";
+      this.activeList = arrays.filter((item, index) => {
+        console.log(item);
+        const newTime = parseInt(new Date().getTime() / 1000);
+        console.log(
+          item.dataTime.replace(/-/g, "/") + "" + item.startTime + ":00"
+        );
+        const liTime = parseInt(
+          new Date(
+            item.dataTime.replace(/-/g, "/") + "" + item.startTime + ":00"
+          ).getTime() / 1000
+        );
+        console.log(liTime, "liTime");
+        console.log(newTime, "newTime");
+        if (liTime > newTime) {
+          return item;
+        }
+      });
+
+      console.log(this.activeList);
+    },
+
+    //获取考试地点
+    getApplysubscribeApplySite() {
+      this.$request
+        .getApplysubscribeApplySite({ applyId: this.applyId })
+        .then((res) => {
+          res.data.forEach((item, index) => {
+            item.checked = false;
+          });
+          this.listData = res.data;
+        });
+    },
+
+    sureOppoint() {
+      var self = this;
+      if (self.addressId) {
+        if (this.timeIndex !== "") {
+          var copyData = JSON.parse(JSON.stringify(self.activeList));
+          const index = copyData.findIndex(
+            (item, index) => this.timeIndex == index
+          );
+          var data = {
+            applyId: self.applyId,
+            goodsId: self.goodsId,
+            studentType: self.applyStatus,
+            applySiteAddress: self.addressName,
+            applySiteExamTime: copyData[index].examTime,
+            applySiteStartTime: copyData[index].startTimeC,
+            applySiteEndTime: copyData[index].endTimeC,
+            orderGoodsId: self.orderGoodsId,
+          };
+          if (self.dataId == 1) {
+            this.updateApplyData(data);
+            this.$router.push({
+              path: "/person-center/my-classhour/appointment-add-kp",
+              query: {
+                applyId: self.applyId,
+                applyStatus: self.applyStatus,
+                goodsId: self.goodsId,
+                orderGoodsId: self.orderGoodsId,
+              },
+            });
+          }
+          if (self.dataId == 2) {
+            self.$request.addApply(data).then((res) => {
+              this.showDetailModal = true;
+            });
+          }
+        } else {
+          this.$message({
+            type: "warning",
+            message: "请选择考试时间",
+          });
+        }
+      } else {
+        this.$message({
+          type: "warning",
+          message: "请选择考试地点",
+        });
+      }
+    },
   },
 };
 </script>

+ 107 - 31
src/pages/person-center/my-classhour/appointment/index.vue

@@ -18,27 +18,32 @@
         label-width="100px"
       >
         <div class="invoice-content__header">
-          <el-descriptions title="这是一个考试标题这是一个考试标题" :column="1">
+          <el-descriptions :title="listData.applyName" :column="1">
             <el-descriptions-item label="报名时间"
-              >2021-12-21</el-descriptions-item
-            >
-            <el-descriptions-item label="温馨提示"
-              >预约开放期登录CCMS,进入主页,显示预核准的已报科目考试,点击预约考试科目,按流程选择考试考点、具体考试时间,提交完成。</el-descriptions-item
-            >
-            <el-descriptions-item label="报考专业" :span="2"
-              >这是专业名称</el-descriptions-item
-            >
-            <el-descriptions-item label="姓名"> 倪虹洁 </el-descriptions-item>
-            <el-descriptions-item label="身份证"
-              >4404635468723685698</el-descriptions-item
+              >{{ $tools.timestampToTime(listData.applyStartTime) }} ~
+              {{
+                $tools.timestampToTime(listData.applyEndTime)
+              }}</el-descriptions-item
             >
+            <el-descriptions-item label="温馨提示">{{
+              listData.applyIntroduce || ""
+            }}</el-descriptions-item>
+            <el-descriptions-item label="报考专业" :span="2">{{
+              listData.major || ""
+            }}</el-descriptions-item>
+            <el-descriptions-item label="姓名">
+              {{ listData.realname }}
+            </el-descriptions-item>
+            <el-descriptions-item label="身份证">{{
+              listData.idCard
+            }}</el-descriptions-item>
           </el-descriptions>
         </div>
 
         <div class="invoice-content__body">
           <el-form-item label="学员类型:">
-            <el-radio v-model="radio1" label="1">非补考学员</el-radio>
-            <el-radio v-model="radio1" label="2">补考学员</el-radio>
+            <el-radio v-model="radio" label="1">非补考学员</el-radio>
+            <el-radio v-model="radio" label="2">补考学员</el-radio>
           </el-form-item>
         </div>
 
@@ -59,31 +64,102 @@ export default {
   data() {
     return {
       form: {},
-      radio1: "",
+      radio: "",
+      goodsId: 0,
+      gradeId: 0,
+      orderGoodsId: 0,
+      listData: [],
+      goodsIdBK: null,
     };
   },
-  mounted() {},
+  mounted() {
+    this.goodsId = this.$route.query.goodsId;
+    this.gradeId = this.$route.query.gradeId;
+    this.orderGoodsId = this.$route.query.orderGoodsId;
+    this.getApplysubscribe();
+  },
   methods: {
+    getApplysubscribe() {
+      var data = {
+        goodsId: this.goodsId,
+        gradeId: this.gradeId,
+      };
+      this.$request.getApplysubscribe(data).then((res) => {
+        if (res.data.applyStatus) {
+          res.data.applyStatus = res.data.applyStatus.split(",");
+        }
+        this.listData = res.data;
+      });
+    },
     cancel() {
       this.$router.go(-1);
     },
     next() {
-      this.$confirm(
-        "您所报考的【设备安装施工员】专业,考试次数已经用完。需要预约考试的补考学员,请先购买补考机会。",
-        "提示",
-        {
-          confirmButtonText: "缴费",
-          cancelButtonText: "知道了",
-        }
-      )
-        .then((_) => {
-          this.$router.push({
-            path: "/payment-success",
-          });
+      if (!this.radio) {
+        this.$message({
+          type: "warning",
+          message: "请选择您的考试身份",
+        });
+        return;
+      }
+      let data = {
+        applyId: this.listData.applyId,
+        applyStatus: this.radio,
+        goodsId: this.goodsId,
+        gradeId: this.gradeId,
+      };
+      this.$request
+        .getApplysubscribeNext(data)
+        .then((res) => {
+          if (res.data === 1 || res.data === 2) {
+            this.$router.push({
+              path: "/person-center/my-classhour/appointment-add",
+              query: {
+                applyId: this.listData.applyId,
+                applyStatus: this.radio,
+                goodsId: this.goodsId,
+                dataId: res.data,
+                orderGoodsId: this.orderGoodsId,
+              },
+            });
+          }
+          if (res.data === 3) {
+            this.$request
+              .goodsList({ makeGoodsId: this.goodsId, goodsType: 3 })
+              .then((res) => {
+                if (res.rows.length) {
+                  this.goodsIdBK = res.rows[0].goodsId;
+                }
+
+                this.$confirm(
+                  "您所报考的" +
+                    this.listData.major +
+                    "专业,考试次数已经用完。需要预约考试的补考学员,请先购买补考机会。",
+                  "提示",
+                  {
+                    confirmButtonText: "缴费",
+                    cancelButtonText: "知道了",
+                  }
+                )
+                  .then((_) => {
+                    if (!this.goodsIdBK) {
+                      uni.showModal({
+                        showCancel: false,
+                        content: "请联系管理员配置补考商品",
+                      });
+                    }
+                    // this.$router.push({
+                    //   path: "/payment-success",
+                    // });
+                  })
+                  .catch((_) => {});
+              });
+          }
         })
-        .catch((_) => {
-          this.$router.push({
-            path: "/person-center/my-classhour/appointment-add",
+        .catch((err) => {
+          this.$message({
+            type: "warning",
+            message: err.msg,
           });
         });
     },

+ 337 - 42
src/pages/person-center/my-classhour/index/index.vue

@@ -1,58 +1,152 @@
 <template>
   <div class="my-classhour">
     <div class="my-classhour__body">
-      <el-tabs v-model="activeName">
-        <el-tab-pane label="学时审核" name="1">
+      <el-tabs :value="activeName" @tab-click="tabChange">
+        <el-tab-pane label="学时审核" name="1"></el-tab-pane>
+        <el-tab-pane label="学习凭证" name="2"></el-tab-pane>
+      </el-tabs>
+
+      <template v-if="activeName == '1'">
+        <div class="no-data" v-if="listData.length == 0">
+          您暂无相关学时审核记录哦
+        </div>
+
+        <template v-else>
           <div class="learn-list">
-            <div class="classhour-item" v-for="(item, index) in 5" :key="index">
+            <div
+              class="classhour-item"
+              v-for="(item, index) in listData"
+              :key="index"
+            >
               <div class="classhour-item__header">
                 <div class="state">
                   学时审核状态:
-                  <div class="note">不可审核</div>
+                  <div class="note" v-if="item.periodStatus === -1">
+                    不可审核
+                  </div>
+                  <div
+                    class="note note--success"
+                    v-if="item.periodStatus === 1"
+                  >
+                    机构审核通过
+                  </div>
+                  <div class="note note--wait" v-if="item.periodStatus === 2">
+                    等待审核
+                  </div>
+                  <div class="note note--wait" v-if="item.periodStatus === 3">
+                    审核中
+                  </div>
+                  <div class="note" v-if="item.periodStatus === 0">
+                    机构审核不通过
+                  </div>
                 </div>
               </div>
-              <div class="classhour-item__body">
-                <div class="img"></div>
+              <div class="classhour-item__body clearfix">
+                <!-- <div class="img"></div> -->
                 <div class="text">
-                  <div class="title">二级建造师建设工程施工管理</div>
-                  <div class="desc">您的学时还未修完,请尽快完成课程学习</div>
+                  <div class="title">{{ item.goodsName }}</div>
+                  <div class="desc desc--black" v-if="item.periodStatus === 1">
+                    机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
+                  </div>
+                  <div class="desc" v-if="item.periodStatus === -1">
+                    您的学时还未修完,请尽快完成课程学习
+                  </div>
+                  <div class="desc" v-if="item.periodStatus === 2">
+                    学习完成后7-15个工作日完成学时审核。
+                  </div>
+                  <div class="desc" v-if="item.periodStatus === 0">
+                    请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。
+                  </div>
+                  <div class="desc" v-if="item.periodStatus === 3">
+                    会在7-15个工作日左右完成学时审核
+                  </div>
                 </div>
                 <div class="btns-wrap">
-                  <div class="btns">
-                    <div class="btn">课程学习</div>
-                    <div class="btn" @click="appointment">预约考试</div>
-                    <div class="btn" @click="showDetailModal = true">
+                  <div class="btns" v-if="item.periodStatus !== 2">
+                    <div
+                      class="btn"
+                      v-if="item.periodStatus === -1"
+                      @click="goCourseDetail(item)"
+                    >
+                      课程学习
+                    </div>
+                    <div
+                      class="btn"
+                      v-if="item.periodStatus === 1 && item.applyStatus === 1"
+                      @click="appointment(item)"
+                    >
+                      预约考试
+                    </div>
+                    <div
+                      class="btn"
+                      v-if="item.periodStatus === 0 && item.rebuildStatus === 0"
+                      @click="getcourseperiodcheat(item)"
+                    >
                       查看详情
                     </div>
+                    <div
+                      class="btn"
+                      v-if="item.periodStatus === 0 && item.rebuildStatus === 1"
+                      @click="goCourseDetail(item)"
+                    >
+                      重修目录
+                    </div>
                   </div>
                 </div>
               </div>
             </div>
           </div>
-        </el-tab-pane>
-        <el-tab-pane label="学习凭证" name="2">
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChange"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :pager-count="5"
+            >
+            </el-pagination>
+          </div>
+        </template>
+      </template>
+
+      <template v-if="activeName == '2'">
+        <div class="no-data" v-if="listData.length == 0">
+          您暂无相关学习凭证记录哦
+        </div>
+
+        <template v-else>
           <div class="certificate-list">
             <div
               class="certificate-item"
-              v-for="(item, index) in 6"
+              v-for="(item, index) in listData"
               :key="index"
             >
               <div class="certificate-item__header">
                 <div class="title">证书名称:</div>
-                <div class="desc">一级建造师</div>
+                <div class="desc">{{ item.title }}</div>
               </div>
               <div class="certificate-item__body">
-                <div class="title">生成时间:</div>
-                <div class="desc">2022-12-31 00:00:00</div>
+                <div class="title">证书编号</div>
+                <div class="desc">{{ item.certificateCode }}</div>
               </div>
               <div class="certificate-item__footer">
-                <div class="btn">查看</div>
-                <div class="btn">下载</div>
+                <div class="btn" @click="preview(item)">查看</div>
+                <div class="btn" @click="download(item)">下载</div>
               </div>
             </div>
           </div>
-        </el-tab-pane>
-      </el-tabs>
+          <div class="pagination">
+            <el-pagination
+              @current-change="currentChange"
+              background
+              layout="prev, pager, next"
+              :total="total"
+              :pager-count="5"
+            >
+            </el-pagination>
+          </div>
+        </template>
+      </template>
     </div>
 
     <el-dialog
@@ -77,20 +171,37 @@
 
             <div class="content__body">
               <div class="list">
-                <div class="list__item">
+                <div
+                  class="list__item"
+                  v-for="(item, index) in rebuildItems"
+                  :key="index"
+                >
                   <div class="title">
-                    <span class="note">录播</span>
-                    1、这是一个节的标题
+                    <span class="note" v-if="item.type == 0"> 测试 </span>
+                    <span class="note note--yellow" v-if="item.type == 1"
+                      >录播</span
+                    >
+                    <span class="note note--yellow" v-if="item.type == 2"
+                      >直播</span
+                    >
+                    <span class="note note--yellow" v-if="item.type == 3"
+                      >回放</span
+                    >
+                    {{ index + 1 }}、{{ item.name }}
                   </div>
                   <div class="desc">
-                    原因:
-                    <span class="note">拍照异常/时间异常</span>
-                  </div>
-                </div>
-                <div class="list__item">
-                  <div class="title">
-                    <span class="note note--yellow">直播</span>
-                    1、这是一个节的标题
+                    <div class="imgs">
+                      <div
+                        class="img"
+                        v-for="(items, indexs) in item.userStudyRecordPhoto"
+                        :key="indexs"
+                      >
+                        <img :src="$tools.splitImgHost(items.photo)" />
+                        <div class="note">
+                          {{ $tools.timestampToTime(items.createTime, false) }}
+                        </div>
+                      </div>
+                    </div>
                   </div>
                   <div class="desc">
                     原因:
@@ -102,7 +213,9 @@
           </div>
         </div>
         <div class="rebuild__footer">
-          <div class="confirm">确认重学</div>
+          <el-button class="confirm" @click="rebuildSubmit" type="primary"
+            >确认重学</el-button
+          >
         </div>
       </div>
     </el-dialog>
@@ -114,17 +227,156 @@ export default {
   name: "MyClasshour",
   data() {
     return {
-      showDetailModal: true,
+      showDetailModal: false,
       activeName: "1",
+      listData: [],
+      rebuildItems: [],
+      rebuildItem: {},
+      param: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 0,
     };
   },
-  mounted() {},
+  mounted() {
+    this.getcourseperiodlistGoods();
+  },
   methods: {
-    appointment() {
+    goCourseDetail(item) {
       this.$router.push({
-        path: "/person-center/my-classhour/appointment",
+        path: `/my-course-detail/${item.goodsId}`,
+        query: {
+          gradeId: item.gradeId,
+          orderGoodsId: item.orderGoodsId,
+        },
       });
     },
+    tabChange(e) {
+      console.log(e.name);
+      if (this.activeName == e.name) {
+        return;
+      }
+
+      this.activeName = e.name;
+      this.param.pageNum = 1;
+
+      if (this.activeName == "1") {
+        this.getcourseperiodlistGoods();
+      } else {
+        this.getUserCertificateList();
+      }
+    },
+    currentChange(e) {
+      this.param.pageNum = e;
+
+      if (this.activeName == "1") {
+        this.getcourseperiodlistGoods();
+      } else {
+        this.getUserCertificateList();
+      }
+    },
+    appointment(item) {
+      var data = {
+        goodsId: item.goodsId,
+        gradeId: item.gradeId,
+      };
+      this.$request
+        .getApplysubscribe(data)
+        .then((res) => {
+          this.$router.push({
+            path: "/person-center/my-classhour/appointment",
+            query: {
+              goodsId: item.goodsId,
+              gradeId: item.gradeId,
+              orderGoodsId: item.orderGoodsId,
+            },
+          });
+        })
+        .catch((err) => {
+          this.$message({
+            type: "success",
+            message: err.msg,
+          });
+        });
+    },
+
+    rebuildSubmit() {
+      this.$confirm(
+        "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
+        "注意",
+        {
+          confirmButtonText: "确认重学",
+          cancelButtonText: "取消",
+          closeOnClickModal: false,
+          closeOnPressEscape: false,
+          distinguishCancelAndClose: false,
+          showClose: false,
+        }
+      )
+        .then((_) => {
+          this.$request
+            .courseperiodrebuild({
+              goodsId: this.rebuildItem.goodsId,
+              gradeId: this.rebuildItem.gradeId,
+            })
+            .then((res) => {
+              this.showRebuildDetailModal = false;
+              this.$router.push({
+                path: `/my-course-detail/${this.rebuildItem.goodsId}`,
+                query: {
+                  gradeId: this.rebuildItem.gradeId,
+                  orderGoodsId: this.rebuildItem.orderGoodsId,
+                },
+              });
+            });
+        })
+        .catch((_) => {});
+    },
+    getcourseperiodlistGoods() {
+      this.$request
+        .getcourseperiodlistGoods(this.param)
+        .then((res) => {
+          this.listData = [...res.rows];
+          this.total = res.total;
+        })
+        .catch((err) => {});
+    },
+
+    getUserCertificateList() {
+      this.$request
+        .getUserCertificateList(this.param)
+        .then((res) => {
+          this.listData = [...res.rows];
+          this.total = res.total;
+        })
+        .catch((err) => {});
+    },
+
+    getcourseperiodcheat(item) {
+      this.rebuildItem = item;
+      this.$request
+        .getcourseperiodcheat({
+          goodsId: item.goodsId,
+          gradeId: item.gradeId,
+        })
+        .then((res) => {
+          this.rebuildItems = res.rows;
+        });
+      this.showDetailModal = true;
+    },
+
+    preview(item) {
+      let url = this.$tools.splitImgHost(item.certificatePath, true);
+    },
+    download(item) {
+      var url = this.$tools.splitImgHost(item.certificatePath, true);
+      var a = document.createElement("a");
+      var event = new MouseEvent("click");
+      a.download = "img";
+      a.href = url;
+      a.dispatchEvent(event);
+    },
   },
 };
 </script>
@@ -160,7 +412,7 @@ export default {
             .note {
               vertical-align: middle;
               display: inline-block;
-              width: 66px;
+              padding: 0 20px;
               height: 24px;
               background: #ffeceb;
               border: 1px solid #ff3b30;
@@ -171,6 +423,18 @@ export default {
               color: #ff3b30;
               text-align: center;
               line-height: 24px;
+
+              &--success {
+                color: #34c759;
+                border: 1px solid #34c759;
+                background: #e6feea;
+              }
+
+              &--wait {
+                color: #007aff;
+                border: 1px solid #007aff;
+                background: rgba(247, 250, 255, 1);
+              }
             }
           }
 
@@ -186,6 +450,7 @@ export default {
         }
 
         &__body {
+          padding-bottom: 20px;
           .img {
             float: left;
             width: 160px;
@@ -194,6 +459,7 @@ export default {
           }
 
           .text {
+            width: 700px;
             float: left;
             margin-left: 12px;
             .title {
@@ -221,7 +487,11 @@ export default {
               font-family: Microsoft YaHei;
               font-weight: 400;
               color: #ff3b30;
-              margin-top: 30px;
+              margin-top: 20px;
+
+              &--black {
+                color: #333;
+              }
             }
           }
 
@@ -342,6 +612,18 @@ export default {
         }
       }
     }
+
+    .no-data {
+      text-align: center;
+      padding: 50px 0;
+      color: #666;
+      font-size: 16px;
+    }
+
+    .pagination {
+      padding: 30px 0;
+      text-align: center;
+    }
   }
 
   .rebuild {
@@ -444,6 +726,19 @@ export default {
 
                 .note {
                   color: #ff3b30;
+                  line-height: 20px;
+                }
+
+                .img {
+                  width: 100px;
+                  height: 100px;
+                  display: inline-block;
+                  text-align: center;
+
+                  img {
+                    max-width: 100%;
+                    max-height: 100%;
+                  }
                 }
               }
             }
@@ -455,11 +750,11 @@ export default {
     &__footer {
       height: 90px;
       border-top: 1px solid #eee;
+      text-align: center;
       .confirm {
-        cursor: pointer;
         width: 200px;
         height: 40px;
-        background: #3f8dfd;
+        padding: 0;
         border-radius: 20px;
         text-align: center;
         line-height: 40px;

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

@@ -198,6 +198,28 @@
                   "
                   >进入学习</el-button
                 >
+
+                <el-button
+                  type="primary"
+                  class="btn"
+                  @click="appointment(item)"
+                  v-if="
+                    item.applyStatus === 1 &&
+                    !(
+                      (item.interfacePushId > 0 && item.officialStatus != 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)
+                    )
+                  "
+                  >预约考试</el-button
+                >
+
                 <div
                   class="btn btn--warm"
                   v-if="
@@ -364,12 +386,11 @@
                         :key="indexs"
                       >
                         <img :src="$tools.splitImgHost(items.photo)" />
+                        <div class="note">
+                          {{ $tools.timestampToTime(items.createTime, false) }}
+                        </div>
                       </div>
                     </div>
-
-                    <div class="note">
-                      {{ $tools.timestampToTime(items.createTime, false) }}
-                    </div>
                   </div>
                   <div class="desc">
                     原因:
@@ -533,7 +554,7 @@ export default {
             //有其他端在操作,不能学习
             uni.showToast({
               icon: "none",
-              title: res.data.msg,
+              title: res.msg,
               mask: true,
               duration: 3000,
             });
@@ -573,7 +594,7 @@ export default {
         }
       )
         .then((_) => {
-          this.$api
+          this.$request
             .courseperiodrebuild({
               goodsId: this.rebuildItem.goodsId,
               gradeId: this.rebuildItem.gradeId,
@@ -654,7 +675,7 @@ export default {
         .catch((err) => {
           this.$message({
             type: "success",
-            message: res.data.msg,
+            message: res.msg,
           });
         });
     },
@@ -670,7 +691,7 @@ export default {
             gradeId: gradeId,
           })
           .then((res) => {
-            resolve(res.data.data);
+            resolve(res.data);
           });
       });
     },
@@ -690,6 +711,31 @@ export default {
         );
       };
     },
+
+    appointment(item) {
+      var data = {
+        goodsId: item.goodsId,
+        gradeId: item.gradeId,
+      };
+      this.$request
+        .getApplysubscribe(data)
+        .then((res) => {
+          this.$router.push({
+            path: "/person-center/my-classhour/appointment",
+            query: {
+              goodsId: item.goodsId,
+              gradeId: item.gradeId,
+              orderGoodsId: item.orderGoodsId,
+            },
+          });
+        })
+        .catch((err) => {
+          this.$message({
+            type: "success",
+            message: err.msg,
+          });
+        });
+    },
   },
 };
 </script>
@@ -996,15 +1042,14 @@ export default {
 
                 .note {
                   color: #ff3b30;
+                  line-height: 20px;
                 }
 
                 .img {
                   width: 100px;
                   height: 100px;
-                  display: flex;
-                  align-items: center;
-                  justify-content: center;
                   display: inline-block;
+                  text-align: center;
 
                   img {
                     max-width: 100%;

+ 303 - 33
src/pages/person-center/my-order/index.vue

@@ -1,68 +1,139 @@
 <template>
   <div class="my-order">
     <div class="my-order__header">
-      <el-tabs v-model="activeName">
+      <el-tabs :value="activeName" @tab-click="tabChange">
         <el-tab-pane label="待支付" name="1"></el-tab-pane>
         <el-tab-pane label="已支付" name="2"></el-tab-pane>
-        <el-tab-pane label="已退款" name="3"></el-tab-pane>
-        <el-tab-pane label="已取消" name="4"></el-tab-pane>
+        <el-tab-pane label="已取消" name="3"></el-tab-pane>
+        <el-tab-pane label="已退款" name="4"></el-tab-pane>
       </el-tabs>
     </div>
 
     <div class="my-order__body">
-      <div class="list">
-        <div class="order-item" v-for="(item, index) in 5" :key="index">
+      <div class="list" v-if="orderList.length == 0">
+        <div class="no-data">您暂无相关订单哦~</div>
+      </div>
+      <div class="list" v-else>
+        <div class="order-item" v-for="(item, index) in orderList" :key="index">
           <div class="order-item__header">
             <div class="state">
               订单号:
-              <div class="note">12345678</div>
+              <div class="note">{{ item.orderSn }}</div>
+            </div>
+            <div class="time">
+              {{ $tools.timestampToTime(item.createTime) }}
             </div>
-            <div class="time">2022-12-1</div>
           </div>
           <div class="order-item__body clearfix">
-            <div class="order-item__body__goodslist">
-              <div
-                class="goods-item clearfix"
-                v-for="(item, itemIndex) in 2"
-                :key="itemIndex"
-              >
-                <div class="img"></div>
-                <div class="text">
-                  <div class="title">二级建造师建设工程施工管理</div>
-                  <div class="desc">
-                    应付金额:
-                    <span class="note">¥99.99</span>
+            <template v-if="activeName != '4'">
+              <div class="order-item__body__goodslist">
+                <div
+                  class="goods-item clearfix"
+                  v-for="(items, itemIndex) in item.orderGoodsList"
+                  :key="itemIndex"
+                >
+                  <div class="img">
+                    <img
+                      :src="$tools.splitImgHost(items.coverUrl, true)"
+                      alt=""
+                    />
+                  </div>
+                  <div class="text">
+                    <div class="title">{{ items.goodsName }}</div>
+                    <div class="desc">
+                      应付金额:
+                      <span class="note">¥{{ items.goodsRealPrice }}</span>
+                    </div>
+                  </div>
+
+                  <div
+                    class="btn btn--nobg"
+                    @click="refund(item.orderSn, items.goodsId)"
+                    v-if="
+                      items.refundStatus === 0 &&
+                      item.orderFrom === 2 &&
+                      (item.orderStatus === 1 ||
+                        item.orderStatus === 2 ||
+                        item.orderStatus === 3) &&
+                      (items.goodsType == '1' || items.goodsType == '2')
+                    "
+                  >
+                    申请退款
                   </div>
                 </div>
               </div>
-            </div>
-            <template v-if="index < 2">
               <div class="price-wrap">
                 <div class="btns">
                   <div class="price-text">应付金额</div>
-                  <div class="price-number">$99</div>
+                  <div class="price-number">${{ item.payPrice }}</div>
                 </div>
               </div>
               <div class="btns-wrap">
                 <div class="btns">
-                  <div class="btn">立即支付</div>
-                  <div class="btn btn--nobg">取消订单</div>
-                  <div class="btn btn--nobg">删除订单</div>
-                  <div class="btn btn--warm">开始学习</div>
-                  <div class="btn btn--nobg">申请退款</div>
+                  <el-button
+                    type="primary"
+                    class="btn"
+                    v-if="item.orderStatus === 0 && item.orderFrom === 2"
+                    @click="pay(item)"
+                  >
+                    立即支付
+                  </el-button>
+                  <div
+                    class="btn btn--nobg"
+                    v-if="item.orderStatus === 0"
+                    @click="cancelOrder(item)"
+                  >
+                    取消订单
+                  </div>
+                  <div
+                    class="btn btn--nobg"
+                    v-if="item.orderStatus === -1 || item.orderStatus === -2"
+                    @click="delOrder(item)"
+                  >
+                    删除订单
+                  </div>
+                  <!-- <div class="btn btn--warm">开始学习</div> -->
                 </div>
               </div>
             </template>
             <template v-else>
+              <div class="order-item__body__goodslist">
+                <div class="goods-item clearfix">
+                  <div class="img">
+                    <img
+                      :src="$tools.splitImgHost(item.coverUrl, true)"
+                      alt=""
+                    />
+                  </div>
+                  <div class="text">
+                    <div class="title">{{ item.goodsName }}</div>
+                    <div class="desc">
+                      <!-- 应付金额:
+                      <span class="note">¥99.99</span> -->
+                    </div>
+                  </div>
+                </div>
+              </div>
               <div class="refund-wrap">
                 <div class="btns">
                   <div class="price-text">已退款</div>
-                  <div class="price-number">$99</div>
+                  <div class="price-number">${{ item.refundFee }}</div>
                 </div>
               </div>
             </template>
           </div>
         </div>
+
+        <div class="pagination">
+          <el-pagination
+            @current-change="currentChange"
+            background
+            layout="prev, pager, next"
+            :total="total"
+            :pager-count="5"
+          >
+          </el-pagination>
+        </div>
       </div>
     </div>
   </div>
@@ -73,16 +144,173 @@ export default {
   name: "MyOrder",
   data() {
     return {
-      activeName: "1",
+      orderList: [],
+      activeName: "2",
+      formData: {
+        status: "0,1",
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 0,
     };
   },
-  mounted() {},
+  mounted() {
+    this.getOrderList();
+  },
   methods: {
-    pay() {
+    currentChange(e) {
+      this.formData.pageNum = e;
+
+      if (this.activeName == "4") {
+        //退款订单
+        this.formData.status = "";
+        this.orderRefundList();
+      } else {
+        //其他订单
+
+        this.formData.status = "0,1";
+        this.getOrderList();
+      }
+    },
+    tabChange(e) {
+      if (this.activeName == e.name) {
+        return;
+      }
+
+      this.formData.pageNum = 1;
+      this.activeName = e.name;
+      if (this.activeName == "4") {
+        //退款订单
+        this.formData.status = "";
+        this.orderRefundList();
+      } else {
+        //其他订单
+
+        this.formData.status = "0,1";
+        this.getOrderList();
+      }
+    },
+    pay(item) {
       this.$router.push({
         path: "payment-success",
       });
     },
+
+    refund(orderSn, goodsId) {
+      this.$confirm("确定要退款吗?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        closeOnClickModal: false,
+        closeOnPressEscape: false,
+        distinguishCancelAndClose: false,
+        showClose: false,
+      })
+        .then((_) => {
+          this.$request
+            .refundSmallOrder({ orderSn: orderSn, goodsId: goodsId })
+            .then((res) => {
+              this.$message({
+                type: "success",
+                message: "退款成功",
+              });
+              this.getOrderList();
+            })
+            .catch((err) => {
+              this.$message({
+                type: "warning",
+                message: "不可以退款哦",
+              });
+            });
+        })
+        .catch((err) => {});
+    },
+
+    delOrder(item) {
+      this.$confirm("确定要删除该订单吗?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        closeOnClickModal: false,
+        closeOnPressEscape: false,
+        distinguishCancelAndClose: false,
+        showClose: false,
+      })
+        .then((_) => {
+          this.$request
+            .eddOrder({ orderId: item.orderId, status: -1 })
+            .then((res) => {
+              this.$message({
+                type: "success",
+                message: "订单删除成功",
+              });
+              this.getOrderList();
+            })
+            .catch((err) => {
+              this.$message({
+                type: "warning",
+                message: err.msg,
+              });
+            });
+        })
+        .catch((err) => {});
+    },
+
+    orderRefundList() {
+      this.formData.pageNum = 1;
+      this.formData.orderStatus = "";
+      this.$request.orderRefundList(this.formData).then((res) => {
+        this.orderList = res.rows;
+        this.total = res.total;
+      });
+    },
+
+    /**
+     * 取消订单
+     */
+    cancelOrder(item) {
+      this.$confirm("确定要取消该订单吗?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        closeOnClickModal: false,
+        closeOnPressEscape: false,
+        distinguishCancelAndClose: false,
+        showClose: false,
+      })
+        .then((_) => {
+          this.$request
+            .eddOrder({ orderId: item.orderId, orderStatus: -1 })
+            .then((res) => {
+              this.$message({
+                type: "success",
+                message: "订单取消成功",
+              });
+              this.getOrderList();
+            })
+            .catch((err) => {
+              this.$message({
+                type: "warning",
+                message: err.msg,
+              });
+            });
+        })
+        .catch((_) => {});
+    },
+
+    //获取订单
+    getOrderList() {
+      if (this.activeName == "1") {
+        this.formData.orderStatus = "0";
+      }
+      if (this.activeName == "2") {
+        this.formData.orderStatus = "1,2,3";
+      }
+      if (this.activeName == "3") {
+        this.formData.orderStatus = "-1,-2,4";
+      }
+      this.$request.getorderlists(this.formData).then((res) => {
+        this.orderList = res.rows;
+        this.total = res.total;
+      });
+    },
   },
 };
 </script>
@@ -164,7 +392,14 @@ export default {
                 float: left;
                 width: 160px;
                 height: 90px;
-                background: #3f8dfd;
+                display: table-cell;
+
+                img {
+                  max-width: 100%;
+                  max-height: 100%;
+                  display: inline-block;
+                  vertical-align: middle;
+                }
               }
 
               .text {
@@ -187,6 +422,29 @@ export default {
                   }
                 }
               }
+
+              .btn {
+                float: right;
+                cursor: pointer;
+                margin: 30px 0 0 0;
+                width: 122px;
+                height: 32px;
+                font-size: 14px;
+                background: #3f8dfd;
+                border-radius: 16px;
+                text-align: center;
+                line-height: 32px;
+                color: #fff;
+
+                &--warm {
+                  background: #ff3b30;
+                }
+
+                &--nobg {
+                  background: none;
+                  color: #333;
+                }
+              }
             }
           }
 
@@ -276,7 +534,7 @@ export default {
                 width: 122px;
                 height: 32px;
                 font-size: 14px;
-                background: #3f8dfd;
+                padding: 0;
                 border-radius: 16px;
                 display: inline-block;
                 text-align: center;
@@ -297,6 +555,18 @@ export default {
         }
       }
     }
+
+    .no-data {
+      text-align: center;
+      padding: 50px 0;
+      color: #666;
+      font-size: 16px;
+    }
+
+    .pagination {
+      padding: 30px 0;
+      text-align: center;
+    }
   }
 }
 </style>

+ 5 - 1
src/request.js

@@ -6,6 +6,8 @@ import course from '@/apis/course' //课程模块
 import answer from '@/apis/answer' //答疑模块
 import note from '@/apis/note' //笔记模块
 import polvy from '@/apis/polvy' //保利威模块
+import order from '@/apis/order' //保利威模块
+import apply from '@/apis/apply' //考试模块
 
 
 
@@ -19,5 +21,7 @@ export default {
     ...course,
     ...answer,
     ...note,
-    ...polvy
+    ...polvy,
+    ...order,
+    ...apply
 }

+ 6 - 0
src/router/index.js

@@ -4,6 +4,7 @@ import store from '../store/index'
 Vue.use(Router)
 
 const router =  new Router({
+  mode:'history',
   routes: [
     {
       path: '*',
@@ -203,6 +204,11 @@ const router =  new Router({
               path: 'appointment-add',
               component: resolve => require(['@/pages/person-center/my-classhour/appointment-add/index'],resolve),
               name: '预约考试',
+            },
+            {
+              path: 'appointment-add-kp',
+              component: resolve => require(['@/pages/person-center/my-classhour/appointment-add-kp/index'],resolve),
+              name: '预约考试',
             }
           ]
         },

+ 5 - 0
src/store/index.js

@@ -8,6 +8,7 @@ Vue.use(Vuex);
 export default new Vuex.Store({
   //所有的数据都放在state中
   state: {
+    applyData: {}, //预约考试数据存放
     token: '',
     user_account: '',
     userInfo: null,
@@ -26,10 +27,14 @@ export default new Vuex.Store({
     header: state => state.header,
     footer: state => state.footer,
     links: state => state.links,
+    getApplyData: state => state.applyData,
   },
 
   //操作数据,唯一的通道是mutations
   mutations: {
+    updateApplyData(state, data) {
+      state.applyData = data;
+    },
     setUserInfo(state, data) {
       state.userInfo = data;
     },