From 0b2357a173a2bc52f3532bfcf93ff31daf226231 Mon Sep 17 00:00:00 2001
From: zhouwenxuan <1175765986@qq.com>
Date: 星期三, 06 九月 2023 14:44:23 +0800
Subject: [PATCH] 导航栏退出登录

---
 pages/tabBar/current/current.vue         |   12 +++++
 pages/tabBar/information/information.vue |   10 +++++
 pages/tabBar/notice/detail.vue           |    4 +-
 pages/tabBar/firstPage/firstPage.vue     |   10 +++++
 pages/tabBar/notice/notice.vue           |   28 +++++++++----
 pages/tabBar/examine/examine.vue         |   12 +++++
 pages/tabBar/response/response.vue       |   10 +++++
 7 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/pages/tabBar/current/current.vue b/pages/tabBar/current/current.vue
index 24a0a5f..f6015aa 100644
--- a/pages/tabBar/current/current.vue
+++ b/pages/tabBar/current/current.vue
@@ -6,8 +6,11 @@
 			<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
 			<!-- 真正的导航栏内容 -->
 			<view class="navBar">
-				<u-icon style=" margin-left: -25px;" name="arrow-left" color="black" size="17" @click="goBack" v-if="role!='工作人员'" />
+				<u-icon style=" margin-left: 13px;" name="arrow-left" color="black" size="17" @click="goBack" v-if="role!='工作人员'" />
 				<view class="barText">信息查看</view>
+				<view >
+					<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+				</view>
 			</view>
 		</view>
     <div v-if="loading" style='display: flex;justify-content: center;position: absolute;width:100%;top: 40%;left: 0'>
@@ -132,6 +135,13 @@
 			this.getInfoList();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			goBack() {
 				uni.switchTab({
 				    url:'/pages/tabBar/firstPage/firstPage'
diff --git a/pages/tabBar/examine/examine.vue b/pages/tabBar/examine/examine.vue
index 203062d..a9c222f 100644
--- a/pages/tabBar/examine/examine.vue
+++ b/pages/tabBar/examine/examine.vue
@@ -7,8 +7,11 @@
 			<!-- 真正的导航栏内容 -->
 			<view style="display: flex; flex-direction: column;" >
 				<view class="navBar">
-					<u-icon style=" margin-left: -25px;" name="arrow-left" color="black" size="17" @click="goBack" />
+					<u-icon style=" margin-left: 13px;" name="arrow-left" color="black" size="17" @click="goBack" />
 					<view class="barText">工作通知审核</view>
+					<view >
+						<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -134,6 +137,13 @@
 			this.getExanineList();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			goBack() {
 				console.log("1111")
 				uni.switchTab({
diff --git a/pages/tabBar/firstPage/firstPage.vue b/pages/tabBar/firstPage/firstPage.vue
index b85ba58..aa771bc 100644
--- a/pages/tabBar/firstPage/firstPage.vue
+++ b/pages/tabBar/firstPage/firstPage.vue
@@ -7,6 +7,9 @@
 			<!-- 真正的导航栏内容 -->
 			<view class="navBar">
 				<view class="barText">首页</view>
+				<view >
+					<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+				</view>
 			</view>
 		</view>
 		<view  class="list">
@@ -110,6 +113,13 @@
 			this.getNum();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			getNum(){
 				this.data.searchParams.reviewStatus = 1;
 				getExamine(this.data).then(res => {
diff --git a/pages/tabBar/information/information.vue b/pages/tabBar/information/information.vue
index 4a132b5..d9ad834 100644
--- a/pages/tabBar/information/information.vue
+++ b/pages/tabBar/information/information.vue
@@ -7,6 +7,9 @@
 			<!-- 真正的导航栏内容 -->
 			<view class="navBar" >
 				<view class="barText">信息发布</view>
+				<view >
+					<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+				</view>
 			</view>
 		</view>
     <div v-if="loading" style='display: flex;justify-content: center;position: absolute;width:100%;top: 40%;left: 0'>
@@ -94,6 +97,13 @@
 			this.getInformationList();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			getInformationList() {
         this.loading = true
 				this.data.searchParams.reviewStatus = this.isReadOnly ? 2 : null;
diff --git a/pages/tabBar/notice/detail.vue b/pages/tabBar/notice/detail.vue
index 2f315aa..434a482 100644
--- a/pages/tabBar/notice/detail.vue
+++ b/pages/tabBar/notice/detail.vue
@@ -9,9 +9,9 @@
 				<view class="navBar">
 					<u-icon name="arrow-left" color="black" size="17" style="margin-left: 8px;" @click="goBack" />
 					<view class="barText">信息详情</view>
-					<view >
+<!-- 					<view >
 						<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>
diff --git a/pages/tabBar/notice/notice.vue b/pages/tabBar/notice/notice.vue
index c53cff8..3c0d15a 100644
--- a/pages/tabBar/notice/notice.vue
+++ b/pages/tabBar/notice/notice.vue
@@ -7,6 +7,9 @@
 			<!-- 真正的导航栏内容 -->
 			<view class="navBar" >
 				<view class="barText">{{user.name}}收到的工作通知</view>
+				<view >
+					<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+				</view>
 				<!-- <view class="barText">{{registerID}}</view> -->
 				<!-- <view style="flex: 1;" @click="loginOut">退出</view> -->
 			</view>
@@ -174,6 +177,13 @@
 			// uni.startPullDownRefresh();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			getNoticeList() {
 				this.loading = true
 				this.noSpeak = 0;
@@ -245,14 +255,14 @@
 				console.log("触发close")
 				this.getNoticeList();
 			},
-			loginOut() {
-				uni.removeStorageSync('tk');
-				uni.removeStorageSync('uid');
-				uni.removeStorageSync('user');
-				uni.navigateTo({
-				  url: `/pages/index/index` 
-				})
-			},
+			// loginOut() {
+			// 	uni.removeStorageSync('tk');
+			// 	uni.removeStorageSync('uid');
+			// 	uni.removeStorageSync('user');
+			// 	uni.navigateTo({
+			// 	  url: `/pages/index/index`
+			// 	})
+			// },
 			//下拉刷新
 			onPullDownRefresh() {
 				console.log('refresh');
@@ -312,7 +322,7 @@
   box-shadow: 0 3px 12px rgba(0,0,0,0.05);
 }
 .barText{
-	/* margin-left: 20px; */
+	 margin-left: 35px; 
 	text-align: center;
 	width: 85%;
 	font-size: 16px;
diff --git a/pages/tabBar/response/response.vue b/pages/tabBar/response/response.vue
index 2823ae1..64cee7d 100644
--- a/pages/tabBar/response/response.vue
+++ b/pages/tabBar/response/response.vue
@@ -7,6 +7,9 @@
 			<!-- 真正的导航栏内容 -->
 			<view class="navBar">
 				<view class="barText">叫应记录</view>
+				<view >
+					<u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button>
+				</view>
 			</view>
 		</view>
     <div v-if="loading" style='display: flex;justify-content: center;position: absolute;width:100%;top: 40%;left: 0'>
@@ -70,6 +73,13 @@
 			uni.hideTabBar();
 		},
 		methods: {
+			loginOut() {
+				uni.clearStorageSync();
+				uni.clearStorage();
+				uni.navigateTo({
+					url: '/pages/index/index'
+				})
+			},
 			getResponseList() {
         this.loading = true
 				getResponse(this.data).then(res => {

--
Gitblit v1.9.2