Browse Source

bug2572,2573同时删除scrollIntoViewIfNeeded改为behavior: "smooth"效果待测

luolei 5 years ago
parent
commit
fc3c1dd89e

+ 5 - 5
src/common/ComTextArea.vue

@@ -62,11 +62,11 @@ export default {
     },
     blur(){
       document.activeElement.scrollIntoView({behavior: "smooth"})
-      document.activeElement.scrollIntoViewIfNeeded(true);
-      $(".foot").css({'display':'block'})
-      setTimeout(()=>{
-        document.activeElement.scrollIntoViewIfNeeded(true);
-      },300)
+      // document.activeElement.scrollIntoViewIfNeeded(true);
+      // $(".foot").css({'display':'block'})
+      // setTimeout(()=>{
+      //   document.activeElement.scrollIntoViewIfNeeded(true);
+      // },300)
     },
     focus(){
       if(isIos()){

+ 4 - 4
src/common/Input.vue

@@ -59,10 +59,10 @@
         // $(".btscroll").css({'position':'fixed'})
         $(".foot").css({'display':'block'})
         document.activeElement.scrollIntoView({behavior: "smooth"})
-        document.activeElement.scrollIntoViewIfNeeded(true);
-        setTimeout(()=>{
-          document.activeElement.scrollIntoViewIfNeeded(true);
-        },300)
+        // document.activeElement.scrollIntoViewIfNeeded(true);
+        // setTimeout(()=>{
+        //   document.activeElement.scrollIntoViewIfNeeded(true);
+        // },300)
         // this.borColor = false;
         // const newData = Object.assign({},this.item,{value:this.val,valueP:this.val});
         // this.$emit("updata",newData);

+ 3 - 2
src/common/Label.vue

@@ -86,7 +86,7 @@
         }
         this.showToast = true;
         $(".btscroll").css({'position':'fixed'})
-        $(".foot").css({'position':'fixed'})
+        $(".foot").css({'position':'fixed','bottom':'0'})
         // 底部body不可滑动
         // const prehandler = function(e){e.preventDefault();}
         // document.body.addEventListener("touchmove",prehandler,false)
@@ -131,7 +131,8 @@
       },
       cancelDel(){
         this.showToast = false;
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
         this.tempItem = {};
         this.delIndx = null;
       }

+ 5 - 5
src/common/MultiLineInput.vue

