Browse Source

tabbar 首页更改

zhaoxiaohai 2 years ago
parent
commit
78fac18c9b
5 changed files with 465 additions and 651 deletions
  1. 2 24
      custom-tab-bar/index.js
  2. 349 366
      pages/tabbar/home/index.js
  3. 1 2
      pages/tabbar/home/index.json
  4. 90 201
      pages/tabbar/home/index.scss
  5. 23 58
      pages/tabbar/home/index.wxml

+ 2 - 24
custom-tab-bar/index.js

@@ -1,24 +1,9 @@
 const _Http = getApp().globalData.http;
 Component({
-    lifetimes: {
-        ready: function () {
-            if (this.data.count == 1) return;
-            if (wx.getStorageSync('userauth') != 0) {
-                //判断页面 以免一直触发
-                const pages = getCurrentPages(),
-                    prevPage = pages[pages.length - 1];
-                if (prevPage.route == 'pages/login/selectSite' || prevPage.route.includes('pages/tabbar/')) {
-                    const auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['营销物料']);
-                    if (auth.length == 1) this.setData({
-                        Permission: ['首页', '信息', '工作台', '营销物料', '我的']
-                    })
-                }
-            }
-        },
-    },
+    lifetimes: {},
     data: {
         active: 'home',
-        Permission: ['首页', '信息', '工作台', '我的'], //可看模块
+        Permission: ['首页', '信息', '我的'], //可看模块
         tabbarList: [{
                 icon: 'icon-a-biaoqianlanshouyexuanzhong',
                 acicon: 'icon-a-biaoqianlanshouyexuanzhong',
@@ -39,13 +24,6 @@ Component({
                 url: '/pages/tabbar/workbench/index',
                 name: 'workbench'
             },
-            {
-                icon: 'icon-a-biaoqianlanzhiku',
-                acicon: 'icon-xiaochengxu_yingxiaowuliaoxuanzhong',
-                text: '营销物料',
-                url: '/pages/tabbar/smartStore/index',
-                name: 'smartStore'
-            },
             {
                 icon: 'icon-a-biaoqianlanwode',
                 acicon: 'icon-a-biaoqianlanwodexuanzhong',

+ 349 - 366
pages/tabbar/home/index.js

@@ -1,369 +1,381 @@
-const _Http = getApp().globalData.http;
-let DataCarousel = null;
+let _Http = getApp().globalData.http,
+    DataCarousel = null;
 Page({
     data: {
+        appid: "wx08b337e860e3ea58",
         bannerList: [], //banner列表
-        user: {},
-        annunciateList: [], //通告列表
         gridList: [],
-        unreadNum: 0, //通告未读
         notice: "",
         msgCount: 1,
-        subassembly: [], //首页部件
         msgList: [], //消息列表
     },
     onLoad(options) {
-        this.refreshData() //更新权限等信息
         this.setData({ //获取胶囊位置信息
             capsule: wx.getMenuButtonBoundingClientRect()
         })
+        this.refreshData() //更新权限等信息
     },
     /* 更新站点信息 */
     refreshData() {
         this.setData({
             user: wx.getStorageSync('userMsg')
         })
-        /* 首页宫格授权查询 */
         if (wx.getStorageSync('userauth').length != 0) {
-            let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告', '推广素材', '商学院', '提报', '销售线索', '营销物料', '销售目标', '客户管理', '项目管理', '销售预测', '合同管理']),
-                gridList = [],
-                subassembly = [];
-            let authList = {};
-            auth.forEach(v => {
-                switch (v.systemmodulename) {
-                    case "通告":
-                        gridList.push({
-                            name: "通告",
-                            path: "/pages/annunciate/index",
-                            icon: "icon-a-shouyejingangqutonggao",
-                            apps: v.apps
-                        });
-                        if (v.apps[0].meta.wedgits.some(value => value.wedgit == 'homenoticelist')) subassembly.push('homenoticelist');
-                        this.setData({
-                            annunciateAuthList: v.apps[0].meta.auth.map(v => v.optionname)
-                        });
-                        break;
-                    case "推广素材":
-                        gridList.push({
-                            name: "推广素材",
-                            path: "/pages/promotional/index",
-                            icon: "icon-a-shouyejingangqutuiguangsucai",
-                            apps: v.apps
-                        })
-                        break;
-                    case "商学院":
-                        gridList.push({
-                            name: "商学院",
-                            path: "/pages/college/index",
-                            icon: "icon-a-shangxueyuanxuexi",
-                            apps: v.apps
-                        })
-                        break;
-                    case "提报":
-                        gridList.push({
-                            name: "提报",
-                            path: "/pages/submission/index",
-                            icon: "icon-a-tibaoguanlitibao",
-                            apps: v.apps
-                        })
-                        break;
-                    case "营销物料":
-                        gridList.push({
-                            name: "营销物料",
-                            path: "/pages/tabbar/smartStore/index",
-                            icon: "icon-a-shouyejingangquyingxiaowuliao",
-                            apps: v.apps
-                        })
-                        break;
-                    case "销售目标":
-                        gridList.push({
-                            name: "销售目标",
-                            path: "/packageA/target/index",
-                            icon: "icon-xiaochengxu_xiaoshoumubiao",
-                            apps: v.apps
-                        })
-                        break;
-                    case "公海线索":
-                        gridList.push({
-                            name: "公海线索",
-                            path: "/packageA/publicClue/index",
-                            icon: "icon-gonghaixiansuo",
-                            apps: v.apps
-                        })
-                        break;
-                        /* 二期应用分界线 */
-                    case "客户管理":
-                        v.apps.forEach(value => {
-                            switch (value.name) {
-                                //客户
-                                case "wCustomer":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "客户",
-                                        path: "/packageA/setclient/index",
-                                        icon: "icon-kehu",
-                                        apps: {}
-                                    })
-                                    authList.wCustomer = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                                    //公海客户
-                                case "wPublicCustomer":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "公海客户",
-                                        path: "/packageA/publicCustomer/index",
-                                        icon: "icon-xiaochengxutongxunlu",
-                                        apps: {}
-                                    })
-                                    authList.wPublicCustomer = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
+            let authList = {},
+                entrance = [{
+                    label: "通用",
+                    icon: "work-tongyong",
+                    appid: "wx08b337e860e3ea58",
+                    list: getapps()
+                }, {
+                    label: "营销工具",
+                    icon: "work-yingxiaogongju",
+                    appid: "wx08b337e860e3ea58",
+                    list: gettool()
+                }, {
+                    label: "CRM",
+                    appid: "wx08b337e860e3ea58",
+                    icon: "work-CRM",
+                    list: getcrm()
+                }, {
+                    label: "E-订单",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-dingdan",
+                    list: getedd()
+                }, {
+                    label: "E-服务",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-fuwu",
+                    list: geteservice()
+                }];
+            //通用
+            function getapps() {
+                const paths = [{
+                    name: "签到",
+                    path: "/packageA/clockIn/index",
+                    icon: "work-a-wodemendianxinxidizhi"
+                }, {
+                    name: "任务",
+                    path: "/packageA/work/index",
+                    icon: "work-a-woderenwuzhongxin"
+                }, {
+                    name: "通讯录",
+                    path: "/packageA/contacts/index",
+                    icon: "work-xiaochengxutongxunlu"
+                }];
+                let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']),
+                    list = [];
+                app.forEach((v, i) => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
                             }
-                        })
-                        break;
-                    case "项目管理":
-                        v.apps.forEach(value => {
-                            switch (value.name) {
-                                //项目商机
-                                case "wproject":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "项目商机",
-                                        path: "/packageA/project/index",
-                                        icon: "icon-xiangmushangji",
-                                        apps: {}
-                                    })
-                                    authList.wproject = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                                    //竞争对手
-                                case "wcompetitor":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "竞争对手",
-                                        path: "/packageA/opponent/index",
-                                        icon: "icon-jingzhengduishou",
-                                        apps: {}
-                                    })
-                                    authList.wcompetitor = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                                    //报价单
-                                case "woffer":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "报价单",
-                                        path: "/packageA/offers/index",
-                                        icon: "icon-xiangmubaojia",
-                                        apps: {}
-                                    })
-                                    authList.woffer = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                            };
-                        });
-                        break;
-                    case "销售线索":
-                        v.apps.forEach(value => {
-                            switch (value.name) {
-                                //销售线索
-                                case "worderclue":
-                                    if (value.meta.auth.some(r => r.option == 'read')) {
-                                        gridList.push({
-                                            name: "销售线索",
-                                            path: "/packageA/saleClue/index",
-                                            icon: "icon-xiaoshouxiansuo",
-                                            apps: {}
-                                        })
-                                        setTimeout(this.getCount, 100);
-                                    }
-                                    authList.worderclue = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                                    //公海线索
-                                case "worderclue_public":
-                                    if (value.meta.auth.some(r => r.option == 'read')) {
-                                        gridList.push({
-                                            name: "公海线索",
-                                            path: "/packageA/publicClue/index",
-                                            icon: "icon-xiaochengxu_xiaoshoumubiao",
-                                            apps: {}
-                                        })
-                                    }
-                                    authList.worderclue_public = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                                    //市场活动
-                                case "wmarketing_activity":
-                                    if (value.meta.auth.some(r => r.option == 'read')) {
-                                        gridList.push({
-                                            name: "市场活动",
-                                            path: "/packageA/activity/index",
-                                            icon: "icon-shichanghuodong",
-                                            apps: {}
-                                        })
-                                    }
-                                    authList.wmarketing_activity = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                            };
-                        });
-                        break;
-                    case "销售预测":
-                        v.apps.forEach(value => {
-                            switch (value.name) {
-                                //销售线索
-                                case "forecast":
-                                    if (value.meta.auth.some(r => r.option == 'read')) {
-                                        gridList.push({
-                                            name: "销售预测",
-                                            path: "/packageA/salesForecasting/index",
-                                            icon: "icon-xiaochengxu_xiaoshouyuce",
-                                            apps: {}
-                                        })
-                                    }
-                                    authList.forecast = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
-                            };
-                        });
-                        break;
-                    case "合同管理":
-                        v.apps.forEach(value => {
-                            switch (value.name) {
-                                //合同
-                                case "wcontract":
-                                    if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
-                                        name: "合同",
-                                        path: "/packageA/contract/index",
-                                        icon: "icon-hetong",
-                                        apps: {}
-                                    })
-                                    authList.wcontract = {
-                                        options: value.meta.auth.map(a => a.option),
-                                        optionnames: value.meta.auth.map(a => a.optionname),
-                                    }
-                                    break;
+                        }
+                    })
+                });
+                return dye(list)
+            }
+            //营销工具
+            function gettool() {
+                const paths = [{
+                    name: "通告",
+                    path: "/pages/annunciate/index",
+                    icon: "work-a-shouyejingangqutonggao"
+                }, {
+                    name: "营销物料",
+                    path: "/pages/mediaLibrary/index",
+                    icon: "work-a-shouyejingangquyingxiaowuliao"
+                }, {
+                    name: "推广素材",
+                    path: "/pages/promotional/index",
+                    icon: "work-a-shouyejingangqutuiguangsucai"
+                }, {
+                    name: "商学院",
+                    path: "/pages/college/index",
+                    icon: "work-a-shangxueyuanxuexi"
+                }, {
+                    name: "提报",
+                    path: "/pages/submission/index",
+                    icon: "work-a-tibaoguanlitibao"
+                }];
+                let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
+                    list = [];
+                tool.forEach(v => {
+                    let auth = v.apps[0].meta.auth;
+                    if (!auth.some(r => r.option == 'read')) return;
+                    authList[v.apps[0].name] = {
+                        options: auth.map(a => a.option),
+                        optionnames: auth.map(a => a.optionname)
+                    };
+                    let item = paths.find(s => s.name == v.systemmodulename);
+                    item && list.push(item)
+                });
+
+                return dye(list)
+            };
+            //CRM
+            function getcrm() {
+                const paths = [{
+                    name: "市场活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-shichanghuodong",
+                }, {
+                    name: "公海线索",
+                    path: "/packageA/publicClue/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao"
+                }, {
+                    name: "销售线索",
+                    path: "/packageA/saleClue/index",
+                    icon: "work-xiaoshouxiansuo"
+                }, {
+                    name: "公海客户",
+                    path: "/packageA/publicCustomer/index",
+                    icon: "work-gonghaikehu"
+                }, {
+                    name: "客户",
+                    path: "/packageA/setclient/index",
+                    icon: "work-kehu"
+                }, {
+                    name: "项目商机",
+                    path: "/packageA/project/index",
+                    icon: "work-xiangmushangji"
+                }, {
+                    name: "报价单",
+                    path: "/packageA/offers/index",
+                    icon: "work-xiangmubaojia"
+                }, {
+                    name: "竞争对手",
+                    path: "/packageA/opponent/index",
+                    icon: "work-jingzhengduishou"
+                }, {
+                    name: "合同",
+                    path: "/packageA/contract/index",
+                    icon: "work-hetong"
+                }, {
+                    name: "销售目标",
+                    path: "/packageA/target/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao"
+                }, {
+                    name: "销售预测",
+                    path: "/packageA/salesForecasting/index",
+                    icon: "work-xiaochengxu_xiaoshouyuce"
+                }];
+                let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['销售预测', '销售线索', '销售目标', '合同管理', '客户管理', '项目管理']),
+                    list = [];
+                crm.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
                             }
