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.

list.vue 7.2 KiB

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