瀏覽代碼

手机验证界面

tags/2.2.4
Stormeye.Wu 6 年之前
父節點
當前提交
7b90e75a7a
共有 3 個文件被更改,包括 28 次插入17 次删除
  1. +1
    -0
      app.json
  2. +26
    -16
      pages/phoneinput/phoneinput.js
  3. +1
    -1
      pages/phoneinput/phoneinput.json

+ 1
- 0
app.json 查看文件

@@ -4,6 +4,7 @@
"pages/bannerdetail/index",
"pages/getuserinfo/index",
"pages/getphoneInfo/index",
"pages/phoneinput/phoneinput",
"pages/market/index",
"pages/user/index",
"pages/coupon/detail/index",


+ 26
- 16
pages/phoneinput/phoneinput.js 查看文件

@@ -31,7 +31,7 @@ Page({
})
.then(res => {
wx.redirectTo({
url: '../coupon/detail/index?id=' + that.data.couponId + "&flag=pay",
url: '/pages/coupon/detail/index?id=' + that.data.couponId + "&flag=pay",
})
})
.catch(error => {
@@ -40,11 +40,27 @@ Page({
})
})
},
//计时器
timerInfo() {
var timer = setInterval(() => {
this.data.time--
this.setData({
time: this.data.time
})
if (this.data.time == 0) {
clearInterval(timer)
this.setData({
flag: true,
retry: false,
time: 60
})
}
}, 1000)
},
send() {
var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
if (phoneReg.test(this.data.phone)) {
this.setData({
flag: false,
retry: true
})
Http.get({
@@ -58,20 +74,14 @@ Page({
})
.then(res => {
console.log(res)
var timer = setInterval(() => {
this.data.time--
this.setData({
time: this.data.time
})
if (this.data.time == 0) {
clearInterval(timer)
this.setData({
flag: true,
retry: false,
time: 60
})
}
}, 1000)
that.timerInfo()
if (res.code == 200) {
console.log(res)
} else {
wx.showToast({
title: res.message
})
}
})
.catch(error => {
wx.showToast({


+ 1
- 1
pages/phoneinput/phoneinput.json 查看文件

@@ -1,6 +1,6 @@
{
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "找回密码",
"navigationBarTitleText": "手机验证",
"navigationBarTextStyle": "black"
}

Loading…
取消
儲存