Selaa lähdekoodia

修改个人信息,新增设置、个人信息

mym 1 vuosi sitten
vanhempi
commit
8c22d5a0e9
5 muutettua tiedostoa jossa 179 lisäystä ja 7 poistoa
  1. 28 1
      pages.json
  2. 65 0
      pages/personal/editPassword.vue
  3. 24 0
      pages/personal/my.vue
  4. 15 6
      pages/personal/personal.vue
  5. 47 0
      pages/personal/setting.vue

+ 28 - 1
pages.json

@@ -352,7 +352,34 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/personal/my",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "个人信息",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/personal/setting",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设置",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/personal/editPassword",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设置账号密码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 65 - 0
pages/personal/editPassword.vue

@@ -0,0 +1,65 @@
+<template>
+	<view>
+		<view class="content">
+			<view class="flex item">
+				<view style="color: gray;">账号</view>
+				<view><input class="uni-input" disabled value="user.phone" /></view>
+			</view>
+			<view class="flex item">
+				<view>旧密码</view>
+				<view><input class="uni-input" :value="pwd.olePassword" placeholder="请输入旧密码" /></view>
+			</view>
+			<view class="flex item">
+				<view>新密码</view>
+				<view><input class="uni-input" :value="pwd.olePassword" placeholder="请输入新密码" /></view>
+			</view>
+			<view class="flex item">
+				<view>确认密码</view>
+				<view><input class="uni-input" :value="pwd.rePassword" placeholder="请再次输入新密码" /></view>
+			</view>
+			<view class="item">
+				<text style="color: gray;">密码必须是8-16位英文字母、数字、字符组合(不能是纯数字)</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				user: this.getUser(),
+				pwd: {}
+			}
+		},
+		methods: {
+			edit(){
+				this.http.request({
+					url: '/sp-admin/app/AppUser/modifyPassword',
+					data: param,
+					success: res => {
+						uni.removeStorageSync('token');
+						uni.removeStorageSync('info');
+						uni.removeStorageSync('menu');
+						uni.redirectTo({ url: '/pages/login/login' });
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: $pg;
+	}
+	.content {
+		padding: 20px 10px;
+	}
+	.item{
+		height: 60px;
+		display: flex;
+		align-items: center;
+		border-top: 1px solid #DCDCDC;
+	}
+</style>

+ 24 - 0
pages/personal/my.vue

@@ -0,0 +1,24 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: $pg;
+	}
+</style>

+ 15 - 6
pages/personal/personal.vue

@@ -17,7 +17,7 @@
 					<view class="tag" v-if="user.userType == 4">司机</view>
 					<view class="tag" v-if="user.userType == 5">外籍商户</view>
 				</view>
-				<text class="icon edit">&#xe645;</text>
+				<text class="icon edit" @click="go('/pages/personal/my')">&#xe645;</text>
 				<view class="clear"></view>
 			</view>
 			<!--组长菜单-->
@@ -109,7 +109,7 @@
 					<text class="title">隐私协议</text>
 					<text class="icon arrow">&#xe8f2;</text>
 				</view>
-				<view class="s_item" @click="show = true">
+				<view class="s_item" @click="go('/pages/personal/setting')">
 					<text class="icon ic">&#xe817;</text>
 					<text class="title">设置</text>
 					<text class="icon arrow">&#xe8f2;</text>
@@ -153,15 +153,24 @@ export default {
 			uni.navigateTo({ url: url });
 		},
 		exitLogin() {
+			let param = {
+				appUserId: this.getUser().id
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确定注销登录?',
 				success: res => {
 					if (res.confirm) {
-						uni.removeStorageSync('token');
-						uni.removeStorageSync('info');
-						uni.removeStorageSync('menu');
-						uni.redirectTo({ url: '/pages/login/login' });
+						this.http.request({
+							url: '/sp-admin/app/AppUser/logout',
+							data: param,
+							success: res => {
+								uni.removeStorageSync('token');
+								uni.removeStorageSync('info');
+								uni.removeStorageSync('menu');
+								uni.redirectTo({ url: '/pages/login/login' });
+							}
+						});
 					}
 				}
 			});

+ 47 - 0
pages/personal/setting.vue

@@ -0,0 +1,47 @@
+<template>
+	<view>
+		<view class="cmd">
+			<view class="s_item" @click="go('')">
+				<text class="title">账号信息</text>
+				<text class="icon arrow">&#xe8f2;</text>
+			</view>
+			<view class="s_item" @click="go('')">
+				<text class="title">通用</text>
+				<text class="icon arrow">&#xe8f2;</text>
+			</view>
+			<view class="s_item" @click="go('')">
+				<text class="title">消息通知</text>
+				<text class="icon arrow">&#xe8f2;</text>
+			</view>
+			<view class="s_item" @click="go('')">
+				<text class="title">帮助与反馈</text>
+				<text class="icon arrow">&#xe8f2;</text>
+			</view>
+			<view class="s_item" @click="go('/pages/personal/editPassword')">
+				<text class="title">修改密码</text>
+				<text class="icon arrow">&#xe8f2;</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			go(url) {
+				uni.navigateTo({ url: url });
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: $pg;
+	}
+</style>