李双庆 1 year ago
parent
commit
f3396b01ac
  1. 62
      api/apiRoute.js
  2. 1
      components/AQ/AQUplodeImage.vue
  3. 12
      components/AQ/AQUplodeImgMulti.vue
  4. 2
      pages/coach/student/physical_examination.vue
  5. 67
      pages/common/feedback.vue
  6. 41
      pages/common/im_chat_info.vue
  7. 29
      pages/common/my_message.vue
  8. 48
      pages/student/index/index.vue
  9. 253
      pages/student/index/physical_examination.vue
  10. 23
      pages/student/my/my.vue
  11. 293
      pages/student/my/personal_data.vue

62
api/apiRoute.js

@ -438,6 +438,68 @@ export default {
return res; return res;
}) })
}, },
//学生详情-修改
xy_memberEdit(data = {}) {
let url = '/customerResourcesAuth/edit'
return http.post(url, data).then(res => {
return res;
})
},
//学生-意见反馈-添加
xy_userFeedbackAdd(data = {}) {
let url = '/userFeedback/add'
return http.post(url, data).then(res => {
return res;
})
},
//学生端-获取好友关系绑定详情
xy_chatGetChatFriendsInfo(data = {}) {
let url = '/xy/chat/getChatFriendsInfo'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-获取聊天消息列表
xy_chatGetChatMessagesList(data = {}) {
let url = '/xy/chat/getChatMessagesList'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-发送聊天消息
xy_chatSendChatMessages(data = {}) {
let url = '/xy/chat/sendChatMessages'
return http.post(url, data).then(res => {
return res;
})
},
//学生端-好友关系列表
xy_chatGetChatFriendsList(data = {}) {
let url = '/xy/chat/getChatFriendsList'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-体测报告-列表
xy_physicalTest(data = {}) {
let url = '/xy/physicalTest'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-体测报告-详情
xy_physicalTestInfo(data = {}) {
let url = '/xy/physicalTest/info'
return http.get(url, data).then(res => {
return res;
})
},

1
components/AQ/AQUplodeImage.vue

@ -1,3 +1,4 @@
<!--单图自定义按钮上传-->
<template> <template>
<view @click="chooseImage"> <view @click="chooseImage">
<slot></slot> <slot></slot>

12
components/AQ/AQUplodeImgMulti.vue

@ -27,6 +27,11 @@ import {Api_url} from "../../common/config";
}, },
props: { props: {
//父组件参数 //父组件参数
//上传文件接口的url
uploadApiUrl:{
type: String,
default: `${Api_url}/file/image`
},
//表单名称 //表单名称
inputName: { inputName: {
type: String, type: String,
@ -48,7 +53,8 @@ import {Api_url} from "../../common/config";
return { return {
inputName: this.inputName, inputName: this.inputName,
inputValue: this.inputValue, inputValue: this.inputValue,
maxFileNum: this.maxFileNum maxFileNum: this.maxFileNum,
uploadApiUrl: this.uploadApiUrl
}; };
} }
}, },
@ -99,7 +105,7 @@ import {Api_url} from "../../common/config";
}, },
//上传接口地址 //上传接口地址
uploadApiUrl: `${Api_url}/file/image`, // uploadApiUrl: `${Api_url}/file/image`,
// 上传图片的样式 // 上传图片的样式
imageStyles: { imageStyles: {
@ -168,7 +174,7 @@ import {Api_url} from "../../common/config";
console.log('xxx',_arr) console.log('xxx',_arr)
this.fileList.push(_arr) this.fileList.push(_arr)
console.log('上传成功2',_arr); console.log('上传成功2',_arr);
this.filePathArr.push(res.data.path) this.filePathArr.push(res.data.url)
//上传成功 //上传成功
this.emitUploadSuccess(this.filePathArr) this.emitUploadSuccess(this.filePathArr)
}else{ }else{

2
pages/coach/student/physical_examination.vue

@ -1,4 +1,4 @@
<!--体测数据--> <!--体测数据-详情页-->
<template> <template>
<view class="overall"> <view class="overall">
<view class="date">{{$util.formatToDateTime(surveyInfo.create_time,'Y-m-d')}}</view> <view class="date">{{$util.formatToDateTime(surveyInfo.create_time,'Y-m-d')}}</view>

67
pages/common/feedback.vue

@ -5,28 +5,28 @@
<view class="main_section"> <view class="main_section">
<view class="section"> <view class="section">
<view class="text_input"> <view class="text_input">
<fui-textarea placeholder="请输入反馈内容" v-model="formData.content"></fui-textarea> <fui-textarea placeholder="请输入反馈内容" v-model="formData.feedback_text"></fui-textarea>
</view> </view>
</view> </view>
<view class="section"> <view class="section">
<view class="upload_box"> <view class="upload_box">
<view>上传图片</view> <view>上传图片</view>
<AQUplodeImgMulti :inputName="`images_arr`" :inputValue="formData.images_arr || []" <AQUplodeImgMulti :inputName="`attachment_url_arr`" :inputValue="formData.attachment_url_arr || []" :uploadApiUrl="uploadApiUrl" :maxFileNum="1"
@AQUploadSuccess="AQUploadSuccess" /> @AQUploadSuccess="AQUploadSuccess" />
</view> </view>
</view> </view>
<view class="section"> <!-- <view class="section">-->
<view class="input_box"> <!-- <view class="input_box">-->
<fui-input label="邮箱方式" borderTop placeholder="请输入邮箱" v-model="formData.mailbox"></fui-input> <!-- <fui-input label="邮箱方式" borderTop placeholder="请输入邮箱" v-model="formData.mailbox"></fui-input>-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<view class="describe"> <!-- <view class="describe">-->
反馈的相关问题会第一时间通过邮箱解答。 <!-- 反馈的相关问题会第一时间通过邮箱解答。-->
</view> <!-- </view>-->
<view class="btn" @click="submitForm()">提交</view> <view class="btn" @click="submitForm()">提交</view>
</view> </view>
@ -34,9 +34,13 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti'; import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti';
import AQTabber from "@/components/AQ/AQTabber" import AQTabber from "@/components/AQ/AQTabber"
import {
Api_url
} from "@/common/config.js";
export default { export default {
@ -46,16 +50,40 @@
}, },
data() { data() {
return { return {
uploadApiUrl:`${Api_url}/memberUploadImage`,//上传文件接口的url
formData: { formData: {
images_arr: [], attachment_url_arr: [],
images:'', attachment_url:undefined,//图片地址,多个使用,号拼接
content:'', feedback_text:'',//反馈内容
mailbox:'', user_id:'',//用户ID|school_customer_resources表id
}, },
} }
}, },
onLoad() {}, onLoad() {},
onShow(){
this.init()
},
methods: { methods: {
async init(){
//获取学生详情
await this.getMemberInfo()
},
//获取学员信息
async getMemberInfo() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.formData.user_id = res.data.id
console.log('xxxx',res.data)
},
//######AQ上传文件组件相关###### //######AQ上传文件组件相关######
// 上传文件回调 // 上传文件回调
AQUploadSuccess(res) { AQUploadSuccess(res) {
@ -67,13 +95,16 @@
} }
this.formData[res.inputName] = _inputValue this.formData[res.inputName] = _inputValue
// console.log('接收AQ上传回调xxx1',res) // console.log('接收AQ上传回调xxx1',res)
// console.log('接收AQ上传回调xxx2',this.formData.member_store_certification_arr) // console.log('接收AQ上传回调xxx2',this.formData[res.inputName])
}, },
async submitForm() { async submitForm() {
let data = {...this.formData} let data = {...this.formData}
data.images = data.images_arr.join(',') if(data.attachment_url_arr.length){
if(!data.content){ data.attachment_url = data.attachment_url_arr.join(',')
}
if(!data.feedback_text){
//反馈内容为必填项 //反馈内容为必填项
uni.showToast({ uni.showToast({
title:'反馈内容为必填项', title:'反馈内容为必填项',
@ -81,7 +112,7 @@
}) })
return return
} }
let res = await memberApi.setFeedback(data) let res = await apiRoute.xy_userFeedbackAdd(data)
if(res.code != 1){ if(res.code != 1){
uni.showToast({ uni.showToast({
title:res.msg, title:res.msg,

41
pages/common/im_chat_info.vue

@ -102,7 +102,7 @@ export default {
}, },
data() { data() {
return { return {
uploadUrl: `${Api_url}/uploadImage`, uploadUrl: `${Api_url}/uploadImage`,//图片文件上传路径|默认为员工端上传文件
scrollTop:'',//滚动条位置,用于加载第一页后滚动到底部 scrollTop:'',//滚动条位置,用于加载第一页后滚动到底部
@ -182,6 +182,8 @@ export default {
this.formData.from_type = 'customer'//学生 this.formData.from_type = 'customer'//学生
this.formData.from_id = this.to_id//发送者的id(学生) this.formData.from_id = this.to_id//发送者的id(学生)
this.formData.to_id = this.from_id//接收者的id(员工) this.formData.to_id = this.from_id//接收者的id(员工)
this.uploadUrl = `${Api_url}/memberUploadImage`//图片文件上传路径|学生端端上传文件
} }
//获取好友关系详情 //获取好友关系详情
await this.getChatFriendsInfo() await this.getChatFriendsInfo()
@ -200,7 +202,17 @@ export default {
personnel_id: this.chatFriendsInfoParams.personnel_id,//员工资源ID personnel_id: this.chatFriendsInfoParams.personnel_id,//员工资源ID
customer_resources_id: this.chatFriendsInfoParams.customer_resources_id,//学生资源ID customer_resources_id: this.chatFriendsInfoParams.customer_resources_id,//学生资源ID
} }
let res = await apiRoute.xs_chatGetChatFriendsInfo(params)
let res
if( this.from_type == 'personnel'){
//员工
res = await apiRoute.xs_chatGetChatFriendsInfo(params)
}else{
//学生
res = await apiRoute.xy_chatGetChatFriendsInfo(params)
}
if (res.code != 1){ if (res.code != 1){
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -253,7 +265,17 @@ export default {
this.tableList = [] this.tableList = []
} }
let res = await apiRoute.xs_chatGetChatMessagesList(data)//获取消息列表
let res
if( this.from_type == 'personnel'){
//员工
res = await apiRoute.xs_chatGetChatMessagesList(data)//获取消息列表
}else{
//学生
res = await apiRoute.xy_chatGetChatMessagesList(data)//获取消息列表
}
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){
@ -327,7 +349,16 @@ export default {
}) })
return return
} }
let res = await apiRoute.xs_chatSendChatMessages(data)
let res
if( this.from_type == 'personnel'){
//员工
res = await apiRoute.xs_chatSendChatMessages(data)
}else{
//学生
res = await apiRoute.xy_chatSendChatMessages(data)
}
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -370,7 +401,7 @@ export default {
this.moreShow = false this.moreShow = false
}, },
//但文件上传回调 //文件上传回调
uplodeImageRes(resData,extraData){ uplodeImageRes(resData,extraData){
console.log('上传成功回调',resData,extraData) console.log('上传成功回调',resData,extraData)
//判断是不是上传相册图片 //判断是不是上传相册图片

29
pages/common/my_message.vue

@ -103,11 +103,12 @@ export default {
}else{ }else{
//获取学生用户详情 //获取学生用户详情
this.from_type = 'customer'//学生 this.from_type = 'customer'//学生
await this.getMemberInit()
} }
this.getContactList() this.getContactList()
}, },
//获取用户详情 //获取员工用户详情
async getPersonnelUserInfo(){ async getPersonnelUserInfo(){
let data = {} let data = {}
let res = await apiRoute.getPersonnelInfo(data); let res = await apiRoute.getPersonnelInfo(data);
@ -130,6 +131,20 @@ export default {
this.filteredData.personnel_id = res.data.id this.filteredData.personnel_id = res.data.id
}, },
//获取学员用户信息
async getMemberInit() {
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.customer_resources_id = res.data.id//学生资源的id
},
//获取联系人列表 //获取联系人列表
async getContactList(){ async getContactList(){
let params = {...this.filteredData} let params = {...this.filteredData}
@ -147,7 +162,17 @@ export default {
this.contactList = [] this.contactList = []
} }
let res = await apiRoute.xs_chatGetChatFriendsList(params) let res
//1=教练,2=销售,3=学员
if (['1', '2'].includes(String(this.userType))) {
//员工
res = await apiRoute.xs_chatGetChatFriendsList(params)
}else{
//学生
res = await apiRoute.xy_chatGetChatFriendsList(params)
}
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;

48
pages/student/index/index.vue

@ -29,24 +29,24 @@
<view class="card-con-txt1"> <view class="card-con-txt1">
<view class="card-con-txt1-left"> <view class="card-con-txt1-left">
<image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image> <image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image>
<view class="card-con-txt1-left-txt top">{{memberIndexData.tx.score}}</view> <view class="card-con-txt1-left-txt top">{{physicalTestInfo.calculateChildHealthScore}}</view>
<view class="card-con-txt1-left-txt top1">综合评分</view> <view class="card-con-txt1-left-txt top1">综合评分</view>
</view> </view>
<view class="card-con-txt1-right"> <view class="card-con-txt1-right">
<view style="color: #AAAAAA;padding: 5rpx;">数据测评时间:{{$util.formatToDateTime(memberIndexData.tx.create_time,'Y-m-d')}}</view> <view style="color: #AAAAAA;padding: 5rpx;">数据测评时间:{{$util.formatToDateTime(physicalTestInfo.created_at,'Y-m-d')}}</view>
<view style="display: flex;justify-content: space-around;margin-top: 20rpx;"> <view style="display: flex;justify-content: space-around;margin-top: 20rpx;">
<view> <view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.height * 100}}</view> <view style="font-size: 48rpx;color: #29d3b4;">{{physicalTestInfo.height}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">身高(CM)</view> <view style="color: #AAAAAA;font-size: 30rpx;">身高(CM)</view>
</view> </view>
<view> <view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.weight}}</view> <view style="font-size: 48rpx;color: #29d3b4;">{{physicalTestInfo.weight}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">体重(KG)</view> <view style="color: #AAAAAA;font-size: 30rpx;">体重(KG)</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="more" @click="physical_examination(memberIndexData)">更多</view> <view class="more" @click="physical_examination()">更多</view>
</view> </view>
<view class="upcomin-classes"> <view class="upcomin-classes">
@ -170,6 +170,13 @@
}, },
thisPath:'',//当前页面的路径(默认'') thisPath:'',//当前页面的路径(默认'')
openPath:'',//正确的跳转路径(默认'') openPath:'',//正确的跳转路径(默认'')
physicalTestInfo:{
created_at:'',//测评时间
calculateChildHealthScore:'0',//综合评分
height:'0',//身高
weight:'0',//体重
},//体测报告详情
} }
}, },
onLoad() { onLoad() {
@ -186,11 +193,36 @@
//学生页面初始化 //学生页面初始化
async init(){ async init(){
await this.member_init() await this.member_init()
await this.getPhysicalTestList()
this.getMemberIndex() this.getMemberIndex()
this.getList() this.getList()
this.getJobAssignmentsInfo() this.getJobAssignmentsInfo()
}, },
//获取体测列表
async getPhysicalTestList(){
let params = {
page: 1,//当前页码
limit: 1,//每页返回数据条数
total: 1,//数据总条数
resource_id:this.member_info.id,//学生资源表id
}
let res = await apiRoute.xy_physicalTest(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
}
console.log('tc',res.data)
let arr = res.data.data
if(arr.length){
this.physicalTestInfo = arr[0]
}
},
async openViewHome_COPY(){ async openViewHome_COPY(){
@ -301,10 +333,10 @@
}) })
}, },
//跳转体测列表 //跳转体测列表
physical_examination(e){ physical_examination(){
let students_id = e.students_id let resource_id = this.member_info.id
uni.navigateTo({ uni.navigateTo({
url: `/pages/student/index/physical_examination?students_id=${students_id}` url: `/pages/student/index/physical_examination?resource_id=${resource_id}`
}) })
}, },
//跳转作业列表页 //跳转作业列表页

