Bläddra i källkod

登录是否初始密码判断

xiaohaizhao 1 år sedan
förälder
incheckning
7f1c5c8dbe
4 ändrade filer med 537 tillägg och 516 borttagningar
  1. 2 0
      pages/login/modules/account.js
  2. 2 0
      pages/login/modules/phone.js
  3. 2 0
      pages/login/phone.js
  4. 531 516
      pages/tabbar/home/index.js

+ 2 - 0
pages/login/modules/account.js

@@ -68,6 +68,8 @@ Component({
                     password: (this.data.memory) ? this.data.password : ''
                 })
                 loginMsg.loginMsg(res);
+                console.log('是否为初始密码', res.remindchangepassword == 1)
+                getApp().globalData.remindchangepassword = res.remindchangepassword == 1;
             })
         }
     }

+ 2 - 0
pages/login/modules/phone.js

@@ -91,6 +91,8 @@ Component({
                     phonenumber: (this.data.memory) ? this.data.phonenumber : ''
                 })
                 loginMsg.loginMsg(res);
+                console.log('是否为初始密码', res.remindchangepassword == 1)
+                getApp().globalData.remindchangepassword = res.remindchangepassword == 1;
             })
         },
         /* 是否记忆密码 */

+ 2 - 0
pages/login/phone.js

@@ -35,6 +35,8 @@ Page({
 							icon: "none"
 						})
 						loginMsg.loginMsg(res);
