lex-xin 5 роки тому
батько
коміт
fec76f1742

+ 22 - 1
src/api/app.js

@@ -82,6 +82,25 @@ const queryUserInfo = (data) => {
   })
 }
 
+// 获取老师评价和学生评价
+const getStuAndTeaReview = (data) => {
+  return axios({
+      url: api + '/courseReview/getStuAndTeaReview',
+      method: 'get',
+      params: data
+  })
+}
+
+// 批量添加评价
+const batchAdd = (data) => {
+  return axios({
+      url: api + 'courseReview/batchAdd',
+      method: 'post',
+      data: data
+  })
+}
+
+
 export {
     createCourseGroup,
     sysTenantAccountGet,
@@ -91,5 +110,7 @@ export {
     teacherCourseMinutes,
     tenantEntryActivitesList,
     queryUserInfo,
-    createOrder
+    createOrder,
+    getStuAndTeaReview,
+    batchAdd
 }

BIN
src/assets/images/pay_ing.png


+ 72 - 64
src/router/appRouter.js

@@ -1,66 +1,74 @@
 let teacherRouter = [{
-    path: "/courseApply",
-    name: "courseApply",
-    component: () =>
-      import( /* webpackChunkName:'CourseApply'*/ "@/views/app/CourseApply.vue"),
-    meta: {
-      descrition: "课程创建",
-      weight: 1 // 页面权重
-    }
-  }, {
-    path: "/account",
-    name: "account",
-    component: () =>
-      import( /* webpackChunkName:'Account'*/ "@/views/app/Account.vue"),
-    meta: {
-      descrition: "我的账户",
-      weight: 1 // 页面权重
-    }
-  }, {
-    path: "/periodRecord",
-    name: "periodRecord",
-    component: () =>
-      import( /* webpackChunkName:'PeriodRecord'*/ "@/views/app/PeriodRecord.vue"),
-    meta: {
-      descrition: "课时使用记录",
-      weight: 2 // 页面权重
-    }
-  }, {
-    path: "/exchangeRecord",
-    name: "exchangeRecord",
-    component: () =>
-      import( /* webpackChunkName:'ExchangeRecord'*/ "@/views/app/ExchangeRecord.vue"),
-    meta: {
-      descrition: "兑换记录",
-      weight: 2 // 页面权重
-    }
-  }, {
-    path: "/periodExchange",
-    name: "periodExchange",
-    component: () =>
-      import( /* webpackChunkName:'PeriodExchange'*/ "@/views/app/PeriodExchange.vue"),
-    meta: {
-      descrition: "课时兑换",
-      weight: 2 // 页面权重
-    }
-  }, {
-    path: "/helpCenter",
-    name: "helpCenter",
-    component: () =>
-      import( /* webpackChunkName:'HelpCenter'*/ "@/views/app/HelpCenter.vue"),
-    meta: {
-      descrition: "帮助中心",
-      weight: 2 // 页面权重
-    }
-  }, {
-    path: "/courseEvaluation",
-    name: "courseEvaluation",
-    component: () =>
-      import( /* webpackChunkName:'CourseEvaluation'*/ "@/views/app/CourseEvaluation.vue"),
-    meta: {
-      descrition: "课程评价",
-      weight: 2 // 页面权重
-    }
-  }, 
-];
+  path: "/courseApply",
+  name: "courseApply",
+  component: () =>
+    import( /* webpackChunkName:'CourseApply'*/ "@/views/app/CourseApply.vue"),
+  meta: {
+    descrition: "课程创建",
+    weight: 1 // 页面权重
+  }
+}, {
+  path: "/account",
+  name: "account",
+  component: () =>
+    import( /* webpackChunkName:'Account'*/ "@/views/app/Account.vue"),
+  meta: {
+    descrition: "我的账户",
+    weight: 1 // 页面权重
+  }
+}, {
+  path: "/periodRecord",
+  name: "periodRecord",
+  component: () =>
+    import( /* webpackChunkName:'PeriodRecord'*/ "@/views/app/PeriodRecord.vue"),
+  meta: {
+    descrition: "课时使用记录",
+    weight: 2 // 页面权重
+  }
+}, {
+  path: "/exchangeRecord",
+  name: "exchangeRecord",
+  component: () =>
+    import( /* webpackChunkName:'ExchangeRecord'*/ "@/views/app/ExchangeRecord.vue"),
+  meta: {
+    descrition: "兑换记录",
+    weight: 2 // 页面权重
+  }
+}, {
+  path: "/periodExchange",
+  name: "periodExchange",
+  component: () =>
+    import( /* webpackChunkName:'PeriodExchange'*/ "@/views/app/PeriodExchange.vue"),
+  meta: {
+    descrition: "课时兑换",
+    weight: 2 // 页面权重
+  }
+}, {
+  path: "/helpCenter",
+  name: "helpCenter",
+  component: () =>
+    import( /* webpackChunkName:'HelpCenter'*/ "@/views/app/HelpCenter.vue"),
+  meta: {
+    descrition: "帮助中心",
+    weight: 2 // 页面权重
+  }
+}, {
+  path: "/courseEvaluation",
+  name: "courseEvaluation",
+  component: () =>
+    import( /* webpackChunkName:'CourseEvaluation'*/ "@/views/app/CourseEvaluation.vue"),
+  meta: {
+    descrition: "课程评价",
+    weight: 2 // 页面权重
+  }
+}, {
+  path: "/paymentResult",
+  name: 'paymentResult',
+  component: () =>
+    import( /* webpackChunkName:'PaymentResult'*/ "@/views/app/PaymentResult.vue"),
+  meta: {
+    descrition: "支付结果",
+    weight: 2 // 页面权重
+  }
+}];
 export default teacherRouter;

