Explorar o código

待办事项列表页样式修改

seimin %!s(int64=3) %!d(string=hai) anos
pai
achega
a4cf543119
Modificáronse 3 ficheiros con 47 adicións e 10 borrados
  1. 27 0
      src/filters/index.js
  2. 1 0
      src/main.js
  3. 19 10
      src/views/indes.vue

+ 27 - 0
src/filters/index.js

@@ -0,0 +1,27 @@
1
+import Vue from 'vue'
2
+Vue.filter('timeFormat', function (date, fmt) {
3
+  if (!date) {
4
+    return '';
5
+  }
6
+  date = new Date(date);
7
+  if (/(y+)/.test(fmt)) {
8
+    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
9
+  }
10
+  let o = {
11
+    'M+': date.getMonth() + 1,
12
+    'd+': date.getDate(),
13
+    'H+': date.getHours(),
14
+    'm+': date.getMinutes(),
15
+    's+': date.getSeconds()
16
+  };
17
+  for (let k in o) {
18
+    if (new RegExp(`(${k})`).test(fmt)) {
19
+      let str = o[k] + '';
20
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
21
+    }
22
+  }
23
+  function padLeftZero(str) {
24
+    return ('00' + str).substr(str.length);
25
+  }
26
+  return fmt;
27
+})

+ 1 - 0
src/main.js

@@ -6,6 +6,7 @@ import router from './router'
6 6
 import axios from 'axios'
7 7
 import Cube from './index'
8 8
 import 'lib-flexible'
9
+import './filters'
9 10
 // import host from '../src/request/host'
10 11
 // import {get,post} from './service/http'
11 12
 Vue.use(Cube)

+ 19 - 10
src/views/indes.vue

@@ -91,6 +91,13 @@
91 91
               <p v-if="valConfig == 1">
92 92
                 报修人:
93 93
                 <span class="grayFont">{{ item.requester.name }}</span>
94
+                <span v-if="!item.contactsInformation"></span>
95
+                <span @click.stop v-if="item.contactsInformation"
96
+                  ><a :href="'tel:' + item.contactsInformation"
97
+                    >(<i class="iconfont icon-shouji"></i
98
+                    >{{ item.contactsInformation }})</a
99
+                  ></span
100
+                >
94 101
               </p>
95 102
               <p v-if="valConfig == 2">
96 103
                 报修科室 :
@@ -99,16 +106,15 @@
99 106
                 }}</span>
100 107
               </p>
101 108
             </div>
102
-            <div class="bottom" @click.stop>
103
-              <span class="fl" v-if="!item.contactsInformation"
104
-                >联系电话:</span
105
-              >
106
-              <span class="fl" v-if="item.contactsInformation"
107
-                >联系电话:<a :href="'tel:' + item.contactsInformation"><i class="iconfont icon-shouji"></i>{{
108
-                  item.contactsInformation
109
-                }}</a></span
109
+            <div class="bottom">
110
+              <span v-if="!item.place"></span>
111
+              <span
112
+                v-if="item.place"
113
+                style="width:70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
114
+                >{{ item.place.area.area }} {{ item.place.place }}
115
+                {{ item.houseNumber }}</span
110 116
               >
111
-              <span class="fr">报修时间:{{ item.acceptDate }}</span>
117
+              <span>{{ item.acceptDate | timeFormat("MM-dd HH:mm") }}</span>
112 118
             </div>
113 119
           </div>
114 120
         </div>
@@ -421,8 +427,11 @@ export default {
421 427
         }
422 428
       }
423 429
       .bottom {
430
+        display: flex;
431
+        justify-content: space-between;
432
+        align-items: center;
424 433
         overflow: hidden;
425
-        line-height: 0.86rem;
434
+        height: 0.86rem;
426 435
         border-bottom: 0.01rem solid #e6e6e6;
427 436
         font-size: 0.24rem;
428 437
         color: #999;