Browse Source

个人中心

lilei 3 years ago
parent
commit
d19f974fca
3 changed files with 25 additions and 22 deletions
  1. 4 0
      App.vue
  2. 4 2
      pages.json
  3. 17 20
      pages/userCenter/index.vue

+ 4 - 0
App.vue

@@ -46,6 +46,10 @@
 		width: 24upx !important;
 		height: 24upx !important;
 	}
+	.status_bar {
+	      height: var(--status-bar-height);
+	      width: 100%;
+	  }
 	.isIPXup{
 		padding-bottom: 64rpx !important;
 	}

+ 4 - 2
pages.json

@@ -31,8 +31,10 @@
 		{
 			"path": "pages/userCenter/index",
 			"style": {
-				"navigationBarTitleText": "个人中心",
-				"navigationBarTextStyle": "white"
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom",
+				// 将回弹属性关掉
+				"bounce":"none"
 			}
 		},
 		{

+ 17 - 20
pages/userCenter/index.vue

@@ -1,9 +1,12 @@
 <template>
 	<view class="user-content">
+		<view class="status_bar">
+		  <!-- 这里是状态栏 -->
+	    </view>
 		<!-- 头部 -->
-		<view class="user-head">
+		<view class="user-head" :style="`background:${$config('primaryColor')}`">
 			<view class="user-photo">
-				<u-avatar :src="userAvatarUrl" size="large" class="avatar"></u-avatar>
+				<u-avatar :src="userAvatarUrl" size="100" class="avatar"></u-avatar>
 			</view>
 			<view class="user-info">
 				<text class="user-name">用户名</text>
@@ -13,14 +16,14 @@
 		<!-- 列表 -->
 		<view class="user-list">
 			<u-cell-group>
-				<u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="0" @click="toPage" title="服务协议及隐私政策"></u-cell-item>
+				<u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="0" @click="toPage(0)" title="服务协议及隐私政策"></u-cell-item>
 				<!-- <u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#55aa00'}" index="1" @click="toPage" title="关于我们"></u-cell-item> -->
-				<u-cell-item icon="lock" icon-size="38" :icon-style="{color:'#00aaff'}" index="2" @click="toPage" title="修改密码"></u-cell-item>
+				<u-cell-item icon="lock" icon-size="38" :icon-style="{color:'#00aaff'}" index="2" @click="toPage(1)" title="修改密码"></u-cell-item>
 			</u-cell-group>
 		</view>
 		<!-- 退出 -->
 		<view class="user-btn">
-			<u-button type="success" :custom-style="quitButton" @click="quitOutSys" shape="circle">退出登录</u-button>
+			<u-button type="success" :custom-style="{background:$config('primaryColor')}" @click="quitOutSys" shape="circle">退出登录</u-button>
 		</view>
 	</view>
 </template>
@@ -33,11 +36,6 @@
 	export default {
 		data() {
 			return {
-				quitButton: {
-					borderRadius:'100rpx',
-					fontSize:'30rpx',
-					background: '#ed1c24'
-				},
 				userInfoData: null,  //  用户信息
 				userAvatarUrl: ''  //  用户头像
 			};
@@ -46,6 +44,10 @@
 			this.getUserInfo()
 		},
 		onLoad() {
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
 		},
 		methods:{
 			//  获取用户信息
@@ -61,7 +63,7 @@
 			// 打开对应的页面
 			toPage(index){
 				let pageUrl=[
-					'/pages/agreement/agreement?fromPage=usercenter',
+					'/pages/login/userAuthYs?fromPage=usercenter',
 					'/pages/userCenter/changePwd'
 					]
 				uni.navigateTo({
@@ -120,17 +122,12 @@
 	.user-content{
 		width: 100%;
 		.user-head{
-			background: #ed1c24;
 			display: flex;
 			align-items: center;
-			padding: 35rpx 55rpx;
+			padding: 80rpx 35rpx;
 			.user-photo{
 				flex-shrink: 0;
 				margin-right: 5rpx;
-				// width: 130rpx;
-				// height: 130rpx;
-				// border-radius: 50%;
-				// overflow: hidden;
 			}
 			.user-info{
 				flex-grow: 1;
@@ -138,12 +135,12 @@
 				color: #FFFFFF;
 				.user-name{
 					display: block;
-					font-size: 30rpx;
-					margin-bottom: 20rpx;
+					font-size: 36rpx;
+					margin-bottom: 10rpx;
 				}
 				.user-phone{
 					display: block;
-					font-size: 26rpx;
+					font-size: 28rpx;
 				}
 			}
 		}