From 22271e641e4505ba906c3770905b7e84e3ad8d85 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 02 四月 2024 17:05:57 +0800
Subject: [PATCH] mrshi

---
 wx/pages/index/index.vue |  134 +++++++++++++++++++++++---------------------
 1 files changed, 69 insertions(+), 65 deletions(-)

diff --git a/wx/pages/index/index.vue b/wx/pages/index/index.vue
index 86875dc..d2c43b9 100644
--- a/wx/pages/index/index.vue
+++ b/wx/pages/index/index.vue
@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content_head" :style="{backgroundImage: 'url(' + backgroundImg + ')'}">
 			<text>{{userInfo.company.name}}</text>
-			<text>褰撳墠鍦ㄤ繚锛�20浜�</text>
+			<text>褰撳墠鍦ㄤ繚锛歿{num}}浜�</text>
 		</view>
 		<view class="content_box">
 			<view class="content_box_list">
@@ -42,10 +42,6 @@
 					<text>鍛樺伐绠$悊</text>
 					<text>鏌ョ湅浜哄憳鎶曚繚淇℃伅</text>
 				</view>
-				<view class="content_box_list1_item" @click="jump(9)" :style="{backgroundImage: 'url(' + backgroundImg9 + ')'}">
-					<text>娲鹃仯鍗曚綅绠$悊</text>
-					<text>鏂板淇敼娲鹃仯鍗曚綅</text>
-				</view>
 			</view>
 		</view>
 		<view class="content_loginout">
@@ -62,6 +58,7 @@
 		},
 		data() {
 			return {
+				num: 0,
 				backgroundImg: require('@/static/background/home_bg@2x.png'),
 				backgroundImg1: require('@/static/background/home_ic_toubao@2x.png'),
 				backgroundImg2: require('@/static/background/home_ic_baodan@2x.png'),
@@ -71,13 +68,20 @@
 				backgroundImg6: require('@/static/background/home_ic_huanchang@2x.png'),
 				backgroundImg7: require('@/static/background/home_ic_huanchangjilu@2x.png'),
 				backgroundImg8: require('@/static/background/home_ic_yuangong@2x.png'),
-				backgroundImg9: require('@/static/background/home_ic_paiqian@2x.png'),
 			}
 		},
-		onLoad() {
-
+		onShow() {
+			this.getNum()
 		},
 		methods: {
+			getNum() {
+				this.$u.api.guaranteeNum()
+					.then(res => {
+						if (res.code === 200) {
+							this.num = res.data
+						}
+					})
+			},
 			loginOut() {
 				this.$u.api.logout()
 					.then(res => {
@@ -97,100 +101,100 @@
 				}
 				switch(type) {
 					case 1:
-						if (this.userInfo.permissions.filter(item => item === 'business:insuranceapply:query').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:insuranceapply:query').length > 0) {
 							uni.navigateTo({
 								url: '/pages/insuranceApplication/insuranceApplication'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 2:
-						if (this.userInfo.permissions.filter(item => item === 'business:myPolicy:query').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:myPolicy:query').length > 0) {
 							uni.navigateTo({
 								url: '/pages/myPolicy/myPolicy'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 3:
-						if (this.userInfo.permissions.filter(item => item === 'business:onlineReporting:create').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:onlineReporting:create').length > 0) {
 							uni.navigateTo({
 								url: '/pages/online_reporting/online_reporting'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 4:
-						if (this.userInfo.permissions.filter(item => item === 'business:addsubtract:apply').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:addsubtract:apply').length > 0) {
 							uni.navigateTo({
 								url: '/pages/addition_subtraction_application/addition_subtraction_application'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 5:
-						if (this.userInfo.permissions.filter(item => item === 'business:addsubtractInsuranceRecords:query').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:addsubtractInsuranceRecords:query').length > 0) {
 							uni.navigateTo({
 								url: '/pages/add_subtract_insurance/add_subtract_insurance'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 6:
-						if (this.userInfo.permissions.filter(item => item === 'business:factoryChange:create').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:factoryChange:create').length > 0) {
 							uni.navigateTo({
-								url: '/pages/add_subtract_insurance/add_subtract_insurance'
+								url: '/pages/factoryChange/factoryChange'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 7:
-						if (this.userInfo.permissions.filter(item => item === 'business:factoryChange:query').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'business:factoryChange:query').length > 0) {
 							uni.navigateTo({
 								url: '/pages/dispatch_unit_records/dispatch_unit_records'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 					case 8:
-						if (this.userInfo.permissions.filter(item => item === 'system:user:query').length > 0) {
+						// if (this.userInfo.permissions.filter(item => item === 'system:user:query').length > 0) {
 							uni.navigateTo({
 								url: '/pages/employee_management/employee_management'
 							})
-						} else {
-							uni.showToast({
-								title: '鎮ㄦ病鏈夋潈闄�',
-								icon: 'none'
-							})
-						}
+						// } else {
+						// 	uni.showToast({
+						// 		title: '鎮ㄦ病鏈夋潈闄�',
+						// 		icon: 'none'
+						// 	})
+						// }
 						break
 				}
 			}

--
Gitblit v1.9.3