resource.vue 14 KB

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