index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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. let that = this
  230. this.initList();
  231. setTimeout(function(){
  232. uni.stopPullDownRefresh()
  233. },500)
  234. },
  235. onLoad(option) {
  236. let eduStr = uni.getStorageSync('eduObj')
  237. if(eduStr){
  238. this.selObj = JSON.parse(eduStr)
  239. this.subjectList({businessId:this.selObj.bId,projectId:this.selObj.pId,educationId:this.selObj.eId})
  240. this.mergeBusiness()
  241. }else{
  242. this.show = true
  243. }
  244. this.initList();
  245. },
  246. methods: {
  247. mergeBusiness(){
  248. this.paramList[0].educationTypeId = this.selObj.eId
  249. this.paramList[0].businessId = this.selObj.bId
  250. this.paramList[0].subjectId = 0
  251. this.paramList[1].educationTypeId = this.selObj.eId
  252. this.paramList[1].businessId = this.selObj.bId
  253. this.paramList[1].subjectId = 0
  254. this.paramList[2].educationTypeId = this.selObj.eId
  255. this.paramList[2].businessId = this.selObj.bId
  256. this.paramList[2].subjectId = 0
  257. },
  258. subjectList(data) {
  259. var self = this;
  260. this.$api.subjectList(data).then(res => {
  261. if(res.data.code==200){
  262. self.sList = res.data.rows
  263. let allItem = {id:0,subjectName:'全部'}
  264. self.sList.unshift(allItem)
  265. }
  266. });
  267. },
  268. active2(item){
  269. this.selObj.bId = item.id
  270. this.show = false
  271. this.selObj.pId = item.projectId
  272. this.selObj.bName = item.businessName
  273. this.selObj.pName = item.projectName
  274. uni.setStorageSync('eduObj', JSON.stringify(this.selObj));
  275. this.subjectList({businessId:item.id,projectId:item.projectId,educationId:this.selObj.eId})
  276. this.mergeBusiness()
  277. //初始化
  278. this.initList();
  279. },
  280. businessList(data) {
  281. var self = this;
  282. this.$api.businessList(data).then(res => {
  283. if(res.data.code==200){
  284. self.bList = res.data.rows
  285. }
  286. });
  287. },
  288. active1(item){
  289. this.selObj.eId = item.id
  290. this.selObj.eName = item.educationName
  291. this.businessList({educationId:item.id})
  292. },
  293. educationList() {
  294. var self = this;
  295. this.$api.educationTypeList().then(res => {
  296. if(res.data.code==200){
  297. self.eList = res.data.rows
  298. if(self.selObj.eId){
  299. self.businessList({educationId:self.selObj.eId})
  300. } else {
  301. this.active1(self.eList[0])
  302. }
  303. }
  304. });
  305. },
  306. openLeft(){
  307. this.show = true
  308. },
  309. initList() {
  310. this.paramList[0].pageNum = 1
  311. this.paramList[1].pageNum = 1
  312. this.list1 = []
  313. this.list2 = []
  314. this.list3 = [];
  315. this.courseList();
  316. this.bankList();
  317. this.liveList()
  318. this.educationList()
  319. },
  320. cMenu(index){
  321. this.paramList[0].pageNum = 1
  322. this.paramList[0].subjectId= index;
  323. this.list1 = []
  324. // this.menuIndex
  325. this.courseList();
  326. },
  327. cMenu1(index){
  328. this.paramList[1].pageNum = 1
  329. this.paramList[1].subjectId= index;
  330. this.list2 = []
  331. // this.menuIndex1 = index;
  332. this.bankList();
  333. },
  334. cMenu2(index){
  335. this.paramList[2].pageNum = 1
  336. this.paramList[2].subjectId= index;
  337. this.list3 = []
  338. // this.menuIndex1 = index;
  339. this.liveList();
  340. },
  341. change(index){
  342. this.current = index;
  343. },
  344. //课程
  345. courseList() {
  346. var self = this;
  347. var param = this.paramList[0];
  348. this.$api.goodsList(param).then(res => {
  349. self.paramList[0].total = res.data.total;
  350. self.list1.push.apply(self.list1, res.data.rows);
  351. if (self.list1.length === res.data.total) {
  352. self.paramList[0].showStatus = true;
  353. }
  354. });
  355. },
  356. //题库
  357. bankList() {
  358. var self = this;
  359. var param = this.paramList[1];
  360. this.$api.goodsList(param).then(res => {
  361. self.paramList[1].total = res.data.total;
  362. self.list2.push.apply(self.list2, res.data.rows);
  363. if (self.list2.length === res.data.total) {
  364. self.paramList[1].showStatus = true;
  365. }
  366. });
  367. },
  368. //直播
  369. liveList() {
  370. var self = this;
  371. var param = this.paramList[2];
  372. this.$api.goodsList(param).then(res => {
  373. self.paramList[2].total = res.data.total;
  374. self.list3.push.apply(self.list3, res.data.rows);
  375. if (self.list3.length === res.data.total) {
  376. self.paramList[2].showStatus = true;
  377. }
  378. });
  379. },
  380. },
  381. onReachBottom() {
  382. if (this.current == 0) {
  383. if (this.list1.length < this.paramList[0].total) {
  384. this.paramList[0].pageNum++;
  385. this.courseList();
  386. }
  387. }
  388. if (this.current == 1) {
  389. if (this.list2.length < this.paramList[1].total) {
  390. this.paramList[1].pageNum++;
  391. this.bankList();
  392. }
  393. }
  394. },
  395. computed: { ...mapGetters(['userInfo']) }
  396. };
  397. </script>
  398. <style >
  399. ::-webkit-scrollbar {
  400. width: 0;
  401. height: 0;
  402. color: transparent;
  403. }
  404. page {
  405. background-color: #eaeef1;
  406. }
  407. </style>
  408. <style scoped lang="scss">
  409. .bg_color {
  410. width: 100%;
  411. height: 16rpx;
  412. background-color: #EAEEF1;
  413. }
  414. .check_ck {
  415. height: 211rpx;
  416. background: #FFFFFF;
  417. box-shadow: 0rpx 5rpx 5rpx 1rpx rgba(1,99,235,0.0500);
  418. border-radius: 24rpx 24rpx 0rpx 0rpx;
  419. padding: 0 38rpx;
  420. .again_ck {
  421. width: 25%;
  422. display: flex;
  423. align-items: center;
  424. justify-content: space-between;
  425. }
  426. }
  427. .checked {
  428. display: flex;
  429. justify-content: space-between;
  430. height: 108rpx;
  431. line-height: 108rpx;
  432. border-bottom: 1rpx solid #EEEEEE;
  433. font-size: 28rpx;
  434. .check_title {
  435. font-size: 32rpx;
  436. font-weight: 500;
  437. color: #333;
  438. white-space: nowrap;
  439. width: 75%;
  440. overflow-x: hidden;
  441. }
  442. }
  443. .contents {
  444. position: relative;
  445. left: 0;
  446. top: 320rpx;
  447. }
  448. .emptyTip{
  449. color: #999999;
  450. font-size: 32rpx;
  451. text-align: center;
  452. margin-top: 20%;
  453. }
  454. .popuBox{
  455. top: 92px;
  456. width: 100%;
  457. bottom:0;
  458. position:absolute;
  459. overflow-y:scroll;
  460. overflow-x:hidden;
  461. background-color: #FFFFFF;
  462. }
  463. .activeStys2{
  464. background: #007AFF !important;
  465. color: #FFFFFF;
  466. }
  467. .tylszB{
  468. text-align: center;
  469. padding:20rpx 10rpx;
  470. background: #FFFFFF;
  471. border: 2rpx solid #EEEEEE;
  472. border-radius: 16rpx;
  473. margin-top: 15rpx;
  474. font-size: 30rpx;
  475. overflow: hidden;
  476. white-space: nowrap;
  477. text-overflow: ellipsis;
  478. }
  479. .activeStys{
  480. background: linear-gradient(90deg, rgba(1,94,234,0.2),rgba(255,255,255,.6));
  481. border-radius: 16rpx;
  482. font-weight: bold;
  483. color: #007AFF!important;
  484. }
  485. .tylsz{
  486. color: #666;
  487. font-size: 30rpx;
  488. padding:20rpx 10rpx;
  489. margin-top: 15rpx;
  490. white-space: nowrap;
  491. }
  492. .popup_t1 {
  493. padding-left: 35rpx;
  494. border-bottom: 1rpx solid #eee;
  495. height: 57rpx;
  496. margin-top: 86rpx;
  497. font-weight: bold;
  498. color: #007AFF;
  499. font-size: 27rpx;
  500. }
  501. .flex-d {
  502. height:100%;
  503. background-color: #FFFFFF;
  504. padding: 0 5%;
  505. font-size: 30rpx;
  506. }
  507. .contentZ {
  508. display: flex;
  509. height: 100%;
  510. padding: 10rpx;
  511. .lzs {
  512. width:200rpx;
  513. height: 100%;
  514. overflow-y: scroll;
  515. }
  516. .rzs {
  517. margin-left:40rpx;
  518. flex:1;
  519. height: 100%;
  520. overflow-y: scroll;
  521. }
  522. }
  523. .contentZ::-webkit-scrollbar {
  524. display: none;
  525. }
  526. .fots {
  527. height: 100rpx;
  528. display: flex;
  529. align-items: center;
  530. justify-content: space-around;
  531. border-top: 1rpx solid #eee;
  532. }
  533. .leftBtns {
  534. font-size: 30rpx;
  535. color: #007AFF;
  536. font-weight: 500;
  537. }
  538. .right_Btns {
  539. font-size: 30rpx;
  540. color: #fff;
  541. background-color: #007AFF;
  542. border-radius: 24rpx;
  543. height: 60rpx;
  544. line-height: 60rpx;
  545. text-align: center;
  546. padding: 0rpx 23rpx;
  547. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  548. }
  549. .blackFont{
  550. color: #333333;
  551. margin: 0 10rpx;
  552. }
  553. .margin30 {
  554. margin:0 20rpx 0 0;
  555. }
  556. .wk_icon{
  557. width: 24rpx;
  558. height: 24rpx;
  559. margin-right: 12rpx;
  560. }
  561. .noteTag{
  562. font-size: 24rpx;
  563. font-family: PingFang SC;
  564. font-weight: 500;
  565. color: #999999;
  566. align-items: center;
  567. }
  568. .priceTag{
  569. font-size: 32rpx;
  570. font-family: PingFang SC;
  571. font-weight: bold;
  572. color: #FC3F3F;
  573. }
  574. .sale {
  575. color: #999999;
  576. font-size: 28rpx;
  577. margin-left: 8rpx;
  578. }
  579. .price_line {
  580. color: #999999;
  581. font-size: 28rpx;
  582. text-decoration:line-through;
  583. font-weight: 400;
  584. }
  585. .titleTag{
  586. font-size: 32rpx;
  587. font-weight: bold;
  588. color: #333333;
  589. margin-left: 8rpx;
  590. }
  591. .yearTag{
  592. width: 80rpx;
  593. height: 32rpx;
  594. background: #EBF5FF;
  595. border: 2rpx solid #007AFF;
  596. border-radius: 16rpx;
  597. font-size: 24rpx;
  598. color: #007AFF;
  599. text-align: center;
  600. line-height: 32rpx;
  601. }
  602. .itemBox{
  603. background: #FFFFFF;
  604. border-radius: 24rpx;
  605. width: 100%;
  606. padding: 23rpx 22rpx 32rpx 22rpx;
  607. margin-bottom: 24rpx;
  608. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
  609. }
  610. .listBox{
  611. background-color: #EAEEF1;
  612. padding: 24rpx 24rpx 150rpx 24rpx;
  613. position: relative;
  614. // top: 235rpx;
  615. }
  616. .menuSel{
  617. width: 100%;
  618. // height: 70rpx;
  619. padding: 30rpx 0rpx;
  620. background: #EAEEF1;
  621. white-space:nowrap;
  622. overflow: hidden;
  623. }
  624. .r_sliper{
  625. padding: 0 20rpx;
  626. }
  627. .r_t1{
  628. // height: 48rpx;
  629. background: #007AFF;
  630. border-radius: 8rpx;
  631. padding: 9rpx 21rpx;
  632. // margin-top: 11rpx;
  633. color: #FFFFFF;
  634. }
  635. .r_t2{
  636. // height: 48rpx;
  637. background: #FFFFFF;
  638. border: 2rpx solid #EEEEEE;
  639. border-radius: 8rpx;
  640. padding: 9rpx 21rpx;
  641. // margin-top: 11rpx;
  642. color:#666666;
  643. font-size: 30rpx;
  644. }
  645. </style>