From 17ddcaf59d85194b7f73b601a907ead24d696baf Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Tue, 19 Mar 2024 17:19:39 +0800
Subject: [PATCH] 更新

---
 pages/user/center.vue          |  128 +++++++++++++++++++++---------------------
 common/common.js               |    2 
 static/icon/menu-center-05.png |    0 
 pages/home/index.vue           |    6 -
 static/icon/menu-center-06.png |    0 
 components/tabBar/tabBar.vue   |    2 
 static/img/center-bg-2.png     |    0 
 7 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/common/common.js b/common/common.js
index dfee272..e5712e8 100644
--- a/common/common.js
+++ b/common/common.js
@@ -96,7 +96,7 @@
 }
 
 
-export const getTabbarList = (roleType) => {
+export const getTabbarList = (roleType = 1) => {
 	if (roleType == 2) {
 		return [{
 				name: '首页',
diff --git a/components/tabBar/tabBar.vue b/components/tabBar/tabBar.vue
index b2ab7fe..ac11e42 100644
--- a/components/tabBar/tabBar.vue
+++ b/components/tabBar/tabBar.vue
@@ -55,7 +55,7 @@
 				uni.switchTab({
 					url
 				})
-				this.$emit("change", name)
+				this.$emit("change", index)
 			}
 		}
 	}
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 180025b..35a20e2 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -266,7 +266,7 @@
 				@close="selectBoxShow = false" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
 				@confirm="confirmSite" @change="changeSite" @cancel="selectBoxShow = false"></u-picker>
 		</view>
-		<tabBar :current="0" :list="tabList" @change="changeTabbar" />
+		<tabBar :current="0" :list="tabList" />
 	</view>
 </template>
 
@@ -626,9 +626,7 @@
 			// 	});
 			// },
 
-			changeTabbar() {
-				uni.$emit('refreshStatistics')
-			},
+
 
 
 
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 7f1a3a4..5320e33 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -1,7 +1,8 @@
 <template>
 	<view class="container">
 		<view class="head">
-			<image src="/static/img/center-bg.png" class="head-bg" />
+			<image src="/static/img/center-bg.png" class="head-bg" v-if="roleType == 1" />
+			<image src="/static/img/center-bg-2.png" class="head-bg" v-if="roleType == 2" />
 			<!-- 用户信息 -->
 			<view class="user-box">
 				<view class="left">
@@ -36,49 +37,50 @@
 				</navigator>
 			</view>
 		</view>
+		<view class="cell-box" v-if="isLogin">
+			<u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}">
+				<u-cell v-if="roleType == 1" title="切换角色" isLink url="/subPackage/user/role/index">
+					<image slot="icon" src="/static/icon/menu-center-02.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="roleType == 2" title="切换角色" isLink url="/subPackage/user/role/index">
+					<image slot="icon" src="/static/icon/menu-center-05.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="siteInfo.addressType == 1" title="我的事件" isLink
+					url="/subPackage/bs/views/repairList?from=center">
+					<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="siteInfo.addressType == 2" title="我的事件" isLink url="/subPackage/user/event/event">
+					<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="roleType == 1" title="我的评价" isLink url="/subPackage/user/commentList/evaluateList">
+					<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="roleType == 1" title="我的评论" isLink url="/subPackage/user/commentList/commentList">
+					<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="roleType == 1" title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
+					<image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image>
+				</u-cell>
+				<u-cell v-if="roleType == 2" title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
+					<image slot="icon" src="/static/icon/menu-center-06.png" class="icon" mode=""></image>
+				</u-cell>
 
-		<view class="main">
-			<view class="cell-box" v-if="isLogin">
-				<u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}">
-					<u-cell title="切换角色" isLink url="/subPackage/user/role/index" :border="false">
-						<image slot="icon" src="/static/icon/menu-center-02.png" class="icon" mode=""></image>
-					</u-cell>
-					<u-cell v-if="siteInfo.addressType == 1" title="我的事件" isLink
-						url="/subPackage/bs/views/repairList?from=center" :border="false">
-						<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
-					</u-cell>
-					<u-cell v-if="siteInfo.addressType == 2" title="我的事件" :border="false" isLink
-						url="/subPackage/user/event/event">
-						<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
-					</u-cell>
-					<u-cell v-if="roleType == 1" :border="false" title="我的评价" isLink
-						url="/subPackage/user/commentList/evaluateList">
-						<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
-					</u-cell>
-					<u-cell v-if="roleType == 1" :border="false" title="我的评论" isLink
-						url="/subPackage/user/commentList/commentList">
-						<image slot="icon" src="/static/icon/menu-center-01.png" class="icon" mode=""></image>
-					</u-cell>
-					<u-cell title="修改密码" :border="false" isLink url="/subPackage/user/password/index">
-						<image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image>
-					</u-cell>
+			</u-cell-group>
+		</view>
+		<!-- <view class="cell-box" v-if="isLogin">
+			<u-cell-group :border="false">
+				<u-cell title="退出登录" :border="false" @click="logOut" isLink>
+					<image slot="icon" src="/static/icon/menu-center-04.png" class="icon" mode=""></image>
+				</u-cell>
+			</u-cell-group>
+		</view> -->
 
