resource.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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. uni.navigateTo({
  184. url: "/pages/login/login"
  185. })
  186. } else {
  187. console.log(111);
  188. }
  189. },
  190. toggleActive1() {
  191. this.isActive1 = true;
  192. this.isActive2 = false;
  193. this.tab = true;
  194. },
  195. toggleActive2() {
  196. this.isActive1 = false;
  197. this.isActive2 = true;
  198. this.tab = false;
  199. },
  200. swipeIndex(index) {
  201. this.current = index.detail.current;
  202. },
  203. phoneLogin() {
  204. this.current = 0
  205. },
  206. accountLogin() {
  207. this.current = 1
  208. },
  209. },
  210. onReady() {
  211. },
  212. onLoad() {
  213. // console.log(this.screenHeight);
  214. // console.log(this.navheight);
  215. console.log(this.tabBarHeight);
  216. if (this.navheight) {
  217. this.swiper = this.screenHeight - this.navheight - 140
  218. } else {
  219. this.swiper = this.screenHeight - this.customBar - 150
  220. }
  221. }
  222. };
  223. </script>
  224. <style lang="scss" scoped>
  225. .resource {
  226. .search {
  227. background-color: #ffffff;
  228. position: relative;
  229. display: flex;
  230. width: 750rpx;
  231. height: 88rpx;
  232. justify-content: center;
  233. align-items: center;
  234. // background-color: rebeccapurple;
  235. .inpSer {
  236. width: 690rpx;
  237. height: 65rpx;
  238. margin: auto;
  239. background-color: rgba(240, 242, 245, 1);
  240. border-radius: 5rpx;
  241. color: rgba(0, 0, 0, 0.26);
  242. position: relative;
  243. .inpTxt {
  244. // padding: 0px, 12rpx, 0px, 12rpx;
  245. color: #000;
  246. padding-left: 60rpx;
  247. height: 100%;
  248. width: 100%;
  249. }
  250. input::placeholder {
  251. color: #000;
  252. }
  253. .ico {
  254. position: absolute;
  255. top: 50%;
  256. left: 20rpx;
  257. transform: translate(0, -50%);
  258. display: flex;
  259. align-items: center;
  260. image {
  261. margin-right: 10rpx;
  262. }
  263. }
  264. }
  265. }
  266. .top {
  267. // width: 500rpx;
  268. display: flex;
  269. justify-content: space-between;
  270. margin: auto;
  271. background-color: #ffffff;
  272. padding: 10px 150rpx;
  273. // margin-bottom: 40px;
  274. // font-size: 18px;
  275. // padding-top: 0;
  276. .info1 {
  277. font-weight: bold !important;
  278. position: relative;
  279. color: rgba(0, 0, 0, 0.8);
  280. font-size: 34rpx;
  281. line-height: 48rpx;
  282. width: 136rpx;
  283. height: 48rpx;
  284. text-align: center;
  285. // font-family: PingFang SC;
  286. // font-family: \9ed1\4f53;
  287. .yun {
  288. width: 134rpx;
  289. height: 32rpx;
  290. position: absolute;
  291. left: 0;
  292. bottom: -10rpx;
  293. // transform: translate(-50%,0%);
  294. // box-shadow: 0px 10rpx 30rpx 6rpx #4a97f2;
  295. image {
  296. width: 100%;
  297. height: 100%;
  298. }
  299. }
  300. }
  301. .info2 {
  302. color: rgba(0, 0, 0, 0.6);
  303. font-size: 34rpx;
  304. font-weight: 400;
  305. line-height: 48rpx;
  306. width: 136rpx;
  307. height: 48rpx;
  308. text-align: center;
  309. font-family: 微软雅黑;
  310. }
  311. }
  312. .scroll-view-height {
  313. // background-color: ;
  314. // height: 68vh;
  315. // background-color: red;
  316. // padding-bottom: 50px;
  317. .contBox {
  318. width: 100%;
  319. padding: 10px 30rpx;
  320. // height: 100%;
  321. display: flex;
  322. flex-wrap: wrap;
  323. justify-content: space-between;
  324. // background-color: greenyellow;
  325. margin-bottom: 50px;
  326. .cont {
  327. background-color: #ffffff;
  328. width: 332rpx;
  329. padding: 20rpx 15rpx;
  330. border-radius: 10px;
  331. margin-bottom: 20rpx;
  332. image {
  333. width: 300rpx;
  334. height: 170rpx;
  335. border-radius: 10rpx;
  336. }
  337. .tit {
  338. width: 257rpx;
  339. margin: 10rpx 0;
  340. // height: 80rpx;
  341. font-weight: bold;
  342. white-space: normal;
  343. display: -webkit-box;
  344. word-break: break-all;
  345. text-overflow: ellipsis;
  346. overflow: hidden;
  347. -webkit-box-orient: vertical;
  348. -webkit-line-clamp: 2;
  349. /*设置 需要显示的行数*/
  350. }
  351. .teacher {
  352. color: #999999;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. </style>