+ 19 - 8
src/views/app/CourseApply.vue

@@ -100,6 +100,11 @@ export default {
     name: 'courseApply',
     components: { MHeader },
     data() {
+        // 获取有没有传参
+        let courseList = localStorage.getItem('courseApply')
+        courseList = courseList ? JSON.parse(courseList) : null
+        console.log(courseList)
+        localStorage.removeItem('courseApply')
         return {
             dataForm: { // 时间下拉框
                 status: false,
@@ -144,24 +149,23 @@ export default {
                     className: 'minutes'
                 }]
             },
-            form: {
+            form: courseList ? courseList.form : {
                 name: null,
                 subjectIdList: null,
                 studentNum: null,
                 singleClassMinutes: null,
                 courseCount: null,
-                courseStart: null,
-                giveTeachMode: null
+                courseStart: null
             },
-            formName: {
+            formName: courseList ? courseList.formName : {
                 subjectListName: null, // 声部名称
                 subjectListIndex: 0, // 声部名称
             },
-            scheduleList: [], // 课时安排
+            scheduleList: courseList ? courseList.scheduleList : [], // 课时安排
             timeTable: [], // 生成的课表
             onSubmitStatus: true, // 点击
-            consumePeriod: 0, // 消耗课时
-            consumePeriodText: '0小时',
+            consumePeriod: courseList ? courseList.consumePeriod : 0, // 消耗课时
+            consumePeriodText: courseList ? courseList.consumePeriodText : '0小时',
             usePeriod: 0, // 可用课时
             usePeriodText: '0分钟',
         }
@@ -256,7 +260,6 @@ export default {
             this.timeTable = []
             // 重新生成课表
             this.setTimeTable()
-
         },
         onClassTimerSelect(value) { // 每课时长设置
             // 判断两次选的时间是否一致
@@ -537,6 +540,14 @@ export default {
                     message: '剩余可用时间不足,是否充值?',
                     confirmButtonText: '去充值'
                 }).then(() => {
+                    let params = {
+                        form: form,
+                        scheduleList: this.scheduleList,
+                        formName: this.formName,
+                        consumePeriod: this.consumePeriod, // 消耗课时
+                        consumePeriodText: this.consumePeriodText,
+                    }
+                    localStorage.setItem('courseApply', JSON.stringify(params))
                     // 跳转充值页面
                     this.$router.push('/periodExchange')
                 }).catch(() => {

+ 19 - 1
src/views/app/CourseEvaluation.vue

@@ -56,17 +56,35 @@
 </template>
 <script>
 import MHeader from '@/components/MHeader'
+import { getStuAndTeaReview, batchAdd } from '@/api/app'
 export default {
     name: 'courseEvaluation',
     components: { MHeader },
     data () {
+        let query = this.$route.query
         return {
-            rate: 2
+            rate: 2,
+            courseId: query.courseId
         }
     },
     mounted() {
+        this.__init()
     },
     methods: {
+        __init() {
+            getStuAndTeaReview({ courseId: this.courseId}).then(res => {
+                console.log(res)
+                let result = res.data
+                if(result.code == 200) {
+
+                } else {
+                    this.$toast(result.msg)
+                }
+            })
+        },
+        onSubmit() {
+
+        }
     }
 }
 </script>

+ 376 - 0
src/views/app/PaymentResult.vue

@@ -0,0 +1,376 @@
+<template>
+  <div class="paymentresult">
+    <m-header v-if="headerStatus" :isBack="isBack" />
+    <div class="payon" v-if="pageStatus == 'on'">
+      <img src="@/assets/images/pay_success.png" alt />
+      <p>支付成功</p>
+      <van-button type="info" @click="onAppBack" round>返回</van-button>
+    </div>
+
+    <div class="payerror" v-if="pageStatus == 'error'">
+      <img src="@/assets/images/pay_error.png" alt />
+      <p>支付失败</p>
+      <van-button type="info" @click="onAppBack" round>返回</van-button>
+    </div>
+
+    <div class="paying" v-if="pageStatus == 'paying'">
+      <img src="@/assets/images/pay_ing.png" alt />
+      <p>订单处理中</p>
+      <van-button type="info" @click="onAppBack" round>返回</van-button>
+      <p class="countdown">到计时{{ smsText }}秒刷新</p>
+    </div>
+
+    <div class="paysuccess" v-if="pageStatus == 'success'">
+      <div class="status">
+        <img src="@/assets/images/pay_success.png" alt />
+        <p>支付成功</p>
+        <p class="money" v-if="groupType == 'PRACTICE'">¥{{ PRACTICEPRICE }}</p>
+        <p class="money" v-else>¥{{ orderInfo.actualAmount }}</p>
+      </div>
+      <div class="orderinfo">
+        <p>
+          <span>购买时间:</span>
+          {{ orderInfo.createTime }}
+        </p>
+        <p>
+          <span>订单号:</span>
+          {{ orderInfo.orderNo }}
+        </p>
+          <p>
+            <span>购买详情:</span>
+          </p>
+        <img class="icon_img" v-if="!ownershipType" src="@/assets/images/icon_cw.png" alt srcset />
+      </div>
+      <van-button type="info" @click="onRepay" round>返回</van-button>
+    </div>
+  </div>
+</template>
+
+<script>
+/* eslint-disable */
+import MHeader from "@/components/MHeader"
+import { browser } from "@/common/common"
+// import { stat } from 'fs'
+export default {
+  name: "paymentresult",
+  components: { MHeader },
+  data() {
+    let that = this;
+    return {
+      headerStatus: false,
+      isBack: that.$route.query.isBack == "off" ? false : true, // 是否显示返回按钮
+      pageStatus: null,
+      orderInfo: {}, // 订单基本信息
+      smsText: 60,
+      groupType: null, //订单类型
+    };
+  },
+  mounted() {
+    if (!browser().android && !browser().iPhone) {
+      this.headerStatus = true;
+    }
+    this.__init();
+  },
+  methods: {
+    __init() {
+      let params = this.$route.query;
+      // 支付成功
+      if (params.orderNo) {
+        // 是否有订单号
+        // checkOrderStatus({ orderNo: params.orderNo }).then(res => {
+        //   let result = res.data;
+        //   if (result.code == 200) {
+        //     let tempResult = result.data;
+        //     if (
+        //       tempResult.ownershipType &&
+        //       tempResult.ownershipType == "COOPERATION"
+        //     ) {
+        //       this.ownershipType = true;
+        //     }
+        //     this.orderInfo = tempResult.order;
+        //     this.groupType = tempResult.groupType;
+        //     if (tempResult.order.type) {
+        //       this.activeName = tempResult.order.type;
+        //     }
+        //     this.showStatus(tempResult.order.status, tempResult.groupType);
+        //     if (tempResult.groupType == "MUSIC") {
+        //       // 乐团课
+        //       this.parseClassList(tempResult.course, tempResult.goods);
+        //     } else if (tempResult.groupType == "VIP") {
+        //       // vip课
+        //       this.parseVipList(tempResult.detail);
+        //     } else if (tempResult.groupType == "SPORADIC") {
+        //       // 零星收费
+        //       this.parseSporadic(tempResult.detail);
+        //     } else if (tempResult.groupType == "PRACTICE") {
+        //       // 陪练课
+        //       this.queryOrderInfo();
+        //     }
+        //   } else {
+        //     // 订单处理中
+        //     this.pageStatus = "paying";
+        //     this.CountDown();
+        //   }
+        //   // this.pageStatus = 'success'
+        // });
+      } else {
+        if (params.type) {
+          this.pageStatus = params.type;
+        } else {
+          this.pageStatus = "paying";
+          this.CountDown();
+        }
+      }
+    },
+    getYMDToCn(date) {
+      if (typeof date == "string") {
+        date = date.replace(/-/gi, "/");
+      }
+      let tempDate = new Date(date);
+      return (
+        tempDate.getFullYear() +
+        "年" +
+        (tempDate.getMonth() + 1) +
+        "月" +
+        tempDate.getDate() +
+        "日"
+      );
+    },
+    splitStr(str) {
+      if (str) {
+        let s = str.split(":");
+        return s[0] + ":" + s[1];
+      } else {
+        return str;
+      }
+    },
+    
+    showStatus(status, type) {
+      if (status == "ING") {
+        this.pageStatus = "paying";
+        this.CountDown();
+      } else if (status == "SUCCESS") {
+        this.pageStatus = "success";
+      } else if (status == "FAILED") {
+        this.pageStatus = "error";
+      }
+    },
+    onAppBack() {
+      // app回调页面
+      if (browser().android) {
+        if (this.groupType == "PRACTICE") {
+          // 收费网管课
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          DAYA.postMessage(JSON.stringify({ api: "back" }));
+        }
+      } else if (browser().iPhone) {
+        if (this.groupType == "PRACTICE") {
+          // 收费网管课
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          window.webkit.messageHandlers.DAYA.postMessage(
+            JSON.stringify({ api: "back" })
+          );
+        }
+      } else {
+        // musicGroupId
+        if (this.$route.query.sporadic || this.groupType == "SPORADIC") {
+          this.$router.push({
+            path: "/SporadicLogin",
+            query: {
+              id: this.$route.query.sporadic || this.orderInfo.musicGroupId
+            }
+          });
+        } else if (this.groupType == "PRACTICE") {
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          this.$router.push({
+            path: "/login",
+            query: {
+              musicGroupId: this.$route.query.musicGroupId
+            }
+          });
+        }
+      }
+    },
+    onRepay() {
+      if (browser().android) {
+        if (this.groupType == "PRACTICE") {
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          DAYA.postMessage(JSON.stringify({ api: "back" }));
+        }
+      } else if (browser().iPhone) {
+        if (this.groupType == "PRACTICE") {
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          window.webkit.messageHandlers.DAYA.postMessage(
+            JSON.stringify({ api: "back" })
+          );
+        }
+      } else {
+        if (this.groupType == "SPORADIC") {
+          if (this.activeName == "LUCK") {
+            this.$router.push({
+              path: "/smallLogin/active"
+            });
+          } else {
+            this.$router.push({
+              path: "/SporadicLogin",
+              query: {
+                id: this.orderInfo.musicGroupId
+              }
+            });
+          }
+        } else if (this.groupType == "PRACTICE") {
+          window.location.replace(
+            window.location.href.toString().replace(window.location.hash, "") +
+              "#" +
+              "/auditionpay/1"
+          );
+          this.$router.push("/auditionpay/1");
+        } else {
+          this.$router.push({
+            path: "/login",
+            query: {
+              musicGroupId: this.$route.query.musicGroupId
+            }
+          });
+        }
+      }
+    },
+    CountDown() {
+      let s = 60;
+      this.smsText = s;
+      let timer = setInterval(() => {
+        if (s <= 0) {
+          window.location.reload();
+          clearInterval(timer);
+        } else {
+          s--;
+          this.smsText = s;
+        }
+      }, 1000);
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.paymentresult {
+  min-height: 100vh;
+}
+.payerror,
+.payon,
+.paying {
+  padding-top: 1rem;
+  img {
+    display: block;
+    margin: 0 auto;
+    width: 1.03rem;
+    height: 1.37rem;
+  }
+  p {
+    padding-top: 0.12rem;
+    font-size: 0.18rem;
+    color: #444444;
+    text-align: center;
+    margin-bottom: 1.5rem;
+    &.countdown {
+      font-size: 0.14rem;
+    }
+  }
+}
+.van-button {
+  width: 90%;
+  margin: 0 5% 0;
+  line-height: 0.48rem;
+  height: 0.5rem;
+  font-size: 0.18rem;
+}
+.paysuccess {
+  .status {
+    background-color: #fff;
+    text-align: center;
+    font-size: 0.16rem;
+    color: #444;
+    padding-bottom: 0.1rem;
+    margin-bottom: 0.1rem;
+    img {
+      margin-top: 0.1rem;
+      width: 0.58rem;
+      height: 0.71rem;
+    }
+    .money {
+      font-size: 0.14rem;
+      color: #f97215;
+    }
+  }
+  .classdetail {
+    background: #fff;
+    margin-bottom: 0.25rem;
+    font-size: 0.14rem;
+    color: #444;
+    padding: 0.15rem;
+    h3 {
+      font-size: 0.14rem;
+      color: #444444;
+    }
+    .detailList {
+      display: flex;
+      flex-wrap: wrap;
+      p {
+        width: 40%;
+      }
+      span {
+        padding-right: 0.08rem;
+      }
+    }
+  }
+  .orderinfo {
+    position: relative;
+    // margin-bottom: 0.25rem;
+    margin-bottom: 0.1rem;
+    padding: 0.15rem 0.15rem 0.48rem;
+    background-color: #fff;
+    font-size: 0.14rem;
+    color: #777777;
+    span {
+      color: #444444;
+    }
+    .icon_img {
+      width: 1.2rem;
+      height: 1.1rem;
+      position: absolute;
+      bottom: 0.3rem;
+      right: 0.2rem;
+    }
+  }
+}
+</style>

+ 1 - 1
src/views/app/PeriodExchange.vue

@@ -178,7 +178,7 @@ export default {
     z-index: 99;
     .active {
         margin-bottom: .15rem;
-        box-shadow:0px 0px 16px 0px rgba(155,145,41,0.19);
+        // box-shadow:0px 0px 16px 0px rgba(155,145,41,0.19);
     }
     img {
         width: 100%;