小程序倒计时60秒以及解决ios页面晃动问题(前端网备份)

Posted lsc-boke

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小程序倒计时60秒以及解决ios页面晃动问题(前端网备份)相关的知识,希望对你有一定的参考价值。

1》小程序ios页面晃动问题,上下晃动是因为机子本身问题,左右问题可以解决
.container
padding-bottom: 0;
background-repeat: no-repeat;
background-size: 100% auto;
background-position: bottom center;

包个container
2》小程序倒计时60秒 以及倒计时的时候按钮无法点击 ,60秒之后重新
<form bindsubmit="formSubmit" bindreset="formReset">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<view class="weui-cellhd">
<view class="weui-label">手机号</view>
</view>
<view class="weui-cellbd">
<input class="weui-input"name="phone" placeholder="请输入手机号"/>
</view>
</view>
<view class="weui-cell weui-cell_input weui-cell_vcode">
<view class="weui-cellhd">
<view class="weui-label">验证码</view>
</view>
<view class="weui-cellbd">
<input class="weui-input" maxlength=‘6‘ name="yzm" placeholder="请输入验证码" />
</view>
<view class="weui-cell__ft">
<view style=‘width:160rpx;text-align:center;font-size:34rpx‘ data-id="2" bindtap="getBtn" class="buttonget weui-vcode-btn">time</view>
</view>
</view>
<view class="weui-cell weui-cell_input weui-cell_vcode"></view>
</view>

<view class=‘xzsf_bt‘>
<button class="weui-btn" formType="submit" type="primary">确定</button>
</view>
</form>

js
data:
nickName: wx.getStorageSync(‘nickName‘),
head: wx.getStorageSync(‘head‘),
time:"获取验证码",
currentTime:60,
disabled: true
,
formSubmit: function (res)
console.log(res);
var phone = res.detail.value.phone;
var yzm = res.detail.value.yzm;
var rePhone = /^1\d10$/;
if (!rePhone.test(phone))
wx.showToast(
title: ‘请输入正确的手机号码‘,
icon: ‘none‘,
duration: 2000
)
return;

var reyzms = /^\d6$/;
if (!reyzms.test(yzm)) 
  wx.showToast(
    title: ‘请输入正确的验证码‘,
    icon: ‘none‘,
    duration: 2000
  )
  return;

,
getBtn: function (options)
var that = this;
var currentTime = that.data.currentTime;
console.log(currentTime);
//这里是60秒内不能再点击
if (that.data.disabled)
that.setData(
time: currentTime + ‘秒‘,
disabled: false
)
var interval = setInterval(function ()
that.setData(
time: (currentTime - 1) + ‘秒‘,
)
currentTime--;
if (currentTime <= 50)
clearInterval(interval)
that.setData(
time: ‘重新获取‘,
currentTime: 60,
disabled: true
)

    

  , 1000)

,

以上是关于小程序倒计时60秒以及解决ios页面晃动问题(前端网备份)的主要内容,如果未能解决你的问题,请参考以下文章

原创倒计时60秒关机小程序下载

前端常用库-发送短信验证码倒计时60秒

前端常用库-发送短信验证码倒计时60秒

C#实现发送验证码倒计时60秒

前端倒计时工具

XP系统关机弹出窗口 出现系统关机倒计时60秒!怎么解决~没中病毒~ 求救~电脑开机不进入系统自动关机