liuyg
2022-02-21 e3dcaeb0180a4e37347ac9ceb44c8a59ae7af37f
pages/registerUser/registerUser.vue
@@ -41,15 +41,16 @@
         和
         <text class="a">《隐私政策》</text>
      </view>
      <div v-show="mapShow">
         <div class="login-map-bc" @click="mapShow = false">
      <div class="login-map-bc" v-if="mapShow">
         <div @click="mapShow = false">
         </div>
         <div class="login-map-content">
            <u-icon class="login-map-close" name="close" @click="mapShow = false"></u-icon>
            <iframe style="width: 100%; height: 100%; position: absolute; " :src="loginMapUrl">
            </iframe>
            <view style="width: 100%; height: 100%; position: absolute; ">
               <web-view :src="loginMapUrl"></web-view>
            </view>
         </div>
      </div>
@@ -65,8 +66,9 @@
      data() {
         var validateUser = (rule, value, callback) => {
            var phone = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
            var identity = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
            var identity =
               /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
            if (value.length <= 11) {
               if (phone.test(value)) {
                  return true
@@ -74,7 +76,7 @@
                  return callback(new Error('手机号格式不正确'));
               }
            }
            if (value.length <= 18) {
               if (identity.test(value)) {
                  return true
@@ -82,7 +84,7 @@
                  return callback(new Error('身份证号格式不正确'));
               }
            }
         };
         return {
@@ -194,16 +196,14 @@
               jsid: ''
            },
            rules: {
               user: [
                  {
                     /*
                      u-form提供的可直接调用的js验证,
                      具体有哪些可以观看官方文档,这里就不在赘述了。
                     */
                     validator: validateUser,
                     trigger: ['change', 'blur'],
                  },
               ],
               user: [{
                  /*
                   u-form提供的可直接调用的js验证,
                   具体有哪些可以观看官方文档,这里就不在赘述了。
                  */
                  validator: validateUser,
                  trigger: ['change', 'blur'],
               }, ],
               pass: [{
                  required: true,
                  message: '请输入6~16位密码',
@@ -319,7 +319,27 @@
            ]
         };
      },
      onShow() {
         let that = this
         uni.$on('updateDataRegionName', function(data) {
            that.regionName = data
            that.form.xq = that.regionName
         })
      },
      methods: {
         handleMessage(name) {
            console.log(name)
            if (name.indexOf('区') != -1) {
               that.regionName = name.replace('区', '派出所');
            } else if (name.indexOf('县') != -1) {
               that.regionName = name.replace('县', '派出所');
            } else if (name.indexOf('市') != -1) {
               that.regionName = name.replace('市', '市派出所');
            }
         },
         openLoginMap() {
            var that = this
            uni.getLocation({
@@ -350,14 +370,17 @@
                     "jd": res.longitude,
                     "wd": res.latitude
                  }]
                  data = JSON.stringify(data);
                  uni.navigateTo({
                     url: '/pages/currentMap/currentMap?data=' + JSON.stringify(data)
                  })
                  // that.loginMapUrl = 'http://127.0.0.1:5500/leafletMapOur/loginMap/loginMap.html?data=' +
                  //    data
                  // that.loginMapUrl =
                  //    'http://192.168.0.115:5500/leafletMapOur/loginMap/loginMap.html?data=' + data
                  that.loginMapUrl = 'http://223.82.109.183:2082/loginMap/loginMap.html?data=' + data
                  that.mapShow = true
                  // // that.loginMapUrl = 'http://223.82.109.183:2082/loginMap/loginMap.html?data=' + data
                  // that.mapShow = true
               }
            })
@@ -535,20 +558,6 @@
      },
      onReady() {
         this.$refs.uForm.setRules(this.rules);
         var that = this
         window.getRegionName = function(name) {
            console.log(name)
            if (name.indexOf('区') != -1) {
               that.regionName = name.replace('区', '派出所');
            } else if (name.indexOf('县') != -1) {
               that.regionName = name.replace('县', '派出所');
            } else if (name.indexOf('市') != -1) {
               that.regionName = name.replace('市', '市派出所');
            }
            that.form.xq = that.regionName
            that.mapShow = false
         }
      },
      watch: {
         faceState() {
@@ -567,6 +576,7 @@
               this.faceMsg = '(服务连接失败!)';
            }
         }
      }
   };
</script>
@@ -588,7 +598,7 @@
      bottom: 0;
      left: 0;
      width: 100%;
      height: 60%;
      height: 100%;
      z-index: 222;
      border-radius: 15px 15px 0 0;
      overflow: hidden;