index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <view >
  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. <view v-show="!show">
  9. <view style="position: fixed;width: 100%;z-index: 999;">
  10. <view class="bg_color"></view>
  11. <view class="check_ck">
  12. <view class="checked">
  13. <view class="check_title">{{selObj.eName}}:{{selObj.pName}}-{{selObj.bName}}</view>
  14. <view class="again_ck" @click="openLeft()">
  15. <view style="color: #007AFF;font-size: 32rpx;">重新选择</view>
  16. <u-icon name="list" color="#007AFF" size="40"></u-icon>
  17. </view>
  18. </view>
  19. <view style="display: flex;align-items:center;">
  20. <view style="margin: 0 auto;">
  21. <u-tabs :list="courseLists" height='97' :current="current" @change="change" :scrollable="false"></u-tabs>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- <u-line color="#D6D6DB" /> -->
  26. <view class="menuSel" v-show="current==0">
  27. <scroll-view class="r_sliper" scroll-x="true" >
  28. <view v-for="(item,index) in sList" :key="index" style="margin-right: 20rpx;display:inline-block">
  29. <view :class="paramList[0].subjectId==item.id?'r_t1':'r_t2'" @click="cMenu(item.id)">
  30. {{item.subjectName}}
  31. </view>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. <view class="menuSel" v-show="current==1">
  36. <scroll-view class="r_sliper" scroll-x="true" >
  37. <view v-for="(item,index) in sList" :key="index" style="margin-right: 20rpx;display:inline-block">
  38. <view :class="paramList[1].subjectId==item.id?'r_t1':'r_t2'" @click="cMenu1(item.id)">
  39. {{item.subjectName}}
  40. </view>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. <view class="menuSel" v-show="current==2">
  45. <scroll-view class="r_sliper" scroll-x="true" >
  46. <view v-for="(item,index) in sList" :key="index" style="margin-right: 20rpx;display:inline-block">
  47. <view :class="paramList[2].subjectId==item.id?'r_t1':'r_t2'" @click="cMenu2(item.id)">
  48. {{item.subjectName}}
  49. </view>
  50. </view>
  51. </scroll-view>
  52. </view>
  53. </view>
  54. <view v-show="current==0" class="contents">
  55. <view class="listBox">
  56. <navigator hover-class="none" :url="'/pages3/course/detail?id='+item.goodsId" v-for="(item,index) in list1" :key="index" >
  57. <view class="itemBox">
  58. <image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 367rpx;width: 100%;border-radius: 24rpx;"></image>
  59. <view style="display: flex;margin-top: 13rpx;align-items: center;">
  60. <view class="yearTag" v-if="item.year">{{item.year}}</view>
  61. <view class="titleTag">{{item.goodsName}}</view>
  62. </view>
  63. <view style="display: flex;justify-content: space-between;margin-top: 15rpx;">
  64. <view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  65. 共 <text class="blackFont">{{item.courseNum}}</text>
  66. <text class="margin30">课程</text>
  67. <text class="blackFont">{{item.classHours || '-'}}</text> 学时</view>
  68. <view v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
  69. <view v-else class="priceTag free">免费</view>
  70. </view>
  71. </view>
  72. </navigator>
  73. <view class="emptyTip" v-if="list1.length==0">暂未上架相关网课~</view>
  74. </view>
  75. </view>
  76. <view v-show="current==1" class="contents">
  77. <view class="listBox">
  78. <navigator hover-class="none" :url="'/pages2/bank/detail?id='+item.goodsId" v-for="(item,index) in list2" :key="index" >
  79. <view class="itemBox">
  80. <image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 367rpx;width: 100%;border-radius: 24rpx;"></image>
  81. <view style="display: flex;margin-top: 13rpx;align-items: center;">
  82. <view class="yearTag" v-if="item.year">{{item.year}}</view>
  83. <view class="titleTag" style="display: flex;justify-content: space-between;flex:1;">
  84. <view style="flex:1;">{{item.goodsName}}</view>
  85. <view v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
  86. <view v-else class="priceTag free">免费</view>
  87. </view>
  88. </view>
  89. <view style="display: flex;justify-content: space-between;margin-top: 15rpx;" v-if="false">
  90. <view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  91. 共 <text class="blackFont">6</text>
  92. <view class="margin30">张卷</view>
  93. <text class="blackFont">120</text>道题 </view>
  94. <view v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
  95. <view v-else class="priceTag free">免费</view>
  96. </view>
  97. </view>
  98. </navigator>
  99. <view class="emptyTip" v-if="list2.length==0">暂未上架相关题库~</view>
  100. </view>
  101. </view>
  102. <view v-show="current==2" class="contents">
  103. <view class="listBox">
  104. <navigator hover-class="none" :url="'/pages5/liveDetail/index?id='+item.goodsId" v-for="(item,index) in list3" :key="index" >
  105. <view class="itemBox">
  106. <image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 367rpx;width: 100%;border-radius: 24rpx;"></image>
  107. <view style="display: flex;margin-top: 13rpx;align-items: center;">
  108. <view class="yearTag" v-if="item.year">{{item.year}}</view>
  109. <view class="titleTag" style="display: flex;justify-content: space-between;flex:1;">
  110. <view style="flex:1;">{{item.goodsName}}</view>
  111. <view v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
  112. <view v-else class="priceTag free">免费</view>
  113. </view>
  114. </view>
  115. <view style="display: flex;justify-content: space-between;margin-top: 15rpx;" v-if="false">
  116. <view class="noteTag">
  117. <image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  118. <view v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
  119. <view v-else class="priceTag free">免费</view>
  120. </view>
  121. </view>
  122. </view>
  123. </navigator>
  124. <view class="emptyTip" v-if="list3.length==0">暂未上架相关直播~</view>
  125. </view>
  126. </view>
  127. </view>
  128. <view v-show="show" class="popuBox">
  129. <view class="flex-d" >
  130. <view class="contentZ">
  131. <view class="lzs" >
  132. <view class="tylsz" v-for="(item, index) in eList" :key="index" @click="item.id === 0 ? activeAll(1) : active1(item)" :class="item.id === selObj.eId ? 'activeStys':''">{{ item.educationName }}</view>
  133. </view>
  134. <view class="rzs" >
  135. <view class="tylszB" v-for="(item, index) in bList" :key="index" @click="item.id === 0 ? activeAll(2) : active2(item)" :class="item.id === selObj.bId ? 'activeStys2':''">{{ item.projectName }}-{{ item.businessName }}</view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. <!-- <tab-bar v-model="current" :list="tabbarlist" :mid-button="true" :mid-button-size="50" class="tab_items"></tab-bar> -->
  141. </view>
  142. </template>
  143. <script>
  144. // import TabBar from '@/components/u-tabbar/u-tabbar.vue';
  145. import { mapGetters } from 'vuex';
  146. export default {
  147. components: {
  148. // TabBar
  149. },
  150. data() {
  151. return {
  152. show:false,
  153. courseLists:[
  154. {
  155. name: '网课'
  156. },
  157. {
  158. name: '题库通'
  159. },
  160. {
  161. name: '直播课'
  162. }
  163. ],
  164. array:['全部','建设工程施工管理','机电全科','机电工程管理与实','机电全科','全科'],
  165. current:0,
  166. menuIndex:0,
  167. menuIndex1:0,
  168. paramList: [
  169. {
  170. pageNum: 1,
  171. pageSize: 10,
  172. total: 0,
  173. showStatus: 0,
  174. goodsType:1,
  175. subjectId:0
  176. },
  177. {
  178. pageNum: 1,
  179. pageSize: 10,
  180. total: 0,
  181. showStatus: 0,
  182. goodsType:2,
  183. subjectId:0
  184. },
  185. {
  186. pageNum: 1,
  187. pageSize: 10,
  188. total: 0,
  189. showStatus: 0,
  190. goodsType:6,
  191. subjectId:0
  192. }
  193. ],
  194. list1: [],
  195. list2: [],
  196. list3:[],
  197. eList:[],
  198. bList:[],
  199. sList:[],
  200. selObj:{
  201. eName:'',
  202. pName:'',
  203. bName:'',
  204. eId:0,
  205. bId:0,
  206. pId:0,
  207. },
  208. current: 1,
  209. tabbarlist: this.$store.state.tabLists
  210. };
  211. },
  212. onPullDownRefresh(){
  213. let that = this
  214. this.initList();
  215. setTimeout(function(){
  216. uni.stopPullDownRefresh()
  217. },500)
  218. },
  219. onLoad(option) {
  220. let eduStr = uni.getStorageSync('eduObj')
  221. if(eduStr){
  222. this.selObj = JSON.parse(eduStr)
  223. this.subjectList({businessId:this.selObj.bId,projectId:this.selObj.pId,educationId:this.selObj.eId})
  224. this.mergeBusiness()
  225. }else{
  226. this.show = true
  227. }
  228. this.initList();
  229. },
  230. methods: {
  231. mergeBusiness(){
  232. this.paramList[0].educationTypeId = this.selObj.eId
  233. this.paramList[0].businessId = this.selObj.bId
  234. this.paramList[0].subjectId = 0
  235. this.paramList[1].educationTypeId = this.selObj.eId
  236. this.paramList[1].businessId = this.selObj.bId
  237. this.paramList[1].subjectId = 0
  238. this.paramList[2].educationTypeId = this.selObj.eId
  239. this.paramList[2].businessId = this.selObj.bId
  240. this.paramList[2].subjectId = 0
  241. },
  242. subjectList(data) {
  243. var self = this;
  244. this.$api.subjectList(data).then(res => {
  245. if(res.data.code==200){
  246. self.sList = res.data.rows
  247. let allItem = {id:0,subjectName:'全部'}
  248. self.sList.unshift(allItem)
  249. }
  250. });
  251. },
  252. active2(item){
  253. this.selObj.bId = item.id
  254. this.show = false
  255. this.selObj.pId = item.projectId
  256. this.selObj.bName = item.businessName
  257. this.selObj.pName = item.projectName
  258. uni.setStorageSync('eduObj', JSON.stringify(this.selObj));
  259. this.subjectList({businessId:item.id,projectId:item.projectId,educationId:this.selObj.eId})
  260. this.mergeBusiness()
  261. //初始化
  262. this.initList();
  263. },
  264. businessList(data) {
  265. var self = this;
  266. this.$api.businessList(data).then(res => {
  267. if(res.data.code==200){
  268. self.bList = res.data.rows
  269. }
  270. });
  271. },
  272. active1(item){
  273. this.selObj.eId = item.id
  274. this.selObj.eName = item.educationName
  275. this.businessList({educationId:item.id})
  276. },
  277. educationList() {
  278. var self = this;
  279. this.$api.educationTypeList().then(res => {
  280. if(res.data.code==200){
  281. self.eList = res.data.rows
  282. if(self.selObj.eId){
  283. self.businessList({educationId:self.selObj.eId})
  284. } else {
  285. this.active1(self.eList[0])
  286. }
  287. }
  288. });
  289. },
  290. openLeft(){
  291. this.show = true
  292. },
  293. initList() {
  294. this.paramList[0].pageNum = 1
  295. this.paramList[1].pageNum = 1
  296. this.list1 = []
  297. this.list2 = []
  298. this.list3 = [];
  299. this.courseList();
  300. this.bankList();
  301. this.liveList()
  302. this.educationList()
  303. },
  304. cMenu(index){
  305. this.paramList[0].pageNum = 1
  306. this.paramList[0].subjectId= index;
  307. this.list1 = []
  308. // this.menuIndex
  309. this.courseList();
  310. },
  311. cMenu1(index){
  312. this.paramList[1].pageNum = 1
  313. this.paramList[1].subjectId= index;
  314. this.list2 = []
  315. // this.menuIndex1 = index;
  316. this.bankList();
  317. },
  318. cMenu2(index){
  319. this.paramList[2].pageNum = 1
  320. this.paramList[2].subjectId= index;
  321. this.list3 = []
  322. // this.menuIndex1 = index;
  323. this.liveList();
  324. },
  325. change(index){
  326. this.current = index;
  327. },
  328. //课程
  329. courseList() {
  330. var self = this;
  331. var param = this.paramList[0];
  332. this.$api.goodsList(param).then(res => {
  333. self.paramList[0].total = res.data.total;
  334. self.list1.push.apply(self.list1, res.data.rows);
  335. if (self.list1.length === res.data.total) {
  336. self.paramList[0].showStatus = true;
  337. }
  338. });
  339. },
  340. //题库
  341. bankList() {
  342. var self = this;
  343. var param = this.paramList[1];
  344. this.$api.goodsList(param).then(res => {
  345. self.paramList[1].total = res.data.total;
  346. self.list2.push.apply(self.list2, res.data.rows);
  347. if (self.list2.length === res.data.total) {
  348. self.paramList[1].showStatus = true;
  349. }
  350. });
  351. },
  352. //直播
  353. liveList() {
  354. var self = this;
  355. var param = this.paramList[2];
  356. this.$api.goodsList(param).then(res => {
  357. self.paramList[2].total = res.data.total;
  358. self.list3.push.apply(self.list3, res.data.rows);
  359. if (self.list3.length === res.data.total) {
  360. self.paramList[2].showStatus = true;
  361. }
  362. });
  363. },
  364. },
  365. onReachBottom() {
  366. if (this.current == 0) {
  367. if (this.list1.length < this.paramList[0].total) {
  368. this.paramList[0].pageNum++;
  369. this.courseList();
  370. }
  371. }
  372. if (this.current == 1) {
  373. if (this.list2.length < this.paramList[1].total) {
  374. this.paramList[1].pageNum++;
  375. this.bankList();
  376. }
  377. }
  378. },
  379. computed: { ...mapGetters(['userInfo']) }
  380. };
  381. </script>
  382. <style >
  383. ::-webkit-scrollbar {
  384. width: 0;
  385. height: 0;
  386. color: transparent;
  387. }
  388. page {
  389. background-color: #eaeef1;
  390. }
  391. </style>
  392. <style scoped lang="scss">
  393. .bg_color {
  394. width: 100%;
  395. height: 16rpx;
  396. background-color: #EAEEF1;
  397. }
  398. .check_ck {
  399. height: 211rpx;
  400. background: #FFFFFF;
  401. box-shadow: 0rpx 5rpx 5rpx 1rpx rgba(1,99,235,0.0500);
  402. border-radius: 24rpx 24rpx 0rpx 0rpx;
  403. padding: 0 38rpx;
  404. .again_ck {
  405. width: 25%;
  406. display: flex;
  407. align-items: center;
  408. justify-content: space-between;
  409. }
  410. }
  411. .checked {
  412. display: flex;
  413. justify-content: space-between;
  414. height: 108rpx;
  415. line-height: 108rpx;
  416. border-bottom: 1rpx solid #EEEEEE;
  417. font-size: 28rpx;
  418. .check_title {
  419. font-size: 32rpx;
  420. font-weight: 500;
  421. color: #333;
  422. white-space: nowrap;
  423. width: 75%;
  424. overflow-x: hidden;
  425. }
  426. }
  427. .contents {
  428. position: relative;
  429. left: 0;
  430. top: 320rpx;
  431. }
  432. .emptyTip{
  433. color: #999999;
  434. font-size: 32rpx;
  435. text-align: center;
  436. margin-top: 20%;
  437. }
  438. .popuBox{
  439. top: 92px;
  440. width: 100%;
  441. bottom:0;
  442. position:absolute;
  443. overflow-y:scroll;
  444. overflow-x:hidden;
  445. background-color: #FFFFFF;
  446. }
  447. .activeStys2{
  448. background: #007AFF !important;
  449. color: #FFFFFF;
  450. }
  451. .tylszB{
  452. text-align: center;
  453. padding:20rpx 10rpx;
  454. background: #FFFFFF;
  455. border: 2rpx solid #EEEEEE;
  456. border-radius: 16rpx;
  457. margin-top: 15rpx;
  458. font-size: 30rpx;
  459. overflow: hidden;
  460. white-space: nowrap;
  461. text-overflow: ellipsis;
  462. }
  463. .activeStys{
  464. background: linear-gradient(90deg, rgba(1,94,234,0.2),rgba(255,255,255,.6));
  465. border-radius: 16rpx;
  466. font-weight: bold;
  467. color: #007AFF!important;
  468. }
  469. .tylsz{
  470. color: #666;
  471. font-size: 30rpx;
  472. padding:20rpx 10rpx;
  473. margin-top: 15rpx;
  474. white-space: nowrap;
  475. }
  476. .popup_t1 {
  477. padding-left: 35rpx;
  478. border-bottom: 1rpx solid #eee;
  479. height: 57rpx;
  480. margin-top: 86rpx;
  481. font-weight: bold;
  482. color: #007AFF;
  483. font-size: 27rpx;
  484. }
  485. .flex-d {
  486. height:100%;
  487. background-color: #FFFFFF;
  488. padding: 0 5%;
  489. font-size: 30rpx;
  490. }
  491. .contentZ {
  492. display: flex;
  493. height: 100%;
  494. padding: 10rpx;
  495. .lzs {
  496. width:200rpx;
  497. height: 100%;
  498. overflow-y: scroll;
  499. }
  500. .rzs {
  501. margin-left:40rpx;
  502. flex:1;
  503. height: 100%;
  504. overflow-y: scroll;
  505. }
  506. }
  507. .contentZ::-webkit-scrollbar {
  508. display: none;
  509. }
  510. .fots {
  511. height: 100rpx;
  512. display: flex;
  513. align-items: center;
  514. justify-content: space-around;
  515. border-top: 1rpx solid #eee;
  516. }
  517. .leftBtns {
  518. font-size: 30rpx;
  519. color: #007AFF;
  520. font-weight: 500;
  521. }
  522. .right_Btns {
  523. font-size: 30rpx;
  524. color: #fff;
  525. background-color: #007AFF;
  526. border-radius: 24rpx;
  527. height: 60rpx;
  528. line-height: 60rpx;
  529. text-align: center;
  530. padding: 0rpx 23rpx;
  531. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  532. }
  533. .blackFont{
  534. color: #333333;
  535. margin: 0 10rpx;
  536. }
  537. .margin30 {
  538. margin:0 20rpx 0 0;
  539. }
  540. .wk_icon{
  541. width: 24rpx;
  542. height: 24rpx;
  543. margin-right: 12rpx;
  544. }
  545. .noteTag{
  546. font-size: 24rpx;
  547. font-family: PingFang SC;
  548. font-weight: 500;
  549. color: #999999;
  550. align-items: center;
  551. }
  552. .priceTag{
  553. font-size: 32rpx;
  554. font-family: PingFang SC;
  555. font-weight: bold;
  556. color: #FC3F3F;
  557. }
  558. .titleTag{
  559. font-size: 32rpx;
  560. font-weight: bold;
  561. color: #333333;
  562. margin-left: 8rpx;
  563. }
  564. .yearTag{
  565. width: 80rpx;
  566. height: 32rpx;
  567. background: #EBF5FF;
  568. border: 2rpx solid #007AFF;
  569. border-radius: 16rpx;
  570. font-size: 24rpx;
  571. color: #007AFF;
  572. text-align: center;
  573. line-height: 32rpx;
  574. }
  575. .itemBox{
  576. background: #FFFFFF;
  577. border-radius: 24rpx;
  578. width: 100%;
  579. padding: 23rpx 22rpx 32rpx 22rpx;
  580. margin-bottom: 24rpx;
  581. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
  582. }
  583. .listBox{
  584. background-color: #EAEEF1;
  585. padding: 24rpx 24rpx 150rpx 24rpx;
  586. position: relative;
  587. // top: 235rpx;
  588. }
  589. .menuSel{
  590. width: 100%;
  591. // height: 70rpx;
  592. padding: 30rpx 0rpx;
  593. background: #EAEEF1;
  594. white-space:nowrap;
  595. overflow: hidden;
  596. }
  597. .r_sliper{
  598. padding: 0 20rpx;
  599. }
  600. .r_t1{
  601. // height: 48rpx;
  602. background: #007AFF;
  603. border-radius: 8rpx;
  604. padding: 9rpx 21rpx;
  605. // margin-top: 11rpx;
  606. color: #FFFFFF;
  607. }
  608. .r_t2{
  609. // height: 48rpx;
  610. background: #FFFFFF;
  611. border: 2rpx solid #EEEEEE;
  612. border-radius: 8rpx;
  613. padding: 9rpx 21rpx;
  614. // margin-top: 11rpx;
  615. color:#666666;
  616. font-size: 30rpx;
  617. }
  618. </style>