resource.vue 9.6 KB

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