用户端

This commit is contained in:
@fawn-nine
2024-08-07 10:41:04 +08:00
parent 3ae89fd86b
commit ebd8dff627
5 changed files with 187 additions and 90 deletions

View File

@@ -104,10 +104,11 @@
this.pageType = e.type
this.form.classId = e.id
this.form.type = e.type
if(e.options){
if(e.id){
// this.form.renwuId = e.renwuId
this.form = JSON.parse(e.options)
this.pageName = '编辑'
this.form.id = e.id
this.pageName = '编辑'
this.getTaskInfo()
}else{
this.pageName = '添加'
}
@@ -123,7 +124,7 @@
},
//页面显示
onShow() {
},
computed: {
...mapState(['userInfo']),
@@ -134,6 +135,40 @@
},
//方法
methods: {
// 获取医案任务详情
getTaskInfo(){
$http.request({
url: "common/class/getClassTaskInfo",
method: "POST",
data: {
"taskId": this.form.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
// that.isHave = true
console.log(res)
this.form = res.classTask
this.fileList1 = []
if(this.form.img != ''){
var List = this.form.img.split(',')
List.forEach(item => {
this.fileList1.push({url:item})
})
}
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.msg,
icon: 'error'
})
});
},
radioChange(e){
// console.log('点了', e);
@@ -183,10 +218,10 @@
},
onSubmit() {
this.$refs.form.validate().then(res => {
var _show = '1'
if(this.form.type == 2){
this.form.display == true ? _show = '1' : _show = '0'
}
// var _show = '1'
// if(this.form.type == 2){
// this.form.display == true ? _show = '1' : _show = '0'
// }
if (this.fileList1.length > 0) {
let _list = this.fileList1
@@ -200,9 +235,10 @@
url: _url,
method: "POST",
data: {
"classId": this.form.classId,
"id": this.form.id,
"classId": this.form.id ? undefined : this.form.classId,
"type": this.form.type, //类型 0班内任务1医案2心得
"display": _show, //0不展示1展示
"display": this.form.display, //0不展示1展示
"title": this.form.title,
"content": this.form.content,
"img": this.form.img

View File

@@ -58,18 +58,19 @@
</view>
<!-- 班内同学 -->
<view class="classMateBox" v-show="students.length> 0 && tabId == '2'">
<view class="newBox">
<view class="newBox flexbox">
<view :class="['item','flexbox']" v-for="(item, index) in students" :key="index">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="classmateImg">
<image v-if="item.avatar != null && item.avatar != ''" :src="item.avatar"
<image v-if="item.student.avatar != null && item.student.avatar != ''" :src="item.student.avatar"
mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
<view class="textItems flex_box">
<text class="txt555" v-if="item.nickname != null && item.nickname != ''">
{{item.nickname}}
<text class="txt555" v-if="item.student.nickname != null && item.student.nickname != ''">
{{item.student.nickname}}
</text>
<text v-else>匿名用户</text>
</view>
</view>
@@ -108,8 +109,7 @@
</view>
<!-- <uni-section class="mb-10 nobg" title="任务列表" type="line"></uni-section> -->
<view v-if="taskList.length > 0 ">
<view v-if="taskList.length > 0 ">
<view class="submitRecode">
<view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)">
@@ -117,16 +117,21 @@
<text>{{item.title}}</text>
</view>
<view class="leve2">
{{item.content}}
</view>
<view class="leve3" @click.stop="editMyXinde(item)" v-show="tijiaoTitleId == 2 && myExperience == 1">
修改
{{item.content}}
</view>
<view class="leve3" >
<view class="tips flex_box">
<text>发布者{{item.createUser.nickname != null && item.createUser.nickname != '' ? item.createUser.nickname : '匿名用户'}}</text>
<text style="" class="date">日期{{item.createTime}}</text>
</view>
<text class="btn" v-show="tijiaoTitleId == 2 && myExperience == 1" @click.stop="editMyXinde(item)" >修改</text>
</view>
<view class="leve3" v-show="item.reply && tijiaoTitleId != 2">
<text>已提交答案</text>
</view>
<view class="leve3 no" v-show="!item.reply && tijiaoTitleId != 2">
<text>未提交答案</text>
<text>未提交答案 点击开始答题</text>
</view>
</view>
</view>
@@ -148,7 +153,53 @@
<view class="bottomBox" v-if="!isHave && !isDirector && !isMonitor && students.length < thisClass.number">
<button type="primary" @click="addClass">一键加入班级</button>
</view>
<!-- 管理弹出 -->
<u-popup key="1" :show="showMan" :round="10" @close="closeManager">
<view class="guanli">
<h3>班内管理人员</h3>
<view class="item">
<text class="adminName">班长</text>
<view class="personbox" v-if="admins.monitor.id">
<text>{{admins.monitor.user.nickname != null && admins.monitor.user.nickname != '' ? admins.monitor.user.nickname : '匿名用户'}}</text>
<text v-if="admins.monitor.id">({{admins.monitor.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item">
<text class="adminName">副班长</text>
<view class="personbox" v-if="admins.dmonitor.id">
<text>{{admins.dmonitor.user.nickname != null && admins.dmonitor.user.nickname != '' ? admins.dmonitor.user.nickname : '匿名用户'}}</text>
<text>({{admins.dmonitor.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item"><text class="adminName">学习委员</text>
<view class="personbox" v-if="admins.learner.id">
<text>{{admins.learner.user.nickname != null && admins.learner.user.nickname != '' ? admins.learner.user.nickname : '匿名用户'}}</text>
<text>({{admins.learner.user.tel}})</text>
</view>
<text v-else>暂未设置</text>
</view>
<view class="item arryItem"><text class="adminName">记分员</text>
<template v-if="admins.counter.length > 0">
<view class="arryItemSub" v-for="(item,index) in admins.counter" :key="index">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</view>
</template>
<text v-else>暂未设置</text>
</view>
<view class="item arryItem"><text class="adminName">评分员</text>
<template v-if="admins.scorer.length > 0">
<view class="arryItemSub" v-for="(item,index) in admins.scorer" :key="index">
<text>{{item.user.nickname != null && item.user.nickname != '' ? item.user.nickname : '匿名用户'}}</text>
<text>({{item.user.tel}}) </text>
</view>
</template>
<text v-else>暂未设置</text>
</view>
</view>
</u-popup>
<z-navigation ></z-navigation>
</view>
</template>
@@ -239,11 +290,11 @@
id: '0'
},
{
name: '医案',
name: '班内医案',
id: '1'
},
{
name: '心得',
name: '班内心得',
id: '2'
},
],
@@ -285,9 +336,9 @@
},
methods: {
editMyXinde(item){
var options = JSON.stringify(item)
// var options = JSON.stringify(item)
uni.navigateTo({
url:`/pages/miniClass/addHomeWork?options=${options}&type=2`
url:`/pages/miniClass/addHomeWork?id=${item.id}&type=2`
})
},
radioChange1(e){
@@ -316,7 +367,7 @@
// console.log('options',options);
uni.navigateTo({
url:`/pages/miniClass/taskDetail?options=${options}`
url:`/pages/miniClass/taskDetail?id=${item.id}`
})
},
delClass() {
@@ -371,7 +422,7 @@
url: "common/class/getClassTaskListStudent",
method: "POST",
data: {
"limit": 100,
"limit": 10,
"page": 1,
"classId": this.thisClass.id,
"type": this.tijiaoTitleId+'', //类型 0班内任务1医案2心得
@@ -855,10 +906,18 @@
// .userName{}
}
.leve2{
color: #999;
@include bov()
color: #666;
@include bov(3)
}
.leve3{color: $themeColor; text-align: center; padding-top: 10rpx;}
.leve3{
color: $themeColor; text-align: center; padding-top: 10rpx;
.tips{
width: 100%; justify-content: space-between;font-size: 26rpx; color: #999;
}
.date{ }
.btn{border: 1px solid $themeColor; margin-top: 20rpx; display: inline-block; width: 50%; padding: 6rpx 0; border-radius: 10rpx;}
}
.leve3.no{color: #ff9277; text-align: center;}
}
}
@@ -894,6 +953,7 @@
}
.classMateBox {
.newBox{justify-content: space-between; flex-wrap: wrap;}
.zmVip {
background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);
}
@@ -907,7 +967,7 @@
}
.item {
width: 100%;
width:48%;
position: relative;
.textItems {

View File

@@ -179,7 +179,6 @@
</view>
<!-- 管理弹出 -->
<u-popup key="1" :show="showMan" :round="10" @close="closeManager">
<view class="guanli">
<h3>班内管理人员</h3>
<view class="item">

View File

@@ -18,7 +18,7 @@
</view>
<view class="learnBox box">
<view class="newBox" v-if="classList.length > 0">
<view class="item flexbox" v-for="(item, index) in classList" :key="index" >
<view class="item flexbox" v-for="(item, index) in classList" :key="index" @click="onPageJump('/pages/miniClass/classInfo',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
@@ -26,8 +26,8 @@
<view class="imgcontainer defaultImg" v-else>
<image src="@/static/my_04.png" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555" @click="onPageJump('/pages/miniClass/classInfo',item.id)">
<view class="buyItems" >
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie">
@@ -37,7 +37,7 @@
</view> -->
<view class="btn_box" >
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo" @click="onPageJump('/pages/miniClass/classInfo',item.id,'have')">进入班级</text>
<text class="seeInfo">进入班级</text>
</view>
</view>
</view>

View File

@@ -175,23 +175,18 @@
},
onLoad(e) {
uni.hideTabBar();
this.thisTask = JSON.parse(e.options)
console.log('e', this.thisTask)
if (this.thisTask.img != '') {
var imgs = this.thisTask.img.split(',')
imgs = imgs.forEach((item, index) => {
this.FileList11.push({
url: item
})
})
} else {
this.FileList11 = []
}
console.log('this.FileList', this.FileList)
// this.thisTask = JSON.parse(e.options)
console.log('e',e)
if(e.id){
this.thisTask.id = e.id
this.getTaskInfo()
this.getZuoyeList()
}
// console.log('this.FileList', this.FileList)
// this.TaskId = e.id
this.getUserInfo()
this.getZuoyeList()
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
@@ -203,14 +198,50 @@
uni.stopPullDownRefresh()
},
onShow() {
this.form.taskId = this.thisTask.id
// this.getTaskInfo()
this.form.taskId = this.thisTask.id
},
computed: {
...mapState(["userInfo"]),
},
methods: {
// 获取医案任务详情
getTaskInfo(){
$http.request({
url: "common/class/getClassTaskInfo",
method: "POST",
data: {
"taskId": this.thisTask.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
// that.isHave = true
console.log(res)
this.thisTask = res.classTask
this.fileList11 = []
if (this.thisTask.img != '') {
var imgs = this.thisTask.img.split(',')
imgs = imgs.forEach((item, index) => {
this.FileList11.push({
url: item
})
})
}
console.log('this.fileList11',this.fileList11);
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.msg,
icon: 'error'
})
});
},
closePup(){
this.showEditBlank = false
this.form = {
@@ -270,7 +301,7 @@
this.loadFlag = true;
this.pPage++;
$http.request({
url: 'common/class/getReplyListByTaskId',
url: 'common/class/getReplyListByTaskIdStudent',
method: "POST",
data: {
"limit": 10,
@@ -370,11 +401,11 @@
icon: 'success'
})
this.FileList = []
this.closePup()
this.thisTask.reply = true
this.closePup()
setTimeout(()=>{
this.pPage = 0
this.zuoyeList = []
this.getTaskInfo()
this.getZuoyeList()
},200)
}).catch(e => {
@@ -425,38 +456,8 @@
this.form.display = e.detail.value
console.log('点了', this.form.display, e);
},
getTaskInfo() {
uni.showLoading({
title: '正在加载'
})
$http.request({
url: "common/class/getTaskInfo",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"TaskId": this.TaskId // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
this.refresh = false
if (res.code == 0) {
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
}
}
}
</script>
@@ -473,7 +474,8 @@
padding-right: 20rpx;
}
.noanser{ padding: 20rpx;
text-align: center; border-bottom: 1px solid #eee;
text-align: center;
// border-bottom: 1px solid #eee;
.btn{display: inline-block; border-radius: 20rpx ; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;}
}
.in {