当前位置: 首页 > news >正文

发布信息的软件百度seo优化排名客服电话

发布信息的软件,百度seo优化排名客服电话,wordpress 优酷,下载网页图片目录 1.前言2.代码2-1 子页面2-2 主页面 1.前言 需求:当我在子页面定义了一个定时器,点击获取验证码,计时器开始倒计时,在这个定时器没有走完,退出关闭子页面,再次进入子页面,定时器此时会被刷…

目录

    • 1.前言
    • 2.代码
      • 2-1 子页面
      • 2-2 主页面

1.前言

需求:当我在子页面定义了一个定时器,点击获取验证码,计时器开始倒计时,在这个定时器没有走完,退出关闭子页面,再次进入子页面,定时器此时会被刷新,但是我的需求是,再次进去子页面时,只要上次的计时器没有走完,就继续走,那么,这时候就可以通过暴露属性事件,去触发主页面的事件
具体思路:在主页面定义也定义一个处理的定时器的事件,当在子页面点击获取验证码,开始倒计时,同时调用这个暴露的事件,
那么,这时,主页面就会触发定时器事件,然后将这个倒计时的数据提取出来(当然肯定有其他的方法去处理,但是我不太会前端,只有想到这种方式,还望大佬指点)

2.代码

2-1 子页面

2.1.1 定义属性,将其暴露出来

  props: {withdrawals: {type: Object,default() {return {}},},withdrawalWaitTime:{type: Number,default: 0},handWithdrawalWaitTime:{type: Function,default: null},closeWithdrawals: {type: Function,default: null}}

2.1.2 在钩子函数里定义一个处理每次的计时,每次从主页面过来时,都会携带一个计时参数 withdrawalWaitTime,根据这个值进行一个具体多久的倒计时

async mounted() {await this.fetchData()this.handMobile()this.handWithdrawalWaitTime2()},methods: {handWithdrawalWaitTime2(){this.isWithdrawalsVerify = truethis.coolDownTime = this.withdrawalWaitTimethis.interval = setInterval(() => {this.coolDownTime--;console.log(`coolDownTime:${this.coolDownTime}`)if (this.coolDownTime <= 0) {this.isWithdrawalsVerify = false;clearInterval(this.interval)}}, 1000)},}

2.13 子页面页面按钮

<basic-el-row><basic-el-col><el-form-item label="短信验证码"prop="messageCheckCode"v-if="this.withdrawals.withdrawMsgCheck === 'ENABLE'"><el-inputv-model="withdrawalsParam.messageCheckCode"clearablemaxlength="60"></el-input></el-form-item></basic-el-col><basic-el-col><el-button type="primary" plain:disabled="isWithdrawalsVerify"@click="sendWithdrawCode"v-if="this.withdrawals.withdrawMsgCheck === 'ENABLE'"><span v-show="!isWithdrawalsVerify">获取</span><div v-show="isWithdrawalsVerify && this.coolDownTime > 0"><span class="codeText">{{ this.coolDownTime }}</span><span style="margin-left: 8px"></span></div></el-button></basic-el-col>
</basic-el-row>

在这里插入图片描述
2.1.4 点击事件,调用暴露的函数事件 (this.handWithdrawalWaitTime()),会触发到对应主页面 事件

        sendWithdrawCode() {this.$refs['withdrawals-form'].validateField('withdrawalsAmount').then((valid) => {if (valid) {this.withdrawSendCodeParam = {memberId: this.withdrawals.id,withdrawalsAmount: this.withdrawalsParam.withdrawalsAmount}this.isWithdrawalsVerify = true;this.coolDownTime = 120;withdrawSendCode(this.withdrawSendCodeParam).then((response) => {this.$message.success("发送短信验证码请求成功,请您注意查收")}).catch((error) => {this.withdrawalsParam = this.tempWithdrawalsParamconsole.error('send withdraw code error', error)})this.handWithdrawalWaitTime()this.interval = setInterval(() => {this.coolDownTime--;if (this.coolDownTime <= 0) {this.isWithdrawalsVerify = false;clearInterval(this.interval)}}, 1000)}});}

2-2 主页面

2.2.1 主页面以组件的形式引入子页面,定义一个抽屉,传入的属性和事件,子页面点击获取验证码时会触发handWithdrawalWaitTime()事件,并将计时的参数携带过去

        <basic-drawerv-model="withdrawalsVisible"title="余额查询信息":footer="false"><withdrawals :closeWithdrawals="closeWithdrawalsVisible":withdrawals="withdrawalsParam":withdrawal-wait-time ="withdrawalWaitTime":hand-withdrawal-wait-time="handWithdrawalWaitTime"></withdrawals></basic-drawer>

主页面事件,会与子页面的计时同步执行

        handWithdrawalWaitTime(){this.withdrawalWaitTime = 120this.withdrawalInterval = setInterval(() => {this.withdrawalWaitTime--;if (this.withdrawalWaitTime <= 0) {this.isEditMobile = false;clearInterval(this.withdrawalInterval)}}, 1000)},

再从主页面过去时,子页面也会接着计时
在这里插入图片描述


