Browse Source

遮挡问题

luolei 5 years ago
parent
commit
2e3a67c81c

+ 3 - 1
src/common/ComTextArea.vue

@@ -61,7 +61,9 @@ export default {
       this.$emit("updata",newData);
     },
     blur(){
-      document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+      }
       $(".foot").css({'display':'block'})
       // document.activeElement.scrollIntoViewIfNeeded(true);
       // $(".foot").css({'display':'block'})

+ 6 - 2
src/common/Input.vue

@@ -48,7 +48,9 @@
       changeVal(e){
         this.borColor = true;
         if(this.item.controlType==7){//数字键盘
-          this.val = e.target.value=e.target.value.replace(/^\.$/,'').slice(0,9)
+          if(+e.target.value.length>10){
+            e.target.value=e.target.value.replace(/^\.$/,'').slice(0,10)
+          }
         }
         // document.activeElement.scrollIntoViewIfNeeded(true);
         this.borColor = false;
@@ -58,7 +60,9 @@
       blur(){
         // $(".btscroll").css({'position':'fixed'})
         $(".foot").css({'display':'block'})
-        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+        if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+          document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+        }
         // document.activeElement.scrollIntoViewIfNeeded(true);
         // setTimeout(()=>{
         //   document.activeElement.scrollIntoViewIfNeeded(true);

+ 7 - 2
src/common/MultiLineInput.vue

@@ -76,7 +76,9 @@ export default {
       let tmpTxt = '',arr=this.tmpArr
       // document.activeElement.scrollIntoViewIfNeeded(true);
       if(type == 'number'){
-        e.currentTarget.value = e.currentTarget.value.replace(/^\.$/,'').slice(0,9)
+        if(+e.currentTarget.value.length>10){
+          e.currentTarget.value = e.currentTarget.value.replace(/^\.$/,'').slice(0,10)
+        }
       }
       arr[num]=e.currentTarget.value
       tmpTxt=arr.join('/')
@@ -93,7 +95,10 @@ export default {
       // 如果该项未选中,则不存值
       // $(".btscroll").css({'position':'fixed'})
       $(".foot").css({'display':'block'})
-      document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+      
+      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+      }
       // document.activeElement.scrollIntoViewIfNeeded(true);
       // setTimeout(()=>{
       //   document.activeElement.scrollIntoViewIfNeeded(true);

+ 7 - 2
src/common/OptionInp.vue

@@ -40,7 +40,9 @@ import $ from 'jquery';
     methods:{
       changeVal(e){
         if(this.msg.type=='number'){//数字键盘
-          this.txt = e.target.value=e.target.value.replace(/^\.$/,'').slice(0,9)
+          if(+e.target.value.length>10){
+            e.target.value=e.target.value.replace(/^\.$/,'').slice(0,9)
+          }
         }
         const newData = Object.assign({},this.part,{value:this.txt});
         this.$emit("updata",newData);
@@ -50,7 +52,10 @@ import $ from 'jquery';
       handleBlur(){
           // $(".btscroll").css({'position':'fixed'})
         $(".foot").css({'display':'block'})
-        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+        
+        if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+          document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+        }
         // document.activeElement.scrollIntoViewIfNeeded(true);
         // setTimeout(()=>{
         //   document.activeElement.scrollIntoViewIfNeeded(true);

+ 1 - 2
src/common/Picker.vue

@@ -102,14 +102,13 @@
       // height: 4.8rem;
       height: 227px;
       background: #fff;
-      z-index: 999;
       position: fixed;
       top:50%;
       left: 50%;
       transform: translate(-50%,-50%);
       box-sizing: border-box;
       border-radius: .2rem;
-      z-index: 1000;
+      z-index: 1100;
       font-size: .3rem;
       overflow-y: hidden;
       .confBtn{

+ 6 - 1
src/components/Detail.vue

@@ -70,6 +70,7 @@
                   :detail="1"
                   :item="item"/>
         </div>
+        <!-- <p ref="btm"></p> -->
       </div>
     </div>
   </div>
@@ -160,7 +161,11 @@ import $ from 'jquery';
       },
       slideToggle(e,idx){
         document.activeElement.blur();
-        console.log(e.currentTarget,$(e.currentTarget).next().height(),this.scroll.maxScrollY)
+        // let y = this.$store.state.scroll.y
+        // if(idx==this.checkDatas.questionMapping.length-1){
+        //   this.scroll.scrollToElement(this.$refs.btm,0,true,true)
+        //   this.scroll.scrollTo(0,0,this.scroll.maxScrollY)
+        // }
         let mapping = this.checkDatas.questionMapping;
         let num = 0;
         for(let i in mapping){

+ 0 - 1
src/components/Login.vue

@@ -110,7 +110,6 @@ export default {
       this.he = (window.innerHeight,'focus')      
     },
     blur() {
-      document.activeElement.scrollIntoViewIfNeeded(false);
       if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
         document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
         // setTimeout(() => {

+ 3 - 1
src/store.js

@@ -9,7 +9,9 @@ const store = new Vuex.Store({
     pathInfo:{}, //患者信息-后续提交要用
     sysConfig:[], //系统配置项
     allMoudles:[], //模板
-    scroll:{},
+    scroll:{
+      x:0,y:0
+    },
     symptom:{ //症状情况
       choose:[],
       origin:{},