Commit c5d0fa3f authored by 石盼盼's avatar 石盼盼

Merge branch 'shipanpan' into 'master'

已抢班级详情接口对接,已上课时运动评价展示页接口对接

See merge request !7
parents f9afb437 4d11110d
// pages/index/classDetail/classDetail.js const app = getApp()
import { Base } from '../../../utils/base.js';
const base = new Base()
Page({ Page({
/**
* 页面的初始数据
*/
data: { data: {
stuList:[],
courseData : '',
noticeCount: 9,
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { onLoad: function (options) {
console.log(options)
this.getlessondetail()
},
getlessondetail : function (){
const {coach_id, class_id,lesson_id} = this.data
let params = {
url:'coach/lessondetail',
data:{
coach_id : 5,
class_id : 16,
lesson_id : 69
},
callback : (data) => {
console.log(data)
this.setData({
courseData : data,
stuList : data.class_single_person
})
}
}
base.newRequest(params)
}, },
goperformance:function(){ goperformance:function(){
wx.navigateTo({ wx.navigateTo({
url: '../../index/performance/performance', url: '../../index/performance/performance',
}) })
}, },
/** gocourseinstant: function () {
* 生命周期函数--监听页面初次渲染完成 wx.navigateTo({
*/ url: '../../index/courseInstant/courseInstant',
onReady: function () { })
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
<view class="top flex-h flex-vc flex-hb"> <view class="top flex-h flex-vc flex-hb">
<view class="time">上课时间</view> <view class="time">上课时间</view>
<view class="date"> <view class="date">
<text class="nyr">2020-10-28</text> <text class="nyr">{{courseData.class_date}}</text>
<text>15:00~16:00</text> <text>{{courseData.start_time}}~{{courseData.end_time}}</text>
</view> </view>
</view> </view>
<view class="top flex-h flex-vc flex-hb"> <view class="top flex-h flex-vc flex-hb" bindtap="gocourseinstant">
<view class="time">课程瞬间</view> <view class="time">课程瞬间</view>
<view class="date"> <view class="date">
<text class="nyr">查看</text> <text class="nyr">查看</text>
...@@ -14,56 +14,20 @@ ...@@ -14,56 +14,20 @@
</view> </view>
</view> </view>
<view class="cont"> <view class="cont">
<view class="item flex-h flex-vc flex-hb"> <view class="item flex-h flex-vc flex-hb" wx:for="{{stuList}}" wx:key="index" data-id="{{item.id}}">
<view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image>
<view>
<view class="name">西西</view>
<view class="big_name">大名:王梓甜</view>
</view>
</view>
<view>
<view class="evaluation" catchtap="goperformance">运动评价</view>
</view>
</view>
<view class="line"></view>
<view class="item flex-h flex-vc flex-hb">
<view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image>
<view>
<view class="name">西西</view>
<view class="big_name">大名:王梓甜</view>
</view>
</view>
<view>
<view class="leave">已请假</view>
</view>
</view>
<view class="line"></view>
<view class="item flex-h flex-vc flex-hb">
<view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image>
<view>
<view class="name">西西</view>
<view class="big_name">大名:王梓甜</view>
</view>
</view>
<view>
<view class="evaluation">运动评价</view>
</view>
</view>
<view class="line"></view>
<view class="item flex-h flex-vc flex-hb">
<view class="flex-h flex-vc"> <view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image> <image src="/images/default_head.png" wx:if="{{item.child.thumb == null}}"></image>
<image src="{{item.child.thumb}}" wx:else></image>
<view> <view>
<view class="name">西西</view> <view class="name">{{item.child.nick_name}}</view>
<view class="big_name">大名:王梓甜</view> <view class="big_name">{{item.child.child_name}}</view>
</view> </view>
</view> </view>
<view> <view class="status">
<view class="evaluation">运动评价</view> <view class="evaluation" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view>
<view class="leave" wx:else>已请假</view>
<view class="unread" wx:if="{{ !item.class_moment }}"></view>
</view> </view>
</view> </view>
<view class="line"></view> <!-- <view class="line"></view> -->
</view> </view>
\ No newline at end of file
...@@ -34,9 +34,8 @@ page{ ...@@ -34,9 +34,8 @@ page{
width: 750rpx; width: 750rpx;
height: 194rpx; height: 194rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 15rpx;
margin-bottom: 24rpx;
padding: 42rpx 30rpx; padding: 42rpx 30rpx;
border-bottom: 1px solid #EBEBEB;
} }
.cont .item image{ .cont .item image{
width: 110rpx; width: 110rpx;
...@@ -73,6 +72,19 @@ page{ ...@@ -73,6 +72,19 @@ page{
font-size: 24rpx; font-size: 24rpx;
line-height: 48rpx; line-height: 48rpx;
text-align: center; text-align: center;
}
.status{
position: relative;
}
.unread {
width: 16rpx;
height: 16rpx;
background: #FF0000;
border-radius: 50%;
position: absolute;
top: 0;
right: 0;
} }
.line{ .line{
width: 690rpx; width: 690rpx;
......
...@@ -5,16 +5,38 @@ Page({ ...@@ -5,16 +5,38 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
texts: "已输入",
min: 0,//最少字数
max: 300, //最多字数
currentWordNumber:0
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { onLoad: function (options) {
}, },
inputs: function (e) {
var value = e.detail.value;
var len = parseInt(value.length);
console.log(len)
if (len <= this.data.min)
this.setData({
texts: "已输入",
num:this.data.min-len
})
else if (len > this.data.min)
this.setData({
texts: " ",
textss: " ",
num:''
})
this.setData({
currentWordNumber: len //当前字数
});
if (len > this.data.max) return;
console.log(this.data)
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
<view class="performance"> <view class="cont">
<view class="title">运动表现</view> <view class="performance">
<view class="title">运动表现</view>
<view class="progress-box">
<progress percent="100" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" />
</view>
<view class="progress-box">
<progress percent="80" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" />
</view>
<view class="progress-box">
<progress percent="90" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" />
</view>
<view class="progress-box">
<progress percent="80" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" />
</view>
<view class="progress-box">
<progress percent="80" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" />
</view>
</view>
<view class="coach">
<view class="title">教练评语</view>
<view class="text">
<textarea placeholder="请输入对学生的评价" minlength="{{min}}" maxlength="{{max}}" bindinput="inputs">
<text class="currentWordNumber">{{currentWordNumber}}/{{max}}</text>
<text class="hint">{{texts}}{{num}}</text>
</textarea>
</view>
</view>
<view class="badge">
<view class="title">颁发徽章</view>
</view>
</view> </view>
<view class="coach"> <view class="button">
<view class="title">教练评语</view> <view class="apply" bindtap="goapplyResult">保存</view>
<view class="text">
<textarea placeholder="请输入对学生的评价"></textarea>
</view>
</view> </view>
<view class="badge">
<view class="title">颁发徽章</view>
</view>
\ No newline at end of file
page { page {
background: #F7F8FA; background: #F7F8FA;
}
.cont{
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
} }
...@@ -35,12 +37,56 @@ page { ...@@ -35,12 +37,56 @@ page {
} }
.coach .text textarea{ .coach .text textarea{
padding: 26rpx; padding: 26rpx;
position: relative;
}
.coach .text .currentWordNumber{
color: #B3B3B3;
font-size: 24rpx;
position: absolute;
right: 2rpx;
bottom: 30rpx;
}
.coach .text .hint{
color: #B3B3B3;
font-size: 24rpx;
position: absolute;
right: 80rpx;
bottom: 30rpx;
} }
.badge { .badge {
width: 690rpx; width: 690rpx;
/* height: 300rpx; */
background: #FFFFFF; background: #FFFFFF;
border-radius: 15rpx; border-radius: 15rpx;
padding: 50rpx 30rpx; padding: 50rpx 30rpx;
margin-bottom: 50rpx;
}
/* 进度条样式 */
.progress-box{
width: 80%;
margin-left: 100rpx;
margin-bottom: 20rpx;
}
/* 按钮样式 */
.button{
width: 750rpx;
height: 118rpx;
padding: 18rpx 68rpx 20rpx;
position: fixed;
bottom: 0;
background: #FFFFFF;
}
.button .apply{
width: 620rpx;
height: 80rpx;
border:none;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 40rpx;
color: #000000;
font-size: 30rpx;
text-align: center;
line-height: 80rpx;
} }
\ No newline at end of file
const app = getApp()
let Charts = require('../../../utils/wxcharts-min.js'); let Charts = require('../../../utils/wxcharts-min.js');
var app = getApp();
var lineChart = null; var lineChart = null;
import {Base} from '../../../utils/base.js';
const base = new Base()
Page({ Page({
data: { data: {
windowWidth: '', windowWidth: '',
windowHeight: '', windowHeight: '',
coach : '',
coachcomment:'',
awardList: [ awardList: [
{ {
src:'/images/my/per_pic_02.png' src:'/images/my/per_pic_02.png'
...@@ -30,6 +34,7 @@ Page({ ...@@ -30,6 +34,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.getRpx() this.getRpx()
this.getCharts() this.getCharts()
this.getcomment()
}, },
getRpx() { getRpx() {
var res = wx.getSystemInfoSync(); //试图获取屏幕宽高数据 var res = wx.getSystemInfoSync(); //试图获取屏幕宽高数据
...@@ -42,10 +47,10 @@ Page({ ...@@ -42,10 +47,10 @@ Page({
lineChart = new Charts({ lineChart = new Charts({
canvasId: 'radarCanvas', canvasId: 'radarCanvas',
type: 'radar', type: 'radar',
categories: ['1', '2', '3', '4', '5', '6'], categories: ['耐力', '体力', '柔韧度', '训练完整度', '运动量' ],
series: [{ series: [{
name: '运动表现', name: '运动表现',
data: [90, 110, 125, 95, 87, 122] data: [90, 110, 125, 95, 87]
}], }],
width: this.data.windowWidth, width: this.data.windowWidth,
height: this.data.windowHeight, height: this.data.windowHeight,
...@@ -55,5 +60,25 @@ Page({ ...@@ -55,5 +60,25 @@ Page({
} }
} }
}); });
} },
getcomment : function () {
const { coach_id,class_id,lesson_id,child_id } = this.data
let params = {
url: 'coach/comment',
data:{
coach_id : 5,
class_id : 16,
lesson_id : 69,
child_id : 14
},
callback : (data) => {
console.log(data)
this.setData({
coach : data.coach,
coachcomment : data
})
}
}
base.newRequest(params)
},
}) })
\ No newline at end of file
<view class="canvasbox"> <view class="top">
<view class="title">运动表现</view> <view class="title">运动表现</view>
<canvas canvas-id="radarCanvas" disable-scroll="true" class="canvas"></canvas> <view class="canvasbox">
<canvas canvas-id="radarCanvas" disable-scroll="true" class="canvas"></canvas>
</view>
</view> </view>
<view class="one"> <view class="one">
<view class="title">教练评语</view> <view class="title">教练评语</view>
<view class="teacher"> <view class="teacher">
<view class="flex-h flex-vc flex-hb"> <view class="flex-h flex-vc flex-hb">
<view class="teacher_left flex-v flex-hc"> <view class="teacher_left flex-v flex-hc">
<image></image> <image src="/images/default_head.png" wx:if="{{coach.coach.thumb == null}}"></image>
<text>王教练</text> <image src="{{coach.coach.thumb}}" wx:else></image>
</view> <text class="name">{{coach.title}}</text>
<view class="teacher_right">
孩子对于运动的兴趣非常大!建议孩子多参加户外运动,对孩子视力保护比较好!
</view> </view>
<view class="teacher_right">{{coachcomment.class_comment}}</view>
</view>
</view>
<view class="line"></view>
<view class="parents">
<view class="title">家长回复</view>
<view class="flex-h">
<image src="{{coachcomment.child.wx_user.avatarurl}}"></image>
<text class="name">{{coachcomment.child.wx_user.nickname}}</text>
</view> </view>
<view class="comments">{{coachcomment.comment_reply}}</view>
</view> </view>
<view class="line"></view>
<view class="parents">
<view class="title">家长回复</view>
<view class="flex-h">
<image src="../../../images/photo.png"></image>
<text class="name">家长名字</text>
</view>
<view class="comments">谢谢教练~孩子非常喜欢上运动课,回到家之后也会自己进行练习,进步了很多。</view>
</view>
</view> </view>
<view class="one"> <view class="one">
<view class="title">收获徽章</view> <view class="title">收获徽章</view>
......
...@@ -2,14 +2,20 @@ page { ...@@ -2,14 +2,20 @@ page {
background: #F7F8FA; background: #F7F8FA;
padding: 20rpx 30rpx 60rpx 30rpx; padding: 20rpx 30rpx 60rpx 30rpx;
} }
.canvasbox { .top{
width: 100%; width: 100%;
height: 605rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 15rpx; border-radius: 15rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding: 50rpx 30rpx;
} }
.canvasbox .canvas { .top .canvasbox {
width: 100%;
height: 605rpx;
background: #FFFFFF;
border-radius: 15rpx;
}
.top .canvasbox .canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
...@@ -46,6 +52,12 @@ page { ...@@ -46,6 +52,12 @@ page {
height: 80rpx; height: 80rpx;
border-radius: 50%; border-radius: 50%;
} }
.teacher_left .name{
width: 120rpx;
color: #1A1A1A;
font-size: 24rpx;
margin-top: 8rpx;
}
.teacher_right { .teacher_right {
padding: 20rpx; padding: 20rpx;
font-size: 24rpx; font-size: 24rpx;
......
...@@ -86,10 +86,10 @@ Page({ ...@@ -86,10 +86,10 @@ Page({
} }
}, },
goteamDetail (e) { goteamDetail (e) {
let item = e.currentTarget.dataset.item var lesson_id = e.currentTarget.dataset.id
console.log(item) console.log(lesson_id)
wx.navigateTo({ wx.navigateTo({
url: '../../team/teamDetail/teamDetail?lesson_id=' + item.lesson_id, url: '../../team/teamDetail/teamDetail?lesson_id=' + lesson_id,
}) })
}, },
initData:function(){ initData:function(){
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</view> </view>
<view> <view>
<view wx:if="{{datalList.length>0}}"> <view wx:if="{{datalList.length>0}}">
<view class="tabContent1" wx:if="{{activeIndex == 2}}" wx:for="{{datalList}}" wx:key="item" data-item="{{item}}" catchtap="goteamDetail"> <view class="tabContent1" wx:if="{{activeIndex == 2}}" wx:for="{{datalList}}" wx:key="item" data-id="{{item.id}}" catchtap="goteamDetail">
<view class="tab_item1"> <view class="tab_item1">
<view class="top"> <view class="top">
<view class="class-title">{{item.course.name}}</view> <view class="class-title">{{item.course.name}}</view>
......
...@@ -9,9 +9,8 @@ Page({ ...@@ -9,9 +9,8 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options.lesson_id) console.log(options)
this.getclassdetail(); this.getclassdetail();
this.getlessondetail();
}, },
getclassdetail: function () { getclassdetail: function () {
const { coach_id, class_id} = this.data const { coach_id, class_id} = this.data
...@@ -26,45 +25,25 @@ Page({ ...@@ -26,45 +25,25 @@ Page({
this.setData({ this.setData({
courseData : data, courseData : data,
studentList : data.class_students, studentList : data.class_students,
lessonList : data.end_lessons
}) })
} }
} }
base.newRequest(params) base.newRequest(params)
}, },
getlessondetail: function () {
const {coach_id, class_id,lesson_id} = this.data goclassDetail:function(e){
let params = { var lesson_id = e.currentTarget.dataset.id
url:'coach/lessondetail', console.log(lesson_id)
data:{
coach_id : 5,
class_id : 16,
lesson_id : 69
},
callback : (data) => {
console.log(data)
this.setData({
lessonList:data
})
}
}
base.newRequest(params)
},
goclassDetail:function(){
wx.navigateTo({ wx.navigateTo({
url: '../../index/classDetail/classDetail', url: '../../index/classDetail/classDetail?lesson_id=' + lesson_id
}) })
}, },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () { onShow: function () {
}, },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
......
...@@ -14,19 +14,13 @@ ...@@ -14,19 +14,13 @@
<view class="class_place">上课地点:{{courseData.stadium.name}}</view> <view class="class_place">上课地点:{{courseData.stadium.name}}</view>
</view> </view>
</view> </view>
<view class="state flex-h">
<view>已上课</view>
<view>即将上课</view>
<view>待上课</view>
<view>待上课</view>
</view>
</view> </view>
<view class="students"> <view class="students">
<text>本班学员</text> <text>本班学员</text>
<view class="stu flex-h flex-hw"> <view class="stu flex-h flex-hw">
<view class="stus column" wx:for="{{studentList}}" wx:key="index" wx:for-item="item"> <view class="stus column" wx:for="{{studentList}}" wx:key="index" wx:for-item="item">
<image src="/images/default_head.png" wx:if="{{item.child.thumb == null}}"></image> <image src="/images/default_head.png" wx:if="{{item.child.thumb == null}}"></image>
<image src="{{item.child.thumb}}" wx:else></image> <image src="{{item.child.thumb}}" wx:else></image>
<view class="name">{{item.child.child_name}}</view> <view class="name">{{item.child.child_name}}</view>
</view> </view>
</view> </view>
...@@ -34,13 +28,31 @@ ...@@ -34,13 +28,31 @@
<view class="haveclass"> <view class="haveclass">
<text class="title">已上课时</text> <text class="title">已上课时</text>
<view class="item" wx:for="{{lessonList}}" wx:key="index" wx:for-item="item"> <view class="haveclass-top flex-h flex-hb">
<view class="lesson">第二节课</view> <text class="title">已上课时</text>
<view class="date">日期:2020-10-21</view> <text class="restclass">剩余<text class="number">2</text>课时</text>
</view>
<!-- <view class="item" wx:for="{{lessonList}}" wx:key="index" data-id="{{item.id}}" catchtap="goclassDetail">
<view class="lesson">第{{item.class_index}}节课</view>
<view class="date">日期:{{item.class_date}}</view>
<view class="number"> <view class="number">
<text>应到:8人</text> <text>应到:{{item.class_single_person_count}}人</text>
<text>实到:7人</text> <text>实到:{{item.class_single_person_not_leave_count}}人</text>
</view> </view>
<view class="btn" catchtap="goclassDetail">课程详情</view> <view class="btn">课程详情</view>
</view> </view> -->
<block wx:for="{{lessonList}}" wx:key="index">
<view class="item">
<view class="item_content">
<view class="lesson">第{{item.class_index}}节课</view>
<view class="date">日期:{{item.class_date}}</view>
<view class="number">
<text>应到:{{item.class_single_person_count}}人</text>
<text>实到:{{item.class_single_person_not_leave_count}}人</text>
</view>
<view class="btn">课程详情</view>
</view>
</view>
</block>
</view> </view>
\ No newline at end of file
...@@ -3,7 +3,6 @@ page{ ...@@ -3,7 +3,6 @@ page{
} }
.top{ .top{
width: 750rpx; width: 750rpx;
height: 568rpx;
background: #FFFFFF; background: #FFFFFF;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
...@@ -44,14 +43,7 @@ page{ ...@@ -44,14 +43,7 @@ page{
.top .course .course_bot .class_time{ .top .course .course_bot .class_time{
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.top .state{
width:100%;
margin-top: 150rpx;
padding-left: 20rpx;
}
.top .state>view{
width:190rpx;
}
.students{ .students{
width: 100%; width: 100%;
background: #FFFFFF; background: #FFFFFF;
...@@ -93,16 +85,45 @@ page{ ...@@ -93,16 +85,45 @@ page{
margin-bottom: 40rpx; margin-bottom: 40rpx;
display: block; display: block;
} }
.haveclass .restclass{
color: #1A1A1A;
font-size: 26rpx;
margin-bottom: 40rpx;
display: block;
}
.haveclass .restclass .number{
color: #1A1A1A;
font-size: 34rpx;
font-weight: bold;
margin-left: 10rpx;
margin-right: 10rpx;
}
.haveclass .item{ .haveclass .item{
width: 690rpx; width: 640rpx;
height: 206rpx; height: 206rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 15rpx; border-radius: 15rpx;
box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72); box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72);
padding: 40rpx 20rpx; padding: 40rpx 20rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
margin-left: 50rpx;
border-left: 1px solid #EEF0F2;
position: relative; position: relative;
} }
.haveclass .item::after{
content: '';
display: inline-block;
position: absolute;
left: -60rpx;
top: 60rpx;
width: 20rpx;
height: 20rpx;
border-radius: 20rpx;
background: #BDBDBD;
border: 2px solid #EEE;
}
.haveclass .item .lesson{ .haveclass .item .lesson{
color: #000000; color: #000000;
font-size: 30rpx; font-size: 30rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment