Browse Source

Merge remote-tracking branch 'origin/new' into tempMaster

zhouna 5 years ago
parent
commit
56cb74200b

+ 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

+ 4 - 3
src/common/CheckBox.vue

@@ -125,6 +125,7 @@ import OptionInp from '../common/OptionInp.vue';
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .check-wrap{
     img{
       width:100%;
@@ -133,7 +134,7 @@ import OptionInp from '../common/OptionInp.vue';
       width:100%;
     }
     .list{
-      color: #7C828E;
+      color: #colors[text];
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
@@ -149,10 +150,10 @@ import OptionInp from '../common/OptionInp.vue';
       }
     }
     .check{
-      color: #4F50FF;
+      color: #colors[theme];
     }
     .exclu{
-      color:#e6e7e9;
+      color:#colors[exclu];
     }
   }
 </style>

+ 3 - 4
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'})
@@ -63,13 +62,13 @@
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .inp-wrap{
     input{
       width: 100%;
-      color: #4F50FF;
+      color: #colors[theme];
       font-size: .3rem;
       border: 0 none;
-      // border-bottom: 1px solid #7C828E;
       border-bottom: 1px solid #DFE0E4;
       margin-bottom: .3rem;
       border-radius: 0;
@@ -79,7 +78,7 @@
       background: transparent;
     }
     .change{
-      border-color:  #4F50FF;
+      border-color:  #colors[theme];
     }
   }
 </style>

+ 4 - 4
src/common/MultiLineInput.vue