253
pages/student/index/physical_examination.vue

@ -1,4 +1,4 @@
<!--体测数据-详情--> <!--体测数据-列表详情-->
<template> <template>
<view class="overall"> <view class="overall">
@ -11,33 +11,85 @@
> >
<view class="item" v-for="(v,k) in tableList" :key="k"> <view class="item" v-for="(v,k) in tableList" :key="k">
<view class="date">{{$util.formatToDateTime(v.create_time, 'Y-m-d')}}</view> <view class="date">{{$util.formatToDateTime(v.created_at, 'Y-m-d')}}</view>
<view class="content"> <view class="content">
<view class="circle-container"> <view class="circle-container">
<view class="card-con-txt1-left"> <view class="card-con-txt1-left">
<image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image> <image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image>
</view> </view>
<view class="card-con-txt1-left-txt">{{v.score}}</view> <view class="card-con-txt1-left-txt">{{v.calculateChildHealthScore}}</view>
<view class="card-con-txt1-left-txt top1">综合评分</view> <view class="card-con-txt1-left-txt top1">综合评分</view>
</view> </view>
<view style="height: 170rpx;"></view> <view style="height: 170rpx;"></view>
<view style="display: flex;justify-content: space-around;"> <view style="display: flex;justify-content: space-around;">
<view style="text-align: center;"> <view style="text-align: center;">
<view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">身高 (CM)</view> <view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">身高 (CM)</view>
<view style="font-size: 55rpx;color: #29d3b4;">{{(v.height * 100)}}</view> <view style="font-size: 55rpx;color: #29d3b4;">{{(v.height)}}</view>
</view> </view>
<view style="text-align: center;"> <view style="text-align: center;">
<view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">体重 (KG)</view> <view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">体重 (KG)</view>
<view style="font-size: 55rpx;color: #29d3b4;">{{v.weight}}</view> <view style="font-size: 55rpx;color: #29d3b4;">{{v.weight}}</view>
</view> </view>
</view> </view>
<view class="coach-message"> <!-- <view class="coach-message">-->
<view> <!-- <view>-->
<image :src="$util.img('/uniapp_src/static/images/index/lv.png')" class="drop-image"></image> <!-- <image :src="$util.img('/uniapp_src/static/images/index/lv.png')" class="drop-image"></image>-->
<!-- </view>-->
<!-- <view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">{{v.content}}</view>-->
<!-- </view>-->
<view class="list_box" >
<view class="ul">
<view class="li">
<view class="li_title">坐位体前屈</view>
<view class="li_content">测试结果:{{v.seated_forward_bend}}</view>
</view>
<view class="li">
<view class="li_title">仰卧卷腹</view>
<view class="li_content">测试结果:{{v.sit_ups}}</view>
</view>
<view class="li">
<view class="li_title">九十度仰卧撑</view>
<view class="li_content">测试结果:{{v.push_ups}}</view>
</view>
<view class="li">
<view class="li_title">火烈鸟平衡测试</view>
<view class="li_content">测试结果:{{v.flamingo_balance}}</view>
</view>
<view class="li">
<view class="li_title">三十秒双脚连续跳</view>
<view class="li_content">测试结果:{{v.thirty_sec_jump}}</view>
</view>
<view class="li">
<view class="li_title">立定跳远</view>
<view class="li_content">测试结果:{{v.standing_long_jump}}</view>
</view>
<view class="li">
<view class="li_title">4乘10m灵敏折返跑</view>
<view class="li_content">测试结果:{{v.agility_run}}</view>
</view>
<view class="li">
<view class="li_title">走平衡木</view>
<view class="li_content">测试结果:{{v.balance_beam}}</view>
</view>
<view class="li">
<view class="li_title">网球掷远</view>
<view class="li_content">测试结果:{{v.tennis_throw}}</view>
</view>
<view class="li">
<view class="li_title">十米往返跑</view>
<view class="li_content">测试结果:{{v.ten_meter_shuttle_run}}</view>
</view>
</view> </view>
<view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">{{v.content}}</view>
</view> </view>
<view style="font-size: 45rpx;text-align: center;margin-top: 30%;">详细数据信息</view>
</view> </view>
</view> </view>
@ -46,95 +98,95 @@
</template> </template>
<script> <script>
import memberApi from '@/api/member.js'; import apiRoute from '@/api/apiRoute.js';
export default {
data() {
return {
loading:false,//加载状态
lowerThreshold: 100,//距离底部多远触发
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载
//筛选条件
filteredData:{
page:1,//当前页码
limit:10,//每页返回数据条数
total:10,//数据总条数
students_id: '',//学员id
},
tableList:[],//表格数据
}
},
onLoad(options) {
this.filteredData.students_id = options.students_id//学员id
},
onShow(){
this.init()
},
methods: {
//初始化
async init(){
this.getList()
},
//加载更多(下一页) export default {
loadMoreData() { data() {
//判断是否加载 return {
if (!this.isReachedBottom) { loading: false,//加载状态
this.isReachedBottom = true;//设置为不可请求状态 lowerThreshold: 100,//距离底部多远触发
this.getList(); isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载
}
},
//重置为第一页
async resetFilteredData() {
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多
this.filteredData.page = 1//当前页码 //筛选条件
this.filteredData.limit = 10//每页返回数据条数 filteredData: {
this.filteredData.total = 10//数据总条数 page: 1,//当前页码
limit: 10,//每页返回数据条数
total: 10,//数据总条数
resource_id: '',//学员资源id
}, },
//获取-学员-体测列表 tableList: [],//表格数据
async getList(){ }
this.loading = true },
onLoad(options) {
this.filteredData.resource_id = options.resource_id//学员资源id
},
onShow() {
this.init()
},
methods: {
//初始化
async init() {
this.getList()
},
let data = {...this.filteredData} //加载更多(下一页)
loadMoreData() {
//判断是否加载
if (!this.isReachedBottom) {
this.isReachedBottom = true;//设置为不可请求状态
this.getList();
}
},
//重置为第一页
async resetFilteredData() {
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多
//判断是否还有数据 this.filteredData.page = 1//当前页码
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { this.filteredData.limit = 10//每页返回数据条数
this.loading = false this.filteredData.total = 10//数据总条数
uni.showToast({ },
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){ //获取-学员-体测列表
this.tableList = [] async getList() {
} this.loading = true
let data = {...this.filteredData}
//学员-体测列表 //判断是否还有数据
let res = await memberApi.surveyList(data) if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
this.loading = false this.loading = false
this.isReachedBottom = false; uni.showToast({
if (res.code != 1){ title: '暂无更多',
uni.showToast({ icon: 'none'
title: res.msg, })
icon: 'none' return
}) }
return
}
this.tableList = this.tableList.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 if (data.page == 1) {
this.tableList = []
}
// console.log('列表',this.tableList) //学员-体测列表
this.filteredData.total = res.data.list.total let res = await apiRoute.xy_physicalTest(data)
this.filteredData.page++ 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> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -150,6 +202,33 @@ import memberApi from '@/api/member.js';
flex-direction: column; flex-direction: column;
.item{ .item{
margin-bottom: 40rpx; margin-bottom: 40rpx;
.content{
.list_box{
font-size: 30rpx;
text-align: center;
margin-top: 120rpx;
.ul{
padding: 0 20rpx;
display: flex;
flex-wrap: wrap; /* 允许换行 */
justify-content: space-between;
align-items: center;
gap: 20rpx;
.li{
width: 48%; /* 每个列表项占宽度的48%,留出一些间距 */
display: flex;
flex-direction: column;
gap: 5rpx;
.li_title{
text-align: left;
}
.li_content{
text-align: left;
}
}
}
}
}
} }
} }

23
pages/student/my/my.vue

@ -9,7 +9,7 @@
<view class="user_section"> <view class="user_section">
<view class="box"> <view class="box">
<view class="left" @click="personal_data"> <view class="left" @click="personal_data">
<image class="pic" :src="$util.img(member_info.headimg)"></image> <image class="pic" :src="member_info.memberHasOne ? member_info.memberHasOne.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')"></image>
<view class="name">{{member_info.name}}</view> <view class="name">{{member_info.name}}</view>
</view> </view>
<view class="right" @click="setup"> <view class="right" @click="setup">
@ -57,7 +57,7 @@
<!-- </view>--> <!-- </view>-->
<view class="item" @click="openViewContractList()"> <view class="item" @click="openViewContractList()">
<view>我的合同</view> <view>我的订单</view>
<view></view> <view></view>
</view> </view>
</view> </view>
@ -89,6 +89,7 @@
<script> <script>
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
import member from '@/api/member.js'; import member from '@/api/member.js';
export default { export default {
components: { components: {
@ -104,14 +105,16 @@
}, },
methods: { methods: {
//获取学员信息 //获取学员信息
member_init() { async member_init() {
member.member().then(res => { let res = await apiRoute.xy_memberInfo({})
if(res.code == 1){ if(res.code != 1){
this.member_info = res.data uni.showToast({
}else{ title: res.msg,
this.member_info = [] icon: 'none'
} })
}) return
}
this.member_info = res.data
}, },
//打开设置 //打开设置
setup(item) { setup(item) {

293
pages/student/my/personal_data.vue

@ -5,11 +5,16 @@
<view class="main_section"> <view class="main_section">
<view class="section"> <view class="section">
<view class="item"> <view class="item">
<image @click="changeAvatar()" class="pic" :src="$util.img(formData.headimg)" <image @click="previewImage(editHeadimg)" class="pic" :src="editHeadimg"></image>
v-if="upload_type == 1"> <view class="btn">
<image @click="changeAvatar()" class="pic" :src="uploadHeadimg" v-else> <AQUplodeImage
</image> :uploadUrl=uploadUrl
<view class="btn" @click="changeAvatar()">修改头像</view> :extraData="{ input_name: 'headimg', formData:{} }"
@uplodeImageRes="uplodeImageRes"
>
修改头像
</AQUplodeImage>
</view>
</view> </view>
</view> </view>
@ -28,18 +33,18 @@
账号 <text class="required"></text> 账号 <text class="required"></text>
</view> </view>
<view class="input"> <view class="input">
<input disabled placeholder="暂无" v-model="formData.username" /> <input disabled placeholder="暂无" v-model="formData.memberHasOne.mobile" />
</view> </view>
</view> </view>
<view class="item"> <!-- <view class="item">-->
<view class="title"> <!-- <view class="title">-->
住址 <text class="required"></text> <!-- 住址 <text class="required"></text>-->
</view> <!-- </view>-->
<view class="input"> <!-- <view class="input">-->
<input placeholder="暂无" v-model="formData.address" /> <!-- <input placeholder="暂无" v-model="formData.address" />-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<view class="item"> <view class="item">
<view class="title"> <view class="title">
@ -57,40 +62,37 @@
性别 <text class="required">*</text> 性别 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input placeholder="请选择性别" v-model="sex_name" @click="picker_show_sex=true" /> <input placeholder="请选择性别" v-model="formData.gender_name" @click="picker_show_sex=true" />
<fui-picker layer="1" :linkage="true" :options="options_sex_arr" :show="picker_show_sex" <fui-picker layer="1" :linkage="true" :options="options_sex_arr" :show="picker_show_sex"
@change="changePickerSex" @cancel="picker_sex_show=false"></fui-picker> @change="changePickerSex" @cancel="cancelPickerSex"></fui-picker>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="title"> <view class="title">
生日 <text class="required">*</text> 年龄 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input placeholder="请选择生日" @click="picker_show_birthday=true" v-model="formData.birthday" /> <input type="number" v-model.number="formData.age" :min="3" :max="18" placeholder="请输入年龄" @input="handleAgeInput" /> </view>
<fui-date-picker :minDate="minDate" :maxDate="maxDate" :show="picker_show_birthday" type="3"
@change="changePickerBirthday" @cancel="picker_show_birthday=false"></fui-date-picker>
</view>
</view> </view>
</view> </view>
<view class="section"> <view class="section">
<view class="item"> <!-- <view class="item">-->
<view class="title"> <!-- <view class="title">-->
邮箱 <text class="required">*</text> <!-- 邮箱 <text class="required">*</text>-->
</view> <!-- </view>-->
<view class="input"> <!-- <view class="input">-->
<input v-model="formData.email" placeholder="请输入邮箱" /> <!-- <input v-model="formData.email" placeholder="请输入邮箱" />-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<view class="item"> <view class="item">
<view class="title"> <view class="title">
手机 <text class="required">*</text> 手机 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input v-model="formData.phone" placeholder="请输入手机" /> <input v-model="formData.phone_number" placeholder="请输入手机" />
</view> </view>
</view> </view>
</view> </view>
@ -102,45 +104,37 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import member from '@/api/member.js'; import member from '@/api/member.js';
import { import {
Api_url Api_url
} from "@/common/config.js"; } from "@/common/config.js";
import AQTabber from "@/components/AQ/AQTabber" import AQTabber from "@/components/AQ/AQTabber"
import AQUplodeImage from '@/components/AQ/AQUplodeImage';//单图上传组件
export default { export default {
components: { components: {
AQTabber, AQTabber,
AQUplodeImage,
}, },
data() { data() {
return { return {
member_info: [], member_info: {},
formData: {
images_arr: [],
name: '', //姓名
email: '', //邮箱
tel: '', //手机
wx: '', //微信
sex: '', //性别
birthday: '', //生日
},
//上传图片APi路径 //上传图片APi路径
uploadUrl: `${Api_url}/file/image`, uploadUrl: `${Api_url}/memberUploadImage`,
//性别选择器 相关 //性别选择器 相关
picker_show_sex: false, picker_show_sex: false,
sex_name: '请选择', sex_name: '请选择',
options_sex_arr: [{ options_sex_arr: [
value: 1, // {
text: '男' // value: 1,
}, // text: '男'
{ // },
value: 2, ],
text: '女'
},
],
//生日选择器相关 //生日选择器相关
minDate: '', minDate: '',
@ -149,79 +143,81 @@
upload_type: 1, upload_type: 1,
uploadHeadimg: '', uploadHeadimg: '',
editHeadimg: '', editHeadimg: '',
//表单
formData: {
headimg:'',//头像
name:'',//姓名
course_arr:[],//课程
gender:'',//性别: male-男性, female-女性, other-其他
gender_name:'',//性别: male-男性, female-女性, other-其他
age:'',//年龄
phone_number:'',//手机号
},
} }
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
this.init() this.init()
this.member_init()
}, },
methods: { methods: {
async init() { async init() {
await this.memberInfo()
await this.getSexDict()
this.getBirthday() this.getBirthday()
}, },
//获取学员信息 //获取学员信息
async member_init() { async memberInfo() {
const member_in = await member.member(); let res = await apiRoute.xy_memberInfo({})
if (member_in.code == 1) { if(res.code != 1){
this.member_info = member_in.data uni.showToast({
this.formData = { title: res.msg,
...this.member_info icon: 'none'
} })
this.sex_name = member_in.data.gender return
} else { }
this.member_info = [] this.formData = res.data
}
this.formData.headimg = res.data.memberHasOne ? res.data.memberHasOne.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')
this.editHeadimg = this.formData.headimg
console.log('xq',this.formData)
}, },
// 修改头像按钮 //获取性别字典
changeAvatar() { async getSexDict() {
uni.chooseImage({ let res = await apiRoute.common_Dictionary({key:'zy_sex'})
count: 1, if(res.code != 1){
sizeType: ['compressed'], uni.showToast({
sourceType: ['album', 'camera'], title: res.msg,
success: (res) => { icon: 'none'
const tempFilePath = res.tempFilePaths[0] })
// 这里可以调用上传接口 return
this.uploadFilePromise(tempFilePath) }
}
}) let dictionary = res.data.dictionary
}, let arr = []
uploadFilePromise(url) { dictionary.forEach((v,k)=>{
let token = uni.getStorageSync('token') || '' arr.push({
let a = uni.uploadFile({ text: v.name,
url: this.uploadUrl, //仅为示例,非真实的接口地址 value: v.value,
filePath: url, })
name: 'file', })
header: { this.options_sex_arr = arr
'token': `${token}`, //请求头设置token },
},
success: (e) => {
let res = JSON.parse(e.data.replace(/\ufeff/g, "") || "{}")
console.log('上传成功2', res)
if (res.code == 1) {
this.upload_type = 2
this.formData.headimg = res.data.path
this.editHeadimg = res.data.path
this.uploadHeadimg = res.data.url
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
},
});
},
//性别选择相关 //性别选择相关
changePickerSex(e) { changePickerSex(e) {
console.log('监听选择', e) console.log('监听选择', e)
this.sex_name = e.text this.formData.gender_name = e.text
this.formData.sex = e.value this.formData.gender = e.value
this.picker_show_sex = false this.cancelPickerSex()
}, },
cancelPickerSex(){
this.picker_show_sex = false
},
//生日选择相关 //生日选择相关
//获取当前年月日+获取30年前的日期 //获取当前年月日+获取30年前的日期
@ -270,34 +266,69 @@
this.picker_show_birthday = false this.picker_show_birthday = false
}, },
//监听-年龄修改
handleAgeInput(e) {
let age = e.detail.value;
if (age < 3) {
uni.showToast({
title: '年龄不能小于3岁',
icon: 'none'
});
this.formData.age = 3;
} else if (age > 18) {
uni.showToast({
title: '年龄不能大于18岁',
icon: 'none'
});
this.formData.age = 18;
} else {
this.formData.age = age;
}
},
//文件上传回调
uplodeImageRes(resData,extraData){
console.log('上传成功回调',resData,extraData)
//判断是不是上传相册图片
if (extraData.input_name == 'headimg') {
console.log('收到的图片地址:', resData.url);
this.editHeadimg = resData.url;
}
},
//图片预览
previewImage(url){
uni.previewImage({
current: url, // 当前图片地址
urls: [url] // 所有图片列表(可以是多个)
});
},
//提交信息 //提交信息
submit() { async submit() {
console.log(this.editHeadimg, '111') if (this.editHeadimg) {
if(this.editHeadimg == ''){ this.formData.headimg = this.editHeadimg
this.editHeadimg = this.formData.headimg }
} let params = {
member.member_edit({ ...this.formData
header: this.editHeadimg, }
name: this.formData.name,
address: this.formData.address, let res = await apiRoute.xy_memberEdit(params)
gender: this.sex_name, if(res.code != 1){
birthday: this.formData.birthday, uni.showToast({
email: this.formData.email, title: res.msg,
phone: this.formData.phone, icon: 'none'
}).then(res => { })
if (res.code == 1) { return
uni.showToast({ }
title: res.msg, uni.showToast({
icon: 'none' title: res.msg,
}) icon: 'success'
} else { })
uni.showToast({ },
title: res.msg,
icon: 'none'
})
}
})
}
} }
} }

Loading…
Cancel
Save