|
|
|
@ -2,54 +2,38 @@ |
|
|
|
<template> |
|
|
|
<view class="main_section"> |
|
|
|
|
|
|
|
<view class="section_3"> |
|
|
|
<scroll-view |
|
|
|
class="section_3" |
|
|
|
scroll-y="true" |
|
|
|
:lower-threshold="lowerThreshold" |
|
|
|
@scrolltolower="loadMoreData" |
|
|
|
style="height: 80vh;" |
|
|
|
> |
|
|
|
<view class="ul"> |
|
|
|
<view class="li"> |
|
|
|
<view class="li" v-for="(v,k) in tableList" :key="k" @click="openViewWorkDetails(v)"> |
|
|
|
<view class="left_box"> |
|
|
|
<view class="date_box"> |
|
|
|
<text>12</text> |
|
|
|
<text>{{v.wc_count}}</text> |
|
|
|
<text>/</text> |
|
|
|
<text>24</text> |
|
|
|
<text>{{v.student_count}}</text> |
|
|
|
</view> |
|
|
|
<view class="ratio"> |
|
|
|
完成率:80% |
|
|
|
完成率:{{v.rate}}% |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="center_box"> |
|
|
|
<view>班级:少年班</view> |
|
|
|
<view>时间:2020-05-25 15:30 - 17:30</view> |
|
|
|
<view>课程:篮球少儿课 |
|
|
|
<view>班级:{{v.class_name}}</view> |
|
|
|
<view>时间:{{v.send_time}}</view> |
|
|
|
<view>课程:{{v.courses_name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="right_box"> |
|
|
|
<!-- <view class="tag" style="background:#fad24e;">上课中</view>--> |
|
|
|
<view class="tag" style="background:#1cd188;">待批改</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="li"> |
|
|
|
<view class="left_box"> |
|
|
|
<view class="date_box"> |
|
|
|
<text>12</text> |
|
|
|
<text>/</text> |
|
|
|
<text>24</text> |
|
|
|
</view> |
|
|
|
<view class="ratio"> |
|
|
|
完成率:80% |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="center_box"> |
|
|
|
<view>班级:少年班</view> |
|
|
|
<view>时间:2020-05-25 15:30 - 17:30</view> |
|
|
|
<view>课程:篮球少儿课 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="right_box"> |
|
|
|
<!-- <view class="tag" style="background:#fad24e;">上课中</view>--> |
|
|
|
<view class="tag" style="background:#1cd188;">待批改</view> |
|
|
|
</view> |
|
|
|
<view class="tag" v-if="v.dpg_count == 0" style="background:#1cd188;">待批改</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<!-- 底部导航--> |
|
|
|
<AQTabber/> |
|
|
|
@ -57,7 +41,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// import user from '@/api/user.js'; |
|
|
|
import memberApi from '@/api/member.js'; |
|
|
|
import AQTabber from "@/components/AQ/AQTabber.vue" |
|
|
|
|
|
|
|
|
|
|
|
@ -67,110 +51,89 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
list: [], |
|
|
|
likes: 0, |
|
|
|
type: 1, |
|
|
|
type1: 1, |
|
|
|
activity_id: 0, |
|
|
|
um_id: 0, |
|
|
|
urls: 'http://medication.zeyan.wang/' |
|
|
|
} |
|
|
|
loading:false,//加载状态 |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData:{ |
|
|
|
page:1,//当前页码 |
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
total:10,//数据总条数 |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
const um_id = uni.getStorageSync('um_id'); |
|
|
|
this.um_id = um_id |
|
|
|
if (um_id == '') { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/login/login' |
|
|
|
}) |
|
|
|
tableList:[],//数据列表 |
|
|
|
} |
|
|
|
this.fetchData(this.um_id) |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
onShow() { |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
fetchData(um_id) { |
|
|
|
user.activity_index({ |
|
|
|
um_id: um_id |
|
|
|
}).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.status == 200) { |
|
|
|
if (res.data == null) { |
|
|
|
this.list = [] |
|
|
|
} else { |
|
|
|
this.list = res.data |
|
|
|
} |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
async init(){ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.fetchData(this.um_id) |
|
|
|
|
|
|
|
//加载更多(下一页) |
|
|
|
loadMoreData() { |
|
|
|
//判断是否加载 |
|
|
|
if (!this.isReachedBottom) { |
|
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
publishing() { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/index/publishing' |
|
|
|
}) |
|
|
|
//重置为第一页 |
|
|
|
async resetFilteredData() { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
}, |
|
|
|
like(id, um_id) { |
|
|
|
user.activity_like({um_id: um_id, activity_id: id, type: 1}).then(res => { |
|
|
|
if (res.status == 200) { |
|
|
|
user.activity_index({ |
|
|
|
um_id: um_id |
|
|
|
}).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res.status == 200) { |
|
|
|
this.list = res.data |
|
|
|
} |
|
|
|
}); |
|
|
|
this.type = res.data.type |
|
|
|
this.activity_id = res.data.activity_id |
|
|
|
} else { |
|
|
|
//获取列表 |
|
|
|
async getList(){ |
|
|
|
this.loading = true |
|
|
|
|
|
|
|
let data = {...this.filteredData} |
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
|
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){ |
|
|
|
this.loading = false |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
title: '暂无更多', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
collection(id, um_id) { |
|
|
|
user.activity_like({um_id: um_id, activity_id: id, type: 2}).then(res => { |
|
|
|
if (res.status == 200) { |
|
|
|
console.log(res) |
|
|
|
this.fetchData(this.um_id) |
|
|
|
this.type1 = res.data.type |
|
|
|
this.activity_id = res.data.activity_id |
|
|
|
} else { |
|
|
|
|
|
|
|
if(data.page == 1){ |
|
|
|
this.tableList = [] |
|
|
|
} |
|
|
|
|
|
|
|
let res = await memberApi.jsGetAssignmentsList(data) |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1){ |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
console.log('列表',this.tableList) |
|
|
|
this.filteredData.total = res.data.total |
|
|
|
this.filteredData.page++ |
|
|
|
}, |
|
|
|
coninfo(item) { |
|
|
|
// user.coninfo({id:id}).then(res => { |
|
|
|
// if(res.status == 200){ |
|
|
|
uni.setStorageSync('coninfo', item); |
|
|
|
|
|
|
|
//跳转页面-作业详情 |
|
|
|
openViewWorkDetails(item){ |
|
|
|
let id = item.id |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/index/coninfo' |
|
|
|
url: `/pages/coach/student/work_details?id=${id}` |
|
|
|
}) |
|
|
|
// }else{ |
|
|
|
// uni.showToast({ |
|
|
|
// title: res.msg, |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}, |
|
|
|
Comment(id) { |
|
|
|
uni.setStorageSync('actid', id); |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/index/Comment' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|