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.
 
 
 
 
 
 

321 lines
6.8 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 v-for="(item, ind) in weekArr" :key="item.en" @click="liTap(ind)" :class="ind == num? 'active' : ''">
  19. <text>{{ item.en }}</text>
  20. <text>{{ item.cn }}</text>
  21. </view>
  22. </view>
  23. <view class="tSec2Box2">
  24. <view class="tSec2Con2" v-for="(items, ind) in dataArr" :key="items.num" v-show="ind == num">
  25. <view class="studCheckList">
  26. <view class="studCheckLi" v-for="(k, index) in items.weekList" :key="k.LessonDate" v-if="items.weekList.length != 0">
  27. <view class="studCheckT">
  28. <image mode="widthFix" src="~@/common/images/book.png"></image>
  29. {{ k.LessonName }}
  30. </view>
  31. <view class="studCheckTxt">
  32. <image src="~@/common/images/time.png" mode="widthFix"></image>
  33. {{ k.LessonDate }}
  34. <image style="margin:0 5px 0 30px" src="~@/common/images/person.png" mode="widthFix"></image>
  35. <text>
  36. {{ k.Teacher }}
  37. </text>
  38. <image style="margin:0 5px 0 30px" src="~@/common/images/location.png" mode="widthFix"></image>
  39. {{ k.ClassRoomName }}
  40. </view>
  41. <view class="studCheckStatue" :class="k.Sort == '迟到'? 'studCheckStatue2' : k.Sort == '早退'? 'studCheckStatue2' : k.Sort == '病假'? 'studCheckStatue4' : k.Sort == '事假'? 'studCheckStatue2' : k.Sort == '准时'? 'studCheckStatue1' : 'studCheckStatue3' ">
  42. <text></text> {{ k.Sort }}
  43. </view>
  44. </view>
  45. <view class="noHtml" v-if="items.weekList.length == 0">
  46. 该时间段没有数据
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import common from '@/common/js/common.js'
  56. export default {
  57. data() {
  58. return {
  59. semester: '',
  60. num: 0,
  61. weekDayTime: 0,
  62. todayWeek: {},
  63. dataArr: [],
  64. weekArr: [
  65. {
  66. en: 'MON',
  67. cn: '星期一'
  68. },
  69. {
  70. en: 'TUE',
  71. cn: '星期二'
  72. },
  73. {
  74. en: 'WED',
  75. cn: '星期三'
  76. },
  77. {
  78. en: 'THU',
  79. cn: '星期四'
  80. },
  81. {
  82. en: 'FRI',
  83. cn: '星期五'
  84. },
  85. {
  86. en: 'SAT',
  87. cn: '星期六'
  88. },
  89. {
  90. en: 'SUN',
  91. cn: '星期日'
  92. }
  93. ]
  94. };
  95. },
  96. methods: {
  97. async init() {
  98. let _this = this;
  99. _this.todayWeek = common.weekday();
  100. _this.semester = common.judgeDate();
  101. _this.weekDayTime = 7 * common.oneDayTime();
  102. _this.studentCheckData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  103. },
  104. studentCheckData(Monday, Sunday) {
  105. // var studCheckList = $('.studCheckList');
  106. let _this = this;
  107. _this.LOADING('加载数据中…')
  108. _this.HTTP_GET(
  109. 'learun/adms/timetable/StuLessonInfo',
  110. {StartDate:Monday, EndDate:Sunday},
  111. '加载数据时出错'
  112. ).then( res => {
  113. _this.HIDE_LOADING()
  114. //console.log(res)
  115. _this.dataArr.length = 0;
  116. for(let j = 1; j < 8; j++){
  117. let dataFlag = true;
  118. var num = Math.floor(Math.random() * 100000000);
  119. res.forEach((n, i) => {
  120. if(n.week == j){
  121. n.num = num;
  122. _this.dataArr.push(n);
  123. dataFlag = false;
  124. return
  125. }
  126. })
  127. if(dataFlag){
  128. _this.dataArr.push({
  129. week: j,
  130. num: num,
  131. weekList: []
  132. });
  133. }
  134. }
  135. })
  136. },
  137. liTap(ind) {
  138. this.num = ind;
  139. },
  140. timeTap(num) {
  141. let _this = this;
  142. if (num == 1) {
  143. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime - _this.weekDayTime;
  144. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime - _this.weekDayTime;
  145. } else {
  146. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime + _this.weekDayTime;
  147. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime + _this.weekDayTime;
  148. }
  149. _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  150. _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  151. _this.semester = common.judgeDate(_this.todayWeek.SundayTime);
  152. _this.studentCheckData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  153. }
  154. },
  155. created() {
  156. this.init()
  157. }
  158. };
  159. </script>
  160. <style lang="less" scoped>
  161. * {
  162. box-sizing: border-box;
  163. }
  164. .timeTable_sec1 {
  165. padding: 14px 12px;
  166. text-align: center;
  167. background: #0075c4;
  168. color: #94d4ff;
  169. font-size: 0;
  170. }
  171. .tSec1Box > * {
  172. display: inline-block;
  173. vertical-align: middle;
  174. }
  175. .tSec1Line {
  176. height: 13px;
  177. width: 1px;
  178. background: #94d4ff;
  179. margin: 0 10px;
  180. }
  181. .tSec1Box {
  182. font-size: 15px;
  183. overflow: hidden;
  184. white-space: nowrap;
  185. text-overflow: ellipsis;
  186. }
  187. #semester2 {
  188. margin-bottom: 10px;
  189. }
  190. #weekTime2 text {
  191. margin: 0 10px;
  192. }
  193. .tSec1Box > text {
  194. width: auto;
  195. text-align: center;
  196. line-height: 22px;
  197. }
  198. .tSec1Box image {
  199. width: 15px;
  200. margin-right: 2px;
  201. }
  202. .tSec1Box text:after {
  203. display: none;
  204. }
  205. .timeTable_sec2 {
  206. margin-bottom: 30px;
  207. }
  208. .tSec2Top2 {
  209. padding: 0 12px;
  210. background: #0075c4;
  211. height: 55px;
  212. text-align: center;
  213. overflow: hidden;
  214. }
  215. .tSec2Top2 view {
  216. width: 14.285714%;
  217. float: left;
  218. line-height: 18px;
  219. padding: 9px 0 9px;
  220. color: #fff;
  221. font-size: 13px;
  222. border-right: 1px solid #1084d2;
  223. border-top: 1px solid #1084d2;
  224. }
  225. .tSec2Top2 view:first-child {
  226. border-left: 1px solid #1084d2;
  227. }
  228. .tSec2Top2 view.active {
  229. color: #0075c4;
  230. background: #fff;
  231. border-color: #fff;
  232. }
  233. .tSec2Top2 view text {
  234. display: block;
  235. }
  236. .tSec2Top2 view text:first-child {
  237. letter-spacing: 2px;
  238. text-transform: uppercase;
  239. }
  240. .tSec2Box2 {
  241. background: #fff;
  242. }
  243. .studCheckLi {
  244. border-bottom: 1px solid #d5eaf7;
  245. padding: 8px 12px;
  246. font-size: 15px;
  247. }
  248. .studCheckT {
  249. font-size: 15px;
  250. color: #6e6e6e;
  251. }
  252. .studCheckT image {
  253. width: 11px;
  254. position: relative;
  255. margin-right: 5px;
  256. }
  257. .studCheckTxt {
  258. font-size: 13px;
  259. color: #9d9e9e;
  260. margin: 7px 0;
  261. }
  262. .studCheckTxt text {
  263. // margin: 0 30px;
  264. }
  265. .studCheckTxt image {
  266. width: 12px;
  267. position: relative;
  268. margin-right: 3px;
  269. top: 1px;
  270. }
  271. .studCheckStatue {
  272. font-size: 13px;
  273. }
  274. .studCheckStatue text {
  275. display: inline-block;
  276. width: 8px;
  277. height: 8px;
  278. position: relative;
  279. margin-right: 5px;
  280. vertical-align: middle;
  281. top: -2px;
  282. }
  283. .studCheckStatue1 {
  284. color: #0089fe;
  285. }
  286. .studCheckStatue1 text {
  287. background: #0089fe;
  288. }
  289. .studCheckStatue2 {
  290. color: #f2b60a;
  291. }
  292. .studCheckStatue2 text {
  293. background: #f2b60a;
  294. }
  295. .studCheckStatue3 {
  296. color: #e24545;
  297. }
  298. .studCheckStatue3 text {
  299. background: #e24545;
  300. }
  301. .studCheckStatue4 {
  302. color: #29cf41;
  303. }
  304. .studCheckStatue4 text {
  305. background: #29cf41;
  306. }
  307. .noHtml {
  308. height: 100%;
  309. line-height: 60px;
  310. text-align: center;
  311. font-size: 14px;
  312. }
  313. </style>