Browse Source

基础数据

zhaoxiaohai 2 years ago
parent
commit
29d6ce5f62
3 changed files with 216 additions and 193 deletions
  1. 3 1
      app.json
  2. 194 189
      pages/tabbar/home/index.js
  3. 19 3
      static/font-icon.wxss

+ 3 - 1
app.json

@@ -38,7 +38,9 @@
         "remitVoucher/index",
         "remitVoucher/detail",
         "remitVoucher/update",
-        "remitVoucher/modules/selectAccount/index"
+        "remitVoucher/modules/selectAccount/index",
+        "borrow/index",
+        "borrow/detail"
       ]
     },
     {

+ 194 - 189
pages/tabbar/home/index.js

@@ -1,192 +1,197 @@
 let _Http = getApp().globalData.http,
-	DataCarousel = null;
+    DataCarousel = null;
 Page({
-	data: {
-		bannerList: [], //banner列表
-		gridList: [],
-		notice: "",
-		msgCount: 1,
-		msgList: [], //消息列表
-	},
-	onLoad(options) {
-		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 = [],
-				authList = {};
-			wx.setStorageSync('auth', authList)
-			gridList.push({
-				name: "商城",
-				path: "/packageA/market/index",
-				color: "#F29C37",
-				bColor: "#FCF6EF",
-				icon: "icon-shangcheng"
-			})
-			gridList.push({
-				name: "销售订单",
-				path: "/packageA/orderForm/index",
-				color: "#5AB73F",
-				bColor: "#F4FAEF",
-				icon: "icon-dingdan"
-			})
-			gridList.push({
-				name: "收货",
-				path: "/packageA/shipment/index",
-				color: "#3874F6",
-				bColor: "#F0F3FF",
-				icon: "icon-shouhuo"
-			})
-			gridList.push({
-				name: "业绩目标",
-				path: "/packageA/target/index",
-				color: "#5AB73F",
-				bColor: "#F4FAEF",
-				icon: "icon-yejimubiao"
-			})
-			gridList.push({
-				name: "账户",
-				path: "/packageA/account/index",
-				color: "#EB4B5C",
-				bColor: "#FDF1ED",
-				icon: "icon-zhanghu"
-			})
-			gridList.push({
-				name: "促销活动",
-				path: "/packageA/activity/index",
-				color: "#3874F6",
-				bColor: "#F0F3FF",
-				icon: "icon-cuxiaohuodong"
-			})
-			gridList.push({
-				name: "工具查询",
-				path: "/packageA/tool/index",
-				color: "#EB4B5C",
-				bColor: "#FDF1ED",
-				icon: "icon-kaipiao"
-			})
-			gridList.push({
-				name: "购物车",
-				path: "/packageA/shopping/index",
-				color: "#EB4B5C",
-				bColor: "#FDF1ED",
-				icon: "icon-kaipiao"
-			})
-			gridList.push({
-				name: "开票",
-				path: "/packageA/invoice/index",
-				color: "#EB4B5C",
-				bColor: "#FDF1ED",
-				icon: "icon-kaipiao"
-			})
-			/* ------------------------------- */
-			gridList.push({
-				name: "数据查询",
-				path: "#",
-				color: "#F29C37",
-				bColor: "#FCF6EF",
-				icon: "icon-shujuchaxun"
-			})
-			/* ------------------------------- */
-			gridList.push({
-				name: "打款凭证",
-				path: "/packageA/remitVoucher/index",
-				color: "#F29C37",
-				bColor: "#FCF6EF",
-				icon: "icon-shujuchaxun"
-			})
-			/* ------------------------------- */
-			this.setData({
-				gridList
-			})
-		} 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
-		})
-	},
-	/* 获取最新信息 */
-	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() {}
+    data: {
+        bannerList: [], //banner列表
+        gridList: [],
+        notice: "",
+        msgCount: 1,
+        msgList: [], //消息列表
+    },
+    onLoad(options) {
+        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 = [],
+                authList = {};
+            wx.setStorageSync('auth', authList)
+            gridList.push({
+                name: "商城",
+                path: "/packageA/market/index",
+                color: "#F29C37",
+                bColor: "#FCF6EF",
+                icon: "icon-shangcheng"
+            })
+            gridList.push({
+                name: "销售订单",
+                path: "/packageA/orderForm/index",
+                color: "#5AB73F",
+                bColor: "#F4FAEF",
+                icon: "icon-dingdan"
+            })
+            gridList.push({
+                name: "收货",
+                path: "/packageA/shipment/index",
+                color: "#3874F6",
+                bColor: "#F0F3FF",
+                icon: "icon-shouhuo"
+            })
+            gridList.push({
+                name: "业绩目标",
+                path: "/packageA/target/index",
+                color: "#5AB73F",
+                bColor: "#F4FAEF",
+                icon: "icon-yejimubiao"
+            })
+            gridList.push({
+                name: "账户",
+                path: "/packageA/account/index",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-zhanghu"
+            })
+            gridList.push({
+                name: "促销活动",
+                path: "/packageA/activity/index",
+                color: "#3874F6",
+                bColor: "#F0F3FF",
+                icon: "icon-cuxiaohuodong"
+            })
+            gridList.push({
+                name: "工具查询",
+                path: "/packageA/tool/index",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-kaipiao"
+            })
+            gridList.push({
+                name: "购物车",
+                path: "/packageA/shopping/index",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-kaipiao"
+            })
+            gridList.push({
+                name: "开票",
+                path: "/packageA/invoice/index",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-kaipiao"
+            })
+            gridList.push({
+                name: "打款凭证",
+                path: "/packageA/remitVoucher/index",
+                color: "#F29C37",
+                bColor: "#FCF6EF",
+                icon: "icon-shujuchaxun"
+            })
+            gridList.push({
+                name: "工具借用",
+                path: "/packageA/borrow/index",
+                color: "#F29C37",
+                bColor: "#FCF6EF",
+                icon: "icon-shujuchaxun"
+            })
+            /* ------------------------------- */
+            gridList.push({
+                name: "数据查询",
+                path: "#",
+                color: "#F29C37",
+                bColor: "#FCF6EF",
+                icon: "icon-shujuchaxun"
+            })
+            this.setData({
+                gridList
+            })
+        } 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
+        })
+    },
+    /* 获取最新信息 */
+    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() {}
 })

+ 19 - 3
static/font-icon.wxss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3830173 */
-  src: url('//at.alicdn.com/t/c/font_3830173_olpdutjwuy.woff2?t=1673252301979') format('woff2'),
-       url('//at.alicdn.com/t/c/font_3830173_olpdutjwuy.woff?t=1673252301979') format('woff'),
-       url('//at.alicdn.com/t/c/font_3830173_olpdutjwuy.ttf?t=1673252301979') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_3830173_11m2ocmmf9gh.woff2?t=1675318503223') format('woff2'),
+       url('//at.alicdn.com/t/c/font_3830173_11m2ocmmf9gh.woff?t=1675318503223') format('woff'),
+       url('//at.alicdn.com/t/c/font_3830173_11m2ocmmf9gh.ttf?t=1675318503223') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,22 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-a-biaoqianlanzhiku:before {
+  content: "\e608";
+}
+
+.icon-webqiyeshuiyintupian:before {
+  content: "\e671";
+}
+
+.icon-gouwuche:before {
+  content: "\e680";
+}
+
+.icon-gongjuchaxun:before {
+  content: "\e681";
+}
+
 .icon-a-shouyeshujugaikuangzhanshishuju:before {
   content: "\e64e";
 }