jufubao-base 1.0.119-beta11 → 1.0.119-beta13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<!-- #endif -->
|
|
16
16
|
<view class="jfb-base-con-phone__body" v-if="done">
|
|
17
17
|
<view
|
|
18
|
-
v-if="has_times==='Y'"
|
|
18
|
+
v-if="has_times === 'Y'"
|
|
19
19
|
class="jfb-base-con-phone__body-wrap"
|
|
20
20
|
:style="{
|
|
21
21
|
height: layoutInfo.bodyMinHeightRpx + 'rpx',
|
|
@@ -156,14 +156,14 @@ export default {
|
|
|
156
156
|
btnTwoUrl: "",
|
|
157
157
|
message: "发送验证码",
|
|
158
158
|
countdownTimer: null,
|
|
159
|
-
timeRemaining:
|
|
159
|
+
timeRemaining: 120,
|
|
160
160
|
disabled: false,
|
|
161
|
-
background:"",
|
|
161
|
+
background: "",
|
|
162
162
|
method: "entry",
|
|
163
163
|
options: {},
|
|
164
164
|
activity_id: "",
|
|
165
165
|
done: false,
|
|
166
|
-
has_times:
|
|
166
|
+
has_times: "N",
|
|
167
167
|
errmessage: "",
|
|
168
168
|
showOhoneNumber: "", //仅用于展示
|
|
169
169
|
order_num: null,
|
|
@@ -207,12 +207,23 @@ export default {
|
|
|
207
207
|
},
|
|
208
208
|
filterSpaces(event) {
|
|
209
209
|
// 使用replace方法去除用户输入的空格
|
|
210
|
-
let value = event.target.value.replace(/\s+/g,
|
|
210
|
+
let value = event.target.value.replace(/\s+/g, "");
|
|
211
211
|
// 更新数据以移除空格
|
|
212
212
|
this.phoneNumber = value;
|
|
213
213
|
// 将处理后的值反映到视图
|
|
214
214
|
event.target.value = value;
|
|
215
215
|
},
|
|
216
|
+
validatePhoneNumber(phoneNumber) {
|
|
217
|
+
// 定义手机号正则表达式
|
|
218
|
+
const regex = /^1[3-9]\d{9}$/;
|
|
219
|
+
|
|
220
|
+
// 检查输入的手机号是否符合格式
|
|
221
|
+
if (phoneNumber.match(regex)) {
|
|
222
|
+
return true;
|
|
223
|
+
} else {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
},
|
|
216
227
|
getList() {
|
|
217
228
|
jfbRootExec("getCouponPhoneList", {
|
|
218
229
|
vm: this,
|
|
@@ -257,6 +268,13 @@ export default {
|
|
|
257
268
|
});
|
|
258
269
|
return;
|
|
259
270
|
}
|
|
271
|
+
if (!this.validatePhoneNumber(this.phoneNumber)) {
|
|
272
|
+
uni.showToast({
|
|
273
|
+
title: "手机号格式不正确",
|
|
274
|
+
icon: "none",
|
|
275
|
+
});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
260
278
|
// 发送验证码的异步操作
|
|
261
279
|
uni.showToast({
|
|
262
280
|
title: "发送中",
|
|
@@ -274,7 +292,7 @@ export default {
|
|
|
274
292
|
},
|
|
275
293
|
startCountdown() {
|
|
276
294
|
// 设置剩余时间
|
|
277
|
-
this.timeRemaining =
|
|
295
|
+
this.timeRemaining = 120;
|
|
278
296
|
// 设置定时器,每秒执行一次
|
|
279
297
|
this.countdownTimer = setInterval(() => {
|
|
280
298
|
// 每秒减少1
|
|
@@ -290,7 +308,7 @@ export default {
|
|
|
290
308
|
// 清除定时器
|
|
291
309
|
clearInterval(this.countdownTimer);
|
|
292
310
|
// 重新设置时间
|
|
293
|
-
this.timeRemaining =
|
|
311
|
+
this.timeRemaining = 120;
|
|
294
312
|
}
|
|
295
313
|
}, 1000);
|
|
296
314
|
},
|