zhaoxiaohai 2 rokov pred
rodič
commit
1d986fa679
2 zmenil súbory, kde vykonal 13 pridanie a 10 odobranie
  1. 8 5
      pages/tabbar/home/index.js
  2. 5 5
      pages/tabbar/home/index.wxml

+ 8 - 5
pages/tabbar/home/index.js

@@ -21,16 +21,15 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        //this.getTabBar().monitor();开启socket监听
-        this.refreshData(wx.getStorageSync('userMsg')) //更新权限等信息
+        this.refreshData() //更新权限等信息
         this.setData({ //获取胶囊位置信息
             capsule: wx.getMenuButtonBoundingClientRect()
         })
     },
     /* 更新站点信息 */
-    refreshData(item) {
+    refreshData() {
         this.setData({
-            user: item
+            user: wx.getStorageSync('userMsg')
         })
         /* 首页宫格授权查询 */
         if (wx.getStorageSync('userauth').length != 0) {
@@ -138,10 +137,13 @@ Page({
     /* 获取通告列表 */
     queryNoticeList(i) {
         if (i == 5) return;
+        let obj = this.data.gridList.find(v => v.name == '通告');
+        if (!obj || obj.apps.length == 0) return;
         _Http.basic({
             "classname": "saletool.notice.notice",
             "method": "queryNoticeList",
             "content": {
+                "nocache": true,
                 "pageNumber": 1,
                 "pageSize": 3
             }
@@ -151,7 +153,7 @@ Page({
                 annunciateList: res.data,
                 unreadNum: res.total - res.tips.readNum
             })
-        })
+        });
     },
     /* 获取最新信息 */
     queryMessage(i = 0) {
@@ -231,6 +233,7 @@ Page({
         if (this.data.msgList.length > 2) this.startDataCarousel();
         this.getCount(); //更新徽标数据
         this.queryMessage(0); //更新最新消息
+        this.queryNoticeList(0); //获取通告列表
     },
     onHide() {
         clearInterval(DataCarousel);

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

@@ -13,8 +13,8 @@
 <!-- 轮播区域 -->
 <view class="banner">
     <view class="banner_oval" />
-    <swiper class='banner_content'>
-        <swiper-item wx:for="{{bannerList}}">
+    <swiper class='banner_content' autoplay circular>
+        <swiper-item wx:for="{{bannerList}}" wx:key="index">
             <image src="{{item.attinfos[0].url}}" mode="aspectFill" data-hyperlink="{{item.hyperlink}}" catchtap="bannerClick" />
         </swiper-item>
     </swiper>
@@ -28,7 +28,7 @@
 </view>
 <!-- 宫格区域 -->
 <My_card custom-class='grld'>
-    <navigator url="#" class="item" wx:for="{{gridList}}" wx:key="{{index}}" data-item="{{item}}" catchtap="applications">
+    <navigator url="#" class="item" wx:for="{{gridList}}" wx:key="index" data-item="{{item}}" catchtap="applications">
         <view class="iconfont {{item.icon}}" />
         <text>{{item.name}}</text>
         <view wx:if="{{item.count}}" class="badge">{{item.count}}</view>
@@ -44,7 +44,7 @@
         <view class="time">更新于:2022-02-12</view>
     </view>
     <My_card custom-class='data-display' hover>
-        <view class="item" wx:for="{{6}}">
+        <view class="item" wx:for="{{6}}" wx:key="index">
             <view class="label">销售额(¥)</view>
             <view class="nubmer">9999.99</view>
         </view>
@@ -61,7 +61,7 @@
         <block wx:else>查看全部</block>
         <van-icon class="icon" name="arrow" />
     </view>
-    <block wx:for="{{annunciateList}}">
+    <block wx:for="{{annunciateList}}" wx:key="index">
         <navigator url="#" class="item-box" data-item="{{item}}" bindtap="toAnnunciateDetails">
             <Item item='{{item}}' />
         </navigator>