lex 1 rok pred
rodič
commit
0cc36e1ca3

+ 91 - 63
src/views/liveClassManager/createLiveClass.vue

@@ -194,8 +194,8 @@
                 {
                   required: true,
                   validator: validStock,
-                  trigger: 'blur',
-                },
+                  trigger: 'blur'
+                }
               ]"
             >
               <el-input
@@ -203,7 +203,7 @@
                 placeholder="请输入课时数"
                 maxlength="2"
                 @input="
-                  (val) => {
+                  val => {
                     form.onlineClassesNum = val.replace(/[^\d]/g, '');
                   }
                 "
@@ -251,7 +251,7 @@
                 placeholder="请输入现单价"
                 maxlength="9"
                 @input="
-                  (val) => {
+                  val => {
                     form.onlineClassesUnitPrice = val.replace(/[^\d]/g, '');
                   }
                 "
@@ -270,7 +270,7 @@
                 placeholder="请输入原单价"
                 maxlength="9"
                 @input="
-                  (val) => {
+                  val => {
                     form.offlineClassesUnitPrice = val.replace(/[^\d]/g, '');
                   }
                 "
@@ -310,7 +310,9 @@
           :data="form.timeTable"
         >
           <el-table-column align="center" label="课时">
-            <template slot-scope="scope"> 第{{ scope.$index + 1 }}课 </template>
+            <template slot-scope="scope">
+              第{{ scope.$index + 1 }}课
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -404,8 +406,12 @@
             >
               <el-radio-group v-model="form.os" :disabled="isDisabled">
                 <!-- 根据不同的模式,显示不同的直播设备 -->
-                <el-radio v-if="serviceProvider === 'rongCloud'" label="pc">web</el-radio>
-                <el-radio v-if="serviceProvider === 'tencentCloud'" label="client"
+                <el-radio v-if="serviceProvider === 'rongCloud'" label="pc"
+                  >web</el-radio
+                >
+                <el-radio
+                  v-if="serviceProvider === 'tencentCloud'"
+                  label="client"
                   >乐直播</el-radio
                 >
                 <el-radio label="mobile">手机</el-radio>
@@ -470,7 +476,7 @@
                       class="dotWrap"
                       :class="[
                         form.preTemplate == 1 ? 'checked' : '',
-                        isDisabled ? 'disabled' : '',
+                        isDisabled ? 'disabled' : ''
                       ]"
                     ></i>
                   </div>
@@ -480,7 +486,7 @@
                       class="dotWrap"
                       :class="[
                         form.preTemplate == 2 ? 'checked' : '',
-                        isDisabled ? 'disabled' : '',
+                        isDisabled ? 'disabled' : ''
                       ]"
                     ></i>
                   </div>
@@ -490,7 +496,7 @@
                       class="dotWrap"
                       :class="[
                         form.preTemplate == 3 ? 'checked' : '',
-                        isDisabled ? 'disabled' : '',
+                        isDisabled ? 'disabled' : ''
                       ]"
                     ></i>
                   </div>
@@ -502,7 +508,10 @@
 
         <el-row>
           <el-col :span="24">
-            <el-button type="primary" @click="onReset" v-if="[0, 1].includes(status)"
+            <el-button
+              type="primary"
+              @click="onReset"
+              v-if="[0, 1].includes(status)"
               >重置</el-button
             >
             <el-button type="primary" @click="onSubmit">确定</el-button>
@@ -537,7 +546,7 @@ import {
   sysTenantConfigAll,
   findTeacherByTenantId,
   liveGroupDetail,
-  updateLiveGroup,
+  updateLiveGroup
 } from "./api";
 import { getSubject, getOrganRole } from "@/api/buildTeam";
 import { vipGroupCategory, createVip } from "@/api/vipSeting";
@@ -575,10 +584,10 @@ export default {
           whether_chat: 0,
           whether_video: 0,
           whether_mic: 0,
-          whether_view_shop_cart: 1,
+          whether_view_shop_cart: 1
         },
         timeTable: [], // 排课
-        clientType: "TEACHER", // 主讲人身份 默认[老师]
+        clientType: "TEACHER" // 主讲人身份 默认[老师]
       },
       status: 0, // 直播课状态
       auditStatus: null, // 审核状态
