于宏哲PHP 9 months ago
parent
commit
e99d12c5e0
  1. 4
      api/apiRoute.js
  2. 10
      pages.json
  3. 353
      pages/coach/job/list.vue
  4. 132
      pages/coach/my/service_detail.vue
  5. 414
      pages/coach/my/service_list.vue
  6. 20
      pages/coach/student/work_details.vue

4
api/apiRoute.js

@ -80,11 +80,11 @@ export default {
}, },
//获取服务详情 //获取服务详情
async getServiceDetail(data = {}) { async getServiceDetail(data = {}) {
return await http.get('/service/detail', data); return await http.get('/member/service/detail', data);
}, },
//获取服务列表 //获取服务列表
async getServiceList(data = {}) { async getServiceList(data = {}) {
return await http.get('/service/list', data); return await http.get('/member/service/list', data);
}, },
//完成服务 //完成服务
async completeService(data = {}) { async completeService(data = {}) {

10
pages.json

@ -619,9 +619,19 @@
"navigationBarBackgroundColor": "#29d3b4", "navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
},
{
"path": "pages/coach/my/service_list",
"style": {
"navigationBarTitleText": "服务列表",
"navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "black"
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",

353
pages/coach/job/list.vue

@ -2,16 +2,11 @@
<template> <template>
<view class="main_section"> <view class="main_section">
<scroll-view <scroll-view class="section_3" scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData"
class="section_3" style="height: 80vh;">
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 80vh;"
>
<view class="ul"> <view class="ul">
<view class="li" v-for="(v,k) in tableList" :key="k" @click="openViewWorkDetails(v)"> <view class="li" v-for="(v,k) in tableList" :key="k" @click="openViewWorkDetails(v)">
<view class="left_box"> <!-- <view class="left_box">
<view class="date_box"> <view class="date_box">
<text>{{v.wc_count}}</text> <text>{{v.wc_count}}</text>
<text>/</text> <text>/</text>
@ -20,16 +15,19 @@
<view class="ratio"> <view class="ratio">
完成率{{v.rate}}% 完成率{{v.rate}}%
</view> </view>
</view> </view> -->
<view class="center_box"> <view class="center_box">
<view>班级{{v.class_name}}</view> <view>班级{{v.class_name}}</view>
<view>时间{{v.send_time}}</view> <view>时间{{v.create_time}}</view>
<view>课程{{v.courses_name}} <view>课程{{v.course_name}}
</view> </view>
</view> </view>
<view class="right_box"> <view class="right_box">
<!-- <view class="tag" style="background:#fad24e;">上课中</view>--> <view class="tag" v-if="v.status == 1" style="background:#1cd188;">未提交</view>
<view class="tag" v-if="v.dpg_count == 0" style="background:#1cd188;">待批改</view> <view class="tag" v-if="v.status == 2" style="background:#1cd188;">已提交</view>
<view class="tag" v-if="v.status == 3" style="background:#1cd188;">待批改</view>
<view class="tag" v-if="v.status == 4" style="background:#1cd188;">已批改</view>
</view> </view>
</view> </view>
</view> </view>
@ -47,30 +45,44 @@
<uni-popup ref="publishPopup" type="center"> <uni-popup ref="publishPopup" type="center">
<view class="popup-content"> <view class="popup-content">
<view class="popup-title">发布作业</view> <view class="popup-title">发布作业</view>
<!--
<view class="form-item"> <view class="form-item">
<text class="form-label">类型</text> <text class="form-label">类型</text>
<input class="form-input" type="number" v-model="formData.type" placeholder="请输入类型" /> <input class="form-input" type="number" v-model="formData.type" placeholder="请输入类型" />
</view> </view>
-->
<view class="form-item"> <view class="form-item">
<text class="form-label">班级ID</text> <text class="form-label">班级</text>
<input class="form-input" type="number" v-model="formData.class_id" placeholder="请输入班级ID" /> <!-- <input class="form-input" type="number" v-model="formData.class_id" placeholder="请输入班级ID" /> -->
</view>
<view class="form-item"> <picker mode="selector" :range="class_id_options" range-key="name" @change="handleClassChange"
<text class="form-label">课程ID</text> class="form-picker">
<input class="form-input" type="number" v-model="formData.course_id" placeholder="请输入课程ID" /> <view v-if="selectedClassName" class="picker-text">{{ selectedClassName }}</view>
<view v-else class="picker-placeholder">请选择班级</view>
</picker>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label">教师ID</text> <text class="form-label">课程</text>
<input class="form-input" type="number" v-model="formData.personnel_id" placeholder="请输入教师ID" /> <!-- <input class="form-input" type="number" v-model="formData.course_id" placeholder="请输入课程" /> -->
<picker mode="selector" :range="course_list" range-key="name" @change="handleCourseChange"
class="form-picker">
<view v-if="selectedCourseName" class="picker-text">{{ selectedCourseName }}</view>
<view v-else class="picker-placeholder">请选择课程</view>
</picker>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label">学生ID</text> <text class="form-label">学生</text>
<input class="form-input" type="number" v-model="formData.student_id" placeholder="请输入学生ID" /> <!-- <input class="form-input" type="number" v-model="formData.student_id" placeholder="请输入学生ID" /> -->
<picker mode="selector" :range="student_list" range-key="name" @change="handleStudentChange"
class="form-picker">
<view v-if="selectedStudentName" class="picker-text">{{ selectedStudentName }}</view>
<view v-else class="picker-placeholder">请选择学生</view>
</picker>
</view> </view>
<view class="form-item"> <view class="form-item">
@ -78,57 +90,54 @@
<textarea class="form-textarea" v-model="formData.description" placeholder="请输入作业描述" /> <textarea class="form-textarea" v-model="formData.description" placeholder="请输入作业描述" />
</view> </view>
<view class="form-item"> <!-- <view class="form-item">
<text class="form-label">内容类型</text> <text class="form-label">内容类型</text>
<picker class="form-picker" :value="contentTypeIndex" :range="contentTypes" @change="contentTypeChange"> <picker class="form-picker" :value="contentTypeIndex" :range="contentTypes"
@change="contentTypeChange">
<view class="picker-text">{{contentTypes[contentTypeIndex]}}</view> <view class="picker-text">{{contentTypes[contentTypeIndex]}}</view>
</picker> </picker>
</view> </view> -->
<!-- 根据内容类型显示不同的上传控件 --> <!-- 根据内容类型显示不同的上传控件 -->
<!-- 图片类型 --> <!-- 图片类型 -->
<view class="form-item" v-if="formData.content_type === '1'"> <!-- <view class="form-item" v-if="formData.content_type === '1'">
<text class="form-label">上传图片</text> <text class="form-label">上传图片</text>
<view class="upload-container"> <view class="upload-container">
<!-- 已上传图片预览 -->
<view class="image-preview" v-if="uploadedFiles.image"> <view class="image-preview" v-if="uploadedFiles.image">
<image class="preview-image" :src="uploadedFiles.image" mode="aspectFill"></image> <image class="preview-image" :src="uploadedFiles.image" mode="aspectFill"></image>
<view class="delete-btn" @click="deleteFile('image')"> <view class="delete-btn" @click="deleteFile('image')">
<text class="delete-icon">×</text> <text class="delete-icon">×</text>
</view> </view>
</view> </view>
<!-- 上传按钮 -->
<view class="upload-btn" v-if="!uploadedFiles.image" @click="chooseFile('image')"> <view class="upload-btn" v-if="!uploadedFiles.image" @click="chooseFile('image')">
<text class="upload-icon">+</text> <text class="upload-icon">+</text>
<text class="upload-text">上传图片</text> <text class="upload-text">上传图片</text>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 视频类型 --> <!-- 视频类型 -->
<view class="form-item" v-if="formData.content_type === '2'"> <!-- <view class="form-item" v-if="formData.content_type === '2'">
<text class="form-label">上传视频</text> <text class="form-label">上传视频</text>
<view class="upload-container"> <view class="upload-container">
<!-- 已上传视频预览 -->
<view class="video-preview" v-if="uploadedFiles.video"> <view class="video-preview" v-if="uploadedFiles.video">
<video class="preview-video" :src="uploadedFiles.video" controls></video> <video class="preview-video" :src="uploadedFiles.video" controls></video>
<view class="delete-btn" @click="deleteFile('video')"> <view class="delete-btn" @click="deleteFile('video')">
<text class="delete-icon">×</text> <text class="delete-icon">×</text>
</view> </view>
</view> </view>
<!-- 上传按钮 -->
<view class="upload-btn" v-if="!uploadedFiles.video" @click="chooseFile('video')"> <view class="upload-btn" v-if="!uploadedFiles.video" @click="chooseFile('video')">
<text class="upload-icon">+</text> <text class="upload-icon">+</text>
<text class="upload-text">上传视频</text> <text class="upload-text">上传视频</text>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 文本类型 --> <!-- 文本类型 -->
<view class="form-item" v-if="formData.content_type === '3'"> <!-- <view class="form-item" v-if="formData.content_type === '3'">
<text class="form-label">内容文本</text> <text class="form-label">内容文本</text>
<textarea class="form-textarea" v-model="formData.content_text" placeholder="请输入内容文本" /> <textarea class="form-textarea" v-model="formData.content_text" placeholder="请输入内容文本" />
</view> </view> -->
<view class="form-buttons"> <view class="form-buttons">
<button class="btn-cancel" @click="closePublishPopup">取消</button> <button class="btn-cancel" @click="closePublishPopup">取消</button>
@ -140,9 +149,9 @@
</template> </template>
<script> <script>
// import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
@ -164,16 +173,19 @@ export default {
// //
formData: { formData: {
type: '',
class_id: '', class_id: '',
course_id: '', course_id: '',
personnel_id: '',
student_id: '', student_id: '',
description: '', description: '',
content_type: '1',
content_text: '',
status: '1'
}, },
class_id_options: [
],
selectedClassName:'',
course_list:[],
selectedCourseName:'',
student_list:[],
selectedStudentName:'',
// //
contentTypes: ['图片', '视频', '文本'], contentTypes: ['图片', '视频', '文本'],
contentTypeIndex: 0, contentTypeIndex: 0,
@ -185,68 +197,106 @@ export default {
}, },
// //
mockData: [ mockData: []
{ }
id: 1,
wc_count: 15,
student_count: 20,
rate: 75,
class_name: '高三一班',
send_time: '2023-05-12',
courses_name: '高等数学',
dpg_count: 0
}, },
{ onLoad() {
id: 2,
wc_count: 18,
student_count: 22,
rate: 82,
class_name: '高三二班',
send_time: '2023-05-13',
courses_name: '物理',
dpg_count: 5
}, },
{ onShow() {
id: 3, this.init()
wc_count: 10, // this.getData()
student_count: 25, },
rate: 40, methods: {
class_name: '高三三班', handleClassChange(e) {
send_time: '2023-05-14', const index = e.detail.value;
courses_name: '化学', const selectedClass = this.class_id_options[index];
dpg_count: 0 this.formData.class_id = selectedClass.id;
this.selectedClassName = selectedClass.name;
},
handleCourseChange(e) {
const index = e.detail.value;
const selectedCourse = this.course_list[index];
this.formData.course_id = selectedCourse.id;
this.selectedCourseName = selectedCourse.name;
}, },
{ handleStudentChange(e) {
id: 4, const index = e.detail.value;
wc_count: 22, const selectedStudent = this.student_list[index];
student_count: 24, this.formData.student_id = selectedStudent.id;
rate: 92, this.selectedStudentName = selectedStudent.name;
class_name: '高三四班',
send_time: '2023-05-15',
courses_name: '英语',
dpg_count: 3
}, },
{ async getClassList() {
id: 5, let params = {
wc_count: 16, status: 1, //(1 2)
student_count: 20,
rate: 80,
class_name: '高三五班',
send_time: '2023-05-16',
courses_name: '语文',
dpg_count: 0
}
]
} }
let res = await apiRoute.common_getClassAll(params)
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
console.log('班级列表', res.data)
let arr = []
res.data.forEach((v, k) => {
arr.push({
name: `${v.campus_name}-${v.class_name}`,
id: v.id,
})
})
this.class_id_options = arr
this.getCourseList()
}, },
onLoad() {}, async getCourseList() {
onShow() {
this.init() let res = await apiRoute.common_getCourseAll({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
let arr = []
res.data.forEach((v, k) => {
arr.push({
name: `${v.course_name}`,
id: v.id,
})
})
this.course_list = arr
this.getStudentList()
}, },
methods: { async getStudentList() {
let res = await apiRoute.jlGetStudentList({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
let arr = []
res.data.forEach((v, k) => {
arr.push({
name: `${v.name}`,
id: v.id,
})
})
this.student_list = arr
},
async init() { async init() {
this.getList() this.getList()
}, },
async getData() {
this.getClassList()
},
//() //()
loadMoreData() { loadMoreData() {
@ -268,7 +318,9 @@ export default {
async getList() { async getList() {
this.loading = true this.loading = true
let data = {...this.filteredData} let data = {
...this.filteredData
}
// //
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
@ -284,23 +336,6 @@ export default {
this.tableList = [] this.tableList = []
} }
// 使
setTimeout(() => {
this.loading = false
this.isReachedBottom = false
//
const startIndex = (this.filteredData.page - 1) * this.filteredData.limit
const endIndex = startIndex + this.filteredData.limit
const pageData = this.mockData.slice(startIndex, endIndex)
this.tableList = this.tableList.concat(pageData)
this.filteredData.total = this.mockData.length
this.filteredData.page++
}, 500)
//
/*
let res = await memberApi.jsGetAssignmentsList(data) let res = await memberApi.jsGetAssignmentsList(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
@ -317,7 +352,8 @@ export default {
console.log('列表', this.tableList) console.log('列表', this.tableList)
this.filteredData.total = res.data.total this.filteredData.total = res.data.total
this.filteredData.page++ this.filteredData.page++
*/
this.getData()
}, },
//- //-
@ -426,7 +462,7 @@ export default {
}, },
// //
submitForm() { async submitForm() {
// //
if (!this.formData.class_id) { if (!this.formData.class_id) {
uni.showToast({ uni.showToast({
@ -453,33 +489,42 @@ export default {
} }
// //
if (this.formData.content_type === '1' && !this.uploadedFiles.image) { // if (this.formData.content_type === '1' && !this.uploadedFiles.image) {
uni.showToast({ // uni.showToast({
title: '请上传图片', // title: '',
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
if (this.formData.content_type === '2' && !this.uploadedFiles.video) { // if (this.formData.content_type === '2' && !this.uploadedFiles.video) {
uni.showToast({ // uni.showToast({
title: '请上传视频', // title: '',
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
if (this.formData.content_type === '3' && !this.formData.content_text) { // if (this.formData.content_type === '3' && !this.formData.content_text) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return
// }
let res = await apiRoute.jlPublishJob(this.formData)
if (res.code != 1) {
uni.showToast({ uni.showToast({
title: '请输入内容文本', title: res.msg,
icon: 'none' icon: 'none'
}) })
return return
} }
console.log('提交表单数据:', this.formData)
//
uni.showToast({ uni.showToast({
title: '发布成功', title: '发布成功',
icon: 'success' icon: 'success'
@ -490,28 +535,24 @@ export default {
// //
this.formData = { this.formData = {
type: '',
class_id: '', class_id: '',
course_id: '', course_id: '',
personnel_id: '',
student_id: '', student_id: '',
description: '', description: '',
content_type: '1',
content_text: '',
status: '1'
}
this.contentTypeIndex = 0
this.uploadedFiles = {
image: '',
video: ''
} }
this.init()
// this.contentTypeIndex = 0
// this.uploadedFiles = {
// image: '',
// video: ''
// }
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main_section { .main_section {
min-height: 100vh; min-height: 100vh;
background: #292929 100%; background: #292929 100%;
@ -524,28 +565,34 @@ export default {
margin-top: 36rpx; margin-top: 36rpx;
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
.title_box { .title_box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.top_box { .top_box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
text { text {
font-size: 30rpx; font-size: 30rpx;
} }
} }
.line { .line {
width: 90rpx; width: 90rpx;
height: 2px; height: 2px;
background: #29D3B4; background: #29D3B4;
} }
} }
.ul { .ul {
margin-top: 30rpx; margin-top: 30rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20rpx; gap: 20rpx;
.li { .li {
position: relative; position: relative;
border-radius: 22rpx; border-radius: 22rpx;
@ -553,29 +600,35 @@ export default {
padding: 14rpx 0; padding: 14rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
.left_box { .left_box {
margin-left: 28rpx; margin-left: 28rpx;
width: 146rpx; width: 146rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10rpx; gap: 10rpx;
.date_box { .date_box {
display: flex; display: flex;
font-size: 48rpx; font-size: 48rpx;
text:nth-child(1) { text:nth-child(1) {
color: #29D3B4; color: #29D3B4;
} }
} }
.ratio { .ratio {
color: #AAAAAA; color: #AAAAAA;
} }
} }
.center_box { .center_box {
margin-left: 52rpx; margin-left: 52rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10rpx; gap: 10rpx;
} }
.right_box { .right_box {
.tag { .tag {
position: absolute; position: absolute;
@ -642,7 +695,9 @@ export default {
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.form-input, .form-textarea, .form-picker { .form-input,
.form-textarea,
.form-picker {
width: 100%; width: 100%;
background: #444; background: #444;
border-radius: 10rpx; border-radius: 10rpx;

132
pages/coach/my/service_detail.vue

@ -240,75 +240,75 @@ export default {
async getServiceDetail() { async getServiceDetail() {
try { try {
// 使 // 使
// const res = await apiRoute.getServiceDetail({id: this.id}); const res = await apiRoute.getServiceDetail({id: this.id});
// if(res.code == 1) { if(res.code == 1) {
// this.serviceInfo = res.data || null; this.serviceInfo = res.data || null;
// } else { } else {
// uni.showToast({ uni.showToast({
// title: res.msg || '', title: res.msg || '获取服务详情失败',
// icon: 'none' icon: 'none'
// }); });
// } }
// 使 // 使
setTimeout(() => { // setTimeout(() => {
// // //
const mockServices = { // const mockServices = {
'1': { // '1': {
id: '1', // id: '1',
resource_id: '美团用户1', // resource_id: '1',
course_id: '2001', // course_id: '2001',
service_id: '18645873651', // service_id: '18645873651',
service_remark: '针对学员英语口语发音进行专项辅导', // service_remark: '',
status: 1, // status: 1,
staff_id: '3001', // staff_id: '3001',
score: 4, // score: 4,
feedback: '老师很耐心,讲解很清楚,孩子进步很大', // feedback: '',
created_at: '2023-10-15 14:30:00', // created_at: '2023-10-15 14:30:00',
feedback_time: '2023-10-16 18:20:00', // feedback_time: '2023-10-16 18:20:00',
updated_at: '2023-10-16 18:20:00', // updated_at: '2023-10-16 18:20:00',
campus: '总部校区', // campus: '',
source: '线上', // source: '线',
channel: '地推' // channel: ''
}, // },
'2': { // '2': {
id: '2', // id: '2',
resource_id: '李柏辉', // resource_id: '',
course_id: '2002', // course_id: '2002',
service_id: '13876337043', // service_id: '13876337043',
service_remark: '解答家长关于课程安排的问题', // service_remark: '',
status: 0, // status: 0,
staff_id: '3001', // staff_id: '3001',
score: 0, // score: 0,
feedback: '', // feedback: '',
created_at: '2023-10-18 09:15:00', // created_at: '2023-10-18 09:15:00',
feedback_time: '', // feedback_time: '',
updated_at: '2023-10-18 09:15:00', // updated_at: '2023-10-18 09:15:00',
campus: '西区校区', // campus: '西',
source: '地推', // source: '',
channel: '' // channel: ''
}, // },
'3': { // '3': {
id: '3', // id: '3',
resource_id: '张小明', // resource_id: '',
course_id: '2003', // course_id: '2003',
service_id: '13912345678', // service_id: '13912345678',
service_remark: '为学员制定个性化学习计划', // service_remark: '',
status: 0, // status: 0,
staff_id: '3001', // staff_id: '3001',
score: 0, // score: 0,
feedback: '', // feedback: '',
created_at: '2023-10-20 16:45:00', // created_at: '2023-10-20 16:45:00',
feedback_time: '', // feedback_time: '',
updated_at: '2023-10-20 16:45:00', // updated_at: '2023-10-20 16:45:00',
campus: '东区校区', // campus: '',
source: '线下', // source: '线',
channel: '朋友介绍' // channel: ''
} // }
}; // };
// ID // ID
this.serviceInfo = mockServices[this.id] || null; // this.serviceInfo = mockServices[this.id] || null;
if (!this.serviceInfo) { if (!this.serviceInfo) {
uni.showToast({ uni.showToast({
@ -319,7 +319,7 @@ export default {
this.navigateBack(); this.navigateBack();
}, 1500); }, 1500);
} }
}, 500); // }, 500);
} catch(error) { } catch(error) {
console.error('获取服务详情失败:', error); console.error('获取服务详情失败:', error);
uni.showToast({ uni.showToast({

414
pages/coach/my/service_list.vue

@ -0,0 +1,414 @@
<!--作业列表-->
<template>
<view class="main_section">
<scroll-view class="section_3" scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData"
style="height: 80vh;">
<view class="ul">
<view class="li" v-for="(v,k) in tableList" :key="k" @click="openViewWorkDetails(v)">
<view class="center_box">
<view>服务{{v.service_name}}</view>
<view>时间{{v.created_at}}</view>
<view>服务描述{{v.description}}
</view>
</view>
<view class="right_box">
<view class="tag" v-if="v.status == 1" style="background:#1cd188;">已服务</view>
<view class="tag" v-else style="background:#1cd188;">待服务</view>
</view>
</view>
</view>
</scroll-view>
<!-- 底部导航-->
<AQTabber />
</view>
</template>
<script>
import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default {
components: {
AQTabber,
},
data() {
return {
loading: false, //
lowerThreshold: 100, //
isReachedBottom: false, //|true=|false=
//
filteredData: {
page: 1, //
limit: 10, //
total: 10, //
},
tableList: [], //
}
},
onLoad() {
},
onShow() {
this.init()
},
methods: {
async init(){
this.getList() //
},
//()
loadMoreData() {
//
if (!this.isReachedBottom) {
this.isReachedBottom = true; //
this.getList();
}
},
//
async resetFilteredData() {
this.isReachedBottom = false; // 便
this.filteredData.page = 1 //
this.filteredData.limit = 10 //
this.filteredData.total = 10 //
},
//
async getList() {
this.loading = true
let data = {
...this.filteredData
}
//
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if (data.page == 1) {
this.tableList = []
}
let res = await apiRoute.getServiceList(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
this.filteredData.total = res.data.total
this.filteredData.page++
this.getData()
},
//-
openViewWorkDetails(item) {
let id = item.id
this.$navigateTo({
url: `/pages/coach/my/service_detail?id=${id}`
})
}
}
}
</script>
<style lang="less" scoped>
.main_section {
min-height: 100vh;
background: #292929 100%;
padding: 0 24rpx;
padding-top: 40rpx;
padding-bottom: 150rpx;
font-size: 28rpx;
.section_3 {
margin-top: 36rpx;
color: #fff;
font-size: 24rpx;
.title_box {
display: flex;
flex-direction: column;
.top_box {
display: flex;
justify-content: space-between;
align-items: center;
text {
font-size: 30rpx;
}
}
.line {
width: 90rpx;
height: 2px;
background: #29D3B4;
}
}
.ul {
margin-top: 30rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
.li {
position: relative;
border-radius: 22rpx;
background: #434544 100%;
padding: 14rpx 0;
display: flex;
align-items: center;
.left_box {
margin-left: 28rpx;
width: 146rpx;
display: flex;
flex-direction: column;
gap: 10rpx;
.date_box {
display: flex;
font-size: 48rpx;
text:nth-child(1) {
color: #29D3B4;
}
}
.ratio {
color: #AAAAAA;
}
}
.center_box {
margin-left: 52rpx;
display: flex;
flex-direction: column;
gap: 10rpx;
}
.right_box {
.tag {
position: absolute;
top: 0rpx;
right: 0rpx;
padding: 10rpx;
width: 102rpx;
text-align: center;
font-size: 24rpx;
border-bottom-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
}
}
}
}
//
.publish-btn {
position: fixed;
bottom: 220rpx;
right: 40rpx;
width: 120rpx;
height: 120rpx;
background: #29D3B4;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 20rpx rgba(41, 211, 180, 0.4);
z-index: 99;
.btn-text {
color: #fff;
font-size: 26rpx;
text-align: center;
}
}
//
.popup-content {
width: 650rpx;
background: #333;
border-radius: 20rpx;
padding: 30rpx;
max-height: 80vh;
overflow-y: auto;
.popup-title {
font-size: 36rpx;
color: #fff;
text-align: center;
margin-bottom: 30rpx;
font-weight: bold;
}
.form-item {
margin-bottom: 20rpx;
.form-label {
display: block;
color: #fff;
font-size: 28rpx;
margin-bottom: 10rpx;
}
.form-input,
.form-textarea,
.form-picker {
width: 100%;
background: #444;
border-radius: 10rpx;
padding: 16rpx;
color: #fff;
font-size: 28rpx;
box-sizing: border-box;
}
.form-textarea {
height: 150rpx;
}
.picker-text {
height: 60rpx;
line-height: 60rpx;
}
//
.upload-container {
margin-top: 10rpx;
}
.upload-btn {
width: 200rpx;
height: 200rpx;
background: #444;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px dashed #666;
.upload-icon {
font-size: 60rpx;
color: #29D3B4;
line-height: 60rpx;
}
.upload-text {
font-size: 24rpx;
color: #aaa;
margin-top: 10rpx;
}
}
//
.image-preview {
position: relative;
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
.preview-image {
width: 100%;
height: 100%;
}
.delete-btn {
position: absolute;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
.delete-icon {
color: #fff;
font-size: 28rpx;
}
}
}
//
.video-preview {
position: relative;
width: 100%;
height: 300rpx;
border-radius: 10rpx;
overflow: hidden;
.preview-video {
width: 100%;
height: 100%;
}
.delete-btn {
position: absolute;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
.delete-icon {
color: #fff;
font-size: 28rpx;
}
}
}
}
.form-buttons {
display: flex;
justify-content: space-between;
margin-top: 40rpx;
button {
width: 45%;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 30rpx;
}
.btn-cancel {
background: #555;
color: #fff;
}
.btn-submit {
background: #29D3B4;
color: #fff;
}
}
}
}
</style>

20
pages/coach/student/work_details.vue

@ -2,9 +2,11 @@
<template> <template>
<view class="dark-theme"> <view class="dark-theme">
<!-- 作业展示--> <!-- 作业展示-->
<view class="top-style" v-if="infoData.student_file"> <view class="top-style" v-if="infoData.content_text">
<video v-if="infoData.student_file_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.student_file)"></video> <video v-if="infoData.content_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.content_text)"></video>
<image v-else style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.student_file)" mode="aspectFit"></image> <image v-if="infoData.content_type == 1" style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.content_text)" mode="aspectFit"></image>
<view v-if="infoData.content_type == 3" class="multi-line-ellipsis" v-html="infoData.content_text"></view>
</view> </view>
<!-- 简练信息+作业描述--> <!-- 简练信息+作业描述-->
@ -14,7 +16,7 @@
<fui-avatar width="80" :src="$util.img(infoData.coach_pic)"></fui-avatar> <fui-avatar width="80" :src="$util.img(infoData.coach_pic)"></fui-avatar>
<view class="head-text">{{infoData.coach_name}}</view> <view class="head-text">{{infoData.coach_name}}</view>
</view> </view>
<view class="multi-line-ellipsis" v-html="infoData.content_text"></view> <view class="multi-line-ellipsis" v-html="infoData.description"></view>
</view> </view>
</view> </view>
</template> </template>
@ -36,15 +38,15 @@ export default {
onLoad(options) { onLoad(options) {
this.filteredData.id = options.id || '1' // ID1 this.filteredData.id = options.id || '1' // ID1
// 使 // 使
this.mockData() // this.mockData()
}, },
onShow(){ onShow(){
// this.init() // - this.init() // -
}, },
methods: { methods: {
// //
async init(){ async init(){
// this.getAssignmentsInfo() // this.getAssignmentsInfo() //
}, },
// //
@ -59,7 +61,7 @@ export default {
}, },
// - // -
/*
async getAssignmentsInfo() { async getAssignmentsInfo() {
let params = {...this.filteredData} let params = {...this.filteredData}
let res = await memberApi.assignmentsInfo(params) let res = await memberApi.assignmentsInfo(params)
@ -73,7 +75,7 @@ export default {
this.infoData = res.data this.infoData = res.data
}, },
*/
} }
} }
</script> </script>

Loading…
Cancel
Save