From 4e44bc1fd7806a6c1611302120882b91d96640b5 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Mon, 27 Apr 2020 17:50:19 +0800
Subject: [PATCH] bug修复

---
 SunshineLnsMinApp/pages/xsjb/xsjb.js |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/SunshineLnsMinApp/pages/xsjb/xsjb.js b/SunshineLnsMinApp/pages/xsjb/xsjb.js
index 12f1a32..bc818a3 100644
--- a/SunshineLnsMinApp/pages/xsjb/xsjb.js
+++ b/SunshineLnsMinApp/pages/xsjb/xsjb.js
@@ -135,8 +135,11 @@
       if (!this.data.thisData.createrMobile) {
         return app.showModal("请填写手机号码!");
       }
+      if (/^[1]([3-9])[0-9]{9}$/.test(this.data.thisData.createrMobile)==false){
+        return app.showModal("手机号码有误!");
+      }
       if (!this.data.thisData.createrAddress) {
-        return app.showModal("请填写联系方式!");
+        return app.showModal("请填写联系地址!");
       }
     }
     wx.request({
@@ -151,16 +154,30 @@
           wx.showToast({
             title: '提交成功!',
             icon: 'success',
-            duration: 2000
-          })
-          wx.navigateBack({
-            delta: 2
+            duration: 2000,
+            success: function() {
+              setTimeout(function() {
+                //要延时执行的代码
+                wx.navigateBack({
+                  delta: 2
+                })
+              }, 1000) //延迟时间
+            },
           })
         }
       }
     })
   },
 
+  checkMobile: function() {
+    var sMobile = document.mobileform.mobile.value
+    if (!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(sMobile))) {
+      alert("不是完整的11位手机号或者正确的手机号前七位");
+      document.mobileform.mobile.focus();
+      return false;
+    }
+  },
+
   // 选择地理位置
   chooseLocation: function(e) {
     const that = this;

--
Gitblit v1.8.0