Browse Source

首页通告列表

zhaoxiaohai 3 years ago
parent
commit
eb95c38136
3 changed files with 11 additions and 71 deletions
  1. 2 1
      pages/tabbar/home/index.json
  2. 2 44
      pages/tabbar/home/index.scss
  3. 7 26
      pages/tabbar/home/index.wxml

+ 2 - 1
pages/tabbar/home/index.json

@@ -1,6 +1,7 @@
 {
     "usingComponents": {
-        "van-notice-bar": "@vant/weapp/notice-bar/index"
+        "van-notice-bar": "@vant/weapp/notice-bar/index",
+        "Item": "../../annunciate/modules/list"
     },
     "navigationStyle": "custom"
 }

+ 2 - 44
pages/tabbar/home/index.scss

@@ -1,5 +1,3 @@
-@import "../../annunciate/incidental.scss";//通告底部样式
-
 /* 顶部 */
 .header {
     display: flex;
@@ -183,47 +181,7 @@
         }
     }
 
-    &_banner {
-        width: 630rpx;
-        height: 160rpx;
-        border-radius: 16rpx;
-        box-sizing: border-box;
-        border: 1px solid aqua;
-        margin: 20rpx auto 0;
-    }
-
-    navigator {
-        width: 100%;
-        padding-top: 20rpx;
-        padding-left: 20rpx;
-
-        .item {
-            width: calc(100%-20rpx);
-            height: 150rpx;
-            border-bottom: 2rpx solid #eeeeee;
-
-            .title {
-                width: 650rpx;
-                height: 40rpx;
-                line-height: 40rpx;
-                font-size: 28rpx;
-                font-family: PingFang SC-Bold, PingFang SC;
-                font-weight: bold;
-                color: #333333;
-            }
-
-            .explain {
-                width: 640rpx;
-                height: 34rpx;
-                font-size: 24rpx;
-                font-family: PingFang SC-Regular, PingFang SC;
-                color: #666666;
-                margin-top: 10rpx;
-            }
-        }
-    }
-
-    navigator:last-child .item {
-        border: none;
+    .item-box{
+        padding: 20rpx 0;
     }
 }

+ 7 - 26
pages/tabbar/home/index.wxml

@@ -50,37 +50,18 @@
 </My_card>
 
 <!-- 通告 -->
-<My_card title='最新通告' class="annunciate">
+<My_card wx:if="{{annunciateList.length>0}}" title='最新通告' class="annunciate">
     <view class="unread" slot='title-r' bindtap="toAnnunciate">
         12条未读
         <view class="circle" />
         <van-icon class="icon" name="arrow" />
     </view>
-    <view class="annunciate_banner">
-        banner占位
-    </view>
-    <navigator url="#" wx:for="{{annunciateList}}" data-item="{{item}}" bindtap="toAnnunciateDetails">
-        <view class="item">
-            <view class="title line-1">{{item.title}}</view>
-            <view class="explain line-1">{{item.summary}}</view>
-            <view class="incidental">
-                <view class="incidental_l">
-                    <van-tag custom-class='tag line-1' color="#FF3B30" plain>{{item.classname}}</van-tag>
-                    <view class="time">发布于:{{item.createdate}}</view>
-                </view>
-                <view class="incidental_r">
-                    <view class="incidental_r_item">
-                        <text class="iconfont icon-a-tonggaofujian" />
-                        附件:{{item.attinfos.length}}
-                    </view>
-                    <view class="incidental_r_item">
-                        <text class="iconfont icon-a-tonggaoliulanliang" />
-                        {{item.readcount}}
-                    </view>
-                </view>
-            </view>
-        </view>
-    </navigator>
+    <block wx:for="{{annunciateList}}">
+        <navigator url="#" class="item-box" data-item="{{item}}" bindtap="toAnnunciateDetails">
+            <Item item='{{item}}' />
+        </navigator>
+        <view wx:if="{{index!=annunciateList.length-1}}" style="width: 100%; border: 1rpx solid #EEEEEE; margin-left: 30rpx;" />
+    </block>
 </My_card>
 
 <view style="height: 140rpx;" />