Commit 98e871ee authored by 罗超's avatar 罗超

调整

parent 3624fcbe
<template>
<view class="setComments-box">
<view class="setComments-add" @click="addComments">
<!-- <view class="setComments-add" @click="addComments">
<van-icon name="plus" /><text>创建评价</text>
</view>
</view> -->
<view class="index-student-information">
<view class="setComments-content-box" v-if="dataList.length>0">
<template v-for="(item,index) in dataList">
......
<template>
<van-popup :show="show" :round="true" position="bottom" custom-style="height: 80%" @close="closepopup">
<view class="studentsPopu-box flex">
<view class="studentsPopu-title">
选择学员 <text>({{chooseStuArray?chooseStuArray.length:0}} / {{stuList?stuList.length:0}})</text>
</view>
<view class="studentsPopu-search flex">
<van-search :value="Keywords" shape="round" style="border-radius: 20rpx;width: 100%;" input-align="center"
background="#F6F6F6" @change="searchKeywords" placeholder="请输入搜索关键词" />
background="#F6F6F6" @change="searchKeywords" placeholder="请输入学员姓名" />
</view>
<view class="studentsPopuImg">
<view class="studentsPopuImg" style="flex:1;height: 1px;">
<view class="studentsPopu-img-box flex">
<template v-for="(item,index) in stuList">
<view class="studentsPopu-img-list flex" @click="clickChoose(item)"
<view class="studentsPopu-img-list flex" v-if="(Keywords!='' && item.StuName.indexOf(Keywords)!=-1) || Keywords==''" @click="clickChoose(item)"
:class="item.state?'active':''">
<view class="studentsPopu-imgbox flex">
<view class="studentsPopu-img flex">
......@@ -32,7 +32,6 @@
</view>
</view>
</van-popup>
</template>
<script>
import {
......@@ -56,10 +55,9 @@
proxy
} = getCurrentInstance();
let data = reactive({
show: false,
loading: false,
Keywords: '',
stuList: [],
stuList: props.courseStuList,
chooseStuArray: []
});
let methods = {
......@@ -77,43 +75,31 @@
}
},
// 搜索
searchKeywords() {
},
showFun() {
data.show = true
},
closepopup() {
data.show = false
searchKeywords({detail}) {
data.Keywords=detail
},
save() {
ctx.emit("getdata", data.chooseStuArray);
data.show = false
}
};
//监听属性数组
watch(() => props["courseStuList"], (newValue, oldValue) => {
if (newValue != oldValue && newValue && newValue.length > 0) {
let addList = function(arr) {
arr.forEach((item) => {item.state = false;})
}
addList(newValue);
data.stuList = newValue;
}
}, {
deep: true,
});
// watch(() => props["courseStuList"], (newValue, oldValue) => {
// if (newValue != oldValue && newValue && newValue.length > 0) {
// let addList = function(arr) {
// arr.forEach((item) => {item.state = false;})
// }
// addList(newValue);
// data.stuList = newValue;
// }
// }, {
// deep: true,
// });
let that = methods;
return {
...toRefs(data),
...methods
};
},
onLoad() {
},
onShow() {
}
};
</script>
......@@ -220,10 +206,10 @@
overflow: hidden;
}
.footer {
/* .footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
} */
</style>
<template>
<view class="addComment-index-box">
<view class="addComment-index-box flex" style="background-color: #F6F6F6;flex-direction: column;padding-bottom: 168rpx;">
<navbar class="navbarSticky" bg="#F6F6F6">
<view class="addComment-header-box flex">
<van-icon class="addComment-header-left" name="arrow-left" @click="back" />
<text class="addComment-header-title">新增评论</text>
</view>
</navbar>
<view class="addComment-content">
<view class="addComment-content" style="background-color: #F6F6F6;">
<view class="addComment-title flex">
<van-icon name="friends-o" />
<text>
选择学员 ({{postMsg.ChooseStuList?postMsg.ChooseStuList.length:0}})
</text>
</view>
<view class="addComment-img-box flex">
<view class="addComment-img-box flex" :style="{'height':(expendStatus?'unset':'178rpx'),'overflow':(expendStatus?'unset':'hidden')}">
<view class="addComment-img-list activeOne flex" @click="selectStudents">
<view class="addComment-imgbox flex">
<view class="addComment-img">
......@@ -39,20 +39,22 @@
</view>
<view class="addComment-textarea-box">
<view class="hotsopt" @click="expendStatus=!expendStatus"></view>
<view class="content-textarea-box">
<textarea placeholder="请填写评论内容" v-model="postMsg.Info"></textarea>
</view>
<view class="Sure-button flex">
<view v-if="clickShow" @click="clickSure">确定</view>
<view v-else class="active">确定</view>
</view>
</view>
<template v-show="show">
<studentsPopu ref="getstudentsPopup" :courseStuList="StuList" @getdata="getChooseStu"></studentsPopu>
</template>
<van-popup :z-index="1000" :show="show" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopup">
<studentsPopu ref="getstudentsPopup" :courseStuList="StuList" @getdata="getChooseStu" v-if="show"></studentsPopu>
</van-popup>
</view>
<view class="footer" v-if="!show">
<view class="studentsPopu-save flex">
<view v-if="clickShow" @click="clickSure">确定</view>
<view v-else class="active">确定</view>
</view>
</view>
<view class="addComment-bj"></view>
<!-- <view class="addComment-bj"></view> -->
</view>
</template>
<script>
......@@ -63,7 +65,8 @@
toRefs,
onMounted,
getCurrentInstance,
inject
inject,
nextTick
} from "vue";
import navbar from '../../components/navbar.vue'
export default {
......@@ -83,29 +86,6 @@
} = getCurrentInstance();
let data = reactive({
value: 1,
optionsList: [{
text: '部分可见',
value: 0
},
{
text: '可见不可见',
value: 1
},
{
text: '活动商品',
value: 2
},
],
radioList: [{
name: '使用默认配置',
id: 1,
checked: true
},
{
name: '自定义评价',
id: 2
}
],
checked: '1',
Msg: {
CourseId: '',
......@@ -119,7 +99,8 @@
},
StuList: [], //课程学员列表
clickShow: true,
show: false
show: false,
expendStatus:false
});
let methods = {
back() {
......@@ -130,23 +111,34 @@
// 点击弹出学员列表
selectStudents() {
data.show = true
setTimeout(() => {
refs.getstudentsPopup.$vm.showFun()
}, 500)
},
closepopup(){
data.show=false
},
// 点击确定
clickSure() {
uni.showLoading()
data.clickShow = false;
data.postMsg.Times = data.Msg.CommentTimes;
data.postMsg.CourseId = data.Msg.CourseId;
proxy.$request("/Teacher/BatchSetStuComment", data.postMsg).then(res => {
if (res.Code == 1) {
uni.showToast({
title: '操作成功!',
title: '评语保存成功!',
icon: 'none',
duration: 500
})
uni.navigateBack({
delta:1
})
}else{
uni.showToast({
title: '评语保存失败,请重试',
icon: 'none',
duration: 500
})
}
uni.hideLoading()
})
},
......@@ -155,10 +147,11 @@
if (array) {
data.postMsg.ChooseStuList = array
}
data.show=false
},
//根据课程编号获取课程学员
getCourseStu() {
uni.showLoading()
let stuMsg = {
courseId: data.Msg.CourseId
};
......@@ -167,6 +160,7 @@
if (res) {
data.StuList = res.Data;
}
uni.hideLoading()
})
},
};
......@@ -178,8 +172,11 @@
onLoad(option) {
this.Msg.CourseId = option.CourseId;
this.Msg.CommentTimes = option.CommentTimes;
this.getCourseStu();
},
onShow() {
this.getCourseStu();
}
};
</script>
......@@ -214,7 +211,7 @@
background: #F6F6F6;
border-radius: 30rpx;
padding: 33rpx 37rpx;
min-height: 537rpx;
min-height: 720rpx;
}
.addComment-textarea-box {
......@@ -222,7 +219,18 @@
/* background: #FFFFFF; */
background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654049334000_485.png') no-repeat top 0 center #FFFFFF;
background-size: 141rpx 41rpx;
padding: 50rpx 50rpx 37rpx 50rpx;
padding: 84rpx 50rpx 37rpx 50rpx;
position: relative;
}
.addComment-textarea-box .hotsopt{
width: 141rpx;
height: 41rpx;
position: absolute;
top: 0;
left: 50%;
margin-left: -70rpx;
z-index: 2;
}
.addComment-text {
......@@ -327,4 +335,29 @@
top: 0;
z-index: 9;
}
.studentsPopu-save view {
background: #C91727;
font-size: 30rpx;
font-weight: bold;
letter-spacing: 1rpx;
width: 260rpx;
line-height: 88rpx;
border-radius: 44rpx;
text-align: center;
color: #FFFFFF;
}
.studentsPopu-save {
justify-content: center;
margin-top: 40rpx;
margin-bottom: 40rpx;
}
.footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: #FFF;
}
</style>
......@@ -108,10 +108,10 @@
//实在评价可见性
clickoptions(type) {
let showTypeMsg = {
ids: ''+data.currentAction.Id,
Ids: ''+data.currentAction.Id,
ShowType: type
};
proxy.$request("/Teacher/SetStuCommentShowTypeByTimes", showTypeMsg).then(res => {
proxy.$request("/Teacher/SetStuCommentShowType", showTypeMsg).then(res => {
if (res.Code==1) {
methods.getStuCommentList()
}else{
......@@ -147,9 +147,11 @@
this.topData.CreateTime = json.CreateTime;
this.topData.CreateTypeStr = json.CreateTypeStr;
this.Msg.CommentTimes = json.Times;
this.getStuCommentList();
},
onShow() {
this.getStuCommentList();
}
};
</script>
<style scoped>
......
......@@ -120,9 +120,12 @@
},
onLoad(option) {
this.Msg.CourseId = option.CourseId;
},
onShow() {
this.getCourseRule();
this.getCourseCommentTimes();
},
}
};
</script>
......@@ -221,4 +224,5 @@
top: 0;
z-index: 9;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment