Browse Source

新增遮罩层禁止点击

XhuiCoder 1 year ago
parent
commit
b9b94771ec

+ 2 - 1
common/common.js

@@ -9,7 +9,8 @@ import {
 export function toast(content) {
 	uni.showToast({
 		icon: 'none',
-		title: content
+		title: content,
+    mask: true,
 	})
 }
 

+ 34 - 27
pages/createInfo/createInfo.vue

@@ -264,11 +264,37 @@
       })
 
       getAccessToken(this.callbackToken)
-      window.addEventListener("message", e => {
+      window.addEventListener("message", this.msgCallback, false)
+    },
+    destroyed() {
+      window.removeEventListener("message", this.msgCallback, false)
+    },
+    watch: {
+      'baseFormData.mchnt': {
+        immediate: true,
+        handler(newVal, oldVal) {
+          if (newVal) {
+            getChildListByMchnt({ mchnt: newVal }).then(res => {
+              if (res.code !== 200) return
+              const { data } = res
+              this.lrhjdzList = []
+              let str1 = JSON.stringify(data).replaceAll('code', 'value').replaceAll('label', 'text').replaceAll('null', '')
+              this.lrhjdzList = JSON.parse(str1)
+            })
+          } else {
+            this.lrhjdzList = []
+            this.baseFormData.lrHjdz = ''
+          }
+        }
+      }
+    },
+    methods: {
+      msgCallback(e) {
         if (e.data.data && e.data.data.arg.base64) {
           setTimeout(() => {
             uni.showLoading({
-              title: '正在识别中...'
+              title: '正在识别中...',
+              mask:true,
             })
             this.faceBase64 = ''
             this.cardType = uni.getStorageSync("cardType")
@@ -285,7 +311,8 @@
         if (e.data.data && e.data.data.arg.faceBase64) {
           setTimeout(() => {
             uni.showLoading({
-              title: '正在识别中...'
+              title: '正在识别中...',
+              mask:true,
             })
             this.faceBase64 = e.data.data.arg.faceBase64
             // 压缩
@@ -295,28 +322,7 @@
             })
           }, 1000);
         }
-      }, false)
-    },
-    watch: {
-      'baseFormData.mchnt': {
-        immediate: true,
-        handler(newVal, oldVal) {
-          if (newVal) {
-            getChildListByMchnt({ mchnt: newVal }).then(res => {
-              if (res.code !== 200) return
-              const { data } = res
-              this.lrhjdzList = []
-              let str1 = JSON.stringify(data).replaceAll('code', 'value').replaceAll('label', 'text').replaceAll('null', '')
-              this.lrhjdzList = JSON.parse(str1)
-            })
-          } else {
-            this.lrhjdzList = []
-            this.baseFormData.lrHjdz = ''
-          }
-        }
-      }
-    },
-    methods: {
+      },
       mchntChange(mchnt) {
         // console.log(mchnt);
       },
@@ -429,7 +435,7 @@
           this.idcardFace = words.photo
           this.idcardFaceUrl = base64ToUrl(words.photo);
           this.idcardMD5 = CryptoJS.MD5(id).toString()
-          
+
           if (id) {
             GetLrByZjhm({
               lrJmzjhm: this.idcardMD5
@@ -530,7 +536,8 @@
       save() {
         if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
           uni.showLoading({
-            title: '正在保存中...'
+            title: '正在保存中...',
+            mask:true,
           })
           let paramFiles = []
           fileToBlob(base64toFilen('data:image/jpeg;base64,' + this.frontBase64), (e) => {

+ 36 - 29
pages/info/add-files.vue

@@ -69,7 +69,7 @@
             <!-- <uni-file-picker v-model="zczm" @select="imgSelect3" @delete="imgDelete3"></uni-file-picker> -->
             <myfile :zczmList="zczmList" @recordsChange="zcChange"></myfile>
           </uni-forms-item>
-          
+
           <view v-if="show" style="border: 1px solid red;">
             <uni-forms-item label="直接上传">
               <uni-data-checkbox v-model="radio" :localdata="radioData"></uni-data-checkbox>
@@ -274,11 +274,39 @@
     },
     onLoad(o) {
       getAccessToken(this.callbackToken)
-      window.addEventListener("message", e => {
+      window.addEventListener("message", this.msgCallback, false)
+
+      this.getDictList(Object.keys(this.dicts), this.dicts)
+      this.baseFormData.code = getOpenid()
+
+      this.userInfo = getUser()
+      this.baseFormData.lrHjdz = this.userInfo.dept.locationCode
+      this.groupId = this.userInfo.dept.locationCode.substring(0, 6)
+      let unitFilter = this.userInfo.dept.unitFilter.split(',')
+      this.level = unitFilter.length
+      if (this.userInfo.userType === '07') {
+        this.updateFlag = true
+        this.baseFormData.lrHjdz = this.userInfo.dept.locationCode.substring(0, 6) + '000000'
+        // let info = JSON.parse(o.info)
+        // this.baseFormData.lrHjdz = info.lrHjdz
+        // this.groupId = info.lrHjdz.substring(0, 6)
+        // this.baseFormData = info
+        // this.src = config.baseUrl + info.lrTx
+      }
+      //  查询街道和社区
+      this.getAddressList(this.baseFormData.lrHjdz)
+    },
+    destroyed() {
+      window.removeEventListener("message", this.msgCallback, false)
+    },
+    methods: {
+      msgCallback(e) {
         if (e.data.data && e.data.data.arg.base64) {
+          console.log(e);
           setTimeout(() => {
             uni.showLoading({
-              title: '正在识别中...'
+              title: '正在识别中...',
+              mask:true,
             })
 
             this.faceBase64 = ''
@@ -301,7 +329,8 @@
         if (e.data.data && e.data.data.arg.faceBase64) {
           setTimeout(() => {
             uni.showLoading({
-              title: '正在识别中...'
+              title: '正在识别中...',
+              mask:true,
             })
 
             this.faceBase64 = e.data.data.arg.faceBase64
@@ -314,30 +343,7 @@
           }, 1000);
 
         }
-      }, false)
-
-      this.getDictList(Object.keys(this.dicts), this.dicts)
-      this.baseFormData.code = getOpenid()
-
-      this.userInfo = getUser()
-      this.baseFormData.lrHjdz = this.userInfo.dept.locationCode
-      this.groupId = this.userInfo.dept.locationCode.substring(0, 6)
-      let unitFilter = this.userInfo.dept.unitFilter.split(',')
-      this.level = unitFilter.length
-      if (this.userInfo.userType === '07') {
-        this.updateFlag = true
-        this.baseFormData.lrHjdz = this.userInfo.dept.locationCode.substring(0, 6) + '000000'
-        // let info = JSON.parse(o.info)
-        // this.baseFormData.lrHjdz = info.lrHjdz
-        // this.groupId = info.lrHjdz.substring(0, 6)
-        // this.baseFormData = info
-        // this.src = config.baseUrl + info.lrTx
-      }
-      //  查询街道和社区
-      this.getAddressList(this.baseFormData.lrHjdz)
-
-    },
-    methods: {
+      },
       tkChange(e) {
         this.tkzmList = e
       },
@@ -681,7 +687,8 @@
       save() {
         if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
           uni.showLoading({
-            title: '正在保存中...'
+            title: '正在保存中...',
+            mask:true,
           })
           let paramFiles = []
 

+ 2 - 1
pages/login/index.vue

@@ -254,7 +254,8 @@
         uni.hideKeyboard()
         this.$refs['baseForm'].validate().then(res => {
           uni.showLoading({
-            title: '登录中...'
+            title: '登录中...',
+            mask:true,
           })
           if (!this.formData.openid) this.formData.openid = getOpenid()
           if (this.accountType === '0') {

+ 5 - 4
pages/lr/info.vue

@@ -565,7 +565,8 @@
       },
       save() {
         uni.showLoading({
-          title: '正在修改中...'
+          title: '正在修改中...',
+          mask:true,
         })
         let paramFiles = []
         if (this.baseFormData.istk == 1 && this.tkzmList.length == 1 && this.tkzmList[0].indexOf(
@@ -660,9 +661,9 @@
                   if (r.code == 200) {
                     toast('保存成功')
                     setTimeout(function() {
-                      // uni.switchTab({
-                      // 	url: '/pages/index/index'
-                      // })
+                      uni.switchTab({
+                      	url: '/pages/lr/list'
+                      })
 
                       // uni.navigateBack()
                     }, 1000)

+ 2 - 1
pages/my/index.vue

@@ -51,7 +51,8 @@
           success: function(response) {
             if (response.confirm) {
               uni.showLoading({
-                title: '正在退出中...'
+                title: '正在退出中...',
+                mask:true,
               })
               const user = getUser()
               const { accountType } = user

+ 2 - 1
pages/my/updatePwd.vue

@@ -127,7 +127,8 @@
             return
           }
           uni.showLoading({
-            title: '正在修改中...'
+            title: '正在修改中...',
+            mask:true,
           })
           if (['04', '07'].includes(this.userType)) {
             updateLrPwd(this.baseFormData).then(r => {