-				</u-cell-group>
-			</view>
-			<!-- <view class="cell-box" v-if="isLogin">
-				<u-cell-group :border="false">
-					<u-cell title="退出登录" :border="false" @click="logOut" isLink>
-						<image slot="icon" src="/static/icon/menu-center-04.png" class="icon" mode=""></image>
-					</u-cell>
-				</u-cell-group>
-			</view> -->
-
-
-
+		<view class="exit-btn" @click="logOut" :style="{color:color}">
+			退出登录
 		</view>
 
 
-		<tabBar :current="2" :list="tabList" @change="changeTabbar" />
+		<tabBar :current="2" :list="tabbarList" />
 	</view>
 </template>
 
@@ -92,7 +94,7 @@
 	import tabBar from "@/components/tabBar/tabBar.vue"
 	import {
 		getTabbarList
-	} from "@/common/common.js"
+	} from "@/common/common.js";
 	export default {
 		components: {
 			tabBar
@@ -114,7 +116,8 @@
 				roleType: 1,
 				addressType: 1,
 				user_info: {},
-				tabList: []
+				color: "#017BFC",
+				tabbarList: []
 			};
 		},
 
@@ -122,11 +125,14 @@
 			// this.getUserInfo();
 			let role = uni.getStorageSync('activeRole')
 			if (role.roleName == "居民") {
-				this.tabList = getTabbarList(1);
+				this.tabbarList = getTabbarList(1)
 				this.roleType = 1
+				this.color = "#017BFC"
+
 			} else {
-				this.tabList = getTabbarList(2);
+				this.tabbarList = getTabbarList(2)
 				this.roleType = 2;
+				this.color = "#003399"
 			}
 			this.addressType = uni.getStorageSync("siteInfo").addressType;
 		},
@@ -136,10 +142,6 @@
 
 		},
 		methods: {
-
-			changeTabbar() {
-				uni.$emit('refreshStatistics')
-			},
 
 			setAvatar(avatar) {
 				return `${minioBaseUrl}${avatar}`
@@ -213,8 +215,7 @@
 
 <style lang="scss">
 	.container {
-		background-color: #fff;
-		// background-color: #f7f7f7;
+		background-color: #f7f7f7;
 		min-height: 100vh;
 		overflow: hidden;
 	}
@@ -349,25 +350,14 @@
 		}
 	}
 
-	.main {
-		border-radius: 30rpx 30rpx 0 0;
-		position: relative;
-		top: -40rpx;
-		z-index: 10;
-		padding: 30rpx 30rpx 0;
-		background-color: #fff;
-	}
-
 	.cell-box {
-		// background: #ffffff;
-		// margin: 18rpx;
-		border-radius: 20rpx;
-		box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(107, 134, 159, 0.2);
+		background: #ffffff;
+		margin: 18rpx;
 
 		.icon {
 			width: 52rpx;
 			height: 52rpx;
-			margin-right: 12rpx;
+			margin-right: 22rpx;
 		}
 	}
 
@@ -377,4 +367,16 @@
 		font-weight: 500;
 		color: #585b61;
 	}
+
+	.exit-btn {
+		width: 690rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		border-radius: 16rpx;
+		border: 1px solid currentColor;
+		text-align: center;
+		position: fixed;
+		bottom: 150rpx;
+		left: calc((100% - 690rpx)/2);
+	}
 </style>
\ No newline at end of file
diff --git a/static/icon/menu-center-05.png b/static/icon/menu-center-05.png
new file mode 100644
index 0000000..5cfb014
--- /dev/null
+++ b/static/icon/menu-center-05.png
Binary files differ
diff --git a/static/icon/menu-center-06.png b/static/icon/menu-center-06.png
new file mode 100644
index 0000000..d663b72
--- /dev/null
+++ b/static/icon/menu-center-06.png
Binary files differ
diff --git a/static/img/center-bg-2.png b/static/img/center-bg-2.png
new file mode 100644
index 0000000..e336739
--- /dev/null
+++ b/static/img/center-bg-2.png
Binary files differ

--
Gitblit v1.9.3