Commit 195dd6d9 authored by 罗超's avatar 罗超

提交

parent f7e396f1
...@@ -23,4 +23,5 @@ export default { ...@@ -23,4 +23,5 @@ export default {
*{ *{
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>
...@@ -24,6 +24,14 @@ export function login(data) { ...@@ -24,6 +24,14 @@ export function login(data) {
}) })
} }
export function setCourseComment(data) {
return request({
url: '/Teacher/SetCourseComment',
method: 'post',
data
})
}
/** /**
* 手机号登录 * 手机号登录
* @param {JSON参数} data * @param {JSON参数} data
......
<template> <template>
<view class="examDetailsComponents-box"> <view class="examDetailsComponents-box">
<view class="examDetailsComponents activeOne flex" v-for="(item,index) in ExamStu" :key="index" :class="item.StuId ==0?'mismatchActive':''"> <template v-for="(item,index) in ExamStu">
<view class="examDetailsComponents activeOne flex" v-if="(item.StuId==0 && unKnowStatus) || !unKnowStatus" :key="index" :class="item.StuId ==0?'mismatchActive':''">
<view class="examDetailsComponents-time-box flex" @click="goStuScoreDetail(item)"> <view class="examDetailsComponents-time-box flex" @click="goStuScoreDetail(item)">
<view class="examDetailsComponents-time flex"> <view class="examDetailsComponents-time flex">
<view>{{item.StuName.substring(0,1)}}</view> <view>{{item.StuName.substring(0,1)}}</view>
...@@ -39,12 +41,13 @@ ...@@ -39,12 +41,13 @@
排名率 排名率
</view> </view>
<view class="homework-score-num"> <view class="homework-score-num">
<text>{{(item.RankRate * 100).toFixed(0)}}</text>% <text>{{(item.RankRate * 100).toFixed(0)}}</text>%
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template>
</view> </view>
</template> </template>
<script> <script>
...@@ -53,22 +56,30 @@ ...@@ -53,22 +56,30 @@
toRefs, toRefs,
onMounted, onMounted,
getCurrentInstance, getCurrentInstance,
inject inject,
watch
} from "vue"; } from "vue";
export default { export default {
props: { props: {
ExamStu:[] ExamStu:[],
checkUnKnow:false
}, },
components: {}, components: {},
setup() { setup(props) {
watch(
() => props.checkUnKnow,
(newValue, oldValue) => {
data.unKnowStatus=newValue
}
)
let data = reactive({ let data = reactive({
obj: { obj: {
Name: '', Name: '',
Photo: '', Photo: '',
}, },
showPhone: false, showPhone: false,
unKnowStatus:props.checkUnKnow,
showLogin: true, //多次点击 showLogin: true, //多次点击
}); });
let methods = { let methods = {
......
...@@ -54,8 +54,10 @@ ...@@ -54,8 +54,10 @@
<view class="examList-popup-box"> <view class="examList-popup-box">
<van-icon class="examList-popup-closure" name="cross" @click="closepopup"/> <van-icon class="examList-popup-closure" name="cross" @click="closepopup"/>
<view class="examList-popup-title">导入考试信息</view> <view class="examList-popup-title">导入考试信息</view>
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654136886000_860.png" mode="widthFix" class="examList-popup-icon"></image>
<view class="examList-popup-content"> <view class="examList-popup-content">
<input v-model="uploadParm.ExamName" class="examList-popup-name" placeholder="请输入考试名称"/> <input v-model="uploadParm.ExamName" class="examList-popup-name" placeholder="请输入考试名称"/>
<van-uploader <van-uploader
class="examList-popup-fil-box flex" class="examList-popup-fil-box flex"
accept="file" accept="file"
...@@ -69,7 +71,7 @@ ...@@ -69,7 +71,7 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653639041000_305.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653639041000_305.png" />
选择文件 选择文件
</view> --> </view> -->
<van-button round color='#C91727' custom-style='width: 548rpx;' block>选择文件</van-button> <van-button round color='#C91727' icon="add-o" custom-style='width: 360rpx;margin:0 auto;' block>选择文件</van-button>
</van-uploader> </van-uploader>
</view> </view>
</view> </view>
...@@ -362,33 +364,42 @@ ...@@ -362,33 +364,42 @@
.examList-popup-fil-box{ .examList-popup-fil-box{
display: flex; display: flex;
line-height: 88rpx; line-height: 88rpx;
width: 548rpx; width: 360rpx;
/* padding: 0 197rpx; */ /* padding: 0 197rpx; */
border-radius: 44rpx; border-radius: 44rpx;
font-size: 30rpx; font-size: 30rpx;
color: #FFFFFF; color: #FFFFFF;
background: #C91727; background: #C91727;
margin:0 auto;
margin-top: 27rpx; margin-top: 27rpx;
text-align: center; text-align: center;
} }
.examList-popup-name{ .examList-popup-name{
background-color: #FFFFFF; background-color: #FFFFFF;
text-align: center; text-align: center;
border: 1px solid #AAAAAA; border: 1rpx solid #AAAAAA;
height: 86rpx; height: 88rpx;
line-height: 86rpx; line-height: 88rpx;
padding: 0 10rpx; padding: 0 10rpx;
border-radius: 44rpx; border-radius: 44rpx;
font-size: 30rpx; font-size: 30rpx;
width: 439rpx;
font-weight: bold;
margin:0 auto;
} }
.examList-popup-title{ .examList-popup-title{
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
margin-bottom: 73rpx; margin-bottom: 70rpx;
letter-spacing: 1rpx;
} }
.examList-popup-icon{
width:188rpx;
height: 188rpx;
display: block;
margin: 0 auto 50rpx auto;
}
.examList-popup-closure{ .examList-popup-closure{
position: absolute; position: absolute;
right: 31rpx; right: 31rpx;
...@@ -399,7 +410,8 @@ ...@@ -399,7 +410,8 @@
.examList-popup-box{ .examList-popup-box{
position: relative; position: relative;
width: 548rpx; width: 548rpx;
padding: 48rpx 55rpx 98rpx 55rpx; padding: 48rpx 55rpx 82rpx 55rpx;
box-sizing: border-box;
} }
.homework-score-num view:last-child{ .homework-score-num view:last-child{
font-size: 23rpx; font-size: 23rpx;
......
<template> <template>
<view class="rulesPopup-box"> <view class="rulesPopup-box">
<van-popup :show="show" :round="true" @close="closepopup"> <van-icon class="rulesPopup-closure" name="cross" @click="cancelHandler" />
<view class="rulesPopup-box"> <view class="rulesPopup-title">自定义评论规则</view>
<van-icon class="rulesPopup-closure" name="cross" @click="closepopup" /> <view class="rulesPopup-content">
<view class="rulesPopup-title">自定义评论规则</view> <!-- <input v-model="ruleObj.Title" class="rulesPopup-name" placeholder="请输入本组自定义规则名称" /> -->
<view class="rulesPopup-content"> <view class="rulesPopup-RuleSettings">
<input v-model="ruleObj.Title" class="rulesPopup-name" placeholder="请输入本组自定义规则名称" /> <view class="RuleSettings-title">规则设置</view>
<view class="rulesPopup-RuleSettings"> <sRegionSlider :minValue="minValue" :maxValue="maxValue" :fillMinValue='rangeValue[0]' :fullValue='rangeValue[1]' :step="5"
<text class="RuleSettings-title">规则设置</text> @up="up" @down="down" @move="move" />
<view class="RuleSettings-slider">
<sRegionSlider :minValue="minValue" :maxValue="maxValue" :step="1"
@up="up" @down="down" @move="move" />
</view>
</view>
</view>
<view class="RuleSettings-content">
<textarea placeholder="请填写评论内容" v-model="ruleObj.Info"></textarea>
</view>
<view class="rulesPopup-save flex">
<view @click="save">保存</view>
</view>
</view> </view>
</van-popup> </view>
<view class="RuleSettings-content">
<textarea placeholder="请填写评论内容" v-model="ruleObj.Info"></textarea>
</view>
<view class="rulesPopup-save flex">
<van-loading color="#f5f5f5" v-if="loading" />
<view @click="save" v-else>保存</view>
</view>
</view> </view>
</template> </template>
<script> <script>
...@@ -38,20 +36,33 @@ ...@@ -38,20 +36,33 @@
import { import {
uploadFile uploadFile
} from "@/utils/index"; } from "@/utils/index";
import {setCourseComment} from '../../api/index'
export default { export default {
components: { components: {
sRegionSlider sRegionSlider
}, },
props: { props: {
rule:{
type:Number,
default:null
},
rules:{
type:Object,
default:null
}
}, },
emits: ['change'], emits: ['change','cancel'],
setup(props, ctx) { setup(props, ctx) {
let { let {
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
watch(
() => props.rules,
(newValue, oldValue) => {
data.rules=newValue
}
)
let data = reactive({ let data = reactive({
show: false,
loading: false, loading: false,
isRange: true, isRange: true,
ruleObj: { ruleObj: {
...@@ -62,45 +73,65 @@ ...@@ -62,45 +73,65 @@
Info: "", //评价 Info: "", //评价
}, },
minValue:0, minValue:0,
maxValue:10 maxValue:0,
rangeValue:[0,100],
rules:props.rules
}); });
if(props.rule!=-1){
let tempRule=data.rules.CommentDetails[props.rule]
data.ruleObj.DetailId = tempRule.DetailId;
data.ruleObj.StartNum = tempRule.StartNum;
data.ruleObj.EndNum = tempRule.EndNum;
data.ruleObj.Info = tempRule.Info;
data.minValue = tempRule.StartNum;
data.maxValue = tempRule.EndNum;
}
let methods = { let methods = {
chage(minValue,maxValue){ chage(minValue,maxValue){
data.minValue = minValue; data.minValue = minValue;
data.maxValue = maxValue; data.maxValue = maxValue;
}, },
up(e){ up(e){
// console.log(e);//// e中包含了原有的e信息, 并添加了custom对象
data.minValue = e.custom.minValue; data.minValue = e.custom.minValue;
data.maxValue = e.custom.maxValue; data.maxValue = e.custom.maxValue;
}, },
down(e){ }, down(e){ },
move(e){ }, move(e){ },
showFun(item) { cancelHandler(){
if (item) { ctx.emit('cancel')
data.ruleObj.DetailId = item.DetailId;
data.ruleObj.StartNum = item.StartNum;
data.ruleObj.EndNum = item.EndNum;
data.ruleObj.Info = item.Info;
} else {
data.ruleObj.DetailId = 0;
data.ruleObj.StartNum = 0;
data.ruleObj.EndNum = 0;
data.ruleObj.Info = "";
}
data.show = true
},
closepopup() {
data.show = false
},
onChange(value) {
console.log(value)
}, },
save() { save() {
data.ruleObj.StartNum = data.valueNum[0]; if(data.ruleObj.Info==''){
data.ruleObj.EndNum = data.valueNum[1]; uni.showToast({
ctx.emit("change", data.ruleObj); title: '请填写评语内容',
data.show = false icon: 'none',
duration: 1000
})
return;
}
uni.showLoading()
data.loading=true
console.log(data.valueNum)
data.ruleObj.StartNum = data.minValue >data.maxValue?data.maxValue:data.minValue;
data.ruleObj.EndNum = data.minValue>data.maxValue?data.minValue:data.maxValue;
if(props.rule!=-1){
data.rules.CommentDetails[props.rule]=data.ruleObj
}else{
data.rules.CommentDetails.push(data.ruleObj)
}
setCourseComment(data.rules).then(r=>{
//console.log(r)
data.loading=false
uni.hideLoading()
uni.showToast({
title: '操作成功!',
icon: 'none',
duration: 500
})
ctx.emit("change");
})
} }
}; };
let that = methods; let that = methods;
...@@ -128,9 +159,7 @@ ...@@ -128,9 +159,7 @@
border-radius: 100rpx; border-radius: 100rpx;
} }
.RuleSettings-slider {
padding: 0 0 30rpx 0;
}
.rulesPopup-save view { .rulesPopup-save view {
background: #C91727; background: #C91727;
...@@ -151,6 +180,10 @@ ...@@ -151,6 +180,10 @@
.RuleSettings-content textarea { .RuleSettings-content textarea {
width: 100%; width: 100%;
font-size: 30rpx;
font-weight: 400;
color: #282828;
line-height: 48rpx;
} }
.RuleSettings-content { .RuleSettings-content {
...@@ -158,12 +191,16 @@ ...@@ -158,12 +191,16 @@
border-radius: 30rpx; border-radius: 30rpx;
min-height: 152rpx; min-height: 152rpx;
padding: 37rpx 43rpx; padding: 37rpx 43rpx;
box-sizing: border-box;
margin-top: 40rpx;
} }
.RuleSettings-title { .RuleSettings-title {
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
color: #282828; color: #282828;
line-height: 42rpx;
/* margin-bottom: 70rpx; */
} }
.rulesPopup-box .noData { .rulesPopup-box .noData {
...@@ -186,9 +223,8 @@ ...@@ -186,9 +223,8 @@
.rulesPopup-RuleSettings { .rulesPopup-RuleSettings {
background: #FCEEEF; background: #FCEEEF;
border-radius: 30rpx; border-radius: 30rpx;
padding: 35rpx 41rpx; padding: 35rpx 40rpx;
margin-top: 51rpx; padding-bottom: 60rpx;
margin-bottom: 40rpx;
} }
.rulesPopup-name { .rulesPopup-name {
...@@ -208,8 +244,7 @@ ...@@ -208,8 +244,7 @@
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
margin-bottom: 73rpx; margin-bottom: 60rpx;
letter-spacing: 1rpx;
} }
.rulesPopup-closure { .rulesPopup-closure {
...@@ -222,8 +257,10 @@ ...@@ -222,8 +257,10 @@
.rulesPopup-box { .rulesPopup-box {
position: relative; position: relative;
width: 548rpx; width: 650rpx;
padding: 48rpx 55rpx 60rpx 55rpx; padding: 40rpx;
padding-bottom: 60rpx;
box-sizing: border-box;
} }
.rulesPopup-box {} .rulesPopup-box {}
......
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
dataList: [], dataList: [],
}); });
let methods = { let methods = {
back() { // back() {
uni.navigateBack({ // uni.navigateBack({
delta: 1 // delta: 1
}) // })
}, // },
addComments(){ addComments(){
uni.navigateTo({ uni.navigateTo({
url: '/pages/setComments/commentRulesList?show=' + true url: '/pages/setComments/commentRulesList?show=' + true
......
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
<view clipchildren= false> <view clipchildren= false>
<text class="loading" :style="{opacity: lineLeft===0 ? '1' : '0'}">loading...</text> <text class="loading" :style="{opacity: lineLeft===0 ? '1' : '0'}">loading...</text>
<view class="fj-slider-box" :style="{opacity: lineLeft!==0 ? '1' : '0'}" clipchildren= false> <view class="fj-slider-box" :style="{opacity: lineLeft!==0 ? '1' : '0'}" clipchildren= false>
<view class="tip" :style="{left:`${tipLeft}px`,opacity: tipShow ? '1' : '1'}"> <view class="tip" :style="{left:`${minLeft}px`,opacity: tipShow ? '1' : '1'}">
{{curValue}}% {{myShowMinNum}}%
<view class="h"></view> <view class="h"></view>
</view> </view>
<view class="tip" :style="{left:`${maxLeft-30}px`,opacity: tipShow ? '1' : '1'}">
{{myShowMaxNum}}%
<view class="h"></view>
</view>
<view class="fj-slider" clipchildren= false> <view class="fj-slider" clipchildren= false>
<view class="fj-line" ref="fj-line"> <view class="fj-line" ref="fj-line">
<view class="scale-box"> <view class="scale-box">
...@@ -35,8 +39,8 @@ ...@@ -35,8 +39,8 @@
</view> </view>
</view> </view>
<view class="fj-value"> <view class="fj-value">
<text class="fj-v-l" :style="{color: showMinNum===fillMinValue ? '#333' : '#999'}">{{fillMinValue}}</text> <text class="fj-v-l">{{fillMinValue}}</text>
<text class="fj-v-r" :style="{color: showMaxNum===fillValue ? '#333' : '#999'}">{{fillValue}}</text> <text class="fj-v-r">{{fillValue}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -78,7 +82,7 @@ export default { ...@@ -78,7 +82,7 @@ export default {
}, },
step: { step: {
type: Number, type: Number,
default: 1, default: 5,
}, },
}, },
watch: { watch: {
...@@ -128,9 +132,16 @@ export default { ...@@ -128,9 +132,16 @@ export default {
sFillMinValue:0, sFillMinValue:0,
percentage: 0, percentage: 0,
disX:0 disX:0,
myShowMinNum:0,
myShowMaxNum:0,
}; };
}, },
created() {
this.myShowMinNum=this.minValue
this.myShowMaxNum=this.maxValue
},
mounted(){ mounted(){
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.envir({ this.envir({
...@@ -206,6 +217,9 @@ export default { ...@@ -206,6 +217,9 @@ export default {
}) })
}, },
touchmove(e, type) { touchmove(e, type) {
try{
// #ifndef APP-PLUS // #ifndef APP-PLUS
const disX = e.touches[0].clientX - this.lineLeft const disX = e.touches[0].clientX - this.lineLeft
// #endif // #endif
...@@ -238,6 +252,11 @@ export default { ...@@ -238,6 +252,11 @@ export default {
this.curValue = this.curValue + this.fillMinValue; this.curValue = this.curValue + this.fillMinValue;
if(type==='min'){
this.myShowMinNum=this.curValue
}else if(type==='max'){
this.myShowMaxNum=this.curValue
}
this.$emit('move', { this.$emit('move', {
...e, ...e,
custom:{ custom:{
...@@ -248,6 +267,9 @@ export default { ...@@ -248,6 +267,9 @@ export default {
} }
}) })
}catch(e){
//TODO handle the exception
}
}, },
touchend(e, type) { touchend(e, type) {
if(type === 'min') { if(type === 'min') {
...@@ -295,10 +317,10 @@ export default { ...@@ -295,10 +317,10 @@ export default {
<style scoped> <style scoped>
.scale view{ .scale view{
width: 2px; width: 2rpx;
height: 5px; height: 7rpx;
background: #282828; background: #282828;
border-radius: 1px; border-radius: 1rpx;
} }
.scale{ .scale{
justify-content: space-between; justify-content: space-between;
...@@ -313,7 +335,7 @@ export default { ...@@ -313,7 +335,7 @@ export default {
.fj-slider-box{font-size:14px;} .fj-slider-box{font-size:14px;}
.loading{font-size:14px;text-align: center;display: block;} .loading{font-size:14px;text-align: center;display: block;}
.fj-value{position: relative;height:20px;} .fj-value{position: relative;height:20px;}
.fj-v-l,.fj-v-r{font-size: 14px;position: absolute;} .fj-v-l,.fj-v-r{font-size: 24rpx;position: absolute;font-weight: 500;color: #282828;}
.fj-v-l{left:0;} .fj-v-l{left:0;}
.fj-v-r{right:0;} .fj-v-r{right:0;}
...@@ -336,15 +358,16 @@ export default { ...@@ -336,15 +358,16 @@ export default {
} }
.tip{ .tip{
width: 37px; /* width: 37px; */
position: relative; position: relative;
padding: 1px 5px; padding: 10rpx;
background: #FFFDFD; background: #FFFDFD;
color: rgba(227,64,76,1); color: #E53F4E;
border-radius: 6px; border-radius: 6px;
z-index: 4; z-index: 4;
font-size: 14px; font-size: 24rpx;
text-align: center; text-align: center;
display: inline;
} }
.h{ .h{
position: absolute; position: absolute;
...@@ -359,14 +382,14 @@ export default { ...@@ -359,14 +382,14 @@ export default {
} }
.fj-line{position: relative;} .fj-line{position: relative;}
.fj-line, .fj-line-pull { .fj-line, .fj-line-pull {
height: 5px; height: 12rpx;
background: #999; background: #fff;
position: absolute; position: absolute;
top:14px; top:14px;
left: 15px; left: 15px;
right: 15px; right: 15px;
z-index: 1; z-index: 1;
border-radius: 5px; border-radius: 6rpx;
} }
.fj-line-pull{z-index: 2;background: #282828;} .fj-line-pull{z-index: 2;background: #282828;}
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<view>{{ExamName}}</view> <view>{{ExamName}}</view>
</view> </view>
<view class="conten-title-right"> <view class="conten-title-right">
<text>仅查看未匹配学员</text> <text>仅看未匹配</text>
<van-switch :checked="unSelectCheck" size="18px" active-color="#07c160" @change="changeUnSelect"/>
</view> </view>
</view> </view>
<view class="jobDetails-num-box flex"> <view class="jobDetails-num-box flex">
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
</view> </view>
</view> </view>
<view class="index-student-information" style="flex:1;height:1px"> <view class="index-student-information" style="flex:1;height:1px">
<examDetailsComponents :ExamStu="ExamStu"></examDetailsComponents> <examDetailsComponents :ExamStu="ExamStu" :checkUnKnow='unSelectCheck'></examDetailsComponents>
</view> </view>
</view> </view>
</view> </view>
...@@ -66,9 +67,13 @@ ...@@ -66,9 +67,13 @@
ExamName:"测试需要绑", ExamName:"测试需要绑",
ExamNum:0, ExamNum:0,
AvgScore:0, AvgScore:0,
ExamStu:[] ExamStu:[],
unSelectCheck:false
}); });
let methods = { let methods = {
changeUnSelect({ detail }){
data.unSelectCheck=detail
},
//获取考试学生列表 //获取考试学生列表
getExamStuList(){ getExamStuList(){
proxy.$request("/Exam/GetExamStuList", data.Msg).then(res => { proxy.$request("/Exam/GetExamStuList", data.Msg).then(res => {
...@@ -127,25 +132,34 @@ ...@@ -127,25 +132,34 @@
padding: 70rpx 185rpx 35rpx 185rpx; padding: 70rpx 185rpx 35rpx 185rpx;
} }
.conten-title-right text{ .conten-title-right text{
background: #C91727;
border-radius: 27rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: bold; font-weight: 400;
color: #FFFFFF; color:grey;
padding: 10rpx 19rpx; text-align: right;
display: block; display: block;
margin-bottom: 10rpx;
} }
.conten-title-right{ .conten-title-right{
flex-shrink: 0; flex-shrink: 0;
text-align: right;
margin-left: 20rpx;
} }
.conten-title-left view{ .conten-title-left view{
font-size: 50rpx; font-size: 36rpx;
font-weight: 800; font-weight: 600;
color: #282828;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
overflow:hidden;
text-overflow:ellipsis;
} }
.conten-title-left text{ .conten-title-left text{
font-size: 36rpx;
font-weight: 400;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 24rpx;
font-weight: 400;
color:grey;
} }
.conten-title-left{ .conten-title-left{
color: #282828; color: #282828;
......
...@@ -7,40 +7,56 @@ ...@@ -7,40 +7,56 @@
</view> </view>
</navbar> </navbar>
<view class="commentRulesList-content"> <view class="commentRulesList-content">
<view class="commentRulesList-title flex"> <!-- <view class="commentRulesList-title flex">
<van-image class="img" width="35rpx" height="40rpx" fit="cover" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653980136000_413.png" /> <van-image class="img" width="35rpx" height="40rpx" fit="cover" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653980136000_413.png" />
<text>{{courseRule.Title}}</text> <text>{{courseRule.Title}}</text>
</view> </view> -->
<view class="commentRulesList-list" v-if="courseRule" v-for="(item,index) in courseRule.CommentDetails"> <view style="border-radius: 30rpx;background: #FCEEEF;overflow: hidden;margin-bottom: 40rpx;" v-for="(item,index) in courseRule.CommentDetails">
<view class="commentRulesList-cross" v-if="courseRule.Id>0" @click="deleteRules(item,index)">
<van-icon name="cross" />
</view> <van-swipe-cell
<view class="commentRulesList-img flex"> id="swipe-cell"
<view>百分比: {{item.StartNum}}%-{{item.EndNum}}%</view> :right-width="116"
<van-image v-if="courseRule.Id>0" @click="editRules(item)" class="img" width="31rpx" height="30rpx" fit="cover" async-close
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653980151000_180.png" /> :key="index"
@close="onClose"
>
<view class="commentRulesList-list">
<view class="commentRulesList-img flex">
<view>百分比: {{item.StartNum}}%-{{item.EndNum}}%</view>
</view>
<view class="commentRulesList-comment">
{{item.Info}}
</view>
</view> </view>
<view class="commentRulesList-comment"> <view slot="right" class="van-swipe-cell__right">
{{item.Info}}
<van-button square type="danger" @click="deleteRules(item,index)" custom-style="height:100%;">删除</van-button>
<van-button square type="primary" @click="editRules(item,index)" custom-style="height:100%;">编辑</van-button>
</view> </view>
</van-swipe-cell>
</view> </view>
<view class="noData" v-else> <view class="noData" v-if="!courseRule || !courseRule.CommentDetails || !courseRule.CommentDetails.length>0">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653902791000_806.png" mode="widthFix"></image> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653902791000_806.png" mode="widthFix"></image>
<view>暂无评论规则数据</view> <view>暂无评论规则数据</view>
</view> </view>
</view> </view>
<view class="commentRulesList-footer-box"> <view class="commentRulesList-footer-box">
<view class="commentRulesList-footer flex"> <view class="commentRulesList-footer flex">
<view class="add flex">
<!-- <text @click="addRules">添加自定义规则</text>
<view class="Wire"></view> -->
</view>
<!-- <view class="save flex"><text v-if="!isDefaultRule" @click="saveRules">保存</text></view> -->
<view class="add flex"> <view class="add flex">
<text @click="addRules">添加自定义规则</text> <text @click="addRules">添加自定义规则</text>
<view class="Wire"></view>
</view> </view>
<view class="save flex"><text v-if="!isDefaultRule" @click="saveRules">保存</text></view>
</view> </view>
</view> </view>
<template v-show="show"> <van-popup :show="show" :round="true" @close="closepopup">
<rulesPopup ref="getrulesPopup" @change="changeData"></rulesPopup> <rulesPopup @cancel="closepopup" :rule="editor" :rules="courseRule" v-if="show" ref="getrulesPopup" @change="changeData"></rulesPopup>
</template> </van-popup>
</view> </view>
</template> </template>
<script> <script>
...@@ -83,10 +99,20 @@ ...@@ -83,10 +99,20 @@
}, //课程规则 }, //课程规则
isDefaultRule: true, //是否是默认规则( isDefaultRule: true, //是否是默认规则(
detailItem: {}, //当前编辑项 detailItem: {}, //当前编辑项
show:false show:false,
editor:-1
}); });
let methods = { let methods = {
onClose(event) {
const { position, instance } = event.detail;
switch (position) {
case 'left':
case 'cell':
case 'right':
instance.close();
break;
}
},
back() { back() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
...@@ -94,29 +120,22 @@ ...@@ -94,29 +120,22 @@
}, },
// 关闭规则弹窗 // 关闭规则弹窗
closure(){ closure(){
refs.getrulesPopup.$vm.closepopup() this.show=false
},
saveRules() { //保存规则
proxy.$request("/Teacher/SetCourseComment", data.courseRule).then(res => {
if (res) {
uni.showToast({
title: '操作成功!',
icon: 'none',
duration: 500
})
this.getCourseRule()
}
})
}, },
//添加规则 //添加规则
addRules() { addRules() {
data.show = true data.show = true
refs.getrulesPopup.$vm.showFun() //refs.getrulesPopup.$vm.showFun()
},
closepopup(){
data.show=false
data.editor=-1
}, },
//编辑规则 //编辑规则
editRules(item) { editRules(item,index) {
data.editor=index
data.show = true data.show = true
refs.getrulesPopup.$vm.showFun(item)
}, },
//删除规则 //删除规则
...@@ -156,6 +175,7 @@ ...@@ -156,6 +175,7 @@
}, },
//获取课程规则信息 //获取课程规则信息
getCourseRule() { getCourseRule() {
uni.showLoading()
proxy.$request("/Teacher/GetCourseComment", data.Msg).then(res => { proxy.$request("/Teacher/GetCourseComment", data.Msg).then(res => {
if (res) { if (res) {
var tempData = res.Data; var tempData = res.Data;
...@@ -171,36 +191,13 @@ ...@@ -171,36 +191,13 @@
data.isDefaultRule = false; data.isDefaultRule = false;
} }
} }
uni.hideLoading()
}) })
}, },
//获取子组件数据 //获取子组件数据
changeData(item) { changeData() {
console.log("item", item); methods.getCourseRule()
if (item) { data.show=false
if (item.Title && item.Title != '') {
data.courseRule.Title = item.Title
}
if (data.isDefaultRule) {
data.courseRule.CommentDetails = [];
}
let obj = {
DetailId: item.DetailId,
StartNum: item.StartNum,
EndNum: item.EndNum,
Info: item.Info
}
if (item.DetailId > 0 && data.courseRule.CommentDetails.length > 0) {
let chooseIndex = data.courseRule.CommentDetails.findIndex(qitem => qitem.DetailId == item.DetailId);
data.courseRule.CommentDetails[chooseIndex].StartNum = obj.StartNum;
data.courseRule.CommentDetails[chooseIndex].EndNum = obj.EndNum;
data.courseRule.CommentDetails[chooseIndex].Info = obj.Info;
} else {
data.courseRule.CommentDetails.push(obj)
}
}
if (data.isDefaultRule) {
data.isDefaultRule = false;
}
} }
} }
return { return {
...@@ -211,17 +208,17 @@ ...@@ -211,17 +208,17 @@
onLoad(option) { onLoad(option) {
this.Msg.CourseId = option.CourseId; this.Msg.CourseId = option.CourseId;
if(option.show){ if(option.show){
this.show = option.show //this.show = option.show
this.addRules() //this.addRules()
}
if(option.CourseId){
this.show = true
this.addRules()
setTimeout(()=>{
this.show = false
this.closure()
},200)
} }
// if(option.CourseId){
// this.show = true
// this.addRules()
// setTimeout(()=>{
// this.show = false
// this.closure()
// },200)
// }
this.getCourseRule(); this.getCourseRule();
}, },
}; };
...@@ -232,7 +229,17 @@ ...@@ -232,7 +229,17 @@
flex: 1; flex: 1;
width: 100%; width: 100%;
} }
.van-swipe-cell__left,
.van-swipe-cell__right {
position: absolute;
top: 0;
height: 100%;
right: 0;
width:232px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
}
.noData image { .noData image {
width: 200rpx; width: 200rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
...@@ -305,7 +312,7 @@ ...@@ -305,7 +312,7 @@
font-weight: 400; font-weight: 400;
color: #282828; color: #282828;
line-height: 58rpx; line-height: 58rpx;
letter-spacing: 1rpx;
} }
.commentRulesList-img .img { .commentRulesList-img .img {
...@@ -344,11 +351,10 @@ ...@@ -344,11 +351,10 @@
.commentRulesList-list { .commentRulesList-list {
background: #FCEEEF; background: #FCEEEF;
border-radius: 30px; /* border-radius: 30px; */
position: relative; position: relative;
padding: 37rpx 38rpx 36rpx 45rpx; padding: 37rpx 38rpx 36rpx 45rpx;
margin-bottom: 40rpx; min-height: 100rpx;
min-height: 290rpx;
} }
.commentRulesList-title .img { .commentRulesList-title .img {
...@@ -410,7 +416,18 @@ ...@@ -410,7 +416,18 @@
background: #FFFFFF; background: #FFFFFF;
color: #D13A48; color: #D13A48;
} }
.right-opeartion{
width: 100px;
margin-left: 38px;
background: #D13A48;
color: #FFF;
left: 159px;
z-index: -1;
padding-left: 91rpx;
box-sizing: border-box;
display: flex;
align-items: center;
}
.add text, .add text,
.save text { .save text {
line-height: 88rpx; line-height: 88rpx;
...@@ -487,11 +504,10 @@ ...@@ -487,11 +504,10 @@
.commentRulesList-list { .commentRulesList-list {
background: #FCEEEF; background: #FCEEEF;
border-radius: 30px; /* border-radius: 30px; */
position: relative; position: relative;
padding: 37rpx 38rpx 36rpx 45rpx; padding: 37rpx 38rpx 36rpx 45rpx;
margin-bottom: 40rpx; min-height: 100rpx;
min-height: 290rpx;
} }
.commentRulesList-title .img { .commentRulesList-title .img {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="setComments-index-box"> <view class="setComments-index-box">
<navbar class="navbarSticky" bg="#F6F6F6"> <navbar class="navbarSticky" bg="#F6F6F6">
<view class="setComments-header-box flex"> <view class="setComments-header-box flex">
<van-icon class="setComments-header-left" name="arrow-left" @click="back" /> <van-icon class="setComments-header-left" name="arrow-left" @click="backFirst" />
<text class="setComments-header-title">设置评语</text> <text class="setComments-header-title">设置评语</text>
</view> </view>
</navbar> </navbar>
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<template v-else>使用默认配置</template> <template v-else>使用默认配置</template>
</text> </text>
<view> <view>
<template v-if="courseRule&&courseRule.Id>0">从自定义评价规则进入修改</template> <template v-if="courseRule&&courseRule.Id>0">当前启用自定义规则,可以随时再次调整</template>
<template v-else>不喜欢默认配置可自行设置</template> <template v-else>当前使用为系统默认配置,你可以点击进行自定义调整</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -77,8 +77,11 @@ ...@@ -77,8 +77,11 @@
courseRule: {}, //课程评价规则 courseRule: {}, //课程评价规则
}); });
let methods = { let methods = {
back() { backFirst() {
console.log('come in...')
console.log(getCurrentPages())
uni.navigateBack({ uni.navigateBack({
url:'/pages/index/workSituation',
delta: 1 delta: 1
}) })
...@@ -103,8 +106,10 @@ ...@@ -103,8 +106,10 @@
}) })
}, },
goRules() { goRules() {
console.log('come in 2 ....')
uni.navigateTo({ uni.navigateTo({
url: '/pages/setComments/commentRulesList?CourseId=' + data.Msg.CourseId //url: '/pages/setComments/commentRulesList?CourseId=' + data.Msg.CourseId
url: '/pages/setComments/commentRulesList?show=' + false+'CourseId=' + data.Msg.CourseId
}) })
} }
}; };
......
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