| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- <template>
- <view>
- <view style="z-index: 999;">
- <u-navbar title="中正云学堂" :is-back="false">
- <view class="slot-wrap"><image src="/static/search.png" class="search" @click="jumpSearch"></image></view>
- </u-navbar>
- </view>
- <scroll-view scroll-y="true" @scroll="scroll" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower">
- <view class="box">
- <view class="my_swiper"><u-swiper :list="list" @click="swiperClick" height="330" border-radius="25" mode="none"></u-swiper></view>
- <!-- 日历-->
- <view class="calendar_card">
- <view class="card_box">
- <u-row gutter="16">
- <u-col span="11" v-if="false">
- <view >
- <text class="t1">距离</text>
- <text class="t2">二级建造师</text>
- <text class="t1">考试</text>
- <text class="t3">365</text>
- <text class="t1">天,继续加油哦!</text>
- </view>
- </u-col>
- <u-col offset="11" span="1">
- <view @click="jumpPlan"><image src="/static/more.png" class="img_more"></image></view>
- </u-col>
- </u-row>
- </view>
- <u-line color="#EEEEEE" />
- <view style="width: 100%;display: flex;justify-content:center;margin-top: 20rpx;">
- <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
- </view>
- <view style="width: 100%;display: flex;justify-content:center;margin-top: 40rpx;">
- <view v-for="(item, index) in date_num" :key="index" class="date_num">{{ item }}</view>
- </view>
- <view style="width: 100%;margin-top: 20rpx;" v-if="false">
- <u-row gutter="16">
- <u-col span="2" text-align="center">
- <view><image src="/static/left.png" class="arr-icon"></image></view>
- </u-col>
- <u-col span="8" text-align="center"><view class="course_title">二级建造师市政公用工程</view></u-col>
- <u-col span="2" text-align="center">
- <view><image src="/static/right.png" class="arr-icon"></image></view>
- </u-col>
- </u-row>
- </view>
- </view>
- <!-- 筛选-->
- <view style="margin-top: 20rpx;">
- <u-row gutter="16">
- <u-col span="1">
- <view style="padding: 5rpx;"><image src="/static/select.png" class="arr-icon" @click="show = false"></image></view>
- </u-col>
- <u-col span="11">
- <view>
- <u-subsection
- @change="sectionChange"
- height="54"
- button-color="#2F4379"
- bg-color="#F8F9FF"
- active-color="#FFFFFF"
- inactive-color="#636A75"
- :list="tab_list"
- :current="current"
- ></u-subsection>
- </view>
- </u-col>
- </u-row>
- </view>
- <!-- 课程列表-->
- <view v-if="current == 0">
- <view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list1" :key="index">
- <image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
- <view class="list_content">
- <view style="margin-left: 280rpx;margin-top: 10rpx;">
- <view class="list_title">{{ item.courseName }}</view>
- <view class="old_price">原价:¥{{ item.price }}</view>
- <view class="price">现价:¥{{ item.price }}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 题库列表-->
- <view v-if="current == 1">
- <view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list2" :key="index">
- <image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
- <view class="list_content">
- <view style="margin-left: 280rpx;margin-top: 10rpx;">
- <view class="list_title">{{ item.bankName }}</view>
- <view class="old_price">原价:¥{{ item.price }}</view>
- <view class="price">现价:¥{{ item.price }}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 重点列表-->
- <view v-if="current == 2">
- <view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list3" :key="index">
- <image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
- <view class="list_content">
- <view style="margin-left: 280rpx;margin-top: 10rpx;">
- <view class="list_title">{{ item.name }}</view>
- <view class="old_price">原价:¥{{ item.price }}</view>
- <view class="price">现价:¥{{ item.price }}</view>
- </view>
- </view>
- </view>
- </view>
- <view v-if="paramList[current].showStatus" style="text-align: center;margin-top: 24rpx;">到底啦~</view>
- <u-popup v-model="show">
- <view style="width: 600rpx"><view class="popup_t1">选择你需要的</view></view>
- </u-popup>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- name: 'home',
- data() {
- return {
- show: false,
- tab_list: [
- {
- name: '课程'
- },
- {
- name: '刷题'
- },
- {
- name: '重点考点'
- }
- ],
- current: 0,
- list: [],
- paramList: [
- {
- pageNum: 1,
- pageSize: 10,
- total: 0,
- showStatus: 0
- },
- {
- pageNum: 1,
- pageSize: 10,
- total: 0,
- showStatus: 0
- },
- {
- pageNum: 1,
- pageSize: 10,
- total: 0,
- showStatus: 0
- }
- ],
- date: ['日', '一', '二', '三', '四', '五', '六'],
- date_num: [],
- list1: [],
- list2: [],
- list3: [],
- windowHeight: 0
- };
- },
- onLoad() {},
- mounted() {
- this.windowHeight = uni.getSystemInfoSync().windowHeight;
- this.initList();
- this.advertisingList();
- // d是当前星期一的日期对象
- var d=this.getMonDate();
- var arr=[];
- for(var i=0; i<7; i++)
- {
- this.date_num.push(d.getDate())
- d.setDate(d.getDate()+1);
- }
- console.log(arr)
- },
- methods: {
- getMonDate()
- {
- var d=new Date(),
- day=d.getDay(),
- date=d.getDate();
- if(day==0)
- return d;
- else
- d.setDate(date-day);
- return d;
- },
- swiperClick(index){
- let item = this.list[index]
- uni.navigateTo({
- url: item.jumpUrl
- });
- },
- advertisingList(){
- let self = this
- this.$api.advertisingList().then(res => {
- let index;
- for (index in res.data.rows ) {
- res.data.rows[index].image = res.data.rows[index].adverUrl
- }
- self.list = res.data.rows
- });
- },
- initList() {
- this.courseList();
- this.bankList();
- this.noteList();
- },
- scroll(e) {},
- scrollTolower() {
- if (this.current == 0) {
- if (this.list1.length < this.paramList[0].total) {
- this.paramList[0].pageNum++;
- this.courseList();
- }
- }
- if (this.current == 1) {
- if (this.list1.length < this.paramList[1].total) {
- this.paramList[1].pageNum++;
- this.bankList();
- }
- }
- if (this.current == 2) {
- if (this.list1.length < this.paramList[2].total) {
- this.paramList[2].pageNum++;
- this.noteList();
- }
- }
- },
- sectionChange(index) {
- this.current = index;
- },
- //课程
- courseList() {
- var self = this;
- var param = this.paramList[0];
- this.$api.courselist(param).then(res => {
- self.paramList[0].total = res.data.total;
- self.list1.push.apply(self.list1, res.data.rows);
- if (self.list1.length === res.data.total) {
- self.paramList[0].showStatus = true;
- }
- });
- },
- //题库
- bankList() {
- var self = this;
- var param = this.paramList[1];
- this.$api.banklist(param).then(res => {
- self.paramList[1].total = res.data.total;
- self.list2.push.apply(self.list2, res.data.rows);
- if (self.list2.length === res.data.total) {
- self.paramList[1].showStatus = true;
- }
- });
- },
- //考试重点
- noteList() {
- var self = this;
- var param = this.paramList[2];
- this.$api.notelist(param).then(res => {
- self.paramList[2].total = res.data.total;
- self.list3.push.apply(self.list3, res.data.rows);
- if (self.list3.length === res.data.total) {
- self.paramList[2].showStatus = true;
- }
- });
- },
- jumpDetail(item) {
- if (this.current == 0) {
- this.$navTo.togo('/pages2/course/detail', {
- id: item.courseId
- });
- return;
- }
- if (this.current == 1) {
- this.$navTo.togo('/pages2/bank/detail', {
- id: item.bankId
- });
- return;
- }
- if (this.current == 2) {
- this.$navTo.togo('/pages2/course/keynote', {
- id: item.fileId
- });
- return;
- }
- },
- jumpPlan() {
- if(!this.$method.isLogin()){
- this.$navTo.togo('/pages/login/login');
- }else{
- this.$navTo.togo('/pages2/plan/detail', {});
- }
-
- },
- jumpSearch() {
- this.$navTo.togo('/pages2/index/search', {});
- }
- }
- };
- </script>
- <style scoped>
- .search {
- width: 40rpx;
- height: 40rpx;
- margin-left: 30rpx;
- }
- .slot-wrap {
- display: flex;
- align-items: center;
- }
- .popup_t1 {
- height: 29rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #131b31;
- margin: 100rpx;
- }
- .price {
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ff0000;
- margin-top: 8rpx;
- }
- .old_price {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- text-decoration: line-through;
- color: #999999;
- margin-top: 8rpx;
- }
- .list_title {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #2f4379;
- }
- .list_content {
- width: 656rpx;
- height: 134rpx;
- background: #ffffff;
- box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
- border-radius: 24rpx;
- position: absolute;
- top: 20rpx;
- left: 20rpx;
- }
- .list_box {
- position: relative;
- width: 100%;
- margin-top: 30rpx;
- }
- .list_img {
- width: 278rpx;
- height: 134rpx;
- z-index: 100;
- position: relative;
- }
- .course_title {
- color: #2f4379;
- box-shadow: 0rpx 0rpx 9rpx 1rpx rgba(47, 67, 121, 0.1);
- border-radius: 28rpx;
- width: 100%;
- height: 48rpx;
- line-height: 48rpx;
- }
- .arr-icon {
- width: 40rpx;
- height: 40rpx;
- }
- .wrap {
- padding: 24rpx;
- }
- .u-row {
- margin: 40rpx 0;
- }
- .date_num {
- width: 14%;
- text-align: center;
- color: #34c759;
- }
- .card_date {
- width: 14%;
- text-align: center;
- color: #7f8caf;
- }
- page {
- background: #ffffff;
- font-size: 28rpx;
- }
- .calendar_card {
- width: 100%;
- height: 300rpx;
- background: #ffffff;
- box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
- border-radius: 22rpx;
- margin-top: 25rpx;
- }
- .box {
- margin: 30rpx;
- }
- .my_swiper {
- box-shadow: 0rpx 20rpx 16rpx 4rpx rgba(47, 67, 121, 0.08);
- border-radius: 25rpx;
- }
- .calendar_card .card_box {
- height: 60rpx;
- line-height: 60rpx;
- margin-left: 40rpx;
- }
- .calendar_card .t1 {
- color: #7f8caf;
- font-size: 24rpx;
- }
- .calendar_card .t2 {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #32467b;
- margin: 0 10rpx;
- }
- .calendar_card .t3 {
- font-size: 30rpx;
- font-weight: bold;
- color: #32467b;
- text-shadow: 0rpx 3rpx 3rpx rgba(0, 0, 0, 0.2);
- margin: 0 10rpx;
- }
- .img_more {
- width: 26rpx;
- height: 26rpx;
- }
- </style>
|