index.vue 16 KB

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