@@ -74,7 +74,7 @@ export default {
   methods:{
     changeVal(e,num,type){
       let tmpTxt = '',arr=this.tmpArr
-      document.activeElement.scrollIntoViewIfNeeded(true);
+      // document.activeElement.scrollIntoViewIfNeeded(true);
       if(type == 'number'){
         e.currentTarget.value = e.currentTarget.value.replace(/^\.$/,'').slice(0,9)
       }
@@ -94,10 +94,10 @@ export default {
       // $(".btscroll").css({'position':'fixed'})
       $(".foot").css({'display':'block'})
       document.activeElement.scrollIntoView({behavior: "smooth"})
-      document.activeElement.scrollIntoViewIfNeeded(true);
-      setTimeout(()=>{
-        document.activeElement.scrollIntoViewIfNeeded(true);
-      },300)
+      // document.activeElement.scrollIntoViewIfNeeded(true);
+      // setTimeout(()=>{
+      //   document.activeElement.scrollIntoViewIfNeeded(true);
+      // },300)
     },
     focus(){
       if(isIos()){

+ 4 - 4
src/common/OptionInp.vue

@@ -51,10 +51,10 @@ import $ from 'jquery';
           // $(".btscroll").css({'position':'fixed'})
         $(".foot").css({'display':'block'})
         document.activeElement.scrollIntoView({behavior: "smooth"})
-        document.activeElement.scrollIntoViewIfNeeded(true);
-        setTimeout(()=>{
-          document.activeElement.scrollIntoViewIfNeeded(true);
-        },300)
+        // document.activeElement.scrollIntoViewIfNeeded(true);
+        // setTimeout(()=>{
+        //   document.activeElement.scrollIntoViewIfNeeded(true);
+        // },300)
           // 如果该项未选中,则不存值
         // const select = this.item.select;
         // if(!select){return}

+ 6 - 4
src/common/PickTime.vue

@@ -47,8 +47,8 @@
       },
       showPicker(){
         this.showTime = true;
-        $(".btscroll").css({'position':'fixed'})
-        $(".foot").css({'position':'fixed'})
+        $(".btscroll").css({'position':'fixed','top':'1rem'})
+        $(".foot").css({'position':'fixed','bottom':'0'})
       },
       getTimeVal(value,index){//确定
         // 首位为0则去掉
@@ -60,11 +60,13 @@
         this.showTime = false;
         const newData = Object.assign({},this.item,{value:this.val,valueP:this.val,pickIndex:index});
         this.$emit("updata",newData);
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
       },
       close(){//点击蒙层关闭
         this.showTime = false;
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
       }
     },
     components:{

+ 1 - 0
src/common/RadioSelect.vue

@@ -121,6 +121,7 @@ import Submit from "../common/Submit";
         this.$emit("updata",newData);
       },
       handleClickShow(idx){
+        document.activeElement.blur();
         this.flg = idx
         this.SymptomLis = this.datas&&this.datas.questionDetailList
         let lis = this.SymptomLis;

+ 1 - 1
src/common/SymptomLis.vue

@@ -116,7 +116,7 @@ import {setScroll} from '@utils/tools.js';
         height: 0.74rem;
         line-height: 0.74rem;
         border: 1px solid #DFE0E4;
-        border-radius: 0.08rem;
+        border-radius: 0.4rem;
         text-align: center;
         color: #7C828E;
         margin: 0 0.18rem 0.3rem 0;

+ 4 - 2
src/common/Toast.vue

@@ -27,11 +27,13 @@ import $ from 'jquery';
     props:['message','show','labShow'],
     methods:{
       comfirn(){
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
         this.$emit("comfirn")
       },
       cancel(){
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
         this.$emit("cancel")
       },
     },

+ 3 - 0
src/components/Detail.vue

@@ -158,6 +158,7 @@ import {patt,trimDots,imageUrlPrefix,setScroll} from '@utils/tools.js';
         this.checkDatas = Object.assign({},this.checkDatas);
       },
       slideToggle(idx){
+        document.activeElement.blur();
         let mapping = this.checkDatas.questionMapping;
         let num = 0;
         for(let i in mapping){
@@ -363,6 +364,8 @@ import {patt,trimDots,imageUrlPrefix,setScroll} from '@utils/tools.js';
       position: absolute;
       width: 100%;
       height: 100%;
+      top: 1.6rem;
+      left: 0;
       .content {
         padding-bottom: 3.88rem;
         padding-top: 0;

+ 6 - 4
src/components/DetailBox.vue

@@ -118,16 +118,18 @@
         // 校验是否有已填项,有--弹窗;无--return
         if(this.checkF){
           this.showToast = true;
-          $(".btscroll").css({'position':'fixed'})
-          $(".foot").css({'position':'fixed'})
+          $(".btscroll").css({'position':'fixed','top':'1rem'})
+          $(".foot").css({'position':'fixed','bottom':'0'})
         }  
       },
       cancelDel(){
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
         this.showToast = false;
       },
       comfirnDel(){
-        $(".btscroll").css({'position':'absolute'})
+        $(".btscroll").css({'position':'absolute','top':'0'})
+        $(".foot").css({'position':'absolute','bottom':'0'})
         this.$refs.detail.clearData();
         this.showToast = false;
         this.checkF = false;

+ 1 - 1
src/components/DiagTreat.vue

@@ -201,7 +201,7 @@
     font-size: .3rem;
     .quest{
       color: #colors[quest];
-      margin-bottom: .36rem;
+      margin-bottom: .3rem;
       font-weight: 700;
     }
     .label{

+ 9 - 9
src/components/Login.vue

@@ -103,21 +103,21 @@ export default {
       this.show = !show;
     },
     blur() {
-      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-        document.activeElement.scrollIntoView({behavior: "smooth"})
-        document.activeElement.scrollIntoViewIfNeeded(true);      
-        setTimeout(() => {
-          document.activeElement.scrollIntoViewIfNeeded(true);
-        }, 300);
-      }
+      // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+      //   document.activeElement.scrollIntoViewIfNeeded(true);      
+      //   setTimeout(() => {
+          document.activeElement.scrollIntoView({behavior: "smooth"})
+      //     document.activeElement.scrollIntoViewIfNeeded(true);
+      //   }, 300);
+      // }
     },
     changeName() {
-      document.activeElement.scrollIntoViewIfNeeded(true);
+      // document.activeElement.scrollIntoViewIfNeeded(true);
       const { patName } = this;
       this.patName = patName.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
     },
     changeVal() {
-      document.activeElement.scrollIntoViewIfNeeded(true);
+      // document.activeElement.scrollIntoViewIfNeeded(true);
       const { type, value } = this;
       if (type == 102 || type == 103) {
         this.value = value.replace(/[^\d]/g, "");

+ 1 - 2
src/components/Others.vue

@@ -5,7 +5,7 @@
           v-if="dtoList"
           :key="it.id"
           class="label">
-        <p class="quest">{{i + 1 +'.' + (it.description||it.name)}}</p>
+        <p class="quest" :style="{'margin-bottom':it.controlType==0?'.3rem':'0'}">{{i + 1 +'.' + (it.description||it.name)}}</p>
         <img class="questionImg" :src="it.url.replace('{imageUrlPrefix}',imgUrl)" v-if="it.url">
         <Label v-if="it.controlType==0"
               :item="it"
@@ -198,7 +198,6 @@
     // .btscroll;
     .quest{
       color: #colors[quest];
-      // margin-bottom: .36rem;
       font-weight: 700;
     }
     .label{

+ 5 - 3
src/components/Symptom.vue

@@ -310,10 +310,11 @@ export default {
       }
       this.showToast = true;
       $(".btscroll").css({'position':'fixed'})
-      $(".foot").css({'position':'fixed'})
+      $(".foot").css({'position':'fixed','bottom':'0'})
     },
     comfirnDel() {
-      $(".btscroll").css({'position':'absolute'})
+      $(".btscroll").css({'position':'absolute','top':'0'})
+      $(".foot").css({'position':'absolute','bottom':'0'})
       this.chooseSymp.splice(this.delIndex, 1);
       this.checkText.splice(this.delIndex, 1);
       this.$store.commit('delText', { type: moduleCP['symp'], pId: this.questId })
@@ -333,7 +334,8 @@ export default {
       this.cancelDel();
     },
     cancelDel() {
-      $(".btscroll").css({'position':'absolute'})
+      $(".btscroll").css({'position':'absolute','top':'0'})
+      $(".foot").css({'position':'absolute','bottom':'0'})
       this.showToast = false;
       this.delIndex = null;
       this.questId = null;