@@ -592,8 +601,8 @@ export default {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime();
-        },
-      },
+        }
+      }
     };
   },
   async mounted() {
@@ -605,7 +614,7 @@ export default {
       try {
         // 判断声部,如果为MUSIC_THEORY则为乐理,显示普通
         let subjectItem = {};
-        this.subjectList.forEach((item) => {
+        this.subjectList.forEach(item => {
           if (val == item.id) {
             subjectItem = item;
           }
@@ -619,8 +628,8 @@ export default {
         this.form.teacher = ""; // 重置指导老师
         // 根据科目id获取相应的老师
         await findTeacherByTenantId({
-          subjectIds: subjectItem.code == "MUSIC_THEORY" ? null : val,
-        }).then((res) => {
+          subjectIds: subjectItem.code == "MUSIC_THEORY" ? null : val
+        }).then(res => {
           this.teacherList = res.data;
         });
       } catch {}
@@ -643,7 +652,7 @@ export default {
       this.form.preTemplate = index;
     },
     async onSubmit() {
-      this.$refs.liveForm.validate(async (flag) => {
+      this.$refs.liveForm.validate(async flag => {
         if (!flag) {
           this.onScrollError();
           return false;
@@ -656,7 +665,7 @@ export default {
             return;
           }
           const timeTable = [];
-          form.timeTable.forEach((item) => {
+          form.timeTable.forEach(item => {
             timeTable.push({
               classDate: item.classDate,
               actualTeacherId: form.teacher,
@@ -665,7 +674,7 @@ export default {
               teachMode: item.teachMode,
               id: item.id,
               teachingContent: item.teachingContent,
-              teachingPoint: item.teachingPoint,
+              teachingPoint: item.teachingPoint
             });
           });
 
@@ -681,7 +690,9 @@ export default {
               onlineClassesNum: form.onlineClassesNum || 0,
               offlineClassesUnitPrice: form.offlineClassesUnitPrice || 0,
               onlineClassesUnitPrice: form.onlineClassesUnitPrice || 0,
-              registrationStartTime: dayjs(form.signUpStart).format("YYYY-MM-DD"),
+              registrationStartTime: dayjs(form.signUpStart).format(
+                "YYYY-MM-DD"
+              ),
               paymentExpireDate: dayjs(form.signUpEnd).format("YYYY-MM-DD"),
               singleClassMinutes: form.singleClassMinutes,
               userId: form.teacher,
@@ -693,7 +704,7 @@ export default {
               subjectIdList: form.subjectIdList,
               educationalTeacherId: form.educationalTeacherId,
               organId: -1,
-              organIdList: form.organIds.join(","),
+              organIdList: form.organIds.join(",")
             },
             liveBroadcastRoom: {
               speakerId: form.teacher,
@@ -709,9 +720,9 @@ export default {
               roomConfig: {
                 ...form.roomConfig,
                 subjectId: form.subjectIdList,
-                groupType: "LIVE",
-              },
-            },
+                groupType: "LIVE"
+              }
+            }
           };
           console.log(obj, "obj");
           if (this.type === "update") {
@@ -723,19 +734,19 @@ export default {
             this.$router.push({
               path: "/liveClassManager",
               query: {
-                tabrouter: 2,
-              },
+                tabrouter: 2
+              }
             });
           } else {
-            createVip(obj).then((res) => {
+            createVip(obj).then(res => {
               if (res.code == 200) {
                 this.$message.success("创建成功");
                 this.$store.dispatch("delVisitedViews", this.$route);
                 this.$router.push({
                   path: "/liveClassManager",
                   query: {
-                    tabrouter: 2,
-                  },
+                    tabrouter: 2
+                  }
                 });
               }
             });
@@ -753,7 +764,7 @@ export default {
         let isError = document.getElementsByClassName("el-alert");
         isError[0].scrollIntoView({
           block: "center",
-          behavior: "smooth",
+          behavior: "smooth"
         });
       });
     },
@@ -762,7 +773,7 @@ export default {
       let count = 0;
       this.$refs.liveForm.validateField(
         ["signUpStart", "signUPEnd", "onlineClassesNum", "singleClassMinuteId"],
-        (valid) => {
+        valid => {
           count += 1;
           if (valid) {
             this.onScrollError();
@@ -799,7 +810,7 @@ export default {
           } else {
             return time.getTime() + 86400000 <= new Date().getTime();
           }
-        },
+        }
       };
     },
     startBigin() {
@@ -808,7 +819,7 @@ export default {
         disabledDate(time) {
           // return time.getTime() >= Date.now();
           return time.getTime() + 86400000 <= new Date().getTime();
-        },
+        }
       };
     },
     onScrollError() {
@@ -816,7 +827,7 @@ export default {
         let isError = document.getElementsByClassName("is-error");
         isError[0].scrollIntoView({
           block: "center",
-          behavior: "smooth",
+          behavior: "smooth"
         });
       });
     },
@@ -825,7 +836,7 @@ export default {
       let onlinePrice = null;
       let offLinePrice = null;
       let minus = null;
-      this.liveGroupList.forEach((item) => {
+      this.liveGroupList.forEach(item => {
         if (item.id === val) {
           onlinePrice = item.onlineClassesUnitPrice;
           offLinePrice = item.offlineClassesUnitPrice;
@@ -840,7 +851,7 @@ export default {
     },
     onConfirm(val) {
       let tempVal = deepClone(val || []);
-      tempVal.forEach((item) => {
+      tempVal.forEach(item => {
         item.teachingContent = "";
         item.teachingPoint = "";
         item.singleClassMinutes = this.form.singleClassMinutes;
@@ -852,36 +863,37 @@ export default {
     async __init() {
       try {
         const findName = await sysTenantConfigAll({
-          group: "LIVE_CLIENT",
+          group: "LIVE_CLIENT"
         });
         if (findName.data && findName.data.length > 0) {
-          findName.data.forEach((item) => {
+          findName.data.forEach(item => {
             if (item.paramName == "live_client") {
               this.serviceProvider = item.paranValue;
-              this.form.os = this.serviceProvider == "tencentCloud" ? "client" : "pc";
+              this.form.os =
+                this.serviceProvider == "tencentCloud" ? "client" : "pc";
             }
           });
         }
 
         // 获取 指导老师列表
         await getSubject({
-          tenantId: 1,
-        }).then((res) => {
+          tenantId: 1
+        }).then(res => {
           if (res.code == 200) {
             this.subjectList = [...res.data];
           }
         });
 
         // 获取乐团主管
-        await getOrganRole({ all: true }).then((ruselt) => {
+        await getOrganRole({ all: true }).then(ruselt => {
           this.educationList = ruselt?.data?.EDUCATION;
         });
 
         // 获取课时数
         // 获取默认左边参数
         await vipGroupCategory({
-          groupType: "live",
-        }).then((res) => {
+          groupType: "live"
+        }).then(res => {
           if (res.code == 200) {
             this.liveGroupList = res.data;
           }
@@ -895,7 +907,7 @@ export default {
           const vipGroupApplyBaseInfo = data.vipGroupApplyBaseInfo || {};
           const courseSchedules = data.courseSchedules || [];
           const tempCourse = [];
-          courseSchedules.forEach((item) => {
+          courseSchedules.forEach(item => {
             tempCourse.push({
               classDate: item.classDate,
               actualTeacherId: item.teacherId,
@@ -905,7 +917,7 @@ export default {
               id: item.id,
               singleClassMinutes: vipGroupApplyBaseInfo.singleClassMinutes,
               teachingContent: item.teachingContent,
-              teachingPoint: item.teachingPoint,
+              teachingPoint: item.teachingPoint
             });
           });
 
@@ -919,7 +931,9 @@ export default {
             roomTitle: liveBroadcastRoom.roomTitle, //
             liveRemark: liveBroadcastRoom.liveRemark, // 内容
             organIds: vipGroupApplyBaseInfo.organIdList
-              ? vipGroupApplyBaseInfo.organIdList.split(",").map((item) => Number(item))
+              ? vipGroupApplyBaseInfo.organIdList
+                  .split(",")
+                  .map(item => Number(item))
               : [],
             subjectIdList: subjectId, // 声部
             teacher: liveBroadcastRoom.speakerId, // 指导老师列表
@@ -934,8 +948,10 @@ export default {
             onlineClassesNum: vipGroupApplyBaseInfo.onlineClassesNum,
             singleClassMinuteId: vipGroupApplyBaseInfo.vipGroupCategoryId, //时长编号
             singleClassMinutes: vipGroupApplyBaseInfo.singleClassMinutes, // 时长
-            onlineClassesUnitPrice: vipGroupApplyBaseInfo.onlineClassesUnitPrice, // 售价
-            offlineClassesUnitPrice: vipGroupApplyBaseInfo.offlineClassesUnitPrice, // 原价
+            onlineClassesUnitPrice:
+              vipGroupApplyBaseInfo.onlineClassesUnitPrice, // 售价
+            offlineClassesUnitPrice:
+              vipGroupApplyBaseInfo.offlineClassesUnitPrice, // 原价
             os: liveBroadcastRoom.os, // 直播设备
             useScene: liveBroadcastRoom.useScene, // 直播场景
             popularizeType: liveBroadcastRoom.popularizeType, // 观看权限信息
@@ -945,10 +961,10 @@ export default {
               whether_chat: 0,
               whether_video: 0,
               whether_mic: 0,
-              whether_view_shop_cart: 0,
+              whether_view_shop_cart: 0
             },
             timeTable: tempCourse, // 排课
-            clientType: "TEACHER", // 主讲人身份 默认[老师]
+            clientType: "TEACHER" // 主讲人身份 默认[老师]
           };
 
           this.status = data.vipGroupApplyBaseInfo.status;
@@ -959,20 +975,30 @@ export default {
         //
         console.log(e, "e info");
       }
-    },
+    }
   },
   computed: {
     countOnlineClassesUnitPrice() {
-      return this.form.onlineClassesNum * this.form.onlineClassesUnitPrice || 0;
+      return (
+        Math.ceil(
+          this.form.onlineClassesNum * this.form.onlineClassesUnitPrice
+        ) || 0
+      );
     },
     countOfflineClassesUnitPrice() {
-      return this.form.onlineClassesNum * this.form.offlineClassesUnitPrice || 0;
+      return (
+        Math.ceil(
+          this.form.onlineClassesNum * this.form.offlineClassesUnitPrice
+        ) || 0
+      );
     },
     isDisabled() {
       console.log(this.status, this.type, "isDisabled");
-      return this.type === "update" && [1, 2].includes(this.status) ? true : false;
-    },
-  },
+      return this.type === "update" && [1, 2].includes(this.status)
+        ? true
+        : false;
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -993,7 +1019,8 @@ export default {
     .dotWrap {
       width: 21px;
       height: 21px;
-      background: url("../../assets/images/icon_checkbox_default.png") no-repeat center;
+      background: url("../../assets/images/icon_checkbox_default.png") no-repeat
+        center;
       background-size: contain;
       display: block;
       position: absolute;
@@ -1002,7 +1029,8 @@ export default {
       overflow: hidden;
 
       &.checked {
-        background: url("../../assets/images/icon_checkbox.png") no-repeat center;
+        background: url("../../assets/images/icon_checkbox.png") no-repeat
+          center;
         background-size: contain;
       }
 

+ 10 - 2
src/views/liveClassManager/liveClassTwo/components/courseOverview.vue

@@ -325,10 +325,18 @@ export default {
   },
   computed: {
     countOnlineClassesUnitPrice() {
-      return this.form.onlineClassesNum * this.form.onlineClassesUnitPrice || 0
+      return (
+        Math.ceil(
+          this.form.onlineClassesNum * this.form.onlineClassesUnitPrice
+        ) || 0
+      );
     },
     countOfflineClassesUnitPrice() {
-      return this.form.onlineClassesNum * this.form.offlineClassesUnitPrice || 0
+      return (
+        Math.ceil(
+          this.form.onlineClassesNum * this.form.offlineClassesUnitPrice
+        ) || 0
+      );
     },
   }
 };