register-vip.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>注册会员</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="css/main.css" />
  12. <link rel="stylesheet" type="text/css" href="css/mui.picker.min.css" />
  13. <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
  14. <script>
  15. //屏蔽分享
  16. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  17. WeixinJSBridge.call('hideOptionMenu');
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <div class="mui-content">
  23. <h6 style="text-align: center;margin-top: 10px;display: none;" id="addOneTooth">尊敬的会员,您已经添加过 <em class="cl-red">1</em> 支牙刷了,添加后无法撤销。</h6>
  24. <div style="margin: 20px 0;text-align: center;">
  25. <div style="padding: 10px 0;">
  26. <span class="iconfont icon-chenggong" style="color: #3bbf64;font-size: 40px;"></span>
  27. </div>
  28. <h4> 已成功扫描唯一码 </h4>
  29. <p id="barCodeId"></p>
  30. <p>别忘了完善下方的会员信息</p>
  31. <p style="width: 60%;margin-left: 20%;">成功注册会员,您将获得延保服务,以及免费积分和刷头福利</p>
  32. <p style="width: 60%;margin-left: 20%;">“刷头兑换券”请移至上朵公众号【朵粉特供】→【福利社】领取</p>
  33. </div>
  34. <img width="100%" src="images/youhuiquan.jpg" />
  35. <div style="padding: 15px 10px;font-weight: bold;font-size: 15px;">
  36. 完善信息
  37. </div>
  38. <form class="mui-input-group">
  39. <div class="mui-input-row line-bottom">
  40. <label>您的姓名</label>
  41. <input type="text" maxlength="10" id="ipt-name" placeholder="填写您的姓名">
  42. </div>
  43. <div class="mui-input-row line-bottom" id="js-userBirthDate">
  44. <label>出生日期</label>
  45. <input type="text" id="newDate" readonly="readonly" placeholder="选择您的出生日期">
  46. </div>
  47. <div class="mui-input-row line-bottom">
  48. <label>手机号码</label>
  49. <input type="tel" id="ipt-phone" maxlength="11" placeholder="填写您的手机号码">
  50. </div>
  51. <div class="mui-input-row line-bottom" id="js-phone" style="display:none;">
  52. <label>验&nbsp;&nbsp;证&nbsp;&nbsp;码</label>
  53. <input style="width: 50% !important;float: left;" type="tel" placeholder="请输入验证码" maxlength="4" id="code"><button type="button" class="pull-code" disabled="disabled">获取验证码</button>
  54. </div>
  55. <div class="mui-table my-table" style="padding:15px 10px 0px 10px;">
  56. <div class="mui-table-cell mui-col-xs-2">
  57. <label>您的性别</label>
  58. </div>
  59. <div class="mui-table-cell mui-col-xs-3">
  60. <div class="mui-input-row mui-radio mui-left">
  61. <label>男</label>
  62. <input id="maleId" class="iconfont icon-boy" name="radio0" type="radio" checked="" value="1">
  63. </div>
  64. </div>
  65. <div class="mui-table-cell mui-col-xs-5">
  66. <div class="mui-input-row mui-radio mui-left">
  67. <label>女</label>
  68. <input id="femaleId" class="iconfont icon-girl" name="radio0" type="radio" value="2">
  69. </div>
  70. </div>
  71. </div>
  72. <!--<div class="mui-table my-table">
  73. <div class="mui-table-cell mui-col-xs-2">
  74. <label style="display: block;width: 60px;">您的年龄</label>
  75. </div>
  76. <div class="mui-table-cell mui-col-xs-3">
  77. <div class="mui-input-row mui-radio mui-left">
  78. <label class="my-label">80后</label>
  79. <input name="radio1" class="radio1" type="radio" checked="" value="1">
  80. </div>
  81. </div>
  82. <div class="mui-table-cell mui-col-xs-3">
  83. <div class="mui-input-row mui-radio mui-left">
  84. <label class="my-label">85后</label>
  85. <input name="radio1" class="radio1" type="radio" value="2">
  86. </div>
  87. </div>
  88. <div class="mui-table-cell mui-col-xs-3">
  89. <div class="mui-input-row mui-radio mui-left">
  90. <label class="my-label">90后</label>
  91. <input name="radio1" class="radio1" type="radio" value="3">
  92. </div>
  93. </div>
  94. </div>
  95. <div class="mui-table my-table" style="padding-bottom: 12px;">
  96. <div class="mui-table-cell mui-col-xs-2">
  97. <label></label>
  98. </div>
  99. <div class="mui-table-cell mui-col-xs-3">
  100. <div class="mui-input-row mui-radio mui-left">
  101. <label class="my-label">95后</label>
  102. <input name="radio1" class="radio1" type="radio" value="4">
  103. </div>
  104. </div>
  105. <div class="mui-table-cell mui-col-xs-3">
  106. <div class="mui-input-row mui-radio mui-left">
  107. <label class="my-label">00后</label>
  108. <input name="radio1" class="radio1" type="radio" value="5">
  109. </div>
  110. </div>
  111. <div class="mui-table-cell mui-col-xs-3">
  112. <div class="mui-input-row mui-radio mui-left">
  113. <label class="my-label">其他</label>
  114. <input name="radio1" class="radio1" type="radio" value="6">
  115. </div>
  116. </div>
  117. </div>-->
  118. <div class="mui-table my-table">
  119. <div class="mui-table-cell mui-col-xs-2">
  120. <label style="display: block;width: 60px;">购买渠道</label>
  121. </div>
  122. <div class="mui-table-cell mui-col-xs-3">
  123. <div class="mui-input-row mui-radio mui-left">
  124. <label class="my-label">天猫</label>
  125. <input name="radio2" class="radio2" type="radio" checked="" value="1">
  126. </div>
  127. </div>
  128. <div class="mui-table-cell mui-col-xs-3">
  129. <div class="mui-input-row mui-radio mui-left">
  130. <label class="my-label">微信</label>
  131. <input name="radio2" class="radio2" type="radio" value="4">
  132. </div>
  133. </div>
  134. <div class="mui-table-cell mui-col-xs-3">
  135. <div class="mui-input-row mui-radio mui-left">
  136. <label class="my-label">京东</label>
  137. <input name="radio2" class="radio2" type="radio" value="3">
  138. </div>
  139. </div>
  140. </div>
  141. <div class="mui-table my-table">
  142. <div class="mui-table-cell mui-col-xs-2">
  143. <label style="display: block;width: 60px;">&nbsp;</label>
  144. </div>
  145. <div class="mui-table-cell mui-col-xs-3">
  146. <div class="mui-input-row mui-radio mui-left">
  147. <label class="my-label">一条</label>
  148. <input name="radio2" class="radio2" type="radio" value="6">
  149. </div>
  150. </div>
  151. <div class="mui-table-cell mui-col-xs-3">
  152. <div class="mui-input-row mui-radio mui-left">
  153. <label class="my-label">小红书</label>
  154. <input name="radio2" class="radio2" type="radio" value="7">
  155. </div>
  156. </div>
  157. <div class="mui-table-cell mui-col-xs-3">
  158. <div class="mui-input-row mui-radio mui-left">
  159. <label class="my-label">其他</label>
  160. <input name="radio2" class="radio2" type="radio" value="5">
  161. </div>
  162. </div>
  163. </div>
  164. <div class="mui-input-row line-top">
  165. <label>购买日期</label>
  166. <input type="text" id="buyDate" readonly="readonly" placeholder="选择您的购买日期">
  167. </div>
  168. </form>
  169. <br />
  170. <div class="mui-content-padded mui-text-center">
  171. <button type="button" class="my-btn-black" id="my-btn-submit" style="width: 50%;">提交注册</button>
  172. </div>
  173. </div>
  174. <!-- 加载ing begin-->
  175. <div class="loading covers">
  176. <div class="loading-bj"></div>
  177. <p>正在加载...</p>
  178. </div>
  179. <!-- 加载ing end -->
  180. <script type="text/javascript" src="js/mui.min.js"></script>
  181. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
  182. <script type="text/javascript" src="js/main.js"></script>
  183. <script src="js/mui.picker.min.js"></script>
  184. <script type="text/javascript">
  185. /*以前的电话号码*/
  186. var oldPhone;
  187. /*是否需要填写验证码 1:需要 2:不需要*/
  188. var isNeedPhone = 1;
  189. /*1需要填写,2不需要*/
  190. var isNeedBirthday = 1;
  191. window.addEventListener('pageshow', function(e) {
  192. // 通过persisted属性判断是否存在 BF Cache
  193. if(e.persisted) {
  194. location.reload();
  195. }
  196. });
  197. //实时监听文本框字数
  198. document.getElementById("ipt-phone").addEventListener("input", function() {
  199. var phone = this.value;
  200. if(phone == oldPhone){
  201. $("#js-phone").hide();
  202. isNeedPhone = 2;
  203. return false;
  204. }else{
  205. isNeedPhone = 1;
  206. $("#js-phone").show();
  207. if(countdown == 60) {
  208. $(".pull-code").removeAttr("disabled").addClass("active");
  209. } else {
  210. $(".pull-code").attr("disabled", "disabled").removeClass("active");
  211. }
  212. }
  213. var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
  214. if(phone.length == 11) {
  215. if(mobile.test(phone) && countdown == 60) {
  216. $(".pull-code").removeAttr("disabled").addClass("active");
  217. } else {
  218. $(".pull-code").attr("disabled", "disabled").removeClass("active");
  219. }
  220. } else {
  221. $(".pull-code").attr("disabled", "disabled").removeClass("active");
  222. }
  223. });
  224. //发送验证码
  225. var validate_flag = false,
  226. show_msg = '';
  227. $(document).on('tap', '.pull-code', function() {
  228. var th = $(this);
  229. var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
  230. var phone = $("#ipt-phone").val();
  231. if(mobile.test(phone)) {
  232. settime(th);
  233. if(!window.sessionStorage) {
  234. mui.alert("您的浏览器不支持sessionStorage");
  235. } else {
  236. //自定义json数据
  237. var obj = {};
  238. obj["phone"] = phone;
  239. obj["codetime"] = new Date().getTime();
  240. //json格式化插入
  241. sessionStorage.setItem('code_data', JSON.stringify(obj));
  242. }
  243. //ajax
  244. $.ajax(base_path + '/wechat/apparatus/send_phone?dates=' + new Date().getTime(), {
  245. data: {
  246. "phone": phone
  247. },
  248. dataType: 'json',
  249. xhrFields: {
  250. withCredentials: true
  251. },
  252. crossDomain: true,
  253. type: 'get',
  254. timeout: 15000,
  255. success: function(dt) {
  256. //console.log(dt);
  257. if(dt.isRedirect) {
  258. location.href = dt.redirectURL;
  259. } else {
  260. if(dt.status) {
  261. console.log("获取短信成功!");
  262. } else {
  263. mui.alert("获取短信失败!请稍后重试");
  264. }
  265. }
  266. },
  267. error: function(xhr, type, errorThrown) {
  268. console.log(xhr);
  269. mui.alert("获取短信失败!网络错误");
  270. }
  271. });
  272. } else {
  273. if(phone != '') {
  274. show_msg = '手机号码格式不正确';
  275. } else {
  276. show_msg = '请填写手机号码';
  277. }
  278. mui.alert(show_msg);
  279. }
  280. });
  281. var countdown = 60;
  282. function settime(obj) {
  283. if(countdown <= 0) {
  284. obj.addClass("active").removeAttr("disabled");
  285. obj.text("获取验证码");
  286. countdown = 60;
  287. return;
  288. } else {
  289. obj.attr("disabled", true).removeClass("active");
  290. obj.text("重新发送" + countdown + "");
  291. countdown--;
  292. }
  293. setTimeout(function() {
  294. settime(obj)
  295. }, 1000)
  296. }
  297. //选择购买日期
  298. mui('body').on('tap', '#buyDate', function(event) {
  299. var date = new Date();
  300. var y = date.getFullYear();
  301. var m = date.getMonth(); //获取当前月份的日期
  302. var d = date.getDate();
  303. var picker = new mui.DtPicker({
  304. type: "date", //设置日历初始视图模式
  305. beginDate: new Date(2018, 00, 08), //设置开始日期
  306. endDate: new Date(y, m, d) //设置结束日期
  307. });
  308. picker.show(function(rs) {
  309. $("#buyDate").val(rs.text);
  310. picker.dispose();
  311. picker = null;
  312. });
  313. });
  314. //选择出生日期
  315. mui('body').on('tap', '#newDate', function(event) {
  316. var date = new Date();
  317. var y = date.getFullYear();
  318. var m = date.getMonth(); //获取当前月份的日期
  319. var d = date.getDate();
  320. var picker = new mui.DtPicker({
  321. type: "date", //设置日历初始视图模式
  322. beginDate: new Date(1949, 9, 01), //设置开始日期
  323. endDate: new Date((y - 8), 00, 01) //设置结束日期
  324. });
  325. picker.show(function(rs) {
  326. $("#newDate").val(rs.text);
  327. picker.dispose();
  328. picker = null;
  329. });
  330. });
  331. var qrCode = null;
  332. var isFocusOn = null;
  333. var userIdentity = null;
  334. mui.ready(function() {
  335. console.log("页面加载完毕");
  336. $(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
  337. //获取机器条码 barcode
  338. qrCode = getParam("qrCode");
  339. var code_data = JSON.parse(sessionStorage.getItem('code_data'));
  340. if(code_data != null) {
  341. $("#ipt-phone").val(code_data.phone);
  342. if((new Date().getTime() - code_data.codetime) > 59000) {
  343. $(".pull-code").addClass("active").removeAttr("disabled");
  344. } else {
  345. countdown = parseInt(60 - ((new Date().getTime() - code_data.codetime) / 1000));
  346. console.log(countdown)
  347. settime($(".pull-code"));
  348. }
  349. }
  350. if(qrCode != null) {
  351. $("#barCodeId").html("(" + qrCode + ")");
  352. $.ajax(base_path + '/wechat/getActivationAndMember?dates=' + new Date().getTime(), {
  353. data: {
  354. "qrCode": qrCode //产品类型id
  355. },
  356. dataType: 'json',
  357. xhrFields: {
  358. withCredentials: true
  359. },
  360. crossDomain: true,
  361. type: 'get',
  362. timeout: 15000,
  363. success: function(dt) {
  364. if(dt.isRedirect) {
  365. location.href = dt.redirectURL;
  366. } else {
  367. if(dt.status) { //判断接口返回状态status
  368. if(dt.data.isActivation) {
  369. //已激活
  370. mui.alert('该产品已被激活!', '提醒', function() {
  371. location.href = "my-center.html";
  372. });
  373. }
  374. if(dt.data.memberInfo.userStatus != 2) {
  375. //未关注
  376. mui.alert('请先关注公众号再激活!', '提醒', function() {
  377. location.href = "follow-me-tooth.html";
  378. });
  379. }
  380. //填充用户数据
  381. $("#ipt-name").val(dt.data.memberInfo.userName);
  382. if(dt.data.memberInfo.userSex != null) {
  383. if(dt.data.memberInfo.userSex == 1) {
  384. $("#maleId").attr("checked", true);
  385. }
  386. if(dt.data.memberInfo.userSex == 2) {
  387. $("#femaleId").attr("checked", true);
  388. }
  389. }
  390. if(dt.data.memberInfo.userIdentity == 1){
  391. if(dt.data.memberInfo.userBirthDate != null && typeof(dt.data.memberInfo.userBirthDate) != "undefined"){
  392. $("#js-userBirthDate").hide();
  393. isNeedBirthday = 2;
  394. }else{
  395. isNeedBirthday = 1;
  396. }
  397. }else{
  398. isNeedBirthday = 1;
  399. }
  400. if(dt.data.memberToothNumber > 0){
  401. $("#addOneTooth em").html(dt.data.memberToothNumber)
  402. $("#addOneTooth").show();
  403. }
  404. oldPhone = dt.data.memberInfo.userTel;
  405. if(oldPhone != null && oldPhone != "" && typeof(oldPhone) != "undefined"){
  406. $("#ipt-phone").val(oldPhone);
  407. isNeedPhone = 2;
  408. }else{
  409. $("#js-phone").show();
  410. isNeedPhone = 1;
  411. }
  412. var radios = $(".radio1");
  413. switch(dt.data.memberInfo.userAgeStage) {
  414. case(1):
  415. radios.eq(0).attr("checked", true);
  416. break;
  417. case(2):
  418. radios.eq(1).attr("checked", true);
  419. break;
  420. case(3):
  421. radios.eq(2).attr("checked", true);
  422. break;
  423. case(4):
  424. radios.eq(3).attr("checked", true);
  425. break;
  426. case(5):
  427. radios.eq(4).attr("checked", true);
  428. break;
  429. case(6):
  430. radios.eq(5).attr("checked", true);
  431. }
  432. isFocusOn = dt.data.memberInfo.userStatus;
  433. userIdentity = dt.data.memberInfo.userIdentity;
  434. } else {
  435. mui.alert("查询失败!");
  436. } }
  437. },
  438. error: function(xhr, type, errorThrown) {
  439. console.log(xhr);
  440. mui.alert("网络错误!");
  441. }
  442. });
  443. }
  444. });
  445. $(document).on('tap', '#my-btn-submit', function() {
  446. validate(); //验证文本框
  447. var userName = $("#ipt-name").val();
  448. var userSex = $('input[name="radio0"]:checked ').val();
  449. var userBirthDate = $('#newDate').val();
  450. var apparatusStore = $('input[name="radio2"]:checked').val();
  451. var buyDate = $("#buyDate").val();
  452. var tel = $("#ipt-phone").val();
  453. var code = $("#code").val();
  454. var  selectDate =  new  Date(Date.parse(buyDate));
  455. var  nowDate =  new  Date(Date.parse(new Date().toLocaleDateString()));
  456. //if(selectDate>nowDate){
  457. //mui.alert("购买日期不能大于当前日期");
  458. //return false;
  459. //}
  460. if(validate_flag) {
  461. //验证通过
  462. $.ajax(base_path + '/wechat/apparatus/add_apparatus?dates=' + new Date().getTime(), {
  463. data: {
  464. "barCode": qrCode, //条码
  465. "userName": userName, //用户姓名
  466. "userSex": userSex, //用户姓名
  467. "userTel": tel, //手机
  468. "code": code, //验证码
  469. "userBirthDateString": userBirthDate, //出生日期
  470. "apparatusStore": apparatusStore, //渠道id 1:天猫 2:淘宝 3:京东 4:微信 5:其他 6:一条 7:小红书
  471. "buyDate": buyDate //购买日期
  472. },
  473. dataType: 'json',
  474. xhrFields: {
  475. withCredentials: true
  476. },
  477. crossDomain: true,
  478. type: 'get',
  479. timeout: 15000,
  480. success: function(dt) {
  481. if(dt.isRedirect) {
  482. location.href = dt.redirectURL;
  483. } else {
  484. if(dt.status) { //判断接口返回状态status
  485. mui.alert('注册成功!', '温馨提示', function() {
  486. if(userIdentity == 1) { //会员
  487. if(isFocusOn == 1 || isFocusOn == 0) { //未关注
  488. location.href = "member-follow-me.html";
  489. } else { //已关注
  490. $.ajax(base_path + '/wechat/coupon/getIsReceive?dates=' + new Date().getTime(), {
  491. data: {},
  492. dataType: 'json',
  493. xhrFields: {
  494. withCredentials: true
  495. },
  496. crossDomain: true,
  497. type: 'get',
  498. timeout: 15000,
  499. success: function(dt) {
  500. //console.log(dt);
  501. if(dt.isRedirect) {
  502. location.href = dt.redirectURL;
  503. } else {
  504. if(dt.status) {
  505. console.log("未领取!");
  506. location.href = "welfare-service.html";
  507. } else {
  508. console.log("已领取!");
  509. location.href = "my-center.html";
  510. }
  511. }
  512. },
  513. error: function(xhr, type, errorThrown) {
  514. console.log(xhr);
  515. }
  516. });
  517. }
  518. } else { //非会员
  519. if(isFocusOn == 1 || isFocusOn == 0) { //未关注
  520. location.href = "follow-me.html";
  521. } else { //已关注
  522. location.href = "welfare-service.html";
  523. }
  524. }
  525. });
  526. } else {
  527. mui.alert(dt.message, '温馨提示', function() {
  528. location.href = "my-center.html";
  529. });
  530. }
  531. }
  532. },
  533. error: function(xhr, type, errorThrown) {
  534. console.log(xhr);
  535. mui.alert("网络错误");
  536. }
  537. });
  538. } else {
  539. mui.alert(dalog_msg); //弹窗提示
  540. }
  541. });
  542. //正则表达式示例
  543. var dalog_msg = '',
  544. validate_flag = false;
  545. function validate() {
  546. var ch_en_num = /^[A-Za-z_\-\u4e00-\u9fa5]{2,10}$/; //简体中文英文(2-10位)
  547. var positive_int = /^[0-9]\d*$/; //正整数0-9
  548. var code_int = /^[0-9]{4}$/; //正整数0-9,4位数字
  549. var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
  550. var full_date = /^\d{4}(\-|\/|.)\d{1,2}\1\d{1,2}$/; //日期格式 (2016\12\12,2016-12-12,2016.12.12)
  551. var name = $("#ipt-name").val().trim(),
  552. tel = $("#ipt-phone").val(),
  553. code = $("#code").val();
  554. validate_flag = false;
  555. if(!ch_en_num.test(name)) {
  556. //未通过验证
  557. if(name != '') {
  558. dalog_msg = '名字格式不正确';
  559. } else {
  560. dalog_msg = '请填写名字';
  561. }
  562. return dalog_msg;
  563. }
  564. //验证通过
  565. if($("#newDate").val() == null || $("#newDate").val() == "" ) {
  566. if(isNeedBirthday == 1){
  567. dalog_msg = '请选择出生日期';
  568. return dalog_msg;
  569. }
  570. }
  571. if(!mobile.test(tel)) {
  572. if(tel != '') {
  573. dalog_msg = '手机格式不正确';
  574. } else {
  575. dalog_msg = '请填写手机号码';
  576. }
  577. return dalog_msg;
  578. }
  579. if(isNeedPhone == 1){ //需要验证手机号码
  580. if(!code_int.test(code)) {
  581. if(code != '') {
  582. dalog_msg = '验证码格式不正确';
  583. } else {
  584. dalog_msg = '请填写验证码';
  585. }
  586. return dalog_msg;
  587. }
  588. }
  589. if($("#buyDate").val() == null || $("#buyDate").val() == "") {
  590. dalog_msg = '请选择购买日期';
  591. return dalog_msg;
  592. }
  593. validate_flag = true;
  594. return dalog_msg; //返回提示信息
  595. }
  596. </script>
  597. </body>
  598. </html>