From ea689dd91eaa72425dc01759042c3b4eb2186512 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 17 六月 2026 10:14:44 +0800
Subject: [PATCH] 新增智能电表、空调管理

---
 h5/pages/customer/contract/list.vue |  206 +++++++++++++++++++++++++-------------------------
 1 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/h5/pages/customer/contract/list.vue b/h5/pages/customer/contract/list.vue
index 73c3e01..ac70d09 100644
--- a/h5/pages/customer/contract/list.vue
+++ b/h5/pages/customer/contract/list.vue
@@ -1,103 +1,103 @@
-<template>

-  <view class="cu-page">

-    <scroll-view scroll-x class="cu-tabs cu-tabs--scroll">

-      <view

-        v-for="(t, i) in tabs"

-        :key="t.value"

-        :class="['cu-tab', tabIdx === i ? 'cu-tab--active' : '']"

-        @click="tabIdx = i; load()"

-      >{{ t.label }}</view>

-    </scroll-view>

-

-    <view class="cu-list-header">

-      <text class="cu-list-header__count">鍏� {{ list.length }} 浠藉悎鍚�</text>

-    </view>

-

-    <view class="cu-list-wrap">

-      <view v-for="item in list" :key="item.id" class="cu-list-card cu-list-card--clickable" @click="goDetail(item.id)">

-        <view class="cu-list-card__head">

-          <view class="cu-list-card__icon cu-list-card__icon--contract">馃搫</view>

-          <view class="cu-list-card__main">

-            <view class="cu-list-card__title-row">

-              <text class="cu-list-card__title">{{ item.code }}</text>

-              <text :class="['cu-status', contractStatusClass(item.status)]">{{ statusText(item.status) }}</text>

-            </view>

-            <text class="cu-list-card__sub">{{ item.roomInfo || '鏆傛棤鎴块棿淇℃伅' }}</text>

-            <view class="cu-period-chip">{{ item.startDate }} ~ {{ item.endDate }}</view>

-          </view>

-        </view>

-

-        <view class="cu-info-grid">

-          <view class="cu-info-cell">

-            <text class="cu-info-cell__label">绉熻祦闈㈢Н</text>

-            <text class="cu-info-cell__value cu-info-cell__value--primary">{{ formatArea(item.totalArea) }}</text>

-          </view>

-          <view class="cu-info-cell">

-            <text class="cu-info-cell__label">浠樻鏂瑰紡</text>

-            <text class="cu-info-cell__value">{{ item.payTypeText || '-' }}</text>

-          </view>

-        </view>

-

-        <view v-if="item.billStatusTip" :class="['cu-bill-tip', billTipClass(item.billStatusType)]">

-          <text class="cu-bill-tip__icon">{{ billTipIcon(item.billStatusType) }}</text>

-          <text class="cu-bill-tip__text">{{ item.billStatusTip }}</text>

-        </view>

-

-        <view class="cu-list-card__foot">

-          <text class="cu-time">鐐瑰嚮鏌ョ湅瀹屾暣鍚堝悓淇℃伅</text>

-          <text class="cu-list-card__arrow">璇︽儏 鈫�</text>

-        </view>

-      </view>

-      <u-empty v-if="!list.length" text="鏆傛棤鍚堝悓" margin-top="80" />

-    </view>

-  </view>

-</template>

-

-<script>

-import { customerContractPage } from '@/api'

