| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 | 
							- <template>
 
- 	<view class="content">
 
- 		<view class="updatePassword-wrap">
 
- 			<view class="username item">
 
- 				<text>新密码:</text>
 
- 				<uni-easyinput :inputBorder="false" v-model="password"
 
- 					class="input" 
 
- 					type="text"  
 
- 					placeholder="请输入新密码" />
 
- 			</view>
 
- 			<view class="password item">
 
- 				<text>确认密码:</text>
 
- 				<uni-easyinput v-model="rePassword"
 
- 				 :inputBorder="false" 
 
- 				 class="input"
 
- 				 type="text"  placeholder="请确认密码">
 
- 				</uni-easyinput>
 
- 			</view>
 
- 			<button type="primary" @click="submit" class="submit-BT">提交</button>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {updatePwd} from '@/api/system/user.js'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				password: "",
 
- 				rePassword: "",
 
- 			}
 
- 		},
 
- 		methods: {		
 
- 			submit() {		
 
- 				let rePassword = (this.rePassword).trim();
 
- 				let password = (this.password).trim();
 
- 				if (password.length < 1) {
 
- 					uni.showToast({
 
- 						title: '请填写新密码',
 
- 						icon: "error"
 
- 					})
 
- 					return;
 
- 				}
 
- 				if (rePassword!==password) {
 
- 					uni.showToast({
 
- 						title: '两次密码不一致',
 
- 						icon: "error"
 
- 					})					
 
- 					return;
 
- 				}
 
- 				updatePwd({
 
- 					password,
 
- 					rePassword
 
- 				}).then(()=>{
 
- 					uni.showToast({
 
- 						title:'修改成功',
 
- 						duration:2000,
 
- 						complete() {
 
- 							uni.reLaunch({
 
- 								url:'/pages/login/index'
 
- 							})
 
- 						}
 
- 					})					
 
- 				})
 
- 			}
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss" scoped>
 
- 	.content {
 
- 		.head {
 
- 			font-size: 50upx;
 
- 			text-align: center;
 
- 			padding: 40upx 0;
 
- 			letter-spacing: 2upx;
 
- 		}
 
- 		.updatePassword-wrap {
 
- 			margin: 100upx auto 0;
 
- 			box-sizing: border-box;
 
- 			padding: 20upx 30upx;
 
- 			border-radius: 8upx;
 
- 			.item {
 
- 				display: flex;
 
- 				justify-content: flex-start;
 
- 				align-items: center;
 
- 				height: 90upx;
 
- 				font-size: 32upx;
 
- 				line-height: 90upx;
 
- 				background-color: #fff;
 
- 				border-radius: 50upx;
 
- 				padding: 0 20upx;
 
- 				.input{
 
- 					width: 520upx;
 
- 					border: none;
 
- 				}
 
- 				&.password {
 
- 					margin-top: 40upx;
 
- 				}
 
- 			}
 
- 			.tip {
 
- 				text-align: right;
 
- 				padding: 18upx 0;
 
- 				font-size: 28upx;
 
- 			}
 
- 			.submit-BT {
 
- 				width: 600rpx;
 
- 				height: 72rpx;
 
- 				line-height: 72rpx;	
 
- 				text-align: center;							
 
- 				background:#3D90F4;
 
- 				border-radius: 42rpx;	
 
- 				font-size: 32rpx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: 400;
 
- 				color: #FFFFFF;
 
- 				z-index: 999;
 
- 				margin: 100rpx auto;
 
- 			}
 
- 		}
 
- 	}
 
- </style>
 
 
  |