Переглянути джерело

未登录状态&&报名上传状态&&首页样式&&

XW 1 рік тому
батько
коміт
7c9cdad7a1

+ 4 - 1
Contest/contest.client/src/view/Home.vue

@@ -8,7 +8,7 @@
                     </el-menu-item>
                 </el-menu>
                 <span class="website-name">{{ store.website.name }}</span>
-                <div class="head-photo">
+                <div class="head-photo" v-show="userInfo?.exp">
                     <el-dropdown>
                         <el-avatar :size="35" :src="userInfo?.picture" />
                         <template #dropdown>
@@ -39,6 +39,9 @@
                         </template>
                     </el-dropdown>
                 </div>
+                <div class="head-photo" v-show="!userInfo?.exp">
+                    <p @click="toTeammodel()" style="height: 35px; line-height: 35px;">登录</p>
+                </div>
             </el-header>
             <el-main>
                 <router-view></router-view>

+ 14 - 5
Contest/contest.client/src/view/activitylist/ActivityInfo.less

@@ -53,11 +53,20 @@
         padding: 20px 0;
         font-size: 16px;
 
-        img {
-            width: 70%;
-            height: 400px;
-            margin-left: 15%;
-            border-radius: 5px;
+        
+
+        .img-box {
+            // height: 500px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+
+            img {
+                width: auto;
+                max-width: 100%;
+                max-height: 100%;
+                border-radius: 5px;
+            }
         }
 
         // .sk-box{

+ 11 - 3
Contest/contest.client/src/view/activitylist/ActivityInfo.vue

@@ -12,12 +12,14 @@
                 {{ actInfo.name }}
             </p>
             <div class="join-btn" @click="openDraw">
-                报名
+                {{ registered === 1 ? '已报名' : '报名' }}
             </div>
         </div>
         <div class="info-box">
             <div style="margin-bottom: 20px;" class="sk-info">
-                <img :src="actInfo.posterSas" alt="">
+                <div class="img-box">
+                    <img :src="actInfo.posterSas" alt="">
+                </div>
                 <p style="text-align: center; font-size: 20px;font-weight: bold; margin: 20px 0;">
                     <span>{{ $tools.formatTime(actInfo.stime, 'yyyy-MM-dd') }}</span> - <span>{{ $tools.formatTime(actInfo.etime, 'yyyy-MM-dd') }}</span>
                 </p>
@@ -253,7 +255,6 @@ function getListInfo() {
             let nowTime = Date.parse(new Date())
             contest.value = res.contest
             enrollData.type = res.contest.sign.type
-            console.log(nowTime > res.contest.sign.stime && nowTime < res.contest.sign.etime);
             registered.value = nowTime > res.contest.sign.stime && nowTime < res.contest.sign.etime ? 0 : 3
             enrollData.enrollInfos = contest.value.sign.fields.map(item => {
                 return {
@@ -283,6 +284,10 @@ function getEnroll() {
         activityId: infoId.value
     }
     proxy.$api.teaContest(params).then(res => {
+        if(res?.enroll) {
+            registered.value = 1
+            return
+        }
         if(registered.value != 3 && actInfo.value?.scope != 'school') {
             registered.value = schoolList.length ? (res.code === 200 ? 1 : 0) : 2
         }
@@ -439,6 +444,9 @@ function joinBtn() {
     })
 }
 function openDraw() {
+    if(registered.value === 1) {
+        return
+    }
     if(registered.value) {
         ElMessage({
             type: 'warning',

+ 14 - 10
Contest/contest.client/src/view/homepage/HomePage.vue

@@ -4,10 +4,10 @@
             <el-carousel-item v-for="(item, index) in carousel" :key="index">
                 <div class="carousel-box" @click="openBanner(item)">
                     <img :src="item.img" alt="" />
-                    <div class="title-box">
+                    <!-- <div class="title-box">
                         <p>{{ item.title }}</p>
                         <p>{{ item.subtitle }}</p>
-                    </div>
+                    </div> -->
                 </div>
             </el-carousel-item>
         </el-carousel>
@@ -90,9 +90,9 @@ onMounted(() => {
     let banners = store.website.banners
     banners.forEach(item => {
         if(item.source === 'upload') {
-            item.img = 'https://teammodeltest.blob.core.chinacloudapi.cn' + '/' + store.website.id + item.blob + '?' + store.website.sas
+            item.img = store.website.url + item.blob + '?' + store.website.sas
         } else if(item.source === 'activity') {
-            item.img = item.blob + '?' + store.website.sas
+            item.img = store.website.url + item.blob + '?' + store.website.sas
         }
         carousel.value.push(item)
     })
@@ -131,6 +131,7 @@ function getActList() {
                 item.posterShow = !item.poster ? require('@/assets/img/no-poster-cn.png') : item.url + item.poster + '?' + item.sas
                 lessonList.value.push(item)
             })
+            lessonList.value = lessonList.value.sort((a, b) => b.createTime - a.createTime)
             lessonListShow.value = lessonList.value
         }
     }).finally(() => {
@@ -166,7 +167,7 @@ watch(actType, ((newValue, oldValue) => {
 </script>
 <style lang="less" scoped>
 .home-page {
-    padding: 0 15%;
+    padding: 0 13%;
     // padding-top: 20px;
     height: 100%;
     background: linear-gradient(0deg, #c3d9e9, transparent);
@@ -176,6 +177,8 @@ watch(actType, ((newValue, oldValue) => {
         width: 100%;
         height: 100%;
         position: relative;
+        display: flex;
+        align-items: center;
 
         .title-box {
             position: absolute;
@@ -221,18 +224,19 @@ watch(actType, ((newValue, oldValue) => {
 
                 .img-box {
                     max-width: 95%;
-                    display: block;
                     /* border-top-left-radius: 5px;
                     border-top-right-radius: 5px; */
-                    border-radius: 5px;
                     margin: 10px;
-                    height: 170px;
-                    text-align: center;
+                    height: 142px;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
 
                     img {
                         width: auto;
                         max-width: 100%;
                         max-height: 100%;
+                        border-radius: 5px;
                     }
                 }
 
@@ -288,7 +292,7 @@ watch(actType, ((newValue, oldValue) => {
                 .lesson-type {
                     position: absolute;
                     top: 10px;
-                    right: 9px;
+                    right: 10px;
                     height: 20px;
                     line-height: 20px;
                     font-size: 14px;

+ 7 - 1
Contest/contest.client/src/view/myactivity/MyActivity.vue

@@ -51,6 +51,7 @@
                                     <el-icon v-show="!skModule"><CaretRight /></el-icon>
                                     赛课模块
                                 </p>
+                                <el-alert title="上传作品时间已过" v-show="contest.upload.actState === 'finish'" type="warning" :closable="false" show-icon style="margin-top: 20px;" />
                                 <div v-show="skModule">
                                     <div class="cipher-box" v-show="contest.sign.type">
                                         <p>队伍名称:{{ cipher.teamName }}</p>
@@ -110,7 +111,7 @@
                                             </div>
                                         </div>
                                     </template>
-                                    <template v-if="contest?.upload && !contest?.upload.captainUpload || contest?.upload.captainUpload && isLeader">
+                                    <template v-if="contest?.upload && contest.upload.actState === 'going' && !contest?.upload.captainUpload || contest?.upload.captainUpload && isLeader">
                                         <el-upload class="upload-demo" ref="refUpload" :file-list="fileList" :accept="accept" drag multiple :on-change="handleChange" :auto-upload="false" action="">
                                             <el-icon class="el-icon--upload"><UploadFilled /></el-icon>
                                             <div class="el-upload__text">
@@ -212,6 +213,7 @@ let store = useStore()
 let router = useRouter()
 
 let actIndex = ref(0)
+let activeStep = ref(0)
 let actTab = ref('user')
 let searchName = ref('')
 let accept = ref('')
@@ -286,6 +288,10 @@ function getListInfo(info, index) {
             })
             actInfo.value = res.activity
             if(res.contest?.upload.type === 'file') accept.value = res.contest?.upload.fileType.map(item => '.' + item).join()
+            let nowDate = new Date().getTime()
+            res.contest.modules.forEach((item, index) => {
+                res.contest[item].actState = nowDate < res.contest[item].stime ? 'notStart' : (nowDate > res.contest[item].etime ? 'finish' : 'going')
+            })
             contest.value = res.contest
             research.value = res.research
             training.value = res.training

+ 3 - 1
Contest/contest.client/src/view/myactivity/MyReview.vue

@@ -350,8 +350,10 @@ function saveScore() {
     if(ruleInfo.value.scoreDetail) {
         // 排查细项打分时,是否有遗漏(可以打0分)
         notScore = checkNotScore(ruleInfo.value.trees)
+    } else {
+        notScore = reviewScore.value
     }
-    if(notScore || reviewScore.value === null) {
+    if(notScore) {
         ElMessage({
             type: 'warning',
             message: ruleInfo.value.scoreDetail ? '有细项未打分' : '未打分'