5252 </tiny-tooltip >
5353 </tiny-form-item >
5454 <tiny-form-item >
55- <tiny-button type =" primary" @click =" handleForgot" > 提交</tiny-button >
55+ <tiny-button :disabled = " !isReady " type =" primary" @click =" handleForgot" > 提交</tiny-button >
5656 </tiny-form-item >
5757 </tiny-form >
58+ <div class =" forgot-bottom" >
59+ <div class =" to-login" @click =" toLogin" >去登录</div >
60+ </div >
5861 </div >
5962</template >
6063
6164<script lang="ts">
62- import { reactive , watch } from ' vue'
65+ import { reactive , watch , computed } from ' vue'
6366import { TinyForm , TinyFormItem , TinyInput , TinyButton , TinyTooltip } from ' @opentiny/vue'
6467import useLogin from ' ./js/useLogin'
6568import { getMetaApi , META_SERVICE } from ' @opentiny/tiny-engine-meta-register'
@@ -87,6 +90,17 @@ export default {
8790 rules: [... useLogin ().passwordRules ]
8891 })
8992
93+ const isReady = computed (() => {
94+ return (
95+ state .forgotData .username &&
96+ state .forgotData .password &&
97+ state .forgotData .key &&
98+ state .forgotData .confirmPassword &&
99+ ! state .pwManualShow &&
100+ state .forgotData .confirmPassword === state .forgotData .password
101+ )
102+ })
103+
90104 const handleConfirmPwChange = () => {
91105 if (state .forgotData .confirmPassword !== state .forgotData .password ) {
92106 state .confirmManualShow = true
@@ -131,6 +145,10 @@ export default {
131145 }
132146 }
133147
148+ const toLogin = () => {
149+ emit (' changeStatus' , useLogin ().LOGIN )
150+ }
151+
134152 watch (
135153 () => state .forgotData .password ,
136154 () => {
@@ -139,7 +157,9 @@ export default {
139157 )
140158 return {
141159 state ,
142- handleForgot
160+ isReady ,
161+ handleForgot ,
162+ toLogin
143163 }
144164 }
145165}
@@ -150,7 +170,7 @@ export default {
150170 color : #191919 ;
151171 font-size : 24px ;
152172 font-weight : 600 ;
153- margin-bottom : 28 px ;
173+ margin-bottom : 36 px ;
154174}
155175
156176.pw-tips {
@@ -170,6 +190,16 @@ export default {
170190 }
171191}
172192
193+ .forgot-bottom {
194+ display : flex ;
195+ justify-content : center ;
196+ font-size : 14px ;
197+ .to-login {
198+ cursor : pointer ;
199+ color : #1476ff ;
200+ }
201+ }
202+
173203:deep(.tiny-form-item__content ) {
174204 margin-left : 0 !important ;
175205}
0 commit comments