@@ -120,6 +120,7 @@ export default {
 }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .multipIpt {
     width: 100%;
     // height: .74rem /* 74/100 */;
@@ -132,7 +133,7 @@ export default {
     margin: .3rem 0;
     .contentVal {
       font-size: .3rem /* 30/100 */;
-      color: #4F50FF;
+      color: #colors[theme];
       text-align: left;
       border: 0 none;
       // border-bottom: 1px solid #b0afaf !important;
@@ -154,7 +155,7 @@ export default {
   .inline{
     display: inline-block;
     vertical-align: middle;
-    color: #7C828E;
+    color: #colors[text];
     padding: 0;
     margin:0;
     height: auto /* 74/100 */;
@@ -177,7 +178,6 @@ export default {
   }
   .sticP {
     width: 100%;
-    // position: relative;
     padding-right: 1rem;
     box-sizing: border-box;
     .iptWrap {
@@ -191,6 +191,6 @@ export default {
     }
   }
   .check{
-    color: #4F50FF;
+    color: #colors[theme];
   }
 </style>

+ 9 - 18
src/common/OptionInp.vue

@@ -89,44 +89,35 @@ import $ from 'jquery';
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .inpbox{
-    color:#7C828E;
+    color:#colors[text];
     display: inline-block;
     width: 100%;
     white-space: normal;
     vertical-align: middle;
-    // padding-right: .3rem;
-    /* height: .42rem;
-    line-height: .42rem; */
-    /* .inp{
-      display: inline-block;
-      vertical-align: top;
-      input{
-        color: #4F50FF;
-        font-size: .28rem;
-        border-bottom: 1px solid #DFE0E4 !important;
-        border-radius: 0;
-        padding-left: .05rem;
-      }
-    } */
+    height: .42rem;
+    line-height: .42rem;
     .prefix,.suffix{
       display: inline-block;
       vertical-align: middle;
     }
-    input{
+     input{
       height: .42rem;
       color: #4F50FF;
       font-size: .28rem;
       border-bottom: 1px solid #DFE0E4 !important;
       border-radius: 0;
       padding-left: .05rem;
+      height: 0.38rem;
+      line-height: 0.38rem;
     }
     .check{//选中
-      color: #4F50FF;
+      color: #colors[theme];
     }
     // .inp .exclu{ //互斥
     .exclu{ //互斥
-      color:#e6e7e9 !important;
+      color:#colors[exclu] !important;
     }
     .cancel{ //取消
       color: #bbbbbb !important;

+ 3 - 2
src/common/Radio.vue

@@ -77,6 +77,7 @@ import OptionInp from '../common/OptionInp.vue';
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .radio-wrap{
     img{
       width:100%;
@@ -85,7 +86,7 @@ import OptionInp from '../common/OptionInp.vue';
       width:100%;
     }
     .list{
-      color: #7C828E;
+      color: #colors[text];
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
@@ -102,7 +103,7 @@ import OptionInp from '../common/OptionInp.vue';
         vertical-align: middle;
       }
       .check{
-        color: #4F50FF;
+        color: #colors[theme];
       }
     }
   }

+ 3 - 3
src/common/RadioSelect.vue

@@ -82,17 +82,17 @@ import OptionInp from '../common/OptionInp.vue';
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .radio-wrap{
     img{
       width:100%;
     }
     .list{
-      color: #7C828E;
+      color: #colors[text];
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       white-space: nowrap;
       -webkit-white-space: nowrap;
-      // -webkit-box-orient: vertical;
       span {
           margin-left:1.2rem;
       }
@@ -101,7 +101,7 @@ import OptionInp from '../common/OptionInp.vue';
         vertical-align: middle;
       }
       .check{
-        color: #4F50FF;
+        color: #colors[theme];
       }
     }
   }

+ 1 - 1
src/common/Tiptoast.vue

@@ -71,7 +71,7 @@
         font-weight: 700;
       }
       .text{
-        color:#000;
+        color:#colors[quest];
         padding-top: .3rem;
         font-size: .3rem;
       }

+ 2 - 6
src/common/Toast.vue

@@ -54,7 +54,7 @@ import $ from 'jquery';
       border-radius: .2rem;
       z-index: 1000;
       .text{
-        color:#000;
+        color:#colors[quest];
         text-align: center;
         height: 1.25rem;
         // overflow-y: auto;
@@ -72,11 +72,7 @@ import $ from 'jquery';
           height: .70rem;
           line-height: .70rem;
           text-align: center;
-          // color: #fff;
           font-size: .30rem;
-          // background: -webkit-gradient(linear, right top, left top, from(#4F8BFF), to(#4F4FFF));
-          // background: linear-gradient(right, #4F8BFF, #4F4FFF);
-          // box-shadow: 0 .12rem .24rem 0 rgba(79,129,255,0.40);
           border-radius: .35rem;
         }
         .comf{
@@ -84,7 +80,7 @@ import $ from 'jquery';
           border:2px solid rgba(246,75,68,1);
         }
         .canc{
-          color: #4F50FF;
+          color: #colors[theme];
           border:2px solid rgba(79,80,255,1);
         }
       }

+ 1 - 1
src/components/AddContent.vue

@@ -154,7 +154,7 @@ export default {
   }
   // .btscroll;  
   h3 {
-    color: #000;
+    color: #colors[quest];
     margin-bottom: 0.36rem;
   }
 }

+ 2 - 1
src/components/Detail.vue

@@ -242,12 +242,13 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .detail-wrap{
     // padding: .3rem .5rem 1.2rem .6rem;
     padding: .3rem .4rem 1rem ;
     font-size: .3rem;
     .quest{
-      color:#000;
+      color:#colors[quest];
       margin-bottom: .2rem;
     }
     .questionImg {

+ 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;

+ 1 - 5
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);
@@ -195,7 +191,7 @@
     font-size: .3rem;
     // .btscroll;    
     .quest{
-      color: #000;
+      color: #colors[quest];
       margin-bottom: .36rem;
       font-weight: 700;
     }

+ 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);

+ 1 - 1
src/components/Others.vue

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

+ 5 - 4
src/components/PathInfo.vue

@@ -203,6 +203,7 @@
   }
 </script>
 <style lang="less" scoped>
+@import '../less/base.less';
   .path-wrap{
     font-size: .28rem;
     position: absolute;
@@ -224,11 +225,11 @@
       margin-left: .6rem;
       position: relative;
       >p{
-        color: #7C828E;
+        color: #colors[text];
         margin-top: .27rem;
       }
       .name{
-        color: #7C828E;
+        color: #colors[text];
         margin-top: .27rem;
         span{
           margin-right: .08rem;
@@ -239,7 +240,7 @@
           display: inline-block;
           margin-top: .27rem;
           span{
-            color: #7C828E;
+            color: #colors[text];
           }
         }
         p:first-child{
@@ -250,7 +251,7 @@
         position: absolute;
         left: 0;
         bottom:-.6rem;
-        color: #7C828E;
+        color: #colors[text];
       }
     }
     .out-box{

+ 2 - 2
src/components/Preview.vue

@@ -419,7 +419,7 @@ export default {
       padding-left: 0;
     }
     h4 {
-      color: #000;
+      color: #colors[quest];
       font-size: .32rem;
       font-weight: bold;
       position: relative;
@@ -443,7 +443,7 @@ export default {
   }
   .baseMsg {
     font-size: 0.32rem;
-    color: #000000;
+    color: #colors[quest];
     letter-spacing: 0;
     text-align: justify;
     font-weight: bold;

+ 1 - 1
src/components/Symptom.vue

@@ -334,7 +334,7 @@ export default {
   font-size: 0.3rem;
   // .btscroll;
   .quest {
-    color: #000;
+    color: #colors[quest];
     margin-bottom: 0.36rem;
     font-weight: 700;
     .searchImg {

+ 1 - 1
src/components/TabPage.vue

@@ -245,7 +245,7 @@ export default {
       width: 100%;
       height: 0.5rem;
       line-height: 0.5rem;
-      color: #7c828e;
+      color: #colors[text];
       text-align: center;
     }
     .current {

+ 14 - 5
src/less/base.less

@@ -1,6 +1,13 @@
 // 公用less
 @font-size: 13.33333333vw !important;
-@theme-color:#4F50FF;
+// @theme-color:#4F50FF;
+// 命名空间和访问符,映射
+#colors(){
+  theme:#4F50FF; //主题色,选中色
+  text:#7C828E; //患者信息及选项文字颜色
+  quest:#000000; //问题颜色
+  exclu:#e6e7e9; //互斥文字颜色
+}
 .mask{
   width:100%;
   height: 100%;
@@ -62,7 +69,8 @@
     border: 1px solid #DFE0E4;
     border-radius: .08rem;
     text-align: center;
-    color: #7C828E;
+    // color: #7C828E;
+    color: #colors[text];
     margin: 0 .25rem .3rem 0;
     padding: 0 .05rem;
     box-sizing: border-box;
@@ -83,9 +91,10 @@
 .result{
   padding-right: .3rem;
   .title{
-    color: #4F50FF;
+    // color: #4F50FF;
+    // color: #colors[theme];
     padding-left: .1rem;
-    border-left: .08rem solid #4F50FF;
+    border-left: .08rem solid #colors[theme];
     margin-bottom: .19rem;
     font-weight: 700;
   }
@@ -111,5 +120,5 @@
 }
 
 .toastWrapper {
-  background-color: #000;
+  background-color: #colors[quest];
 }

+ 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
+      }
   })
 }