+						console.log('是否为初始密码', res.remindchangepassword == 1)
+						getApp().globalData.remindchangepassword = res.remindchangepassword == 1;
 					})
 				} else {
 					console.log('登录失败!' + res.errMsg)

+ 531 - 516
pages/tabbar/home/index.js

@@ -1,521 +1,536 @@
 let _Http = getApp().globalData.http,
-	DataCarousel = null;
+  DataCarousel = null;
 Page({
-	data: {
-		appid: wx.getStorageSync('appid'),
-		bannerList: [], //banner列表
-		gridList: [],
-		notice: "",
-		msgCount: 1,
-		msgList: [], //消息列表
-	},
-	onLoad(options) {
-		this.setData({ //获取胶囊位置信息
-			capsule: wx.getMenuButtonBoundingClientRect()
-		})
-		this.refreshData() //更新权限等信息
-		this.getTabBar().unReadMessageCount(); //更新信息数量
-		let history = getApp().globalData.LaunchOptions;
-		if (history && !getCurrentPages().some(v => v.__route__ == history.path)) {
-			let url = `/${history.path}?`;
-			for (const key in history.query) {
-				url += `${key}=${history.query[key]}&`
-			}
-			wx.navigateTo({
-				url,
-				success(res) {
-					wx.showToast({
-						title: '已恢复页面',
-						icon: "none"
-					});
-					getApp().globalData.LaunchOptions = null;
-				}
-			})
-		}
-	},
-	/* 更新站点信息 */
-	refreshData() {
-		this.setData({
-			user: wx.getStorageSync('userMsg')
-		})
-		if (wx.getStorageSync('userauth').length != 0) {
-			let authList = {},
-				entrance = [{
-					label: "通用",
-					icon: "work-tongyong",
-					appid: "wx197f219a82a89d7b",
-					list: getapps()
-				}, {
-					label: "E-订单",
-					appid: "wxc1b6ae925ac1d06a",
-					icon: "work-E-dingdan",
-					list: getedd()
-				}, {
-					label: "E-服务",
-					appid: "wxc1b6ae925ac1d06a",
-					icon: "work-E-fuwu",
-					list: geteservice()
-				}, {
-					label: "营销工具",
-					icon: "work-yingxiaogongju",
-					appid: "wx197f219a82a89d7b",
-					list: gettool()
-				}, {
-					label: "CRM",
-					appid: "wx197f219a82a89d7b",
-					icon: "work-CRM",
-					list: getcrm()
-				}];
-			//通用
-			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"
-				}, {
-					name: "工作汇报",
-					path: "/packageA/report/index",
-					icon: "work-gongzuohuibao"
-				}, {
-					name: "作业看板",
-					path: "/packageA/achievement/index",
-					icon: "work-zuoyekanban"
-				}, {
-					name: "销售沙漏",
-					path: "/packageA/salesHourglass/index",
-					icon: "work-xiaoshouloudou"
-				}];
-				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])
-							}
-						}
-					})
-				});
-				return dye(list)
-			}
-			//营销工具
-			function gettool() {
-				const paths = [{
-					name: "通告",
-					path: "/pages/annunciate/index",
-					icon: "work-a-shouyejingangqutonggao",
-					objectname: "sat_notice"
-				}, {
-					name: "营销物料",
-					path: "/pages/mediaLibrary/index",
-					icon: "work-a-shouyejingangquyingxiaowuliao",
-					objectname: "sys_attachment"
-				}, {
-					name: "推广素材",
-					path: "/pages/promotional/index",
-					icon: "work-a-shouyejingangqutuiguangsucai",
-					objectname: "sat_sharematerial"
-				}, {
-					name: "商学院",
-					path: "/pages/college/index",
-					icon: "work-a-shangxueyuanxuexi",
-					objectname: "sat_courseware"
-				}, {
-					name: "提报",
-					path: "/pages/submission/index",
-					icon: "work-a-tibaoguanlitibao",
-					objectname: "sat_submiteditmodel"
-				}];
-				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)
-				});
+  data: {
+    appid: wx.getStorageSync('appid'),
+    bannerList: [], //banner列表
+    gridList: [],
+    notice: "",
+    msgCount: 1,
+    msgList: [], //消息列表
+  },
+  onLoad(options) {
+    this.setData({ //获取胶囊位置信息
+      capsule: wx.getMenuButtonBoundingClientRect()
+    })
+    this.refreshData() //更新权限等信息
+    this.getTabBar().unReadMessageCount(); //更新信息数量
+    let history = getApp().globalData.LaunchOptions;
+    if (history && !getCurrentPages().some(v => v.__route__ == history.path)) {
+      let url = `/${history.path}?`;
+      for (const key in history.query) {
+        url += `${key}=${history.query[key]}&`
+      }
+      wx.navigateTo({
+        url,
+        success(res) {
+          wx.showToast({
+            title: '已恢复页面',
+            icon: "none"
+          });
+          getApp().globalData.LaunchOptions = null;
+        }
+      })
+    }
+    //查询密码是否为初始状态
+    if (getApp().globalData.remindchangepassword) wx.showModal({
+      title: "提示",
+      content: "当前密码为初始密码,请前往修改密码",
+      confirmText: '前往修改',
+      cancelText: "下次再说",
+      success: ({
+        confirm
+      }) => {
+        getApp().globalData.remindchangepassword = null;
+        if (confirm) wx.navigateTo({
+          url: '/pages/tabbar/mine/changePassword/index',
+        })
+      },
+    })
+  },
+  /* 更新站点信息 */
+  refreshData() {
+    this.setData({
+      user: wx.getStorageSync('userMsg')
+    })
+    if (wx.getStorageSync('userauth').length != 0) {
+      let authList = {},
+        entrance = [{
+          label: "通用",
+          icon: "work-tongyong",
+          appid: "wx197f219a82a89d7b",
+          list: getapps()
+        }, {
+          label: "E-订单",
+          appid: "wxc1b6ae925ac1d06a",
+          icon: "work-E-dingdan",
+          list: getedd()
+        }, {
+          label: "E-服务",
+          appid: "wxc1b6ae925ac1d06a",
+          icon: "work-E-fuwu",
+          list: geteservice()
+        }, {
+          label: "营销工具",
+          icon: "work-yingxiaogongju",
+          appid: "wx197f219a82a89d7b",
+          list: gettool()
+        }, {
+          label: "CRM",
+          appid: "wx197f219a82a89d7b",
+          icon: "work-CRM",
+          list: getcrm()
+        }];
+      //通用
+      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"
+        }, {
+          name: "工作汇报",
+          path: "/packageA/report/index",
+          icon: "work-gongzuohuibao"
+        }, {
+          name: "作业看板",
+          path: "/packageA/achievement/index",
+          icon: "work-zuoyekanban"
+        }, {
+          name: "销售漏斗",
+          path: "/packageA/salesHourglass/index",
+          icon: "work-xiaoshouloudou"
+        }];
+        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])
+              }
+            }
+          })
+        });
+        return dye(list.sort((a, b) => a.index - b.index))
+      }
+      //营销工具
+      function gettool() {
+        const paths = [{
+          name: "通告",
+          path: "/pages/annunciate/index",
+          icon: "work-a-shouyejingangqutonggao",
+          objectname: "sat_notice"
+        }, {
+          name: "营销物料",
+          path: "/pages/mediaLibrary/index",
+          icon: "work-a-shouyejingangquyingxiaowuliao",
+          objectname: "sys_attachment"
+        }, {
+          name: "推广素材",
+          path: "/pages/promotional/index",
+          icon: "work-a-shouyejingangqutuiguangsucai",
+          objectname: "sat_sharematerial"
+        }, {
+          name: "商学院",
+          path: "/pages/college/index",
+          icon: "work-a-shangxueyuanxuexi",
+          objectname: "sat_courseware"
+        }, {
+          name: "提报",
+          path: "/pages/submission/index",
+          icon: "work-a-tibaoguanlitibao",
+          objectname: "sat_submiteditmodel"
+        }];
+        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",
-					objectname: "sat_campaign"
-				}, {
-					name: "公海线索",
-					path: "/packageA/publicClue/index",
-					icon: "work-xiaochengxu_xiaoshoumubiao",
-					objectname: "sat_orderclue"
-				}, {
-					name: "销售线索",
-					path: "/packageA/saleClue/index",
-					icon: "work-xiaoshouxiansuo",
-					objectname: "sat_orderclue"
-				}, {
-					name: "公海客户",
-					path: "/packageA/publicCustomer/index",
-					icon: "work-gonghaikehu",
-					objectname: "sa_customers"
-				}, {
-					name: "我的客户",
-					path: "/packageA/setclient/index",
-					icon: "work-kehu",
-					objectname: "sa_customers"
-				}, {
-					name: "项目商机",
-					path: "/packageA/project/index",
-					icon: "work-xiangmushangji",
-					objectname: "sa_project"
-				}, {
-					name: "报价单",
-					path: "/packageA/offers/index",
-					icon: "work-xiangmubaojia",
-					objectname: "sa_quotedprice"
-				}, {
-					name: "竞争对手",
-					path: "/packageA/opponent/index",
-					icon: "work-jingzhengduishou",
-					objectname: "sa_competitor"
-				}, {
-					name: "合同",
-					path: "/packageA/contract/index",
-					icon: "work-hetong",
-					objectname: "sa_contract"
-				}, {
-					name: "销售目标",
-					path: "/packageA/target/index",
-					icon: "work-xiaochengxu_xiaoshoumubiao",
-					objectname: "sa_salestarget"
-				}, {
-					name: "销售预测",
-					path: "/packageA/salesForecasting/index",
-					icon: "work-xiaochengxu_xiaoshouyuce",
-					objectname: "sa_salesforecastbill"
-				}];
-				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])
-							}
-						}
-					})
-				});
-				return dye(list.sort((a, b) => a.index - b.index))
-			};
-			//E订单
-			function getedd() {
-				let paths = [{
-					name: "商城",
-					path: "/packageA/market/index",
-					icon: "work-shangcheng",
-					objectname: "sa_itemgroup"
-				}, {
-					name: "销售订单",
-					path: "/packageA/orderForm/index",
-					icon: "work-dingdan",
-					objectname: "sa_order"
-				}, {
-					name: "收货",
-					path: "/packageA/shipment/index",
-					icon: "work-shouhuo",
-					objectname: "sa_logistics"
-				}, {
-					name: "业绩目标",
-					path: "/packageA/target/index",
-					icon: "work-yejimubiao"
-				}, {
-					name: "账户",
-					path: "/packageA/account/index",
-					icon: "work-zhanghu",
-					objectname: "sa_accountbalance"
-				}, {
-					name: "促销活动",
-					path: "/packageA/activity/index",
-					icon: "work-cuxiaohuodong",
-					objectname: "sa_promotion"
-				}, {
-					name: "工具查询",
-					path: "/packageA/tool/index",
-					icon: "work-gongjuchaxun"
-				}, {
-					name: "购物车",
-					path: "/packageA/shopping/index",
-					icon: "work-gouwuche"
-				}, {
-					name: "开票",
-					path: "/packageA/invoice/index",
-					icon: "work-kaipiao",
-					objectname: "sa_invoiceapplyid"
-				}, {
-					name: "打款凭证",
-					path: "/packageA/remitVoucher/index",
-					icon: "work-dakuanpingzheng"
-				}, {
-					name: "工具借用",
-					path: "/packageA/borrow/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_order"
-				}, {
-					name: "工具归还",
-					path: "/packageA/toolBill/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_order"
-				}, {
-					name: "退返申请",
-					path: "/packageA/returnOne/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_aftersalesmag"
-				}, {
-					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",
-					objectname: "sa_workorder"
-				}, {
-					name: "申请单",
-					path: "/Eservice/agent/serviceBillList/index",
-					icon: "work-shenqingdan",
-					// objectname: "sa_serviceorder"
-				}, {
-					name: "申请单管理",
-					path: "/Eservice/workerLeader/serviceBillList/index",
-					icon: "work-shenqingdanguanli",
-					// objectname: "sa_serviceorder"
-				}, {
-					name: "业务员服务申请单",
-					path: "/Eservice/saler/serviceBillList/index",
-					icon: "work-yewuyuanfuwushenqingdan",
-					// objectname: "sa_serviceorder"
-				}];
-				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({
-				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
-			})
-			//用于消息跳转对照权限以及路径
-			wx.setStorageSync('authComparison', entrance.map(v => {
-				v = v.list.map(s => {
-					s.appid = v.appid;
-					return s
-				})
-				return v
-			}).flat())
-		} else {
-			setTimeout(this.refreshData, 10);
-			return;
-		}
+        return dye(list)
+      };
+      //CRM
+      function getcrm() {
+        const paths = [{
+          name: "市场活动",
+          path: "/packageA/activity/index",
+          icon: "work-shichanghuodong",
+          objectname: "sat_campaign"
+        }, {
+          name: "公海线索",
+          path: "/packageA/publicClue/index",
+          icon: "work-xiaochengxu_xiaoshoumubiao",
+          objectname: "sat_orderclue"
+        }, {
+          name: "销售线索",
+          path: "/packageA/saleClue/index",
+          icon: "work-xiaoshouxiansuo",
+          objectname: "sat_orderclue"
+        }, {
+          name: "公海客户",
+          path: "/packageA/publicCustomer/index",
+          icon: "work-gonghaikehu",
+          objectname: "sa_customers"
+        }, {
+          name: "我的客户",
+          path: "/packageA/setclient/index",
+          icon: "work-kehu",
+          objectname: "sa_customers"
+        }, {
+          name: "项目商机",
+          path: "/packageA/project/index",
+          icon: "work-xiangmushangji",
+          objectname: "sa_project"
+        }, {
+          name: "报价单",
+          path: "/packageA/offers/index",
+          icon: "work-xiangmubaojia",
+          objectname: "sa_quotedprice"
+        }, {
+          name: "竞争对手",
+          path: "/packageA/opponent/index",
+          icon: "work-jingzhengduishou",
+          objectname: "sa_competitor"
+        }, {
+          name: "合同",
+          path: "/packageA/contract/index",
+          icon: "work-hetong",
+          objectname: "sa_contract"
+        }, {
+          name: "销售目标",
+          path: "/packageA/target/index",
+          icon: "work-xiaochengxu_xiaoshoumubiao",
+          objectname: "sa_salestarget"
+        }, {
+          name: "销售预测",
+          path: "/packageA/salesForecasting/index",
+          icon: "work-xiaochengxu_xiaoshouyuce",
+          objectname: "sa_salesforecastbill"
+        }];
+        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])
+              }
+            }
+          })
+        });
+        return dye(list.sort((a, b) => a.index - b.index))
+      };
+      //E订单
+      function getedd() {
+        let paths = [{
+          name: "商城",
+          path: "/packageA/market/index",
+          icon: "work-shangcheng",
+          objectname: "sa_itemgroup"
+        }, {
+          name: "销售订单",
+          path: "/packageA/orderForm/index",
+          icon: "work-dingdan",
+          objectname: "sa_order"
+        }, {
+          name: "收货",
+          path: "/packageA/shipment/index",
+          icon: "work-shouhuo",
+          objectname: "sa_logistics"
+        }, {
+          name: "业绩目标",
+          path: "/packageA/target/index",
+          icon: "work-yejimubiao"
+        }, {
+          name: "账户",
+          path: "/packageA/account/index",
+          icon: "work-zhanghu",
+          objectname: "sa_accountbalance"
+        }, {
+          name: "促销活动",
+          path: "/packageA/activity/index",
+          icon: "work-cuxiaohuodong",
+          objectname: "sa_promotion"
+        }, {
+          name: "工具查询",
+          path: "/packageA/tool/index",
+          icon: "work-gongjuchaxun"
+        }, {
+          name: "购物车",
+          path: "/packageA/shopping/index",
+          icon: "work-gouwuche"
+        }, {
+          name: "开票",
+          path: "/packageA/invoice/index",
+          icon: "work-kaipiao",
+          objectname: "sa_invoiceapplyid"
+        }, {
+          name: "打款凭证",
+          path: "/packageA/remitVoucher/index",
+          icon: "work-dakuanpingzheng"
+        }, {
+          name: "工具借用",
+          path: "/packageA/borrow/index",
+          icon: "work-shujuchaxun",
+          objectname: "sa_order"
+        }, {
+          name: "工具归还",
+          path: "/packageA/toolBill/index",
+          icon: "work-shujuchaxun",
+          objectname: "sa_order"
+        }, {
+          name: "退返申请",
+          path: "/packageA/returnOne/index",
+          icon: "work-shujuchaxun",
+          objectname: "sa_aftersalesmag"
+        }, {
+          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",
+          objectname: "sa_workorder"
+        }, {
+          name: "申请单",
+          path: "/Eservice/agent/serviceBillList/index",
+          icon: "work-shenqingdan",
+          // objectname: "sa_serviceorder"
+        }, {
+          name: "申请单管理",
+          path: "/Eservice/workerLeader/serviceBillList/index",
+          icon: "work-shenqingdanguanli",
+          // objectname: "sa_serviceorder"
+        }, {
+          name: "业务员服务申请单",
+          path: "/Eservice/saler/serviceBillList/index",
+          icon: "work-yewuyuanfuwushenqingdan",
+          // objectname: "sa_serviceorder"
+        }];
+        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({
+        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
+      })
+      //用于消息跳转对照权限以及路径
+      wx.setStorageSync('authComparison', entrance.map(v => {
+        v = v.list.map(s => {
+          s.appid = v.appid;
+          return s
+        })
+        return v
+      }).flat())
+    } else {
+      setTimeout(this.refreshData, 10);
+      return;
+    }
 
