Browse Source

1. 优化

MONSTER-ygh 1 year ago
parent
commit
58a02ae01e

+ 17 - 7
components/customNavbar/customNavbar.vue

@@ -10,8 +10,9 @@
 						<!-- 这里我就直接用文本代替了,返回图标大家自行替换哈 -->
 						<!-- #ifdef APP-PLUS || H5 -->
 						<view v-if="isLeft" @click="back()">
-							<u-icon name="arrow-left" color="unset"></u-icon>
-							{{ leftText }}
+							<u-icon v-if="isPageUp" name="arrow-left" color="unset"></u-icon>
+							<u-icon v-if="!isPageUp" name="home" size="22" color="unset"></u-icon>
+							{{ isPageUp ? '':leftText }}
 						</view>
 						<!-- #endif -->
 						<!-- 这里考虑到微信小程序分享的页面,在页面中不存在上一页面时,直接返回首页。-->
@@ -106,6 +107,10 @@
 			isFixed: {
 				type: Boolean,
 				default: false
+			},
+			delta: {
+				type: Number,
+				default: 1,
 			}
 		},
 		mounted() {
@@ -143,15 +148,20 @@
 			// 返回上一页面
 			back() {
 				console.log("返回上一页!")
-				uni.navigateBack({
-					delta: 1
-				})
+				if(this.isPageUp) {
+					uni.navigateBack({
+						delta: this.delta
+					})
+				}else {
+					this.homePage()
+				}
+				
 			},
 			// 微信小程序返回首页
 			homePage() {
 				console.log("返回首页!")
-				uni.switchTab({
-					url: '/pages/index/index'
+				uni.reLaunch({
+					url: '/pages/main/index'
 				})
 			}
 		}

+ 17 - 3
pages/login/index.vue

@@ -32,11 +32,15 @@
 								placeholder="请输入密码"
 								border="surround"
 								shape="circle"
-								type="password"
+								:type="passwordType"
 								clearable
 								prefixIcon="lock-fill"
 								prefixIconStyle="font-size: 22px;color: #909399"
-								></u--input>
+								>
+									<template slot="suffix">
+										<u-icon @click="setPasswordType" name="eye"></u-icon>
+									</template>
+								</u--input>
 							</u-form-item>
 						</u--form>
 					</view>
@@ -82,6 +86,7 @@
 						trigger: ['blur', 'change']
 					},
 				},
+				passwordType: 'password'
 			}
 		},
 		onReady() {
@@ -102,7 +107,7 @@
 			// #endif
 		},
 		onShow() {
-
+			this.passwordType = 'password'
 		},
 		methods: {
 			/**
@@ -229,6 +234,15 @@
 					this.redirectToAuth()
 				}
 				
+			},
+			//  设置密码类型
+			setPasswordType(){
+				if(this.passwordType=='password'){
+					this.passwordType = 'text'
+				}else {
+					this.passwordType = 'password'
+				}
+				 
 			}
 		}
 	}

+ 1 - 1
pages/passwordSet/index.vue

@@ -33,7 +33,7 @@
 				title: '这是我的',
 				statusBarHeight: 0, // 状态栏安全距离
 				value: "",
-				tip: ["输入当前密码,确认身份","设置六位数数字密码","再次输入"],
+				tip: ["输入当前密码,确认身份","设置六位数数字密码","再次输入"],
 				actionIndex: 0,
 				password: '',
 				withdrawInfo: {}

+ 11 - 2
pages/resetpass/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="pages">
-		<u-navbar
+		<!-- <u-navbar
 			title="修改密码"
 			:placeholder="true"
 			:autoBack="true"
@@ -9,7 +9,16 @@
 			 :titleStyle="{color:'#fff'}"
 			 leftIconColor="#fff"
 		>
-		</u-navbar>
+		</u-navbar> -->
+		<!-- 头部主要内容 开始 -->
+		<view class="passwordset-content-header">	
+			<customNavbar 
+			title="支付密码设置" 
+			bgColor="var(--gd-bgm-color)"
+			:contentStyle="{color: '#fff'}"
+			:leftStyle="{color: '#fff'}"
+			></customNavbar>
+		</view>
 		<view class="form-wrap">
 			<u--form labelPosition="left" labelWidth="70px" :model="form"  :rules="rules" ref="uForm" >
 				<u-form-item label="旧密码" prop="oldPassword" borderBottom ref="oldPassword" >