Răsfoiți Sursa

文章详情空白行不显示

liyongli 3 ani în urmă
părinte
comite
c51c96a613

+ 1 - 1
miniprogram/pages/detail/detail.js

@@ -27,7 +27,7 @@ Page({
     })
     let D = list.data[0] || {};
     console.log(D.content.match(/style=\"([a-z|A-Z|-|:|;|0-9]*)\"/g))
-    D.content = D.content.replace(/<p/gi, '<p style="text-indent: 2em"').replace(/style=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/width=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/height=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/<img/g, "<img style='width: 100%'")
+    D.content = D.content.replace(/style=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/width=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/height=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/<img/g, "<img style='width: 100%'").replace(/<p/gi, '<p style="text-indent: 2em;min-height: 1em"')
     if (D.creat_time) D.creat_time = this.format(D.creat_time);
     _this.setData({
       detail: D

+ 1 - 1
miniprogram/pages/detail/template/defaultDetail/index.wxml

@@ -1,6 +1,6 @@
 <!--miniprogram/pages/detail/template/pdfDetail/index.wxml-->
 <template name="defaultDetail">
-  <video class="video" wx:if="{{headUrl}}" src="{{headUrl}}"></video>
+  <video custom-cache="{{false}}" class="video" wx:if="{{headUrl}}" src="{{headUrl}}"></video>
   <view style="width:730rpx;margin: 10rpx auto;display:block" wx:if="{{creat_time}}"> 发表日期:{{creat_time}}</view>
   <rich-text wx:if="{{content}}" style="width:730rpx;margin: 10rpx auto;display:block" nodes="{{content}}"></rich-text>
 </template>

+ 2 - 2
miniprogram/pages/home/index.wxml

@@ -1,7 +1,7 @@
 <!--miniprogram/pages/home/index.wxml-->
 <view class="home">
   <image class="headImg " mode="aspectFit"
-    src="cloud://cloud1-6gbxfp9x33ff3b7c.636c-cloud1-6gbxfp9x33ff3b7c-1306051304/homeTop.jpeg"></image>
+    src="cloud://cloud1-6gbxfp9x33ff3b7c.636c-cloud1-6gbxfp9x33ff3b7c-1306051304/head.jpeg"></image>
   <view class="title">
     畅行中国·庆祝建党100周年“追寻红色记忆”主题——“重访红色声音故里”融媒传播暨 “党性教育基地”揭牌仪式定于2021年6月16日-19日在陕西延安举行。
   </view>
@@ -72,7 +72,7 @@
       </view>
     </view>
     <view wx:if="{{item.type == 'video'}}">
-      <video id="newsVideo{{index}}" data-index="{{index}}" bindplay="play" style="width: 100%" src="{{item.url}}"></video>
+      <video custom-cache="{{false}}" id="newsVideo{{index}}" data-index="{{index}}" bindplay="play" wx:if="{{item && item.url}}" style="width: 100%" src="{{item.url}}"></video>
     </view>
     <view class="br"></view>
   </view>

+ 1 - 1
miniprogram/pages/interList/interList.wxml

@@ -4,7 +4,7 @@
 
     <view class="videoEle" wx:if="{{item.headUrl}}">
       <text wx:if="{{item.title}}" class="top">{{item.title}}</text>
-      <video class="video" wx:if="{{item.headUrl}}" src="{{item.headUrl}}"></video>
+      <video custom-cache="{{false}}" class="video" wx:if="{{item && item.headUrl}}" src="{{item.headUrl}}"></video>
       <text wx:if="{{item.creat_time}}" class="subTitle">发布日期 {{item.creat_time}}</text>
     </view>
     <view wx:if="{{!item.headUrl}}" bindtap="toDetail"  data-id="{{item._id}}" data-title="{{item.title}}">

+ 3 - 3
miniprogram/pages/marvellous/index.wxml

@@ -13,8 +13,8 @@
           <image style="background-color: #000" mode="aspectFit" wx:if="{{pageType === 'img'}}" class="img"
             src="{{v.url}}" lazy-load="{{true}}">
           </image>
-          <video show-progress="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}"
-            show-center-play-btn="{{false}}" bindlongtap="longtap" wx:if="{{pageType === 'video'}}" class="video {{}}"
+          <video custom-cache="{{false}}" show-progress="{{false}}" show-fullscreen-btn="{{false}}" show-play-btn="{{false}}"
+            show-center-play-btn="{{false}}" bindlongtap="longtap" wx:if="{{v && v.url && pageType === 'video'}}" class="video {{}}"
             src="{{v.url}}"></video>
         </view>
       </view>
@@ -28,6 +28,6 @@
   <!-- 视频 -->
   <view class="videoM " style="display: {{showVideo == '' ? 'none': 'block'}}">
     <mp-icon class="close" icon="close2" color="#fff" size="{{25}}" bindtap="closeVideo"></mp-icon>
-    <video show-play-btn="{{true}}" class="v" src="{{showVideo}}"></video>
+    <video custom-cache="{{false}}" show-play-btn="{{true}}" wx:if="{{showVideo}}" class="v" src="{{showVideo}}"></video>
   </view>
 </view>