正在显示
2 个修改的文件
包含
18 行增加
和
7 行删除
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | //获取应用实例 | 3 | //获取应用实例 |
4 | var app = getApp(); | 4 | var app = getApp(); |
5 | var baseUrl = app.globalData.baseUrl; | 5 | var baseUrl = app.globalData.baseUrl; |
6 | +var regMobile = /^(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/; | ||
6 | 7 | ||
7 | Page({ | 8 | Page({ |
8 | data: { | 9 | data: { |
@@ -32,11 +33,11 @@ Page({ | @@ -32,11 +33,11 @@ Page({ | ||
32 | if (this.data.buttonDisable) return; | 33 | if (this.data.buttonDisable) return; |
33 | var that = this; | 34 | var that = this; |
34 | var mobile = this.data.mobile; | 35 | var mobile = this.data.mobile; |
35 | - var regMobile = /^(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/; | 36 | + |
36 | console.log("mobile---", mobile); | 37 | console.log("mobile---", mobile); |
37 | if (!regMobile.test(mobile)) { | 38 | if (!regMobile.test(mobile)) { |
38 | wx.showToast({ | 39 | wx.showToast({ |
39 | - image: "/images/error.png", | 40 | + icon: 'none', |
40 | title: '手机号有误!' | 41 | title: '手机号有误!' |
41 | }) | 42 | }) |
42 | return; | 43 | return; |
@@ -90,6 +91,14 @@ Page({ | @@ -90,6 +91,14 @@ Page({ | ||
90 | 91 | ||
91 | login: function () { | 92 | login: function () { |
92 | var that = this; | 93 | var that = this; |
94 | + console.log("mobile---login", that.data.mobile); | ||
95 | + if (!regMobile.test(that.data.mobile)) { | ||
96 | + wx.showToast({ | ||
97 | + icon:'none', | ||
98 | + title: '手机号有误!' | ||
99 | + }) | ||
100 | + return; | ||
101 | + } | ||
93 | var Authorization = getApp().globalData.Authorization; | 102 | var Authorization = getApp().globalData.Authorization; |
94 | wx.request({ | 103 | wx.request({ |
95 | url: baseUrl + "uaa/v1/users/op/bind-mobile", | 104 | url: baseUrl + "uaa/v1/users/op/bind-mobile", |
@@ -132,9 +141,9 @@ Page({ | @@ -132,9 +141,9 @@ Page({ | ||
132 | console.log("fail ", res.data) | 141 | console.log("fail ", res.data) |
133 | }, | 142 | }, |
134 | complete: function (res) { | 143 | complete: function (res) { |
135 | - wx.reLaunch({ | ||
136 | - url: '../main/guide/guide' | ||
137 | - }) | 144 | + // wx.reLaunch({ |
145 | + // url: '../main/guide/guide' | ||
146 | + // }) | ||
138 | } | 147 | } |
139 | }) | 148 | }) |
140 | }, | 149 | }, |
@@ -60,8 +60,10 @@ | @@ -60,8 +60,10 @@ | ||
60 | </view> | 60 | </view> |
61 | </scroll-view> | 61 | </scroll-view> |
62 | 62 | ||
63 | - <image class='chat-img' bindtap='gochat' src='/images/icon_chat.png'></image> | 63 | + <!-- <image class='chat-img' bindtap='gochat' src='/images/icon_chat.png'></image> --> |
64 | 64 | ||
65 | - <image class='logout-img' bindtap='loginout' src='/images/icon_logout.png'></image> | 65 | + <!-- <image class='logout-img' bindtap='loginout' src='/images/icon_logout.png'></image> --> |
66 | + | ||
67 | + <image class='logout-img' bindtap='gochat' src='/images/icon_chat.png'></image> | ||
66 | 68 | ||
67 | </view> | 69 | </view> |
请
注册
或
登录
后发表评论