-export default {

-  data () {

-    return {

-      list: [],

-      tabIdx: 0,

-      tabs: [

-        { label: '鍏ㄩ儴', value: null }, { label: '寰呮墽琛�', value: 0 }, { label: '鎵ц涓�', value: 1 },

-        { label: '宸插埌鏈�', value: 2 }, { label: '閫�绉熶腑', value: 3 }, { label: '宸查��绉�', value: 4 }

-      ]

-    }

-  },

-  onShow () { this.load() },

-  methods: {

-    load () {

-      customerContractPage({ page: 1, capacity: 50, model: { status: this.tabs[this.tabIdx].value } })

-        .then(res => { this.list = (res.data && res.data.records) || [] })

-    },

-    formatArea (area) {

-      if (area === null || area === undefined || area === '') return '-'

-      return `${area}銕

-    },

-    statusText (s) {

-      const map = { 0: '寰呮墽琛�', 1: '鎵ц涓�', 2: '宸插埌鏈�', 3: '閫�绉熶腑', 4: '宸查��绉�' }

-      return map[s] || '-'

-    },

-    contractStatusClass (s) {

-      if (s === 1) return 'cu-status--ok'

-      if (s === 2 || s === 4) return 'cu-status--muted'

-      if (s === 3) return 'cu-status--warn'

-      return 'cu-status--muted'

-    },

-    billTipClass (type) {

-      if (type === 'danger') return 'cu-bill-tip--danger'

-      if (type === 'warn') return 'cu-bill-tip--warn'

-      return 'cu-bill-tip--ok'

-    },

-    billTipIcon (type) {

-      if (type === 'danger') return '鈿狅笍'

-      if (type === 'warn') return '鈴�'

-      return '鉁�'

-    },

-    goDetail (id) { uni.navigateTo({ url: `/pages/customer/contract/detail?id=${id}` }) }

-  }

-}

-</script>

-
\ No newline at end of file
+<template>
+  <view class="cu-page">
+    <scroll-view scroll-x class="cu-tabs cu-tabs--scroll">
+      <view
+        v-for="(t, i) in tabs"
+        :key="t.value"
+        :class="['cu-tab', tabIdx === i ? 'cu-tab--active' : '']"
+        @click="tabIdx = i; load()"
+      >{{ t.label }}</view>
+    </scroll-view>
+
+    <view class="cu-list-header">
+      <text class="cu-list-header__count">鍏� {{ list.length }} 浠藉悎鍚�</text>
+    </view>
+
+    <view class="cu-list-wrap">
+      <view v-for="item in list" :key="item.id" class="cu-list-card cu-list-card--clickable" @click="goDetail(item.id)">
+        <view class="cu-list-card__head">
+          <view class="cu-list-card__icon cu-list-card__icon--contract">
+
+            <u-icon name="file-text-fill" color="#40a9ff" size="22" />
+
+          </view>
+          <view class="cu-list-card__main">
+            <view class="cu-list-card__title-row">
+              <text class="cu-list-card__title">{{ item.code }}</text>
+              <text :class="['cu-status', contractStatusClass(item.status)]">{{ statusText(item.status) }}</text>
+            </view>
+            <text class="cu-list-card__sub">{{ item.roomInfo || '鏆傛棤鎴块棿淇℃伅' }}</text>
+            <view class="cu-period-chip">{{ item.startDate }} ~ {{ item.endDate }}</view>
+          </view>
+        </view>
+
+        <view class="cu-info-grid">
+          <view class="cu-info-cell">
+            <text class="cu-info-cell__label">绉熻祦闈㈢Н</text>
+            <text class="cu-info-cell__value cu-info-cell__value--primary">{{ formatArea(item.totalArea) }}</text>
+          </view>
+          <view class="cu-info-cell">
+            <text class="cu-info-cell__label">浠樻鏂瑰紡</text>
+            <text class="cu-info-cell__value">{{ item.payTypeText || '-' }}</text>
+          </view>
+        </view>
+
+        <view v-if="item.billStatusTip" :class="['cu-bill-tip', billTipClass(item.billStatusType)]">
+
+          <text class="cu-bill-tip__text">{{ item.billStatusTip }}</text>
+
+        </view>
+
+        <view class="cu-list-card__foot">
+          <text class="cu-time">鐐瑰嚮鏌ョ湅瀹屾暣鍚堝悓淇℃伅</text>
+          <text class="cu-list-card__arrow">璇︽儏 鈫�</text>
+        </view>
+      </view>
+      <u-empty v-if="!list.length" text="鏆傛棤鍚堝悓" margin-top="80" />
+    </view>
+  </view>
+</template>
+
+<script>
+import { customerContractPage } from '@/api'
+export default {
+  data () {
+    return {
+      list: [],
+      tabIdx: 0,
+      tabs: [
+        { label: '鍏ㄩ儴', value: null }, { label: '寰呮墽琛�', value: 0 }, { label: '鎵ц涓�', value: 1 },
+        { label: '宸插埌鏈�', value: 2 }, { label: '閫�绉熶腑', value: 3 }, { label: '宸查��绉�', value: 4 }
+      ]
+    }
+  },
+  onShow () { this.load() },
+  methods: {
+    load () {
+      customerContractPage({ page: 1, capacity: 50, model: { status: this.tabs[this.tabIdx].value } })
+        .then(res => { this.list = (res.data && res.data.records) || [] })
+    },
+    formatArea (area) {
+      if (area === null || area === undefined || area === '') return '-'
+      return `${area}銕
+    },
+    statusText (s) {
+      const map = { 0: '寰呮墽琛�', 1: '鎵ц涓�', 2: '宸插埌鏈�', 3: '閫�绉熶腑', 4: '宸查��绉�' }
+      return map[s] || '-'
+    },
+    contractStatusClass (s) {
+      if (s === 1) return 'cu-status--ok'
+      if (s === 2 || s === 4) return 'cu-status--muted'
+      if (s === 3) return 'cu-status--warn'
+      return 'cu-status--muted'
+    },
+    billTipClass (type) {
+      if (type === 'danger') return 'cu-bill-tip--danger'
+      if (type === 'warn') return 'cu-bill-tip--warn'
+      return 'cu-bill-tip--ok'
+    },
+    goDetail (id) { uni.navigateTo({ url: `/pages/customer/contract/detail?id=${id}` }) }
+  }
+}
+</script>
+

--
Gitblit v1.9.3