indexold.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. <template>
  2. <view class="content">
  3. <view class="top-input"><u-search :showAction="false" placeholder="输入关键词搜索课程" @focus="toNext('/pages/index/search?vedio_status='+ info.vedio_status)" v-model="keyword"></u-search></view>
  4. <view class="swiper">
  5. <u-swiper :autoplay="true" :list="banner" keyName="img" height="140" border-radius="20" @click="bannerClick"></u-swiper>
  6. <view class="notice bb dffs">
  7. <image src="/static/img/pro/indnotice.png" mode=""></image>
  8. <swiper class="noswiper flex1" :autoplay="true" :interval="3000" vertical :duration="1000">
  9. <swiper-item @click="navTo(item)" v-for="(item, index) in notic" :key="index">
  10. <!-- <view class="swiper-item"></view> -->
  11. <view class="title fontmid">{{ item.title }}</view>
  12. </swiper-item>
  13. </swiper>
  14. <u-icon name="arrow-right"></u-icon>
  15. </view>
  16. </view>
  17. <navigator url="/pagesA/catList/catList">分类</navigator>
  18. <!-- 导航列表 -->
  19. <view class="nav">
  20. <sh-menu class="funliBox" :flag="0" :detail="nav" menu="5" :imgW="74"></sh-menu>
  21. </view>
  22. <!-- 导航列表 -->
  23. <view class="conwarp">
  24. <view class="gdHead dfsb"><view class="head">热门榜单</view></view>
  25. <view class="specGod dffs">
  26. <view @click="newxtTo(1, item, ite)" v-for="(item, index) in list_one" class="shopsLi" :key="index">
  27. <image class="bg" :src="'/static/img/temp/indbg' + (index + 1) + '.png'" mode=""></image>
  28. <view class="shopBox">
  29. <view class="topLeft">Top {{ item.num }}</view>
  30. <view class="title blod fontbase">{{ item.name }}</view>
  31. <view class="sub-title">共{{ item.count }}套|每天更新</view>
  32. <view class="line-list oneelli">
  33. <!-- @click="newxtTo(2, item, ite)" -->
  34. <view v-if="ind < 3" v-for="(ite, ind) in item.data" :key="ind" class="li oneelli">{{ ite.rank_num }}、{{ ite.desc }}</view>
  35. </view>
  36. <view class="all dffs">
  37. 查看全部{{ item.count }}套
  38. <u-icon name="arrow-right" color="#fff" size="10"></u-icon>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="conwarp fl-box">
  45. <view class="gdHead dfsb"><view class="head">活动专区</view></view>
  46. <view class="fl-two dfsb">
  47. <image @click="toNext('/pagesA/mall/mall?type=2')" :src="info.pintuan_img" mode="widthFix"></image>
  48. <image @click="toNext('/pagesA/mall/mall?type=3')" :src="info.miaosha_img" mode="widthFix"></image>
  49. </view>
  50. </view>
  51. <!-- -->
  52. <view v-if="info.vedio_status==1" class="conwarp fl-box">
  53. <view class="gdHead dfsb">
  54. <view class="head">教学视频</view>
  55. <view @click="toNext('/pages/index/video/video')" class="fontssm promain dffs">
  56. 查看更多
  57. <u-icon name="arrow-right" color="#025B58" size="10"></u-icon>
  58. </view>
  59. </view>
  60. <view class="fl-thr">
  61. <view class="thr-tab scrollx">
  62. <navigator :url="'/pages/index/video/video?cat='+item.id" class="li fontssm" :class="ind == 0 ? 'sel' : ''" v-for="(item, ind) in vedio_cats" :key="ind">{{ item.name }}</navigator>
  63. </view>
  64. <view class="tab-con scrollx dffs"><video-list :flag="1" :list="video_list"></video-list></view>
  65. </view>
  66. </view>
  67. <view class="conwarp fl-box">
  68. <view class="gdHead dfsb">
  69. <view class="titBox dffs">
  70. <view class="head">名校推荐</view>
  71. <!-- <view
  72. @click="toNext('/pages/index/school/school?type=' + item.id)"
  73. v-for="(item, ind) in school_type"
  74. :key="ind"
  75. :class="[ind == 0 ? 'head' : '', 'textgrey fontmid']"
  76. >
  77. {{ item.name }}
  78. </view> -->
  79. </view>
  80. <view @click="toNext('/pages/index/school/school?type=' + school_type[0].id)" class="fontssm promain dffs">
  81. 查看更多
  82. <u-icon name="arrow-right" color="#025B58" size="10"></u-icon>
  83. </view>
  84. </view>
  85. <view class="fl-four scrollx dffs">
  86. <view @click="toNext('/pages/index/school/schoolInfo?id=' + item.id)" class="schLi dffs" v-for="(item, ind) in school" :key="ind">
  87. <image class="bg" :src="item.logo" mode=""></image>
  88. <view class="shopBox flex1 dffd">
  89. <view class="bold fontmid oneelli">{{ item.name }}</view>
  90. <view class="textgrey desc fontssm">{{ item.brief }}</view>
  91. <view class="all dffs">
  92. 查看更多
  93. <u-icon name="arrow-right" color="#025B58" size="10"></u-icon>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="conwarp fl-box">
  100. <view class="gdHead dfsb">
  101. <view class="head">热门资料</view>
  102. <navigator url="/pagesA/mall/class" class="fontssm promain dffs">
  103. 查看更多
  104. <u-icon name="arrow-right" color="#025B58" size="10"></u-icon>
  105. </navigator>
  106. </view>
  107. <view class="fl-five"><shop-list :flag="1" :list="newsInfo"></shop-list></view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import shMenu from './components/sh-menu.vue';
  113. import videoList from '@/components/videoList.vue';
  114. import shopList from '@/components/shopList.vue';
  115. export default {
  116. components: {
  117. shMenu,
  118. shopList,
  119. videoList
  120. },
  121. data() {
  122. return {
  123. keyword: '',
  124. banner: [],
  125. notic: [],
  126. info:{},
  127. list_one: {},
  128. nav: [],
  129. dl_nav:[], //独立导航列表
  130. school: [],
  131. vedio_cats: [],
  132. school_type: '', //教学视频 选中
  133. video_list: [],
  134. newsInfo: [],
  135. page: 1,
  136. limit: 6
  137. };
  138. },
  139. onPullDownRefresh() {
  140. setTimeout(res => {
  141. uni.stopPullDownRefresh();
  142. }, 1000);
  143. this.newsInfo = [];
  144. this.page = 1;
  145. this.status = 'loadmore';
  146. this.getInfoList();
  147. },
  148. onReachBottom() {
  149. if (this.status == 'nomore') return;
  150. this.status = 'loading';
  151. this.page = ++this.page;
  152. this.getInfoList();
  153. },
  154. onLoad(opt) {
  155. var yqm = '';
  156. let scene = decodeURIComponent(opt.scene);
  157. if(scene)
  158. {
  159. let scene_arr = scene.split('=');
  160. var yqm = scene_arr[1];
  161. console.log(yqm);
  162. }
  163. // let yqm = opt.yqm || '';
  164. if(yqm)
  165. {
  166. uni.setStorageSync('yqm', yqm);
  167. }
  168. this.getInfoList();
  169. },
  170. onShareAppMessage() {
  171. let that = this;
  172. return {
  173. title: that.goodInfo.info.name,
  174. path: ""
  175. };
  176. },
  177. methods: {
  178. // 轮播
  179. bannerClick(e) {
  180. console.log('bannerClick:',e);
  181. let item = this.banner[e];
  182. console.log('item:',item);
  183. if (item.goods_id != 0) {
  184. switch(item.type)
  185. {
  186. case 1:
  187. uni.navigateTo({
  188. url: '/pages/index/navDet?id= ' + item.goods_id
  189. // url: '/pages/index/navInfo?id=' + item.goods_id
  190. });
  191. break;
  192. case 2:
  193. uni.navigateTo({
  194. url: '/pages/index/video/videoInfo?id=' + item.goods_id
  195. });
  196. break;
  197. case 3:
  198. uni.navigateTo({
  199. url: '/pages/news/newsInfo?type=2&id=' + item.goods_id
  200. });
  201. break;
  202. case 4:
  203. uni.navigateTo({
  204. url: '/pages/news/newsInfo?type=2&id=' + item.goods_id
  205. });
  206. break;
  207. }
  208. }
  209. },
  210. // 热门榜单 val 1列表 2.详情 type 1 文档 2 视频
  211. newxtTo(val, item, ite) {
  212. if (val == 1) {
  213. // /pages/index/classList?flag=2&subject_id=2&grade_id=1&title=资源类
  214. uni.navigateTo({
  215. url: `/pages/index/indHot?id=${item.id}&type=${item.type}`
  216. });
  217. return;
  218. }
  219. if (item.type == 1) {
  220. uni.navigateTo({
  221. url: '/pages/index/navDet?id=' + ite.id
  222. });
  223. } else {
  224. console.log(ite);
  225. uni.navigateTo({
  226. url: '/pages/index/video/videoInfo?id=' + ite.id
  227. });
  228. }
  229. },
  230. // 公告
  231. navTo(item) {
  232. console.log('navTo:',item);
  233. uni.navigateTo({
  234. url: '/pages/news/newsInfo?type=2&id=' + item.id
  235. });
  236. },
  237. getInfoList() {
  238. this.$api
  239. .request('index/index', {
  240. school_type: this.school_type || '',
  241. video_cat: this.vedio_cats || '',
  242. page: this.page,
  243. limit: this.limit
  244. })
  245. .then(data => {
  246. if (data.code == 200) {
  247. let dl_nav = data.data.dl_nav;
  248. let nav = data.data.nav;
  249. let hb = dl_nav.concat(nav);
  250. this.nav = hb;
  251. console.log('合并数组: ',hb);
  252. uni.setStorageSync('showVideo',data.data.vedio_status)
  253. this.info =data.data;
  254. this.school_type = data.data.school_type;
  255. this.vedio_cats = data.data.vedio_cats;
  256. this.list_one = data.data.list_one;
  257. // this.nav = data.data.nav;
  258. this.school = data.data.school;
  259. this.banner = data.data.banner;
  260. this.notic = data.data.notic;
  261. this.video_list = data.data.video_list;
  262. this.newsInfo = this.newsInfo.concat(data.data.goods);
  263. console.log(this.newsInfo);
  264. if (data.data.goods.length < this.limit) {
  265. this.status = 'nomore';
  266. }
  267. } else {
  268. this.$api.toast(data.msg);
  269. }
  270. });
  271. },
  272. toNext(url) {
  273. console.log(11);
  274. uni.navigateTo({
  275. url: url
  276. });
  277. }
  278. }
  279. };
  280. </script>
  281. <style lang="scss" scoped>
  282. .content {
  283. .top-input {
  284. padding: 20rpx 30rpx;
  285. }
  286. .swiper {
  287. margin: 0 30rpx;
  288. }
  289. .notice {
  290. padding: 35rpx 0 33rpx;
  291. image {
  292. width: 66rpx;
  293. height: 31rpx;
  294. margin-right: 28rpx;
  295. }
  296. .title {
  297. border-left: 1rpx solid #bfbfbf;
  298. flex: 1;
  299. padding: 0 26rpx;
  300. }
  301. .noswiper {
  302. height: 50rpx;
  303. }
  304. }
  305. .nav {
  306. margin: 25rpx 30rpx 0;
  307. }
  308. .conwarp {
  309. margin-left: 32rpx;
  310. border-radius: 16rpx;
  311. .gdHead {
  312. line-height: 58rpx;
  313. margin-bottom: 16rpx;
  314. .head {
  315. font-size: 34rpx;
  316. font-family: PingFangSC-Medium, PingFang SC;
  317. font-weight: 600;
  318. color: #333333;
  319. line-height: 48rpx;
  320. }
  321. .fontmid {
  322. margin-right: 10rpx;
  323. }
  324. }
  325. .specGod {
  326. padding: 5rpx 5rpx 10rpx;
  327. // flex-wrap: wrap;
  328. display: -webkit-box;
  329. overflow-x: auto;
  330. &::-webkit-scrollbar {
  331. display: none;
  332. }
  333. .shopsLi {
  334. margin-right: 30rpx;
  335. width: 286rpx;
  336. height: 331rpx;
  337. border-radius: 16rpx;
  338. overflow: hidden;
  339. position: relative;
  340. .bg {
  341. position: absolute;
  342. top: 0;
  343. left: 0;
  344. width: 286rpx;
  345. height: 431rpx;
  346. }
  347. .shopBox {
  348. width: 100%;
  349. position: absolute;
  350. top: 0;
  351. left: 0;
  352. z-index: 2;
  353. padding: 22rpx 18rpx 20rpx;
  354. .topLeft {
  355. background: linear-gradient(90deg, #fdd597 0%, #eec37a 100%);
  356. border-radius: 15rpx;
  357. font-size: 18rpx;
  358. font-family: PingFangSC-Medium, PingFang SC;
  359. font-weight: 500;
  360. line-height: 25rpx;
  361. padding: 5rpx 12rpx;
  362. width: 120rpx;
  363. }
  364. .title {
  365. font-family: PingFangSC-Semibold, PingFang SC;
  366. font-weight: 600;
  367. color: #ffffff;
  368. line-height: 42rpx;
  369. margin: 9rpx 5rpx 10rpx;
  370. }
  371. .sub-title {
  372. font-size: 18rpx;
  373. font-family: PingFangSC-Light, PingFang SC;
  374. font-weight: 300;
  375. color: #ffffff;
  376. line-height: 25rpx;
  377. }
  378. .line-list {
  379. margin-top: 27rpx;
  380. .li {
  381. width: 100%;
  382. font-size: 20rpx;
  383. color: #ffffff;
  384. line-height: 28rpx;
  385. margin-bottom: 13rpx;
  386. }
  387. }
  388. .all {
  389. font-size: 16rpx;
  390. font-family: PingFangSC-Light, PingFang SC;
  391. font-weight: 300;
  392. color: #ffffff;
  393. line-height: 22rpx;
  394. justify-content: center;
  395. align-items: center;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .fl-box {
  402. margin: 30rpx 30rpx 0;
  403. .fl-two {
  404. image {
  405. width: 340rpx;
  406. }
  407. }
  408. .fl-thr {
  409. .thr-tab {
  410. .li {
  411. background: #f2f2f2;
  412. border-radius: 27rpx;
  413. color: #999;
  414. padding: 8rpx 15rpx;
  415. margin-right: 20rpx;
  416. }
  417. .sel {
  418. color: $promain;
  419. font-weight: 500rpx;
  420. background: rgba(2, 91, 88, 0.1);
  421. border-radius: 27rpx;
  422. border: 1px solid #025b58;
  423. }
  424. }
  425. .tab-con {
  426. margin-top: 30rpx;
  427. // width: 100%;
  428. }
  429. }
  430. .titBox {
  431. &:nth-of-type(2) {
  432. margin-left: 30rpx;
  433. }
  434. }
  435. .fl-four {
  436. margin-top: 21rpx;
  437. .schLi {
  438. width: 430rpx;
  439. background-color: #fff;
  440. margin-right: 20rpx;
  441. padding: 12rpx 10rpx;
  442. .bg {
  443. width: 149rpx;
  444. height: 149rpx;
  445. margin-right: 16rpx;
  446. }
  447. .shopBox {
  448. width: 240rpx;
  449. .oneelli {
  450. width: 100%;
  451. }
  452. .desc {
  453. margin: 12rpx 0 27rpx;
  454. font-family: PingFangSC-Light, PingFang SC;
  455. font-weight: 300;
  456. line-height: 34rpx;
  457. text-overflow: -o-ellipsis-lastline;
  458. overflow: hidden;
  459. text-overflow: ellipsis;
  460. display: -webkit-box;
  461. -webkit-line-clamp: 2;
  462. line-clamp: 2;
  463. -webkit-box-orient: vertical;
  464. }
  465. .all {
  466. padding: 6rpx 18rpx;
  467. background: rgba(#025b58, 0.2);
  468. border-radius: 21rpx;
  469. font-size: 20rpx;
  470. color: $promain;
  471. align-self: flex-end;
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. </style>