zhaoxiaohai 3 лет назад
Родитель
Сommit
ef28b2c582
3 измененных файлов с 39 добавлено и 1 удалено
  1. 23 1
      pages/tabbar/home/index.js
  2. 15 0
      pages/tabbar/home/index.scss
  3. 1 0
      pages/tabbar/home/index.wxml

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

@@ -74,13 +74,14 @@ Page({
                         })
                         break;
                     case "销售线索":
-                        console.log(v.apps)
                         gridList.push({
                             name: "销售线索",
                             path: "/pages/threadedTree/index",
                             icon: "icon-xiaoshouxiansuo",
                             apps: v.apps
                         })
+                        //获取销售线索待办数量
+                        setTimeout(this.getCount, 100);
                         break;
                 };
             });
@@ -100,6 +101,26 @@ Page({
         this.queryNoticeList(0); //获取通告列表
         this.queryMessage(0)
     },
+    /* 销售线索待办 */
+    getCount() {
+        const index = this.data.gridList.findIndex(v => v.name == '销售线索');
+        if (!index) return;
+        _Http.basic({
+            "classname": "saletool.orderclue.web.orderclue",
+            "method": "getCount",
+            "content": {
+                "nocache": true,
+                "status": "待跟进"
+            }
+        }).then(res => {
+            if (res.data.count == 0) return;
+            if (res.data.count > 99) res.data.count = '99+';
+            this.data.gridList[index].count = res.data.count;
+            this.setData({
+                gridList: this.data.gridList
+            })
+        })
+    },
     /* 查看通告详情 */
     toAnnunciateDetails(e) {
         const {
@@ -206,6 +227,7 @@ Page({
     onShow() {
         this.getTabBar().init();
         this.startDataCarousel();
+        this.getCount(); //更新徽标数据
     },
     /**
      * 生命周期函数--监听页面隐藏

+ 15 - 0
pages/tabbar/home/index.scss

@@ -91,6 +91,7 @@
     flex-wrap: wrap;
 
     .item {
+        position: relative;
         width: 172rpx;
         height: 170rpx;
         box-sizing: border-box;
@@ -98,6 +99,20 @@
         flex-direction: column;
         align-items: center;
 
+        .badge {
+            position: absolute;
+            height: 32rpx;
+            line-height: 30rpx;
+            padding: 0 12rpx;
+            border-radius: 16rpx;
+            background-color: red;
+            font-size: 20rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #FFFFFF;
+            top: 10rpx;
+            right: 20rpx;
+        }
+
         .iconfont {
             height: 64rpx;
             line-height: 64rpx;

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

@@ -31,6 +31,7 @@
     <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>
     </navigator>
 </My_card>
 <!-- 数据概况 -->