From 64b432916af9c9218ab3f3eca614e26c542142ae Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 07 十一月 2023 15:47:13 +0800
Subject: [PATCH] bug

---
 minipro_standard/pages/changePassword/changePassword.vue |  161 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/minipro_standard/pages/changePassword/changePassword.vue b/minipro_standard/pages/changePassword/changePassword.vue
new file mode 100644
index 0000000..311f0d2
--- /dev/null
+++ b/minipro_standard/pages/changePassword/changePassword.vue
@@ -0,0 +1,161 @@
+<template>
+	<view class="password">
+		<view class="password_tip">
+			<image src="@/static/password_ic_tip@2x.png" alt="" />
+			<text>瀵嗙爜鐢�6-20涓嫳鏂囧瓧姣嶃�佹暟瀛楁垨绗﹀彿缁勬垚</text>
+		</view>
+		<view class="password_list">
+			<view class="password_list_item">
+				<text>鍘熷瘑鐮�</text>
+				<view class="password_list_item_box">
+					<input type="password" v-model="form.originalPassword" maxlength="20" placeholder="璇疯緭鍏ュ師瀵嗙爜">
+				</view>
+			</view>
+			<view class="password_list_item">
+				<text>鏂板瘑鐮�</text>
+				<view class="password_list_item_box">
+					<input type="password" v-model="form.newPassword" maxlength="20" placeholder="璇疯緭鍏ユ柊瀵嗙爜">
+				</view>
+			</view>
+			<view class="password_list_item">
+				<text>纭瀵嗙爜</text>
+				<view class="password_list_item_box">
+					<input type="password" v-model="form.confirmPassword" maxlength="20" placeholder="鍐嶆杈撳叆鏂板瘑鐮�">
+				</view>
+			</view>
+		</view>
+		<view class="password_footer">
+			<button class="password_footer_submit" @click="submit">
+				<text>瀹屾垚</text>
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { updatePwd } from '@/util/api/PersonalAPI'
+	export default {
+		data() {
+			return {
+				form: {
+					originalPassword: '',
+					newPassword: '',
+					confirmPassword: ''
+				}
+			};
+		},
+		methods: {
+			// 蹇樿瀵嗙爜
+			forgotPassword() {
+				
+			},
+			// 鎻愪氦淇敼
+			submit() {
+				if (!this.form.originalPassword) {
+					uni.showToast({ title: '鍘熷瘑鐮佷笉鑳戒负绌�', icon: 'none', duration: 2000 });
+				} else if (!this.form.newPassword) {
+					uni.showToast({ title: '鏂板瘑鐮佷笉鑳戒负绌�', icon: 'none', duration: 2000 });
+				} else if (!/^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{6,}$/.test(this.form.newPassword)) {
+					uni.showToast({ title: '瀵嗙爜鏍煎紡涓嶆纭�', icon: 'none', duration: 2000 });
+				} else if (!this.form.confirmPassword) {
+					uni.showToast({ title: '纭瀵嗙爜涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+				} else if (this.form.newPassword !== this.form.confirmPassword) {
+					uni.showToast({ title: '涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�', icon: 'none', duration: 2000 });
+				} else {
+					updatePwd({
+						newPwd: this.form.newPassword,
+						oldPwd: this.form.originalPassword
+					}).then(res => {
+						if (res.code === 200) {
+							uni.showToast({ title: '淇敼鎴愬姛', icon: 'success', duration: 2000, mask: true });
+							setTimeout(() => {
+								uni.navigateBack({ delta: 1 });
+							}, 2000)
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.password {
+	    position: absolute;
+	    width: 100%;
+	    height: 100%;
+	    background: white;
+	    .password_tip {
+	        height: 72rpx;
+	        display: flex;
+	        align-items: center;
+	        background: #F7F7F7;
+	        padding: 0 30rpx;
+	        image {
+	            width: 24rpx;
+	            height: 24rpx;
+	            margin-right: 10rpx;
+	        }
+	        text {
+	            font-size: 24rpx;
+	            font-weight: 400;
+	            color: #666666;
+	        }
+	    }
+	    .password_list {
+	        padding: 0 30rpx;
+	        .password_list_item {
+	            display: flex;
+	            align-items: center;
+	            height: 90rpx;
+	            border-bottom: 1rpx solid #E5E5E5;
+	            text {
+	                width: 150rpx;
+	                flex-shrink: 0;
+	                font-size: 30rpx;
+	                font-weight: 400;
+	                color: #222222;
+	            }
+	            .password_list_item_box {
+	                display: flex;
+	                justify-content: space-between;
+	                flex: 1;
+	                input {
+	                    border: none;
+	                    font-size: 30rpx;
+	                }
+	                input::-webkit-input-placeholder {
+	                    font-size: 28rpx;
+	                    font-weight: 400;
+	                    color: #B2B2B2;
+	                }
+	                p {
+	                    font-size: 26rpx;
+	                    font-weight: 400;
+	                    color: #4275FC;
+	                }
+	            }
+	        }
+	    }
+	    .password_footer {
+	        margin-top: 80rpx;
+	        padding: 0 30rpx;
+	        .password_footer_submit {
+	            width: 100%;
+	            height: 88rpx;
+	            border: none;
+	            background: #4275FC;
+	            box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+	            border-radius: 8rpx;
+	            display: flex;
+	            align-items: center;
+	            justify-content: center;
+	            text {
+	                font-size: 30rpx;
+	                font-weight: 500;
+	                color: #FFFFFF;
+	            }
+	        }
+	    }
+	}
+</style>

--
Gitblit v1.9.3