Prechádzať zdrojové kódy

页面fixed定位改为absolute,输入框聚焦隐藏底部栏

luolei 5 rokov pred
rodič
commit
37ed07a90b

+ 9 - 0
src/common/ComTextArea.vue

@@ -4,11 +4,14 @@
             :style="{width:width,height:height}" 
             v-model="txt" 
             placeholder="请输入"
+            @focus="focus"
             @blur="blur"></textarea>
   </div>
 </template>
 
 <script type="text/javascript">
+import { isIos } from '@utils/tools';
+import $ from 'jquery'
 export default {
   name:'ComTextArea',
   props: {
@@ -39,9 +42,15 @@ export default {
     },
     blur(){
       document.activeElement.scrollIntoViewIfNeeded(true);
+      $(".foot").css({'display':'block'})
       setTimeout(()=>{
         document.activeElement.scrollIntoViewIfNeeded(true);
       },300)
+    },
+    focus(){
+      if(isIos()){
+        $(".foot").css({'display':'none'})
+      }
     }
   },
   watch:{

+ 6 - 0
src/common/Input.vue

@@ -10,6 +10,8 @@
   </div>
 </template>
 <script type="text/javascript">
+  import { isIos } from '@utils/tools';
+  import $ from 'jquery';
   export default {
     name:'Input',
     data(){
@@ -32,6 +34,7 @@
         this.$emit("updata",newData);
       },
       blur(){
+        $(".foot").css({'display':'block'})
         document.activeElement.scrollIntoViewIfNeeded(true);
         setTimeout(()=>{
           document.activeElement.scrollIntoViewIfNeeded(true);
@@ -42,6 +45,9 @@
       },
       focus(e){
         this.$emit('focusPosition',e)
+        if(isIos()){
+          $(".foot").css({'display':'none'})
+        }
       }
     },
     watch:{

+ 10 - 1
src/common/MultiLineInput.vue

@@ -13,6 +13,7 @@
               :placeholder="item.placeholder"
               @input="changeVal($event,idx,content.type)" 
               @blur="blur"
+              @focus="focus"
               :maxlength="content.type=='number'?10:''"
               @click="handleClick">
             <input v-show="content.iptLis.length==1" class="contentVal" 
@@ -21,6 +22,7 @@
               v-model="item.value"
               @input="changeVal($event,idx,content.type)" 
               @blur="blur"
+              @focus="focus"
               :maxlength="content.type=='number'?10:''"
               @click="handleClick">
             <span v-if="idx == 0&&content.iptLis.length>1">/</span>
@@ -31,7 +33,8 @@
   </div>
 </template>
 <script>
-import { getModelExpStr } from '@utils/tools';
+import { getModelExpStr,isIos } from '@utils/tools';
+import $ from 'jquery';
 
 export default {
   props:{
@@ -86,11 +89,17 @@ export default {
     },
     blur(){
       // 如果该项未选中,则不存值
+      $(".foot").css({'display':'block'})
       document.activeElement.scrollIntoViewIfNeeded(true);
       setTimeout(()=>{
         document.activeElement.scrollIntoViewIfNeeded(true);
       },300)
     },
+    focus(){
+      if(isIos()){
+        $(".foot").css({'display':'none'})
+      }
+    },
     handleClick(e){
       // 点击输入框时不选中该项
       // document.activeElement.scrollIntoViewIfNeeded(true);

+ 9 - 1
src/common/OptionInp.vue

@@ -12,13 +12,15 @@
               v-model="txt"
               @click="handleCli"
               @blur="handleBlur"
+              @focus="focus"
               @input="changeVal">
     <!-- </div> -->
     <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
   </div>
 </template>
 <script type="text/javascript">
-import { getExpStr} from '@utils/tools';
+import { getExpStr,isIos} from '@utils/tools';
+import $ from 'jquery';
   export default {
     name:'OptionInp',
     data(){
@@ -45,6 +47,7 @@ import { getExpStr} from '@utils/tools';
         this.$emit('handleInp',this.txt);
       },
       handleBlur(){
+        $(".foot").css({'display':'block'})
         document.activeElement.scrollIntoViewIfNeeded(true);
         setTimeout(()=>{
           document.activeElement.scrollIntoViewIfNeeded(true);
@@ -56,6 +59,11 @@ import { getExpStr} from '@utils/tools';
         // this.$emit("updata",newData);
         // this.$emit('handleInp',this.txt);
       },
+      focus(){
+        if(isIos()){
+          $(".foot").css({'display':'none'})
+        }
+      },
       preClick(e){
         e.stopPropagation();
       },

+ 3 - 2
src/components/DetailBox.vue

@@ -23,7 +23,7 @@
       </div>
     </div>
     <!-- <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div> -->
-    <div :class="['foot',{'noCheck':!checkF || !reqFinish}]" @click="complete">完成</div>
+    <div style="position:absolute" :class="['foot',{'noCheck':!checkF || !reqFinish}]" @click="complete">完成</div>
     <Toast :message="clearTxt" 
           :show="showToast"
           @comfirn="comfirnDel" 
@@ -81,6 +81,7 @@
         // 没点过完成,点关闭时校验是否有必填项--有直接移除
         const type = this.data.moduleType;
         const select = this.privateData.select;
+        $(".foot").css({'display':'block'})
         if(type == moduleCP['symp'] && !select){//只处理主诉症状
           const list = this.privateData.questionMapping;
           if(list){
@@ -168,7 +169,7 @@
   .detailBox-wrap{
     width: 100%;
     // overflow-y: auto;
-    position: fixed;
+    position: absolute;
     // bottom: 0; //iPhone6plus键盘收起会跳转
     top:45px;
     bottom: 0;

+ 1 - 1
src/less/base.less

@@ -96,7 +96,7 @@
 }
 
 .btscroll {
-  position: fixed;
+  position: absolute;
   height: 100%;
   width: 100%;
   left: 0;