seimin 2 years ago
parent
commit
09486e141c
1 changed files with 30 additions and 1 deletions
  1. 30 1
      pages/receipt_infopage/receipt_infopage.vue

+ 30 - 1
pages/receipt_infopage/receipt_infopage.vue

@@ -130,7 +130,8 @@
130 130
         <view class="page_item_foot_text">
131 131
           <text class="text1">预约时间</text>
132 132
           <text class="text2" v-if="infoDATA.taskType.associationType.value == 'inspect'">{{ infoDATA.yyTime }}</text>
133
-          <text class="text2" v-if="infoDATA.taskType.associationType.value == 'patientTransport'">{{ infoDATA.yyjdTime }}</text>
133
+          <text class="text2"
134
+            v-if="infoDATA.taskType.associationType.value == 'patientTransport'">{{ infoDATA.yyjdTime|yyTimeFilter }}</text>
134 135
         </view>
135 136
         <view class="page_item_foot_text" v-if="
136 137
             infoDATA.taskType.associationType.value == 'inspect' ||
@@ -368,6 +369,34 @@
368 369
         textareaText: "",
369 370
       };
370 371
     },
372
+    filters: {
373
+      // 自定义管道 yyTime
374
+      yyTimeFilter: function(data) {
375
+        if (data) {
376
+          let nDate = null;
377
+          if (typeof data == 'string') {
378
+            let arr = data.split(/[-:\s]/);
379
+            nDate = new Date(
380
+              arr[0] - 0,
381
+              arr[1] - 1,
382
+              arr[2] - 0,
383
+              arr[3] - 0,
384
+              arr[4] - 0,
385
+              0
386
+            );
387
+          } else if (typeof data == 'number') {
388
+            nDate = new Date(data);
389
+          }
390
+          const month = (nDate.getMonth() + 1).toString().padStart(2, 0);
391
+          const date = nDate.getDate().toString().padStart(2, 0);
392
+          const hour = nDate.getHours().toString().padStart(2, 0);
393
+          const minute = nDate.getMinutes().toString().padStart(2, 0);
394
+          return `${month}-${date} ${hour}:${minute}`;
395
+        } else {
396
+          return "-";
397
+        }
398
+      },
399
+    },
371 400
     methods: {
372 401
       // 移除检查->知道了
373 402
       know1() {