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

调整

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