-                        })
-                        break;
-                    default:
-                        console.log(v);
-                        break;
-                };
-            });
-            wx.setStorageSync('auth', authList)
-            console.log(wx.getStorageSync('auth'))
-            gridList.push({
-                name: "联系人",
-                path: "/packageA/contacts/index",
-                icon: "icon-xiaochengxutongxunlu",
-                apps: {}
-            })
-            gridList.push({
-                name: "任务",
-                path: "/packageA/work/index",
-                icon: "icon-xiaochengxu_xiaoshouyuce",
-                apps: {}
-            })
-            gridList.push({
-                name: "签到",
-                path: "/packageA/clockIn/index",
-                icon: "icon-a-wodemendianxinxidizhi",
-                apps: {}
-            })
-            /* 首页小组件查询 */
-            try {
-                let home = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['首页'])[0].apps[0].meta.wedgits;
-                if (home.some(v => v.wedgit == 'homedatadisplay')) subassembly.push('homedatadisplay');
-            } catch (e) {
-                this.setData({
-                    gridList,
-                    subassembly: []
-                })
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E订单
+            function getedd() {
+                let paths = [{
+                    name: "商城",
+                    path: "/packageA/market/index",
+                    icon: "work-shangcheng"
+                }, {
+                    name: "销售订单",
+                    path: "/packageA/orderForm/index",
+                    icon: "work-dingdan"
+                }, {
+                    name: "收货",
+                    path: "/packageA/shipment/index",
+                    icon: "work-shouhuo"
+                }, {
+                    name: "业绩目标",
+                    path: "/packageA/target/index",
+                    icon: "work-yejimubiao"
+                }, {
+                    name: "账户",
+                    path: "/packageA/account/index",
+                    icon: "work-zhanghu"
+                }, {
+                    name: "促销活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-cuxiaohuodong"
+                }, {
+                    name: "工具查询",
+                    path: "/packageA/tool/index",
+                    icon: "work-gongjuchaxun"
+                }, {
+                    name: "购物车",
+                    path: "/packageA/shopping/index",
+                    icon: "work-gouwuche"
+                }, {
+                    name: "开票",
+                    path: "/packageA/invoice/index",
+                    icon: "work-kaipiao"
+                }, {
+                    name: "打款凭证",
+                    path: "/packageA/remitVoucher/index",
+                    icon: "work-dakuanpingzheng"
+                }, {
+                    name: "工具借用",
+                    path: "/packageA/borrow/index",
+                    icon: "work-shujuchaxun"
+                }, {
+                    name: "工具归还",
+                    path: "/packageA/toolBill/index",
+                    icon: "work-shujuchaxun"
+                }, {
+                    name: "居间费结算",
+                    path: "/packageA/betweenFee/index",
+                    icon: "work-jujianfeijiesuan"
+                }, ];
+                /* {
+                    name: "数据查询",
+                    path: "#",
+                    icon: "work-shujuchaxun"
+                } */
+                let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
+                    list = [];
+                edd.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E服务
+            function geteservice() {
+                let paths = [{
+                    name: "工单",
+                    path: "/Eservice/workOrder/index",
+                    icon: "work-gongdan"
+                }, {
+                    name: "申请单",
+                    path: "/Eservice/agent/serviceBillList/index",
+                    icon: "work-shenqingdan"
+                }, {
+                    name: "申请单管理",
+                    path: "/Eservice/workerLeader/serviceBillList/index",
+                    icon: "work-shenqingdanguanli"
+                }, {
+                    name: "业务员服务申请单",
+                    path: "/Eservice/saler/serviceBillList/index",
+                    icon: "work-yewuyuanfuwushenqingdan"
+                }];
+                let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
+                    list = [];
+                eservice.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
             }
+            //染色
+            function dye(list) {
+                let colorList = [{
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }];
+                return list.map((v, i) => {
+                    return {
+                        ...v,
+                        ...colorList[i > colorList.length - 1 ? i - colorList.length : i]
+                    }
+                })
+            };
+            wx.setStorageSync('auth', authList)
             this.setData({
-                gridList,
-                subassembly
+                entrance,
+                auth: JSON.stringify(authList),
+                userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
+                site: JSON.stringify(wx.getStorageSync('siteP'))
+            })
+
+            /* 获取首页banner */
+            let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
+            if (banner) this.setData({
+                bannerList: banner.ads
             })
         } else {
             setTimeout(this.refreshData, 10);
             return;
         }
-        /* 获取首页banner */
-        let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
-        if (banner) this.setData({
-            bannerList: banner.ads
-        })
-        this.queryNoticeList(0); //获取通告列表
-    },
-    /* 销售线索待办 */
-    getCount() {
-        const index = this.data.gridList.findIndex(v => v.name == '销售线索');
-        if (index == -1) return;
-        _Http.basic({
-            "classname": "saletool.orderclue.web.orderclue",
-            "method": "getCount",
-            "content": {
-                "nocache": true,
-                "status": "待跟进"
-            }
-        }, false).then(res => {
-            if (res.data.count == 0) res.data.count = '';
-            if (res.data.count > 99) res.data.count = '99+';
-            try {
-                this.data.gridList[index].count = res.data.count;
-            } catch (e) {
 
-            }
-            this.setData({
-                gridList: this.data.gridList
-            })
-        })
-    },
-    /* 查看通告详情 */
-    toAnnunciateDetails(e) {
-        const {
-            item
-        } = e.currentTarget.dataset;
-        let authList = this.data.annunciateAuthList;
-        wx.navigateTo({
-            url: `/pages/annunciate/details?id=${item.sat_noticeid}&auth=${authList}`,
-        })
-    },
-    /* 获取通告列表 */
-    queryNoticeList(i) {
-        if (i == 5) return;
-        let obj = this.data.gridList.find(v => v.name == '通告');
-        if (!obj || obj.apps.length == 0) return;
-        _Http.basic({
-            id: 20221111090904,
-            "content": {
-                "nocache": true,
-                "pageNumber": 1,
-                "pageSize": 3
-            }
-        }, false).then(res => {
-            if (res.msg != '成功') return this.queryNoticeList(i + 1);
-            this.setData({
-                annunciateList: res.data,
-                unreadNum: res.total - res.tips.readNum
-            })
-        });
     },
     /* 获取最新信息 */
     queryMessage(i = 0) {
@@ -401,22 +413,6 @@ Page({
             })
         }, 5000)
     },
