Browse Source

首页顶部消息点击进入消息详情

xiaohaizhao 2 năm trước cách đây
mục cha
commit
c82b7a51e7
2 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 1 1
      pages/tabbar/home/index.wxml
  2. 2 0
      utils/FormatTheAttachment.js

+ 1 - 1
pages/tabbar/home/index.wxml

@@ -11,7 +11,7 @@
     </view>
 </view>
 <!-- 滚动通知 -->
-<van-notice-bar custom-class='notice-bar' mode="link" background="none" data-item="{{notice}}" background='#FCF6EF' color='#666' text="{{notice.message}}">
+<van-notice-bar custom-class='notice-bar' mode="link" background="none" data-item="{{notice}}" background='#FCF6EF' color='#666' text="{{notice.message}}"  bindtap="toMsg">
     <text slot="left-icon" data-item="{{notice}}" class="work work-xiaoxigundong" />
 </van-notice-bar>
 <!-- 轮播区域 -->

+ 2 - 0
utils/FormatTheAttachment.js

@@ -1,4 +1,5 @@
 function fileList(list) {
+	if (list.length == 0) return [];
     let suffixList = {
             image: ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'svg', 'tiff'],
             video: ['mp4', 'ogg', 'webm'],
@@ -13,6 +14,7 @@ function fileList(list) {
         typeList = [];
     for (let key in suffixList) typeList.push(key);
     for (let i = 0; i < list.length; i++) {
+        console.log(list[i])
         list[i].fileType = 'unknown';
         list[i].cover = `/static/image/file/unknown.png`
         const suffix = list[i].postfix.toLowerCase();