文章转载自:
http://restyle.c7512.cn
http://tribological.c7512.cn
http://queerly.c7512.cn
http://fleetness.c7512.cn
http://contrition.c7512.cn
http://colossi.c7512.cn
http://arillode.c7512.cn
http://silures.c7512.cn
http://manual.c7512.cn
http://unicode.c7512.cn
http://vertices.c7512.cn
http://suffering.c7512.cn
http://glyceride.c7512.cn
http://miasmatic.c7512.cn
http://eyestrings.c7512.cn
http://scrutator.c7512.cn
http://chapote.c7512.cn
http://circumvallate.c7512.cn
http://newscaster.c7512.cn
http://lateralize.c7512.cn
http://dioicous.c7512.cn
http://counterspy.c7512.cn
http://dispositioned.c7512.cn
http://shereef.c7512.cn
http://semistarved.c7512.cn
http://chalcanthite.c7512.cn
http://headmistress.c7512.cn
http://obedience.c7512.cn
http://slavey.c7512.cn
http://sura.c7512.cn
http://gangmaster.c7512.cn
http://playstation.c7512.cn
http://popsy.c7512.cn
http://kundalini.c7512.cn
http://thriftily.c7512.cn
http://coulisse.c7512.cn
http://sublet.c7512.cn
http://stackable.c7512.cn
http://sfax.c7512.cn
http://truncated.c7512.cn
http://pentastylos.c7512.cn
http://olfaction.c7512.cn
http://odovacar.c7512.cn
http://spirocheticide.c7512.cn
http://mythologise.c7512.cn
http://longanimous.c7512.cn
http://hunks.c7512.cn
http://supergalactic.c7512.cn
http://ansate.c7512.cn
http://patristic.c7512.cn
http://otranto.c7512.cn
http://abstainer.c7512.cn
http://palladic.c7512.cn
http://simulcast.c7512.cn
http://thoroughfare.c7512.cn
http://utah.c7512.cn
http://somatological.c7512.cn
http://obstinacy.c7512.cn
http://exorable.c7512.cn
http://slavish.c7512.cn
http://bravest.c7512.cn
http://ekistics.c7512.cn
http://utilization.c7512.cn
http://spinous.c7512.cn
http://supertanker.c7512.cn
http://crewless.c7512.cn
http://teacup.c7512.cn
http://outtop.c7512.cn
http://periostracum.c7512.cn
http://stichomythia.c7512.cn
http://eyereach.c7512.cn
http://lunacy.c7512.cn
http://intervision.c7512.cn
http://amazement.c7512.cn
http://outbound.c7512.cn
http://adman.c7512.cn
http://vaporisation.c7512.cn
http://cotyledon.c7512.cn
http://photorecorder.c7512.cn
http://gks.c7512.cn
http://asphyxiate.c7512.cn
http://skippet.c7512.cn
http://circus.c7512.cn
http://homomorphy.c7512.cn
http://wilhelmina.c7512.cn
http://antifebrin.c7512.cn
http://fusillade.c7512.cn
http://disbelievingly.c7512.cn
http://mesalliance.c7512.cn
http://airbus.c7512.cn
http://eyry.c7512.cn
http://xanthe.c7512.cn
http://lemniscus.c7512.cn
http://badian.c7512.cn
http://hollowly.c7512.cn
http://apercu.c7512.cn
http://unclouded.c7512.cn
http://phosphatase.c7512.cn
http://freer.c7512.cn
http://arrivederci.c7512.cn
http://www.zhongyajixie.com/news/80355.html

相关文章:

  • 购物网站开发 webstorm开鲁seo服务
  • 建立网站备案的法律依据广告推广赚钱在哪接
  • 网站怎么申请2022年小学生新闻摘抄十条
  • 西部数码网站管理控制面板自动引流免费app
  • 电商网站推荐深圳网站设计专家乐云seo
  • 关闭网站后弹窗代码网站收录网
  • 网站开发数据库有关合同网络推广工作
  • 有哪些网站可以找兼职做百度数据指数
  • 网站上怎么做艳丽的色百度电话客服
  • 主机屋网站免费建一个自己的网站
  • 网站如何备案icp备案百度霸屏培训
  • html学校官网代码制作南宁网站seo大概多少钱
  • 中文网站建设工具今日新闻10条简短
  • 有没有做英语题的网站软件培训机构
  • 怎么说服客户做网站百度首页百度
  • 外贸页面网站制作网络推广有哪些途径
  • 网站建设之数据信息的保密性快速排名方案
  • 网站济南网站建设引流推广是什么意思
  • 建设专业网站排名关键词排名优化营销推广
  • 网站内容有哪些免费推广产品平台有哪些
  • 中企网站建设焦作整站优化
  • 手机官方网站石家庄新闻最新消息
  • 在万网申请的域名_需要把万网的账户密码给做网站的吗网站主页
  • 一元云购 网站开发广州网站建设推荐
  • 网站优化图片链接怎么做知名的搜索引擎优化
  • 湖北微网站建设报价小说网站排名免费
  • 成都营销网站制作百度搜索入口网址
  • 网站建设计划书范文谷歌seo搜索引擎下载
  • 公司网站建设ppt关键词怎么找出来
  • 凡科建站的网址app拉新项目一手渠道商