123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <template>
- <view class="resource">
- <statusBar :item="navBarData"></statusBar>
- <view class="search">
- <view class="inpSer">
- <!-- <input type="text" class="inpTxt" placeholder="搜索"> -->
- <input type="text" class="inpTxt" placeholder-class="fwb-font" placeholder="请输入文本" />
- <view class="ico">
- <image src="http://43.139.158.220:5007/img/static/yym/union.png" style="width: 28rpx;height: 28rpx;"
- mode="aspectFill"></image>
- <!-- <text class="fwb-font">搜索</text> -->
- </view>
- </view>
- <!-- <view class="inpSer">
-
- </view> -->
- <!-- <uni-search-bar bgColor="#f0f2f5" placeholder="搜索" cancelButton="none" clearButton="none"></uni-search-bar> -->
- </view>
- <view class="top">
- <view class="left" @click="phoneLogin" :class="current==0?info1:info2">
- <text class="">资源库</text>
- <view v-if="current==0" class="yun">
- <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
- </view>
- </view>
- <view class="right" @click="accountLogin" :class="current==1?info1:info2">
- <text class="">精品慕课</text>
- <view v-if="current==1" class="yun">
- <image src="http://43.139.158.220:5007/img/static/yym/Ellipse 10.png" mode="aspectFill"></image>
- </view>
- </view>
- </view>
- <swiper class="scroll-view-height" :style="{height:swiper+'px'}" @change="swipeIndex" :current="current"
- :duration="300">
- <swiper-item>
- <scroll-view scroll-y="true" :style="{height:swiper+'px'}">
- <view class="contBox">
- <!-- <view class="cont" v-for="i in 10"> -->
- <view class="cont" @click="gotoLogin" v-for="(item, index) in classList" :index="index"
- :key="index">
- <image class="image" :src="item.url" mode="aspectFill" />
- <view class="tit btn-font">{{ item.className }}</view>
- <view class="teacher fz-font">{{ item.th_name }}</view>
- </view>
- </view>
- </scroll-view>
- </swiper-item>
- <swiper-item>
- <scroll-view scroll-y="true" :style="{height:swiper+'px'}">
- <view class="contBox">
- <!-- <view class="cont" v-for="i in 10"> -->
- <view class="cont" v-for="(item, index) in classList2" :index="index" :key="index">
- <image class="image" :src="item.url" mode="aspectFill" />
- <view class="tit btn-font">{{ item.className }}</view>
- <view class="teacher fz-font">{{ item.th_name }}</view>
- </view>
- </view>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- navBarData: {
- title: '资源库',
- btn: 0
- },
- current: 0, //登录方式切换
- info1: 'info1', //类名
- info2: 'info2',
- swiper: 0,
- classList: [{
- url: 'http://43.139.158.220:5007/img/static/pubic/img5.jpg',
- className: '创新思维',
- th_name: '主讲教师: 吴伟'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img4.jpg',
- className: '打造无敌商业计划书',
- th_name: '主讲教师: '
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
- className: '创业经营',
- th_name: '主讲教师: 黄伟贤'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img1.jpg',
- className: '创业者管理能力训练基础',
- th_name: '主讲教师: 李芳'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img3.jpg',
- className: '创业基础',
- th_name: '主讲教师: 杨哲气'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img2.jpg',
- className: '创业融资实务',
- th_name: '主讲教师: 郑修'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
- className: '精益创业方法论',
- th_name: '主讲教师: 陈旭华'
- }, {
- url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
- className: '创业经营',
- th_name: '主讲教师: 黄伟贤'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img7.jpg',
- className: '跨境电商创业',
- th_name: '主讲教师: 陈旭华'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
- className: '精益创业方法论',
- th_name: '主讲教师: 陈旭华'
- },
- ],
- classList2: [{
- url: 'http://43.139.158.220:5007/img/static/pubic/img1.jpg',
- className: '创业者管理能力训练基础',
- th_name: '主讲教师: 李芳'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img3.jpg',
- className: '创业基础',
- th_name: '主讲教师: 杨哲气'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img2.jpg',
- className: '创业融资实务',
- th_name: '主讲教师: 郑修'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img5.jpg',
- className: '创新思维',
- th_name: '主讲教师: 吴伟'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img7.jpg',
- className: '跨境电商创业',
- th_name: '主讲教师: 陈旭华'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img4.jpg',
- className: '打造无敌商业计划书',
- th_name: '主讲教师: '
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
- className: '创业经营',
- th_name: '主讲教师: 黄伟贤'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
- className: '精益创业方法论',
- th_name: '主讲教师: 陈旭华'
- }, {
- url: 'http://43.139.158.220:5007/img/static/pubic/img6.jpg',
- className: '创业经营',
- th_name: '主讲教师: 黄伟贤'
- },
- {
- url: 'http://43.139.158.220:5007/img/static/pubic/img8.jpg',
- className: '精益创业方法论',
- th_name: '主讲教师: 陈旭华'
- },
- ],
- };
- },
- methods: {
- gotoLogin() {
- uni.navigateTo({
- url: "/pages/login/login"
- })
- // const value = uni.getStorageSync('login');
- // if (value == 0) {
- // } else {
- // console.log(111);
- // }
- },
- toggleActive1() {
- this.isActive1 = true;
- this.isActive2 = false;
- this.tab = true;
- },
- toggleActive2() {
- this.isActive1 = false;
- this.isActive2 = true;
- this.tab = false;
- },
- swipeIndex(index) {
- this.current = index.detail.current;
- },
- phoneLogin() {
- this.current = 0
- },
- accountLogin() {
- this.current = 1
- },
- },
- onReady() {
- },
- onLoad() {
- // console.log(this.screenHeight);
- // console.log(this.navheight);
- console.log(this.tabBarHeight);
- if (this.navheight) {
- this.swiper = this.screenHeight - this.navheight - 140
- } else {
- this.swiper = this.screenHeight - this.customBar - 150
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .resource {
- .search {
- background-color: #ffffff;
- position: relative;
- display: flex;
- width: 750rpx;
- height: 88rpx;
- justify-content: center;
- align-items: center;
- // background-color: rebeccapurple;
- .inpSer {
- width: 690rpx;
- height: 65rpx;
- margin: auto;
- background-color: rgba(240, 242, 245, 1);
- border-radius: 5rpx;
- color: rgba(0, 0, 0, 0.26);
- position: relative;
- .inpTxt {
- // padding: 0px, 12rpx, 0px, 12rpx;
- color: #000;
- padding-left: 60rpx;
- height: 100%;
- width: 100%;
- }
- input::placeholder {
- color: #000;
- }
- .ico {
- position: absolute;
- top: 50%;
- left: 20rpx;
- transform: translate(0, -50%);
- display: flex;
- align-items: center;
- image {
- margin-right: 10rpx;
- }
- }
- }
- }
- .top {
- // width: 500rpx;
- display: flex;
- justify-content: space-between;
- margin: auto;
- background-color: #ffffff;
- padding: 10px 150rpx;
- // margin-bottom: 40px;
- // font-size: 18px;
- // padding-top: 0;
- .info1 {
- font-weight: bold !important;
- position: relative;
- color: rgba(0, 0, 0, 0.8);
- font-size: 34rpx;
- line-height: 48rpx;
- width: 136rpx;
- height: 48rpx;
- text-align: center;
- // font-family: PingFang SC;
- // font-family: \9ed1\4f53;
- .yun {
- width: 134rpx;
- height: 32rpx;
- position: absolute;
- left: 0;
- bottom: -10rpx;
- // transform: translate(-50%,0%);
- // box-shadow: 0px 10rpx 30rpx 6rpx #4a97f2;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .info2 {
- color: rgba(0, 0, 0, 0.6);
- font-size: 34rpx;
- font-weight: 400;
- line-height: 48rpx;
- width: 136rpx;
- height: 48rpx;
- text-align: center;
- font-family: 微软雅黑;
- }
- }
- .scroll-view-height {
- // background-color: ;
- // height: 68vh;
- // background-color: red;
- // padding-bottom: 50px;
- .contBox {
- width: 100%;
- padding: 10px 30rpx;
- // height: 100%;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- // background-color: greenyellow;
- margin-bottom: 50px;
- .cont {
- background-color: #ffffff;
- width: 332rpx;
- padding: 20rpx 15rpx;
- border-radius: 10px;
- margin-bottom: 20rpx;
- image {
- width: 300rpx;
- height: 170rpx;
- border-radius: 10rpx;
- }
- .tit {
- width: 257rpx;
- margin: 10rpx 0;
- // height: 80rpx;
- font-weight: bold;
- white-space: normal;
- display: -webkit-box;
- word-break: break-all;
- text-overflow: ellipsis;
- overflow: hidden;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- /*设置 需要显示的行数*/
- }
- .teacher {
- color: #999999;
- }
- }
- }
- }
- }
- </style>
|