소스 검색

重新打包

lex-xin 5 년 전
부모
커밋
dda0d437b0
3개의 변경된 파일122개의 추가작업 그리고 109개의 파일을 삭제
  1. 1 1
      src/api/app.js
  2. 92 7
      src/views/app/CourseDetail.vue
  3. 29 101
      src/views/app/PaymentResult.vue

+ 1 - 1
src/api/app.js

@@ -94,7 +94,7 @@ const getStuAndTeaReview = (data) => {
 // 批量添加评价
 const batchAdd = (data) => {
   return axios({
-      url: api + 'courseReview/batchAdd',
+      url: api + '/courseReview/batchAdd',
       method: 'post',
       data: data
   })

+ 92 - 7
src/views/app/CourseDetail.vue

@@ -48,9 +48,26 @@
                 <van-switch v-model="checked" slot="right-icon" size="24" />
             </van-cell>
 
-            <van-panel title="评论给所有学生">
-                <div slot="default" class="content">盼望着,盼望着,东风来了,春天的脚步近了。一切都像刚睡醒的样子,欣欣然张开了眼。山朗润起来了,水涨起来</div>
+            <van-panel title="评论给所有学生" class="evaluation-panel" v-if="checked">
+                <div slot="default">
+                    <van-field rows="3" v-model="contentall" autosize type="textarea" placeholder="请输入1-255字" />
+                </div>
             </van-panel>
+
+            <div v-else>
+                <van-panel class="evaluation-panel" v-for="(item, index) in students" :key="index">
+                    <div slot="header" class="van-hairline--bottom" style="display: flex; padding-left: .16rem">
+                        <div class="header">
+                            <img v-if="item.avatar" :src="item.avatar" alt="">
+                            <img v-else src="../../assets/images/app/icon_student.png" alt="">
+                            {{ item.username }}
+                        </div>
+                    </div>
+                    <div slot="default">
+                        <van-field rows="3" v-model="item.content" autosize type="textarea" placeholder="请输入1-255字" />
+                    </div>
+                </van-panel>
+            </div>
         </div>
 
         <div class="button-group">
@@ -61,6 +78,7 @@
 <script>
 import MHeader from '@/components/MHeader'
 import { getStuAndTeaReview, batchAdd } from '@/api/app'
+import { browser }  from '@/common/common'
 export default {
     name: 'courseEvaluation',
     components: { MHeader },
@@ -68,14 +86,15 @@ export default {
         let query = this.$route.query
         return {
             checked: true,
-            rate: 2,
             courseId: query.courseId,
             teachingMaterial: null,
             teacherClassHeadInfo: {},
-            courseScheduleReview: [],
-            courseScheduleComplaints: [],
+            courseScheduleReview: [], // 学生评价
+            courseScheduleComplaints: [], // 老师评价
             courseScheduleReviewList: {},
-            review4StudentIds: {}
+            review4StudentIds: {},
+            students: [], // 学生列表
+            contentall: null, // 回复内容
         }
     },
     mounted() {
@@ -97,6 +116,10 @@ export default {
                         this.courseScheduleComplaints = tempResult.courseScheduleComplaints ? tempResult.courseScheduleComplaints : []
                         this.courseScheduleReviewList = tempResult.courseScheduleReviewList ? tempResult.courseScheduleReviewList : {}
                         this.review4StudentIds = tempResult.review4StudentIds ? tempResult.review4StudentIds : {}
+                        this.students = tempResult.students ? tempResult.students : []
+                        tempResult.students.forEach(item => {
+                            item.content = null
+                        })
                     }
                 } else {
                     this.$toast(result.msg)
@@ -104,8 +127,57 @@ export default {
             })
         },
         onSubmit() {
-
+            let students = this.students
+            let params = []
+            if(!this.teachingMaterial) {
+                this.$toast('请输入教学内容')
+                return
+            }
+            if(!this.contentall && this.checked) {
+                this.$toast('请输入学生评价')
+                return
+            }
+            students.forEach(item => {
+                if(!this.checked && !item.content) {
+                    this.$toast('请输入学生评价')
+                    return
+                }
+                params.push({
+                    "memo": this.checked ? this.contentall : item.content,
+                    "courseScheduleId": this.courseId,
+                    "studentId": item.id,
+                    "teachingMaterial": this.teachingMaterial
+                })
+            })
+            this.$toast.loading({
+                duration: 0,
+                message: '加载中...',
+                forbidClick: true,
+                loadingType: 'spinner'
+            })
+            batchAdd(params).then(res => {
+                this.$toast.clear()
+                let result = res.data
+                if(result.code == 200) {
+                    this.$toast('评价成功')
+                    setTimeout(() => {
+                        this.onSubmitStatus = true
+                        if(browser().iPhone) {
+                            window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else if(browser().android) {
+                            DAYA.postMessage(JSON.stringify({api: 'back'}))
+                        } else {
+                            this.$router.push('/business')
+                        }
+                    }, 500)
+                } else {
+                    this.$toast(result.msg)
+                }
+            })
         }
+    },
+    destroyed() {
+        this.$toast.clear()
     }
 }
 </script>
@@ -210,11 +282,24 @@ export default {
     }
 }
 
+.evaluation-panel {
+    padding: 0;
+    margin-top: .15rem;
+    margin-bottom: 0;
+    /deep/.van-cell {
+        padding: .1rem .16rem; 
+    }
+}
+
 .button-group {
     margin: .3rem .26rem .2rem;
     .van-button--primary {
         background: @mColor;
         font-size: .18rem;
     }
+    /deep/.van-field__control {
+        font-size: .15rem;
+        color: #999;
+    }
 }
 </style>

+ 29 - 101
src/views/app/PaymentResult.vue

@@ -142,112 +142,40 @@ export default {
     },
     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" })
-          );
-        }
+      let courseApply = localStorage.getItem('courseApply')
+      if(courseApply) {
+        window.location.replace(
+        window.location.href.toString().replace(window.location.hash, "") +
+          "#" + "/courseApply" );
+        this.$router.push("/courseApply");
       } 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
-            }
-          });
-        }
+        window.location.replace(
+        window.location.href.toString().replace(window.location.hash, "") +
+          "#" + "/PeriodExchange" );
+        this.$router.push("/PeriodExchange");
       }
+      
+
+      // if (browser().android) {
+      //     DAYA.postMessage(JSON.stringify({ api: "back" }));
+      // } else if (browser().iPhone) {
+      //     window.webkit.messageHandlers.DAYA.postMessage(
+      //       JSON.stringify({ api: "back" })
+      //     );
+      // }
     },
     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" })
-          );
-        }
+      let courseApply = localStorage.getItem('courseApply')
+      if(courseApply) {
+        window.location.replace(
+        window.location.href.toString().replace(window.location.hash, "") +
+          "#" + "/courseApply" );
+        this.$router.push("/courseApply");
       } 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
-            }
-          });
-        }
+        window.location.replace(
+        window.location.href.toString().replace(window.location.hash, "") +
+          "#" + "/PeriodExchange" );
+        this.$router.push("/PeriodExchange");
       }
     },
     CountDown() {