Commit 3f52f0b8 by 梁建民

添加参数

parent 27ca2797
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "IC业务助手用户协议",
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"backgroundColor": "white"
} }
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "免费注册",
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"backgroundColor": "white"
} }
\ No newline at end of file
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<view class="agreement"> <view class="agreement">
<text class="t1">点击注册即默认同意</text> <text class="t1">点击注册即默认同意</text>
<text class="t2">《IC业务助手用户协议》</text> <navigator url="/pages/person/agreement/index" class="t2">《IC业务助手用户协议》</navigator>
</view> </view>
</view> </view>
\ No newline at end of file
{ {
"navigationBarTitleText": "注册成功", "usingComponents": {},
"navigationBarBackgroundColor": "#0D84D1", "navigationBarTitleText": "注册成功",
"navigationBarTextStyle": "white", "navigationBarBackgroundColor": "white",
"backgroundColor": "#0d84d1" "navigationBarTextStyle": "black",
} "backgroundColor": "white"
}
\ No newline at end of file
...@@ -14,7 +14,10 @@ Page({ ...@@ -14,7 +14,10 @@ Page({
mobileFlag: false, mobileFlag: false,
codeFlag: false, codeFlag: false,
disabled: false, disabled: false,
disabledBtn:false,
loading: false, loading: false,
currentTime: 61,
timeText: '发送验证码',
formData: { formData: {
mobile: '', mobile: '',
code: '' code: ''
...@@ -24,62 +27,114 @@ Page({ ...@@ -24,62 +27,114 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function() {
}, },
/** /**
* 校验字段 * 获取验证码
*/ */
calcForm: function (val, type) { getCode: function() {
var self = this;
var currentTime = this.data.currentTime;
var interval = setInterval(function() {
currentTime--;
self.setData({
timeText: currentTime + 's'
});
if (currentTime <= 0) {
clearInterval(interval);
self.setData({
timeText: '重新发送',
currentTime: 61,
disabled: false
});
}
}, 1000)
},
/**
* 发送验证码
*/
getVerificationCode: function(e) {
http.getData(apis.getRegistCode,{
mobile:'',
code_type:2
},function(res){
if(res.err_code === 0){
http.getData();
this.setData({
disabled: true
});
}
});
},
/**
* 校验字段
*/
calcForm: function(val, type) {
let mobile = val.mobile; let mobile = val.mobile;
let code = val.code; let code = val.code;
let reg_mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/; let reg_mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;
...@@ -120,20 +175,18 @@ Page({ ...@@ -120,20 +175,18 @@ Page({
/** /**
* 登录 * 登录
*/ */
formSubmit:function(e){ formSubmit: function(e) {
var self = this; var self = this;
console.log(e.detail.value)
if (this.calcForm(e.detail.value)) { if (this.calcForm(e.detail.value)) {
self.setData({ self.setData({
disabled: true, disabledBtn: true,
loading: true loading: true
}); });
http.postData(apis.authMobilelogin, e.detail.value, function (res) { http.postData(apis.authMobilelogin, e.detail.value, function(res) {
if (res.err_code === 0) { if (res.err_code === 0) {
...@@ -157,7 +210,7 @@ Page({ ...@@ -157,7 +210,7 @@ Page({
} }
self.setData({ self.setData({
disabled: false, disabledBtn: false,
loading: false loading: false
}); });
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
color: #adb6bf; color: #adb6bf;
} }
.vcode { .vcode {
width: 219rpx;
text-align: right;
font-size: 32rpx; font-size: 32rpx;
color: #61a0f2; color: #61a0f2;
background: none; background: none;
...@@ -31,6 +33,9 @@ ...@@ -31,6 +33,9 @@
border: 0 !important; border: 0 !important;
} }
} }
.vcode-color{
color: #ADB6BF;
}
.areacode { .areacode {
border-left: 1px solid #d8dfe6; border-left: 1px solid #d8dfe6;
.tel-value { .tel-value {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<text class="icon iconfont iconiconxiantiaoshouji"></text> <text class="icon iconfont iconiconxiantiaoshouji"></text>
<view class="form-item-right row verCenter bothSide"> <view class="form-item-right row verCenter bothSide">
<input placeholder="请输入验证码" placeholder-class="placeholderClass" name='code'></input> <input placeholder="请输入验证码" placeholder-class="placeholderClass" name='code'></input>
<button class="vcode">发送验证码</button> <button class="vcode {{disabled ? 'vcode-color':''}}" disabled="{{disabled}}" bindtap="getVerificationCode">{{timeText}}</button>
</view> </view>
</view> </view>
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
</block> </block>
</view> </view>
<button class="login-button" form-type="submit" disabled="{{disabled}}" loading="{{loading}}">登录</button> <button class="login-button" form-type="submit" disabled="{{disabledBtn}}" loading="{{loading}}">登录</button>
</form> </form>
<view class="bottom row bothSide"> <view class="bottom row bothSide">
<navigator url="/pages/person/login/index" class="txt">密码登录</navigator> <navigator url="/pages/person/login/index" class="txt">密码登录</navigator>
<navigator url="/pages/person/verifycode/index" class="txt">注册账户</navigator> <navigator url="/pages/person/register/index" class="txt">注册账户</navigator>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
color: #adb6bf; color: #adb6bf;
} }
.person .inp-wrap .vcode { .person .inp-wrap .vcode {
width: 219rpx;
text-align: right;
font-size: 32rpx; font-size: 32rpx;
color: #61a0f2; color: #61a0f2;
background: none; background: none;
...@@ -33,6 +35,9 @@ ...@@ -33,6 +35,9 @@
.person .inp-wrap .vcode::after { .person .inp-wrap .vcode::after {
border: 0 !important; border: 0 !important;
} }
.person .inp-wrap .vcode-color {
color: #ADB6BF;
}
.person .inp-wrap .areacode { .person .inp-wrap .areacode {
border-left: 1px solid #d8dfe6; border-left: 1px solid #d8dfe6;
} }
......
//数据请求(get) //数据请求(get)
const getData = (url, params, callBack,loading) => { const getData = (url, param, callBack,loading) => {
wx.showNavigationBarLoading(); wx.showNavigationBarLoading();
var params = Object.assign({}, param, { pf: 1 });
if(loading){ if(loading){
wx.showLoading(); wx.showLoading();
} }
...@@ -36,10 +38,12 @@ const getData = (url, params, callBack,loading) => { ...@@ -36,10 +38,12 @@ const getData = (url, params, callBack,loading) => {
}; };
//数据请求(post) //数据请求(post)
const postData = (url, params, callBack, loading) => { const postData = (url, param, callBack, loading) => {
wx.showNavigationBarLoading(); wx.showNavigationBarLoading();
var params = Object.assign({}, param, { pf: 1 });
if (loading) { if (loading) {
wx.showLoading(); wx.showLoading();
} }
...@@ -53,6 +57,7 @@ const postData = (url, params, callBack, loading) => { ...@@ -53,6 +57,7 @@ const postData = (url, params, callBack, loading) => {
}, },
method: "POST", method: "POST",
success: (res) => { success: (res) => {
typeof callBack == "function" && callBack(res.data, ""); typeof callBack == "function" && callBack(res.data, "");
wx.hideNavigationBarLoading(); wx.hideNavigationBarLoading();
......
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 sign in to comment