瀏覽代碼

修改 扫码图标、修改重置密码

achao 2 年之前
父節點
當前提交
5f63819bf6
共有 2 個文件被更改,包括 43 次插入38 次删除
  1. 3 3
      pages/mine/index.vue
  2. 40 35
      pages/mine/settings/editPassword.vue

+ 3 - 3
pages/mine/index.vue

@@ -3,9 +3,9 @@
 	<view class="container">
 		<view class='container_content'>
 			<view class="head">
-				<view style='margin-bottom:14px;' class="row flex flex-end" v-if='hasLogin'>
+				<view style='margin-bottom:14px;' class="row flex flex-end">
 					<u--image class='image' :showLoading="true" src="../../static/mine/saoma.png" width="20px"
-						height="20px" @click="scanCode()"></u--image>
+						height="20px" @click="scanCode()" v-if='hasLogin'></u--image>
 					<u--image @click="goDetailPage('/pages/mine/set')" style='margin-right:0;' class='image'
 						:showLoading="true" src="../../static/mine/shezhi.png" width="20px" height="20px"></u--image>
 				</view>
@@ -194,7 +194,7 @@
 						}
 					} else {
 						this.userName = this.userInfo.userName
-						this.cargoCall=""
+						this.cargoCall = ""
 					}
 					this.$forceUpdate()
 				})

+ 40 - 35
pages/mine/settings/editPassword.vue

@@ -2,24 +2,26 @@
 	<view class="u-page content">
 		<u-icon class="back-btn" name="arrow-left" color="black" size="20" @click="navBack"></u-icon>
 		<view class="wrapper">
-				<h2 class="Semibold">重置密码</h2>
+			<h2 class="Semibold">重置密码</h2>
 			<u--form labelPosition="left" :model="registerData" ref="registerForm" labelWidth="80">
 				<u-form-item label="手机号" prop="phone" borderBottom>
-					<u--input v-model="registerData.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
+					<u--input v-model="registerData.phone" border="none" maxlength="11" placeholder="请输入手机号码">
+					</u--input>
 				</u-form-item>
-			
-				<u-form-item label="验证码" prop="code"borderBottom>
+
+				<u-form-item label="验证码" prop="code" borderBottom>
 					<u--input v-model="registerData.verifyCode" border="none" placeholder="请填写验证码"></u--input>
-					<button  :disabled="disabled1" class="code-style code-small" @tap="getCode">{{tips}}</button>
+					<button :disabled="disabled1" class="code-style code-small" @tap="getCode">{{tips}}</button>
 				</u-form-item>
 				<u-form-item label="新密码" prop="password" borderBottom>
 					<u--input v-model="registerData.password" border="none" placeholder="请输入新密码,6-16位字符"></u--input>
 				</u-form-item>
-			
-				<u-code ref="uCode" @change="codeChange" seconds="60" @start="disabled1 = true" @end="disabled1 = false">
+
+				<u-code ref="uCode" @change="codeChange" seconds="60" @start="disabled1 = true"
+					@end="disabled1 = false">
 				</u-code>
 			</u--form>
-			<button class="code-style reset">重置密码</button>
+			<button class="code-style reset" @click="reset">重置密码</button>
 		</view>
 
 
@@ -124,39 +126,39 @@
 			//修改密码
 			reset() {
 				uni.showLoading({
-					title: '加载中1'
+					title: '加载中'
 				})
 				this.$refs.registerForm.validate().then(res => {
 					uni.$u.toast('校验通过')
 					_this.isLoading = true
 					_this.registerData.identification = 2
 					_this.$request.baseRequest('post', '/commonUser/resetPassword', _this.registerData).then(
-						res => {
-							// 获得数据
-							if (res.code == 200) {
-								uni.clearStorageSync();
-								this.$request.baseRequest('post', '/auth/api/logout').then(res => {
-									
-								})
-								this.$store.commit('logout')
-								// this.$api.logout()
+							res => {
+								// 获得数据
+								if (res.code == 200) {
+									uni.clearStorageSync();
+									this.$request.baseRequest('post', '/auth/api/logout').then(res => {
+
+									})
+									this.$store.commit('logout')
+									// this.$api.logout()
 									uni.showToast({
 										title: '修改成功',
 										icon: 'none',
 										duration: 2000
 									})
-							uni.navigateTo({
-								url: `/pages/public/login`
+									uni.navigateTo({
+										url: `/pages/public/login`
+									})
+								} else {
+									uni.showToast({
+										title: "系统异常或验证码已过期,请退出重试",
+										icon: 'none',
+										duration: 2000
+									})
+								}
+								uni.hideLoading()
 							})
-							} else {
-								uni.showToast({
-									title: "系统异常或验证码已过期,请退出重试",
-									icon: 'none',
-									duration: 2000
-								})
-							}
-							uni.hideLoading()
-						})
 						.catch(res => {
 							uni.$u.toast(res.message)
 						});
@@ -199,15 +201,18 @@
 		background: #2772FB;
 		color: white;
 	}
-	.reset{
+
+	.reset {
 		margin-top: 50rpx;
 	}
-	.Semibold{
+
+	.Semibold {
 		margin-bottom: 50rpx;
 	}
-	.code-small{
-		width:200rpx;
-		height:60rpx;
-		font-size:24rpx;
+
+	.code-small {
+		width: 200rpx;
+		height: 60rpx;
+		font-size: 24rpx;
 	}
 </style>