|
@@ -111,7 +111,7 @@
|
|
|
<view class="course-infos">
|
|
|
<view class="info-box" v-for="(item,index) in courseList" :key="index"
|
|
|
@click="gotoUrl('pages/parents/classSchedule/classScheduleDetails?id=' + item.sheetId)">
|
|
|
- <view class="position today" v-if="item.courseDate == date">
|
|
|
+ <view class="position today" v-if="item.courseDate == day">
|
|
|
今
|
|
|
</view>
|
|
|
<view class="position tomorrow" v-if="item.courseDate == tomorrow">
|
|
@@ -122,7 +122,7 @@
|
|
|
</view>
|
|
|
<view class="location-time">
|
|
|
<view class="location">
|
|
|
- {{item.classroom}}
|
|
|
+ {{item.classroomName}}
|
|
|
</view>
|
|
|
<view class="time">
|
|
|
{{item.coursePeriods}}
|
|
@@ -177,7 +177,7 @@
|
|
|
机构推荐
|
|
|
</view> -->
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="infos-box">
|
|
|
<view class="picture">
|
|
|
<img src="../../../assets/img/classify1.png" alt="">
|
|
@@ -209,7 +209,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-<view class="infos-box">
|
|
|
+ <view class="infos-box">
|
|
|
<view class="picture">
|
|
|
<img src="../../../assets/img/classify1.png" alt="">
|
|
|
</view>
|
|
@@ -278,34 +278,38 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import * as classScheduleApi from '@/apis/parents/classSchedule.js'
|
|
|
+ import * as homePageApi from '@/apis/parents/homePage.js'
|
|
|
import * as mineApi from '@/apis/parents/mine.js'
|
|
|
import ParentsTabbar from '@/components/ParentsTabbar.vue'
|
|
|
-
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
ParentsTabbar
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- chosenList: [
|
|
|
- {name: '全部'},
|
|
|
- {name: '精品试听'},
|
|
|
- {name: '为您优选'},
|
|
|
- {name: '机构推荐'}
|
|
|
+ chosenList: [{
|
|
|
+ name: '全部'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '精品试听'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '为您优选'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '机构推荐'
|
|
|
+ }
|
|
|
],
|
|
|
chosenActive: 0,
|
|
|
- date: '',
|
|
|
+ day: '',
|
|
|
tomorrow: '',
|
|
|
weekDate: [],
|
|
|
weekN: ["一", "二", "三", "四", "五", "六", "日"],
|
|
|
activeClass: 0,
|
|
|
weekDate1: '',
|
|
|
courseList: [],
|
|
|
- form: {
|
|
|
- studentName: '',
|
|
|
- headPhoto: ''
|
|
|
- },
|
|
|
+ form: {},
|
|
|
show: false,
|
|
|
studentList: [],
|
|
|
studentId: '',
|
|
@@ -315,31 +319,46 @@
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
|
- if(this.carhelp.getStudentId()) {
|
|
|
+ let date = new Date() //当前日期
|
|
|
+ this.day = this.getFormatDate(date);
|
|
|
+ this.tomorrow = this.getFormatDate(new Date(date.setDate(date.getDate() + 1)));
|
|
|
+
|
|
|
+ if (this.carhelp.getStudentId()) {
|
|
|
this.studentId = this.carhelp.getStudentId().studentId;
|
|
|
this.getStudentDetail();
|
|
|
- this.getToday();
|
|
|
+ this.getLatelyCourseList();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.getStudentList();
|
|
|
},
|
|
|
methods: {
|
|
|
- chosenClick(item,index) {
|
|
|
+ getFormatDate(date) {
|
|
|
+ let myyear = date.getFullYear();
|
|
|
+ let mymonth = date.getMonth() + 1;
|
|
|
+ let myweekday = date.getDate();
|
|
|
+ if (mymonth < 10) {
|
|
|
+ mymonth = "0" + mymonth;
|
|
|
+ }
|
|
|
+ if (myweekday < 10) {
|
|
|
+ myweekday = "0" + myweekday;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (myyear + "-" + mymonth + "-" + myweekday);
|
|
|
+ },
|
|
|
+ chosenClick(item, index) {
|
|
|
this.chosenActive = index;
|
|
|
},
|
|
|
- getCourseList() {
|
|
|
- this.courseList = [];
|
|
|
+ getLatelyCourseList() {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
})
|
|
|
- classScheduleApi.loadMySchedule({
|
|
|
+ homePageApi.getMyLastSchedules({
|
|
|
studentId: this.studentId,
|
|
|
- startDate: this.date,
|
|
|
- endDate: this.weekDate[6].day
|
|
|
+ count: 2
|
|
|
}).then((response) => {
|
|
|
uni.hideLoading();
|
|
|
- this.courseList = response.data;
|
|
|
+ this.courseList = response.data;
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -347,70 +366,16 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- getToday() {
|
|
|
- this.weekDate = [];
|
|
|
- let date = new Date(); //当前日期
|
|
|
- let year = date.getFullYear(); //当前年
|
|
|
- let month = date.getMonth() + 1; //当前月
|
|
|
- let day = date.getDate(); //当天
|
|
|
- let mydate = new Date(year, month - 1, day);
|
|
|
- let weekday = mydate.getDay();
|
|
|
- this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
|
|
|
- this.getWeekDate(true);
|
|
|
- },
|
|
|
- getWeekDate(bl) {
|
|
|
- let weekDate2 = new Date(this.weekDate1.getTime());
|
|
|
- for (var i = 0; i < 7; i++) {
|
|
|
- for (var j = 0; j < this.weekN.length; j++) {
|
|
|
- if (i == j) {
|
|
|
- this.weekDate.push({
|
|
|
- week: this.weekN[j],
|
|
|
- day: this.getFormatDate(new Date(weekDate2.setDate(this.weekDate1.getDate() + i))),
|
|
|
- isDotShow: false
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (bl) {
|
|
|
- let date = new Date(); //当前日期
|
|
|
- date = this.getFormatDate(date);
|
|
|
- for (var m = 0; m < this.weekDate.length; m++) {
|
|
|
- if (date == this.weekDate[m].day) {
|
|
|
- this.activeClass = m;
|
|
|
- this.date = this.weekDate[m].day;
|
|
|
- this.tomorrow = this.weekDate[m+1].day;
|
|
|
- }
|
|
|
- }
|
|
|
- this.getCourseList();
|
|
|
- }
|
|
|
- },
|
|
|
- getFormatDate(date) {
|
|
|
- let myyear = date.getFullYear();
|
|
|
- let mymonth = date.getMonth() + 1;
|
|
|
- let myweekday = date.getDate();
|
|
|
- if (mymonth < 10) {
|
|
|
- mymonth = "0" + mymonth;
|
|
|
- }
|
|
|
- if (myweekday < 10) {
|
|
|
- myweekday = "0" + myweekday;
|
|
|
- }
|
|
|
-
|
|
|
- return (myyear + "-" + mymonth + "-" + myweekday);
|
|
|
- },
|
|
|
getStudentDetail() {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
})
|
|
|
- // debugger
|
|
|
mineApi.getStudentDtl({
|
|
|
studentId: this.studentId
|
|
|
}).then((response) => {
|
|
|
uni.hideLoading();
|
|
|
- // debugger
|
|
|
- this.form.studentName = response.data.studentName;
|
|
|
- this.form.headPhoto = response.data.headPhoto;
|
|
|
+ this.form = response.data;
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -419,9 +384,12 @@
|
|
|
})
|
|
|
},
|
|
|
confirm(e) {
|
|
|
- this.carhelp.setStudentId({studentId: e[0].value});
|
|
|
+ this.carhelp.setStudentId({
|
|
|
+ studentId: e[0].value
|
|
|
+ });
|
|
|
this.studentId = e[0].value;
|
|
|
this.getStudentDetail();
|
|
|
+ this.getLatelyCourseList();
|
|
|
},
|
|
|
getStudentList() {
|
|
|
uni.showLoading({
|
|
@@ -436,7 +404,7 @@
|
|
|
value: list[i].studentId,
|
|
|
label: list[i].studentName
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -449,48 +417,55 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- page{
|
|
|
+ page {
|
|
|
padding-bottom: 100px;
|
|
|
}
|
|
|
+
|
|
|
.navigation {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- height: 44px;
|
|
|
- background-color: rgba(13, 186, 199, 1);
|
|
|
- padding: 0 16px;
|
|
|
- .title{
|
|
|
- line-height: 44px;
|
|
|
- color: #ffffff;
|
|
|
- font-size: 20px
|
|
|
- }
|
|
|
- .identity{
|
|
|
- display: flex;
|
|
|
- align-items:center;
|
|
|
- .picture{
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- border-radius: 50px;
|
|
|
- overflow: hidden;
|
|
|
- margin-right: 4px;
|
|
|
- img{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- .name{
|
|
|
- margin-right: 4px;
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
- }
|
|
|
- .icon{
|
|
|
- img{
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 44px;
|
|
|
+ background-color: rgba(13, 186, 199, 1);
|
|
|
+ padding: 0 16px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ line-height: 44px;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .identity {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .picture {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ border-radius: 50px;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right: 4px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ margin-right: 4px;
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon {
|
|
|
+ img {
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.head {
|
|
@@ -643,100 +618,115 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.recommend{
|
|
|
- margin:32px 16px ;
|
|
|
- .title {
|
|
|
- height: 20px;
|
|
|
- line-height: 20px;
|
|
|
- margin-bottom: 14px;
|
|
|
- color: #333333;
|
|
|
- font-weight: bold;
|
|
|
-
|
|
|
- img {
|
|
|
- vertical-align: middle;
|
|
|
- margin-right: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
- .classify{
|
|
|
- display: flex;
|
|
|
- margin-bottom: 24px;
|
|
|
- .item{
|
|
|
- border-radius: 12px;
|
|
|
- line-height: 32px;
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- color: rgba(119, 119, 119, 1);
|
|
|
- text-align: center;
|
|
|
- border: 1px solid rgba(204, 204, 204, 1);
|
|
|
- padding: 0 8px;
|
|
|
- margin-left: 12px;
|
|
|
- }
|
|
|
- .chosen{
|
|
|
- border: 1px solid rgba(13, 186, 199, 1);
|
|
|
- color: rgba(13, 186, 199, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- .infos-box{
|
|
|
- border-radius: 12px;
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- padding: 12px;
|
|
|
- margin-bottom: 12px;
|
|
|
- display: flex;
|
|
|
- .picture{
|
|
|
- width: 200rpx;
|
|
|
- height: 200rpx;
|
|
|
- border-radius: 4px;
|
|
|
- overflow: hidden;
|
|
|
- img{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
+ .recommend {
|
|
|
+ margin: 32px 16px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ height: 20px;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-bottom: 14px;
|
|
|
+ color: #333333;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ img {
|
|
|
+ vertical-align: middle;
|
|
|
+ margin-right: 8px;
|
|
|
}
|
|
|
}
|
|
|
- .infos{
|
|
|
- flex: 1;
|
|
|
- margin-left: 12px;
|
|
|
- .name{
|
|
|
- color: rgba(51, 51, 51, 1);
|
|
|
- font-size: 16px;
|
|
|
+
|
|
|
+ .classify {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 24px;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ border-radius: 12px;
|
|
|
+ line-height: 32px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ color: rgba(119, 119, 119, 1);
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid rgba(204, 204, 204, 1);
|
|
|
+ padding: 0 8px;
|
|
|
+ margin-left: 12px;
|
|
|
}
|
|
|
- .tips{
|
|
|
- display: flex;
|
|
|
- margin-top: 8px;
|
|
|
- .item{
|
|
|
- padding: 0 8px;
|
|
|
- line-height: 20px;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: rgba(241, 243, 244, 1);
|
|
|
- color: rgba(16, 16, 16, 1);
|
|
|
- font-size: 12px;
|
|
|
- margin-right: 8px;
|
|
|
+
|
|
|
+ .chosen {
|
|
|
+ border: 1px solid rgba(13, 186, 199, 1);
|
|
|
+ color: rgba(13, 186, 199, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .infos-box {
|
|
|
+ border-radius: 12px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ padding: 12px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .picture {
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ border-radius: 4px;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
}
|
|
|
- .teacher-price{
|
|
|
- margin-top: 44rpx;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- .teacher{
|
|
|
+
|
|
|
+ .infos {
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 12px;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tips {
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- .photo{
|
|
|
- width: 32px;
|
|
|
- height: 32px;
|
|
|
- border-radius: 50px;
|
|
|
- overflow: hidden;
|
|
|
+ margin-top: 8px;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ padding: 0 8px;
|
|
|
+ line-height: 20px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: rgba(241, 243, 244, 1);
|
|
|
+ color: rgba(16, 16, 16, 1);
|
|
|
+ font-size: 12px;
|
|
|
margin-right: 8px;
|
|
|
- img{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- .price{
|
|
|
- color: rgba(255, 61, 0, 1);
|
|
|
+
|
|
|
+ .teacher-price {
|
|
|
+ margin-top: 44rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .teacher {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .photo {
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ border-radius: 50px;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right: 8px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .price {
|
|
|
+ color: rgba(255, 61, 0, 1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
</style>
|