-    /* 宫格区域应用程序 */
-    applications(e) {
-        const {
-            item
-        } = e.currentTarget.dataset;
-        const url = `${item.path}?auth=${JSON.stringify(item.apps)}`
-        if (item.name == "营销物料") {
-            wx.switchTab({
-                url
-            });
-        } else {
-            wx.navigateTo({
-                url
-            });
-        }
-    },
     /* 去消息详情 */
     toMsg(e) {
         const {
@@ -426,16 +422,6 @@ Page({
             url: '/pages/tabbar/message/details?id=' + item.messageid,
         })
     },
-    /* 去通告 */
-    toAnnunciate() {
-        this.applications({
-            currentTarget: {
-                dataset: {
-                    item: this.data.gridList.find(v => v.name == '通告')
-                }
-            }
-        })
-    },
     /* banner */
     bannerClick(e) {
         const {
@@ -449,12 +435,9 @@ Page({
     onShow() {
         this.getTabBar().init();
         if (this.data.msgList.length > 2) this.startDataCarousel();
-        this.getCount(); //更新徽标数据
         this.queryMessage(0); //更新最新消息
-        this.queryNoticeList(0); //获取通告列表
     },
     onHide() {
         clearInterval(DataCarousel);
     },
-    onShareAppMessage() {}
 })

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

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

+ 90 - 201
pages/tabbar/home/index.scss

@@ -1,213 +1,102 @@
 /* 顶部 */
 .header {
-    display: flex;
-    align-items: center;
-    width: 750rpx;
-    height: 88rpx;
-    background-color: var(--bgColor);
-
-    &_title {
-        height: 50rpx;
-        font-size: 36rpx;
-        font-family: PingFang SC-Bold, PingFang SC;
-        font-weight: bold;
-        color: #FFFFFF;
-        margin: 0 8rpx 0 24rpx;
-    }
+	display: flex;
+	align-items: center;
+	width: 750rpx;
+	height: 88rpx;
+	background-color: var(--bgColor);
+
+	&_title {
+			height: 50rpx;
+			font-size: 36rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+			margin: 0 8rpx 0 24rpx;
+	}
 }
-/* 轮播图区域 */
-.banner {
-    position: relative;
-    width: 750rpx;
-    height: 170rpx;
-    background-color: var(--bgColor);
-    padding-top: 24rpx;
-    // margin-bottom: 126rpx;
-
-    /* 椭圆底部 */
-    &_oval {
-        position: absolute;
-        height: 50px;
-        width: 100%;
-        top: 160rpx;
-        background-color: var(--bgColor);
-        border-radius: 0 0 100% 50% / 100%;
-    }
-
-    /* 主内容 */
-    &_content {
-        position: absolute;
-        width: 690rpx;
-        height: 300rpx;
-        background-color: #FFFFFF;
-        box-shadow: inset 0px 2rpx 0px 2rpx rgba(255, 255, 255, 0.16);
-        border-radius: 16rpx;
-        overflow: hidden;
-        margin: 0 !important;
-        left: 30rpx;
-
-        swiper-item {
-            width: 100%;
-            height: 100%;
-            border-radius: 16rpx;
-
 
-            image {
-                width: 100%;
-                height: 100%;
-                border-radius: 16rpx;
-            }
-        }
-    }
-}
 /* 滚动播放 */
-.scroll-area {
-    width: 690rpx;
-    height: 40rpx;
-    margin: 20rpx auto 0;
-
-    .notice-bar {
-        flex: 1;
-        height: 40rpx;
-        line-height: 50rpx;
-        padding: 0 !important;
-        margin: 0 !important;
-        font-size: 28rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #666666;
-
-        .iconfont {
-            color: #FA8C16;
-            margin-right: 20rpx;
-        }
-    }
+.notice-bar {
+	font-size: 28rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+
+	.work {
+			color: #FA8C16;
+			margin-right: 20rpx;
+	}
 }
-/* 宫格区域 */
-.grld {
-    display: flex;
-    flex-wrap: wrap;
-
-    .item {
-        position: relative;
-        width: 172rpx;
-        height: 170rpx;
-        box-sizing: border-box;
-        display: flex;
-        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;
-            font-size: 64rpx;
-            color: var(--assist);
-            margin-top: 30rpx;
-        }
-
-        text {
-            font-size: 28rpx;
-            font-family: PingFangSC-Regular-, PingFangSC-Regular;
-            color: #333333;
-            margin-top: 16rpx;
-        }
-    }
-}
-/* 概况 */
-.general-situation {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    width: 671.5rpx;
-    height: 40rpx;
-    margin: 32rpx auto 0;
-
-    .title {
-        font-size: 30rpx;
-        font-family: PingFang SC-Bold, PingFang SC;
-        font-weight: bold;
-        color: #333333;
-
-        text {
-            color: #FA8C16;
-        }
-    }
-
-    .time {
-        font-size: 24rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #999999;
-    }
-}
-/* 概况数据展示 */
-.data-display {
-    display: flex;
-    flex-wrap: wrap;
-    justify-content: space-around;
-    height: 290rpx;
-
-    .item {
-        width: 33.33%;
-        height: 100rpx;
-        margin-top: 30rpx;
-        text-align: center;
+/* 轮播图区域 */
+.banner {
+	height: 240rpx !important;
 
-        .label {
-            height: 34rpx;
-            line-height: 34rpx;
-            font-size: 24rpx;
-            font-family: PingFang SC-Regular, PingFang SC;
-            color: #999999;
-        }
+	swiper-item {
+			width: 100vw;
+			height: 240rpx !important;
 
-        .nubmer {
-            height: 50rpx;
-            line-height: 50rpx;
-            font-size: 36rpx;
-            font-family: PingFang SC-Bold, PingFang SC;
-            font-weight: bold;
-            color: #333333;
-            margin-top: 14rpx;
-        }
-    }
+			image {
+					width: 100vw;
+					height: 240rpx;
+			}
+	}
 }
-/* 通告 */
-.annunciate {
-    .unread {
-        display: flex;
-        align-items: center;
-        height: 34rpx;
-        font-size: 24rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #666666;
 
-        .circle {
-            width: 16rpx;
-            height: 16rpx;
-            background: #FF3B30;
-            border-radius: 50%;
-            margin: 4rpx 10rpx 0;
-        }
-
-        .icon {
-            margin-top: 3rpx;
-        }
-    }
-
-    .item-box {
-        padding: 20rpx 0;
-    }
+.grld {
+	width: 100vw;
+	background-color: #fff;
+	box-sizing: border-box;
+	padding-top: 30rpx;
+
+	.group {
+			margin-bottom: 30rpx;
+
+			.label {
+					height: 36rpx;
+					font-size: 30rpx;
+					font-family: AppleSystemUIFont-Bold, AppleSystemUIFont;
+					font-weight: bold;
+					color: #333333;
+					margin-bottom: 10rpx;
+
+					text {
+							margin: 0 20rpx 0 30rpx;
+					}
+			}
+
+			.main {
+					display: flex;
+					flex-wrap: wrap;
+
+					.item {
+							display: flex;
+							flex-direction: column;
+							align-items: center;
+							padding: 20rpx 0;
+							width: 20%;
+							border-radius: 16rpx;
+
+							.icon-box {
+									width: 80rpx;
+									border-radius: 16rpx;
+									line-height: 80rpx;
+									text-align: center;
+
+									text {
+											font-size: 40rpx;
+									}
+							}
+
+							.name {
+									width: 80%;
+									line-height: 30rpx;
+									font-size: 24rpx;
+									font-family: AppleSystemUIFont-Regular, AppleSystemUIFont;
+									color: #333333;
+									margin-top: 16rpx;
+									text-align: center;
+							}
+					}
+			}
+	}
 }

+ 23 - 58
pages/tabbar/home/index.wxml

@@ -10,64 +10,29 @@
         </navigator>
     </view>
 </view>
-
-<!-- 轮播区域 -->
-<view class="banner">
-    <view class="banner_oval" />
-    <swiper class='banner_content' autoplay circular>
-        <swiper-item wx:for="{{bannerList}}" wx:key="index">
-            <image src="{{item.attinfos[0].url}}" mode="aspectFill" data-item="{{item}}" catchtap="bannerClick" />
-        </swiper-item>
-    </swiper>
-</view>
-<view style="height: 130rpx;" />
 <!-- 滚动通知 -->
-<view class="scroll-area" data-item="{{notice}}" catchtap="toMsg" wx:if="{{notice}}">
-    <van-notice-bar custom-class='notice-bar' background="none" data-item="{{notice}}" color='#666' text="{{notice.message}}">
-        <text slot="left-icon" data-item="{{notice}}" class="iconfont icon-a-shouyexiaoxigundongquxiaoxi" />
-    </van-notice-bar>
-</view>
-<!-- 宫格区域 -->
-<My_card custom-class='grld'>
-    <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>
-<!-- 数据概况 
-<block wx:if="{{per.query(subassembly,'homedatadisplay')}}">
-    <view class="general-situation">
-        <view class="title">
-            <text class="iconfont icon-a-shouyeshujugaikuangzhanshishuju"></text>
-            数据概况
-        </view>
-        <view class="time">更新于:2022-02-12</view>
-    </view>
-    <My_card custom-class='data-display' hover>
-        <view class="item" wx:for="{{6}}" wx:key="index">
-            <view class="label">销售额(¥)</view>
-            <view class="nubmer">9999.99</view>
+<van-notice-bar custom-class='notice-bar' mode="link" background="none" data-item="{{notice}}" background='#FCF6EF' color='#666' text="{{notice.message}}">
+    <text slot="left-icon" data-item="{{notice}}" class="work work-xiaoxigundong" />
+</van-notice-bar>
+<!-- 轮播区域 -->
+<swiper class='banner' wx:if="{{bannerList.length}}" autoplay circular>
+    <swiper-item wx:for="{{bannerList}}" wx:key="index">
+        <image src="{{item.attinfos[0].url}}" mode="aspectFill" data-item="{{item}}" catchtap="bannerClick" />
+    </swiper-item>
+</swiper>
+<view class="grld">
+    <block wx:for="{{entrance}}" wx:key="index">
+        <view class="group" wx:if="{{item.list.length}}">
+            <view class="label"><text class="work {{item.icon}}" />{{item.label}}</view>
+            <view class="main">
+                <navigator version='trial' class="item" wx:for="{{item.list}}" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site}}" url="{{it.path}}" open-type="{{it.openType||'navigate'}}" wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
+                    <view class="icon-box" style="background-color: {{it.bColor}};">
+                        <text class="work {{it.icon}}" style="color: {{it.color}};" />
+                    </view>
+                    <view class="name">{{it.name}}</view>
+                </navigator>
+            </view>
         </view>
-    </My_card>
-</block>
--->
-<!-- 通告 -->
-<My_card wx:if="{{annunciateList.length>0 && per.query(subassembly,'homenoticelist')}}" title='最新通告' class="annunciate">
-    <view class="unread" slot='title-r' bindtap="toAnnunciate">
-        <block wx:if="{{unreadNum!=0}}">
-            {{unreadNum}}条未读
-            <view class="circle" />
-        </block>
-        <block wx:else>查看全部</block>
-        <van-icon class="icon" name="arrow" />
-    </view>
-    <block wx:for="{{annunciateList}}" wx:key="index">
-        <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-top: 1rpx solid #EEEEEE; margin-left: 30rpx;" />
     </block>
-</My_card>
-<view style="height: 140rpx;" />
-<wxs src='../../../utils/wxmlQueryPer.wxs' module="per" />
+</view>
+<view style="height: 160rpx;" />