homePage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <template>
  2. <view>
  3. <view class="navigation">
  4. 启航教培管家·教师端
  5. </view>
  6. <!-- 课时信息 -->
  7. <view class="class-infos-box">
  8. <view class="title">
  9. <view class="campus">
  10. 青少年宫校区
  11. </view>
  12. <view class="cut">
  13. 切换校区
  14. <view class="img">
  15. <img src="../../../assets/img/riLine-exchange-line@1x.png" alt="">
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 详细信息 -->
  20. <view class="main">
  21. <view class="time">
  22. <!-- <view class="day">
  23. 今日
  24. </view> -->
  25. <view class="week" v-for="(item,index) in list" :key="index"
  26. :class="activeClass == index ? 'day' : ''" @click="activeClassClick(item,index)">{{item.name}}
  27. </view>
  28. <!-- <view class="month">
  29. 本月
  30. </view> -->
  31. </view>
  32. <view class="date" v-if="activeClass == 0">
  33. ({{day.replaceAll('-','.')}})
  34. </view>
  35. <view class="date" v-if="activeClass == 1">
  36. ({{weekStartDate.replaceAll('-','.')}}-{{weekEndDate.replaceAll('-','.')}})
  37. </view>
  38. <view class="date" v-if="activeClass == 2">
  39. ({{monthStartDate.replaceAll('-','.')}}-{{monthEndDate.replaceAll('-','.')}})
  40. </view>
  41. <view class="infos">
  42. <view class="infos-item">
  43. <view class="content">
  44. 9
  45. </view>
  46. <view class="infos-name">
  47. 收费课时
  48. </view>
  49. </view>
  50. <u-line color="#E5E7EA" direction="col" length="80" />
  51. <view class="infos-item">
  52. <view class="content">
  53. 9
  54. </view>
  55. <view class="infos-name">
  56. 赠送课时
  57. </view>
  58. </view>
  59. <u-line color="#E5E7EA" direction="col" length="80" />
  60. <view class="infos-item">
  61. <view class="content">
  62. 9
  63. </view>
  64. <view class="infos-name">
  65. 补课课时
  66. </view>
  67. </view>
  68. <view class="infos-item">
  69. <view class="content">
  70. 100
  71. </view>
  72. <view class="infos-name">
  73. 应到人次
  74. </view>
  75. </view>
  76. <u-line color="#E5E7EA" direction="col" length="80" />
  77. <view class="infos-item">
  78. <view class="content">
  79. 99
  80. </view>
  81. <view class="infos-name">
  82. 实到人次
  83. </view>
  84. </view>
  85. <u-line color="#E5E7EA" direction="col" length="80" />
  86. <view class="infos-item">
  87. <view class="content">
  88. 1
  89. </view>
  90. <view class="infos-name">
  91. 未到/请假
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 最近课程 -->
  98. <view class="course">
  99. <view class="title">
  100. <img src="../../../assets/img/riFill-calendar-todo-fill@1x.png" alt="">最近课程
  101. </view>
  102. <view class="course-infos">
  103. <view class="info-box" @click="gotoUrl('pages/teacher/callNames/classCall')">
  104. <view class="position today">
  105. </view>
  106. <view class="class-name">
  107. 周开琴书法班1
  108. </view>
  109. <view class="location-time">
  110. <view class="location">
  111. 4楼6教室
  112. </view>
  113. <view class="time">
  114. 09:30-10:45
  115. </view>
  116. </view>
  117. <view class="date">
  118. 2023.1.3
  119. </view>
  120. </view>
  121. <view class="info-box info-box2">
  122. <view class="position tomorrow">
  123. </view>
  124. <view class="class-name">
  125. 周开琴书法班2
  126. </view>
  127. <view class="location-time">
  128. <view class="location">
  129. 4楼6教室
  130. </view>
  131. <view class="time">
  132. 09:30-10:45
  133. </view>
  134. </view>
  135. <view class="date">
  136. 2023.1.3
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 我的应用 -->
  142. <view class="my-app">
  143. <view class="title">
  144. <img src="../../../assets/img/riFill-stack-fill@1x.png" alt="">我的应用
  145. </view>
  146. <view class="app-items">
  147. <view class="item" @click="gotoUrl('pages/teacher/message/messageNotification')">
  148. <view class="icon-box"
  149. style="background: linear-gradient(180deg, rgba(89,222,232,1) 1%,rgba(13,186,199,1) 100%)">
  150. <img src="../../../assets/img/riFill-notification-3-fill@1x.png" alt="">
  151. <view class="count">
  152. 99+
  153. </view>
  154. </view>
  155. <view class="text">
  156. 消息通知
  157. </view>
  158. </view>
  159. <view class="item" @click="gotoUrl('pages/teacher/myCourse/myCourse')">
  160. <view class="icon-box"
  161. style="background: linear-gradient(180deg, rgba(91,160,242,1) 1%,rgba(26,118,226,1) 100%);">
  162. <img src="../../../assets/img/riFill-calendar-2-fill@1x.png" alt="">
  163. </view>
  164. <view class="text">
  165. 我的课表
  166. </view>
  167. </view>
  168. <view class="item" @click="gotoUrl('pages/teacher/callNames/callNames')">
  169. <view class="icon-box"
  170. style="background: linear-gradient(180deg, rgba(255,189,96,1) 1%,rgba(255,150,0,1) 100%);">
  171. <img src="../../../assets/img/riFill-file-edit-fill@1x.png" alt="">
  172. </view>
  173. <view class="text">
  174. 点名签到
  175. </view>
  176. </view>
  177. <view class="item" @click="gotoUrl('pages/teacher/myClass/myClass')">
  178. <view class="icon-box"
  179. style="background: linear-gradient(180deg, rgba(169,147,255,1) 1%,rgba(129,97,255,1) 100%);">
  180. <img src="../../../assets/img/riFill-calendar-2-fill@1x.png" alt="">
  181. </view>
  182. <view class="text">
  183. 班级信息
  184. </view>
  185. </view>
  186. <view class="item">
  187. <view class="icon-box"
  188. style="background: linear-gradient(180deg, rgba(89,222,232,1) 1%,rgba(13,186,199,1) 100%);">
  189. <img src="../../../assets/img/riFill-quill-pen-fill@1x.png" alt="">
  190. </view>
  191. <view class="text">
  192. 学员点评
  193. </view>
  194. </view>
  195. <view class="item">
  196. <view class="icon-box"
  197. style="background: linear-gradient(180deg, rgba(255,189,96,1) 1%,rgba(255,150,0,1) 100%);">
  198. <img src="../../../assets/img/riFill-star-fill@1x.png" alt="">
  199. </view>
  200. <view class="text">
  201. 学员秀
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. <Tabbar :current="0" ref="tabbarMain"></Tabbar>
  207. </view>
  208. </template>
  209. <script>
  210. import Tabbar from '@/components/Tabbar.vue'
  211. export default {
  212. components: {
  213. Tabbar
  214. },
  215. data() {
  216. return {
  217. list: [{
  218. name: '今日'
  219. }, {
  220. name: '本周'
  221. }, {
  222. name: '本月',
  223. }],
  224. activeClass: 0,
  225. month: '',
  226. day: '',
  227. weekStartDate: '',
  228. weekEndDate: '',
  229. monthStartDate: '',
  230. monthEndDate: '',
  231. }
  232. },
  233. onLoad() {
  234. let date = new Date() //当前日期
  235. let year = date.getFullYear();//当前年
  236. let month = date.getMonth()+1;//当前月
  237. let day = date.getDate(); //当天
  238. let mydate = new Date(year,month-1,day);
  239. let weekday = mydate.getDay();
  240. let weekDate1 = new Date(year, month - 1, day + 1 - weekday);
  241. let weekDate2 = new Date(year, month - 1, day + 7 - weekday);
  242. this.day = this.getFormatDate(date,true);
  243. this.weekStartDate = this.getFormatDate(weekDate1,true);
  244. this.weekEndDate = this.getFormatDate(weekDate2,true);
  245. this.monthStartDate = this.getFormatDate(date,false) + "-" + '01';
  246. let days = new Date(year, month + 1, 0).getDate();
  247. this.monthEndDate = this.getFormatDate(date,false) + "-" + days;
  248. },
  249. methods: {
  250. getFormatDate(date,m) {
  251. let myyear = date.getFullYear();
  252. let mymonth = date.getMonth()+1;
  253. let myweekday = date.getDate();
  254. if(mymonth < 10){
  255. mymonth = "0" + mymonth;
  256. }
  257. if(myweekday < 10){
  258. myweekday = "0" + myweekday;
  259. }
  260. if(m) {
  261. return (myyear + "-" + mymonth + "-" + myweekday);
  262. }else {
  263. return (myyear + "-" + mymonth);
  264. }
  265. },
  266. activeClassClick(item,index) {
  267. this.activeClass = index;
  268. if (this.activeClass == 0) {
  269. console.log(this.day)
  270. } else if (this.activeClass == 1) {
  271. console.log(this.weekStartDate)
  272. console.log(this.weekEndDate)
  273. } else {
  274. console.log(this.monthStartDate)
  275. console.log(this.monthEndDate)
  276. }
  277. },
  278. }
  279. }
  280. </script>
  281. <style lang="scss" scoped>
  282. .navigation {
  283. height: 44px;
  284. line-height: 44px;
  285. background-color: rgba(13, 186, 199, 1);
  286. color: #ffffff;
  287. padding-left: 16px;
  288. font-size: 20px
  289. }
  290. // 课时信息
  291. /deep/.u-line {
  292. transform: scaleX(1) !important;
  293. }
  294. .class-infos-box {
  295. background: linear-gradient(#0DBAC7, #F4F6F6);
  296. .title {
  297. padding: 12px 16px;
  298. display: flex;
  299. justify-content: space-between;
  300. color: #fff;
  301. .cut {
  302. height: 16px;
  303. font-size: 14px;
  304. .img {
  305. display: inline-block;
  306. img {
  307. vertical-align: middle;
  308. }
  309. }
  310. }
  311. }
  312. // 详细信息
  313. .main {
  314. width: 91.4%;
  315. border-radius: 12px;
  316. padding-top: 22px;
  317. background-color: rgba(255, 255, 255, 1);
  318. text-align: center;
  319. margin: auto;
  320. }
  321. .time {
  322. width: 93%;
  323. margin: auto;
  324. display: flex;
  325. justify-content: space-between;
  326. height: 32px;
  327. line-height: 32px;
  328. border-radius: 50px;
  329. background-color: rgba(240, 244, 250, 1);
  330. color: #777777;
  331. text-align: center;
  332. .day {
  333. color: #fff9;
  334. background-color: #0DBAC7;
  335. border-radius: 50px;
  336. }
  337. .day,
  338. .week,
  339. .month {
  340. width: 33.3%;
  341. }
  342. }
  343. .date {
  344. height: 17px;
  345. color: rgba(119, 119, 119, 1);
  346. font-size: 12px;
  347. font-family: PingFangSC-regular;
  348. margin: 18px 0;
  349. }
  350. .infos {
  351. display: flex;
  352. flex-wrap: wrap;
  353. .infos-item {
  354. width: 33%;
  355. margin-bottom: 40rpx;
  356. .content {
  357. height: 28px;
  358. color: rgba(13, 186, 199, 1);
  359. font-size: 20px;
  360. text-align: center;
  361. font-family: PingFangSC-medium;
  362. }
  363. .infos-name {
  364. height: 20px;
  365. color: rgba(119, 119, 119, 1);
  366. }
  367. }
  368. }
  369. }
  370. // 最近课程
  371. .course {
  372. margin: auto;
  373. margin-top: 16px;
  374. width: 91.4%;
  375. .title {
  376. height: 20px;
  377. line-height: 20px;
  378. margin-bottom: 14px;
  379. color: #333333;
  380. font-weight: bold;
  381. img {
  382. vertical-align: middle;
  383. margin-right: 8px;
  384. }
  385. }
  386. .course-infos {
  387. display: flex;
  388. justify-content: space-between;
  389. .info-box {
  390. border-top: 2px solid #0DBAC7;
  391. background: linear-gradient(to right, #E4F8E3, #dcf5f6);
  392. width: 47.8%;
  393. padding: 24rpx 0 14rpx 24rpx;
  394. box-shadow: 2px 2px 2px 2px #e7e9e9;
  395. border-radius: 8px;
  396. position: relative;
  397. .position {
  398. width: 48rpx;
  399. height: 40rpx;
  400. line-height: 40rpx;
  401. position: absolute;
  402. top: 0;
  403. right: 16rpx;
  404. text-align: center;
  405. border-radius: 0px 0px 4px 4px;
  406. font-size: 12px;
  407. color: #fff;
  408. }
  409. .today {
  410. background-color: #0DBAC7;
  411. }
  412. .tomorrow {
  413. background-color: #0086FF;
  414. }
  415. .class-name {
  416. height: 20px;
  417. color: rgba(51, 51, 51, 1);
  418. font-size: 14px;
  419. }
  420. .location-time {
  421. margin-top: 8rpx;
  422. display: flex;
  423. justify-content: start;
  424. color: rgba(119, 119, 119, 1);
  425. font-size: 12px;
  426. .time {
  427. margin-left: 8rpx;
  428. }
  429. }
  430. .date {
  431. color: rgba(119, 119, 119, 1);
  432. font-size: 12px;
  433. margin-top: 8rpx;
  434. }
  435. }
  436. .info-box2 {
  437. border-top: 2px solid #0086FF;
  438. }
  439. }
  440. }
  441. // 我的应用
  442. .my-app {
  443. margin: auto;
  444. margin-top: 16px;
  445. padding: 16px;
  446. background-color: #fff;
  447. margin-bottom: 300rpx;
  448. .title {
  449. height: 20px;
  450. line-height: 20px;
  451. margin-bottom: 14px;
  452. font-weight: bold;
  453. color: #333333;
  454. img {
  455. vertical-align: middle;
  456. margin-right: 8px;
  457. }
  458. }
  459. .app-items {
  460. display: flex;
  461. flex-wrap: wrap;
  462. .item {
  463. width: 25%;
  464. display: flex;
  465. flex-direction: column;
  466. align-items: center;
  467. margin-bottom: 40rpx;
  468. .icon-box {
  469. width: 40px;
  470. height: 40px;
  471. text-align: center;
  472. border-radius: 8px;
  473. position: relative;
  474. .count {
  475. width: 28px;
  476. height: 16px;
  477. line-height: 16px;
  478. border-radius: 50px;
  479. background-color: rgba(238, 49, 56, 1);
  480. color: rgba(255, 255, 255, 1);
  481. font-size: 10px;
  482. text-align: center;
  483. position: absolute;
  484. top: -16rpx;
  485. right: -28rpx;
  486. }
  487. img {
  488. margin: 8px 0;
  489. }
  490. }
  491. .text {
  492. margin-top: 16rpx;
  493. }
  494. }
  495. }
  496. }
  497. </style>