index.vue 17 KB

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