Pārlūkot izejas kodu

Merge branch 'new' of http://192.168.2.236:10080/zhouna/preliminary into new

liucf 5 gadi atpakaļ
vecāks
revīzija
f404bba9a3

+ 1 - 1
build/webpack.dev.conf.js

@@ -34,7 +34,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     compress: true,
     // host: HOST || config.dev.host,
     // host: '192.168.3.6',
-    host: '192.168.1.106',
+    host: '192.168.1.104',
     port: PORT || config.dev.port,
     open: config.dev.autoOpenBrowser,
     overlay: config.dev.errorOverlay

+ 0 - 1
src/common/Input.vue

@@ -45,7 +45,6 @@
         // this.$emit("updata",newData);
       },
       focus(e){
-        this.$emit('focusPosition',e)
         if(isIos()){
           // $(".btscroll").css({'position':'absolute'})
           $(".foot").css({'display':'none'})

+ 1 - 1
src/components/DetailBox.vue

@@ -173,7 +173,7 @@
   .detailBox-wrap{
     width: 100%;
     // overflow-y: auto;
-    position: fixed;
+    position: absolute;
     // bottom: 0; //iPhone6plus键盘收起会跳转
     top:45px;
     bottom: 0;

+ 0 - 4
src/components/DiagTreat.vue

@@ -21,7 +21,6 @@
         <Input v-if="it.controlType==6 || it.controlType==7"
             :item="it"
             :key="it.id"
-            @focusPosition="focusPosition"
             @updata="updataData($event,it.id,i)"/>
         <!-- 文本域 -->
         <ComTextArea v-if="it.controlType == 5"
@@ -100,9 +99,6 @@
       })
     },
     methods:{
-      focusPosition(e){
-        // this.scroll.scrollToElement(e.target,100,0,-40);
-      },
       onScroll(data) {
         this.$store.commit('setScroll', data);
         document.activeElement.scrollIntoViewIfNeeded(true);

+ 7 - 4
src/components/Login.vue

@@ -82,6 +82,7 @@ export default {
   created(){
     this.code = this.$route.query.hospitalCode||''
   },
+
   methods: {
     close() {
       this.showTip = false;
@@ -100,10 +101,12 @@ export default {
       this.show = !show;
     },
     blur() {
-      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.scrollIntoViewIfNeeded(true);
+        }, 300);
+      }
     },
     changeName() {
       document.activeElement.scrollIntoViewIfNeeded(true);

+ 3 - 0
src/main.js

@@ -5,10 +5,12 @@ import App from './App.vue';
 import preview from 'vue-photo-preview';
 import 'vue-photo-preview/dist/skin.css';
 import PortalVue from 'portal-vue';
+import './utils/getfile.js';
 Vue.use(PortalVue);
 Vue.use(preview);
 Vue.config.productionTip = false;
 
+
 new Vue({
   el:'#app',
   router,
@@ -19,3 +21,4 @@ new Vue({
   template:'<App/>'
 });
 
+

+ 106 - 0
src/utils/getfile.js

@@ -0,0 +1,106 @@
+(function () {
+  var canvas, gl, glRenderer, models,
+      devices = [
+          ['a7', '640x1136', ['iPhone 5', 'iPhone 5s']],
+          ['a7', '1536x2048', ['iPad Air', 'iPad Mini 2', 'iPad Mini 3']],
+          ['a8', '640x1136', ['iPod touch (6th gen)']],
+          ['a8', '750x1334', ['iPhone 6']],
+          ['a8', '1242x2208', ['iPhone 6 Plus']],
+          ['a8', '1536x2048', ['iPad Air 2', 'iPad Mini 4']],
+          ['a9', '640x1136', ['iPhone SE']],
+          ['a9', '750x1334', ['iPhone 6s']],
+          ['a9', '1242x2208', ['iPhone 6s Plus']],
+          ['a9x', '1536x2048', ['iPad Pro (1st gen 9.7-inch)']],
+          ['a9x', '2048x2732', ['iPad Pro (1st gen 12.9-inch)']],
+          ['a10', '750x1334', ['iPhone 7']],
+          ['a10', '1242x2208', ['iPhone 7 Plus']],
+          ['a10x', '1668x2224', ['iPad Pro (2th gen 10.5-inch)']],
+          ['a10x', '2048x2732', ['iPad Pro (2th gen 12.9-inch)']],
+          ['a11', '750x1334', ['iPhone 8']],
+          ['a11', '1242x2208', ['iPhone 8 Plus']],
+          ['a11', '1125x2436', ['iPhone X']],
+          ['a12', '828x1792', ['iPhone Xr']],
+          ['a12', '1125x2436', ['iPhone Xs']],
+          ['a12', '1242x2688', ['iPhone Xs Max']],
+          ['a12x', '1668x2388', ['iPad Pro (3rd gen 11-inch)']],
+          ['a12x', '2048x2732', ['iPad Pro (3rd gen 12.9-inch)']]
+      ];
+
+  function getCanvas() {
+      if (canvas == null) {
+          canvas = document.createElement('canvas');
+      }
+
+      return canvas;
+  }
+
+  function getGl() {
+      if (gl == null) {
+          gl = getCanvas().getContext('experimental-webgl');
+      }
+
+      return gl;
+  }
+
+  function getResolution() {
+      var ratio = window.devicePixelRatio || 1;
+      return (Math.min(screen.width, screen.height) * ratio)
+          + 'x' + (Math.max(screen.width, screen.height) * ratio);
+  }
+
+  function getGlRenderer() {
+      if (glRenderer == null) {
+          debugInfo = getGl().getExtension('WEBGL_debug_renderer_info');
+          glRenderer = debugInfo == null ? 'unknown' : getGl().getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
+      }
+
+      return glRenderer;
+  }
+
+  function getModels() {
+      if (models == null) {
+          var gpu = getGlRenderer(),
+              matches = gpu.match(/^apple\s+([_a-z0-9-]+)\s+gpu$/i),
+              res = getResolution();
+          
+          models = ['unknown'];
+
+          if (matches) {
+              for (var i = 0; i < devices.length; i ++) {
+                  var device = devices[i];
+
+                  if (matches[1].toLowerCase() == device[0]
+                      && res == device[1]) {
+                      models = device[2];
+                      break;
+                  }
+              }
+          }
+      }
+
+      return models;
+  }
+
+  if (window.MobileDevice == undefined) {
+      window.MobileDevice = {};
+  }
+
+  window.MobileDevice.getGlRenderer = getGlRenderer;
+  window.MobileDevice.getModels = getModels;
+  window.MobileDevice.getResolution = getResolution;
+
+  window.MobileDevice.is = function (match) {
+      var currentModels = getModels();
+      match = match.toLowerCase().replace(/\s+$/, '') + ' ';
+
+      for (var i = 0; i < currentModels.length; i ++) {
+          var model = currentModels[i].toLowerCase() + ' ';
+
+          if (0 === model.indexOf(math)) {
+              return true;
+          }
+      }
+
+      return false;
+  };
+})();

+ 13 - 2
src/utils/tools.js

@@ -233,7 +233,7 @@ function fixedKeyboard() {
       }else{
         $('.detailBox-wrap').css('position','fixed');
         // $('.main').css('height','100%;') ;
-        $('.main').height("100%") ;
+        $('.main').height("100%");
       }
     }
   })
@@ -319,7 +319,18 @@ function setScroll(scroll,flg,wrapper){
       scrollY: flg,
       click: true,
       probeType:3,
-      bounceTime:500
+      // bounceTime:800,
+      momentumLimitTime:300,//只有在屏幕上快速滑动的时间小于 momentumLimitTime,才能开启 momentum 动画。
+      momentumLimitDistance:15,//只有在屏幕上快速滑动的距离大于 momentumLimitDistance,才能开启 momentum 动画。
+      swipeTime:500,//设置 momentum 动画的动画时长
+      deceleration:0.015,
+      swipeBounceTime:500,
+      bounce: {
+        top: false,
+        bottom: false,
+        left: false,
+        right: false
+      }
   })
 }