Jelajahi Sumber

文件浏览样式调整

xyg 2 tahun lalu
induk
melakukan
3162726746

+ 1 - 1
light-application-wx/pages/file-browse/file-browse.js

@@ -35,7 +35,7 @@ Page({
                     let records = res.data.data.records;
                     for (let i in records) {
                         let content = records[i].content;
-                        content = content.match(/[\u4e00-\u9fa5]/g).join("");
+                        // content = content.match(/[0-9a-zA-z\u4e00-\u9fa5]/g).join("");
                         records[i].desc = content;
                     }
                     that.setData({

+ 3 - 1
light-application-wx/pages/file-browse/file-browse.wxml

@@ -2,7 +2,9 @@
 <scroll-view class="list">
     <view class="item" scroll-y="true" wx:for="{{list}}" wx:key="i" data-id="{{item.id}}" bindtap="fileDetail">
         <view class="file-name">{{item.title}}</view>
-        <view class="file-desc">{{item.desc}}</view>
+        <view class="line"></view>
+        <!-- <view class="file-desc">{{item.desc}}</view> -->
+        <rich-text class="file-desc" nodes="{{item.desc}}"></rich-text>
         <text class="detailBtn">详情></text>
         <view class="publish-time">{{item.createTime}}</view>
     </view>

+ 11 - 4
light-application-wx/pages/file-browse/file-browse.wxss

@@ -20,27 +20,34 @@ page {
 .file-name {
     font-size: 1.2em;
     line-height: 50rpx;
-    border-bottom: solid 1rpx #dddddd;
-    padding-bottom: 20rpx;
+    width: 70%;
     display: -webkit-box;
     word-break: break-all;
     text-overflow: ellipsis;
     overflow: hidden;
     -webkit-box-orient: vertical;
     /*设置超出两行进行隐藏*/
-    -webkit-line-clamp: 2;
+    -webkit-line-clamp: 1;
+}
+
+.line {
+    background-color: #DDDDDD;
+    width: 100%;
+    margin-top: 20rpx;
+    height: 1rpx;
 }
 
 .file-desc {
     font-size: .8em;
     margin-top: 20rpx;
     margin-bottom: 20rpx;
+    width: 84%;
     display: -webkit-box;
     word-break: break-all;
     text-overflow: ellipsis;
     overflow: hidden;
     -webkit-box-orient: vertical;
-    -webkit-line-clamp: 2;
+    -webkit-line-clamp: 1;
 }
 
 .publish-time {

+ 2 - 0
light-application-wx/pages/file-detail/file-detail.wxss

@@ -7,6 +7,7 @@
 .title {
     font-size: 1.2em;
     text-align: center;
+    word-break: break-all;
 }
 
 .publish-time {
@@ -27,4 +28,5 @@
 
 .content {
     color: #747474;
+    word-break: break-all;
 }