| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <template>
- <view class="center">
- <!-- <view class="cl"></view> -->
- <view class="carousel-section">
- <swiper class="carousel" autoplay="true" interval="5000" duration="400" @change="swiperChange">
- <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"><image :src="item.pic" /></swiper-item>
- </swiper>
- </view>
- <view class="navBox">
- <view class="navBox-item" @click="nav('/pages/course/course')">
- <image class="bg1" src="../../static/img/indexMycourse.png"></image>
- <view class="font">我的课程</view>
- </view>
- <view class="navBox-item" @click="nav('/pages/course/courseWan')">
- <image class="bg2" src="../../static/img/indexKcpj.png"></image>
- <view class="font">课程评价</view>
- </view>
- <view class="navBox-item" @click="nav('/pages/leave/leaveClass')">
- <image class="bg3" src="../../static/img/indexQjsp.png" mode=""></image>
- <view class="font">请假审批</view>
- </view>
- <view class="navBox-item" @click="nav('/pages/problem/problem')">
- <image class="bg4" src="../../static/img/indexWtfq.png" mode="aspectFill"></image>
- <view class="font">问题反馈</view>
- </view>
- </view>
- <!-- <view class="title">教育资讯</view>
- <scroll-view scroll-y="true" class="listBox">
- <view v-for="(item, index) in dataList" :key="index" class="list" @click="navto(item)">
- <view class="img"><image :src="item.image_input[0]" mode=""></image></view>
- <view class="right">
- <view class="r-title">{{ item.title }}</view>
- <view class="time">{{ item.add_time }}</view>
- </view>
- </view>
- </scroll-view> -->
- </view>
- </template>
- <script>
- import { banner,category } from '@/api/index.js';
- export default {
- data() {
- return {
- swiperCurrent: 0,
- carouselList: [{
- pic:'../../static/img/banner.png',
- }],
- dataList: []
- };
- },
- onLoad() {
- this.loadData();
- },
- methods: {
- nav(url) {
- uni.navigateTo({
- url: url
- });
- },
- navto(e){
- uni.navigateTo({
- url:'/pages/index/message?id=' + e.id
- })
- },
- async loadData() {
- const obj = this;
- banner({}).then(e => {
- obj.carouselList = obj.carouselList.concat(e.data.banner);
- console.log(obj.carouselList)
- });
- category({page:1,limit: 1000},2).then(({data}) => {
- console.log(data)
- obj.dataList = data
-
- });
- },
- swiperChange(e) {
- const index = e.detail.current;
- this.swiperCurrent = index;
- }
- }
- };
- </script>
- <style lang="scss">
- .center {
- background: #FFFFFF;
- height: 100%;
- }
- .cl {
- height: 44px;
- }
- .carousel-section {
- margin: 0 auto;
- width: 90%;
- height: 280rpx;
- border-radius: 20rpx;
- image {
- border-radius: 20rpx;
- height: 100%;
- width: 100%;
- }
- // width: 100%;
- // height: 320rpx;
- // border-radius: 24rpx;
- // .titleNview-placing {
- // height: var(--status-bar-height);
- // padding-top: 44px;
- // box-sizing: content-box;
- // }
- // .carousel {
- // width: 92%;
- // height: 240rpx;
- // .carousel-item {
- // width: 100%;
- // height: 100%;
- // }
- // image {
- // width: 100%;
- // height: 100%;
- // border-radius: $border-radius-sm;
- // }
- // }
- }
- .bg1 {
- width: 70rpx;
- height: 60rpx;
- }
- .bg2 {
- width: 62rpx;
- height: 66rpx;
- }
- .bg3 {
- width: 78rpx;
- height: 70rpx;
- }
- .bg4 {
- width: 60rpx;
- height: 62rpx;
- }
- .navBox {
- display: flex;
- align-items: center;
- .navBox-item {
- text-align: center;
- margin-top: 100rpx;
- flex: 1;
- .font {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #69717b;
- }
- }
- }
- .title {
- margin-top: 60rpx;
- padding-left: 32rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #24272c;
- }
- .listBox {
- margin-top: 28rpx;
- }
- .list {
- margin-bottom: 50rpx;
- padding-left: 34rpx;
- padding-right: 40rpx;
- display: flex;
- .img {
- background-color: #ffffff;
- width: 200rpx;
- height: 160rpx;
- flex-shrink: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .right {
- text-align: left;
- width: 100%;
- padding-left: 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .r-title {
- font-size: 32rpx;
- font-weight: 400;
- color: #333333;
- }
- .time {
- font-size: 26rpx;
- font-weight: 400;
- color: #999999;
- }
- }
- }
- </style>
|