From 390547d9103dd40c842c7d94b4a8802cec82b6c9 Mon Sep 17 00:00:00 2001 From: season Date: Tue, 3 Dec 2019 09:44:31 +0800 Subject: [PATCH] 会员资料修改控制身份证和地址不一定要强制输入 --- pages/user/userinfo/userinfo.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index f0361d6..faa392d 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -741,26 +741,23 @@ Page({ var identity_card = th.data.identity_card;//身份证 console.log("身份证",identity_card); - if (identity_card == "" || identity_card == null ) { - getApp().my_warnning("请输入身份证", 0, th); - return false; - } else if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))){ + if (identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))){ getApp().my_warnning("身份证号码错误",0, th); return false; } var address = th.data.address;//地址 - console.log("地址1010101", address) - if (address == "" || address == null) { - getApp().my_warnning("请输入地址", 0, th); - return false; - } + // console.log("地址1010101", address) + // if (address == "" || address == null) { + // getApp().my_warnning("请输入地址", 0, th); + // return false; + // } //保存所属门店的id var sto_sele_id=th.data.sto_sele_id; - console.log("请输入所属门店的id", sto_sele_id); - if (sto_sele_id == null || sto_sele_id==""){ - getApp().my_warnning("请输入所属门店", 0, th); - return false; - } + // console.log("请输入所属门店的id", sto_sele_id); + // if (sto_sele_id == null || sto_sele_id==""){ + // getApp().my_warnning("请输入所属门店", 0, th); + // return false; + // } console.log("要保存的数据", sex, consumption, identity_card, address, user_name); var datas = { mobile: phone,//手机号码 -- libgit2 0.21.4