選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

354 行
7.3 KiB

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