-	},
-	/* 获取最新信息 */
-	queryMessage(i = 0) {
-		_Http.basic({
-			"classname": "system.message.Message",
-			"method": "queryMessage",
-			content: {
-				nocache: true,
-				pageNumber: 1,
-				pageSize: 5,
-				pageTotal: 1,
-				type: "",
-				where: {}
-			},
-		}, false).then(res => {
-			if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
-				title: res.msg,
-				icon: "none"
-			})
-			this.setData({
-				msgList: res.data,
-				notice: res.data[0]
-			})
-			if (this.data.msgList.length > 2) this.startDataCarousel();
-		})
-	},
-	/* 开启消息轮播 */
-	startDataCarousel() {
-		clearInterval(DataCarousel);
-		DataCarousel = setInterval(() => {
-			let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
-			this.setData({
-				msgCount: count + 1,
-				notice: this.data.msgList[count]
-			})
-		}, 5000)
-	},
-	/* 去消息详情 */
-	toMsg(e) {
-		const {
-			item
-		} = e.currentTarget.dataset;
-		wx.navigateTo({
-			url: '/pages/tabbar/message/details?id=' + item.messageid,
-		})
-	},
-	/* banner */
-	bannerClick(e) {
-		const {
-			item
-		} = e.currentTarget.dataset,
-			hyperlink = item.hyperlink.split(":");
-		if (hyperlink[0] == 'path') wx.navigateTo({
-			url: hyperlink[1]
-		})
-	},
-	onShow() {
-		this.getTabBar().init();
-		if (this.data.msgList.length > 2) this.startDataCarousel();
-		this.queryMessage(0); //更新最新消息
-	},
-	onHide() {
-		clearInterval(DataCarousel);
-	},
-	onReady() {
-		// this.setListHeight();
-	},
-	/* 设置页面高度 */
-	setListHeight() {
-		this.selectComponent("#ListBox").setHeight(".grld-title", this);
-	},
-	onShareAppMessage() {}
+  },
+  /* 获取最新信息 */
+  queryMessage(i = 0) {
+    _Http.basic({
+      "classname": "system.message.Message",
+      "method": "queryMessage",
+      content: {
+        nocache: true,
+        pageNumber: 1,
+        pageSize: 5,
+        pageTotal: 1,
+        type: "",
+        where: {}
+      },
+    }, false).then(res => {
+      if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      this.setData({
+        msgList: res.data,
+        notice: res.data[0]
+      })
+      if (this.data.msgList.length > 2) this.startDataCarousel();
+    })
+  },
+  /* 开启消息轮播 */
+  startDataCarousel() {
+    clearInterval(DataCarousel);
+    DataCarousel = setInterval(() => {
+      let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
+      this.setData({
+        msgCount: count + 1,
+        notice: this.data.msgList[count]
+      })
+    }, 5000)
+  },
+  /* 去消息详情 */
+  toMsg(e) {
+    const {
+      item
+    } = e.currentTarget.dataset;
+    wx.navigateTo({
+      url: '/pages/tabbar/message/details?id=' + item.messageid,
+    })
+  },
+  /* banner */
+  bannerClick(e) {
+    const {
+      item
+    } = e.currentTarget.dataset,
+      hyperlink = item.hyperlink.split(":");
+    if (hyperlink[0] == 'path') wx.navigateTo({
+      url: hyperlink[1]
+    })
+  },
+  onShow() {
+    this.getTabBar().init();
+    if (this.data.msgList.length > 2) this.startDataCarousel();
+    this.queryMessage(0); //更新最新消息
+  },
+  onHide() {
+    clearInterval(DataCarousel);
+  },
+  onReady() {
+    // this.setListHeight();
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".grld-title", this);
+  },
+  onShareAppMessage() {}
 })