Commit 33cbcc68e6a41048235cb0d6ef868a5cb16a2ccf

Authored by 前端开发-罗建龙
1 parent 0d76d311

生日优化

packageA/pages/profile/profile.js
@@ -1171,6 +1171,14 @@ Page({ @@ -1171,6 +1171,14 @@ Page({
1171 if (b.length==4) { 1171 if (b.length==4) {
1172 b+='-' 1172 b+='-'
1173 } 1173 }
  1174 + if (b.length==5 && b[4]!='-') {
  1175 + return this.data.oldbirthday
  1176 + }
  1177 +
  1178 + if (b.length==8 && b[7]!='-') {
  1179 + return this.data.oldbirthday
  1180 + }
  1181 +
1174 if (b.length==6 && b[5] >1) { 1182 if (b.length==6 && b[5] >1) {
1175 console.log(b[5]); 1183 console.log(b[5]);
1176 return this.data.oldbirthday 1184 return this.data.oldbirthday
@@ -1182,6 +1190,10 @@ Page({ @@ -1182,6 +1190,10 @@ Page({
1182 lb.splice(5, 0, 0); 1190 lb.splice(5, 0, 0);
1183 b = lb.join(''); 1191 b = lb.join('');
1184 }else{ 1192 }else{
  1193 + let s=b[5]+b[6]
  1194 + if (s*1>12) {
  1195 + return this.data.oldbirthday
  1196 + }
1185 b+='-' 1197 b+='-'
1186 } 1198 }
1187 1199