index.vue 17 KB

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