소스 검색

更新 优化

黄琪勇 1 년 전
부모
커밋
32be4a9df8

+ 3 - 7
src/components/ellipsisScroll/ellipsisScroll.vue

@@ -4,10 +4,8 @@
 * @Date:2024-03-25 11:50:36
 -->
 <template>
-   <div class="xx">
-      <div ref="ellipsisScrollDom" :class="{ isScroll: isScroll }" class="ellipsisScroll">
-         {{ props.title }}
-      </div>
+   <div ref="ellipsisScrollDom" :class="{ isScroll: isScroll }" class="ellipsisScroll">
+      {{ props.title }}
    </div>
 </template>
 
@@ -31,7 +29,6 @@ onUnmounted(() => {
 })
 
 let widthCalc = 0
-
 function handleIsScroll(e: MouseEvent) {
    const target = e.target as HTMLElement
    widthCalc = target.scrollWidth - target.clientWidth
@@ -56,7 +53,6 @@ function handleLeaveScroll() {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
-   line-height: 16px;
    &.isScroll {
       &:hover {
          width: auto;
@@ -68,7 +64,7 @@ function handleLeaveScroll() {
             transform: translateX(0);
          }
          100% {
-            transform: translateX(-clac(100% - v-bind(widthCalc + "px")));
+            transform: translateX(-100%);
          }
       }
    }

+ 2 - 0
src/global.d.ts

@@ -4,6 +4,7 @@ import dictionary from "@/components/dictionary"
 import tooltipAutoShow from "@/components/tooltipAutoShow"
 import split from "@/components/split"
 import ellipsis from "@/components/ellipsis"
+import ellipsisScroll from "@/components/ellipsisScroll"
 
 /** 全局组件 */
 declare module "vue" {
@@ -14,5 +15,6 @@ declare module "vue" {
       tooltipAutoShow: typeof tooltipAutoShow
       split: typeof split
       ellipsis: typeof ellipsis
+      ellipsisScroll: typeof ellipsisScroll
    }
 }

BIN
src/img/loginErr/404.png


BIN
src/img/loginErr/btn.png


+ 3 - 0
src/registerComponents.ts

@@ -7,6 +7,7 @@ import dictionary from "@/components/dictionary"
 import tooltipAutoShow from "@/components/tooltipAutoShow"
 import split from "@/components/split"
 import ellipsis from "@/components/ellipsis"
+import ellipsisScroll from "@/components/ellipsisScroll"
 
 export default (app: App<Element>) => {
    //element
@@ -21,4 +22,6 @@ export default (app: App<Element>) => {
    app.component("split", split)
    //ellipsis
    app.component("ellipsis", ellipsis)
+   //ellipsisScroll
+   app.component("ellipsisScroll", ellipsisScroll)
 }

+ 16 - 1
src/views/cloudTextbooks/cloudTextbooks.vue

@@ -259,8 +259,8 @@ function handleClick(id: string) {
          display: flex;
          flex-direction: column;
          align-items: center;
-         min-width: 1500px;
          padding-top: 10px;
+         min-width: 1240px;
          .bookshelf {
             width: 1500px;
             padding: 0 116px;
@@ -337,6 +337,21 @@ function handleClick(id: string) {
                }
             }
          }
+         @media screen and (max-width: 1600px) {
+            .bookshelf {
+               width: 1400px;
+            }
+         }
+         @media screen and (max-width: 1500px) {
+            .bookshelf {
+               width: 1300px;
+            }
+         }
+         @media screen and (max-width: 1400px) {
+            .bookshelf {
+               width: 1200px;
+            }
+         }
       }
    }
    .empty {

+ 2 - 0
src/views/coursewarePlay/component/point.module.scss

@@ -46,6 +46,7 @@
    }
    :global {
       .van-cell {
+         cursor: pointer;
          background: transparent;
          font-size: 16px;
          color: rgba(255, 255, 255, 0.5);
@@ -80,6 +81,7 @@
       border-top: 0;
       :global {
          .van-cell {
+            cursor: pointer;
             padding-left: 0;
             font-size: 16px;
          }

+ 51 - 9
src/viewsframe/errorPage/errorPage.vue

@@ -6,8 +6,13 @@
 <template>
    <div class="errorPage">
       <div class="error">
-         <div>您访问的页面不存在!</div>
-         <ElButton type="primary" @click="handleGoHome">返回首页</ElButton>
+         <img class="img" src="@/img/loginErr/404.png" />
+         <div class="errName">糟糕,页面找不到了</div>
+         <div class="title">您可以通过以下方式继续访问</div>
+         <div class="btnCon">
+            <div class="btn" @click="handleGoHome">跳转到首页</div>
+            <div class="btn" @click="handleGoBack">返回上一步</div>
+         </div>
       </div>
    </div>
 </template>
@@ -21,6 +26,9 @@ function handleGoHome() {
       path: "/"
    })
 }
+function handleGoBack() {
+   router.back()
+}
 </script>
 
 <style lang="scss" scoped>
@@ -31,17 +39,51 @@ function handleGoHome() {
    justify-content: center;
    align-items: center;
    .error {
-      width: 600px;
-      height: 160px;
-      background-color: $bg-color-page;
       display: flex;
       flex-direction: column;
       justify-content: center;
       align-items: center;
-      & > div:first-child {
-         font-size: $font-size-medium;
-         color: $text-color-regular;
-         margin-bottom: 10px;
+      .img {
+         width: 630px;
+         height: 514px;
+      }
+      .errName {
+         margin-top: -100px;
+         font-weight: 500;
+         font-size: 29px;
+         color: #333333;
+         line-height: 41px;
+      }
+      .title {
+         font-weight: 400;
+         font-size: 22px;
+         color: #aaaaaa;
+         line-height: 30px;
+      }
+      .btnCon {
+         margin-top: 50px;
+         display: flex;
+         justify-content: center;
+         .btn {
+            background: url("@/img/loginErr/btn.png") no-repeat;
+            width: 170px;
+            height: 52px;
+            background-size: 100% 100%;
+            font-weight: bold;
+            font-size: 22px;
+            color: #ffffff;
+            line-height: 52px;
+            text-align: center;
+            letter-spacing: 1px;
+            margin-right: 25px;
+            cursor: pointer;
+            &:hover {
+               opacity: $opacity-hover;
+            }
+            &:last-child {
+               margin-right: 0;
+            }
+         }
       }
    }
 }

+ 9 - 4
src/viewsframe/layout/layout.vue

@@ -10,7 +10,7 @@
             <div class="avatar">
                <div class="imgCon"><el-image class="avatarImg" :src="userInfo.avatar || require('@/img/layout/userImg.png')" /></div>
                <div class="name">
-                  {{ userInfo.username }}
+                  <ellipsisScroll :title="userInfo.username || ''" />
                </div>
                <img class="horn" :class="{ isVisible: visible }" src="@/img/layout/horn.png" />
             </div>
@@ -19,7 +19,7 @@
                   <div class="avatar-item">
                      <el-image class="avatarImg" :src="userInfo.avatar || require('@/img/layout/userImg.png')" />
                      <div class="userInfo">
-                        <div class="realName">{{ userInfo.username }}</div>
+                        <div class="realName"><ellipsisScroll :title="userInfo.username || ''" /></div>
                         <div class="phone">{{ userInfo.phone }}</div>
                      </div>
                   </div>
@@ -67,7 +67,6 @@ function handleLogout() {
 .layout {
    width: 100%;
    height: 100%;
-   min-width: 1200px;
    min-height: 880px;
    background: linear-gradient(180deg, #ffd884 0%, #ffa943 100%);
    box-shadow: 0px 11px 15px 0px #63bd73, inset 0px 1px 14px 0px rgba(255, 255, 255, 0.5);
@@ -107,10 +106,13 @@ function handleLogout() {
          .name {
             margin-left: 6px;
             font-size: 18px;
+            height: 18px;
+            line-height: 18px;
             color: #244b55;
             font-weight: 500;
-            min-width: 56px;
+            width: 56px;
             text-align: center;
+            overflow: hidden;
          }
          .horn {
             margin-left: 8px;
@@ -147,10 +149,13 @@ function handleLogout() {
       }
       .userInfo {
          margin-left: 16px;
+         flex-grow: 1;
+         overflow: hidden;
          .realName {
             font-weight: 600;
             font-size: 20px;
             line-height: 28px;
+            height: 28px;
             color: #333333;
          }
          .phone {

+ 3 - 2
src/viewsframe/login/login.vue

@@ -105,15 +105,16 @@ function handleRefresh() {
    background: url("@/img/loginErr/bg.png") no-repeat;
    background-size: cover;
    display: flex;
-   justify-content: center;
    align-items: center;
+   justify-content: center;
    min-width: 1280px;
    .loginCon {
+      width: 74%;
       display: flex;
       justify-content: space-between;
-      width: 80%;
    }
    .loginBox {
+      margin-top: 8px;
       width: 440px;
       height: 498px;
       background: url("@/img/loginErr/loginBox.png") no-repeat;