liucf 5 vuotta sitten
vanhempi
commit
11298d5cc2

+ 9 - 6
src/common/CheckBox.vue

@@ -17,7 +17,7 @@
   </div>
 </template>
 <script type="text/javascript">
-import tools from '@utils/tools.js';
+import {imageUrlPrefix,patt} from '@utils/tools.js';
 import icon from '../images/check-default.png';
 import checkIcon from '../images/check.png';
 import MultiLineInput from '../common/MultiLineInput.vue';
@@ -25,7 +25,7 @@ import MultiLineInput from '../common/MultiLineInput.vue';
     name:'CheckBox',
     data(){
       return{
-        imgUrl:tools.imageUrlPrefix,
+        imgUrl:imageUrlPrefix,
         defaultPic:icon,
         check:checkIcon,
         datas:{},
@@ -80,10 +80,13 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       },
       inpVal(val,index){//输入框失焦处理
         let valueStr = this.datas.value;
-        let patt = /\$\{[^\]]+\}/g;
-        let newVal =  val;
-        const str = valueStr.replace(patt,newVal);
-        this.datas.value = str;
+        if(valueStr){
+          // let patt = /\$\{[^\]]+\}/g;
+          let newVal =  val;
+          const str = valueStr.replace(patt,newVal);
+          this.datas.value = str;
+        }
+        
         // 输入框回读
         let detailList = this.datas.questionDetailList;
         let currItem = detailList[index];

+ 2 - 1
src/common/Input.vue

@@ -45,7 +45,8 @@
       color: #4F50FF;
       font-size: .3rem;
       border: 0 none;
-      border-bottom: 1px solid #7C828E;
+      // border-bottom: 1px solid #7C828E;
+      border-bottom: 1px solid #DFE0E4;
       margin-bottom: .3rem;
       border-radius: 0;
       outline-color: invert;

+ 6 - 1
src/common/Label.vue

@@ -67,8 +67,13 @@ import Toast from '../common/Toast.vue';
       },
       deletSymp(e,it,index){
         e.stopPropagation();
-        this.showToast = true;
+        // 删除互斥项(无)不弹窗提醒 7-18
         this.tempItem = it;
+        if(it.exclusionType == 1){
+          this.comfirnDel();
+          return
+        }
+        this.showToast = true;
       },
       comfirnDel(){
         const temp = this.tempItem;

+ 8 - 1
src/common/MultiLineInput.vue

@@ -3,7 +3,7 @@
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
     <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
         <div class="iptWrap">
-          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model.number="txt" @input="changeVal" @blur="blur">
+          <input class="contentVal" :type="content.type" :placeholder="content.placeholder" v-model.number="txt" @input="changeVal" @blur="blur" @click="handleClick">
         </div>
     </div>
     <span class="suffix" v-if="content.suffix">{{content.suffix}}</span>
@@ -49,9 +49,16 @@ export default {
       // this.$emit('changeMultipVal',this.txt)
     },
     blur(){
+      // 如果该项未选中,则不存值
+      const select = this.part.select;
+      if(!select){return}
       const newData = Object.assign({},this.part,{value:this.txt,controlType:3});
       this.$emit("updata",newData);
       this.$emit('handleInp',this.txt);
+    },
+    handleClick(e){
+      // 点击输入框时不选中该项
+      e.stopPropagation();
     }
   },
   watch:{

+ 11 - 6
src/common/Radio.vue

@@ -19,7 +19,7 @@
 <script type="text/javascript">
 import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
-import {deepClone} from '@utils/tools.js'
+import {patt} from '@utils/tools.js'
 import MultiLineInput from '../common/MultiLineInput.vue';
   export default{
     name:'Radio',
@@ -37,6 +37,7 @@ import MultiLineInput from '../common/MultiLineInput.vue';
     },
     methods:{
       handleClick(it,index){
+        // let patt = /\$\{[^\]]+\}/g;
         const list = this.datas;
         let data = list.questionDetailList&&list.questionDetailList.slice(0); //数组深拷贝?
         let value = "";
@@ -52,11 +53,13 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       },
       inpVal(val,index){//输入框失焦处理
         let valueStr = this.datas.value;
-        let patt = /\$\{[^\]]+\}/g;
-        // let newVal = '{' + val + '}';//修改时替换值用
-        let newVal =  val;//修改时替换值用
-        const str = valueStr.replace(patt,newVal);
-        this.datas.value = str;
+        if(valueStr){
+          // let patt = /\$\{[^\]]+\}/g;
+          let newVal =  val;//修改时替换值用
+          const str = valueStr.replace(patt,newVal);
+          this.datas.value = str;
+        }
+        
         // 输入框回读
         let detailList = this.datas.questionDetailList;
         let currItem = detailList[index];
@@ -88,6 +91,8 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       padding: .12rem .1rem;
       display: inline-block;
       white-space: nowrap;
+      -webkit-white-space: nowrap;
+      // -webkit-box-orient: vertical;
       img{
         width: .38rem;
         vertical-align: middle;

+ 4 - 2
src/components/Detail.vue

@@ -28,6 +28,7 @@ import Radio from '../common/Radio.vue';
 import CheckBox from '../common/CheckBox.vue';
 import Input from '../common/Input.vue';
 import ComTextArea from '../common/ComTextArea.vue';
+import {patt} from '@utils/tools.js'
 // 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
   export default {
     name:'Detail',
@@ -78,7 +79,7 @@ import ComTextArea from '../common/ComTextArea.vue';
 
         this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
         // flag是区分点开已选症状 未点完成
-        this.$store.commit('setText',{text:newMsg,pId:this.checkDatas.id,type:this.type,flag:true});
+        this.$store.commit('setText',{text:newMsg.replace(patt,''),pId:this.checkDatas.id,type:this.type,flag:true});
       },
       clearData(){//清空
         const datas = this.checkDatas.questionMapping;
@@ -104,7 +105,8 @@ import ComTextArea from '../common/ComTextArea.vue';
 </script>
 <style lang="less" scoped>
   .detail-wrap{
-    padding: .3rem .5rem 1.2rem .6rem;
+    // padding: .3rem .5rem 1.2rem .6rem;
+    padding: .3rem .5rem 2rem .6rem;
     font-size: .3rem;
     .quest{
       color:#000;

+ 18 - 6
src/components/DetailBox.vue

@@ -40,7 +40,7 @@
     mounted(){
       const box = this.$refs.detailBox;
       const height = document.documentElement.clientHeight;
-      box.style.height = height - 50 + 'px'; 
+      box.style.height = height - 45 + 'px'; 
     },
     methods:{
       close(){
@@ -75,7 +75,7 @@
 @import '../less/base.less';
   .detailBox-wrap{
     width: 100%;
-    overflow-y: auto;
+    // overflow-y: auto;
     position: fixed;
     bottom: 0;
     left: 0;
@@ -83,7 +83,8 @@
     background: #fff;
     border-radius: .08rem .08rem 0 0;
     font-size: .3rem;
-    animation: wave .4s ease-in;
+    // animation: wave .4s ease-in;
+    animation: wave .4s linear;
     .head{
       height: .88rem;
       line-height: .88rem;
@@ -108,10 +109,14 @@
       }
     }
     .main{
-
+      height: 100%;
+      width:100%;
+      overflow-y: auto;
     }
     .foot{
       .footer;
+      animation-delay:.6s;
+      animation: foo .4s linear;
       /* width:100%;
       height: .88rem;
       line-height: .88rem;
@@ -122,7 +127,14 @@
     }
   }
   @keyframes wave {
-    0%   {height:0 ;}
-    100% {height: 100%;}
+    0%   {top:100% ;}
+    25% {top: 75%;}
+    50% {top: 50%;}
+    75% {top: 25%;}
+    100% {top: 45px;}
   } 
+  @keyframes foo {
+    0% {bottom:-1rem;}
+    100% {bottom:0;}
+  }
 </style>

+ 7 - 0
src/components/PathInfo.vue

@@ -72,6 +72,7 @@
       }
     },
     created(){
+      // this.ifWX();
       this.getPathInfo();
       this.getSysConfig();
     },
@@ -139,6 +140,12 @@
       },
       getStart(){
         this.$router.push({path:'/tab'})
+      },
+      ifWX(){
+        let us = navigator.userAgent.toLowerCase();
+        if(us.indexOf('micromessenger') == -1){
+          console.log("非微信打开")
+        }
       }
     }
   }

+ 7 - 0
src/components/TabPage.vue

@@ -137,7 +137,14 @@ export default {
   width: 100%;
   height: 100%;
   padding-bottom: 0.88rem;
+  padding-top: 0.82rem;
   .tab {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    background: #fff;
+    z-index: 50;
     height: 0.82rem;
     line-height: 0.82rem;
     border-bottom: 1px solid #ededed;

+ 5 - 2
src/utils/tools.js

@@ -76,9 +76,11 @@ const moduleConfig = (config,modules) => {
       }
     }
   }
-  console.log(activeModule)
+  // console.log(activeModule)
   return activeModule
 }
+// 替换输入框占位符
+const patt = /\$\{[^\]]+\}/g;
 
 module.exports =  {
   imageUrlPrefix,
@@ -86,7 +88,8 @@ module.exports =  {
   deepClone,
   getModelExpStr,
   getAllStr,
-  moduleConfig
+  moduleConfig,
+  patt
 }