Commit 5849d048 authored by 石盼盼's avatar 石盼盼

保存教练评语及各项分数接口对接,家长回复,城市列表,科目列表接口对接

parent f6534210
......@@ -6,7 +6,8 @@ Page({
list: [],
status: false,
num: 0,
arr:[]
arr:[],
badge_ids:[]
},
onLoad: function (options) {
var arr1 = JSON.parse(options.listData)
......@@ -53,14 +54,17 @@ Page({
}
//点击图片把status==true的组成新的数组
var arr = [];
var badge_ids = [];
for (var i = 0; i < list.length; i++) {
if(list[i].status==true){
arr.push(list[i])
badge_ids.push(list[i].id)
}
}
this.setData({
list: list,
arr: arr
arr: arr,
badge_ids: badge_ids
})
},
......@@ -73,7 +77,8 @@ Page({
base.toast('最多选择三个徽章')
} else {
prevPage.setData({
arr: this.data.arr
arr: this.data.arr,
badge_ids: this.data.badge_ids
})
wx.navigateBack({
delta: 1
......
......@@ -9,15 +9,18 @@ Page({
coach_id: '',
class_id: '',
lesson_id: '',
class_single_id:'',
stuList: [],
courseData: '',
noticeCount: 9,
},
onLoad: function (options) {
this.setData({
class_id: options.class_id,
lesson_id: options.lesson_id
lesson_id: options.lesson_id,
})
console.log(options.lesson_id)
console.log(options.class_id)
......@@ -46,9 +49,11 @@ Page({
goperformance: function (e) {
var child_id = e.currentTarget.dataset.id
var class_single_id = e.currentTarget.dataset.class_single_id
console.log(child_id)
console.log(class_single_id)
wx.navigateTo({
url: '../../index/performance/performance?child_id=' + child_id + '&lesson_id=' + this.data.lesson_id + '&class_id=' + this.data.class_id,
url: '../../index/performance/performance?child_id=' + child_id + '&lesson_id=' + this.data.lesson_id + '&class_id=' + this.data.class_id + '&class_single_id=' + class_single_id,
})
},
gocourseinstant: function () {
......
......@@ -24,7 +24,7 @@
</view>
</view>
<view class="status">
<view class="evaluation" data-id="{{item.id}}" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view>
<view class="evaluation" data-id="{{item.id}}" data-class_single_id="{{item.class_single_id}}" 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>
......
......@@ -107,9 +107,14 @@ Page({
base.toast('请开课后上传课程瞬间')
}
},
goevaluation: function () {
goSport: function (e) {
let child_id = e.currentTarget.dataset.child_id
let class_id = e.currentTarget.dataset.class_id
let class_single_id = e.currentTarget.dataset.class_single_id
let course_id = e.currentTarget.dataset.course_id
console.log(course_id)
wx.navigateTo({
url: '/pages/index/evaluation/evaluation',
url: '/pages/index/evaluation/evaluation?child_id=' + child_id + '&class_id=' + class_id + '&class_single_id=' + class_single_id + '&course_id=' + course_id,
})
},
onPullDownRefresh() {
......@@ -124,5 +129,7 @@ Page({
this.getDetail()
}
wx.stopPullDownRefresh()
}
},
})
\ No newline at end of file
......@@ -26,7 +26,7 @@
<view wx:if="{{item.sign_status == 1}}">
<view class="sign">已签到</view>
<view class="evaluation1" wx:if='{{item.class_comment!=""}}'>已评价</view>
<view wx:if='{{item.class_comment==""}}' catchtap="goSport">运动评价</view>
<view class="evaluation" wx:if='{{item.class_comment==""}}' catchtap="goSport" data-child_id="{{item.child.id}}" data-class_id="{{item.class_id}}" data-class_single_id="{{item.class_single_id}}" data-course_id="{{item.course_id}}">运动评价</view>
</view>
<view wx:if="{{item.sign_status == 0}}">
<view class="sign1" bindtap="showButton" data-id='{{item.child.id}}'>签到</view>
......
......@@ -10,57 +10,70 @@ Page({
texts: "已输入",
min: 0,//最少字数
max: 300, //最多字数
currentWordNumber:0,
chooseBadge:true,
imgBox:[],
scoreArr : [],
idlist:[],
scorelist:[]
currentWordNumber: 0,
chooseBadge: true,
imgBox: [],
scoreArr: [],
idlist: [],
scorelist: []
},
onLoad: function (options) {
this.setData({
child_id: options.child_id,
class_id: options.class_id,
class_single_id: options.class_single_id,
course_id : options.course_id
})
this.getComment()
},
onShow: function(){
onShow: function () {
this.setData({
imgBox: this.data.arr?this.data.arr: []
imgBox: this.data.arr ? this.data.arr : [],
badge_ids: this.data.badge_ids ? this.data.badge_ids : []
})
},
inputs: function (e) {
var value = e.detail.value;
console.log(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)
// inputs: function (e) {
// var value = e.detail.value;
// console.log(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)
// },
inputs : function (e) {
this.setData({
texts: " ",
textss: " ",
num:''
value: e.detail.value
})
this.setData({
currentWordNumber: len //当前字数
});
if (len > this.data.max) return;
console.log(this.data)
console.log(this.data.value)
},
onDrag(event) {
console.log(event)
// console.log(event)
let index = event.currentTarget.dataset.index
this.data.scoreArr[index].score = event.detail.value
this.setData({
scoreArr : this.data.scoreArr
scoreArr: this.data.scoreArr
});
console.log(this.data.scoreArr)
// console.log(this.data.scoreArr)
},
gobadgelist:function(e){
gobadgelist: function (e) {
var model = JSON.stringify(this.data.imgBox)
wx.navigateTo({
url: '../../index/badgelist/badgelist?listData=' + model,
......@@ -78,82 +91,65 @@ Page({
},
// 教练对孩子运动评价,获取课程评价维度
getComment : function (){
getComment: function () {
let params = {
url:'coach/comment_norm',
data : {
course_id : 1001,
url: 'coach/comment_norm',
data: {
course_id: this.data.course_id,
},
callback : (data) => {
callback: (data) => {
console.log(data)
var arr = []
for( var i = 0; i<data.length;i++){
for (var i = 0; i < data.length; i++) {
let options = {
id : data[i].id,
id: data[i].id,
name: data[i].name,
score : 0
score: 0
}
arr.push(options)
}
console.log(arr)
this.setData({
scoreArr : arr,
scoreArr: arr,
})
//把scoreArr数组中的id跟score拿出来组成新的数组{id:1,score:0}------{"1":90,"2":80}
// let newarr = []
// this.data.scoreArr.forEach(item => {
// let newdata = {}
// newdata.id = item.id;
// newdata.score = item.score;
// newarr.push(newdata)
// })
// this.setData({
// newarr :this.data.scoreArr
// })
// console.log(newarr)
}
}
base.newRequest(params)
},
// 保存
save : function () {
// let params = {
// url:'badges/add',
// data:{
// },
// type:'POST',
// callback: (data) => {
// }
// }
// base.newRequest(params)
save: function () {
let obj = {};
this.data.scoreArr.map((e) => {
console.log(e)
obj[e.id] = e.score;
});
//如果其中存在某一条评分未评则不能保存成功 必须全部评分完毕
let params = {
url:'coach/comment_save',
data:{
coach_id : 5,
lesson_id : 73,
child_id : 303,
comment_score : this.data.newarr
url: 'badges/add',
data: {
user_child_id: this.data.child_id,
badge_id: 1,//this.data.badge_ids,
class_id: this.data.class_id,
class_single_id: this.data.class_single_id,
coach_id: 5,
},
type:'POST',
type: 'POST',
callback: (data) => {
console.log(data)
//把scoreArr数组中的id跟score拿出来组成新的数组{id:1,score:0}------{"1":90,"2":80}
// let newarr = []
// this.data.scoreArr.forEach(item => {
// let newdata = {}
// newdata.id = item.id;
// newdata.score = item.score;
// newarr.push(newdata)
// })
// this.setData({
// newarr :this.data.scoreArr
// })
// console.log(newarr)
// this.getComment()
let params = {
url: 'coach/comment_save',
data: {
coach_id: 5,
lesson_id: this.data.class_single_id,
child_id: this.data.child_id,
comment_score: JSON.stringify(obj),
commnet: this.data.value
},
type: 'POST',
callback: (data) => {
// base.toast('保存成功')
}
}
base.newRequest(params)
}
}
base.newRequest(params)
......
......@@ -14,9 +14,9 @@
<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 placeholder="请输入对学生的评价" minlength="{{min}}" maxlength="{{max}}" bindinput="inputs" value="{{value}}">
<!-- <text class="currentWordNumber">{{currentWordNumber}}/{{max}}</text>
<text class="hint">{{texts}}{{num}}</text> -->
</textarea>
</view>
</view>
......
......@@ -12,10 +12,21 @@ Page({
coachcomment:'',
awardList: [],
arr1: [],
arr2:[]
arr2:[],
class_id:'',
lesson_id :'',
child_id :'',
class_single_id : ''
},
onLoad: function (options) {
console.log(options.child_id)
console.log(options)
this.setData({
class_id : options.class_id,
lesson_id : options.lesson_id,
child_id : options.child_id,
class_single_id : options.class_single_id
})
console.log(options.class_single_id)
this.getRpx()
this.getcomment()
this.getbadges()
......@@ -46,14 +57,13 @@ 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,
class_id : this.data.class_id,
lesson_id : this.data.lesson_id,
child_id : this.data.child_id,
},
callback : (data) => {
console.log(data)
......@@ -86,9 +96,9 @@ Page({
let params = {
url: 'badges',
data : {
user_child_id : 303,
class_id : 16 ,
class_single_id : 69,
user_child_id : this.data.child_id,
class_id : this.data.class_id ,
class_single_id : this.data.class_single_id,
},
callback : (data) =>{
console.log(data)
......
// pages/my/parents/parents.js
const app = getApp()
import { Base } from '../../../utils/base.js';
const base = new Base()
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
},
......@@ -12,36 +15,35 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getreply()
},
getreply: function () {
wx.showLoading({
title: '加载中...',
})
let params = {
url: 'coach/reply',
data: {
coach_id: 4
},
callback: (data) => {
wx.hideLoading()
console.log(data)
this.setData({
list: data
})
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}
}
base.newRequest(params)
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
......@@ -57,10 +59,5 @@ Page({
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<view class="item">
<view>
<block wx:if="{{list.length>0}}">
<view class="item" wx:for="{{list}}" wx:key="index">
<view class="top flex-h flex-vc flex-hb">
<view class="row">
<image src="../../../images/course_login.png"></image>
<view class="name">家长名字</view>
<image src="{{item.child.wx_user.avatarurl}}"></image>
<view class="name">{{item.child.wx_user.nickname}}</view>
</view>
<view class="date">
<text>2020-10-28</text>
<text>10:00</text>
<text>{{item.updated_at}}</text>
<!-- <text>10:00</text> -->
</view>
</view>
<view class="comments">谢谢教练~孩子非常喜欢上体育课!</view>
<view class="comments">{{item.comment_reply}}</view>
<view class="class">
<view class="evaluation">西西的运动评价</view>
<view class="evaluation">{{item.course.sub_title}}</view>
<view class="row">
<image src="../../../images/course_login.png"></image>
<view class="column">
<text class="subject">篮球课</text>
<text class="date">2020-10-26 10:00~11:00</text>
</view>
</view>
</view>
</view>
<view class="item">
<view class="top flex-h flex-vc flex-hb">
<view class="row">
<image src="../../../images/course_login.png"></image>
<view class="name">家长名字</view>
<view class="img">
<image src="{{item.course.share_img}}"></image>
</view>
<view class="date">
<text>2020-10-28</text>
<text>10:00</text>
<view class="column">
<text class="subject">{{item.course.name}}</text>
<text class="date">{{item.date_int}} {{item.start_time}}~{{item.end_time}}</text>
</view>
</view>
<view class="comments">谢谢教练~孩子非常喜欢上体育课!</view>
<view class="class">
<view class="evaluation">西西的运动评价</view>
<view class="row">
<image src="../../../images/course_login.png"></image>
<view class="column">
<text class="subject">篮球课</text>
<text class="date">2020-10-26 10:00~11:00</text>
</view>
</view>
</block>
<block wx:else>
<view class="empty">
<van-empty class="custom-image" image="/images/without.png" description="暂无课程" />
</view>
</block>
</view>
\ No newline at end of file
......@@ -48,11 +48,15 @@ page{
font-size: 24rpx;
margin-bottom: 20rpx;
}
.item .class image{
.item .class .img{
width: 200rpx;
height: 131rpx;
margin-right: 28rpx;
}
.item .class .img image{
width: 100%;
height: 100%;
}
.item .class .subject{
color: #1A1A1A;
font-size: 26rpx;
......
......@@ -8,33 +8,26 @@ Page({
*/
data: {
cityShow: false,
cityList: [
{
name: '石家庄市'
},
{
name: '保定市'
},
{
name: '邯郸市'
},
{
name: '秦皇岛市'
},
{
name: '邢台市'
},
{
name: '承德市'
},
]
cityList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getCitylist()
},
getCitylist : function () {
let params = {
url : 'coach/city',
callback : (data) => {
console.log(data)
this.setData({
cityList : data
})
}
}
base.newRequest(params)
},
changeCity: function (e) {
this.setData({
......
......@@ -40,7 +40,7 @@
<!-- <view class="cityCenter_title">已开通服务城市</view> -->
<view class="cityCenter_con flex-h flex-hw">
<block wx:for='{{cityList}}' wx:key='index'>
<text class="{{item.isChecked ? 'city_active' : ''}}" catchtap="chooseCity" data-index='{{index}}'>{{item.name}}</text>
<text class="{{item.isChecked ? 'city_active' : ''}}" catchtap="chooseCity" data-index='{{index}}'>{{item.city_name}}</text>
</block>
</view>
</view>
......
......@@ -25,7 +25,6 @@ Page({
wx.showLoading({
title: '加载中',
})
const { coach_id } = this.data;
let params = {
url: 'coach/roblist',
data: {
......@@ -47,7 +46,6 @@ Page({
wx.showLoading({
title: '加载中...',
})
const { coach_id } = this.data;
let params = {
url:'coach/myclasses',
data : {
......
......@@ -11,33 +11,35 @@ Page({
noticeCount: 9, // 家长回复小红点
show:false,
subjectShow: false,
subjectList:[
{
name: '跳绳'
},
{
name: '篮球'
},
{
name: '足球'
},
{
name: '轮滑'
},
{
name: '平衡车'
},
{
name: '跆拳道'
},
]
subjectList:[],
// subjectList:[
// {
// name: '跳绳'
// },
// {
// name: '篮球'
// },
// {
// name: '足球'
// },
// {
// name: '轮滑'
// },
// {
// name: '平衡车'
// },
// {
// name: '跆拳道'
// },
// ]
},
onLoad: function (options) {
this.getSubjectlist()
},
onShow() {
let userInfo = wx.getStorageSync('userInfo');
......@@ -74,6 +76,19 @@ Page({
url: '../../my/teachingArea/teachingArea',
})
},
getSubjectlist : function (){
let params = {
url:'coach/course',
callback : (data) => {
console.log(data)
this.setData({
subjectList : data
})
}
}
base.newRequest(params)
},
//教学科目弹窗
tcHold: function (e) {
this.setData({
......
......@@ -66,7 +66,7 @@
</view>
<view class="subject flex-h flex-hw flex-ha">
<block wx:for='{{subjectList}}' wx:key='index'>
<view class="{{item.isChecked ? 'active' : ''}}" catchtap="chooseOne" data-index='{{index}}'>{{item.name}}</view>
<view class="{{item.isChecked ? 'active' : ''}}" catchtap="chooseOne" data-index='{{index}}' data-item='{{item}}'>{{item.name}}</view>
</block>
</view>
<view class="confirm" catchtap="confirm">确定</view>
......
......@@ -111,7 +111,7 @@ page {
width: 580rpx;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 51rpx 0;
padding: 51rpx 20rpx;
}
.top .til{
text-align: center;
......
......@@ -6,6 +6,7 @@ Page({
courseData: '',
studentList : [],
lessonList: [],
class_id : '',
},
onLoad: function (options) {
......@@ -16,12 +17,11 @@ Page({
this.getclassdetail();
},
getclassdetail: function () {
const { coach_id, class_id} = this.data
let params = {
url : 'coach/classdetail',
data : {
coach_id : 5,
class_id : 16
class_id : this.data.class_id
},
callback : (data) => {
console.log(data)
......
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