lifuxiong 4 gadi atpakaļ
vecāks
revīzija
38683f985f
2 mainītis faili ar 12 papildinājumiem un 4 dzēšanām
  1. 10 3
      components/poster/poster.wxss
  2. 2 1
      utils/poster.js

+ 10 - 3
components/poster/poster.wxss

@@ -1,11 +1,12 @@
 .poster-global {
-  position: fixed;
-  top: 0;
+  position: absolute;
+  top: 2000px;
   left: 0;
   z-index: -2;
-  visibility: hidden;
+  /* visibility: hidden; */
   background-color: transparent;
   height: auto;
+  overflow: hidden;
 }
 
 .poster-container {
@@ -32,6 +33,7 @@
 .poster-photo-wrapper {
   position: relative;
   height: 364rpx;
+  overflow: hidden;
 }
 
 .poster-video-play {
@@ -74,6 +76,11 @@
   font-family: PingFangSC-Regular, PingFang SC;
   font-weight: 400;
   color: rgba(51, 51, 51, 1);
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
 }
 
 .poster-qr-wrapper {

+ 2 - 1
utils/poster.js

@@ -22,7 +22,7 @@ export default class Poster {
 
         fontSize = fontSize.replace("px", "");
         fontSize = Math.ceil(Number(fontSize) * pixelRatio) + "px";
-        top = Math.ceil(top * pixelRatio);
+        top = Math.ceil((top >= 2000 ? top - 2000 : top) * pixelRatio);
         left = Math.ceil(left * pixelRatio);
         if (pixelRatio > 3) {
           // 曲面屏做适配
@@ -100,6 +100,7 @@ export default class Poster {
                 fontWeight: `${fontWeight}`,
                 backgroundColor: `${backgroundColor}`,
                 borderRadius: `${borderRadius}`,
+                maxLines: 3,
               },
             });
             break;