Commit 31c84542 authored by youjie's avatar youjie

no message

parent 5ef2f509
......@@ -48,6 +48,6 @@
.sticky {
position: sticky;
top: 0;
z-index: 999;
z-index: 2;
}
</style>
<template>
<view class="rulesPopup-box">
<van-popup :show="show" :round="true" @close="closepopup">
<view class="rulesPopup-popup-box">
<van-icon class="rulesPopup-popup-closure" name="cross" @click="closepopup"/>
<view class="rulesPopup-popup-title">自定义评论规则</view>
<view class="rulesPopup-popup-content">
<input v-model="uploadParm.ExamName" class="rulesPopup-popup-name" placeholder="请输入本组自定义规则名称"/>
<view>
<text></text>
<view class="rulesPopup-box">
<van-icon class="rulesPopup-closure" name="cross" @click="closepopup"/>
<view class="rulesPopup-title">自定义评论规则</view>
<view class="rulesPopup-content">
<input v-model="uploadParm.ExamName" class="rulesPopup-name" placeholder="请输入本组自定义规则名称"/>
<view class="rulesPopup-RuleSettings">
<text class="RuleSettings-title">规则设置</text>
<view class="RuleSettings-slider">
<van-slider v-model="value" bar-height="10rpx" active-color="#ee0a24">
<template #button>
<div class="custom-button">{{ value }}</div>
</template>
</van-slider>
<!-- <van-slider v-model="valueNum" range
bar-height="4px" active-color="#ee0a24"
@change="onChange" /> -->
</view>
</view>
</view>
<view class="RuleSettings-content">
<textarea placeholder="请填写评论内容"></textarea>
</view>
<view class="rulesPopup-save flex">
<view @click="save">保存</view>
</view>
</view>
</van-popup>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
onMounted,
......@@ -26,195 +43,41 @@
import { uploadFile } from "@/utils/index";
export default {
props: {
dataList:[],
CourseId :0
},
components: {},
setup(props,ctx) {
// 双滑块模式时,值必须是数组
const value = ref([10, 50]);
let {
proxy
} = getCurrentInstance();
let data = reactive({
userData:{},//用户信息
showPhone: false,
showLogin: false, //多次点击
show:false,
uploadParm: {
// Uid:726615,
// CourseId:44977497,
Uid:0,
CourseId:props.CourseId,
ExamName:''
},
fileList:[],
Msg:{
PageIndex: 1,
PageSize: 10,
ExamName:''
},
dataList: props.dataList,
valueNum: ref([0, 0]),
show: false,
loading: false,
});
let methods = {
examDetails(item){
uni.navigateTo({
url: `/pages/index/examDetails?exam=${encodeURIComponent(JSON.stringify(item))}`
});
showFun(){
data.show = true
},
closepopup(){
data.show = false
data.uploadParm = {
Uid:'',
CourseId:'',
ExamName: ''
}
},
// 重新导入
clickReimport(item){
uni.showModal({
title: '提示',
content: '重新导入将要清除此考试数据,是否继续',
success: function (res) {
if (res.confirm) {
that.DelExamInfo(item)
} else if (res.cancel) {
uni.showToast({
title:'已取消',
icon:'none',
duration: 500
})
}
}
});
},
// 删除接口
DelExamInfo(item){
let Msg = {
ExamId: item.ExamId
}
proxy.$request("/Exam/DelExamInfo", Msg).then(res => {
if(res.Code ==1){
uni.showToast({
title:'删除成功',
icon:'none',
duration: 500
})
data.show = true ;
proxy.$parent.getExamPageList();
}
})
},
ImportInformation(){
data.show = true
},
beforeRead(file){
if(!data.uploadParm.ExamName){
uni.showToast({
title:'请输入考试名称',
icon:'none',
duration: 500
})
return
}
if (file.url.indexOf('xls') ==-1 ||file.url.indexOf('xlsx') ==-1) {
uni.showToast({
title:'请上传 xls/xlsx 格式图片',
icon:'none',
duration: 500
})
return false;
}
return true;
},
// 添加导入
customUpload(event){
data.userData = uni.getStorageSync('userInfo')
const { file } = event.detail;
that.uploadFileFun(file)
// uploadFile(params, file, (res) => {
// uni.showModal({
// title:res.Message
// })
// });
// return
onChange(value){
console.log(value)
// data.valueNum = value
// console.log(data.valueNum)
},
uploadFileFun(file){
if(!data.uploadParm.ExamName){
uni.showToast({
title:'请输入考试名称',
icon:'none',
duration: 500
})
return
}
if(file[0].url.indexOf('xls')==-1||file[0].url.indexOf('xlsx')==-1){
uni.showToast({
title:'请上传xls、xlsx格式的文件',
icon:'none',
duration: 500
})
return
}
let host = ''
if (process.env.NODE_ENV === "development") {
host = 'http://192.168.10.36:8082/api'
} else {
host = 'https://eduapi.oytour.com/api'
}
data.userData = uni.getStorageSync('userInfo')
data.uploadParm = {
Uid:data.userData.Id,
CourseId:data.uploadParm.CourseId,
ExamName: data.uploadParm.ExamName
}
data.loading = true
uni.uploadFile({
url: host + '/Upload/UploadStuExamScore',
filePath: file[0].url,
name: 'file',
formData: {
myfile:file[0],
params:JSON.stringify(data.uploadParm)
},
success(res) {
if(res.Code ==1){
uni.showToast({
title: '导入成功',
icon:'none',
duration: 500
})
uni.hideLoading();
data.uploadParm = {
Uid:'',
CourseId:'',
ExamName: ''
}
data.loading = false
// ctx.emit('change')
}else{
uni.showToast({
title: '导入失败',
icon:'none',
duration: 500
})
uni.hideLoading();
data.loading = false
}
},
fail(err) {
console.log("uploadErr", err)
}
});
proxy.$parent.getExamPageList();
save(){
data.show = false
}
};
let that = methods;
return {
...toRefs(data),
value,
...methods
};
},
......@@ -227,6 +90,47 @@
};
</script>
<style scoped>
.custom-button {
width: 26rpx;
color: #fff;
font-size: 20rpx;
line-height: 36rpx;
text-align: center;
background-color: #ee0a24;
border-radius: 100rpx;
}
.RuleSettings-slider{
padding: 52rpx 0 66rpx 0;
}
.rulesPopup-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;
}
.rulesPopup-save{
justify-content: flex-end;
margin-top: 40rpx;
}
.RuleSettings-content textarea{
width: 100%;
}
.RuleSettings-content{
background: #F7F7F7;
border-radius: 30rpx;
min-height: 152rpx;
padding: 37rpx 43rpx;
}
.RuleSettings-title{
font-size: 30rpx;
font-weight: bold;
color: #282828;
}
.rulesPopup-box .noData{
text-align: center;
flex:1;
......@@ -241,51 +145,25 @@
color: #cecece;
text-align: center;
}
.rulesPopup-hint-right view{
padding: 16rpx 30rpx;
background: #C91727;
border-radius: 50rpx;
color: #FFFFFF;
font-size: 24rpx;
font-weight: bold;
letter-spacing: 1rpx;
}
.rulesPopup-hint-right{
flex-shrink: 0;
margin-left: 50rpx;
}
.rulesPopup-hint-left view{
background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653648241000_545.png')no-repeat center;
background-size: 100% 100%;
padding: 11rpx 0 11rpx 30rpx;
}
.rulesPopup-hint-left van-icon{
font-size: 42rpx;
margin-right: 10rpx;
}
.rulesPopup-hint-left{
font-size: 22rpx;
color: #C91727;
letter-spacing: 1rpx;
align-items: center;
}
.rulesPopup-center-hint{
justify-content: space-between;
padding: 10rpx 0;
border-top: 1rpx solid #F6F6F6;
align-items: center;
.rulesPopup-RuleSettings{
background: #FCEEEF;
border-radius: 30rpx;
padding: 35rpx 41rpx;
margin-top: 51rpx;
margin-bottom: 40rpx;
}
.rulesPopup-popup-name{
.rulesPopup-name{
background-color: #F7F7F7;
text-align: center;
border: 1px solid #F7F7F7;
height: 86rpx;
line-height: 86rpx;
height: 88rpx;
line-height: 88rpx;
padding: 0 10rpx;
border-radius: 44rpx;
font-size: 30rpx;
letter-spacing: 1rpx;
}
.rulesPopup-popup-title{
.rulesPopup-title{
width: 100%;
text-align: center;
font-size: 30rpx;
......@@ -293,134 +171,17 @@
margin-bottom: 73rpx;
letter-spacing: 1rpx;
}
.rulesPopup-popup-closure{
.rulesPopup-closure{
position: absolute;
right: 31rpx;
top: 31rpx;
color: #282828;
font-size: 38rpx;
}
.rulesPopup-popup-box{
.rulesPopup-box{
position: relative;
width: 548rpx;
padding: 48rpx 55rpx 98rpx 55rpx;
}
.homework-score-num view:last-child{
font-size: 23rpx;
margin-top: 25rpx;
}
.homework-score-num view:first-child{
margin-right: 10rpx;
font-size: 46rpx;
font-weight: 800;
}
.homework-score-num{
font-weight: 800;
font-style: italic;
font-size: 36rpx;
}
.homework-score-title{
font-size: 20rpx;
margin-bottom: 0rpx;
font-weight: 400;
letter-spacing: 1px;
margin-bottom: 15rpx;
}
.homework-score:last-child{
margin-right: 0rpx;
}
.homework-score{
margin-right: 16rpx;
flex-direction: column;
justify-content: center;
}
.rulesPopup-right{
height: 122rpx;
background: #FCEEEF;
padding: 23rpx 37rpx 15rpx 37rpx;
border-radius: 30rpx;
justify-content: space-between;
flex-shrink: 0;
margin-left: 11rpx;
color: #CE8086;
}
.rulesPopup.activeOne .rulesPopup-state-text{
color: #BEBEBE;
}
.rulesPopup-state-text{
font-size: 20rpx;
letter-spacing: 2px;
}
.rulesPopup-state van-icon{
color: #DADADA;
font-size: 24rpx;
margin-right: 10rpx;
}
.rulesPopup-state{
margin-top: 35rpx;
font-size: 20rpx;
}
.rulesPopup.activeOne .rulesPopup-name{
color: #282828;
}
.rulesPopup-name{
height: 70rpx;
font-size: 26rpx;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin-top: 9rpx;
letter-spacing: 1px;
font-weight: bold;
}
.rulesPopup-left{
flex-grow: 1;
}
.rulesPopup-center{
justify-content: space-between;
padding: 0 0 20rpx 0;
}
.rulesPopup-center-line{
width: 4rpx;
height: 23rpx;
background: #282828;
position: absolute;
left: 0;
top: 46rpx;
}
.rulesPopup.activeOne .rulesPopup-center-box{
background: #FFFFFF;
}
.rulesPopup-center-box{
flex-grow: 1;
position: relative;
border-radius: 30rpx;
padding: 31rpx 40rpx 0 22rpx;
margin-bottom: 50rpx;
box-shadow: 0px 6px 29px 0px rgba(76, 76, 76, 0.09);
border-radius: 30px;
}
.rulesPopup{
margin: 0 50rpx;
}
.rulesPopup-import text{
margin-left: 15rpx;
}
.rulesPopup-import{
width: 247rpx;
border: 1rpx solid #F2A1A8;
background: #FFFFFF;
line-height: 54rpx;
padding: 0 38rpx;
margin: auto;
margin-bottom: 48rpx;
border-radius: 50rpx;
color: #F2A1A8;
font-size: 24rpx;
text-align: center;
padding: 48rpx 55rpx 60rpx 55rpx;
}
.rulesPopup-box{
......
......@@ -35,19 +35,20 @@
<view class="commentRulesList-footer-box">
<view class="commentRulesList-footer flex">
<view class="add flex">
<text>添加自定义规则</text>
<text @click="addRules">添加自定义规则</text>
<view class="Wire"></view>
</view>
<view class="save flex"><text>保存</text></view>
<view class="save flex"><text @click="save">保存</text></view>
</view>
</view>
<rulesPopup></rulesPopup>
<rulesPopup ref="getrulesPopup"></rulesPopup>
</view>
</template>
<script>
import rulesPopup from '@/components/setComments/rulesPopup'
import setComments from '@/components/setComments/setComments'
import {
ref,
reactive,
toRefs,
onMounted,
......@@ -65,6 +66,7 @@
rulesPopup
},
setup() {
let { refs } = getCurrentInstance();
let {
proxy
} = getCurrentInstance();
......@@ -89,7 +91,7 @@
HomeWorkId:'',
jobDetails: {},
dataList:[],
pageState:'more'
pageState:'more',
});
let methods = {
back(){
......@@ -97,8 +99,16 @@
delta: 1
})
},
editRules(){//编辑规则
saveRules(){//保存规则
},
addRules(){//添加规则
data.show = true
refs.getrulesPopup.$vm.showFun()
},
editRules(){//编辑规则
data.show = true
refs.getrulesPopup.$vm.showFun()
},
deleteRules (){//删除规则
uni.showModal({
......@@ -116,8 +126,11 @@
}
}
});
}
},
}
onMounted (() => {
})
return {
...toRefs(data),
...methods
......@@ -186,6 +199,7 @@
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 21rpx 0rpx rgba(165, 165, 165, 0.34);
}
......
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