Parcourir la source

Merge branch 'iteration-20240530-http' into online

lex il y a 10 mois
Parent
commit
62cebd7540

+ 11 - 39
src/common/common.js

@@ -15,15 +15,9 @@ export function getNowDateAndMonday(time) {
   //年
   let mondayY = mondayData.getFullYear();
   //月
-  let mondayM =
-    mondayData.getMonth() + 1 < 10
-      ? "0" + (mondayData.getMonth() + 1)
-      : mondayData.getMonth() + 1;
+  let mondayM = mondayData.getMonth() + 1 < 10 ? "0" + (mondayData.getMonth() + 1) : mondayData.getMonth() + 1;
   //日
-  let mondayD =
-    mondayData.getDate() < 10
-      ? "0" + mondayData.getDate()
-      : mondayData.getDate();
+  let mondayD = mondayData.getDate() < 10 ? "0" + mondayData.getDate() : mondayData.getDate();
 
   let str = mondayY + "-" + mondayM + "-" + mondayD;
   return str;
@@ -40,15 +34,9 @@ export function getNowDateAndSunday(time) {
   let SundayData = new Date(sundayTiem);
   //年
   let tomorrowY = SundayData.getFullYear(); //月
-  let tomorrowM =
-    SundayData.getMonth() + 1 < 10
-      ? "0" + (SundayData.getMonth() + 1)
-      : SundayData.getMonth() + 1;
+  let tomorrowM = SundayData.getMonth() + 1 < 10 ? "0" + (SundayData.getMonth() + 1) : SundayData.getMonth() + 1;
   //日
-  let tomorrowD =
-    SundayData.getDate() < 10
-      ? "0" + SundayData.getDate()
-      : SundayData.getDate();
+  let tomorrowD = SundayData.getDate() < 10 ? "0" + SundayData.getDate() : SundayData.getDate();
   let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
   return str;
 }
@@ -66,10 +54,7 @@ const browser = () => {
     // ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
     android: u.indexOf("DAYAAPPA") > -1 || u.indexOf("Adr") > -1, //android终端
     iPhone: u.indexOf("DAYAAPPI") > -1, //是否为iPhone或者QQHD浏览器
-    isApp:
-      u.indexOf("DAYAAPPI") > -1 ||
-      u.indexOf("DAYAAPPA") > -1 ||
-      u.indexOf("Adr") > -1,
+    isApp: u.indexOf("DAYAAPPI") > -1 || u.indexOf("DAYAAPPA") > -1 || u.indexOf("Adr") > -1,
     iPad: u.indexOf("iPad") > -1, //是否iPad
     webApp: u.indexOf("Safari") == -1, //是否web应该程序,没有头部与底部
     weixin: u.indexOf("MicroMessenger") > -1, //是否微信 (2015-01-22新增)
@@ -183,20 +168,17 @@ const _throttle = (fn, time) => {
 // }
 // 学生地址
 const validStudentUrl = () => {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/mdaya";
   } else if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mstudev.dayaedu.com";
-  } else if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://mstuonline.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mdaya";
   } else {
-    // 默认test环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    //线上
+    returnUrl = "https://gym.lexiaoya.cn/mdaya";
   }
   return returnUrl;
 };
@@ -224,14 +206,4 @@ const changeTwoDecimal = (amt) => {
   return s_x;
 };
 
-export {
-  browser,
-  calcMinute,
-  getSTD,
-  getYMD,
-  getDateList,
-  _debounce,
-  _throttle,
-  validStudentUrl,
-  changeTwoDecimal,
-};
+export { browser, calcMinute, getSTD, getYMD, getDateList, _debounce, _throttle, validStudentUrl, changeTwoDecimal };

+ 14 - 34
src/common/util.js

@@ -75,10 +75,7 @@ export function browser() {
     // ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
     android: u.indexOf("DAYAAPPA") > -1 || u.indexOf("Adr") > -1, //android终端
     iPhone: u.indexOf("DAYAAPPI") > -1, //是否为iPhone或者QQHD浏览器
-    isApp:
-      u.indexOf("DAYAAPPI") > -1 ||
-      u.indexOf("DAYAAPPA") > -1 ||
-      u.indexOf("Adr") > -1,
+    isApp: u.indexOf("DAYAAPPI") > -1 || u.indexOf("DAYAAPPA") > -1 || u.indexOf("Adr") > -1,
     iPad: u.indexOf("iPad") > -1, //是否iPad
     webApp: u.indexOf("Safari") == -1, //是否web应该程序,没有头部与底部
     weixin: u.indexOf("MicroMessenger") > -1, //是否微信 (2015-01-22新增)
@@ -105,8 +102,7 @@ export function utilDate(date, type) {
   }
   let d = new Date(date);
   let year = d.getFullYear() >= 10 ? d.getFullYear() : "0" + d.getFullYear();
-  let month =
-    d.getMonth() + 1 >= 10 ? d.getMonth() + 1 : "0" + (d.getMonth() + 1);
+  let month = d.getMonth() + 1 >= 10 ? d.getMonth() + 1 : "0" + (d.getMonth() + 1);
   let day = d.getDate() >= 10 ? d.getDate() : "0" + d.getDate();
 
   if (type == "ios") {
@@ -144,15 +140,7 @@ export function getYMD(time, noIos) {
  * @param {周几的索引值} index
  */
 export function getWeekString(index) {
-  let weekText = [
-    "星期日",
-    "星期一",
-    "星期二",
-    "星期三",
-    "星期四",
-    "星期五",
-    "星期六",
-  ];
+  let weekText = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
   return weekText[index];
 }
 
@@ -170,40 +158,34 @@ export function checkPhone(phoneNumber) {
 
 // 学生地址
 export function validStudentUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/mdaya";
   } else if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mstudev.dayaedu.com";
-  } else if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://mstuonline.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mdaya";
   } else {
-    // 默认test环境
-    returnUrl = "http://mstutest.dayaedu.com";
+    //线上
+    returnUrl = "https://gym.lexiaoya.cn/mdaya";
   }
   return returnUrl;
 }
 
 // 老师地址
 export function validTeacherUrl() {
-  let url = window.location.href;
+  let url = window.location.hostname;
   let returnUrl = "";
   if (/test/.test(url)) {
     // test环境
-    returnUrl = "http://mteatest.dayaedu.com";
+    returnUrl = "https://test.gym.lexiaoya.cn/mteacher";
   } else if (/dev/.test(url)) {
     // dev 环境
-    returnUrl = "http://mteadev.dayaedu.com";
-  } else if (/online/.test(url)) {
-    //线上
-    returnUrl = "https://mteaonline.dayaedu.com";
+    returnUrl = "https://dev.gym.lexiaoya.cn/mteacher";
   } else {
-    // 默认test环境
-    returnUrl = "http://mteatest.dayaedu.com";
+    //线上
+    returnUrl = "https://gym.lexiaoya.cn/mteacher";
   }
   return returnUrl;
 }
