index.vue 17 KB

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