Commit bbef1970 authored by yyh's avatar yyh

认证成功倒计时

parent d6b463d3
......@@ -4,7 +4,7 @@
<p class="title">恭喜您,资料上传成功</p>
<p class="desc">我们会在24小时内审核完成。</p>
<div @click="goUserCenter" class="btn">返回个人中心</div>
<div class="tip">5秒后跳转到个人中心</div>
<div class="tip">{{count}}秒后跳转到个人中心</div>
</div>
</template>
<script lang="ts">
......@@ -24,12 +24,18 @@ import { Route } from 'vue-router';
},
})
export default class UploadSuccess extends Vue {
private count: number = 5;
private mounted() {
const timer = setTimeout(() => {
this.$router.replace('/userCenter/index');
}, 5000);
const timer = setInterval(() => {
const { count } = this;
if ( count <= 0) {
clearInterval(timer);
return this.$router.replace('/userCenter/index');
}
this.count--;
}, 1000);
this.$once('hook:beforeDestory', () => {
clearTimeout(timer);
clearInterval(timer);
});
}
private goUserCenter() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment