index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <view class="learnings">
  3. <u-navbar :is-back="false" title="学习中心" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  4. <view class="slot-wrap">
  5. <image src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <u-line color="#D6D6DB" />
  9. <view class="contents">
  10. <view class="diatance">
  11. <image class="clock" src="/static/learn/clock.png" mode=""></image>
  12. <text>一级建造师,距离考试还有123天</text>
  13. </view>
  14. <!-- 有学习的课程 -->
  15. <view class="had_courses">
  16. <!-- 直播 -->
  17. <view class="lives">
  18. </view>
  19. <!-- 我的课程 -->
  20. <view class="my_courses">
  21. <text class="titles">我的课程</text>
  22. <view v-for="(item, index) in courseLists" :key="index" class="course_item">
  23. <view class="lefts">
  24. <image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode=""></image>
  25. <view class="live_icon">直播</view>
  26. </view>
  27. <view class="rights">
  28. <view>
  29. <view class="cou_titles">{{ item.goodsName }}</view>
  30. <view v-if="item.serviceStartTime && item.serviceEndTime" class="learn_ranges">
  31. <image class="l_range" src="/static/learn/learn_range.png"></image>
  32. 学习周期:
  33. <text class="l_time">{{ item.serviceStartTime | formate('yyyy.mm.dd') }} - {{ item.serviceEndTime | formate('yyyy.mm.dd') }}</text>
  34. <!-- <text class="l_time">{{ $method.formate(item.studyStartTime,'yyyy.mm.dd') }} - {{ $method.formate(item.studyStartTime,'yyyy.mm.dd') }}</text> -->
  35. </view>
  36. </view>
  37. <view class="learn_progress">
  38. <view class="progress_up">
  39. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  40. 学习进度:{{ item.stuAllNum+item.recordNum }}/{{ item.secAllNum+item.examNum }}
  41. </view>
  42. <view class="progress_down">
  43. <view class="progress_bar" style="width: 50%;">
  44. <u-line-progress :showText="false" height="22" active-color="#ff9900" :show-percent="false"
  45. :percent="((item.stuAllNum+item.recordNum) / (item.secAllNum+item.examNum)) * 100"></u-line-progress>
  46. </view>
  47. <view class="enter_into" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">进入学习</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 我的题库 -->
  54. <view class="my_courses">
  55. <text class="titles">我的题库</text>
  56. <view class="bottoms">
  57. <navigator hover-class="none" url="/pages2/subject/collect">
  58. <view class="item collect">
  59. <view class="text">收藏集<u-icon name="arrow-right"></u-icon></view>
  60. <image class="img" src="/static/questionBank_collect.png"></image>
  61. </view>
  62. </navigator>
  63. <view class="item list">
  64. <navigator hover-class="none" url="/pages2/bank/question_record">
  65. <view class="list-in">
  66. <image class="img" src="/static/questionBank_record.png" ></image>
  67. <view class="text">
  68. 做题记录 <u-icon name="arrow-right"></u-icon>
  69. </view>
  70. </view>
  71. </navigator>
  72. <navigator hover-class="none" url="/pages2/subject/wrong">
  73. <view class="list-in">
  74. <image class="img" src="/static/questionBank_wrong.png"></image>
  75. <view class="text">
  76. 错题集 <u-icon name="arrow-right"></u-icon>
  77. </view>
  78. </view>
  79. </navigator>
  80. </view>
  81. </view>
  82. <view v-for="(item, indexq) in questionLists" :key="indexq" class="course_item">
  83. <view class="lefts">
  84. <image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode=""></image>
  85. <!-- <view class="live_icon">直播</view> -->
  86. </view>
  87. <view class="rights">
  88. <view>
  89. <view class="cou_titles">{{ item.goodsName }}</view>
  90. <view v-if="item.serviceStartTime && item.serviceEndTime" class="learn_ranges">
  91. <image class="l_range" src="/static/learn/learn_range.png"></image>
  92. 学习周期:
  93. <text class="l_time">{{ item.serviceStartTime | formate('yyyy.mm.dd') }} - {{ item.serviceEndTime | formate('yyyy.mm.dd') }}</text>
  94. </view>
  95. </view>
  96. <view class="learn_progress">
  97. <view class="progress_up">
  98. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  99. 学习进度:{{item.doNum}}/{{item.totalNum}}
  100. </view>
  101. <view class="progress_down">
  102. <view class="progress_bar" style="width: 50%;">
  103. <u-line-progress :show-percent="false" height="22" active-color="#007AFF" :percent="(item.doNum/item.totalNum)*100"></u-line-progress>
  104. </view>
  105. <view class="enter_into">进入学习</view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 没有学习的课程 -->
  113. <view v-if="false" class="no_datas">
  114. <image class="courses" src="/static/learn/no_course.png" mode=""></image>
  115. <view class="no_learns">您目前没有可学习的课程</view>
  116. <view class="choose" @click="toChoose()">立即去选购</view>
  117. </view>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. export default {
  123. data() {
  124. return {
  125. paramC: {
  126. pageNum: 1,
  127. pageSize: 50
  128. },
  129. activeItem: {},
  130. sysTime: 0,
  131. // totalC: 0,
  132. courseLists: [],
  133. questionLists: [], // 题库
  134. paramQ: {
  135. pageNum: 1,
  136. pageSize: 50
  137. },
  138. // totalQ: 0,
  139. }
  140. },
  141. onLoad(option) {
  142. this.getcourseList()
  143. this.getlistQuestion()
  144. },
  145. onShow() {
  146. console.log('sfsdg', this.$method)
  147. },
  148. methods: {
  149. toChoose() {
  150. uni.switchTab({
  151. url:'/pages/course/index'
  152. })
  153. },
  154. getcourseList() {
  155. this.$api.courseGoodsList(this.paramC).then(res => {
  156. if (res.data.code == 200) {
  157. this.courseLists = res.data.rows || []
  158. }
  159. })
  160. },
  161. getlistQuestion() {
  162. this.$api.listGoodsUserQuestion(this.paramQ).then(res => {
  163. if (res.data.code == 200) {
  164. this.questionLists = res.data.rows || []
  165. }
  166. })
  167. },
  168. async studyIn(v, i, item, index) {
  169. this.activeItem = item;
  170. if (item.interfaceAccountId > 0) { //学习账号已开通
  171. if (item.learnStatus == 1) { //跳转第三方h5
  172. // this.showMark = true;
  173. uni.navigateTo({
  174. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`
  175. })
  176. return;
  177. // uni.navigateTo({
  178. // url:'/pages/webview/index?url='+item.officialLearningUrl
  179. // })
  180. // return;
  181. } else {
  182. uni.showModal({
  183. showCancel: false,
  184. content: '您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!'
  185. });
  186. return;
  187. }
  188. return;
  189. }
  190. if (item.serviceStartTime && (this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime)) {
  191. uni.showToast({
  192. icon: 'none',
  193. title: '不在学习服务期,不能进入学习'
  194. })
  195. return;
  196. }
  197. if ((item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this
  198. .sysTime >= item.classEndTime)) {
  199. uni.showToast({
  200. icon: 'none',
  201. title: '不在班级有效期,不能进入学习'
  202. })
  203. return
  204. }
  205. if (item.learningStatus == 2) {
  206. uni.showToast({
  207. icon: 'none',
  208. title: '开放学习时间待定,不能进入学习'
  209. })
  210. return
  211. }
  212. if (item.classStatus == 0) {
  213. uni.showToast({
  214. icon: 'none',
  215. title: '尚未开班,不能进入学习'
  216. })
  217. return
  218. }
  219. console.log(this.sysTime, item.learningTimeStart)
  220. console.log(this.sysTime < item.learningTimeStart)
  221. if (item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
  222. uni.showToast({
  223. icon: 'none',
  224. title: '不在开放学习时间,不能进入学习'
  225. })
  226. return;
  227. }
  228. var confirmDetail = true;
  229. if (item.educationName == '继续教育') {
  230. if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  231. confirmDetail = await this.userConfirmInfoDetail()
  232. }
  233. }
  234. if(!confirmDetail) {
  235. return;
  236. }
  237. // //内部系统
  238. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  239. // uni.showModal({
  240. // showCancel: false,
  241. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  242. // });
  243. // return;
  244. // }
  245. this.itemIndex = index;
  246. if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
  247. .classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
  248. .periodStatus == -1) && item.studyCount > 0) {
  249. this.selectClass(item, index);
  250. return;
  251. }
  252. let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
  253. if (rebuildStatus == 0) {
  254. this.$navTo.togo('/pages2/learn/details', {
  255. gradeId: item.gradeId,
  256. goodsId: item.goodsId,
  257. orderGoodsId: item.orderGoodsId,
  258. });
  259. return;
  260. }
  261. // if (item.educationName == '继续教育') {
  262. this.$api.lockLockStatus({
  263. action: 'jxjy',
  264. uuid:this.$method.getUuid()
  265. }).then(res => {
  266. if (res.data.code == 200) { //有其他端在操作,不能学习
  267. uni.showToast({
  268. icon: 'none',
  269. title: res.data.msg,
  270. mask: true,
  271. duration: 3000
  272. })
  273. } else if (res.data.code == 500) { //可以学习
  274. if (item.courseNum == 1) {
  275. this.$api.courseCourseList({
  276. pageNum: 1,
  277. pageSize: 1,
  278. goodsId: item.goodsId,
  279. gradeId: item.gradeId,
  280. orderGoodsId: item.orderGoodsId,
  281. }).then(res => {
  282. if (res.data.code == 200) {
  283. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  284. // this.userConfirmInfoDetail().then(() => {
  285. // uni.navigateTo({
  286. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  287. // })
  288. // })
  289. // } else {
  290. uni.navigateTo({
  291. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  292. })
  293. // }
  294. }
  295. });
  296. return;
  297. }
  298. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  299. // // this.userConfirmInfoDetail().then(() => {
  300. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  301. // // })
  302. // } else {
  303. this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  304. // }
  305. }
  306. })
  307. // } else {
  308. // if (item.courseNum == 1) {
  309. // this.$api.courseCourseList({
  310. // pageNum: 1,
  311. // pageSize: 1,
  312. // goodsId: item.goodsId,
  313. // gradeId: item.gradeId,
  314. // orderGoodsId: item.orderGoodsId,
  315. // }).then(res => {
  316. // if (res.data.code == 200) {
  317. // uni.navigateTo({
  318. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  319. // })
  320. // }
  321. // });
  322. // return;
  323. // }
  324. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  325. // }
  326. },
  327. }
  328. }
  329. </script>
  330. <style>
  331. page {
  332. background: #eaeef1;
  333. }
  334. </style>
  335. <style lang="scss" scoped>
  336. .contents {
  337. width: 100%;
  338. .diatance {
  339. width: 100%;
  340. height: 85rpx;
  341. background-color: #007AFF;
  342. display: flex;
  343. align-items: center;
  344. margin-top: 8rpx;
  345. .clock {
  346. width: 44rpx;
  347. height: 41rpx;
  348. margin: 0rpx 22rpx 0rpx 65rpx;
  349. }
  350. >text {
  351. color: #fff;
  352. font-size: 28rpx;
  353. }
  354. }
  355. }
  356. .had_courses{
  357. width: 100%;
  358. padding: 39rpx 24rpx 31rpx;
  359. .lives {
  360. widows: 100%;
  361. height: 150rpx;
  362. }
  363. }
  364. .my_courses {
  365. .titles {
  366. font-size: 32rpx;
  367. color: #333333;
  368. margin: 44rpx 0rpx 24rpx 43rpx;
  369. font-weight: bold;
  370. display: block;
  371. }
  372. .course_item {
  373. width: 100%;
  374. height: 278rpx;
  375. background: #FFFFFF;
  376. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
  377. border-radius: 24rpx;
  378. padding: 29rpx 29rpx 20rpx 24rpx;
  379. display: flex;
  380. align-items: center;
  381. margin-bottom: 20rpx;
  382. }
  383. .lefts {
  384. width: 202rpx;
  385. height: 223rpx;
  386. border-radius: 12rpx;
  387. margin-right: 35rpx;
  388. position: relative;
  389. top: 0;
  390. left: 0;
  391. border: 1rpx solid #ddd;
  392. .lefet_img {
  393. width: 100%;
  394. height: 100%;
  395. display: block;
  396. }
  397. .live_icon {
  398. width: 65rpx;
  399. height: 35rpx;
  400. line-height: 35rpx;
  401. border-radius: 22rpx 0rpx 22rpx 0rpx;
  402. background-color: #FFB102;
  403. color: #fff;
  404. font-size: 20rpx;
  405. text-align: center;
  406. position: absolute;
  407. top: 0;
  408. left: 0;
  409. }
  410. }
  411. .rights {
  412. width: 400rpx;
  413. height: 223rpx;
  414. display: flex;
  415. flex-direction: column;
  416. justify-content: space-between;;
  417. .cou_titles {
  418. margin-top: 14rpx;
  419. color: #333333;
  420. font-size: 28rpx;
  421. font-weight: bold;
  422. width: 100%;
  423. overflow: hidden;
  424. text-overflow: ellipsis;
  425. white-space: nowrap;
  426. }
  427. .learn_ranges {
  428. color: #999;
  429. font-size: 24rpx;
  430. margin-top: 24rpx;
  431. .l_range {
  432. width: 20rpx;
  433. height: 24rpx;
  434. margin-right: 9rpx;
  435. }
  436. .l_time {
  437. color: #333;
  438. }
  439. }
  440. .learn_progress {
  441. width: 100%;
  442. }
  443. .progress_up {
  444. font-size: 24rpx;
  445. // font-weight: 400;
  446. color: #999999;
  447. display: flex;
  448. align-items: center;
  449. .wk_icon {
  450. width: 24rpx;
  451. height: 24rpx;
  452. margin-right: 8rpx;
  453. }
  454. }
  455. .progress_down {
  456. width: 100%;
  457. display: flex;
  458. justify-content: space-between;
  459. align-items: center;
  460. }
  461. .enter_into {
  462. width: 165rpx;
  463. height: 48rpx;
  464. line-height: 48rpx;
  465. background: #FFB102;
  466. border-radius: 0rpx 16rpx 16rpx 16rpx;
  467. font-size: 24rpx;
  468. font-weight: 400;
  469. color: #FFFFFF;
  470. text-align: center;
  471. }
  472. }
  473. // 收藏集,做题记录
  474. .bottoms {
  475. display: flex;
  476. justify-content: space-between;
  477. margin-bottom: 32rpx;
  478. .item {
  479. width: 335rpx;
  480. &.collect {
  481. position: relative;
  482. font-size: 32rpx;
  483. color: #FFFFFF;
  484. height: 240rpx;
  485. border-radius: 24rpx;
  486. padding:32rpx;
  487. .text {
  488. position:relative;
  489. z-index: 10;
  490. font-size: 32rpx;
  491. font-weight: bold;
  492. color: #FFFFFF;
  493. }
  494. .img {
  495. position:absolute;
  496. left:0;
  497. top:0;
  498. width:100%;
  499. height:100%;
  500. }
  501. }
  502. &.list {
  503. .list-in {
  504. position:relative;
  505. width: 335rpx;
  506. height: 112rpx;
  507. background: #007AFF;
  508. border-radius: 24rpx;
  509. display: flex;
  510. align-items: center;
  511. font-size: 32rpx;
  512. color: #fff;
  513. &:first-of-type {
  514. margin-bottom:16rpx;
  515. }
  516. .text {
  517. padding-left:91rpx;
  518. position:relative;
  519. z-index: 10;
  520. font-size: 32rpx;
  521. font-weight: bold;
  522. color: #FFFFFF;
  523. }
  524. .img {
  525. position:absolute;
  526. left:0;
  527. top:0;
  528. width:100%;
  529. height:100%;
  530. }
  531. }
  532. }
  533. }
  534. }
  535. }
  536. .no_datas {
  537. margin-top: 70rpx;
  538. display: flex;
  539. flex-direction: column;
  540. align-items: center;
  541. .courses {
  542. width: 360rpx;
  543. height: 349rpx;
  544. }
  545. .no_learns {
  546. font-size: 32rpx;
  547. color: #999;
  548. margin: 46rpx 0rpx 56rpx;
  549. }
  550. .choose {
  551. width: 280rpx;
  552. height: 64rpx;
  553. line-height: 64rpx;
  554. border-radius: 32rpx;
  555. background-color: #007AFF;
  556. color: #fff;
  557. font-size: 30rpx;
  558. text-align: center;
  559. }
  560. }
  561. </style>