index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. <template>
  2. <view class="study-center">
  3. <u-navbar
  4. :is-back="false"
  5. title="学习中心"
  6. class="navbar"
  7. :border-bottom="false"
  8. title-color="#333333"
  9. back-icon-color="#ffffff"
  10. >
  11. <view class="slot-wrap">
  12. <image
  13. src="/static/logo2.png"
  14. style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
  15. ></image>
  16. </view>
  17. </u-navbar>
  18. <view class="no-course" v-if="list.length == 0">
  19. <image class="img" src="/static/no-course.png" mode="widthFix"></image>
  20. <view class="title">暂无学习内容</view>
  21. <view class="title">请先购买课程/题库</view>
  22. <view class="btn" @click="goIndex">马上选课/选题</view>
  23. </view>
  24. <template v-else>
  25. <view class="note-list">
  26. <picker class='picker' :range="list" range-key="aliasName" @change="change">
  27. <view class="text">{{businessName || '请选择业务层次'}}</view>
  28. </picker>
  29. <u-icon name="arrow-down"></u-icon>
  30. </view>
  31. <view class="course-list">
  32. <template v-if="getSelectType() == 1">
  33. <navigator
  34. hover-class="none"
  35. :url="'/pages2/wd/class?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  36. class="menu_box"
  37. >
  38. <view class="box_left">
  39. <image src="/static/icon/my_icon3.png" class="my_icon">
  40. </image>
  41. <view class="point" v-if="total2 > 0"></view>
  42. <view>我的网课</view>
  43. </view>
  44. <view class="box_right">
  45. <text>{{ total2 }}</text>
  46. 个课程直播中
  47. </view>
  48. </navigator>
  49. <navigator
  50. hover-class="none"
  51. :url="'/pages2/learn/my_learn?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  52. class="menu_box"
  53. >
  54. <view class="box_left">
  55. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  56. <view class="point" v-if="userNums.periodSum > 0"></view>
  57. <view>我的学时</view>
  58. </view>
  59. <view class="box_right">
  60. 累计
  61. <text>{{ userNums.periodSum }}</text>
  62. 学时未通过
  63. </view>
  64. </navigator>
  65. <navigator
  66. hover-class="none"
  67. :url="'/pages5/liveDetail/list?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  68. class="menu_box"
  69. >
  70. <view class="box_left">
  71. <image src="/static/icon/my_icon12.png" class="my_icon">
  72. </image>
  73. <view class="point" v-if="total2 > 0"></view>
  74. <view>我的直播课</view>
  75. </view>
  76. <view class="box_right">
  77. <text>{{ total2 }}</text>
  78. 个课程直播中
  79. </view>
  80. </navigator>
  81. <view
  82. hover-class="none"
  83. @click="goBank()"
  84. class="menu_box"
  85. >
  86. <view class="box_left">
  87. <image src="/static/icon/my_icon4.png" class="my_icon">
  88. </image>
  89. <view>我的题库</view>
  90. </view>
  91. <view class="box_right">
  92. <text>{{ total2 }}</text>
  93. 个课程直播中
  94. </view>
  95. </view>
  96. </template>
  97. <template v-if="getSelectType() == 2">
  98. <navigator
  99. hover-class="none"
  100. :url="'/pages2/wd/class?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  101. class="menu_box"
  102. >
  103. <view class="box_left">
  104. <image src="/static/icon/my_icon3.png" class="my_icon">
  105. </image>
  106. <view class="point" v-if="total2 > 0"></view>
  107. <view>我的网课</view>
  108. </view>
  109. <view class="box_right">
  110. <text>{{ total2 }}</text>
  111. 个课程直播中
  112. </view>
  113. </navigator>
  114. <navigator
  115. hover-class="none"
  116. :url="'/pages5/liveDetail/list?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  117. class="menu_box"
  118. >
  119. <view class="box_left">
  120. <image src="/static/icon/my_icon12.png" class="my_icon">
  121. </image>
  122. <view class="point" v-if="total2 > 0"></view>
  123. <view>我的直播课</view>
  124. </view>
  125. <view class="box_right">
  126. <text>{{ total2 }}</text>
  127. 个课程直播中
  128. </view>
  129. </navigator>
  130. <view
  131. hover-class="none"
  132. @click="goBank()"
  133. class="menu_box"
  134. >
  135. <view class="box_left">
  136. <image src="/static/icon/my_icon4.png" class="my_icon">
  137. </image>
  138. <view>我的题库</view>
  139. </view>
  140. <view class="box_right">
  141. <text>{{ total2 }}</text>
  142. 个课程直播中
  143. </view>
  144. </view>
  145. <navigator hover-class="none" :url="'/pages5/exam/index?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''" class="menu_box">
  146. <view class="box_left">
  147. <image src="/static/icon/my_icon11.png" class="my_icon"></image>
  148. <view class="point" v-if="total1 > 0"></view>
  149. <view>我的模考</view>
  150. </view>
  151. <view class="box_right">
  152. <text>{{ total1 }}</text>
  153. 个模考预约
  154. </view>
  155. </navigator>
  156. </template>
  157. <template v-if="getSelectType() == 3">
  158. <navigator
  159. hover-class="none"
  160. :url="'/pages2/wd/class?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  161. class="menu_box"
  162. >
  163. <view class="box_left">
  164. <image src="/static/icon/my_icon3.png" class="my_icon">
  165. </image>
  166. <view class="point" v-if="total2 > 0"></view>
  167. <view>我的网课</view>
  168. </view>
  169. <view class="box_right">
  170. <text>{{ total2 }}</text>
  171. 个课程直播中
  172. </view>
  173. </navigator>
  174. <navigator
  175. hover-class="none"
  176. :url="'/pages2/learn/my_learn?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  177. class="menu_box"
  178. >
  179. <view class="box_left">
  180. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  181. <view class="point" v-if="userNums.periodSum > 0"></view>
  182. <view>我的学时</view>
  183. </view>
  184. <view class="box_right">
  185. 累计
  186. <text>{{ userNums.periodSum }}</text>
  187. 学时未通过
  188. </view>
  189. </navigator>
  190. <navigator hover-class="none" :url="'/pages2/exam/index?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''" class="menu_box">
  191. <view class="box_left">
  192. <image src="/static/icon/my_icon10.png" class="my_icon"></image>
  193. <view class="point" v-if="userNums.subscribeSum > 0"></view>
  194. <view>我的考试</view>
  195. </view>
  196. <view class="box_right">
  197. <text>{{ userNums.subscribeSum }}</text>
  198. 考试预约
  199. </view>
  200. </navigator>
  201. <navigator
  202. hover-class="none"
  203. :url="'/pages5/liveDetail/list?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  204. class="menu_box"
  205. >
  206. <view class="box_left">
  207. <image src="/static/icon/my_icon12.png" class="my_icon">
  208. </image>
  209. <view class="point" v-if="total2 > 0"></view>
  210. <view>我的直播课</view>
  211. </view>
  212. <view class="box_right">
  213. <text>{{ total2 }}</text>
  214. 个课程直播中
  215. </view>
  216. </navigator>
  217. <view
  218. hover-class="none"
  219. @click="goBank()"
  220. class="menu_box"
  221. >
  222. <view class="box_left">
  223. <image src="/static/icon/my_icon4.png" class="my_icon">
  224. </image>
  225. <view>我的题库</view>
  226. </view>
  227. <view class="box_right">
  228. <text>{{ total2 }}</text>
  229. 个课程直播中
  230. </view>
  231. </view>
  232. </template>
  233. <template v-if="getSelectType() == null">
  234. <navigator
  235. hover-class="none"
  236. :url="'/pages2/wd/class?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  237. class="menu_box"
  238. >
  239. <view class="box_left">
  240. <image src="/static/icon/my_icon3.png" class="my_icon">
  241. </image>
  242. <view class="point" v-if="total2 > 0"></view>
  243. <view>我的网课</view>
  244. </view>
  245. <view class="box_right">
  246. <text>{{ total2 }}</text>
  247. 个课程直播中
  248. </view>
  249. </navigator>
  250. <navigator
  251. hover-class="none"
  252. :url="'/pages5/liveDetail/list?projectId='+projectId+'&businessId='+businessId+'&educationId='+educationId+''"
  253. class="menu_box"
  254. >
  255. <view class="box_left">
  256. <image src="/static/icon/my_icon12.png" class="my_icon">
  257. </image>
  258. <view class="point" v-if="total2 > 0"></view>
  259. <view>我的直播课</view>
  260. </view>
  261. <view class="box_right">
  262. <text>{{ total2 }}</text>
  263. 个课程直播中
  264. </view>
  265. </navigator>
  266. <view
  267. hover-class="none"
  268. @click="goBank()"
  269. class="menu_box"
  270. >
  271. <view class="box_left">
  272. <image src="/static/icon/my_icon4.png" class="my_icon">
  273. </image>
  274. <view>我的题库</view>
  275. </view>
  276. <view class="box_right">
  277. <text>{{ total2 }}</text>
  278. 个课程直播中
  279. </view>
  280. </view>
  281. </template>
  282. </view>
  283. </template>
  284. <!-- <navigator
  285. hover-class="none"
  286. url="/pages5/liveDetail/list"
  287. class="menu_box"
  288. >
  289. <view class="box_left">
  290. <image src="/static/icon/my_icon3.png" class="my_icon">
  291. </image>
  292. <view class="point" v-if="total2 > 0"></view>
  293. <view>我的网课</view>
  294. </view>
  295. <view class="box_right">
  296. <text>{{ total2 }}</text>
  297. 个课程直播中
  298. </view>
  299. </navigator>
  300. <navigator
  301. hover-class="none"
  302. url="/pages5/liveDetail/list"
  303. class="menu_box"
  304. >
  305. <view class="box_left">
  306. <image src="/static/icon/my_icon4.png" class="my_icon">
  307. </image>
  308. <view>我的题库</view>
  309. </view>
  310. <view class="box_right">
  311. <text>{{ total2 }}</text>
  312. 个课程直播中
  313. </view>
  314. </navigator>
  315. <navigator
  316. hover-class="none"
  317. url="/pages5/liveDetail/list"
  318. class="menu_box"
  319. >
  320. <view class="box_left">
  321. <image src="/static/icon/my_icon12.png" class="my_icon">
  322. </image>
  323. <view class="point" v-if="total2 > 0"></view>
  324. <view>我的直播课</view>
  325. </view>
  326. <view class="box_right">
  327. <text>{{ total2 }}</text>
  328. 个课程直播中
  329. </view>
  330. </navigator>
  331. <navigator
  332. hover-class="none"
  333. url="/pages2/learn/my_learn"
  334. class="menu_box"
  335. >
  336. <view class="box_left">
  337. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  338. <view class="point" v-if="userNums.periodSum > 0"></view>
  339. <view>我的学时</view>
  340. </view>
  341. <view class="box_right">
  342. 累计
  343. <text>{{ userNums.periodSum }}</text>
  344. 学时未通过
  345. </view>
  346. </navigator>
  347. <navigator hover-class="none" url="/pages5/exam/index" class="menu_box">
  348. <view class="box_left">
  349. <image src="/static/icon/my_icon11.png" class="my_icon"></image>
  350. <view class="point" v-if="total1 > 0"></view>
  351. <view>我的模考</view>
  352. </view>
  353. <view class="box_right">
  354. <text>{{ total1 }}</text>
  355. 个模考预约
  356. </view>
  357. </navigator>
  358. <navigator hover-class="none" url="/pages2/exam/index" class="menu_box">
  359. <view class="box_left">
  360. <image src="/static/icon/my_icon10.png" class="my_icon"></image>
  361. <view class="point" v-if="userNums.subscribeSum > 0"></view>
  362. <view>我的考试</view>
  363. </view>
  364. <view class="box_right">
  365. <text>{{ userNums.subscribeSum }}</text>
  366. 考试预约
  367. </view>
  368. </navigator> -->
  369. </view>
  370. </template>
  371. <script>
  372. import { mapGetters } from "vuex";
  373. export default {
  374. components: {},
  375. data() {
  376. return {
  377. list:[],
  378. businessId:'',
  379. educationId:'',
  380. projectId:'',
  381. businessName:'',
  382. userNums: {},
  383. total1: 0,
  384. total2: 0,
  385. selectItem:null,
  386. };
  387. },
  388. onPullDownRefresh() {
  389. },
  390. onLoad(option) {
  391. },
  392. onShow() {
  393. if (this.$method.isLogin()) {
  394. this.orderUserAllBusinessList();
  395. }
  396. },
  397. methods: {
  398. goBank() {
  399. this.$api
  400. .lockLockStatus({
  401. action: "bank",
  402. })
  403. .then((res) => {
  404. if (res.data.code == 200) {
  405. //有其他端在操作,不能学习
  406. uni.showToast({
  407. icon: "none",
  408. title: res.data.msg,
  409. duration: 3000,
  410. });
  411. } else if (res.data.code == 500) {
  412. //可以学习
  413. uni.navigateTo({
  414. url: '/pages2/wd/question_bank?projectId='+this.projectId+'&businessId='+this.businessId+'&educationId='+this.educationId+'',
  415. });
  416. }
  417. });
  418. },
  419. orderUserAllBusinessList() {
  420. this.$api.orderUserAllBusinessList().then(res => {
  421. this.list = res.data.rows;
  422. })
  423. },
  424. getSelectType() {
  425. if(!this.selectItem) {
  426. return null
  427. }
  428. if(this.selectItem.educationName == '继续教育') {
  429. if(this.selectItem.businessName == '一级') {
  430. if(this.selectItem.projectName == '建造师') {
  431. return 1;
  432. } else {
  433. return null;
  434. }
  435. } else if (this.selectItem.businessName == '二级') {
  436. if(this.selectItem.projectName == '建造师' || this.selectItem.projectName == '造价工程师') {
  437. return 1;
  438. } else {
  439. return null;
  440. }
  441. } else if (this.selectItem.businessName == '职称继续教育' && this.selectItem.projectName == '专业技术人员') {
  442. return 1
  443. } else {
  444. return null;
  445. }
  446. }
  447. if(this.selectItem.educationName == '考前培训') {
  448. if(this.selectItem.businessName == '二级' || this.selectItem.businessName == '一级') {
  449. if(this.selectItem.projectName == '建造师') {
  450. return 2;
  451. } else {
  452. return null;
  453. }
  454. } else if(this.selectItem.businessName == '七大员' && this.selectItem.projectName == '施工现场专业人员') {
  455. return 3;
  456. } else{
  457. return null;
  458. }
  459. }
  460. return null
  461. },
  462. change(e) {
  463. this.selectItem = this.list[e.detail.value]
  464. this.businessId = this.list[e.detail.value].businessId
  465. this.projectId = this.list[e.detail.value].projectId
  466. this.educationId = this.list[e.detail.value].educationId
  467. this.businessName = this.list[e.detail.value].educationName +'-'+ this.list[e.detail.value].aliasName
  468. this.isLogin = this.$method.isLogin();
  469. if (this.isLogin) {
  470. this.$store.state.allowLoading = false;
  471. this.getCount();
  472. this.goodsLivingSectionList();
  473. this.getNums()
  474. this.$store.state.allowLoading = true;
  475. }
  476. },
  477. getCount() {
  478. this.$api
  479. .mockSubscribeListSubscribe({
  480. mockStatus: 0,
  481. pageNum: 1,
  482. pageSize: 1,
  483. })
  484. .then((res) => {
  485. this.total1 = res.data.total;
  486. });
  487. },
  488. getNums() {
  489. this.$api.getinfoAttached().then((res) => {
  490. if (res.data.code === 200) {
  491. this.userNums = res.data.data;
  492. const nums =
  493. res.data.data.informSum +
  494. res.data.data.orderSum +
  495. res.data.data.periodSum +
  496. res.data.data.planSum +
  497. res.data.data.subscribeSum;
  498. this.$store.commit("tabNum", nums);
  499. }
  500. });
  501. },
  502. goodsLivingSectionList() {
  503. this.$api.goodsLivingSectionList().then((res) => {
  504. this.total2 = res.data.data.length;
  505. });
  506. },
  507. goIndex() {
  508. uni.switchTab({
  509. url:'../index/index'
  510. })
  511. }
  512. },
  513. onReachBottom() {
  514. },
  515. computed: { ...mapGetters(["userInfo"]) },
  516. };
  517. </script>
  518. <style >
  519. page {
  520. background-color: #EAEEF1;
  521. }
  522. </style>
  523. <style scoped lang="scss">
  524. .study-center {
  525. .navbar {
  526. /deep/ .u-navbar-inner {
  527. margin-right: 0 !important;
  528. }
  529. .slot-wrap {
  530. width: 100%;
  531. }
  532. }
  533. .no-course {
  534. margin: 80rpx auto 0;
  535. text-align: center;
  536. .img {
  537. width:360rpx;
  538. }
  539. .title {
  540. margin-top:10rpx;
  541. font-size: 32rpx;
  542. text-align: center;
  543. color: #999999;
  544. }
  545. .btn {
  546. margin:40rpx auto 0;
  547. width: 280rpx;
  548. text-align: center;
  549. line-height: 64rpx;
  550. color:#fff;
  551. font-size: 30rpx;
  552. height: 64rpx;
  553. background: #007AFF;
  554. border-radius: 32rpx;
  555. }
  556. }
  557. .note-list {
  558. background: #FFFFFF;
  559. display: flex;
  560. align-items: center;
  561. padding:0 32rpx;
  562. .picker {
  563. line-height: 80rpx;
  564. height: 80rpx;
  565. flex:1;
  566. }
  567. }
  568. .course-list {
  569. padding:0 32rpx;
  570. .menu_box {
  571. height: 104rpx;
  572. background: #ffffff;
  573. border-radius: 24rpx;
  574. margin-top: 30rpx;
  575. display: flex;
  576. align-items: center;
  577. padding: 0 20rpx;
  578. justify-content: space-between;
  579. color: #666666;
  580. font-size: 32rpx;
  581. .box_left {
  582. display: flex;
  583. align-items: center;
  584. position:relative;
  585. .point {
  586. width:16rpx;
  587. height:16rpx;
  588. border-radius:50%;
  589. background: red;
  590. position:absolute;
  591. left:50rpx;
  592. top:0;
  593. }
  594. }
  595. .box_right {
  596. font-size: 32rpx;
  597. text {
  598. color: #007aff;
  599. margin: 0 5rpx;
  600. }
  601. }
  602. }
  603. .my_icon {
  604. width: 56rpx;
  605. height: 56rpx;
  606. margin-right: 20rpx;
  607. }
  608. }
  609. }
  610. </style>