Commit 7ddf9a7f authored by 石盼盼's avatar 石盼盼

修改

parent a2930aee
...@@ -20,6 +20,7 @@ Page({ ...@@ -20,6 +20,7 @@ Page({
lesson_id: options.lesson_id lesson_id: options.lesson_id
}) })
console.log(options.lesson_id) console.log(options.lesson_id)
console.log(options.class_id)
this.getlessondetail() this.getlessondetail()
}, },
...@@ -47,7 +48,7 @@ Page({ ...@@ -47,7 +48,7 @@ Page({
var child_id = e.currentTarget.dataset.id var child_id = e.currentTarget.dataset.id
console.log(child_id) console.log(child_id)
wx.navigateTo({ wx.navigateTo({
url: '../../index/performance/performance?child_id=' + child_id, url: '../../index/performance/performance?child_id=' + child_id + '&lesson_id=' + this.data.lesson_id + '&class_id=' + this.data.class_id,
}) })
}, },
gocourseinstant: function () { gocourseinstant: function () {
......
...@@ -8,18 +8,15 @@ Page({ ...@@ -8,18 +8,15 @@ Page({
windowWidth: '', windowWidth: '',
windowHeight: '', windowHeight: '',
coach : '', coach : '',
scoreList: '', scoreList: [],
coachcomment:'', coachcomment:'',
awardList: [] awardList: [],
arr1: [],
arr2:[]
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { onLoad: function (options) {
console.log(options.child_id) console.log(options.child_id)
this.getRpx() this.getRpx()
this.getCharts()
this.getcomment() this.getcomment()
this.getbadges() this.getbadges()
}, },
...@@ -34,10 +31,10 @@ Page({ ...@@ -34,10 +31,10 @@ Page({
lineChart = new Charts({ lineChart = new Charts({
canvasId: 'radarCanvas', canvasId: 'radarCanvas',
type: 'radar', type: 'radar',
categories: ['耐力', '体力', '柔韧度', '训练完整度', '运动量' ], categories: this.data.arr1,
legend: false, legend: false,
series: [{ series: [{
data: [90, 80, 70, 90, 60], data: this.data.arr2,
}], }],
width: this.data.windowWidth, width: this.data.windowWidth,
height: this.data.windowHeight, height: this.data.windowHeight,
...@@ -65,7 +62,23 @@ Page({ ...@@ -65,7 +62,23 @@ Page({
coachcomment : data, coachcomment : data,
scoreList : data.comment_score, scoreList : data.comment_score,
}) })
} var arrs = [];
var newArrs =[];
for(var i = 0 ; i<this.data.scoreList.length; i++) {
// console.log(this.data.scoreList)
arrs.push(this.data.scoreList[i].comment_norm.name)
// console.log(arrs)
newArrs.push(this.data.scoreList[i].score)
// console.log(newArrs)
}
this.setData({
arr1:arrs,
arr2: newArrs
})
console.log(this.data.arr1)
console.log(this.data.arr2)
this.getCharts()
},
} }
base.newRequest(params) base.newRequest(params)
}, },
......
...@@ -8,7 +8,8 @@ Page({ ...@@ -8,7 +8,8 @@ Page({
data: { data: {
activeIndex: 1, activeIndex: 1,
datalList: [], datalList: [],
locked:false locked:false,
classList : [],
}, },
...@@ -16,9 +17,10 @@ Page({ ...@@ -16,9 +17,10 @@ Page({
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
}) })
this.getList(); this.getList()
this.getMyclasslist(); this.getMyclasslist();
}, },
// 抢班列表
getList: function () { getList: function () {
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -40,6 +42,7 @@ Page({ ...@@ -40,6 +42,7 @@ Page({
} }
base.newRequest(params) base.newRequest(params)
}, },
// 我的班级列表
getMyclasslist: function () { getMyclasslist: function () {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
...@@ -54,13 +57,14 @@ Page({ ...@@ -54,13 +57,14 @@ Page({
console.log(data) console.log(data)
wx.hideLoading(); wx.hideLoading();
this.setData({ this.setData({
datalList:data, classList: data,
locked:false locked:false
}) })
} }
} }
base.newRequest(params) base.newRequest(params)
}, },
// 抢班-我的班级列表
getrobclass : function () { getrobclass : function () {
const { coach_id, class_id} = this.data const { coach_id, class_id} = this.data
let params = { let params = {
...@@ -72,7 +76,7 @@ Page({ ...@@ -72,7 +76,7 @@ Page({
callback : (data) => { callback : (data) => {
console.log(data) console.log(data)
this.setData({ this.setData({
datalList: data datalList: data
}) })
} }
} }
...@@ -87,10 +91,9 @@ Page({ ...@@ -87,10 +91,9 @@ Page({
} }
}, },
goteamDetail (e) { goteamDetail (e) {
var lesson_id = e.currentTarget.dataset.id var class_id = e.currentTarget.dataset.id
console.log(lesson_id)
wx.navigateTo({ wx.navigateTo({
url: '../../team/teamDetail/teamDetail?lesson_id=' + lesson_id, url: '../../team/teamDetail/teamDetail?class_id=' + class_id,
}) })
}, },
initData:function(){ initData:function(){
......
{ {
"usingComponents": {}, "usingComponents": {
"van-empty": "/components/vant/empty/index"
},
"navigationBarTitleText": "抢班" "navigationBarTitleText": "抢班"
} }
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<text class="{{activeIndex == 2 ? 'active': ''}}" catchtap="changeTab" data-index="2">我的班级</text> <text class="{{activeIndex == 2 ? 'active': ''}}" catchtap="changeTab" data-index="2">我的班级</text>
</view> </view>
<view> <view>
<view wx:if="{{datalList.length>0}}"> <block wx:if="{{datalList.length>0}}">
<view class="tabContent" wx:if="{{activeIndex == 1 }}" wx:for="{{datalList}}" wx:key="item" data-item="{{item}}"> <view class="tabContent" wx:if="{{activeIndex == 1 }}" wx:for="{{datalList}}" wx:key="item" data-item="{{item}}">
<view class="tab_item"> <view class="tab_item">
<view class="class-title">{{item.course.name}}</view> <view class="class-title">{{item.course.name}}</view>
...@@ -16,12 +16,16 @@ ...@@ -16,12 +16,16 @@
<view class="goclass" bindtap="getrobclass">我要上课</view> <view class="goclass" bindtap="getrobclass">我要上课</view>
</view> </view>
</view> </view>
</view> </block>
<none wx:else></none> <block wx:else>
<view class="empty">
<van-empty class="custom-image" image="/images/without.png" description="暂无课程" />
</view>
</block>
</view> </view>
<view> <view>
<view wx:if="{{datalList.length>0}}"> <block wx:if="{{classList.length>0}}">
<view class="tabContent1" wx:if="{{activeIndex == 2}}" wx:for="{{datalList}}" wx:key="item" data-id="{{item.id}}" catchtap="goteamDetail"> <view class="tabContent1" wx:if="{{activeIndex == 2}}" wx:for="{{classList}}" 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>
...@@ -34,7 +38,11 @@ ...@@ -34,7 +38,11 @@
</view> </view>
</view> </view>
</view> </view>
</view> </block>
<none wx:else></none> <block wx:else>
<view class="empty">
<van-empty class="custom-image" image="/images/without.png" description="暂无课程" />
</view>
</block>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -9,7 +9,10 @@ Page({ ...@@ -9,7 +9,10 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options) this.setData({
class_id : options.class_id
})
console.log(options.class_id)
this.getclassdetail(); this.getclassdetail();
}, },
getclassdetail: function () { getclassdetail: function () {
...@@ -34,9 +37,8 @@ Page({ ...@@ -34,9 +37,8 @@ Page({
goclassDetail:function(e){ goclassDetail:function(e){
var lesson_id = e.currentTarget.dataset.id var lesson_id = e.currentTarget.dataset.id
console.log(lesson_id)
wx.navigateTo({ wx.navigateTo({
url: '../../index/classDetail/classDetail?lesson_id=' + lesson_id url: '../../index/classDetail/classDetail?lesson_id=' + lesson_id + '&class_id=' + this.data.class_id
}) })
}, },
......
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