@@ -277,9 +259,7 @@ export function addTimerFormMinute(classDate, startTime, time) {
 }
 
 export function diffTimerFormMinute(classDate, startTime, endTime) {
-  return Math.abs(
-    dayjs(classDate + " " + startTime).diff(classDate + " " + endTime, "Minute")
-  );
+  return Math.abs(dayjs(classDate + " " + startTime).diff(classDate + " " + endTime, "Minute"));
 }
 
 export function timerFormMinute(classDate, startTime, time) {

+ 235 - 238
src/components/Protocol.vue

@@ -1,252 +1,249 @@
 <template>
-	<div class="protocol">
-		<div class="agreeProtocol" v-show="isProtocol">
-			<slot>
-				<van-checkbox @click="onChange" :checked-color="checkedColor" v-model="checked" v-if="!exists">
-					<template #icon="props">
-						<!-- {{ props.checked }} -->
-						<img :src="props.checked ? activeButtonIcon : inactiveButtonIcon" >
-					</template>
-				</van-checkbox>
-				<i :style="leftStyle" @click="onClick" v-if="!exists">{{ leftString }}</i>
-				<i :style="leftStyle" v-if="exists">查看</i>
-				<span @click="onPopupClose" :style="rightStyle">《{{ rightString }}》</span>
-			</slot>
-		</div>
+  <div class="protocol">
+    <div class="agreeProtocol" v-show="isProtocol">
+      <slot>
+        <van-checkbox @click="onChange" :checked-color="checkedColor" v-model="checked" v-if="!exists">
+          <template #icon="props">
+            <!-- {{ props.checked }} -->
+            <img :src="props.checked ? activeButtonIcon : inactiveButtonIcon" />
+          </template>
+        </van-checkbox>
+        <i :style="leftStyle" @click="onClick" v-if="!exists">{{ leftString }}</i>
+        <i :style="leftStyle" v-if="exists">查看</i>
+        <span @click="onPopupClose" :style="rightStyle">《{{ rightString }}》</span>
+      </slot>
+    </div>
 
-		<!-- 协议 -->
-		<van-popup id="protocolPopup" v-model="popupStatus" position="bottom">
-			<m-protocol :protocolHTML="protocolHTML" :popupStatus="popupStatus" :checked="checked" :tenantId="tenantId" @onClose="onPopupClose" @onPopupSure="onPopupSure" />
-		</van-popup>
-	</div>
+    <!-- 协议 -->
+    <van-popup id="protocolPopup" v-model="popupStatus" position="bottom">
+      <m-protocol :protocolHTML="protocolHTML" :popupStatus="popupStatus" :checked="checked" :tenantId="tenantId" @onClose="onPopupClose" @onPopupSure="onPopupSure" />
+    </van-popup>
+  </div>
 </template>
 
 <script>
-	import MProtocol from './MProtocol'
-	import {
-		queryProduceContract,
-		getContract
-	} from '@/api/smallWeb'
-	// import setLoading from '@/utils/loading'
-	export default {
-		name: 'mheader',
-		components: {
-			MProtocol
-		},
-		props: {
-			value: {
-				type: Boolean,
-				default () {
-					return false
-				}
-			},
-			tenantId: [String, Number], // 机构签署协议
-			type: {
-				type: [String, Number],
-				default: 0
-			},
-			musicGroupId: String,
-			checkedColor: String,
-			userId: String,
-			activeIcon: String,
-			inactiveIcon: String,
-			leftStyle: String,
-			leftString: {
-				type: String,
-				default () {
-					return '我已阅读并同意'
-				}
-			},
-			rightStyle: String,
-			rightString: {
-				type: String,
-				default () {
-					return '产品及服务协议'
-				}
-			}
-		},
-		data() {
-			return {
-				popupStatus: false,
-				checked: this.value,
-				exists: true, // 是否已经生成过协议
-				protocolHTML: null, // 协议内容
-				fullPath: null, //保存
-				isProtocol: false // 是否有协议内容
-			}
-		},
-		mounted() {
-			this.__init()
-			// window.onhashchange = () => {
-			// 	this.popupStatus = false
-			// }
-			window.addEventListener('hashchange', this.onHash, false)
-		},
-		methods: {
-			onHash() {
-				this.popupStatus = false
-			},
-			async __init() {
-				if(this.tenantId) {
-					try {
-						const res = await getContract({ id: this.tenantId, type: this.type })
-						this.protocolHTML = res.data
-						this.isProtocol = this.protocolHTML ? true : false
-						this.exists = false
-						this.checked = false
-						this.$emit('input', this.exists)
-					} catch(e) {
-						//
-					}
-				} else {
-					let params = {
-						userId: this.userId ? this.userId : null,
-						musicGroupId: this.musicGroupId ? this.musicGroupId : null
-					}
-					const token = sessionStorage.getItem('token')
-					if(token) {
-						localStorage.setItem('Authorization', token)
-						localStorage.setItem('userInfo', token)
-					}
+import MProtocol from "./MProtocol";
+import { queryProduceContract, getContract } from "@/api/smallWeb";
+// import setLoading from '@/utils/loading'
+export default {
+  name: "mheader",
+  components: {
+    MProtocol,
+  },
+  props: {
+    value: {
+      type: Boolean,
+      default() {
+        return false;
+      },
+    },
+    tenantId: [String, Number], // 机构签署协议
+    type: {
+      type: [String, Number],
+      default: 0,
+    },
+    musicGroupId: String,
+    checkedColor: String,
+    userId: String,
+    activeIcon: String,
+    inactiveIcon: String,
+    leftStyle: String,
+    leftString: {
+      type: String,
+      default() {
+        return "我已阅读并同意";
+      },
+    },
+    rightStyle: String,
+    rightString: {
+      type: String,
+      default() {
+        return "产品及服务协议";
+      },
+    },
+  },
+  data() {
+    return {
+      popupStatus: false,
+      checked: this.value,
+      exists: true, // 是否已经生成过协议
+      protocolHTML: null, // 协议内容
+      fullPath: null, //保存
+      isProtocol: false, // 是否有协议内容
+    };
+  },
+  mounted() {
+    this.__init();
+    // window.onhashchange = () => {
+    // 	this.popupStatus = false
+    // }
+    window.addEventListener("hashchange", this.onHash, false);
+  },
+  methods: {
+    onHash() {
+      this.popupStatus = false;
+    },
+    async __init() {
+      if (this.tenantId) {
+        try {
+          const res = await getContract({ id: this.tenantId, type: this.type });
+          this.protocolHTML = res.data;
+          this.isProtocol = this.protocolHTML ? true : false;
+          this.exists = false;
+          this.checked = false;
+          this.$emit("input", this.exists);
+        } catch (e) {
+          //
+        }
+      } else {
+        let params = {
+          userId: this.userId ? this.userId : null,
+          musicGroupId: this.musicGroupId ? this.musicGroupId : null,
+        };
+        const token = sessionStorage.getItem("token");
+        if (token) {
+          localStorage.setItem("Authorization", token);
+          localStorage.setItem("userInfo", token);
+        }
 
-					await queryProduceContract(params).then(res => {
-						let result = res.data
-						this.protocolHTML = '' // 重置协议
-						if (result.code == 200) {
-							this.protocolHTML = result.data.productContract
-							this.isProtocol = this.protocolHTML ? true : false
-							this.exists = result.data.exists
-							this.checked = this.exists
-							this.$emit('input', this.exists)
-						}
-					})
-				}
-				// 如果没有协议内容则不 显示协议
-				if(!this.protocolHTML) {
-					this.isProtocol = this.protocolHTML ? true : false
-					this.checked = true // 默认选中,学生端则不用默认选中
-					this.$emit('input', this.checked || this.exists)
-				}
-			},
-			// onChange() {
-			// 	this.$emit('input', this.checked)
-			// },
-			// onClick() {
-			// 	this.checked = !this.checked
-			// 	this.$emit('input', this.checked)
-			// },
-			onChange() {
-				if(this.tenantId) {
-					if(this.checked) {
-						this.checked = false
-						this.onPopupClose()
-					} else {
-						this.$emit('input', false)
-					}
-				} else {
-					this.$emit('input', this.checked)
-				}
-			},
-			onClick() {
-				if(this.tenantId) {
-					if(this.checked) {
-						this.checked = false
-						this.$emit('input', false)
-					} else {
-						this.onPopupClose()
-					}
-				} else {
-					this.checked = !this.checked
-					this.$emit('input', this.checked)
-				}
-			},
-			onPopupSure() {
-				this.$emit('input', true)
-				this.checked = true
-				this.onPopupClose()
-			},
-			onPopupClose() {
-				// 判断是否有协议内容
-				if(!this.protocolHTML) {
-					return
-				}
-				this.popupStatus = !this.popupStatus
-				// 打开弹窗
-				if(this.popupStatus) {
-					const route = this.$route
-					let times = 0
-					/* eslint-disable */
-					for(let i in route.query) {
-						times += 1
-					}
-					let fullPath = route.fullPath
-					const origin = window.location.origin
-					const url = times > 0 ? '&pto=1' : '?pto=1'
-					history.pushState("", "", `${origin}/#${fullPath}${url}`)
-				} else {
-					window.history.go(-1)
-				}
-				let popup = document.querySelector('#protocolPopup')
-				if (popup) {
-					popup.scrollTop = 0
-				}
-			}
-		},
-		watch: {
-			popupStatus(newValue) {
-				this.$emit('changeCheck', newValue)
-			},
-			value(nowValue) {
-				if (nowValue) {
-					this.checked = nowValue
-				}
-			}
-		},
-		destroyed() {
-			window.removeEventListener('hashchange', this.onHash)
-		}
-	}
+        await queryProduceContract(params).then((res) => {
+          let result = res.data;
+          this.protocolHTML = ""; // 重置协议
+          if (result.code == 200) {
+            this.protocolHTML = result.data.productContract;
+            this.isProtocol = this.protocolHTML ? true : false;
+            this.exists = result.data.exists;
+            this.checked = this.exists;
+            this.$emit("input", this.exists);
+          }
+        });
+      }
+      // 如果没有协议内容则不 显示协议
+      if (!this.protocolHTML) {
+        this.isProtocol = this.protocolHTML ? true : false;
+        this.checked = true; // 默认选中,学生端则不用默认选中
+        this.$emit("input", this.checked || this.exists);
+      }
+    },
+    // onChange() {
+    // 	this.$emit('input', this.checked)
+    // },
+    // onClick() {
+    // 	this.checked = !this.checked
+    // 	this.$emit('input', this.checked)
+    // },
+    onChange() {
+      if (this.tenantId) {
+        if (this.checked) {
+          this.checked = false;
+          this.onPopupClose();
+        } else {
+          this.$emit("input", false);
+        }
+      } else {
+        this.$emit("input", this.checked);
+      }
+    },
+    onClick() {
+      if (this.tenantId) {
+        if (this.checked) {
+          this.checked = false;
+          this.$emit("input", false);
+        } else {
+          this.onPopupClose();
+        }
+      } else {
+        this.checked = !this.checked;
+        this.$emit("input", this.checked);
+      }
+    },
+    onPopupSure() {
+      this.$emit("input", true);
+      this.checked = true;
+      this.onPopupClose();
+    },
+    onPopupClose() {
+      // 判断是否有协议内容
+      if (!this.protocolHTML) {
+        return;
+      }
+      this.popupStatus = !this.popupStatus;
+      // 打开弹窗
+      if (this.popupStatus) {
+        const route = this.$route;
+        let times = 0;
+        /* eslint-disable */
+        for (let i in route.query) {
+          times += 1;
+        }
+        let fullPath = route.fullPath;
+        const origin = window.location.origin + +location.pathname;
+        const url = times > 0 ? "&pto=1" : "?pto=1";
+        history.pushState("", "", `${origin}#${fullPath}${url}`);
+      } else {
+        window.history.go(-1);
+      }
+      let popup = document.querySelector("#protocolPopup");
+      if (popup) {
+        popup.scrollTop = 0;
+      }
+    },
+  },
+  watch: {
+    popupStatus(newValue) {
+      this.$emit("changeCheck", newValue);
+    },
+    value(nowValue) {
+      if (nowValue) {
+        this.checked = nowValue;
+      }
+    },
+  },
+  destroyed() {
+    window.removeEventListener("hashchange", this.onHash);
+  },
+};
 </script>
 
 <style lang="less" scoped>
-	.agreeProtocol {
-		display: flex;
-		align-items: center;
-		color: #333333;
-		padding: .1rem .16rem;
-		font-size: .14rem;
-		line-height: 1;
-		i {
-			font-style: normal;
-		}
-		.van-checkbox {
-			padding-right: .08rem;
-			img {
-				width: 20px;
-				height: 20px;
-			}
-		}
+.agreeProtocol {
+  display: flex;
+  align-items: center;
+  color: #333333;
+  padding: 0.1rem 0.16rem;
+  font-size: 0.14rem;
+  line-height: 1;
+  i {
+    font-style: normal;
+  }
+  .van-checkbox {
+    padding-right: 0.08rem;
+    img {
+      width: 20px;
+      height: 20px;
+    }
+  }
 
-		/deep/.van-checkbox__icon .van-icon {
-			border-color: #e9eaef;
-			background-color: #fff;
-		}
+  /deep/.van-checkbox__icon .van-icon {
+    border-color: #e9eaef;
+    background-color: #fff;
+  }
 
-		/deep/.van-checkbox__icon--checked .van-icon {
-			color: #fff;
-			background-color: #F85043;
-			border-color: #F85043;
-		}
+  /deep/.van-checkbox__icon--checked .van-icon {
+    color: #fff;
+    background-color: #f85043;
+    border-color: #f85043;
+  }
 
-		span {
-			color: #01C1B5;
-		}
-	}
+  span {
+    color: #01c1b5;
+  }
+}
 
-	@media screen and (max-width: 320px) {
-		.agreeProtocol .van-checkbox img {
-			width: 20px;
-			height: 20px;
-		}
-	}
+@media screen and (max-width: 320px) {
+  .agreeProtocol .van-checkbox img {
+    width: 20px;
+    height: 20px;
+  }
+}
 </style>

+ 249 - 241
src/views/app/ClassDetail.vue

@@ -1,280 +1,288 @@
 <template>
-    <div class="classdetail">
-        <MHeader :isBack="false" />
-        
-        <div class="header van-hairline--bottom">
-            <h3>{{ dataInfo.groupName }}</h3>
-            <p>{{ dataInfo.courseStartDate | getMonthDay }}—{{ dataInfo.courseEndDate | getMonthDay }}</p>
-        </div>
+  <div class="classdetail">
+    <MHeader :isBack="false" />
 
-        <div class="teahcerInfo van-hairline--bottom">
-            <div class="logo">
-                <img v-if="dataInfo.avatar" :src="dataInfo.avatar" alt="">
-                <img v-else src="../../assets/images/app/icon_teacher.png" alt="">
-            </div>
-            <div class="info">
-                <!-- -{{ dataInfo.subjectNames }} -->
-                <p class="name van-ellipsis">{{ dataInfo.teacherName }}</p>
-                <p class="memo van-multi-ellipsis--l2">简介:{{ dataInfo.introduction }}</p>
-                <p class="times">授课次数:{{ dataInfo.lectureNum ? dataInfo.lectureNum : 0 }}次</p>
-            </div>
-        </div>
+    <div class="header van-hairline--bottom">
+      <h3>{{ dataInfo.groupName }}</h3>
+      <p>{{ dataInfo.courseStartDate | getMonthDay }}—{{ dataInfo.courseEndDate | getMonthDay }}</p>
+    </div>
 
-        <div class="classdetails">
-            <h3>课时安排</h3>
-            <!-- 线下课{{ dataInfo.offlineClassesTimes }}次+线上课{{ dataInfo.onlineClassesTimes }}次 -->
-            <p class="detail"><i class="books"></i><span>总计:{{ dataInfo.totalClassesTimes }}节</span></p>
+    <div class="teahcerInfo van-hairline--bottom">
+      <div class="logo">
+        <img v-if="dataInfo.avatar" :src="dataInfo.avatar" alt="" />
+        <img v-else src="../../assets/images/app/icon_teacher.png" alt="" />
+      </div>
+      <div class="info">
+        <!-- -{{ dataInfo.subjectNames }} -->
+        <p class="name van-ellipsis">{{ dataInfo.teacherName }}</p>
+        <p class="memo van-multi-ellipsis--l2">简介:{{ dataInfo.introduction }}</p>
+        <p class="times">授课次数:{{ dataInfo.lectureNum ? dataInfo.lectureNum : 0 }}次</p>
+      </div>
+    </div>
 
-            <div class="detaillist">
-                <div class="detailitem" v-for="(item, index) in courseList" :key="index">
-                    <span class="time">第{{ ++index }}节</span>
-                    <i class="icon_prossess"></i>
-                    <span class="content">{{ item.classDate | getMonthDay}} {{ item.startClassTime | getHourMinute }}-{{ item.endClassTime | getHourMinute }} {{ item.status == 'FINISH' ? '(已结束)' : '' }}</span>
-                </div>
-            </div>
-        </div>
+    <div class="classdetails">
+      <h3>课时安排</h3>
+      <!-- 线下课{{ dataInfo.offlineClassesTimes }}次+线上课{{ dataInfo.onlineClassesTimes }}次 -->
+      <p class="detail">
+        <i class="books"></i><span>总计:{{ dataInfo.totalClassesTimes }}节</span>
+      </p>
 
-        <div class="pay_btn" @click="onJoin">确认加入</div>
+      <div class="detaillist">
+        <div class="detailitem" v-for="(item, index) in courseList" :key="index">
+          <span class="time">第{{ ++index }}节</span>
+          <i class="icon_prossess"></i>
+          <span class="content">{{ item.classDate | getMonthDay }} {{ item.startClassTime | getHourMinute }}-{{ item.endClassTime | getHourMinute }} {{ item.status == "FINISH" ? "(已结束)" : "" }}</span>
+        </div>
+      </div>
     </div>
+
+    <div class="pay_btn" @click="onJoin">确认加入</div>
+  </div>
 </template>
 <script>
-import MHeader from '@/components/MHeader'
-import { browser, getSTD } from '@/common/common'
-import { getGroupDetail, buyCourseGroup } from '@/api/app'
+import MHeader from "@/components/MHeader";
+import { browser, getSTD } from "@/common/common";
+import { getGroupDetail, buyCourseGroup } from "@/api/app";
 export default {
-    name: 'classdetail',
-    components: { MHeader },
-    data () {
-        return {
-            dataInfo: {},
-            courseList: []
-        }
-    },
-    mounted() {
-        let params = this.$route.query
-        if(params.Authorization) {
-            localStorage.setItem('Authorization', decodeURI(params.Authorization))
-            localStorage.setItem('userInfo', decodeURI(params.Authorization))
-        }
-        // 判断是否在app里面
-        if(!browser().android && !browser().iPhone) {
-            this.headerStatus = true
+  name: "classdetail",
+  components: { MHeader },
+  data() {
+    return {
+      dataInfo: {},
+      courseList: [],
+    };
+  },
+  mounted() {
+    let params = this.$route.query;
+    if (params.Authorization) {
+      localStorage.setItem("Authorization", decodeURI(params.Authorization));
+      localStorage.setItem("userInfo", decodeURI(params.Authorization));
+    }
+    // 判断是否在app里面
+    if (!browser().android && !browser().iPhone) {
+      this.headerStatus = true;
+    } else {
+      document.title = "课堂详情";
+    }
+
+    this.__init();
+  },
+  methods: {
+    __init() {
+      let params = this.$route.query;
+      this.$toast.loading({
+        duration: 0,
+        message: "加载中...",
+        forbidClick: true,
+        loadingType: "spinner",
+      });
+      getGroupDetail({ groupId: params.groupId }).then((res) => {
+        let result = res.data;
+        this.$toast.clear();
+        if (result.code == 200) {
+          if (result.data) {
+            this.dataInfo = result.data;
+            this.courseList = result.data.courseSchedules;
+          }
+        } else if (result.code == 403) {
+          this.$router.push({
+            path: "/appLogin",
+            query: {
+              groupId: params.groupId,
+            },
+          });
         } else {
-            document.title = '课堂详情'
+          this.$toast(result.msg);
         }
-
-        this.__init()
+      });
     },
-    methods: {
-        __init() {
-            let params = this.$route.query
-            this.$toast.loading({
-                duration: 0,
-                message: '加载中...',
-                forbidClick: true,
-                loadingType: 'spinner'
-            })
-            getGroupDetail({ groupId: params.groupId }).then(res => {
-                let result = res.data
-                this.$toast.clear()
-                if(result.code == 200) {
-                    if(result.data) {
-                        this.dataInfo = result.data
-                        this.courseList = result.data.courseSchedules
-                    }
-                } else if(result.code == 403) {
-                    this.$router.push({
-                        path: '/appLogin',
-                        query: {
-                            groupId: params.groupId
-                        }
-                    })
-                } else {
-                    this.$toast(result.msg)
-                }
-            })
-        },
-        onJoin() {
-            let params = this.$route.query
-            this.$dialog.confirm({
-                message: '确定加入课程?'
-            }).then(() => {
-                this.$toast.loading({
-                    duration: 0,
-                    message: '加载中...',
-                    forbidClick: true,
-                    loadingType: 'spinner'
+    onJoin() {
+      let params = this.$route.query;
+      this.$dialog
+        .confirm({
+          message: "确定加入课程?",
+        })
+        .then(() => {
+          this.$toast.loading({
+            duration: 0,
+            message: "加载中...",
+            forbidClick: true,
+            loadingType: "spinner",
+          });
+          buyCourseGroup({ courseGroupId: params.groupId }).then((res) => {
+            let result = res.data;
+            this.$toast.clear();
+            if (result.code == 200) {
+              this.$dialog
+                .alert({
+                  message: "恭喜您已完成课程报名,<br />请关注课程时间,准时上课。",
                 })
-                buyCourseGroup({ courseGroupId: params.groupId }).then(res => {
-                    let result = res.data
-                    this.$toast.clear()
-                    if(result.code == 200) {
-                        this.$dialog.alert({
-                            message: '恭喜您已完成课程报名,<br />请关注课程时间,准时上课。'
-                        }).then(() => {
-                            // this.$router.push('/studentDownLoad')
-                            // window.location.href = 'https://mstuonline.dayaedu.com/#/studentDownload'
-                            if(this.checkUrl()) {
-                                window.location.href = 'https://mstuonline.dayaedu.com/#/transfer'
-                            } else {
-                                window.location.href = 'http://mstudev.dayaedu.com/#/transfer'
-                            }
-                        });
-                    } else if(result.code == 302) {
-                        this.onSubmitStatus = true
-                        this.$dialog.alert({
-                            title: '课程冲突',
-                            message: result.msg,
-                            messageAlign: 'left'
-                        }).then(() => {
-                        // on close
-                        });
-                    } else {
-                        this.$toast(result.msg)
-                    }
+                .then(() => {
+                  // this.$router.push('/studentDownLoad')
+                  if (this.checkUrl()) {
+                    window.location.href = "https://gym.lexiaoya.cn/mdaya/#/transfer";
+                  } else {
+                    window.location.href = "https://test.gym.lexiaoya.cn/mdaya/#/transfer";
+                  }
+                });
+            } else if (result.code == 302) {
+              this.onSubmitStatus = true;
+              this.$dialog
+                .alert({
+                  title: "课程冲突",
+                  message: result.msg,
+                  messageAlign: "left",
                 })
-            }).catch(() => {
-            // on cancel
-            });
-        },
-        checkUrl() {
-            let url = window.location.href
-            if(/mteaonline/ig.test(url)) {
-                return true
+                .then(() => {
+                  // on close
+                });
             } else {
-                return false
+              this.$toast(result.msg);
             }
-        }
+          });
+        })
+        .catch(() => {
+          // on cancel
+        });
     },
-    filters: {
-        getMonthDay(time) {
-            let tempDate = time || new Date()
-            if(typeof(tempDate) == 'string') {
-                tempDate = new Date(time.replace(/-/ig, '/'))
-            }
-            let month = getSTD(tempDate.getMonth() + 1)
-            let day = getSTD(tempDate.getDate())
-            return month + '月' + day + '日'
-        },
-        getHourMinute(time) {
-            let tempDate = time || new Date()
-            if(typeof(tempDate) == 'string') {
-                tempDate = new Date(time.replace(/-/ig, '/'))
-            }
-            let hour = getSTD(tempDate.getHours())
-            let minute = getSTD(tempDate.getMinutes())
-            return hour + ':' + minute
-        }
-    }
-}
+    checkUrl() {
+      let url = window.location.href;
+      if (/mteaonline/gi.test(url)) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+  },
+  filters: {
+    getMonthDay(time) {
+      let tempDate = time || new Date();
+      if (typeof tempDate == "string") {
+        tempDate = new Date(time.replace(/-/gi, "/"));
+      }
+      let month = getSTD(tempDate.getMonth() + 1);
+      let day = getSTD(tempDate.getDate());
+      return month + "月" + day + "日";
+    },
+    getHourMinute(time) {
+      let tempDate = time || new Date();
+      if (typeof tempDate == "string") {
+        tempDate = new Date(time.replace(/-/gi, "/"));
+      }
+      let hour = getSTD(tempDate.getHours());
+      let minute = getSTD(tempDate.getMinutes());
+      return hour + ":" + minute;
+    },
+  },
+};
 </script>
 <style lang="less" scoped>
 @import url("../../assets/commonLess/variable.less");
 .classdetail {
-    position: relative;
-    background-color: #fff;
-    min-height: 100vh;
+  position: relative;
+  background-color: #fff;
+  min-height: 100vh;
 }
 
 .header {
-    padding: .2rem .16rem .15rem;
-    font-size: .14rem;
+  padding: 0.2rem 0.16rem 0.15rem;
+  font-size: 0.14rem;
+  color: #444444;
+  h3 {
+    font-size: 0.18rem;
     color: #444444;
-    h3 {
-        font-size: .18rem;
-        color: #444444;
-        padding-bottom: .05rem;
-    }
+    padding-bottom: 0.05rem;
+  }
 }
 .teahcerInfo {
-    padding: .16rem;
-    display: flex;
-    align-items: center;
-    p {
-        line-height: 1.2;
-    }
-    .logo {
-        width: .72rem;
-        height: .72rem;
-        margin-right: .16rem;
-        img {
-            border-radius: .04rem;
-            width: .72rem;
-            height: .72rem;
-        }
-    }
-    .info {
-        font-size: .12rem;
-        color: #777777;
-    }
-    .name {
-        display: flex;
-        justify-content: space-between;
-        font-size: .14rem;
-        color: #444444;
-    }
-    .memo {
-        padding: .05rem 0;
-    }
-    .times {
-        // color: #F97215;
+  padding: 0.16rem;
+  display: flex;
+  align-items: center;
+  p {
+    line-height: 1.2;
+  }
+  .logo {
+    width: 0.72rem;
+    height: 0.72rem;
+    margin-right: 0.16rem;
+    img {
+      border-radius: 0.04rem;
+      width: 0.72rem;
+      height: 0.72rem;
     }
+  }
+  .info {
+    font-size: 0.12rem;
+    color: #777777;
+  }
+  .name {
+    display: flex;
+    justify-content: space-between;
+    font-size: 0.14rem;
+    color: #444444;
+  }
+  .memo {
+    padding: 0.05rem 0;
+  }
+  .times {
+    // color: #F97215;
+  }
 }
 .classdetails {
-    padding: .13rem .16rem;
-    font-size: .14rem;
+  padding: 0.13rem 0.16rem;
+  font-size: 0.14rem;
+  color: #444444;
+  h3 {
+    font-size: 0.18rem;
     color: #444444;
-    h3 {
-        font-size: .18rem;
-        color: #444444;
-        padding-bottom: .05rem;
-    }
-    .books {
-        display: inline-block;
-        margin-right: .05rem;
-        width: .11rem;
-        height: .11rem;
-        background: url('../../assets/images/app/icon_b.png') no-repeat center center;
-        background-size: contain;
-    }
+    padding-bottom: 0.05rem;
+  }
+  .books {
+    display: inline-block;
+    margin-right: 0.05rem;
+    width: 0.11rem;
+    height: 0.11rem;
+    background: url("../../assets/images/app/icon_b.png") no-repeat center center;
+    background-size: contain;
+  }
 
-    .detaillist {
-        margin-top: .12rem;
-        margin-left: .75rem;
-        border-left: 1px solid #B6D3BD;
-    }
-    .detailitem {
-        line-height: 1;
-        padding-bottom: 0.1rem;
-        display: flex;
-        align-items: center;
-        margin-left: -.61rem;
-        .time {
-            width: .45rem;
-        }
-        &:last-child {
-            padding-bottom: 0;
-        }
+  .detaillist {
+    margin-top: 0.12rem;
+    margin-left: 0.75rem;
+    border-left: 1px solid #b6d3bd;
+  }
+  .detailitem {
+    line-height: 1;
+    padding-bottom: 0.1rem;
+    display: flex;
+    align-items: center;
+    margin-left: -0.61rem;
+    .time {
+      width: 0.45rem;
     }
-    .icon_prossess {
-        display: inline-block;
-        width: .16rem;
-        height: .16rem;
-        background: url('../../assets/images/app/icon_step.png') no-repeat center center;
-        background-size: contain;
-        margin: 0 .15rem 0 .08rem;
+    &:last-child {
+      padding-bottom: 0;
     }
+  }
+  .icon_prossess {
+    display: inline-block;
+    width: 0.16rem;
+    height: 0.16rem;
+    background: url("../../assets/images/app/icon_step.png") no-repeat center center;
+    background-size: contain;
+    margin: 0 0.15rem 0 0.08rem;
+  }
 }
 .pay_btn {
-    margin: .25rem .3rem .2rem;
-    background: @mColor;
-    line-height: .45rem;
-    color: #fff;
-    font-size: .18rem;
-    border-radius:.5rem;
-    text-align: center;
+  margin: 0.25rem 0.3rem 0.2rem;
+  background: @mColor;
+  line-height: 0.45rem;
+  color: #fff;
+  font-size: 0.18rem;
+  border-radius: 0.5rem;
+  text-align: center;
 }
 .van-hairline--bottom::after {
-    color: #414141;
+  color: #414141;
 }
-</style>
+</style>

+ 274 - 287
src/views/message/control/fileUpload.vue

@@ -1,50 +1,40 @@
 <template>
-    <div class="oFileUpload controller" :class="[preview ? '' : 'o-unit']" v-if="widget.type == 'file'">
-        <van-field
-            :name="widget.model"
-            :label="widget.name || '附件'"
-            :required="fileCheck ? false : options.required || false"
-            :rules="rule"
-            v-if="!preview"
+  <div class="oFileUpload controller" :class="[preview ? '' : 'o-unit']" v-if="widget.type == 'file'">
+    <van-field :name="widget.model" :label="widget.name || '附件'" :required="fileCheck ? false : options.required || false" :rules="rule" v-if="!preview">
+      <template #input>
+        <!-- image/*, *.xlsx, *.xls, application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, *.txt, *.pdf -->
+        <van-uploader
+          v-model="dataModel"
+          :before-read="beforeRead"
+          :before-delete="beforeDelete"
+          :after-read="afterRead"
+          :disabled="options.disabled || false"
+          :max-count="options.length"
+          accept="image/*, *.xlsx, *.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, *.txt, *.pdf"
+          preview-size="0.6rem"
         >
-            <template #input>
-                <!-- image/*, *.xlsx, *.xls, application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, *.txt, *.pdf -->
-                <van-uploader
-                    v-model="dataModel"
-                    :before-read="beforeRead"
-                    :before-delete="beforeDelete"
-                    :after-read="afterRead"
-                    :disabled="options.disabled || false"
-                    :max-count="options.length"
-                    accept="image/*, *.xlsx, *.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, *.txt, *.pdf"
-                    preview-size="0.6rem">
-                    <!-- <template v-slot:preview-cover="props">
+          <!-- <template v-slot:preview-cover="props">
                         {{ props }}
                     </template> -->
-                    <!-- <template #preview-cover>
+          <!-- <template #preview-cover>
                         2323
                     </template> -->
-                </van-uploader>
-            </template>
-        </van-field>
-        <van-field
-            v-else
-            :name="widget.model"
-            :label="widget.name || '附件'"
-            class="preview"
-        >
-            <template #input>
-                <div class="preview_file" v-for="(item, index) in dataModel" :key="index">
-                    <div class="preview_item">
-                        <i class="van-icon van-icon-description van-uploader__file-icon"></i>
-                        <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 2rem;">{{ item.name || item.url }}</span>
-                    </div>
-                    <div class="preview_btn">
-                        <van-button @click="downLoadFile2(item.url)" type="info" size="mini">下载</van-button>
-                        <van-button :disabled="!checkFileSuffix(item.url)" v-if="checkFileSuffix(item.url)" @click="downLoadFile(item.url)" type="info" size="mini">预览</van-button>
-                    </div>
-                </div>
-                <!-- <div class="van-uploader__preview" v-for="(item, index) in dataModel" :key="index">
+        </van-uploader>
+      </template>
+    </van-field>
+    <van-field v-else :name="widget.model" :label="widget.name || '附件'" class="preview">
+      <template #input>
+        <div class="preview_file" v-for="(item, index) in dataModel" :key="index">
+          <div class="preview_item">
+            <i class="van-icon van-icon-description van-uploader__file-icon"></i>
+            <span style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 2rem">{{ item.name || item.url }}</span>
+          </div>
+          <div class="preview_btn">
+            <van-button @click="downLoadFile2(item.url)" type="info" size="mini">下载</van-button>
+            <van-button :disabled="!checkFileSuffix(item.url)" v-if="checkFileSuffix(item.url)" @click="downLoadFile(item.url)" type="info" size="mini">预览</van-button>
+          </div>
+        </div>
+        <!-- <div class="van-uploader__preview" v-for="(item, index) in dataModel" :key="index">
                     <div class="van-uploader__file" style="width: 0.6rem; height: 0.6rem;" >
                         <i class="van-icon van-icon-description van-uploader__file-icon"></i>
                         <div class="van-uploader__file-name van-ellipsis">
@@ -56,269 +46,266 @@
                         <van-button :disabled="!checkFileSuffix(item.url)" @click="downLoadFile(item.url)" type="info" size="mini">预览</van-button>
                     </div>
                 </div> -->
-            </template>
-        </van-field>
+      </template>
+    </van-field>
 
-        <van-popup position="bottom" v-model="filePreview" style="height: 100%;border-radius: 0;">
-            <van-sticky>
-                <m-header :backUrl="backUrl" :isFixed="false" name="预览" />
-            </van-sticky>
-            <div id="previewIframe" style="height: calc(100vh - 0.44rem);" v-if="filePreview && (fileType == 'xls' || fileType == 'pdf')">
-            </div>
-            <div style="height: calc(100vh - 0.44rem);" v-if="filePreview && fileType == 'doc'">
-            </div>
-            <!-- <div ref="pdf" style="height: calc(100vh - 0.44rem);" v-if="filePreview && fileType == 'pdf'">
+    <van-popup position="bottom" v-model="filePreview" style="height: 100%; border-radius: 0">
+      <van-sticky>
+        <m-header :backUrl="backUrl" :isFixed="false" name="预览" />
+      </van-sticky>
+      <div id="previewIframe" style="height: calc(100vh - 0.44rem)" v-if="filePreview && (fileType == 'xls' || fileType == 'pdf')"></div>
+      <div style="height: calc(100vh - 0.44rem)" v-if="filePreview && fileType == 'doc'"></div>
+      <!-- <div ref="pdf" style="height: calc(100vh - 0.44rem);" v-if="filePreview && fileType == 'pdf'">
             </div> -->
-        </van-popup>
-    </div>
+    </van-popup>
+  </div>
 </template>
 <script>
-import MHeader from '@/components/MHeader'
-import setLoading from '@/common/loading'
-import { uploadFile, oaUploadFile } from '@/views/message/api'
-import { browser } from '@/common/common'
-import { postMessage } from '@/helpers/native-message'
+import MHeader from "@/components/MHeader";
+import setLoading from "@/common/loading";
+import { uploadFile, oaUploadFile } from "@/views/message/api";
+import { browser } from "@/common/common";
+import { postMessage } from "@/helpers/native-message";
 export default {
-    name: 'oFileUpload',
-    components: { MHeader },
-    props: ['widget', 'preview', 'value', 'fileCheck'],
-    data() {
-        // xls, doc, pdf
-        return {
-            dataModel: this.widget.options?.defaultValue || null,
-            filePreview: false,
-            fileType: 'xls',
-            previewUrl: '',
-            numPages: 1,
-            backUrl: {
-                status: true,
-                callBack: () => {
-                    this.filePreview = false;
-                },
-            },
+  name: "oFileUpload",
+  components: { MHeader },
+  props: ["widget", "preview", "value", "fileCheck"],
+  data() {
+    // xls, doc, pdf
+    return {
+      dataModel: this.widget.options?.defaultValue || null,
+      filePreview: false,
+      fileType: "xls",
+      previewUrl: "",
+      numPages: 1,
+      backUrl: {
+        status: true,
+        callBack: () => {
+          this.filePreview = false;
+        },
+      },
+    };
+  },
+  mounted() {
+    // 初始化参数
+    if (this.value) {
+      const widget = this.widget;
+      const model = widget.originModel || widget.model;
+      for (let v in this.value) {
+        if (v == model) {
+          this.dataModel = this.value[v];
         }
+      }
+    }
+  },
+  methods: {
+    checkFileSuffix(url) {
+      let urlArr = url.split(".");
+      let suffix = urlArr[urlArr.length - 1];
+      //  || suffix == 'doc' || suffix == 'docx'
+      if (suffix == "xlsx" || suffix == "xls" || suffix == "pdf") {
+        return true;
+      } else {
+        return false;
+      }
     },
-    mounted() {
-        // 初始化参数
-        if(this.value) {
-            const widget = this.widget
-            const model = widget.originModel || widget.model
-            for(let v in this.value) {
-                if(v == model) {
-                    this.dataModel = this.value[v]
-                }
-            }
+    getFileSuffix(url) {
+      let urlArr = url.split(".");
+      let suffix = urlArr[urlArr.length - 1];
+      if (suffix == "xlsx" || suffix == "xls") {
+        return "xls";
+      } else if (suffix == "doc" || suffix == "docx") {
+        return "doc";
+      } else if (suffix == "pdf") {
+        return "pdf";
+      } else {
+        return "";
+      }
+    },
+    beforeRead(file) {
+      const isLt2M = file.size / 1024 / 1024 < 5;
+      if (!isLt2M) {
+        this.$toast("上传文件大小不能超过 5MB");
+        return false;
+      }
+      return true;
+    },
+    beforeDelete(file, detail) {
+      this.dataModel.splice(detail.index, 1);
+      if (!this.dataModel || (this.dataModel && this.dataModel.length <= 0)) {
+        this.$emit("fileCheckRequired", false);
+      }
+      return true;
+    },
+    async afterRead(file, detail) {
+      // 上传头像
+      try {
+        setLoading(true);
+        file.status = "uploading";
+        file.message = "上传中...";
+        let formData = new FormData();
+        formData.append("file", file.file);
+        let res = null;
+        const query = this.$route.query;
+        if (query.processId) {
+          formData.append("processId", query.processId);
+          res = await oaUploadFile(formData);
+        } else {
+          res = await uploadFile(formData);
         }
+        let result = res.data;
+        if (result.code == 200) {
+          file.status = "done";
+          this.dataModel[detail.index] = {
+            url: result.data.url,
+            name: file.file.name,
+            file: {
+              name: file.file.name,
+            },
+          };
+          // 目前只对 退费模板做处理(id: 19)
+          if (query.processId == 19) {
+            this.$emit("fileCheckRequired", true);
+          }
+        } else {
+          file.status = "failed";
+          file.message = "上传失败";
+          this.$toast(result.msg);
+          this.dataModel.splice(detail.index, 1);
+          return false;
+        }
+        setLoading(false);
+      } catch (err) {
+        setLoading(false);
+        file.status = "failed";
+        file.message = "上传失败";
+        this.dataModel.splice(detail.index, 1);
+        return false;
+      }
     },
-    methods: {
-        checkFileSuffix(url) {
-            let urlArr = url.split('.')
-            let suffix = urlArr[urlArr.length-1]
-            //  || suffix == 'doc' || suffix == 'docx'
-            if(suffix == 'xlsx' || suffix == 'xls' || suffix == 'pdf') {
-                return true
-            } else {
-                return false
-            }
-        },
-        getFileSuffix(url) {
-            let urlArr = url.split('.')
-            let suffix = urlArr[urlArr.length-1]
-            if(suffix == 'xlsx' || suffix == 'xls') {
-                return 'xls'
-            } else if(suffix == 'doc' || suffix == 'docx') {
-                return 'doc'
-            } else if(suffix == 'pdf') {
-                return 'pdf'
-            } else {
-                return ''
-            }
-        },
-        beforeRead(file) {
-            const isLt2M = file.size / 1024 / 1024 < 5
-            if (!isLt2M) {
-                this.$toast('上传文件大小不能超过 5MB')
-                return false
-            }
-            return true
-        },
-        beforeDelete(file, detail) {
-            this.dataModel.splice(detail.index, 1)
-            if(!this.dataModel || this.dataModel && this.dataModel.length <= 0) {
-                this.$emit('fileCheckRequired', false)
-            }
-            return true
-        },
-        async afterRead(file, detail) { // 上传头像
-            try {
-                setLoading(true)
-                file.status = 'uploading'
-                file.message = '上传中...'
-                let formData = new FormData()
-                formData.append('file', file.file)
-                let res = null
-                const query = this.$route.query
-                if(query.processId) {
-                    formData.append('processId', query.processId)
-                    res = await oaUploadFile(formData)
-                } else {
-                    res = await uploadFile(formData)
-                }
-                let result = res.data
-                if(result.code == 200) {
-                    file.status = 'done'
-                    this.dataModel[detail.index] = {
-                        url: result.data.url,
-                        name: file.file.name,
-                        file: {
-                            name: file.file.name
-                        }
-                    }
-                    // 目前只对 退费模板做处理(id: 19)
-                    if(query.processId == 19) {
-                        this.$emit('fileCheckRequired', true)
-                    }
-                } else {
-                    file.status = 'failed'
-                    file.message = '上传失败'
-                    this.$toast(result.msg)
-                    this.dataModel.splice(detail.index, 1)
-                    return false
-                }
-                setLoading(false)
-            } catch (err) {
-                setLoading(false)
-                file.status = 'failed'
-                file.message = '上传失败'
-                this.dataModel.splice(detail.index, 1)
-                return false
-            }
-        },
-        downLoadFile2(file) {
-            this.$toast.loading({
-                duration: 0, // 持续展示 toast
-                forbidClick: true,
-                message: '下载中...',
-            })
-            if(browser().isApp) {
-                postMessage({ api: 'downloadFile', content: { downloadUrl: file } }, () => {
-                    this.$toast.clear()
-                })
+    downLoadFile2(file) {
+      this.$toast.loading({
+        duration: 0, // 持续展示 toast
+        forbidClick: true,
+        message: "下载中...",
+      });
+      if (browser().isApp) {
+        postMessage({ api: "downloadFile", content: { downloadUrl: file } }, () => {
+          this.$toast.clear();
+        });
+      } else {
+        this.$toast.clear();
+        window.location.href = file;
+      }
+    },
+    downLoadFile(file) {
+      // this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + file
+      this.filePreview = true;
+      this.fileType = this.getFileSuffix(file);
+
+      if (this.fileType == "xls" || this.fileType == "pdf") {
+        this.$toast.loading({
+          duration: 0, // 持续展示 toast
+          forbidClick: true,
+          message: "加载中...",
+        });
+        let _this = this;
+        this.$nextTick(() => {
+          let iframe = document.createElement("iframe");
+          iframe.id = "preview_iframe";
+          iframe.style.width = "100%";
+          iframe.style.height = "100%";
+          iframe.style.border = "none";
+          if (this.fileType == "xls") {
+            if (browser().android) {
+              iframe.src = "https://api.idocv.com/view/url?url=" + encodeURIComponent(file + "?times=" + new Date().getTime());
             } else {
-                this.$toast.clear()
-                window.location.href = file
+              iframe.src = "https://view.officeapps.live.com/op/view.aspx?src=" + file;
             }
-        },
-        downLoadFile(file) {
-            // this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + file
-            this.filePreview = true
-            this.fileType = this.getFileSuffix(file)
+          } else {
+            iframe.src = window.location.origin + location.pathname + "/pdf/web/viewer.html?file=" + encodeURIComponent(file);
+          }
+          if (iframe.attachEvent) {
+            iframe.attachEvent("onload", function () {
+              _this.$toast.clear();
+            });
+          } else {
+            iframe.onload = function () {
+              _this.$toast.clear();
 
-            if(this.fileType == 'xls' || this.fileType == 'pdf') {
-                this.$toast.loading({
-                    duration: 0, // 持续展示 toast
-                    forbidClick: true,
-                    message: '加载中...',
-                })
-                let _this = this
-                this.$nextTick(() => {
-                    let iframe = document.createElement("iframe");
-                    iframe.id = 'preview_iframe'
-                    iframe.style.width = '100%';
-                    iframe.style.height = '100%';
-                    iframe.style.border = 'none';
-                    if(this.fileType == 'xls') {
-                        if(browser().android) {
-                            iframe.src = 'https://api.idocv.com/view/url?url=' + encodeURIComponent(file + '?times=' + new Date().getTime())
-                        } else {
-                            iframe.src = 'https://view.officeapps.live.com/op/view.aspx?src=' + file
-                        }
-                    } else {
-                        iframe.src = window.location.origin + '/pdf/web/viewer.html?file=' + encodeURIComponent(file)
-                    }
-                    if (iframe.attachEvent){
-                        iframe.attachEvent("onload", function(){
-                            _this.$toast.clear()
-                        });
-                    } else {
-                        iframe.onload = function(){
-                            _this.$toast.clear()
-
-                            // setTimeout(() => {
-                            //     let dom =  document.querySelector('#preview_iframe').contentWindow.document
-                            //     let scripts = dom.querySelectorAll('script[src]')
-                            //     if(scripts)
-                            // }, 2000);
-                        };
-                    }
-                    document.querySelector('#previewIframe').appendChild(iframe);
-                })
-            } else if(this.fileType == 'doc') {
-            //     // this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + file
-
-            }
-        },
+              // setTimeout(() => {
+              //     let dom =  document.querySelector('#preview_iframe').contentWindow.document
+              //     let scripts = dom.querySelectorAll('script[src]')
+              //     if(scripts)
+              // }, 2000);
+            };
+          }
+          document.querySelector("#previewIframe").appendChild(iframe);
+        });
+      } else if (this.fileType == "doc") {
+        //     // this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + file
+      }
     },
-    computed: {
-        options() {
-            return this.widget.options || {}
-        },
-        rule() {
-            let rules = this.widget.rules || []
-            if(rules && rules.length > 0) {
-                rules.forEach(item => {
-                    if(item.pattern) {
-                        item.pattern = eval(item.pattern)
-                    }
-                    // 判断是否上传文件
-                    if(this.fileCheck) {
-                        item.required = false
-                    }
-                });
-            }
-            return rules
-        }
+  },
+  computed: {
+    options() {
+      return this.widget.options || {};
     },
-    watch: {
-        // dataModel: {
-        //     deep: true,
-        //     handler(newValue) {
-        //         if (newValue !== undefined && newValue !== null) {
-        //         }
-        //     }
-        // },
-    }
-}
+    rule() {
+      let rules = this.widget.rules || [];
+      if (rules && rules.length > 0) {
+        rules.forEach((item) => {
+          if (item.pattern) {
+            item.pattern = eval(item.pattern);
+          }
+          // 判断是否上传文件
+          if (this.fileCheck) {
+            item.required = false;
+          }
+        });
+      }
+      return rules;
+    },
+  },
+  watch: {
+    // dataModel: {
+    //     deep: true,
+    //     handler(newValue) {
+    //         if (newValue !== undefined && newValue !== null) {
+    //         }
+    //     }
+    // },
+  },
+};
 </script>
 
-<style lang='less' scoped>
-@import url('./controlCommon.less');
+<style lang="less" scoped>
+@import url("./controlCommon.less");
 .oFileUpload {
-    /deep/.van-uploader__wrapper--disabled {
-        opacity: 0.9;
-    }
-    /deep/.van-field__control--custom {
-        flex-wrap: wrap;
-    }
+  /deep/.van-uploader__wrapper--disabled {
+    opacity: 0.9;
+  }
+  /deep/.van-field__control--custom {
+    flex-wrap: wrap;
+  }
 
-    .preview_file {
-        width: 100%;
-        font-size: 14px;
-        display: flex;
-        justify-content: space-between;
-        background: #f7f7f7;
-        padding: .08rem;
-        margin-bottom: 0.08rem;
-        .preview_item {
-            display: flex;
-            padding-top: .03rem;
-            flex-basis: 70%;
-        }
-        .preview_btn {
-            text-align: right;
-            flex-basis: 30%;
-        }
+  .preview_file {
+    width: 100%;
+    font-size: 14px;
+    display: flex;
+    justify-content: space-between;
+    background: #f7f7f7;
+    padding: 0.08rem;
+    margin-bottom: 0.08rem;
+    .preview_item {
+      display: flex;
+      padding-top: 0.03rem;
+      flex-basis: 70%;
     }
+    .preview_btn {
+      text-align: right;
+      flex-basis: 30%;
+    }
+  }
 }
-
-</style>
+</style>

+ 127 - 126
src/views/teacher/CallNames.vue

@@ -1,159 +1,160 @@
 <template>
-    <div class="callnames">
-        <m-header />
+  <div class="callnames">
+    <m-header />
 
-        <van-cell class="title" title-class="title-content">
-            <template slot="default">孙老师</template>
-            <template slot="title">武汉小学乐团·长笛基础课</template>
-            <template slot="label">
-                <p class="time">09月12日(星期一)  13:00-13:45</p>
-                <p class="address">
-                    <van-icon name="location" />
-                    湖北省武汉市红领巾小学
-                </p>
-            </template>
-        </van-cell>
+    <van-cell class="title" title-class="title-content">
+      <template slot="default">孙老师</template>
+      <template slot="title">武汉小学乐团·长笛基础课</template>
+      <template slot="label">
+        <p class="time">09月12日(星期一) 13:00-13:45</p>
+        <p class="address">
+          <van-icon name="location" />
+          湖北省武汉市红领巾小学
+        </p>
+      </template>
+    </van-cell>
 
-        <div class="name-info">
-            <span>共有:30</span>
-            <span>实有:30</span>
-            <span>请假:30</span>
-        </div>
+    <div class="name-info">
+      <span>共有:30</span>
+      <span>实有:30</span>
+      <span>请假:30</span>
+    </div>
 
-        <div class="section">
-            <van-cell-group v-for="i in 6" :key="i">
-                <van-cell class="btn-group" :center="true" :border="false">
-                    <template slot="icon">
-                        <img class="logo" src="http://dev.dayaedu.com/img/teacher1.91bf990d.png" alt="">
-                    </template>
-                    <template slot="title">阿曼湾</template>
-                    <template slot="label"><span>长笛</span><span>合奏课1班</span></template>
-                </van-cell>
-                <van-cell class="btn-group">
-                    <van-button round type="danger">请假</van-button>
-                    <van-button round type="primary">未到</van-button>
-                    <van-button round type="info">到课</van-button>
-                </van-cell>
-            </van-cell-group>
-        </div>
+    <div class="section">
+      <van-cell-group v-for="i in 6" :key="i">
+        <van-cell class="btn-group" :center="true" :border="false">
+          <template slot="icon">
+            <!-- <img class="logo" src="http://dev.dayaedu.com/img/teacher1.91bf990d.png" alt=""> -->
+          </template>
+          <template slot="title">阿曼湾</template>
+          <template slot="label"><span>长笛</span><span>合奏课1班</span></template>
+        </van-cell>
+        <van-cell class="btn-group">
+          <van-button round type="danger">请假</van-button>
+          <van-button round type="primary">未到</van-button>
+          <van-button round type="info">到课</van-button>
+        </van-cell>
+      </van-cell-group>
+    </div>
 
-        <div class="button-group">
-            <van-button type="default">全到</van-button>
-            <van-button type="primary">点名完成</van-button>
-        </div>
+    <div class="button-group">
+      <van-button type="default">全到</van-button>
+      <van-button type="primary">点名完成</van-button>
     </div>
+  </div>
 </template>
 <script>
-import MHeader from '@/components/MHeader'
+import MHeader from "@/components/MHeader";
 export default {
-    name: 'callnames',
-    components: { MHeader }
-}
+  name: "callnames",
+  components: { MHeader },
+};
 </script>
-<style lang='less' scoped>
+<style lang="less" scoped>
 @import url("../../assets/commonLess/variable.less");
-.title { 
-    padding: .16rem;
+.title {
+  padding: 0.16rem;
 }
 .title-content {
-    font-size: .18rem !important;
-    font-weight: bold;
-    .van-cell__label {
-        font-weight: 400;
-        color: @mFontColor;
-        margin-top: .06rem;
-        .time {
-            font-size: .16rem;
-        }
-        .address {
-            padding-top: .03rem;
-            font-size: .14rem;
-            display: flex;
-            align-items: center;
-        }
+  font-size: 0.18rem !important;
+  font-weight: bold;
+  .van-cell__label {
+    font-weight: 400;
+    color: @mFontColor;
+    margin-top: 0.06rem;
+    .time {
+      font-size: 0.16rem;
     }
-    .van-icon-location {
-        margin-right: .03rem;
-        color: @mColor;
+    .address {
+      padding-top: 0.03rem;
+      font-size: 0.14rem;
+      display: flex;
+      align-items: center;
     }
+  }
+  .van-icon-location {
+    margin-right: 0.03rem;
+    color: @mColor;
+  }
 }
 /deep/.van-cell__title {
-    font-size: .14rem;
-    color: @mFontColor;
-    flex: 1 auto;
+  font-size: 0.14rem;
+  color: @mFontColor;
+  flex: 1 auto;
 }
-/deep/.van-cell__value, /deep/.van-cell__label {
-    color: @sFontColor;
+/deep/.van-cell__value,
+/deep/.van-cell__label {
+  color: @sFontColor;
 }
 /deep/.van-cell__label {
-    margin-top: 0;
-    span {
-        padding-right: .1rem;
-    }
+  margin-top: 0;
+  span {
+    padding-right: 0.1rem;
+  }
 }
 .name-info {
-    color: @mFontColor;
-    padding: .09rem .16rem;
-    span {
-        padding-right: .15rem;
-    }
+  color: @mFontColor;
+  padding: 0.09rem 0.16rem;
+  span {
+    padding-right: 0.15rem;
+  }
 }
 .logo {
-    width: .35rem;
-    height: .35rem;
-    margin-right: .12rem;
+  width: 0.35rem;
+  height: 0.35rem;
+  margin-right: 0.12rem;
 }
 .btn-group {
-    &:first-child {
-        padding-bottom: .12rem;
-    }
+  &:first-child {
+    padding-bottom: 0.12rem;
+  }
+  &:last-child {
+    padding-top: 0;
+    padding-left: 0.63rem;
+  }
+  .van-button {
+    padding: 0.04rem 0.24rem;
+    height: auto;
+    line-height: 1.5;
+    font-size: 0.16rem;
+    margin-right: 0.16rem;
     &:last-child {
-        padding-top: 0;
-        padding-left: .63rem;
-    }
-    .van-button {
-        padding: .04rem .24rem;
-        height: auto;
-        line-height: 1.5;
-        font-size: .16rem;
-        margin-right: .16rem;
-        &:last-child {
-            margin-right: 0;
-        }
-    }
-    .van-button--danger {
-        background-color: @redColor;
-        border: 1px solid @redColor;
-    }
-    .van-button--primary {
-        background-color: #FFC10D;
-        border: 1px solid #FFC10D;
+      margin-right: 0;
     }
+  }
+  .van-button--danger {
+    background-color: @redColor;
+    border: 1px solid @redColor;
+  }
+  .van-button--primary {
+    background-color: #ffc10d;
+    border: 1px solid #ffc10d;
+  }
 }
-.section{
-    margin-bottom: .82rem;
+.section {
+  margin-bottom: 0.82rem;
 }
 
 .button-group {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    z-index: 99;
-    width: 100%;
-    box-shadow:0 .02rem .07rem 0 rgba(0,0,0,0.16);
-    display: flex;
-    .van-button {   
-        flex: 1;
-        height: .52rem;
-        line-height: .5rem;
-        font-size: .16rem;
-    }
-    .van-button--default {
-        color: @mFontColor;
-    }
-    .van-button--primary {
-        background: @mColor;
-        border-color: @mColor;
-    }
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 99;
+  width: 100%;
+  box-shadow: 0 0.02rem 0.07rem 0 rgba(0, 0, 0, 0.16);
+  display: flex;
+  .van-button {
+    flex: 1;
+    height: 0.52rem;
+    line-height: 0.5rem;
+    font-size: 0.16rem;
+  }
+  .van-button--default {
+    color: @mFontColor;
+  }
+  .van-button--primary {
+    background: @mColor;
+    border-color: @mColor;
+  }
 }
-</style>
+</style>

+ 194 - 198
src/views/teacher/StartedDetail.vue

@@ -1,227 +1,223 @@
 <template>
-    <div class="starteddetail">
-        <m-header />
+  <div class="starteddetail">
+    <m-header />
 
-        <van-cell :center="true">
-            <template slot="icon">
-                <img class="logo" src="http://dev.dayaedu.com/img/teacher1.91bf990d.png" alt="">
-            </template>
-            <template slot="default">连续旷到2次</template>
-            <template slot="title">阿曼湾</template>
-            <template slot="label">审批通过</template>
-        </van-cell>
-        <div class="started-info">
-            <p>审批事项:合班</p>
-            <p>开始时间:2019-09-01  9:00</p>
-            <p>结束时间:2019-09-01  18:00</p>
-            <p>备注:01班人数较少,01班人数较少01班人数较少
-            01班人数较少01班人数较少01班人数较少01班人数
-            01班人数较少01班人数较少01班人数较少较少</p>
-        </div>
+    <van-cell :center="true">
+      <template slot="icon">
+        <!-- <img class="logo" src="http://dev.dayaedu.com/img/teacher1.91bf990d.png" alt=""> -->
+      </template>
+      <template slot="default">连续旷到2次</template>
+      <template slot="title">阿曼湾</template>
+      <template slot="label">审批通过</template>
+    </van-cell>
+    <div class="started-info">
+      <p>审批事项:合班</p>
+      <p>开始时间:2019-09-01 9:00</p>
+      <p>结束时间:2019-09-01 18:00</p>
+      <p>备注:01班人数较少,01班人数较少01班人数较少 01班人数较少01班人数较少01班人数较少01班人数 01班人数较少01班人数较少01班人数较少较少</p>
+    </div>
 
-        <div class="section">
-            <div class="node success">
-                <div class="message">
-                    <p class="name">我</p>
-                    <p class="content">我发起的</p>
-                </div>
-                <van-icon name="checked" />
-                <div class="step-line"></div>
-            </div>
-            <div class="node success">
-                <div class="message ">
-                    <p class="name">我</p>
-                    <p class="content">我发起的</p>
-                </div>
-                <van-icon name="checked" />
-                <div class="step-line"></div>
-            </div>
-            <div class="node underway">
-                <div class="message ">
-                    <p class="name">主管</p>
-                    <p class="content">审批中</p>
-                </div>
-                <van-icon name="underway" />
-                <div class="step-line"></div>
-            </div>
-            <div class="node empty">
-                <div class="message ">
-                    <p class="name">总经理</p>
-                    <p class="content"></p>
-                </div>
-                <van-icon />
-                <div class="step-line"></div>
-            </div>
-            <div class="node error">
-                <div class="message ">
-                    <p class="name">总经理</p>
-                    <p class="content">已拒绝(原因:理由不充分)</p>
-                </div>
-                <van-icon name="clear" />
-                <div class="step-line"></div>
-            </div>
+    <div class="section">
+      <div class="node success">
+        <div class="message">
+          <p class="name">我</p>
+          <p class="content">我发起的</p>
         </div>
-
-        <div class="button-group">
-            <!-- <van-button type="default">编辑内容</van-button> -->
-            <van-button type="primary">取消审批</van-button>
+        <van-icon name="checked" />
+        <div class="step-line"></div>
+      </div>
+      <div class="node success">
+        <div class="message">
+          <p class="name">我</p>
+          <p class="content">我发起的</p>
+        </div>
+        <van-icon name="checked" />
+        <div class="step-line"></div>
+      </div>
+      <div class="node underway">
+        <div class="message">
+          <p class="name">主管</p>
+          <p class="content">审批中</p>
+        </div>
+        <van-icon name="underway" />
+        <div class="step-line"></div>
+      </div>
+      <div class="node empty">
+        <div class="message">
+          <p class="name">总经理</p>
+          <p class="content"></p>
         </div>
+        <van-icon />
+        <div class="step-line"></div>
+      </div>
+      <div class="node error">
+        <div class="message">
+          <p class="name">总经理</p>
+          <p class="content">已拒绝(原因:理由不充分)</p>
+        </div>
+        <van-icon name="clear" />
+        <div class="step-line"></div>
+      </div>
+    </div>
+
+    <div class="button-group">
+      <!-- <van-button type="default">编辑内容</van-button> -->
+      <van-button type="primary">取消审批</van-button>
     </div>
+  </div>
 </template>
 <script>
-import MHeader from '@/components/MHeader'
+import MHeader from "@/components/MHeader";
 export default {
-    name: 'starteddetail',
-    components: { MHeader }
-}
+  name: "starteddetail",
+  components: { MHeader },
+};
 </script>
-<style lang='less' scoped>
+<style lang="less" scoped>
 @import url("../../assets/commonLess/variable.less");
-/deep/.van-cell__value, /deep/.van-cell__label {
-    color: @tFontColor;
-    span {
-        padding-right: .1rem;
-    }
+/deep/.van-cell__value,
+/deep/.van-cell__label {
+  color: @tFontColor;
+  span {
+    padding-right: 0.1rem;
+  }
 }
 /deep/.van-cell {
-    padding: .16rem;
+  padding: 0.16rem;
 }
 .logo {
-    width: .40rem;
-    height: .40rem;
-    margin-right: .12rem;
+  width: 0.4rem;
+  height: 0.4rem;
+  margin-right: 0.12rem;
 }
 .started-info {
-    background: @whiteColor;
-    font-size: .14rem;
-    padding: .12rem .16rem .25rem;
-    line-height: .22rem;
+  background: @whiteColor;
+  font-size: 0.14rem;
+  padding: 0.12rem 0.16rem 0.25rem;
+  line-height: 0.22rem;
 }
 .section {
+  position: relative;
+  overflow: hidden;
+  padding-left: 0.8rem;
+  padding-bottom: 0.92rem;
+  .node {
     position: relative;
-    overflow: hidden;
-    padding-left: .8rem;
-    padding-bottom: .92rem;
-    .node {
-        position: relative;
-        margin-top: .2rem;
-        margin-right: .26rem;
-        &::before {
-            position: absolute;
-            top: -.2rem;
-            left: -.25rem;
-            z-index: 1;
-            width: .02rem;
-            height: .3rem;
-            background-color: #d8d8d8;
-            content: '';
-        }
-        &:last-child {
-            .step-line {
-                height: 0;
-            }
-        }
+    margin-top: 0.2rem;
+    margin-right: 0.26rem;
+    &::before {
+      position: absolute;
+      top: -0.2rem;
+      left: -0.25rem;
+      z-index: 1;
+      width: 0.02rem;
+      height: 0.3rem;
+      background-color: #d8d8d8;
+      content: "";
+    }
+    &:last-child {
+      .step-line {
+        height: 0;
+      }
+    }
 
-        &.success {
-            .content {
-                color: #62A070;
-            }
-            .van-icon {
-                color: #62A070;
-            }
-        }
-        &.error {
-            .content {
-                color: @sFontColor;
-            }
-            .van-icon {
-                color: #F85043;
-            }
-        }
-        &.underway {
-            .content {
-                color: @orangeColor;
-            }
-            .van-icon {
-                color: @orangeColor;
-            }
-        }
-        &.empty {
-            .van-icon {
-                background: #D8D8D8;
-            }
-        }
+    &.success {
+      .content {
+        color: #62a070;
+      }
+      .van-icon {
+        color: #62a070;
+      }
     }
-    .van-icon {
-        font-size: .22rem;
-        position: absolute;
-        top: .2rem;
-        left: -.25rem;
-        z-index: 2;
-        width: .22rem;
-        height: .22rem;
-        border-radius: 50%;
-        -webkit-transform: translate(-50%, -50%);
-        transform: translate(-50%, -50%);
+    &.error {
+      .content {
+        color: @sFontColor;
+      }
+      .van-icon {
+        color: #f85043;
+      }
     }
-    .step-line {
-        position: absolute;
-        background-color: #d8d8d8;
-        top: .16rem;
-        left: -.25rem;
-        width: .02rem;
-        height: 100%;
+    &.underway {
+      .content {
+        color: @orangeColor;
+      }
+      .van-icon {
+        color: @orangeColor;
+      }
     }
-    .message {
-        position: relative;
-        background: @whiteColor;
-        padding: .08rem .16rem;
-        border-radius: .02rem;
-        &::before {
-            content: ' ';
-            display: block;
-            position: absolute;
-            left: -.05rem;
-            top: .15rem;
-            width: .1rem;
-            height: .1rem;
-            background: @whiteColor;
-            transform: rotate(-45deg);
-        }
-        .name {
-            font-size: .16rem;
-            font-weight: bold;
-            color: @mFontColor;
-        }
-        .content {
-            font-size: .14rem;
-            min-height: .2rem;
-        }
-        
+    &.empty {
+      .van-icon {
+        background: #d8d8d8;
+      }
     }
-
-    
-}
-.button-group {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    z-index: 99;
-    width: 100%;
-    box-shadow:0 .02rem .07rem 0 rgba(0,0,0,0.16);
-    display: flex;
-    .van-button {   
-        flex: 1;
-        height: .52rem;
-        line-height: .5rem;
-        font-size: .16rem;
+  }
+  .van-icon {
+    font-size: 0.22rem;
+    position: absolute;
+    top: 0.2rem;
+    left: -0.25rem;
+    z-index: 2;
+    width: 0.22rem;
+    height: 0.22rem;
+    border-radius: 50%;
+    -webkit-transform: translate(-50%, -50%);
+    transform: translate(-50%, -50%);
+  }
+  .step-line {
+    position: absolute;
+    background-color: #d8d8d8;
+    top: 0.16rem;
+    left: -0.25rem;
+    width: 0.02rem;
+    height: 100%;
+  }
+  .message {
+    position: relative;
+    background: @whiteColor;
+    padding: 0.08rem 0.16rem;
+    border-radius: 0.02rem;
+    &::before {
+      content: " ";
+      display: block;
+      position: absolute;
+      left: -0.05rem;
+      top: 0.15rem;
+      width: 0.1rem;
+      height: 0.1rem;
+      background: @whiteColor;
+      transform: rotate(-45deg);
     }
-    .van-button--default {
-        color: @mFontColor;
+    .name {
+      font-size: 0.16rem;
+      font-weight: bold;
+      color: @mFontColor;
     }
-    .van-button--primary {
-        background: @mColor;
-        border-color: @mColor;
+    .content {
+      font-size: 0.14rem;
+      min-height: 0.2rem;
     }
+  }
+}
+.button-group {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 99;
+  width: 100%;
+  box-shadow: 0 0.02rem 0.07rem 0 rgba(0, 0, 0, 0.16);
+  display: flex;
+  .van-button {
+    flex: 1;
+    height: 0.52rem;
+    line-height: 0.5rem;
+    font-size: 0.16rem;
+  }
+  .van-button--default {
+    color: @mFontColor;
+  }
+  .van-button--primary {
+    background: @mColor;
+    border-color: @mColor;
+  }
 }
-</style>
+</style>

+ 2 - 1
src/views/trainStatistics/trainDetail.vue

@@ -158,10 +158,11 @@ export default {
     },
     showDetail(item) {
       if (item.notesDataIndex > 0) {
+        const route = location.hostname.indexOf("dayaedu.com") ? "/accompany/" : "/accompany-teacher/";
         postMessage({
           api: "openWebView",
           content: {
-            url: location.origin + `/accompany/#/report/${item.id}`,
+            url: location.origin + route + `#/report/${item.id}`,
             orientation: 0,
             isHideTitle: true,
             statusBarTextColor: false,

+ 4 - 3
vue.config.js

@@ -1,10 +1,11 @@
-let targetUrl = "https://mteadev.dayaedu.com";
+let targetUrl = "https://dev.gym.lexiaoya.cn";
 // let targetUrl = "http://192.168.3.26:8000";
 // let targetUrl = 'http://192.168.3.20:8000'
-// let targetUrl = 'https://online.dayaedu.com'
-// let targetUrl = 'http://dev.dayaedu.com/'
+// let targetUrl = 'https://online.gym.lexiaoya.cn'
+// let targetUrl = 'http://dev.gym.lexiaoya.cn/'
 // let targetUrl = 'http://192.168.3.124:8000'
 module.exports = {
+  publicPath: "./",
   chainWebpack: (config) => {
     config.devtool("inline-source-map");
     config.output.filename("[name].[hash].js").end();