diff --git a/src/components/nutrition-top.vue b/src/components/nutrition-top.vue index e3a5a88..76411a6 100644 --- a/src/components/nutrition-top.vue +++ b/src/components/nutrition-top.vue @@ -4,14 +4,24 @@ -
-
-
- {{ idx + 1 }} -
-
- {{ row.title || "未知" }} - {{ row.total }} +
+
+
排行
+
菜品名称
+
分类
+
购买数量
+
+
+
+
+ {{ idx + 1 }} +
+
+ + {{ row.title }} +
+
{{ row.classifyName || "未知" }}
+
{{ row.total }}
@@ -92,85 +102,81 @@ const dateTypeChange = (e) => { } } - .list { - flex: 1; - min-height: 0; + .table { overflow-y: auto; display: flex; flex-direction: column; - gap: 1.2vh; - padding-bottom: 4vh; + gap: 1vh; + padding-top: 1vh; + min-height: 0; - .item { - display: flex; - align-items: center; - justify-content: space-evenly; - padding: 0.8vh 0.5vw; - cursor: pointer; - background-image: url("@/assets/images/car-alarm-list-item-bg.png"); - background-repeat: no-repeat; - background-size: 100% 100%; + .thead { + display: grid; + grid-template-columns: 0.6fr 1fr 1fr 1.6fr; + gap: 1vh; + padding: 1vh; + border: 1px solid rgba(255, 255, 255, 0.15); + border-radius: 6px; - .type { - width: 7vw; - height: 3.6vh; - line-height: 3.6vh; + .th { + color: rgba(255, 255, 255, 0.7); + font-size: 0.8vw; + padding: 6px 0; text-align: center; - background-repeat: no-repeat; - background-size: 100% 100%; - background-position: center; - - .type-text { - display: inline-block; - font-size: 0.65vw; - color: #c9e9ff; - - width: 80%; - margin: 0 0.5vw; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } } + } - .type-1 { - background-image: url("@/assets/images/car-alarm-type-blue.png"); - } + .tbody { + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 1vh; + min-height: 0; - .type-2 { - background-image: url("@/assets/images/car-alarm-type-green.png"); - } - - .end { - flex: 1; - display: flex; + .tr { + display: grid; + grid-template-columns: 0.6fr 1fr 1fr 1.6fr; + gap: 1vh; align-items: center; - justify-content: space-between; + border: 1px solid rgba(255, 255, 255, 0.08); + background: #0c1d31; + border-radius: 8px; + padding: 1vh 1vh 1vh 1vh; + cursor: pointer; - span { - display: inline-block; - width: 5vw; - font-size: 0.6vw; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } + .td { + width: 100%; + color: rgba(255, 255, 255, 0.9); + font-size: 0.7vw; + display: flex; + align-items: center; + justify-content: center; - span:nth-child(1) { - text-align: center; - color: #d6e3ee; + .index-badge { + width: 1.6vw; + height: 1vw; + line-height: 1vw; + text-align: center; + color: #cfe8ff; + font-weight: 600; + background-repeat: no-repeat; + background-image: url("@/assets/images/device-alarm-list-index-bg.png"); + background-size: 100% 100%; + display: inline-block; + } - flex: 1; - margin-right: 1vw; - } - - span:nth-child(2) { - color: #d6e3ee; - width: 6.5vw; + .device-dot { + width: 0.6vw; + height: 0.6vw; + border-radius: 50%; + background: #3bd2a6; + margin-right: 8px; + } } } } } + } /* 隐藏滚动条 */ diff --git a/src/views/nutrition.vue b/src/views/nutrition.vue index 8a078c1..d2ca1b9 100644 --- a/src/views/nutrition.vue +++ b/src/views/nutrition.vue @@ -15,7 +15,7 @@ @@ -130,7 +130,8 @@ const timerObj = reactive({ interval: 10 * 1000, data: null, queryParams: { - dateRangeType: "YESTERDAY" + // dateRangeType: "YESTERDAY" + dateRangeType: "HALF_YEAR" }, } }) @@ -329,6 +330,7 @@ const getCuisineTop = () => { return { title: v.productName, type: v.productId, + classifyName: v.classifyName, total: v.buyProductCount, }; }) ?? [];