From ec597288f2bb4d25d8752e2e24402306719833d4 Mon Sep 17 00:00:00 2001 From: nidapeng <jp@doumee.com> Date: 星期五, 29 三月 2024 15:25:28 +0800 Subject: [PATCH] 提交一把 --- company/src/components/business/operaverifyPhoneNumberWindew.vue | 150 +++++++++++++++++++++++++------------------------- 1 files changed, 75 insertions(+), 75 deletions(-) diff --git a/company/src/components/business/operaverifyPhoneNumberWindew.vue b/company/src/components/business/operaverifyPhoneNumberWindew.vue index 85cd927..f218701 100644 --- a/company/src/components/business/operaverifyPhoneNumberWindew.vue +++ b/company/src/components/business/operaverifyPhoneNumberWindew.vue @@ -22,80 +22,80 @@ </template> <script> - import BaseOpera from '@/components/base/BaseOpera' - import GlobalWindow from '@/components/common/GlobalWindow' - import { sendSms, validateCode } from '@/api/business/smsEmail' - import { mapState } from 'vuex' - export default { - name: 'operaverifyPhoneNumberWindew', - extends: BaseOpera, - components: { GlobalWindow }, - data () { - return { - form: { - phone: this.$store.state.userInfo.company.phone, - code: '' - }, - rules: { - code: [ - { required: true, message: '璇疯緭鍏ラ獙璇佺爜' } - ] - }, - num: 0, - timer: null - } - }, - computed: { - ...mapState(['userInfo']) - }, - methods: { - open (title) { - this.title = title - this.num = 0 - clearInterval(this.timer) - this.timer = null - this.visible = true - this.$nextTick(() => { - this.$refs.form.resetFields() - }) - }, - send () { - sendSms({ - phone: this.form.phone - }).then(res => { - this.num = 60 - this.setTime() - }) - }, - setTime () { - this.timer = setInterval(() => { - if (this.num === 0) { - clearInterval(this.timer) - this.timer = null - return - } - this.num = this.num - 1 - }, 1000) - }, - confirm () { - this.$refs.form.validate((valid) => { - if (!valid) { - return - } - this.isWorking = true - validateCode({ - code: this.form.code - }).then(res => { - this.visible = false - this.$tip.apiSuccess('鎿嶄綔鎴愬姛') - this.$emit('success') - }).catch(e => { - this.$tip.apiFailed(e) - }).finally(() => { - this.isWorking = false - }) - }) - } - } +import BaseOpera from '@/components/base/BaseOpera' +import GlobalWindow from '@/components/common/GlobalWindow' +import { sendSms, validateCode } from '@/api/business/smsEmail' +import { mapState } from 'vuex' +export default { + name: 'operaverifyPhoneNumberWindew', + extends: BaseOpera, + components: { GlobalWindow }, + data () { + return { + form: { + phone: this.$store.state.userInfo.company.phone, + code: '' + }, + rules: { + code: [ + { required: true, message: '璇疯緭鍏ラ獙璇佺爜' } + ] + }, + num: 0, + timer: null } + }, + computed: { + ...mapState(['userInfo']) + }, + methods: { + open (title) { + this.title = title + this.num = 0 + clearInterval(this.timer) + this.timer = null + this.visible = true + this.$nextTick(() => { + this.$refs.form.resetFields() + }) + }, + send () { + sendSms({ + phone: this.form.phone + }).then(res => { + this.num = 60 + this.setTime() + }) + }, + setTime () { + this.timer = setInterval(() => { + if (this.num === 0) { + clearInterval(this.timer) + this.timer = null + return + } + this.num = this.num - 1 + }, 1000) + }, + confirm () { + this.$refs.form.validate((valid) => { + if (!valid) { + return + } + this.isWorking = true + validateCode({ + code: this.form.code + }).then(res => { + this.visible = false + this.$tip.apiSuccess('鎿嶄綔鎴愬姛') + this.$emit('success') + }).catch(e => { + this.$tip.apiFailed(e) + }).finally(() => { + this.isWorking = false + }) + }) + } + } +} </script> -- Gitblit v1.9.3