Browse Source

前端gjy

gjy 3 years ago
parent
commit
767a49a0d1

+ 3 - 1
.gitignore

@@ -1,10 +1,12 @@
 HELP.md
-config/
+
 target/
 !.mvn/wrapper/maven-wrapper.jar
 !**/src/main/**
 !**/src/test/**
 
+config/
+
 ### STS ###
 .apt_generated
 .classpath

+ 2 - 2
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
 	baseUrl: 'https://www.zthymaoyi.com',
-	// baseUrlNew: 'http://192.168.1.120:8090/',
-	baseUrlNew: 'http://api.eliangeyun.com/',
+	baseUrlNew: 'http://192.168.1.120:8090/',
+	// baseUrlNew: 'http://api.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 100 - 20
pages/user/setUp.vue

@@ -1,23 +1,39 @@
 <template>
 	<view class="container">
-		<view class=" flex headPortrait justify-between" @click="switchPicture">
-			<view class="title">头像</view>
-			<view class="nextStep flex">
-				<view class="pictures">
-					<image :src="headUrl" class="picture"></image>
+		<view class="cu-list menu text-left solid-top indexlow">
+			<view class='cu-item' style='margin-bottom:10px;' @click="switchPicture">
+				<view>
+					<text>头像</text>
+				</view>
+				<view style='align-items: center;' class="flex">
+					<view class="pictures">
+						<image :src="headUrl" class="picture"></image>
+					</view>
+					<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
 				</view>
-				<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
 			</view>
-		</view>
-		<view class="flex headPortrait justify-between" @click="nickname(username)">
-			<view class="title">昵称</view>
-			<view class="nextStep flex">
-				<view class="username">
-					{{username}}
+			<view class='cu-item' style='margin-bottom:10px;'  @click="nickname(username)">
+				<view>
+					<text>昵称</text>
+				</view>
+				<view style='align-items: center;' class="flex">
+					<view class="username">
+						{{username}}
 					</view>
+					<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
+				</view>
+			</view>
+			<view class='cu-item' @click='fankui'>
+				<view>
+					<text>意见反馈</text>
+				</view>
 				<image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
 			</view>
 		</view>
+		<view class='exitloginwrap'>
+			<button @click='logout()' class='exitlogin'>退出登录</button>
+		</view>
+		
 	</view>
 </template>
 
@@ -30,6 +46,17 @@
 			return {
 				headUrl:"../../static/img/myimg/YongHu@3x.png",
 				username:"",
+				gridList: [
+					{
+						num:0,
+						name: '退出登录',
+						// icon:'cuIcon-exit',
+						src:'../../static/img/sign/return@3x.png',
+						tips: 0,
+						url:'',
+						show:true
+					},
+				],
 			}
 		},
 		computed: {
@@ -58,16 +85,48 @@
 				uni.navigateTo({
 					url: `/pages/user/set_nickname?nickname=${username}`
 				})
-			}
+			},
+			exitlogin(){
+				
+			},
+			fankui(){
+				uni.navigateTo({
+					url: `/pages/user/fankui`
+				})
+			},
+			logout() {
+				const that = this
+				uni.showModal({
+					title: '询问',
+					content: '您确定要退出吗?',
+					cancelText: '取消',
+					confirmText: '确定',
+					success: (e) => {
+						if (e.confirm) {
+							uni.hideTabBarRedDot({
+								index:3
+							})
+							uni.clearStorageSync();
+							that.$store.commit('logout')
+							that.$api.logout()
+							uni.navigateTo({
+								url: `/pages/public/login`
+							})
+						}
+					}
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.container {
-		padding: 10px 10px 0px;
+	page{
 		background-color: #F5F6FA;
 	}
+	.container {
+		padding: 10px 0 0px;
+	}
 
 	.headPortrait {
 		width: 100%;
@@ -91,7 +150,6 @@
 		height: 35px;
 		background-color: #E0FAF6;
 		border-radius: 18px;
-		margin-top: 6px;
 	}
 
 	.picture {
@@ -102,15 +160,37 @@
 		margin-left: 15px;
 		width: 8px;
 		height: 12px;
-		top: 18px;
 		// justify-content: flex-end
 
 	}
-	.nextStep{
-		margin-right: 20px;
-	}
 	.username{
 		line-height: 50px;
 		color: #6D6D72;
 	}
+	.sign{
+		width: 18px;
+		height: 18px;
+		top: 4px;
+		margin-right: 6px;
+	}
+	.cu-list>.cu-item:after{
+		border:none;
+	}
+	.exitloginwrap{
+		position:fixed;
+		bottom:0;
+		left:0;
+		width:100%;
+		padding-bottom:20px;
+	}
+	.exitlogin{
+		width:90%;
+		background:#fff;
+		border-radius:30px;
+		color:#FB1E1E;
+		font-size:17px;
+	}
+	.exitlogin:after{
+		border:none;
+	}
 </style>

+ 56 - 38
pages/user/user.vue

@@ -15,12 +15,15 @@
 				</view>
 			</view>
 		</view> -->
-		<view class="indexUp flex">
-			<image v-bind:src="headUrl" class="headPortrait"></image>
-			<view class="personal">
-				<view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
-				<view class="information">{{starUserphone}}</view>
+		<view class="indexUp flex justify-between">
+			<view class='flex'>
+				<image v-bind:src="headUrl" class="headPortrait"></image>
+				<view class="personal">
+					<view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
+					<view class="information">{{starUserphone}}</view>
+				</view>
 			</view>
+			<view><image @click='setting' style='width:21px;height:21px;' src="../../static/img/sign/shezhi@3x.png" ></image></view>
 
 		</view>
 		<view class="cover-container">
@@ -32,7 +35,7 @@
 					<view>
 					<!-- 	<text :class="item.icon" class="grid_icon icon text-grey"></text> -->
 						<image :src="item.src" class="sign"></image>
-						<text class="text-grey">{{item.name}}</text>
+						<text >{{item.name}}</text>
 					</view>
 					<view>
 						<text v-if='item.num==2&&taskTip' class='badge_user'>{{taskTip}}</text>
@@ -41,13 +44,6 @@
 					</view>
 					<!-- <image src="../../static/img/sign/authentication@3x.png" mode=""></image> -->
 				</view>
-				<view class='cu-item' @click='fankui'>
-					<view>
-						<image src="../../static/img/sign/authentication@2x.png" class="sign"></image>
-						<text class="text-grey">意见反馈</text>
-					</view>
-					<view class = 'tip_text cuIcon-right' ></view>
-				</view>
 				<!-- <view class='cu-item' @click='scanCode'>
 							<view>
 								<text class="cuIcon-scan icon text-grey"></text>
@@ -142,24 +138,15 @@
 						url: `/pageA/freightTransport/index`,
 						show: true
 					},
-					{
-						num: 5,
-						name: '设置',
-						// icon: 'cuIcon-edit',
-						src:'../../static/img/sign/shezhi@2x.png',
-						tips: 0,
-						url: `/pages/user/setUp`,
-						show: true
-					},	
-					{
-						num:6,
-						name: '退出登录',
-						// icon:'cuIcon-exit',
-						src:'../../static/img/sign/return@3x.png',
-						tips: 0,
-						url:'',
-						show:true
-					},
+					// {
+					// 	num: 5,
+					// 	name: '设置',
+					// 	// icon: 'cuIcon-edit',
+					// 	src:'../../static/img/sign/shezhi@2x.png',
+					// 	tips: 0,
+					// 	url: `/pages/user/setUp`,
+					// 	show: true
+					// }
 				],
 				showTran: true,
 				companyId: 1,
@@ -364,6 +351,29 @@
 					}
 				}
 			},
+			setting(){
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: '登录提示',
+						content: '您尚未登录,是否立即登录?',
+						showCancel: true,
+						confirmText: '登录',
+						success: (e) => {
+							if (e.confirm) {
+								uni.navigateTo({
+									url: '/pages/public/login'
+								})
+							}
+						},
+						fail: () => {},
+						complete: () => {}
+					})
+				}else {
+						uni.navigateTo({
+							url:'/pages/user/setUp'
+						})
+				}
+			},
 			toLogin() {
 				console.log("userInfo",this.userInfo)
 				if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
@@ -469,14 +479,16 @@
 	}
 </script>
 <style lang='scss' scoped>
+	page{
+		background:#F5F6FA;
+	}
 	.container {
 		padding-top: 85px;
-		background-color: #F5F6FA;
 		position: relative;
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: url('~@/static/img/login/bg.png');
+		background: url('~@/static/img/login/bg_slices/bg@3x.png');
 		background-size: 100% 100%;
 		margin: 0 auto;
 	}
@@ -508,10 +520,10 @@
 	.cu-list {
 		/* height: 483rpx;
 		overflow-y: scroll; */
-		margin-top: 42rpx;
+		margin-top: 16rpx;
+		background:#fff;
 		margin-bottom: 80rpx;
 	}
-
 	.badge_user {
 		color: #fff;
 		background-color: #dc3545;
@@ -693,7 +705,7 @@
 		padding: 1px 10px ;
 		padding-bottom: 200upx;
 		
-	   background-color: #F5F6FA;
+	   /* background-color: #F5F6FA; */
 	/* 	border-radius: 20px; */
 		margin-top: 60upx;
 
@@ -835,7 +847,6 @@
 		width: 75px;
 		height: 75px;
 		border-radius: 40px;
-		margin-left: 20px;
 		border: 2px solid #ffffff;
 	}
 
@@ -851,7 +862,10 @@
 	}
 	.indexlow{
 		/* margin-top: 30px; */
-		border-radius: 20px;
+		border-radius: 10px;
+	}
+	.cu-list>.cu-item:after{
+		border:none;
 	}
 	.sign{
 		width: 18px;
@@ -859,4 +873,8 @@
 		top: 4px;
 		margin-right: 6px;
 	}
+	.indexUp{
+		padding:0 20px;
+		align-items: center;
+	}
 </style>

BIN
static/img/login/bg_slices/bg.png


BIN
static/img/login/bg_slices/bg@2x.png


BIN
static/img/login/bg_slices/bg@3x.png


BIN
static/img/sign/shezhi.png


BIN
static/img/sign/shezhi@2x.png


BIN
static/img/sign/shezhi@3x.png