于宏哲PHP 9 months ago
parent
commit
e99d12c5e0
  1. 4
      api/apiRoute.js
  2. 10
      pages.json
  3. 1573
      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 = {}) {
return await http.get('/service/detail', data);
return await http.get('/member/service/detail', data);
},
//获取服务列表
async getServiceList(data = {}) {
return await http.get('/service/list', data);
return await http.get('/member/service/list', data);
},
//完成服务
async completeService(data = {}) {

10
pages.json

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

1573
pages/coach/job/list.vue

File diff suppressed because it is too large

132
pages/coach/my/service_detail.vue

@ -240,75 +240,75 @@ export default {
async getServiceDetail() {
try {
// 使
// const res = await apiRoute.getServiceDetail({id: this.id});
// if(res.code == 1) {
// this.serviceInfo = res.data || null;
// } else {
// uni.showToast({
// title: res.msg || '',
// icon: 'none'
// });
// }
const res = await apiRoute.getServiceDetail({id: this.id});
if(res.code == 1) {
this.serviceInfo = res.data || null;
} else {
uni.showToast({
title: res.msg || '获取服务详情失败',
icon: 'none'
});
}
// 使
setTimeout(() => {
//
const mockServices = {
'1': {
id: '1',
resource_id: '美团用户1',
course_id: '2001',
service_id: '18645873651',
service_remark: '针对学员英语口语发音进行专项辅导',
status: 1,
staff_id: '3001',
score: 4,
feedback: '老师很耐心,讲解很清楚,孩子进步很大',
created_at: '2023-10-15 14:30:00',
feedback_time: '2023-10-16 18:20:00',
updated_at: '2023-10-16 18:20:00',
campus: '总部校区',
source: '线上',
channel: '地推'
},
'2': {
id: '2',
resource_id: '李柏辉',
course_id: '2002',
service_id: '13876337043',
service_remark: '解答家长关于课程安排的问题',
status: 0,
staff_id: '3001',
score: 0,
feedback: '',
created_at: '2023-10-18 09:15:00',
feedback_time: '',
updated_at: '2023-10-18 09:15:00',
campus: '西区校区',
source: '地推',
channel: ''
},
'3': {
id: '3',
resource_id: '张小明',
course_id: '2003',
service_id: '13912345678',
service_remark: '为学员制定个性化学习计划',
status: 0,
staff_id: '3001',
score: 0,
feedback: '',
created_at: '2023-10-20 16:45:00',
feedback_time: '',
updated_at: '2023-10-20 16:45:00',
campus: '东区校区',
source: '线下',
channel: '朋友介绍'
}
};
// setTimeout(() => {
// //
// const mockServices = {
// '1': {
// id: '1',
// resource_id: '1',
// course_id: '2001',
// service_id: '18645873651',
// service_remark: '',
// status: 1,
// staff_id: '3001',
// score: 4,
// feedback: '',
// created_at: '2023-10-15 14:30:00',
// feedback_time: '2023-10-16 18:20:00',
// updated_at: '2023-10-16 18:20:00',
// campus: '',
// source: '线',
// channel: ''
// },
// '2': {
// id: '2',
// resource_id: '',
// course_id: '2002',
// service_id: '13876337043',
// service_remark: '',
// status: 0,
// staff_id: '3001',
// score: 0,
// feedback: '',
// created_at: '2023-10-18 09:15:00',
// feedback_time: '',
// updated_at: '2023-10-18 09:15:00',
// campus: '西',
// source: '',
// channel: ''
// },
// '3': {
// id: '3',
// resource_id: '',
// course_id: '2003',
// service_id: '13912345678',
// service_remark: '',
// status: 0,
// staff_id: '3001',
// score: 0,
// feedback: '',
// created_at: '2023-10-20 16:45:00',
// feedback_time: '',
// updated_at: '2023-10-20 16:45:00',
// campus: '',
// source: '线',
// channel: ''
// }
// };
// ID
this.serviceInfo = mockServices[this.id] || null;
// this.serviceInfo = mockServices[this.id] || null;
if (!this.serviceInfo) {
uni.showToast({
@ -319,7 +319,7 @@ export default {
this.navigateBack();
}, 1500);
}
}, 500);
// }, 500);
} catch(error) {
console.error('获取服务详情失败:', error);
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>
<view class="dark-theme">
<!-- 作业展示-->
<view class="top-style" v-if="infoData.student_file">
<video v-if="infoData.student_file_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.student_file)"></video>
<image v-else style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.student_file)" mode="aspectFit"></image>
<view class="top-style" v-if="infoData.content_text">
<video v-if="infoData.content_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(infoData.content_text)"></video>
<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>
<!-- 简练信息+作业描述-->
@ -14,7 +16,7 @@
<fui-avatar width="80" :src="$util.img(infoData.coach_pic)"></fui-avatar>
<view class="head-text">{{infoData.coach_name}}</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>
</template>
@ -36,15 +38,15 @@ export default {
onLoad(options) {
this.filteredData.id = options.id || '1' // ID1
// 使
this.mockData()
// this.mockData()
},
onShow(){
// this.init() // -
this.init() // -
},
methods: {
//
async init(){
// this.getAssignmentsInfo() //
this.getAssignmentsInfo() //
},
//
@ -59,7 +61,7 @@ export default {
},
// -
/*
async getAssignmentsInfo() {
let params = {...this.filteredData}
let res = await memberApi.assignmentsInfo(params)
@ -73,7 +75,7 @@ export default {
this.infoData = res.data
},
*/
}
}
</script>

Loading…
Cancel
Save