resource.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <view class="resource">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="search">
  5. <uni-search-bar v-model="searchText" bgColor="#f0f2f5" class="btntop" placeholder="搜索" cancelButton="none"
  6. clearButton="none"></uni-search-bar>
  7. </view>
  8. <view class="top">
  9. <view class="left" @click="phoneLogin" :class="current == 0 ? info1 : info2">
  10. <text class="">资源库</text>
  11. <view v-if="current == 0" class="yun">
  12. <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
  13. </view>
  14. </view>
  15. <view class="right" @click="accountLogin" :class="current == 1 ? info1 : info2">
  16. <text class="">精品慕课</text>
  17. <view v-if="current == 1" class="yun">
  18. <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <swiper class="scroll-view-height" :style="{ height: swiper + 'px' }" @change="swipeIndex" :current="current"
  23. :duration="300">
  24. <swiper-item>
  25. <scroll-view scroll-y="true" :style="{ height: swiper + 'px' }">
  26. <view class="contBox">
  27. <view class="cont" @click="gotoLogin" v-for="(item, index) in filteredClassList" :index="index"
  28. :key="index">
  29. <image class="image" :src="item.url" mode="aspectFill" />
  30. <view class="tit btn-font">{{ item.className }}</view>
  31. <view class="teacher fz-font">主讲教师:{{ item.th_name }}</view>
  32. </view>
  33. </view>
  34. </scroll-view>
  35. </swiper-item>
  36. <swiper-item>
  37. <scroll-view scroll-y="true" :style="{ height: swiper + 'px' }">
  38. <view class="contBox">
  39. <view class="cont" @click="gotoWeb(index)" v-for="(item, index) in filteredClassList2"
  40. :index="index" :key="index">
  41. <image class="image" :src="item.url" mode="aspectFill" />
  42. <view class="tit btn-font">{{ item.className }}</view>
  43. <view class="teacher fz-font">主讲教师:{{ item.th_name }}</view>
  44. </view>
  45. </view>
  46. </scroll-view>
  47. </swiper-item>
  48. </swiper>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. navBarData: {
  56. title: "资源库",
  57. btn: 0,
  58. },
  59. current: 0, //登录方式切换
  60. info1: "info1", //类名
  61. info2: "info2",
  62. swiper: 0,
  63. searchText: "", // 搜索文本
  64. classList: [{
  65. url: "http://43.139.158.220:5007/img/static/pubic/img5.jpg",
  66. className: "创新思维",
  67. th_name: "吴伟",
  68. },
  69. {
  70. url: "http://43.139.158.220:5007/img/static/img/sc.jpg",
  71. className: "商机识别与创业营销 ",
  72. th_name: "明照凤 ",
  73. },
  74. {
  75. url: "http://43.139.158.220:5007/img/static/img/sg.jpg",
  76. className: "双创生态圈构建 ",
  77. th_name: "徐文泽",
  78. },
  79. {
  80. url: "http://43.139.158.220:5007/img/static/img/cy.jpg",
  81. className: "创业基础 ",
  82. th_name: "杨哲旗",
  83. },
  84. {
  85. url: "http://43.139.158.220:5007/img/static/img/ks.png",
  86. className: "跨界产品研发实战 ",
  87. th_name: "王程程",
  88. },
  89. {
  90. url: "http://43.139.158.220:5007/img/static/img/cs.jpg",
  91. className: "创造性思维与创新方法训练 ",
  92. th_name: "申珊珊",
  93. },
  94. {
  95. url: "http://43.139.158.220:5007/img/static/img/hs.jpg",
  96. className: "行业创业实践 ",
  97. th_name: "陆亚文",
  98. },
  99. {
  100. url: "http://43.139.158.220:5007/img/static/img/cx.png",
  101. className: "创新方法与训练 ",
  102. th_name: "张梦龙",
  103. },
  104. ],
  105. classList2: [{
  106. url: "http://43.139.158.220:5007/img/static/img/ydjk.png",
  107. className: "运动与健康",
  108. th_name: "代方梅 史文文 等",
  109. },
  110. {
  111. url: "http://43.139.158.220:5007/img/static/img/shyy.png",
  112. className: "生活英语听说",
  113. th_name: "杨芳 张文霞",
  114. },
  115. {
  116. url: "http://43.139.158.220:5007/img/static/img/yyll.jpg",
  117. className: "科研伦理与学术规范",
  118. th_name: "印波",
  119. },
  120. {
  121. url: "http://43.139.158.220:5007/img/static/img/kylw.png",
  122. className: "如何写好科研论文",
  123. th_name: "高飞飞 张靖 等",
  124. },
  125. {
  126. url: "http://43.139.158.220:5007/img/static/img/Cardimg-1.jpg",
  127. className: "中国共产党与中华民族伟大复兴",
  128. th_name: "杜玉芳",
  129. },
  130. {
  131. url: "http://43.139.158.220:5007/img/static/img/Cardimg-2.jpg",
  132. className: "大国航母与舰载机",
  133. th_name: "岳奎志 郭卫刚 等",
  134. },
  135. {
  136. url: "http://43.139.158.220:5007/img/static/img/Cardimg-4.jpg",
  137. className: "体育与社会",
  138. th_name: "张德胜 李菁 等",
  139. },
  140. {
  141. url: "http://43.139.158.220:5007/img/static/img/Cardimg-5.png",
  142. className: "公共管理学",
  143. th_name: "张学礼",
  144. },
  145. {
  146. url: "http://43.139.158.220:5007/img/static/img/Cardimg-6.png",
  147. className: "心理学概论",
  148. th_name: "彭凯平",
  149. },
  150. {
  151. url: "http://43.139.158.220:5007/img/static/img/Cardimg-7.png",
  152. className: "C++语言程序设计基础",
  153. th_name: "郑莉 李超 等",
  154. },
  155. {
  156. url: "http://43.139.158.220:5007/img/static/img/Cardimg-8.png",
  157. className: "《资治通鉴》导读",
  158. th_name: "张国刚",
  159. },
  160. {
  161. url: "http://43.139.158.220:5007/img/static/img/Cardimg-9.png",
  162. className: "军事理论",
  163. th_name: "徐焰杜 文龙 等",
  164. },
  165. {
  166. url: "http://43.139.158.220:5007/img/static/img/Cardimg-10.png",
  167. className: "数据结构(上)",
  168. th_name: "邓俊辉",
  169. },
  170. {
  171. url: "http://43.139.158.220:5007/img/static/img/Cardimg-11.png",
  172. className: "不朽的艺术:走进大师与经典",
  173. th_name: "肖鹰 孙晶",
  174. },
  175. {
  176. url: "http://43.139.158.220:5007/img/static/img/Cardimg-12.jpg",
  177. className: "中国近现代史纲要",
  178. th_name: "翁贺凯",
  179. },
  180. {
  181. url: "http://43.139.158.220:5007/img/static/img/Cardimg-13.png",
  182. className: "马克思主义基本原理",
  183. th_name: "刘震 刘恩至 等",
  184. },
  185. {
  186. url: "http://43.139.158.220:5007/img/static/img/Cardimg-14.png",
  187. className: "数据结构(下)",
  188. th_name: "邓俊辉",
  189. },
  190. {
  191. url: "http://43.139.158.220:5007/img/static/img/Cardimg-16.png",
  192. className: "大学生心理健康",
  193. th_name: "李焰 刘丹 等",
  194. },
  195. {
  196. url: "http://43.139.158.220:5007/img/static/img/Cardimg-17.png",
  197. className: "财务分析与决策",
  198. th_name: "肖星",
  199. },
  200. {
  201. url: "http://43.139.158.220:5007/img/static/img/Cardimg-15.png",
  202. className: "习近平新时代中国特色社会主义思想",
  203. th_name: "胡鞍钢",
  204. },
  205. ],
  206. };
  207. },
  208. // 模糊搜索
  209. computed: {
  210. filteredClassList() {
  211. const filteredList = this.classList.filter((item) =>
  212. item.className.includes(this.searchText)
  213. );
  214. return this.searchText ? filteredList : this.classList;
  215. },
  216. filteredClassList2() {
  217. const filterdList2 = this.classList2.filter((item) =>
  218. item.className.includes(this.searchText)
  219. );
  220. return this.searchText ? filterdList2 : this.classList2;
  221. },
  222. },
  223. methods: {
  224. gotoLogin() {
  225. // uni.navigateTo({
  226. // url: "/pages/login/login"
  227. // })
  228. const value = uni.getStorageSync("login");
  229. if (value == 0) {
  230. uni.navigateTo({
  231. url: "/pages/login/login",
  232. });
  233. } else if (this.current === 0) {
  234. const selectedItem = this.classList[this.current];
  235. const url =
  236. "https://zyk.icve.com.cn/chuangxin/18a329e8-3cd6-4983-a1aa-945a28198bc3";
  237. uni.navigateTo({
  238. url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
  239. });
  240. }
  241. },
  242. gotoWeb(index) {
  243. if (this.current === 1) {
  244. const url_header = 'https://www.xuetangx.com/course'
  245. const urls = [
  246. "/HUBU10011000132/16906642?channel=i.area.course_list_all",
  247. "/THU05021000376?channel=i.area.course_list_all",
  248. "/BNU03031000037/16905009?channel=i.area.course_list_all",
  249. "/THU04011000365/16906220?channel=i.area.course_list_all",
  250. "/zysy06011001641?channel=i.area.course_list_all",
  251. "/NAU08091000091/16904996?channel=i.area.course_list_all",
  252. "/Wuhanty04021002450/16906830?channel=i.area.course_list_all",
  253. "/NUDT12041000081?channel=i.area.course_list_all",
  254. "/THU07111000416/16905032?channel=i.area.course_list_all",
  255. "/THU08091000247/16906211?channel=i.area.course_list_all",
  256. "/THU03011000245/16905905?channel=i.area.course_list_all",
  257. "/NDU00001001710?channel=i.area.course_list_all",
  258. "/THU08091000384/16906679?channel=i.area.course_list_all",
  259. "/THU13011000261/16904949?channel=i.area.course_list_all",
  260. "/THU03051000444/16905083?channel=i.area.course_list_all",
  261. "/THU03051000344/16906535?channel=i.area.course_list_all",
  262. "/THU08091002048/16906478?channel=i.area.course_list_all",
  263. "/THU07111000285/16905861?channel=i.area.course_list_all",
  264. "/THU02031000264?channel=i.area.course_list_all",
  265. "/THU03051000744/16905028?channel=i.area.course_list_all"
  266. ];
  267. if (index >= 0 && index < urls.length) {
  268. const url = urls[index];
  269. uni.navigateTo({
  270. url: "/pages/skipone/skipone?url=" + url_header + encodeURIComponent(url),
  271. });
  272. }
  273. }
  274. },
  275. toggleActive1() {
  276. this.isActive1 = true;
  277. this.isActive2 = false;
  278. this.tab = true;
  279. },
  280. toggleActive2() {
  281. this.isActive1 = false;
  282. this.isActive2 = true;
  283. this.tab = false;
  284. },
  285. swipeIndex(index) {
  286. this.current = index.detail.current;
  287. },
  288. phoneLogin() {
  289. this.current = 0;
  290. },
  291. accountLogin() {
  292. this.current = 1;
  293. },
  294. },
  295. onReady() {},
  296. onLoad() {
  297. if (this.navheight) {
  298. this.swiper = this.screenHeight - this.navheight - 140;
  299. } else {
  300. this.swiper = this.screenHeight - this.customBar - 150;
  301. }
  302. },
  303. };
  304. </script>
  305. <style lang="scss" scoped>
  306. .btntop {
  307. width: 100%;
  308. }
  309. .resource {
  310. .search {
  311. background-color: #ffffff;
  312. position: relative;
  313. display: flex;
  314. width: 750rpx;
  315. height: 88rpx;
  316. justify-content: center;
  317. align-items: center;
  318. // background-color: rebeccapurple;
  319. .inpSer {
  320. width: 690rpx;
  321. height: 65rpx;
  322. margin: auto;
  323. background-color: rgba(240, 242, 245, 1);
  324. border-radius: 5rpx;
  325. color: rgba(0, 0, 0, 0.26);
  326. position: relative;
  327. .inpTxt {
  328. // padding: 0px, 12rpx, 0px, 12rpx;
  329. color: #000;
  330. height: 100%;
  331. width: 100%;
  332. }
  333. input::placeholder {
  334. color: #000;
  335. }
  336. .ico {
  337. position: absolute;
  338. top: 50%;
  339. left: 20rpx;
  340. transform: translate(0, -50%);
  341. display: flex;
  342. align-items: center;
  343. image {
  344. margin-right: 10rpx;
  345. }
  346. }
  347. }
  348. }
  349. .top {
  350. // width: 500rpx;
  351. display: flex;
  352. justify-content: space-between;
  353. margin: auto;
  354. background-color: #ffffff;
  355. padding: 10px 150rpx;
  356. // margin-bottom: 40px;
  357. // font-size: 18px;
  358. // padding-top: 0;
  359. .info1 {
  360. font-weight: bold !important;
  361. position: relative;
  362. color: rgba(0, 0, 0, 0.8);
  363. font-size: 34rpx;
  364. line-height: 48rpx;
  365. width: 136rpx;
  366. height: 48rpx;
  367. text-align: center;
  368. // font-family: PingFang SC;
  369. // font-family: \9ed1\4f53;
  370. .yun {
  371. width: 134rpx;
  372. height: 32rpx;
  373. position: absolute;
  374. left: 0;
  375. bottom: -10rpx;
  376. // transform: translate(-50%,0%);
  377. // box-shadow: 0px 10rpx 30rpx 6rpx #4a97f2;
  378. image {
  379. width: 100%;
  380. height: 100%;
  381. }
  382. }
  383. }
  384. .info2 {
  385. color: rgba(0, 0, 0, 0.6);
  386. font-size: 34rpx;
  387. font-weight: 400;
  388. line-height: 48rpx;
  389. width: 136rpx;
  390. height: 48rpx;
  391. text-align: center;
  392. font-family: 微软雅黑;
  393. }
  394. }
  395. .scroll-view-height {
  396. // background-color: ;
  397. // height: 68vh;
  398. // background-color: red;
  399. // padding-bottom: 50px;
  400. .contBox {
  401. width: 100%;
  402. padding: 10px 30rpx;
  403. // height: 100%;
  404. display: flex;
  405. flex-wrap: wrap;
  406. justify-content: space-between;
  407. // background-color: greenyellow;
  408. margin-bottom: 50px;
  409. .cont {
  410. background-color: #ffffff;
  411. width: 332rpx;
  412. padding: 20rpx 15rpx;
  413. border-radius: 10px;
  414. margin-bottom: 20rpx;
  415. image {
  416. width: 300rpx;
  417. height: 170rpx;
  418. border-radius: 10rpx;
  419. }
  420. .tit {
  421. width: 257rpx;
  422. margin: 10rpx 0;
  423. // height: 80rpx;
  424. font-weight: bold;
  425. white-space: normal;
  426. display: -webkit-box;
  427. word-break: break-all;
  428. text-overflow: ellipsis;
  429. overflow: hidden;
  430. -webkit-box-orient: vertical;
  431. -webkit-line-clamp: 2;
  432. /*设置 需要显示的行数*/
  433. }
  434. .teacher {
  435. color: #999999;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. </style>