Commit 4d11110d authored by 石盼盼's avatar 石盼盼

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

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