From 27c5d303a27ff03ec47380e9e30ef44e575d1ec7 Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Mon, 5 Jun 2023 10:41:19 +0800 Subject: [PATCH] 生日日期优化 --- packageA/pages/profile/profile.js | 6 ++++++ packageA/pages/profile/profile.wxml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js index 5747b04..a7dc0c7 100644 --- a/packageA/pages/profile/profile.js +++ b/packageA/pages/profile/profile.js @@ -78,6 +78,7 @@ Page({ lon: null, //经度 loading: 0, oldBirtthDayLength:0, //生日日期个数 + oldbirthday:'',//生日日期 }, //通过路径跳转到其他页面 goto: function (e) { @@ -1147,6 +1148,10 @@ Page({ console.log("获取生日222222222"); console.log(e); let b = this.getInput(e); + let reg=/^[0-9\-]*$/ + if (!(reg.test(b))){ + return this.data.oldbirthday + } let length = b.length; let oldBirtthDayLength=this.data.oldBirtthDayLength if (length > oldBirtthDayLength) { @@ -1164,6 +1169,7 @@ Page({ this.setData({ datet: b, oldBirtthDayLength:length, + oldbirthday:b }); }, //获取生日 diff --git a/packageA/pages/profile/profile.wxml b/packageA/pages/profile/profile.wxml index 9277f88..8e453f8 100644 --- a/packageA/pages/profile/profile.wxml +++ b/packageA/pages/profile/profile.wxml @@ -91,7 +91,7 @@ 出生日期: - + -- libgit2 0.21.4