resource.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="resource">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="search">
  5. <view class="inpSer">
  6. <!-- <input type="text" class="inpTxt" placeholder="搜索"> -->
  7. <input type="text" class="inpTxt" placeholder-class="fwb-font" placeholder="请输入文本" />
  8. <view class="ico">
  9. <image src="http://43.139.158.220:5007/img/static/yym/union.png" style="width: 28rpx;height: 28rpx;"
  10. mode="aspectFill"></image>
  11. <!-- <text class="fwb-font">搜索</text> -->
  12. </view>
  13. </view>
  14. <!-- <view class="inpSer">
  15. </view> -->
  16. <!-- <uni-search-bar bgColor="#f0f2f5" placeholder="搜索" cancelButton="none" clearButton="none"></uni-search-bar> -->
  17. </view>
  18. <view class="top">
  19. <view class="left" @click="phoneLogin" :class="current==0?info1:info2">
  20. <text class="">资源库</text>
  21. <view v-if="current==0" class="yun">
  22. <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
  23. </view>
  24. </view>
  25. <view class="right" @click="accountLogin" :class="current==1?info1:info2">
  26. <text class="">精品慕课</text>
  27. <view v-if="current==1" class="yun">
  28. <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
  29. </view>
  30. </view>
  31. </view>
  32. <swiper class="scroll-view-height" :style="{height:swiper+'px'}" @change="swipeIndex" :current="current"
  33. :duration="300">
  34. <swiper-item>
  35. <scroll-view scroll-y="true" :style="{height:swiper+'px'}">
  36. <view class="contBox">
  37. <!-- <view class="cont" v-for="i in 10"> -->
  38. <view class="cont" v-for="(item, index) in classList" :index="index" :key="index">
  39. <image class="image" :src="item.url" mode="aspectFill" />
  40. <view class="tit btn-font">{{ item.className }}</view>
  41. <view class="teacher fz-font">{{ item.th_name }}</view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </swiper-item>
  46. <swiper-item>
  47. <scroll-view scroll-y="true" :style="{height:swiper+'px'}">
  48. <view class="contBox">
  49. <!-- <view class="cont" v-for="i in 10"> -->
  50. <view class="cont" v-for="(item, index) in classList2" :index="index" :key="index">
  51. <image class="image" :src="item.url" mode="aspectFill" />
  52. <view class="tit btn-font">{{ item.className }}</view>
  53. <view class="teacher fz-font">{{ item.th_name }}</view>
  54. </view>
  55. </view>
  56. </scroll-view>
  57. </swiper-item>
  58. </swiper>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. navBarData: {
  66. title: '资源库',
  67. btn: 0
  68. },
  69. current: 0, //登录方式切换
  70. info1: 'info1', //类名
  71. info2: 'info2',
  72. swiper: 0,
  73. classList: [{
  74. url: 'http://43.139.158.220:5007/img/static/pubic/img5.jpg',
  75. className: '创新思维',
  76. th_name: '主讲教师: 吴伟'
  77. },
  78. {
  79. url: 'http://43.139.158.220:5007/img/static/pubic/img4.jpg',
  80. className: '打造无敌商业计划书',
  81. th_name: '主讲教师: '
  82. },
  83. {
  84. url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
  85. className: '创业经营',
  86. th_name: '主讲教师: 黄伟贤'
  87. },
  88. {
  89. url: 'http://43.139.158.220:5007/img/static/pubic/img1.jpg',
  90. className: '创业者管理能力训练基础',
  91. th_name: '主讲教师: 李芳'
  92. },
  93. {
  94. url: 'http://43.139.158.220:5007/img/static/pubic/img3.jpg',
  95. className: '创业基础',
  96. th_name: '主讲教师: 杨哲气'
  97. },
  98. {
  99. url: 'http://43.139.158.220:5007/img/static/pubic/img2.jpg',
  100. className: '创业融资实务',
  101. th_name: '主讲教师: 郑修'
  102. },
  103. {
  104. url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
  105. className: '精益创业方法论',
  106. th_name: '主讲教师: 陈旭华'
  107. }, {
  108. url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
  109. className: '创业经营',
  110. th_name: '主讲教师: 黄伟贤'
  111. },
  112. {
  113. url: 'http://43.139.158.220:5007/img/static/pubic/img7.jpg',
  114. className: '跨境电商创业',
  115. th_name: '主讲教师: 陈旭华'
  116. },
  117. {
  118. url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
  119. className: '精益创业方法论',
  120. th_name: '主讲教师: 陈旭华'
  121. },
  122. ],
  123. classList2: [
  124. {
  125. url: 'http://43.139.158.220:5007/img/static/pubic/img1.jpg',
  126. className: '创业者管理能力训练基础',
  127. th_name: '主讲教师: 李芳'
  128. },
  129. {
  130. url: 'http://43.139.158.220:5007/img/static/pubic/img3.jpg',
  131. className: '创业基础',
  132. th_name: '主讲教师: 杨哲气'
  133. },
  134. {
  135. url: 'http://43.139.158.220:5007/img/static/pubic/img2.jpg',
  136. className: '创业融资实务',
  137. th_name: '主讲教师: 郑修'
  138. },
  139. {
  140. url: 'http://43.139.158.220:5007/img/static/pubic/img5.jpg',
  141. className: '创新思维',
  142. th_name: '主讲教师: 吴伟'
  143. },
  144. {
  145. url: 'http://43.139.158.220:5007/img/static/pubic/img7.jpg',
  146. className: '跨境电商创业',
  147. th_name: '主讲教师: 陈旭华'
  148. },
  149. {
  150. url: 'http://43.139.158.220:5007/img/static/pubic/img4.jpg',
  151. className: '打造无敌商业计划书',
  152. th_name: '主讲教师: '
  153. },
  154. {
  155. url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
  156. className: '创业经营',
  157. th_name: '主讲教师: 黄伟贤'
  158. },
  159. {
  160. url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
  161. className: '精益创业方法论',
  162. th_name: '主讲教师: 陈旭华'
  163. }, {
  164. url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
  165. className: '创业经营',
  166. th_name: '主讲教师: 黄伟贤'
  167. },
  168. {
  169. url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
  170. className: '精益创业方法论',
  171. th_name: '主讲教师: 陈旭华'
  172. },
  173. ],
  174. };
  175. },
  176. methods: {
  177. toggleActive1() {
  178. this.isActive1 = true;
  179. this.isActive2 = false;
  180. this.tab = true;
  181. },
  182. toggleActive2() {
  183. this.isActive1 = false;
  184. this.isActive2 = true;
  185. this.tab = false;
  186. },
  187. swipeIndex(index) {
  188. this.current = index.detail.current;
  189. },
  190. phoneLogin() {
  191. this.current = 0
  192. },
  193. accountLogin() {
  194. this.current = 1
  195. },
  196. },
  197. onReady() {
  198. },
  199. onLoad() {
  200. // console.log(this.screenHeight);
  201. // console.log(this.navheight);
  202. console.log(this.tabBarHeight);
  203. if (this.navheight) {
  204. this.swiper = this.screenHeight - this.navheight - 140
  205. } else {
  206. this.swiper = this.screenHeight - this.customBar - 150
  207. }
  208. }
  209. };
  210. </script>
  211. <style lang="scss" scoped>
  212. .resource {
  213. .search {
  214. background-color: #ffffff;
  215. position: relative;
  216. display: flex;
  217. width: 750rpx;
  218. height: 88rpx;
  219. justify-content: center;
  220. align-items: center;
  221. // background-color: rebeccapurple;
  222. .inpSer {
  223. width: 690rpx;
  224. height: 65rpx;
  225. margin: auto;
  226. background-color: rgba(240, 242, 245, 1);
  227. border-radius: 5rpx;
  228. color: rgba(0, 0, 0, 0.26);
  229. position: relative;
  230. .inpTxt {
  231. // padding: 0px, 12rpx, 0px, 12rpx;
  232. color: #000;
  233. padding-left: 60rpx;
  234. height: 100%;
  235. width: 100%;
  236. }
  237. input::placeholder {
  238. color: #000;
  239. }
  240. .ico {
  241. position: absolute;
  242. top: 50%;
  243. left: 20rpx;
  244. transform: translate(0, -50%);
  245. display: flex;
  246. align-items: center;
  247. image {
  248. margin-right: 10rpx;
  249. }
  250. }
  251. }
  252. }
  253. .top {
  254. // width: 500rpx;
  255. display: flex;
  256. justify-content: space-between;
  257. margin: auto;
  258. background-color: #ffffff;
  259. padding: 10px 150rpx;
  260. // margin-bottom: 40px;
  261. // font-size: 18px;
  262. // padding-top: 0;
  263. .info1 {
  264. font-weight: bold !important;
  265. position: relative;
  266. color: rgba(0, 0, 0, 0.8);
  267. font-size: 34rpx;
  268. line-height: 48rpx;
  269. width: 136rpx;
  270. height: 48rpx;
  271. text-align: center;
  272. // font-family: PingFang SC;
  273. // font-family: \9ed1\4f53;
  274. .yun {
  275. width: 134rpx;
  276. height: 32rpx;
  277. position: absolute;
  278. left: 0;
  279. bottom: -10rpx;
  280. // transform: translate(-50%,0%);
  281. // box-shadow: 0px 10rpx 30rpx 6rpx #4a97f2;
  282. image {
  283. width: 100%;
  284. height: 100%;
  285. }
  286. }
  287. }
  288. .info2 {
  289. color: rgba(0, 0, 0, 0.6);
  290. font-size: 34rpx;
  291. font-weight: 400;
  292. line-height: 48rpx;
  293. width: 136rpx;
  294. height: 48rpx;
  295. text-align: center;
  296. font-family: 微软雅黑;
  297. }
  298. }
  299. .scroll-view-height {
  300. // background-color: ;
  301. // height: 68vh;
  302. // background-color: red;
  303. // padding-bottom: 50px;
  304. .contBox {
  305. width: 100%;
  306. padding: 10px 30rpx;
  307. // height: 100%;
  308. display: flex;
  309. flex-wrap: wrap;
  310. justify-content: space-between;
  311. // background-color: greenyellow;
  312. margin-bottom: 50px;
  313. .cont {
  314. background-color: #ffffff;
  315. width: 332rpx;
  316. padding: 20rpx 15rpx;
  317. border-radius: 10px;
  318. margin-bottom: 20rpx;
  319. image {
  320. width: 300rpx;
  321. height: 170rpx;
  322. border-radius: 10rpx;
  323. }
  324. .tit {
  325. width: 257rpx;
  326. margin: 10rpx 0;
  327. // height: 80rpx;
  328. font-weight: bold;
  329. white-space: normal;
  330. display: -webkit-box;
  331. word-break: break-all;
  332. text-overflow: ellipsis;
  333. overflow: hidden;
  334. -webkit-box-orient: vertical;
  335. -webkit-line-clamp: 2;
  336. /*设置 需要显示的行数*/
  337. }
  338. .teacher {
  339. color: #999999;
  340. }
  341. }
  342. }
  343. }
  344. }
  345. </style>