zhaoxiaohai 3 anos atrás
pai
commit
3c40f0b84f
2 arquivos alterados com 37 adições e 8 exclusões
  1. 30 1
      pages/tabbar/home/index.js
  2. 7 7
      pages/tabbar/home/index.wxml

+ 30 - 1
pages/tabbar/home/index.js

@@ -6,6 +6,7 @@ Page({
      */
     data: {
         user: {},
+        annunciateList: [], //通告列表
         gridList: [{
             name: "通告",
             path: "/pages/annunciate/index",
@@ -33,8 +34,36 @@ Page({
         this.setData({ //获取胶囊位置信息
             capsule: wx.getMenuButtonBoundingClientRect()
         })
+        this.queryNoticeList(0); //获取通告列表
     },
-    /* 更新数据 */
+    /* 查看通告详情 */
+    toAnnunciateDetails(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: '/pages/annunciate/details?item=' + JSON.stringify(item),
+        })
+    },
+    /* 获取通告列表 */
+    queryNoticeList(i) {
+        if (i == 5) return;
+        _Http.basic({
+            "classname": "saletool.notice.notice",
+            "method": "queryNoticeList",
+            "content": {
+                "pageNumber": 1,
+                "pageSize": 3
+            }
+        }).then(res => {
+            console.log("通告列表", res)
+            if (res.msg != '成功') return this.queryNoticeList(i + 1);
+            this.setData({
+                annunciateList: res.data
+            })
+        })
+    },
+    /* 更新站点信息 */
     refreshData(item) {
         this.setData({
             user: item

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

@@ -59,23 +59,23 @@
     <view class="annunciate_banner">
         banner占位
     </view>
-    <navigator url="/pages/annunciate/details" wx:for="{{3}}">
+    <navigator url="#" wx:for="{{annunciateList}}" data-item="{{item}}" bindtap="toAnnunciateDetails">
         <view class="item">
-            <view class="title line-1">五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动</view>
-            <view class="explain line-1">五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动五一劳动节活动</view>
+            <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' color="#FF3B30" plain>政策公告</van-tag>
-                    <view class="time">发布于:2022-10-12</view>
+                    <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" />
-                        附件:1
+                        附件:{{item.attinfos.length}}
                     </view>
                     <view class="incidental_r_item">
                         <text class="iconfont icon-a-tonggaoliulanliang" />
-                        200
+                        {{item.readcount}}
                     </view>
                 </view>
             </view>