Blame view

src/components/index/indexCommunity.vue 5.25 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
6d9d3e27   wuxw   完成物业首页功能
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    <div class="index-1-left-1">
      <div class="index-title">
        <span>{{ $t('propertyIndex.communityInfo') }}</span>
      </div>
      <div class="flex justify-between border-bottom index-1-left-1-content">
        <div v-for="(item, index) in stats" :key="index" class="flex justify-center" >
          <div class="index-1-left-img">
            <i :class="item.icon"></i>
          </div>
          <div>
            <div class="index-number">{{ indexCommunityViewInfo[item.key] }}</div>
            <div class="index-number-describe">{{ $t(`propertyIndex.${item.label}`) }}</div>
          </div>
        </div>
      </div>
      <div class="flex justify-between index-1-left-1-bottom">
        <div class="flex justify-between index-1-left-1-bottom-item">
          <div class="text-center">
            <div class="index-name">{{ $t('propertyIndex.residentReg') }}</div>
            <div class="index-name-ico">
              <i class="el-icon-user"></i>
            </div>
          </div>
          <div class="text-center">
            <div class="index-number">{{ indexCommunityViewInfo.ownerCount }}
              <span class="index-number-unit">{{ $t('propertyIndex.unit') }}</span>
            </div>
            <div class="index-number-describe margin-top-sm" @click="_toOwner">
              {{ $t('propertyIndex.registerResident') }} >
            </div>
          </div>
        </div>
        <div class="flex justify-between index-1-left-1-bottom-item">
          <div class="text-center">
            <div class="index-name">{{ $t('propertyIndex.vehicle') }}</div>
            <div class="index-name-ico">
              <i class="el-icon-truck"></i>
            </div>
          </div>
          <div class="text-center">
            <div class="index-number">{{ indexCommunityViewInfo.carCount }}
              <span class="index-number-unit">{{ $t('propertyIndex.unit') }}</span>
            </div>
            <div class="index-number-describe margin-top-sm" @click="_toCar">
              {{ $t('propertyIndex.viewVehicle') }} >
            </div>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import { getPropertyAssetsIndex } from '@/api/index/propertyIndexApi'
  
  export default {
    name: 'IndexCommunity',
    data() {
      return {
        indexCommunityViewInfo: {
          floorCount: 0,
          roomCount: 0,
          shopCount: 0,
          ownerCount: 0,
          spaceCount: 0,
          carCount: 0,
        },
        stats: [
          { key: 'floorCount', label: 'building', icon: 'el-icon-office-building' },
          { key: 'roomCount', label: 'house', icon: 'el-icon-house' },
          { key: 'shopCount', label: 'shop', icon: 'el-icon-shopping-bag-2' },
          { key: 'spaceCount', label: 'parkingSpace', icon: 'el-icon-truck' }
        ]
      }
    },
    created() {
    },
    methods: {
      _loadPropertyIndexAssets() {
        const param = {
          page: 1,
          row: 10,
          communityId: this.getCommunityId()
        }
  
        getPropertyAssetsIndex(param)
          .then(res => {
            if (res.code === 0) {
              Object.assign(this.indexCommunityViewInfo, res.data)
            }
          })
          .catch(err => {
            console.error('请求失败处理', err)
          })
      },
      _toOwner() {
e94f0676   wuxw   跳转到业务受理页面处理完成
98
        this.$router.push('/pages/property/listOwner?tab=ownerInfo')
6d9d3e27   wuxw   完成物业首页功能
99
100
      },
      _toCar() {
e94f0676   wuxw   跳转到业务受理页面处理完成
101
        this.$router.push('/pages/property/listOwnerCar?tab=ownerCar')
6d9d3e27   wuxw   完成物业首页功能
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .index-1-left-1 {
    background: #fff;
    border-radius: 4px;
    padding: 15px;
    
    .index-title {
      font-size: 16px;
      font-weight: bold;
      margin-bottom: 15px;
      text-align: left;
      color: #333;
    }
    
    .index-1-left-1-content {
      padding: 50px 0;
      border-bottom: 1px solid #eee;
      
      > div {
        width: 25%;
        text-align: center;
      }
      
      .index-1-left-img {
        width: 40px;
        height: 40px;
        background: #f0f7ff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 10px;
        
        i {
          font-size: 20px;
          color: #409EFF;
        }
      }
      
      .index-number {
        font-size: 24px;
        font-weight: bold;
        color: #333;
      }
      
      .index-number-describe {
        font-size: 12px;
        color: #999;
      }
    }
    
    .index-1-left-1-bottom {
      padding: 28px 40px;
      
      .index-1-left-1-bottom-item {
        width: 40%;
        border-radius: 4px;
        padding: 10px;
        padding-left:30px;
        padding-right:30px;
        
        .index-name {
          font-size: 16px;
          font-weight: bold;
          color: #333;
        }
        
        .index-name-ico {
          width: 40px;
          height: 40px;
          background: #e6f7ff;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin: 10px auto;
          
          i {
            font-size: 20px;
            color: #1890ff;
          }
        }
        
        .index-number {
          font-size: 24px;
          font-weight: bold;
          color: #333;
          
          .index-number-unit {
            font-size: 14px;
            color: #999;
          }
        }
        
        .index-number-describe {
          font-size: 12px;
          color: #1890ff;
          cursor: pointer;
          
          &:hover {
            text-decoration: underline;
          }
        }
      }
    }
    
    .margin-top-sm {
      margin-top: 5px;
    }
  }
  </style>