Browse Source

Merge branch 'master' of ssh://gitlab.frkj.cc:222/php/ZhiHuiJiaoWu_UniApp

master
王泽彦 10 months ago
parent
commit
d70b68342e
  1. 35
      api/apiRoute.js
  2. 9
      pages.json
  3. 193
      pages/student/index/index.vue
  4. 45
      pages/student/index/job_list.vue
  5. 4
      pages/student/login/login.vue
  6. 47
      pages/student/my/lesson_consumption.vue
  7. 9
      pages/student/my/my.vue
  8. 211
      pages/student/my/my_coach.vue

35
api/apiRoute.js

@ -539,6 +539,41 @@ export default {
})
},
//学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetMyCoach(data = {}) {
let url = '/xy/personCourseSchedule/getMyCoach'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-学生课程安排-获取学生课程消耗记录列表
xy_personCourseScheduleGetStudentCourseUsageList(data = {}) {
let url = '/xy/personCourseSchedule/getStudentCourseUsageList'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-获取作业列表
xy_assignment(data = {}) {
let url = '/xy/assignment'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-提交作业
xy_assignmentSubmitObj(data = {}) {
let url = '/xy/assignment/submitObj'
return http.get(url, data).then(res => {
return res;
})
},

9
pages.json

@ -36,6 +36,15 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/student/my/my_coach",
"style": {
"navigationBarTitleText": "我的教练",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/student/login/forgot",

193
pages/student/index/index.vue

@ -76,37 +76,48 @@
<view class="after-class-con" v-for="(v,k) in jobAssignmentsInfo" :key="k" @click="openViewWorkDetails(v)">
<view class="after-class-con-txt">
<view style="width: 25%;margin-top: 5%;">
<view style="font-size: 55rpx;color: #fff;"><span style="color: #29d3b4;">12</span>/23
</view>
<view style="font-size: 35rpx;color: #ccc;padding-left: 10rpx;">已完成</view>
</view>
<view style="width: 70%;">
<!-- <view style="width: 25%;margin-top: 5%;">-->
<!-- <view style="font-size: 55rpx;color: #fff;"><span style="color: #29d3b4;">12</span>/23-->
<!-- </view>-->
<!-- <view style="font-size: 35rpx;color: #ccc;padding-left: 10rpx;">已完成</view>-->
<!-- </view>-->
<view style="width: 100%;">
<view style="color: #fff;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;align-items: center;">
<image :src="$util.img(v.coach_pic)" style="width: 50rpx;height: 50rpx;">
<image :src="v.student.customerResources.member.headimg ? v.student.customerResources.member.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')" style="width: 50rpx;height: 50rpx;">
</image>
<span style="padding-left: 10rpx;font-size: 35rpx;">{{v.coach_name}}</span>
<span style="padding-left: 10rpx;font-size: 35rpx;">{{v.student.name}}</span>
</view>
<view>
<fui-button background="#404045" color="#F59A23" borderColor="#F59A23"
btnSize="mini" @click="submitJob(v)">上传</fui-button>
</view>
</view>
<view style="color: #fff;padding: 10rpx;">时间{{v.create_time}}</view>
<view class="multi-line-ellipsis" v-html="v.content_text">
<view style="color: #fff;padding: 10rpx;">时间{{$util.formatToDateTime(v.created_at, "Y-m-d H:i")}}</view>
<view style="color: #fff;padding: 10rpx;">类型{{v.content_type == 1 ? '图片' : (v.content_type == 2 ? '视频':'文本')}}</view>
<view class="description">
{{v.description}}
</view>
</view>
</view>
</view>
<!-- 已提交的作业列表-->
<view class="item" v-for="(v,k) in assignmentsList" :key="k" @click="openViewWorkDetails(v)">
<view class="multi-line-ellipsis text-style" v-html="v.content_text"></view>
<view style="width: 92%;margin: auto;border-radius: 15rpx;" v-if="v.student_file">
<video v-if="v.student_file_type == 2" style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)"></video>
<image v-else style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)" mode="aspectFit"></image>
</view>
<view class="box">
<view class="description">
描述:{{v.description}}
</view>
<view class="content_box" v-if="v.content_text">
<video class="video" v-if="v.content_type == 2" :src="v.content_text"></video>
<image class="image" v-else-if="v.content_type == 1" :src="v.content_text" mode="aspectFit"></image>
<view class="text" v-else-if="v.content_type == 3" >作业内容{{ v.content_text }}</view>
</view>
</view>
</view>
<!-- <view class="multi-line-ellipsis text-style">-->
@ -138,32 +149,14 @@
//
uploadApiUrl: ``,
uploadImageApiUrl: `${Api_url}/file/image`,
uploadVideoApiUrl: `${Api_url}/file/video`,
uploadImageApiUrl: `${Api_url}/memberUploadImage`,//
uploadVideoApiUrl: `${Api_url}/memberUploadVideo`,//
member_info: {},//
assignmentsList: [],//
jobAssignmentsInfo: [],//
memberIndexData:{
tx:{//
height: '', //
weight: '', //
score: '', //
create_time: '' //
},
kcyg: { //
id: '', // ID
date_time: "", //
time_slot: "", //
address: "", //
courses_name: "", //
date_md: "", // /
weekday: "" //
}
},//
path_arr:{
'1':'/pages/coach/home/index',//
'2':'/pages/market/index/index',//
@ -194,7 +187,6 @@
await this.member_init()
await this.getPhysicalTestList()
await this.getPersonCourseScheduleList()
this.getMemberIndex()
this.getList()
this.getJobAssignmentsInfo()
},
@ -248,64 +240,15 @@
}
},
async openViewHome_COPY(){
//
let pages = getCurrentPages();
//
this.thisPath = '/' + pages[0].route
//
let userType = String(uni.getStorageSync('userType'))
this.openPath = this.path_arr[userType]
console.log(
'跳转',
this.thisPath,
userType,
this.path_arr[userType]
)
if(this.thisPath != this.openPath){
console.log('打印1')
//tabBar-
uni.setStorageSync('tabBerIndex', 0)
uni.navigateTo({
url: this.openPath
})
return
}else{
//->
this.init()
}
},
async getMemberIndex(){
let res = await memberApi.memberIndex({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
// console.log('',res)
if(res.data.kcyg.time_slot){
res.data.kcyg.time_slot = res.data.kcyg.time_slot.split(',');
}
this.memberIndexData = res.data
},
//
async getList(){
let data = {
page: 1,
limit: 10,
status: '2',//1=,2=,3=
resources_id: this.member_info.id,
status: '3',//1 2 3
}
let res = await memberApi.assignmentsList(data)
let res = await apiRoute.xy_assignment(data)
if(res.code != 1){
uni.showToast({
title: res.msg,
@ -322,9 +265,10 @@
let data = {
page: 1,
limit: 1,
status: '1',//1=,2=,3=
resources_id: this.member_info.id,
status: '2',// 1 2 3
}
let res = await memberApi.assignmentsList(data)
let res = await apiRoute.xy_assignment(data)
if(res.code != 1){
uni.showToast({
title: res.msg,
@ -373,15 +317,15 @@
//
async submitJob(item) {
let type = item.content_type // 12
let type = item.content_type // 123
try {
//
let uploadRes = await this.uploadFile(type)
// console.log('', uploadRes)
console.log('上传结果', uploadRes)
//
if (!uploadRes.data.path) {
if (!uploadRes.data.url) {
return
}
@ -389,22 +333,28 @@
let data = {
id: item.id, // id
student_file: uploadRes.data.path, //
student_file_type: type, // 12
student_content: '', //
resources_id:this.member_info.id, // id
content_text:uploadRes.data.url
}
//
await this.assignmentsSubmit(data)
} catch (error) {
console.error('上传或提交作业失败:', error)
alert('上传或提交作业失败')
//alert('')
//
uni.showToast({
title: '上传或提交作业失败',
icon: 'none'
})
}
},
// (/) type=12
// (/) type=123
async uploadFile(type) {
return new Promise((resolve, reject) => {
if (type == 1) {
//
this.uploadApiUrl = this.uploadImageApiUrl
uni.chooseImage({
count: 1,
@ -424,7 +374,8 @@
reject(error)
}
})
} else {
} else if(type == 2){
//
this.uploadApiUrl = this.uploadVideoApiUrl
uni.chooseVideo({
count: 1,
@ -493,12 +444,11 @@
//
async assignmentsSubmit(item) {
let data = {
id: item.id, // id
student_file: item.student_file, //
student_file_type: item.student_file_type, // 12
student_content: item.student_content, //
resources_id:item.resources_id, // id
id:item.id,
content_text:item.content_text
}
let res = await memberApi.assignmentsSubmit(data)
let res = await apiRoute.xy_assignmentSubmitObj(data)
if (res.code != 1) {
uni.showToast({
title: res.msg,
@ -569,6 +519,7 @@
}
.multi-line-ellipsis {
width: 100%;
color: #fff;
padding: 5rpx 10rpx;
display: -webkit-box;
@ -779,7 +730,7 @@
.after-class-con {
width: 92%;
height: 246rpx;
//height: 246rpx;
background-color: #404045;
border-radius: 20rpx;
margin: 15rpx auto;
@ -791,9 +742,11 @@
display: flex;
justify-content: space-between;
padding: 20rpx;
height: 95%;
width: 100%;
align-content: space-around;
.description{
color: #fff;
}
}
.pic {
@ -801,4 +754,32 @@
height: 144rpx;
border-radius: 50%;
}
.item{
padding: 40rpx;
.box{
color: #fff;
display: flex;
flex-direction: column;
.description{
}
.content_box{
width: 100%;
margin: auto;
margin-top: 20rpx;
border-radius: 15rpx;
.video{
width: 100%;
border-radius: 15rpx;
}
.image{
width: 100%;
border-radius: 15rpx;
}
.text{
color: #fff;
}
}
}
}
</style>

45
pages/student/index/job_list.vue

@ -13,24 +13,25 @@
>
<view class="con-list" v-for="(v,k) in tableList" :key="k" @click="openViewWorkDetails(v)">
<view class="con-list-img" v-if="v.student_file">
<video v-if="v.student_file_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)"></video>
<image v-else style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)" mode="aspectFit"></image>
<view class="con-list-img" v-if="v.content_text">
<video v-if="v.content_type == 2" class="pic" style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.content_text)"></video>
<image v-else-if="v.content_type == 1" style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.content_text)" mode="aspectFit"></image>
<view class="text" v-else>{{v.content_text}}</view>
</view>
<view class="date_box">
<view class="describe" style="margin-top: 20rpx;">
时间{{v.create_time}}
时间{{v.created_at}}
</view>
<!--是否已经完成作业-->
<view class="mark" v-if="v.status == 2">
<view class="mark" v-if="v.status == 3">
<image class="check_mark" :src="$util.img('/uniapp_src/static/images/index/check_mark.png')"></image>
</view>
</view>
<!--作业描述-->
<view class="con" style="margin-bottom: 20rpx; color:#fff;" v-html="v.content_text"></view>
<view class="con" style="margin-bottom: 20rpx; color:#fff;" v-html="v.description"></view>
<view class="assignment">
<view>{{v.type == 1 ? '班级作业' : '个人作业'}}</view>
@ -44,6 +45,7 @@
</template>
<script>
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js';
export default {
@ -58,11 +60,14 @@ import memberApi from '@/api/member.js';
page:1,//
limit:10,//
total:10,//
status: '',//1=,2=,3=
resources_id: '',//id
status: '',// 1 2 3
},
tableList:[],//
member_info:{},//
}
},
onShow(){
@ -77,9 +82,25 @@ import memberApi from '@/api/member.js';
methods: {
//
async init(){
await this.memberInit()
await this.getList();
},
//
async memberInit() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.member_info = res.data
this.filteredData.resources_id = this.member_info.id,//id
console.log('xxxx',this.member_info)
},
//()
loadMoreData() {
//
@ -117,7 +138,7 @@ import memberApi from '@/api/member.js';
this.tableList = []
}
let res = await memberApi.assignmentsList(data)
let res = await apiRoute.xy_assignment(data)
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
@ -192,7 +213,6 @@ import memberApi from '@/api/member.js';
}
.con-list-img{
width: 100%;
height: 280rpx;
display: flex;
align-items: center;
justify-content: center;
@ -205,6 +225,13 @@ import memberApi from '@/api/member.js';
width: 100%;
height: 280rpx;
}
.text{
width: 100%;
font-size: 28rpx;
color:#fff;
white-space: pre-wrap;
word-wrap: break-word;
}
}
.pic{

4
pages/student/login/login.vue

@ -277,8 +277,8 @@ export default {
this.password1= '123123' //
}else{
//
this.user= '15335526445' //
this.password1= '123123' //
this.user= '13042409890' //
this.password1= '13042409890' //
}
},

47
pages/student/my/lesson_consumption.vue

@ -2,27 +2,23 @@
<template>
<view class="assemble">
<view style="height: 50rpx;"></view>
<view class="ul">
<view class="message_box" v-if="!tableList.length">
暂无更多数据
</view>
<view class="ul" v-if="tableList.length">
<view class="li" v-for="(v,k) in tableList" :key="k">
<view class="left">
<view class="title">{{v.name}}</view>
<view class="date">上课时间{{v.create_time}}</view>
<view class="date">课程使用日期{{v.usage_date}}</view>
</view>
<view class="right">
<view
v-if="v.status == 1"
class="btn"
style="background-color: #29d3b4;"
>
{{v.hour}}课时
</view>
<view
v-if="v.status == 2"
class="btn"
style="background-color: #FAD04D;"
>
请假
{{v.usage_date}}课时
</view>
</view>
</view>
@ -31,7 +27,7 @@
</template>
<script>
import memberApi from '@/api/member.js';
import apiRoute from '@/api/apiRoute.js';
export default {
data() {
@ -45,9 +41,12 @@ import memberApi from '@/api/member.js';
page:1,//
limit:10,//
total:10,//
resources_id:'',//id
},
tableList:[],//
memberInfo:{},//
}
},
onLoad(options) {
@ -65,9 +64,24 @@ import memberApi from '@/api/member.js';
methods: {
//
async init(){
await this.getMemberInfo()//
await this.getList()//
},
//
async getMemberInfo() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.memberInfo = res.data
this.filteredData.resources_id = res.data.id
},
//()
loadMoreData() {
//
@ -105,7 +119,7 @@ import memberApi from '@/api/member.js';
this.tableList = []
}
let res = await memberApi.studentsSignList(data)
let res = await apiRoute.xy_personCourseScheduleGetStudentCourseUsageList(data)
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
@ -128,6 +142,11 @@ import memberApi from '@/api/member.js';
</script>
<style lang="less" scoped>
.message_box{
font-size: 30rpx;
text-align: center;
color: #fff;
}
.assemble {
width: 100%;
height: 100vh;

9
pages/student/my/my.vue

@ -64,7 +64,7 @@
<view class="section_box">
<view class="item">
<view>我的教练</view>
<view @click="openViewMyCoach()">我的教练</view>
<view></view>
</view>
<!-- <view class="item">-->
@ -160,6 +160,13 @@
url: `/pages/common/my_message`
})
},
//-
openViewMyCoach(){
uni.navigateTo({
url: `/pages/student/my/my_coach`
})
},
}
}
</script>

211
pages/student/my/my_coach.vue

@ -0,0 +1,211 @@
<!--我的教练-列表-->
<template>
<view class="main_box">
<scroll-view scroll-y="true" :lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData" style="height: 100%;padding-top:50rpx;padding-bottom: 50rpx">
<!-- <view class="data_hint" v-if="!this.tableList.length">暂无更多数据</view>-->
<view class="main_section" v-for="(v,k) in tableList" :key="k">
<view class="left">
<!-- 头像-->
<image :src="v.head_img ? v.head_img : $util.img('/uniapp_src/static/images/common/yong_hu.png')" class="pic"></image>
</view>
<view class="right">
<view class="title">姓名{{v.name}}</view>
<view class="title">电话{{v.phone}}</view>
</view>
</view>
</scroll-view>
<!-- 加载状态-->
<!-- <fui-loading :isFixed="true" srcCol="/static/icon-img/loading_white.png" text="正在加载..." v-if="loading"></fui-loading>-->
</view>
</template>
<script>
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue"
export default {
components: {
AQTabber,
},
data() {
return {
loading:false,//
lowerThreshold: 100,//
isReachedBottom: false,//|true=|false=
memberInfo:{id:''},//
//
filteredData:{
page:1,//
limit:10,//
total:10,//
resources_id:'',//id
},
tableList:[],//
}
},
onLoad(options) {},
onShow() {
this.init()//
},
//
async onPullDownRefresh() {
//
await this.resetFilteredData()
await this.getList()
},
methods: {
//
async init() {
await this.getMemberInfo();
await this.getList();
},
//
async resetFilteredData() {
this.isReachedBottom = false; // 便
this.filteredData.page = 1//
this.filteredData.limit = 10//
this.filteredData.total = 10//
},
//
async getMemberInfo() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.memberInfo = res.data
this.filteredData.resources_id = res.data.id
},
//()
loadMoreData() {
return //
//
if (!this.isReachedBottom) {
this.isReachedBottom = true;//
this.getList();
}
},
//
loadData() {
setTimeout(() => {
this.isReachedBottom = false; // 便
}, 1000);
},
//
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.xy_personCourseScheduleGetMyCoach(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++
},
}
}
</script>
<style lang="less" scoped>
.main_box {
width: 100%;
height: 100%;
overflow: auto;
background: #292929;
}
.data_hint{
margin-top: 100rpx;
font-size: 30rpx;
text-align: center;
color: #fff;
}
.main_section{
width: 92%;
border-radius: 15rpx;
background-color: #404045;
margin: 20rpx auto;
padding: 30rpx;
color: #fff;
display: flex;
align-items: center;
.left{
display: flex;
flex-direction: column;
align-items: center;
.pic{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
}
.right{
margin-left: 20rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
.title{
font-size: 32rpx;
}
.con{
color: #D7D7D7;
font-size: 26rpx;
margin-top: 20rpx;
}
.current-venue{
border-radius: 8rpx;
border: 2rpx #F59A23 solid;
width: 120rpx;
text-align: center;
color: #F59A23;
position: absolute;
top: 10%;
right: 3%;
}
</style>
Loading…
Cancel
Save