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.
 
 
 
 
 
 

352 lines
7.2 KiB

  1. <template>
  2. <view class="page">
  3. <div class="timeTable_sec1">
  4. <div class="tSec1Box" id="semester">
  5. <image src="@/static/timeT1-1.png" mode="widthFix"></image>
  6. <span>2019年上半学期</span>
  7. </div>
  8. <view class="tSec1Box" id="weekTime">
  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. </div>
  16. <div class="timeTable_sec2">
  17. <view class="tSec2Top">
  18. <view class="tSec2TopLi" 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. <div class="tSec2Box">
  24. <view class="tSec2Con" v-for="(items, i) in dataArr" :key="items.num" v-show="i == num">
  25. <view class="tSec2List">
  26. <view v-if="items.lessonData.length <= 0" class="tSec2ListLi">
  27. <view class="noHtml">该时间段没有考试</view>
  28. </view>
  29. <view v-if="items.lessonData.length > 0">
  30. <view class="tSec2ListLi" v-for="(k, j) in items.lessonData" :key="j">
  31. <view class="tSec2ListL">第 {{ k.sectionTime }} 节</view>
  32. <view class="tSec2ListR">
  33. <view class="tSec2ListBox">
  34. <view class="tSec2ListT">{{ k.LessonName }}</view>
  35. <view class="tSec2ListT">{{ k.ClassName }}</view>
  36. <view class="tSec2ListTxt">
  37. <text class="text-xxl cuIcon cuIcon-profile"></text>
  38. {{ k.EmpName }}
  39. </view>
  40. </view>
  41. <view class="tSec2Location">
  42. <text class="text-xxl cuIcon cuIcon-location"></text>
  43. {{ k.ClassroomName }}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </div>
  51. </div>
  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. user: null,
  62. weekDayTime: 0,
  63. todayWeek: {},
  64. dataArr: [],
  65. weekArr: [
  66. {
  67. en: 'MON',
  68. cn: '星期一'
  69. },
  70. {
  71. en: 'TUE',
  72. cn: '星期二'
  73. },
  74. {
  75. en: 'WED',
  76. cn: '星期三'
  77. },
  78. {
  79. en: 'THU',
  80. cn: '星期四'
  81. },
  82. {
  83. en: 'FRI',
  84. cn: '星期五'
  85. },
  86. {
  87. en: 'SAT',
  88. cn: '星期六'
  89. },
  90. {
  91. en: 'SUN',
  92. cn: '星期日'
  93. }
  94. ]
  95. };
  96. },
  97. methods: {
  98. init() {
  99. let _this = this;
  100. _this.todayWeek = common.weekday();
  101. _this.semester = common.judgeDate();
  102. _this.weekDayTime = 7 * common.oneDayTime();
  103. _this.user = _this.GET_GLOBAL('loginUser');
  104. _this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  105. },
  106. loadData(start, end) {
  107. let param = { startTime: start, endTime: end };
  108. // let param = { StartDate: '2018-11-05', EndDate: '2018-11-11' };
  109. let _this = this;
  110. _this.LOADING('加载数据中…');
  111. _this.HTTP_GET('arrangeExam/list', param, '加载数据时出错').then(res => {
  112. this.HIDE_LOADING();
  113. console.log(res);
  114. _this.ProcessingData(res);
  115. });
  116. },
  117. liTap(ind) {
  118. this.num = ind;
  119. },
  120. timeTap(num) {
  121. let _this = this;
  122. if (num == 1) {
  123. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime - _this.weekDayTime;
  124. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime - _this.weekDayTime;
  125. } else {
  126. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime + _this.weekDayTime;
  127. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime + _this.weekDayTime;
  128. }
  129. _this.num = 0;
  130. _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  131. _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  132. _this.semester = common.judgeDate(_this.todayWeek.SundayTime);
  133. _this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  134. },
  135. ProcessingData(data) {
  136. let dataM = [
  137. {
  138. weekTime: 1,
  139. num: Math.floor(Math.random() * 100000000),
  140. lessonData: []
  141. },
  142. {
  143. weekTime: 2,
  144. num: Math.floor(Math.random() * 100000000),
  145. lessonData: []
  146. },
  147. {
  148. weekTime: 3,
  149. num: Math.floor(Math.random() * 100000000),
  150. lessonData: []
  151. },
  152. {
  153. weekTime: 4,
  154. num: Math.floor(Math.random() * 100000000),
  155. lessonData: []
  156. },
  157. {
  158. weekTime: 5,
  159. num: Math.floor(Math.random() * 100000000),
  160. lessonData: []
  161. },
  162. {
  163. weekTime: 6,
  164. num: Math.floor(Math.random() * 100000000),
  165. lessonData: []
  166. },
  167. {
  168. weekTime: 7,
  169. num: Math.floor(Math.random() * 100000000),
  170. lessonData: []
  171. }
  172. ];
  173. data.forEach((n, i) => {
  174. n.sectionTime = n.LessonTime.slice(1);
  175. dataM.forEach((k, j) => {
  176. if (k.weekTime == n.LessonTime.slice(0, 1)) {
  177. k.lessonData.push(n);
  178. }
  179. });
  180. });
  181. dataM.forEach((n, i) => {
  182. n.lessonData.sort(common.compare('sectionTime'));
  183. });
  184. this.dataArr = dataM;
  185. }
  186. },
  187. created() {
  188. this.init();
  189. }
  190. };
  191. </script>
  192. <style lang="less" scoped>
  193. .page {
  194. background: #fff;
  195. }
  196. .timeTable_sec1 {
  197. padding: 14px 12px;
  198. text-align: center;
  199. background: #0075c4;
  200. color: #94d4ff;
  201. font-size: 0;
  202. }
  203. .tSec1Box > * {
  204. display: inline-block;
  205. vertical-align: middle;
  206. }
  207. .tSec1Line {
  208. height: 13px;
  209. width: 1px;
  210. background: #94d4ff;
  211. margin: 0 10px;
  212. }
  213. .tSec1Box {
  214. font-size: 15px;
  215. overflow: hidden;
  216. white-space: nowrap;
  217. text-overflow: ellipsis;
  218. }
  219. #semester {
  220. margin-bottom: 10px;
  221. }
  222. #weekTime {
  223. }
  224. #weekTime text {
  225. margin: 0 10px;
  226. }
  227. .tSec1Box > text {
  228. width: auto;
  229. text-align: center;
  230. line-height: 22px;
  231. }
  232. .tSec1Box image {
  233. width: 15px;
  234. margin-right: 2px;
  235. height: 15px;
  236. }
  237. .tSec1Box text:after {
  238. display: none;
  239. }
  240. .timeTable_sec2 {
  241. margin-bottom: 30px;
  242. }
  243. .tSec2Top {
  244. padding: 0 12px;
  245. background: #0075c4;
  246. height: 55px;
  247. text-align: center;
  248. overflow: hidden;
  249. }
  250. .tSec2TopLi {
  251. width: 14.285714%;
  252. float: left;
  253. line-height: 18px;
  254. padding: 9px 0 9px;
  255. color: #fff;
  256. font-size: 13px;
  257. border-right: 1px solid #1084d2;
  258. border-top: 1px solid #1084d2;
  259. }
  260. .tSec2TopLi:first-child {
  261. border-left: 1px solid #1084d2;
  262. }
  263. .tSec2TopLi.active {
  264. color: #0075c4;
  265. background: #fff;
  266. border-color: #fff;
  267. }
  268. .tSec2TopLi text {
  269. display: block;
  270. }
  271. .tSec2TopLi text:first-child {
  272. letter-spacing: 2px;
  273. text-transform: uppercase;
  274. }
  275. .tSec2Box {
  276. padding: 0 12px 10px;
  277. margin-top: 10px;
  278. }
  279. .tSec2Con {
  280. border-left: 1px solid #d5eaf7;
  281. border-right: 1px solid #d5eaf7;
  282. border-top: 1px solid #d5eaf7;
  283. // display: none;
  284. }
  285. .tSec2Con:first-child {
  286. display: block;
  287. }
  288. .tSec2List {
  289. margin-top: 10px;
  290. }
  291. .tSec2List:first-child {
  292. margin-top: 0;
  293. }
  294. .tSec2ListLi {
  295. border-bottom: 1px solid #d5eaf7;
  296. overflow: hidden;
  297. height: 80px;
  298. }
  299. .tSec2ListL {
  300. float: left;
  301. background: #e8f6ff;
  302. height: 100%;
  303. width: 25%;
  304. text-align: center;
  305. line-height: 36px;
  306. padding: 11px 0;
  307. font-size: 14px;
  308. color: #646464;
  309. }
  310. .tSec2ListR {
  311. float: left;
  312. width: 75%;
  313. height: 100%;
  314. line-height: 18px;
  315. padding: 4px 0;
  316. overflow: hidden;
  317. }
  318. .tSec2ListBox {
  319. width: 70%;
  320. float: left;
  321. padding-left: 5px;
  322. }
  323. .tSec2ListT {
  324. color: #3e3e3e;
  325. font-size: 15px;
  326. margin: 5px 0;
  327. overflow: hidden;
  328. white-space: nowrap;
  329. text-overflow: ellipsis;
  330. }
  331. .tSec2ListTxt {
  332. color: #888888;
  333. font-size: 13px;
  334. }
  335. .tSec2Location {
  336. width: 30%;
  337. float: left;
  338. line-height: 44px;
  339. font-size: 13px;
  340. color: #888888;
  341. }
  342. .noHtml {
  343. height: 100%;
  344. line-height: 60px;
  345. text-align: center;
  346. font-size: 14px;
  347. }
  348. </style>