Commit c67e040b authored by 吴颖's avatar 吴颖

Merge branch 'master' of...

Merge branch 'master' of http://gitlab.xueyoubangedu.com/shipanpan/wandouchengzhang_coach into wuying
parents aadaf2b9 77e3bd2b
var startPoint;
const min = 80;
const max = 294;
Component({
/**
* 组件的属性列表
*/
properties: {
currentProgress: {
type: Number,
value: 0
},
maxProgress: {
type: Number,
value: 10
},
canSlide: {
type: Boolean,
value: true
},
progressName:{
type:String,
value:""
},
slideImg:{
type:String,
value:"image/ic_slide_button_1.png"
},
titlesize:{
type:String,
value:"24rpx",
},
fontWeight:{
type:Number,
value:500,
},
color:{
type: String,
value: "#333333",
}
},
/**
* 组件的初始数据
*/
data: {
buttonLeft: 80,
progress: 0,
progressText: 0,
},
lifetimes: {
attached: function() {
// 在组件实例进入页面节点树时执行
this.setData({
progressText: (this.properties.currentProgress).toFixed(1),
buttonLeft: this.properties.currentProgress * (max - min) / this.properties.maxProgress + min,
progress: this.properties.currentProgress * (max - min) / this.properties.maxProgress
})
},
detached: function() {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
methods: {
buttonStart: function(e) {
startPoint = e.touches[0]
},
buttonMove: function(e) {
if (!this.properties.canSlide) {
return
}
var endPoint = e.touches[e.touches.length - 1]
var translateX = endPoint.clientX - startPoint.clientX
var translateY = endPoint.clientY - startPoint.clientY
startPoint = endPoint;
var buttonLeft = this.data.buttonLeft + translateX;
if (buttonLeft > max) {
return
}
if (buttonLeft < min) {
return
}
console.log(buttonLeft)
this.setData({
// buttonTop: buttonTop,
buttonLeft: buttonLeft,
progress: buttonLeft - min,
progressText: ((buttonLeft - min) / (max - min) * this.properties.maxProgress).toFixed(1)
//
})
},
buttonEnd: function(e) {
},
/**
* 获取分数
*/
getScore(){
return this.data.progressText
},
setCurrentProgress(progress){
this.setData({
currentProgress:progress,
progressText: (progress).toFixed(1),
buttonLeft: progress * (max - min) / this.properties.maxProgress + min,
progress: progress * (max - min) / this.properties.maxProgress
})
}
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class='progress-root-container'>
<text class='text' style='color:{{color}};font-size:{{titlesize}};font-weight:{{fontWeight}}'>{{progressName}}</text>
<view class='progress-max'></view>
<view class='progress-current' style="width:{{2*progress}}rpx"></view>
<text class='pencent-text'>{{progressText}}</text>
<image class='slice-button' src='{{slideImg}}' catchtouchmove="buttonMove" catchtouchstart="buttonStart" catchtouchend="buttonEnd" style="left:{{2*buttonLeft}}rpx"/>
</view>
/* 588rpx max 160rpx min */
.progress-root-container {
display: flex;
flex-direction: row;
width: 627rpx;
align-items: center;
height: 68rpx;
}
.text {
font-size: 24rpx;
color: #1A1A1A;
font-weight: normal;
position: absolute;
left: 60rpx;
}
.progress-max {
position: absolute;
left: 192rpx;
height: 8rpx;
width: 428rpx;
background: #E3E4E6;
border-radius: 30rpx;
z-index: 10;
}
.progress-current {
position: absolute;
left: 192rpx;
height: 8rpx;
width: 428rpx;
background: #FFC600;
border-radius: 30rpx;
z-index: 20;
}
.pencent-text {
font-size: 28rpx;
color: #1A1A1A;
left: 646rpx;
position: absolute;
z-index: 20;
}
.slice-button {
left: 588rpx;
width: 40rpx;
height: 30rpx;
position: absolute;
z-index: 30;
}
\ No newline at end of file
...@@ -10,7 +10,7 @@ Page({ ...@@ -10,7 +10,7 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options) console.log(options.lesson_id)
this.getlessondetail() this.getlessondetail()
}, },
...@@ -35,9 +35,11 @@ Page({ ...@@ -35,9 +35,11 @@ Page({
base.newRequest(params) base.newRequest(params)
}, },
goperformance:function(){ goperformance:function(e){
var child_id = e.currentTarget.dataset.id
console.log(child_id)
wx.navigateTo({ wx.navigateTo({
url: '../../index/performance/performance', url: '../../index/performance/performance?child_id=' + child_id,
}) })
}, },
gocourseinstant: function () { gocourseinstant: function () {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
</view> </view>
<view class="status"> <view class="status">
<view class="evaluation" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view> <view class="evaluation" data-id="{{item.id}}" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view>
<view class="leave" wx:else>已请假</view> <view class="leave" wx:else>已请假</view>
<view class="unread" wx:if="{{ !item.class_moment }}"></view> <view class="unread" wx:if="{{ !item.class_moment }}"></view>
</view> </view>
......
...@@ -8,7 +8,8 @@ Page({ ...@@ -8,7 +8,8 @@ Page({
texts: "已输入", texts: "已输入",
min: 0,//最少字数 min: 0,//最少字数
max: 300, //最多字数 max: 300, //最多字数
currentWordNumber:0 currentWordNumber:0,
currentValue: 50,
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -36,53 +37,10 @@ Page({ ...@@ -36,53 +37,10 @@ Page({
if (len > this.data.max) return; if (len > this.data.max) return;
console.log(this.data) console.log(this.data)
}, },
onDrag(event) {
/** this.setData({
* 生命周期函数--监听页面初次渲染完成 currentValue: event.detail.value,
*/ });
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"bar": "/components/bar/index"
},
"navigationBarTitleText": "运动评价" "navigationBarTitleText": "运动评价"
} }
\ No newline at end of file
<view class="cont"> <view class="cont">
<view class="performance"> <view class="performance">
<view class="title">运动表现</view> <view class="title">运动表现</view>
<view class="progress-box"> <bar id="bar1" class="bar1" currentProgress="10" maxProgress="10" canSlide="{{true}}" progressName="运动量" slideImg="../../images/ic_slide_button_1.png" />
<progress percent="100" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" /> <bar id="bar1" class="bar1" currentProgress="9" maxProgress="10" canSlide="{{true}}" progressName="体力" slideImg="../../images/ic_slide_button_1.png" />
</view> <bar id="bar1" class="bar1" currentProgress="8" maxProgress="10" canSlide="{{true}}" progressName="完整度" slideImg="../../images/ic_slide_button_1.png" />
<view class="progress-box"> <bar id="bar1" class="bar1" currentProgress="6" maxProgress="10" canSlide="{{true}}" progressName="柔韧度" slideImg="../../images/ic_slide_button_1.png" />
<progress percent="80" show-info stroke-width="6" border-radius="8" activeColor="#FFC600" /> <bar id="bar1" class="bar1" currentProgress="8" maxProgress="10" canSlide="{{true}}" progressName="耐力" slideImg="../../images/ic_slide_button_1.png" />
</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>
<view class="coach"> <view class="coach">
<view class="title">教练评语</view> <view class="title">教练评语</view>
......
...@@ -63,10 +63,23 @@ page { ...@@ -63,10 +63,23 @@ page {
margin-bottom: 50rpx; margin-bottom: 50rpx;
} }
.txt{
color: #1A1A1A;
font-size: 24rpx;
line-height: 56rpx;
}
.bar{
width: 80%;
}
.head{
width: 12%;
color: #1A1A1A;
font-size: 24rpx;
}
/* 进度条样式 */ /* 进度条样式 */
.progress-box{ .progress-box{
width: 80%; width: 80%;
margin-left: 100rpx; margin-left: 48rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
......
...@@ -8,33 +8,20 @@ Page({ ...@@ -8,33 +8,20 @@ Page({
windowWidth: '', windowWidth: '',
windowHeight: '', windowHeight: '',
coach : '', coach : '',
scoreList: '',
coachcomment:'', coachcomment:'',
awardList: [ awardList: []
{
src:'/images/my/per_pic_02.png'
},
{
src:'/images/my/per_pic_02.png'
},
{
src:'/images/my/per_pic_02.png'
},
{
src:'/images/my/per_pic_02.png'
},
{
src:'/images/my/per_pic_02.png'
}
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options.child_id)
this.getRpx() this.getRpx()
this.getCharts() this.getCharts()
this.getcomment() this.getcomment()
this.getbadges()
}, },
getRpx() { getRpx() {
var res = wx.getSystemInfoSync(); //试图获取屏幕宽高数据 var res = wx.getSystemInfoSync(); //试图获取屏幕宽高数据
...@@ -50,7 +37,7 @@ Page({ ...@@ -50,7 +37,7 @@ Page({
categories: ['耐力', '体力', '柔韧度', '训练完整度', '运动量' ], categories: ['耐力', '体力', '柔韧度', '训练完整度', '运动量' ],
series: [{ series: [{
name: '运动表现', name: '运动表现',
data: [90, 110, 125, 95, 87] data: [90, 110, 125, 95, 87],
}], }],
width: this.data.windowWidth, width: this.data.windowWidth,
height: this.data.windowHeight, height: this.data.windowHeight,
...@@ -75,10 +62,29 @@ Page({ ...@@ -75,10 +62,29 @@ Page({
console.log(data) console.log(data)
this.setData({ this.setData({
coach : data.coach, coach : data.coach,
coachcomment : data coachcomment : data,
scoreList : data.comment_score,
}) })
} }
} }
base.newRequest(params) base.newRequest(params)
}, },
getbadges : function () {
const { user_child_id,class_id,class_single_id } = this.data
let params = {
url: 'badges',
data : {
user_child_id,
class_id,
class_single_id
},
callback : (data) =>{
console.log(data)
this.setData({
})
}
}
base.newRequest(params)
}
}) })
\ No newline at end of file
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
<view class="parents"> <view class="parents">
<view class="title">家长回复</view> <view class="title">家长回复</view>
<view class="flex-h"> <view class="flex-h">
<image src="{{coachcomment.child.wx_user.avatarurl}}"></image> <image src="/images/default_head.png" wx:if="{{coachcomment.child.wx_user.avatarurl == null}}"></image>
<text class="name">{{coachcomment.child.wx_user.nickname}}</text> <image src="{{coachcomment.child.wx_user.avatarurl}}" wx:else></image>
<text class="name">{{coachcomment.child.wx_user.nickname ? 'coachcomment.child.wx_user.nickname' : '家长名字'}}</text>
</view> </view>
<view class="comments">{{coachcomment.comment_reply}}</view> <view class="comments">{{coachcomment.comment_reply}}</view>
</view> </view>
......
...@@ -87,6 +87,7 @@ page { ...@@ -87,6 +87,7 @@ page {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
margin-right: 22rpx; margin-right: 22rpx;
border-radius: 50%;
} }
.parents .name{ .parents .name{
color: #1A1A1A; color: #1A1A1A;
......
...@@ -25,7 +25,7 @@ Page({ ...@@ -25,7 +25,7 @@ Page({
this.setData({ this.setData({
courseData : data, courseData : data,
studentList : data.class_students, studentList : data.class_students,
lessonList : data.end_lessons lessonList : data.class_single
}) })
} }
} }
......
{ {
"usingComponents": {}, "usingComponents": {
"van-steps": "../../../components/vant/steps/index"
},
"navigationBarTitleText": "班级详情" "navigationBarTitleText": "班级详情"
} }
\ No newline at end of file
...@@ -27,32 +27,20 @@ ...@@ -27,32 +27,20 @@
</view> </view>
<view class="haveclass"> <view class="haveclass">
<text class="title">已上课时</text>
<view class="haveclass-top flex-h flex-hb"> <view class="haveclass-top flex-h flex-hb">
<text class="title">已上课时</text> <text class="title">已上课时</text>
<text class="restclass">剩余<text class="number">2</text>课时</text> <text class="restclass">剩余<text class="number">{{courseData.left_num_count}}</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>应到:{{item.class_single_person_count}}人</text>
<text>实到:{{item.class_single_person_not_leave_count}}人</text>
</view> </view>
<view class="btn">课程详情</view> <view class="item" wx:for="{{lessonList}}" wx:key="index" data-id="{{item.id}}" >
</view> --> <image src="/images/select_circle.png" wx:if="{{item.lesson_status == 1}}"></image>
<block wx:for="{{lessonList}}" wx:key="index"> <image src="/images/circle.png" wx:else></image>
<view class="item"> <view class="line"></view>
<view class="item_content"> <view class="{{item.lesson_status == 1 ? 'lesson' : 'unlesson'}}">第{{item.class_index}}节课</view>
<view class="lesson">第{{item.class_index}}节课</view>
<view class="date">日期:{{item.class_date}}</view> <view class="date">日期:{{item.class_date}}</view>
<view class="number"> <view class="number">
<text>应到:{{item.class_single_person_count}}人</text> <text>应到:{{item.class_single_person_count}}人</text>
<text>实到:{{item.class_single_person_not_leave_count}}人</text> <text>实到:{{item.class_single_person_not_leave_count}}人</text>
</view> </view>
<view class="btn">课程详情</view> <view class="btn" wx:if="{{item.lesson_status == 1}}" data-id="{{item.id}}" catchtap="goclassDetail">课程详情</view>
</view> </view>
</view>
</block>
</view> </view>
\ No newline at end of file
...@@ -98,7 +98,8 @@ page{ ...@@ -98,7 +98,8 @@ page{
margin-left: 10rpx; margin-left: 10rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.haveclass .item{
.haveclass .item{
width: 640rpx; width: 640rpx;
height: 206rpx; height: 206rpx;
background: #FFFFFF; background: #FFFFFF;
...@@ -107,22 +108,23 @@ page{ ...@@ -107,22 +108,23 @@ page{
padding: 40rpx 20rpx; padding: 40rpx 20rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
margin-left: 50rpx; margin-left: 50rpx;
border-left: 1px solid #EEF0F2;
position: relative; position: relative;
} }
.haveclass .item::after{ .haveclass .item image{
content: ''; width: 26rpx;
display: inline-block; height: 26rpx;
position: absolute; position: absolute;
left: -60rpx; left: -50rpx;
top: 60rpx; top: 48rpx;
width: 20rpx; }
height: 20rpx; .haveclass .item .line{
border-radius: 20rpx; width: 2rpx;
background: #BDBDBD; height: 205rpx;
border: 2px solid #EEE; background: #EBEBEB;
position: absolute;
left: -38rpx;
top: 73rpx;
} }
.haveclass .item .lesson{ .haveclass .item .lesson{
color: #000000; color: #000000;
...@@ -130,6 +132,12 @@ page{ ...@@ -130,6 +132,12 @@ page{
margin-bottom: 33rpx; margin-bottom: 33rpx;
font-weight: bold; font-weight: bold;
} }
.haveclass .item .unlesson{
color: #999999;
font-size: 30rpx;
margin-bottom: 33rpx;
font-weight: bold;
}
.haveclass .item .date{ .haveclass .item .date{
color: #999999; color: #999999;
font-size: 24rpx; font-size: 24rpx;
...@@ -140,7 +148,7 @@ page{ ...@@ -140,7 +148,7 @@ page{
font-size: 24rpx; font-size: 24rpx;
} }
.haveclass .item .number text{ .haveclass .item .number text{
margin-right: 10rpx; margin-right: 50rpx;
} }
.haveclass .item .btn{ .haveclass .item .btn{
width: 136rpx; width: 136rpx;
......
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