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

Merge branch 'shipanpan' into 'master'

修改

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