| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  | <template> | 
					
						
							|  |  |  |  |   <view class="main"> | 
					
						
							|  |  |  |  |     <view class="contents"> | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |       <u-form ref="uForm" :model="loginObj" class="paddings" label-width="90px"> | 
					
						
							|  |  |  |  |         <u-form-item :label="'新密码'" prop="newPassword" style="display: flex"> | 
					
						
							|  |  |  |  |           <u-input | 
					
						
							|  |  |  |  |             v-model="loginObj.newPassword" | 
					
						
							|  |  |  |  |             class="border-color" | 
					
						
							|  |  |  |  |             :password="true" | 
					
						
							|  |  |  |  |             :placeholder="'请输入新密码'" | 
					
						
							|  |  |  |  |             placeholder-class="place-class" | 
					
						
							|  |  |  |  |           /> | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         </u-form-item> | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |         <u-form-item | 
					
						
							|  |  |  |  |           :label="'请确认密码'" | 
					
						
							|  |  |  |  |           prop="payPassword" | 
					
						
							|  |  |  |  |           style="display: flex" | 
					
						
							|  |  |  |  |         > | 
					
						
							|  |  |  |  |           <u-input | 
					
						
							|  |  |  |  |             v-model="loginObj.payPassword" | 
					
						
							|  |  |  |  |             class="border-color" | 
					
						
							|  |  |  |  |             :password="true" | 
					
						
							|  |  |  |  |             :placeholder="'请确认密码'" | 
					
						
							|  |  |  |  |             placeholder-class="place-class" | 
					
						
							|  |  |  |  |           /> | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         </u-form-item> | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |         <u-form-item :label="'验证码'" prop="code"> | 
					
						
							|  |  |  |  |           <view class="code-box"> | 
					
						
							|  |  |  |  |             <u-input | 
					
						
							|  |  |  |  |               v-model="loginObj.code" | 
					
						
							|  |  |  |  |               class="border-color" | 
					
						
							|  |  |  |  |               style="width: auto;" | 
					
						
							|  |  |  |  |               :placeholder="'请输入验证码'" | 
					
						
							|  |  |  |  |               placeholder-class="place-class" | 
					
						
							|  |  |  |  |             /> | 
					
						
							|  |  |  |  |             <button :disabled="disabled" class="yzm" @click.stop="getCode()"> | 
					
						
							|  |  |  |  |               {{ getCodeText }} | 
					
						
							|  |  |  |  |             </button> | 
					
						
							|  |  |  |  |           </view> | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         </u-form-item> | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |          | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |       </u-form> | 
					
						
							|  |  |  |  |     </view> | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |     <u-button class="btn" shape="circle" type="success" @click="submit">{{ | 
					
						
							|  |  |  |  |       '确定' | 
					
						
							|  |  |  |  |     }}</u-button> | 
					
						
							|  |  |  |  |     <view style="height: 20rpx"></view> | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   </view> | 
					
						
							|  |  |  |  | </template> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <script> | 
					
						
							|  |  |  |  | import * as api from '@/config/login.js' | 
					
						
							|  |  |  |  | import { setToken } from '@/config/auth.js' | 
					
						
							|  |  |  |  | import address from '@/components/address.vue' | 
					
						
							|  |  |  |  | import store from '@/store' | 
					
						
							|  |  |  |  | import { getData } from '../../config/login' | 
					
						
							|  |  |  |  | export default { | 
					
						
							|  |  |  |  |   data() { | 
					
						
							|  |  |  |  |     return { | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |       getCodeText: '获取验证码', | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |       disabled: false, | 
					
						
							|  |  |  |  |       time: 60, | 
					
						
							|  |  |  |  |       yzmCheck: false, | 
					
						
							|  |  |  |  |       userInfo: '', | 
					
						
							|  |  |  |  |       loginObj: { | 
					
						
							|  |  |  |  |         emailed: '', | 
					
						
							|  |  |  |  |         code: '', | 
					
						
							|  |  |  |  |         email: '', | 
					
						
							|  |  |  |  |       }, | 
					
						
							|  |  |  |  |       rules: { | 
					
						
							|  |  |  |  |         newPassword: [ | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |             // 必填项
 | 
					
						
							|  |  |  |  |             required: true, | 
					
						
							|  |  |  |  |             // 提示内容(会出现在u-form-item内的底部)
 | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |             message: '请输入密码', | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |             trigger: ['blur'], | 
					
						
							|  |  |  |  |           }, | 
					
						
							|  |  |  |  |         ], | 
					
						
							|  |  |  |  |         code: [ | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |             // 必填项
 | 
					
						
							|  |  |  |  |             required: true, | 
					
						
							|  |  |  |  |             // 提示内容(会出现在u-form-item内的底部)
 | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |             message: '请输入短信验证码', | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |             trigger: ['blur'], | 
					
						
							|  |  |  |  |           }, | 
					
						
							|  |  |  |  |         ], | 
					
						
							|  |  |  |  |         payPassword: [ | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |             // 必填项
 | 
					
						
							|  |  |  |  |             required: true, | 
					
						
							|  |  |  |  |             // 提示内容(会出现在u-form-item内的底部)
 | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |             message: '请输入密码', | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |             trigger: ['blur'], | 
					
						
							|  |  |  |  |           }, | 
					
						
							|  |  |  |  |         ], | 
					
						
							|  |  |  |  |       }, | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  |   }, | 
					
						
							|  |  |  |  |   onLoad(option) { | 
					
						
							|  |  |  |  |     // this.getMemberInfo()
 | 
					
						
							|  |  |  |  |   }, | 
					
						
							|  |  |  |  |   onReady() { | 
					
						
							|  |  |  |  |     this.$refs.uForm.setRules(this.rules) | 
					
						
							|  |  |  |  |   }, | 
					
						
							|  |  |  |  |   methods: { | 
					
						
							|  |  |  |  |     submit() { | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |       this.$refs.uForm.validate().then(res => { | 
					
						
							|  |  |  |  |         api.forgetPayPassword(this.loginObj).then(res => { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |           if (res.code == '200') { | 
					
						
							|  |  |  |  |             uni.showToast({ | 
					
						
							|  |  |  |  |               title: res.msg, | 
					
						
							|  |  |  |  |               icon: 'none', | 
					
						
							|  |  |  |  |               success() { | 
					
						
							|  |  |  |  |                 setTimeout(() => { | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |                   uni.navigateBack() | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |                 }, 2000) | 
					
						
							|  |  |  |  |               }, | 
					
						
							|  |  |  |  |             }) | 
					
						
							|  |  |  |  |           } else { | 
					
						
							|  |  |  |  |             uni.showToast({ | 
					
						
							|  |  |  |  |               icon: 'none', | 
					
						
							|  |  |  |  |               title: res.msg, | 
					
						
							|  |  |  |  |             }) | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |             clearInterval(this.time) | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |             this.setTimer(0) | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |         }) | 
					
						
							|  |  |  |  |       }) | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |     getCode() { | 
					
						
							|  |  |  |  |       // this.disabled = true
 | 
					
						
							|  |  |  |  |       // this.getCodeText = "发送中..." //发送验证码
 | 
					
						
							|  |  |  |  |       // this.getCodeisWaiting = true;
 | 
					
						
							|  |  |  |  |       // this.getCodeBtnColor = "rgba(255,255,255,0.5)" //追加样式,修改颜色
 | 
					
						
							|  |  |  |  |       this.getYzm() | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |     getYzm() { | 
					
						
							| 
									
										
										
										
											2025-05-09 14:07:56 +08:00
										 |  |  |  |       api.resetPayPasswordVerification().then(res => { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         if (res.code == '200') { | 
					
						
							|  |  |  |  |           setTimeout(() => { | 
					
						
							|  |  |  |  |             uni.showToast({ | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |               title: '验证码已发送', | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |               icon: 'none', | 
					
						
							|  |  |  |  |             }) //弹出提示框
 | 
					
						
							|  |  |  |  |             this.setTimer(60) //调用定时器方法
 | 
					
						
							|  |  |  |  |           }, 1000) | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |       }) | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |     setTimer(num) { | 
					
						
							|  |  |  |  |       this.disabled = true | 
					
						
							|  |  |  |  |       let holdTime = num //定义变量并赋值
 | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |       this.getCodeText = '重新获取' + '(60)' | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |       //setInterval()是一个实现定时调用的函数,可按照指定的周期(以毫秒计)来调用函数或计算表达式。
 | 
					
						
							|  |  |  |  |       //setInterval方法会不停地调用函数,直到 clearInterval被调用或窗口被关闭。
 | 
					
						
							|  |  |  |  |       this.time = setInterval(() => { | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |         console.log( | 
					
						
							|  |  |  |  |           '%c [ holdTime ]-183', | 
					
						
							|  |  |  |  |           'font-size:13px; background:#5f6e08; color:#a3b24c;', | 
					
						
							|  |  |  |  |           holdTime | 
					
						
							|  |  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         if (holdTime <= 0) { | 
					
						
							|  |  |  |  |           this.disabled = false | 
					
						
							|  |  |  |  |           this.getCodeisWaiting = false | 
					
						
							|  |  |  |  |           this.getCodeBtnColor = '#ffffff' | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |           this.getCodeText = '获取验证码' | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |           clearInterval(this.time) //清除该函数
 | 
					
						
							|  |  |  |  |           return //返回前面
 | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2025-04-01 21:35:18 +08:00
										 |  |  |  |           this.getCodeText = '重新获取' + '(' + holdTime + ')' | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  |           holdTime-- | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |       }, 1000) | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |   }, | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | </script> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <style lang="scss" scoped> | 
					
						
							| 
									
										
										
										
											2025-04-01 17:06:24 +08:00
										 |  |  |  | :v-deep uni-button:after { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   border: none; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-01 17:06:24 +08:00
										 |  |  |  | :v-deep .u-form-item__body__right__message { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   margin-left: 170rpx !important; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  | .code-box { | 
					
						
							|  |  |  |  |   display: flex; | 
					
						
							|  |  |  |  |   align-items: center; | 
					
						
							|  |  |  |  |   justify-content: space-between; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  | .yzm { | 
					
						
							|  |  |  |  |   // width: 161rpx;
 | 
					
						
							|  |  |  |  |   height: 74rpx; | 
					
						
							|  |  |  |  |   line-height: 74rpx; | 
					
						
							|  |  |  |  |   text-align: center; | 
					
						
							|  |  |  |  |   color: #fff; | 
					
						
							|  |  |  |  |   background: #2fbc42; | 
					
						
							|  |  |  |  |   border-radius: 40rpx; | 
					
						
							|  |  |  |  |   margin-left: 30rpx; | 
					
						
							|  |  |  |  |   font-size: 24rpx; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-01 17:06:24 +08:00
										 |  |  |  | :v-deep .u-form-item:nth-child(2) { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   width: 670rpx; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | .contents { | 
					
						
							|  |  |  |  |   background-color: #fff; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | page { | 
					
						
							|  |  |  |  |   background-color: #f2f2f2; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-01 17:06:24 +08:00
										 |  |  |  | :v-deep .width-s { | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   width: 200rpx !important; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | .paddings { | 
					
						
							|  |  |  |  |   padding: 30rpx 0rpx; | 
					
						
							|  |  |  |  |   margin: 0 40rpx; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | .border-color { | 
					
						
							|  |  |  |  |   border-radius: 50rpx; | 
					
						
							|  |  |  |  |   padding-left: 50rpx !important; | 
					
						
							|  |  |  |  |   font-size: 28rpx; | 
					
						
							|  |  |  |  |   width: 400rpx; | 
					
						
							|  |  |  |  |   height: 60rpx; | 
					
						
							|  |  |  |  |   background: #f5f6f8; | 
					
						
							|  |  |  |  |   border: none; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | .btn { | 
					
						
							| 
									
										
										
										
											2025-04-22 17:47:02 +08:00
										 |  |  |  |   background-color: #005BAC; | 
					
						
							| 
									
										
										
										
											2025-03-23 09:29:40 +08:00
										 |  |  |  |   border: none; | 
					
						
							|  |  |  |  |   height: 92rpx; | 
					
						
							|  |  |  |  |   line-height: 92rpx; | 
					
						
							|  |  |  |  |   font-size: 30rpx; | 
					
						
							|  |  |  |  |   margin: 40rpx auto; | 
					
						
							|  |  |  |  |   width: 690rpx; | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-11 10:05:35 +08:00
										 |  |  |  | </style> |