You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

447 lines
8.9 KiB

  1. <template>
  2. <view class="page">
  3. <view class="timeTable_sec1">
  4. <view class="tSec1Box" id="semester2">
  5. <image src="~@/common/images/timeT1-1.png" mode="widthFix"></image>
  6. <text>{{ semester }}</text>
  7. </view>
  8. <view class="tSec1Box" id="weekTime2">
  9. <text class="text-xxl cuIcon cuIcon-back" @click="timeTap(1)"></text>
  10. <text>{{todayWeek.Monday}}</text>
  11. -
  12. <text>{{todayWeek.Sunday}} </text>
  13. <text class="text-xxl cuIcon cuIcon-right" @click="timeTap(2)"></text>
  14. </view>
  15. </view>
  16. <view class="timeTable_sec2">
  17. <view class="tSec2Top2">
  18. <view class="tSec2TopUl">
  19. <view class="tSec2TopLi" v-for="(item, ind) in weekArr" :key="item.en" @click="liTap(ind)"
  20. :class="ind == num? 'active' : ''">
  21. <text>{{ item.en }}</text>
  22. <text>{{ item.cn }}</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="tSec2Box2">
  27. <view class="tSec2Con2" v-for="(items, ind) in dataArr" :key="items.num" v-show="ind == num">
  28. <view class="studCheckList">
  29. <view class="studCheckLi" v-for="(k, index) in items.weekList" :key="index"
  30. v-if="items.weekList.length != 0">
  31. <view class="studCheckT">
  32. <image mode="widthFix" src="~@/common/images/book.png"></image>
  33. {{ k.LessonName }}
  34. </view>
  35. <view class="studCheckTxt">
  36. <image src="~@/common/images/time.png" mode="widthFix"></image>
  37. {{ k.LessonDate }}
  38. <image style="margin:0 5px 0 30px" src="~@/common/images/person.png" mode="widthFix">
  39. </image>
  40. <text>
  41. {{ k.Teacher }}
  42. </text>
  43. <image style="margin:0 5px 0 30px" src="~@/common/images/location.png" mode="widthFix">
  44. </image>
  45. {{ k.ClassName }}
  46. </view>
  47. <view class="studCheckStatue"
  48. :class="k.Sort == '迟到'? 'studCheckStatue5' : k.Sort == '早退'? 'studCheckStatue2' : k.Sort == '病假'? 'studCheckStatue4' : k.Sort == '事假'? 'studCheckStatue6' : k.Sort == '准时'? 'studCheckStatue1' : 'studCheckStatue3' ">
  49. <text></text> {{ k.Sort }}
  50. </view>
  51. </view>
  52. <view class="noHtml" v-if="items.weekList.length == 0">
  53. 该时间段没有数据
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import common from '@/common/js/common.js'
  63. export default {
  64. data() {
  65. return {
  66. semester: '',
  67. num: 0,
  68. user: null,
  69. weekDayTime: 0,
  70. noClassTime: 0,
  71. todayWeek: {
  72. Monday:'',
  73. Sunday:''
  74. },
  75. dataArr: [],
  76. itemcs:'',
  77. weekArr: [{
  78. en: 'ONE',
  79. cn: '星期一'
  80. },
  81. {
  82. en: 'TWO',
  83. cn: '星期二'
  84. },
  85. {
  86. en: 'THREE',
  87. cn: '星期三'
  88. },
  89. {
  90. en: 'FOUR',
  91. cn: '星期四'
  92. },
  93. {
  94. en: 'FIVE',
  95. cn: '星期五'
  96. },
  97. {
  98. en: 'SIX',
  99. cn: '星期六'
  100. },
  101. {
  102. en: 'SEVEN',
  103. cn: '星期七'
  104. },
  105. {
  106. en: 'EIGHT',
  107. cn: '星期八'
  108. },
  109. {
  110. en: 'NINE',
  111. cn: '星期九'
  112. },
  113. {
  114. en: 'TEN',
  115. cn: '星期十'
  116. }
  117. ]
  118. // weekArr: [
  119. // {
  120. // en: 'MON',
  121. // cn: '星期一'
  122. // },
  123. // {
  124. // en: 'TUE',
  125. // cn: '星期二'
  126. // },
  127. // {
  128. // en: 'WED',
  129. // cn: '星期三'
  130. // },
  131. // {
  132. // en: 'THU',
  133. // cn: '星期四'
  134. // },
  135. // {
  136. // en: 'FRI',
  137. // cn: '星期五'
  138. // },
  139. // {
  140. // en: 'SAT',
  141. // cn: '星期六'
  142. // },
  143. // {
  144. // en: 'SUN',
  145. // cn: '星期日'
  146. // }
  147. // ]
  148. };
  149. },
  150. methods: {
  151. async init() {
  152. let _this = this;
  153. // _this.todayWeek = common.weekday();
  154. // _this.semester = common.judgeDate();
  155. _this.weekDayTime = 14 * common.oneDayTime();
  156. _this.noClassTime = 4 * common.oneDayTime();
  157. _this.studentCheckData();
  158. },
  159. liTap(ind) {
  160. this.num = ind;
  161. },
  162. timeTap(num) {
  163. let _this = this;
  164. if (num == 1) {
  165. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime - _this.weekDayTime;
  166. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime - _this.weekDayTime;
  167. } else {
  168. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime + _this.weekDayTime;
  169. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime + _this.weekDayTime;
  170. }
  171. _this.num = 0;
  172. _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  173. _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  174. // _this.semester = common.judgeDate(_this.todayWeek.SundayTime);
  175. _this.studentCheckData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  176. },
  177. studentCheckData(start, end) {
  178. // var studCheckList = $('.studCheckList');
  179. let _this = this;
  180. _this.LOADING('加载数据中…')
  181. _this.HTTP_GET(
  182. 'learun/adms/timetable/StuLessonInfo', {
  183. StartDate: start,
  184. EndDate: end
  185. },
  186. '加载数据时出错'
  187. ).then(res => {
  188. _this.HIDE_LOADING()
  189. _this.semester = res.semester
  190. // 回显日期
  191. if (!start) {
  192. _this.todayWeek.MondayTime = new Date(res.startDate).valueOf();
  193. _this.todayWeek.SundayTime = new Date(res.endDate).valueOf();
  194. _this.num = 0;
  195. _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  196. _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  197. }
  198. // if (!start) {
  199. // _this.todayWeek.MondayTime = new Date(res.startDate).valueOf();
  200. // _this.todayWeek.SundayTime = new Date(res.endDate).valueOf() + _this.noClassTime;
  201. // _this.num = 0;
  202. // _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  203. // _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  204. // }
  205. // console.log(res)
  206. _this.dataArr.length = 0;
  207. for(let j = 1; j < 11; j++){
  208. let dataFlag = true;
  209. var num = Math.floor(Math.random() * 100000000);
  210. res.results.forEach((n, i) => {
  211. if(n.week == j){
  212. n.num = num;
  213. _this.dataArr.push(n);
  214. dataFlag = false;
  215. return
  216. }
  217. })
  218. if(dataFlag){
  219. _this.dataArr.push({
  220. week: j,
  221. num: num,
  222. weekList: []
  223. });
  224. }
  225. }
  226. })
  227. },
  228. },
  229. created() {
  230. this.user = this.GET_GLOBAL('loginUser');
  231. this.init()
  232. }
  233. };
  234. </script>
  235. <style lang="less" scoped>
  236. * {
  237. box-sizing: border-box;
  238. }
  239. .timeTable_sec1 {
  240. padding: 14px 12px;
  241. text-align: center;
  242. background: #0075c4;
  243. color: #94d4ff;
  244. font-size: 0;
  245. }
  246. .tSec1Box>* {
  247. display: inline-block;
  248. vertical-align: middle;
  249. }
  250. .tSec1Line {
  251. height: 13px;
  252. width: 1px;
  253. background: #94d4ff;
  254. margin: 0 10px;
  255. }
  256. .tSec1Box {
  257. font-size: 15px;
  258. overflow: hidden;
  259. white-space: nowrap;
  260. text-overflow: ellipsis;
  261. }
  262. #semester2 {
  263. margin-bottom: 10px;
  264. }
  265. #weekTime2 text {
  266. margin: 0 10px;
  267. }
  268. .tSec1Box>text {
  269. width: auto;
  270. text-align: center;
  271. line-height: 22px;
  272. }
  273. .tSec1Box image {
  274. width: 15px;
  275. margin-right: 2px;
  276. }
  277. .tSec1Box text:after {
  278. display: none;
  279. }
  280. .timeTable_sec2 {
  281. margin-bottom: 30px;
  282. }
  283. .tSec2Top2 {
  284. padding: 0 12px;
  285. background: #0075c4;
  286. height: 55px;
  287. text-align: center;
  288. overflow: auto;
  289. }
  290. .tSec2TopUl {
  291. width: 800px;
  292. }
  293. .tSec2TopLi {
  294. width: 10%;
  295. float: left;
  296. line-height: 18px;
  297. padding: 9px 0 9px;
  298. color: #fff;
  299. font-size: 13px;
  300. border-right: 1px solid #1084d2;
  301. border-top: 1px solid #1084d2;
  302. }
  303. .tSec2TopLi:first-child {
  304. border-left: 1px solid #1084d2;
  305. }
  306. .tSec2TopLi.active {
  307. color: #0075c4;
  308. background: #fff;
  309. border-color: #fff;
  310. }
  311. .tSec2TopLi text {
  312. display: block;
  313. }
  314. .tSec2TopLi text:first-child {
  315. letter-spacing: 2px;
  316. text-transform: uppercase;
  317. }
  318. .tSec2Box2 {
  319. background: #fff;
  320. }
  321. .studCheckLi {
  322. border-bottom: 1px solid #d5eaf7;
  323. padding: 8px 12px;
  324. font-size: 15px;
  325. }
  326. .studCheckT {
  327. font-size: 15px;
  328. color: #6e6e6e;
  329. }
  330. .studCheckT image {
  331. width: 11px;
  332. position: relative;
  333. margin-right: 5px;
  334. }
  335. .studCheckTxt {
  336. font-size: 13px;
  337. color: #9d9e9e;
  338. margin: 7px 0;
  339. }
  340. .studCheckTxt text {
  341. // margin: 0 30px;
  342. }
  343. .studCheckTxt image {
  344. width: 12px;
  345. position: relative;
  346. margin-right: 3px;
  347. top: 1px;
  348. }
  349. .studCheckStatue {
  350. font-size: 13px;
  351. }
  352. .studCheckStatue text {
  353. display: inline-block;
  354. width: 8px;
  355. height: 8px;
  356. position: relative;
  357. margin-right: 5px;
  358. vertical-align: middle;
  359. top: -2px;
  360. }
  361. .studCheckStatue1 {
  362. color: #0089fe;
  363. }
  364. .studCheckStatue1 text {
  365. background: #0089fe;
  366. }
  367. .studCheckStatue2 {
  368. color: #f2b60a;
  369. }
  370. .studCheckStatue2 text {
  371. background: #f2b60a;
  372. }
  373. .studCheckStatue3 {
  374. color: #e24545;
  375. }
  376. .studCheckStatue3 text {
  377. background: #e24545;
  378. }
  379. .studCheckStatue4 {
  380. color: #29cf41;
  381. }
  382. .studCheckStatue4 text {
  383. background: #29cf41;
  384. }
  385. .studCheckStatue5 {
  386. color: #ad5151;
  387. }
  388. .studCheckStatue5 text {
  389. background: #ad5151;
  390. }
  391. .studCheckStatue6 {
  392. color: #84f193;
  393. }
  394. .studCheckStatue6 text {
  395. background: #84f193;
  396. }
  397. .noHtml {
  398. height: 100%;
  399. line-height: 60px;
  400. text-align: center;
  401. font-size: 14px;
  402. }
  403. </style>