From 17efddc6a667670dca682bf36b51a43e99615e6d Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 16 十月 2024 15:59:38 +0800
Subject: [PATCH] 代码初始化

---
 h5/pages/changePassword/changePassword.vue |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/h5/pages/changePassword/changePassword.vue b/h5/pages/changePassword/changePassword.vue
index f79f54c..0533847 100644
--- a/h5/pages/changePassword/changePassword.vue
+++ b/h5/pages/changePassword/changePassword.vue
@@ -1,9 +1,5 @@
 <template>
 	<view class="box">
-		<view class="box_tips">
-			<image src="@/static/ic_tip@2x.png" mode="widthFix"></image>
-			<text>濡傞仐蹇樺瘑鐮侊紝璇疯仈绯诲洯鍖虹郴缁熺鐞嗗憳閲嶇疆</text>
-		</view>
 		<view class="list">
 			<view class="list_item">
 				<view class="list_item_label">
@@ -11,7 +7,7 @@
 					<text>*</text>
 				</view>
 				<view class="list_item_content">
-					<input type="number" maxlength="11" placeholder="璇疯緭鍏ユ棫瀵嗙爜" placeholder-style="color: #999999;" />
+					<input type="password" v-model="param.oldPwd" :maxlength="32" placeholder="璇疯緭鍏ユ棫瀵嗙爜" placeholder-style="color: #999999;" />
 				</view>
 			</view>
 			<view class="list_item">
@@ -20,7 +16,7 @@
 					<text>*</text>
 				</view>
 				<view class="list_item_content">
-					<input type="number" maxlength="11" placeholder="璇疯緭鍏�6-18浣嶆暟瀛椼�佸瓧姣嶇粍鍚堟柊瀵嗙爜" placeholder-style="color: #999999;" />
+					<input type="password" v-model="param.newPwd" :maxlength="32" placeholder="璇疯緭鍏�6-18浣嶆暟瀛椼�佸瓧姣嶇粍鍚�" placeholder-style="color: #999999;" />
 				</view>
 			</view>
 			<view class="list_item">
@@ -29,22 +25,64 @@
 					<text>*</text>
 				</view>
 				<view class="list_item_content">
-					<input type="number" maxlength="11" placeholder="璇疯緭鍏�6-18浣嶆暟瀛椼�佸瓧姣嶇粍鍚堟柊瀵嗙爜" placeholder-style="color: #999999;" />
+					<input type="password" v-model="param.newPwdTemp" :maxlength="32" placeholder="璇峰啀杈撲竴娆℃柊瀵嗙爜" placeholder-style="color: #999999;" />
 				</view>
 			</view>
 		</view>
+		<view class="box_tips">
+			<u-icon name="info-circle" class="mr12" color="#4d99a8"></u-icon>
+			<text>濡傚瘑鐮侀仐蹇橈紝璇疯仈绯诲洯鍖虹郴缁熺鐞嗗憳閲嶇疆</text>
+		</view>
 		<view class="footer-box">
-			<view class="submit-button">鎻愪氦</view>
+			<view class="submit-button" @click="onSubmit">鎻愪氦</view>
 		</view>
 	</view>
 </template>
 
 <script>
+import { uploadPassword } from '@/api'
 	export default {
 		data() {
 			return {
-				
+				param: {}
 			};
+		},
+		methods: {
+			onSubmit() {
+      const { param } = this
+      if (!param.oldPwd) return uni.showToast({
+        title: '鏃у瘑鐮佷笉鑳戒负绌�',
+        icon: 'none'
+      })
+      if (!param.newPwd) return uni.showToast({
+        title: '鏂板瘑鐮佷笉鑳戒负绌�',
+        icon: 'none'
+      })
+      if (!param.newPwdTemp) return uni.showToast({
+        title: '纭瀵嗙爜涓嶈兘涓虹┖',
+        icon: 'none'
+      })
+      if (param.newPwdTemp != param.newPwd) return uni.showToast({
+        title: '涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�',
+        icon: 'none'
+      })
+      uploadPassword({
+        ...param
+      }).then(res => {
+        if (res && res.code == 200) {
+          setTimeout(() => {
+            uni.showToast({
+              title: '瀵嗙爜淇敼鎴愬姛,璇烽噸鏂扮櫥褰�',
+              icon: 'success',
+              duration: 2000
+            })
+          })
+          uni.redirectTo({
+            url: "/pages/staffLogin/login"
+          })
+        }
+      })
+    }
 		}
 	}
 </script>
@@ -70,7 +108,7 @@
 			text {
 				font-size: 26rpx;
 				font-weight: 400;
-				color: #E0312A;
+				color: #4c99a7;
 			}
 		}
 		.list {
@@ -135,8 +173,7 @@
 		}
 		.footer-box {
 			width: 100%;
-			position: fixed;
-			bottom: 30rpx;
+			margin-top: 48rpx;
 			height: 80rpx;
 			display: flex;
 			justify-content: center;
@@ -145,7 +182,7 @@
 				width: calc(100% - 60rpx);
 				height: 88rpx;
 				line-height: 88rpx;
-				background: #025eef;
+				background: #4d99a8;
 				border-radius: 4rpx;
 				color: #fff;
 				border-radius: 44rpx;

--
Gitblit v1.9.3