Przeglądaj źródła

fix:流调优化

magic v 4 lat temu
rodzic
commit
3c1cf7544b

+ 22 - 4
src/pages/FormResult/index.vue

@@ -1,5 +1,6 @@
 <template>
-<div class="bl-flex" h100 items-center column>
+<div class="bl-flex" h100 items-center column
+  :rst-bg-color="putIsAbnormal">
   <div size-lg bold color-des padding-top-xl>请出示给门诊员工</div>
   <div size-lg padding-top-xl>
     <div class="bl-flex abnormal" items-center color-success v-if="!putIsAbnormal">
@@ -13,18 +14,35 @@
   </div>
   <div w100 size-sm padding-lg padding-top-xl>
     <div class="bl-flex" between margin-top-md margin-bottom-md
-      v-for="(item, index) in data.result.slice(0, 3)"
+      v-for="(item, index) in data.result.slice(0, 4)"
       :key="index">
       <div color-des>{{ item.title }}</div>
       <div>{{ item.val }}</div>
     </div>
+    <div class="bl-flex" between margin-top-md margin-bottom-md
+      :color-warning="putTemperature === 37.3"
+      :color-error="putTemperature > 37.3"
+      :color-success="putTemperature < 37.3"
+      v-if="putTemperature !== true && !!putTemperature">
+      <div color-des>当日体温</div>
+      <div>{{ putTemperature }}°C</div>
+    </div>
+    <div class="bl-flex" between margin-top-md margin-bottom-md color-error
+      v-for="(item, index) in putAbnormalList"
+      :key="'a' + index">
+      <div>{{ item.title }}</div>
+      <div>{{ item.val }}</div>
+    </div>
     <div class="bl-flex" between margin-top-md margin-bottom-md>
       <div color-des>提交时间</div>
       <div>{{ data.created }}</div>
     </div>
   </div>
-  <div w100 padding-lg>
-    <div class="btn primary" @click="btnLinkBack()">回到首页</div>
+  <div class="bl-flex" padding-bottom-lg v-if="putOrgName">
+    <div size-xl>{{ putOrgName }}</div>
+  </div>
+  <div w100 padding-lg v-if="!putIsAbnormal">
+    <div class="btn primary" @click="btnLinkBack()">回到小程序首页</div>
   </div>
 </div>
 </template>

+ 28 - 0
src/pages/FormResult/mixins/index.js

@@ -23,6 +23,34 @@ export default {
       } catch (err) {
         
       }
+    },
+    putAbnormalList () {
+      return this.data.result.filter(item => item.type === 'radio' && item.val === '是')
+    },
+    putOrgName () {
+      let name = ''
+      let reg = new RegExp('眼科门诊')
+      this.data.result.some(item => {
+        if (reg.test(item.title)) {
+          name = item.val
+          return true
+        }
+      })
+      return name
+    },
+    // 体温
+    putTemperature () {
+      let num = ''
+      let reg = new RegExp('当日体温')
+      this.data.result.some(item => {
+        if (reg.test(item.title)) {
+          let n = Number(item.val)
+          // 温度参数校验
+          num = isNaN(n) || n
+          return true
+        }
+      })
+      return num
     }
   },
   methods: {

+ 3 - 0
src/pages/FormResult/style.scss

@@ -5,3 +5,6 @@
     font-size: 52px;
   }
 }
+.bl-flex[rst-bg-color] {
+  background: rgba(248, 228, 193, 1);
+}