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.
 
 
 
 
 
 

322 lines
6.8 KiB

  1. <template>
  2. <view class="page">
  3. <view class="timeTable_sec1">
  4. <view class="tSec1Box" id="semester2">
  5. <image src="@/static/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. height: 15px;
  201. margin-right: 2px;
  202. }
  203. .tSec1Box text:after {
  204. display: none;
  205. }
  206. .timeTable_sec2 {
  207. margin-bottom: 30px;
  208. }
  209. .tSec2Top2 {
  210. padding: 0 12px;
  211. background: #0075c4;
  212. height: 55px;
  213. text-align: center;
  214. overflow: hidden;
  215. }
  216. .tSec2Top2 view {
  217. width: 14.285714%;
  218. float: left;
  219. line-height: 18px;
  220. padding: 9px 0 9px;
  221. color: #fff;
  222. font-size: 13px;
  223. border-right: 1px solid #1084d2;
  224. border-top: 1px solid #1084d2;
  225. }
  226. .tSec2Top2 view:first-child {
  227. border-left: 1px solid #1084d2;
  228. }
  229. .tSec2Top2 view.active {
  230. color: #0075c4;
  231. background: #fff;
  232. border-color: #fff;
  233. }
  234. .tSec2Top2 view text {
  235. display: block;
  236. }
  237. .tSec2Top2 view text:first-child {
  238. letter-spacing: 2px;
  239. text-transform: uppercase;
  240. }
  241. .tSec2Box2 {
  242. background: #fff;
  243. }
  244. .studCheckLi {
  245. border-bottom: 1px solid #d5eaf7;
  246. padding: 8px 12px;
  247. font-size: 15px;
  248. }
  249. .studCheckT {
  250. font-size: 15px;
  251. color: #6e6e6e;
  252. }
  253. .studCheckT image {
  254. width: 11px;
  255. position: relative;
  256. margin-right: 5px;
  257. }
  258. .studCheckTxt {
  259. font-size: 13px;
  260. color: #9d9e9e;
  261. margin: 7px 0;
  262. }
  263. .studCheckTxt text {
  264. // margin: 0 30px;
  265. }
  266. .studCheckTxt image {
  267. width: 12px;
  268. position: relative;
  269. margin-right: 3px;
  270. top: 1px;
  271. }
  272. .studCheckStatue {
  273. font-size: 13px;
  274. }
  275. .studCheckStatue text {
  276. display: inline-block;
  277. width: 8px;
  278. height: 8px;
  279. position: relative;
  280. margin-right: 5px;
  281. vertical-align: middle;
  282. top: -2px;
  283. }
  284. .studCheckStatue1 {
  285. color: #0089fe;
  286. }
  287. .studCheckStatue1 text {
  288. background: #0089fe;
  289. }
  290. .studCheckStatue2 {
  291. color: #f2b60a;
  292. }
  293. .studCheckStatue2 text {
  294. background: #f2b60a;
  295. }
  296. .studCheckStatue3 {
  297. color: #e24545;
  298. }
  299. .studCheckStatue3 text {
  300. background: #e24545;
  301. }
  302. .studCheckStatue4 {
  303. color: #29cf41;
  304. }
  305. .studCheckStatue4 text {
  306. background: #29cf41;
  307. }
  308. .noHtml {
  309. height: 100%;
  310. line-height: 60px;
  311. text-align: center;
  312. font-size: 14px;
  313. }
  314. </style>