commit
ac230ac578
|
@ -66,6 +66,12 @@ export default {
|
|||
userAvatar: "", // 用户头像
|
||||
rankIf: true, // 权限识别
|
||||
isLogin: false, // 是否登录
|
||||
|
||||
|
||||
applyTime:[],
|
||||
submitTime:[],
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -84,7 +90,17 @@ export default {
|
|||
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/guide");
|
||||
break;
|
||||
case "apply":
|
||||
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/apply");
|
||||
//判断一下是否开启 这咋判断呢???
|
||||
var startTime = parseInt(this.$moment(this.applyTime[0]).format("X"))
|
||||
var endTime = parseInt(this.$moment(this.applyTime[1]).format("X"))
|
||||
var nowTime = parseInt(this.$moment().format("X"))
|
||||
|
||||
if (startTime <= nowTime && nowTime <= endTime){
|
||||
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/apply");
|
||||
}else {
|
||||
Message.warning("未在报名时间段")
|
||||
this.getPath()
|
||||
}
|
||||
break;
|
||||
case "submit":
|
||||
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/submit");
|
||||
|
@ -152,6 +168,13 @@ export default {
|
|||
|
||||
//保存banner
|
||||
this.banner = res.data.compBanner;
|
||||
|
||||
|
||||
this.applyTime[0] = res.data.applyStartTime
|
||||
this.applyTime[1] = res.data.applyEndTime
|
||||
this.submitTime[0] = res.data.submitStartTime
|
||||
this.submitTime[1] = res.data.submitEndTime
|
||||
|
||||
}else {
|
||||
// 未正式上线,需要拦截等操作,跳转404
|
||||
Message.warning("该竞赛还未上线");
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
<el-switch v-model="compInfo.chart"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="报名时间">
|
||||
<el-form-item label="报名时间" v-if="isReady">
|
||||
<el-date-picker
|
||||
v-model="compInfo.applyTime"
|
||||
v-model="applyTime"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
|
@ -54,9 +54,9 @@
|
|||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="比赛时间">
|
||||
<el-form-item label="比赛时间" v-if="isReady">
|
||||
<el-date-picker
|
||||
v-model="compInfo.submitTime"
|
||||
v-model="submitTime"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
|
@ -371,6 +371,9 @@ export default {
|
|||
],
|
||||
|
||||
},
|
||||
isReady: false,
|
||||
applyTime:[],
|
||||
submitTime:[],
|
||||
compInfo:{
|
||||
compId: "",
|
||||
compName: "",
|
||||
|
@ -378,8 +381,10 @@ export default {
|
|||
online: false,
|
||||
rank: "",
|
||||
chart: "",
|
||||
applyTime:'',
|
||||
submitTime:''
|
||||
applyStartTime:'',
|
||||
applyEndTime:'',
|
||||
submitStartTime:'',
|
||||
submitEndTime:'',
|
||||
},
|
||||
homeInfo:{
|
||||
compId: "",
|
||||
|
@ -459,6 +464,16 @@ export default {
|
|||
|
||||
saveData(type){
|
||||
var compInfo = this.compInfo;
|
||||
if (this.applyTime != null) {
|
||||
compInfo.applyStartTime = this.applyTime[0]
|
||||
compInfo.applyEndTime = this.applyTime[1]
|
||||
}
|
||||
if (this.submitTime != null) {
|
||||
compInfo.submitStartTime = this.submitTime[0]
|
||||
compInfo.submitEndTime = this.submitTime[1]
|
||||
}
|
||||
|
||||
|
||||
var chatInfo = this.chatInfo;
|
||||
var guideInfo = this.guideInfo;
|
||||
var submitCust = this.submitCust;
|
||||
|
@ -472,6 +487,7 @@ export default {
|
|||
contactInfo,
|
||||
homeInfo,
|
||||
};
|
||||
console.log(compInfo)
|
||||
this.$api.updateData(type,updateDataVo).then((res) =>{
|
||||
if (res.status == 0) {
|
||||
Message.success("保存成功");
|
||||
|
@ -492,11 +508,16 @@ export default {
|
|||
if (res.status == 0) {
|
||||
//正常
|
||||
this.compInfo = res.compInfo;
|
||||
this.applyTime[0] = res.compInfo.applyStartTime
|
||||
this.applyTime[1] = res.compInfo.applyEndTime
|
||||
this.submitTime[0] = res.compInfo.submitStartTime
|
||||
this.submitTime[1] = res.compInfo.submitEndTime
|
||||
this.chatInfo = res.chatInfo;
|
||||
this.contactInfo = res.contactInfo;
|
||||
this.homeInfo = res.homeInfo;
|
||||
this.submitCust = res.submitCust;
|
||||
this.guideInfo = res.guideInfo;
|
||||
this.isReady = true;
|
||||
}else if (res.status == 10){
|
||||
Message.error("系统错误");
|
||||
}else {
|
||||
|
|
Loading…
Reference in New Issue