index.vue 16 KB

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