AdaptiveTrainingIndex.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!--
  2. * @Description: 适应性培训
  3. * @Author: 空白格
  4. * @Date: 2022-08-12 15:23:44
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-08-12 17:57:25
  7. * @FilePath: \veterans_client_web\src\views\AdaptiveTraining\AdaptiveTrainingIndex.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class="app-main adaptive-training">
  12. <BannerBreadcrumb title="适应性培训" />
  13. <div class="app-main-box">
  14. <!-- banner -->
  15. <div class="adaptive-training-banner">
  16. <div class="adaptive-training-banner-title">适应性培训</div>
  17. <div class="adaptive-training-banner-subtitle">
  18. -退役军人思想政治教育 -退役军人就业创业指导
  19. </div>
  20. <div class="adaptive-training-banner-describe">
  21. 适应性培训课程包含思想政治教育、法律法规政策介绍,就业创业指导、求职技巧指导、服务项目指引等,需看完线上课程后完成适应性培训。
  22. </div>
  23. </div>
  24. <!-- 统计 -->
  25. <div class="adaptive-training-statistics">
  26. <div class="adaptive-training-statistics-box"></div>
  27. <div class="atsb-tab">
  28. <div
  29. class="atsb-tab-item"
  30. v-for="(item, index) in tabList"
  31. :key="index"
  32. :class="{ 'atsb-tab-active': tabCur === item.value }"
  33. @click="tabClick(item)"
  34. >
  35. {{ item.label }}
  36. </div>
  37. </div>
  38. <div class="atsb-total">
  39. <div class="atsb-total-item">
  40. <p>已看课程</p>
  41. <p><span>8</span>个</p>
  42. </div>
  43. <div class="atsb-total-item">
  44. <p>还需观看</p>
  45. <p><span>8</span>个</p>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- 列表 -->
  51. <div class="app-main-box-content adaptive-training-list" v-loading="loading" v-if="onlineClassList.length">
  52. <el-row :gutter="16">
  53. <el-col
  54. :xs="24"
  55. :sm="24"
  56. :md="12"
  57. :lg="12"
  58. :xl="12"
  59. v-for="(item, index) in onlineClassList"
  60. :key="index"
  61. >
  62. <div class="adaptive-training-list-item">
  63. <div class="left">
  64. <el-image :src="item.titleImg" class="image" fit="cover">
  65. <div slot="placeholder" class="image-slot">
  66. 加载中<span class="dot">...</span>
  67. </div>
  68. </el-image>
  69. </div>
  70. <div class="right">
  71. <div class="name">{{ item.adaptName }}</div>
  72. <div class="total">共{{ item.amount }}节课,已学完{{ item.finishCount }}节课,学习进度{{ item.finishPercent || 0 }}%</div>
  73. </div>
  74. </div>
  75. </el-col
  76. >
  77. </el-row>
  78. <div class="pagination" v-if="total">
  79. <el-pagination
  80. background
  81. layout="prev, pager, next"
  82. :page-size="queryParams.pageSize"
  83. :total="total"
  84. @current-change="currentChange"
  85. />
  86. </div>
  87. </div>
  88. <el-empty description="列表数据为空" v-else></el-empty>
  89. </div>
  90. </div>
  91. </template>
  92. <script>
  93. import BannerBreadcrumb from "@/components/BannerBreadcrumb";
  94. import { getTrainingList } from "@/api/AdaptiveTraining";
  95. export default {
  96. name: "AdaptiveTrainingIndex",
  97. components: {
  98. BannerBreadcrumb,
  99. },
  100. data() {
  101. return {
  102. tabCur: 1,
  103. tabList: [
  104. { label: "适应性培训", value: 1 },
  105. { label: "线下培训", value: 2 },
  106. ],
  107. queryParams: {
  108. pageNum: 1,
  109. pageSize: 8,
  110. },
  111. total: 0,
  112. onlineClassList: [],
  113. loading: false
  114. };
  115. },
  116. created() {
  117. this.getOnlineList();
  118. },
  119. methods: {
  120. tabClick(item) {
  121. this.tabCur = item.value;
  122. },
  123. /**
  124. * 获取适应性培训
  125. * @date 2022-08-12
  126. * @returns {any}
  127. */
  128. getOnlineList() {
  129. this.loading = true
  130. getTrainingList(this.queryParams).then((res) => {
  131. this.onlineClassList = res.rows;
  132. this.total = Number(res.total);
  133. this.loading = false
  134. });
  135. },
  136. /**
  137. * 分页触发
  138. * @date 2022-08-12
  139. * @param {any} page
  140. * @returns {any}
  141. */
  142. currentChange(page) {
  143. this.queryParams.pageNum = page;
  144. this.getOnlineList()
  145. },
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .adaptive-training {
  151. padding-bottom: 30px;
  152. &-banner {
  153. width: 100%;
  154. height: 300px;
  155. background: url("./../../assets/images/adaptive-training-banner.png")
  156. no-repeat center center;
  157. background-size: 100% 100%;
  158. &-title {
  159. text-align: center;
  160. position: relative;
  161. font-size: 40px;
  162. padding-top: 20px;
  163. width: 300px;
  164. margin: 0 auto;
  165. text-align: justify;
  166. text-align-last: justify;
  167. color: #fff;
  168. &::before {
  169. content: "";
  170. display: block;
  171. width: 26px;
  172. height: 26px;
  173. background: url("./../../assets/images/star-icon.svg") no-repeat center
  174. center;
  175. background-size: 100% 100%;
  176. position: absolute;
  177. left: -30px;
  178. top: 30px;
  179. }
  180. }
  181. &-subtitle {
  182. width: 90%;
  183. margin: 20px auto;
  184. padding: 20px 0;
  185. text-align: center;
  186. color: #fff;
  187. font-size: 22px;
  188. font-family: SourceHanSansCN;
  189. border-top: 1px solid #fff;
  190. border-bottom: 1px solid #fff;
  191. }
  192. &-describe {
  193. width: 90%;
  194. height: 60px;
  195. line-height: 60px;
  196. text-align: center;
  197. margin: 28px auto 0;
  198. background: #4d3be0;
  199. opacity: 0.8;
  200. border: solid 1px #fff;
  201. color: #fff;
  202. font-size: 14px;
  203. }
  204. }
  205. &-statistics {
  206. background-color: #fff;
  207. height: 270px;
  208. &-box {
  209. height: 270px;
  210. background-image: url(./../../assets/images/adaptive-training-bg.png);
  211. background-repeat: no-repeat;
  212. background-position: top center;
  213. background-size: 100% 196px;
  214. .atsb-tab {
  215. display: flex;
  216. width: 400px;
  217. margin: 0 auto;
  218. justify-content: space-between;
  219. padding-top: 20px;
  220. margin-bottom: 18px;
  221. &-item {
  222. font-size: 30px;
  223. color: #000;
  224. border-bottom: 3px solid #fff;
  225. padding-bottom: 10px;
  226. cursor: pointer;
  227. &:hover {
  228. color: #335ceb;
  229. border-bottom: 3px solid #335ceb;
  230. }
  231. }
  232. &-active {
  233. color: #335ceb;
  234. border-bottom: 3px solid #335ceb;
  235. }
  236. }
  237. .atsb-total {
  238. width: calc(100% - 80px);
  239. height: 140px;
  240. background: #fff;
  241. margin: 0 auto;
  242. box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.11);
  243. border-radius: 10px;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. &-item {
  248. text-align: center;
  249. &:first-child {
  250. margin-right: 15%;
  251. }
  252. p {
  253. color: #656565;
  254. font-size: 22px;
  255. span {
  256. color: #505050;
  257. font-size: 40px;
  258. }
  259. &:last-child {
  260. font-size: 20px;
  261. margin-top: 10px;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. }
  268. &-list {
  269. margin-top: 10px;
  270. &-item {
  271. height: 91px;
  272. display: flex;
  273. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  274. padding: 18px 15px;
  275. cursor: pointer;
  276. .left {
  277. width: 122px;
  278. height: 89px;
  279. margin-right: 10px;
  280. .image {
  281. width: 100%;
  282. height: 100%;
  283. border-radius: 4px;
  284. border: solid 1px #e0e0e0;
  285. }
  286. }
  287. .right {
  288. display: flex;
  289. flex-direction: column;
  290. .name {
  291. font-size: 20px;
  292. color: #424242;
  293. line-height: 30px;
  294. margin-bottom: 20px;
  295. }
  296. .total {
  297. font-size: 14px;
  298. color: #6F6F6F;
  299. padding-left: 10px;
  300. }
  301. }
  302. }
  303. .pagination {
  304. text-align: center;
  305. margin-top: 20px;
  306. :deep(.el-pager .active) {
  307. background-color: #ff3939;
  308. }
  309. :deep(.el-pagination.is-background .el-pager li:not(.disabled).active) {
  310. background-color: #ff3939;
  311. }
  312. }
  313. }
  314. }
  315. </style>