From 439e2aeade4d616c205b530af816f55b24e02b3b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 15 Jul 2024 11:25:57 +0800 Subject: [PATCH] (Update townDetail components with optimized API parameters and added sotre_id for improved accuracy) --- src/api.js | 14 +- src/components/index/bottomCenter.vue | 240 +++++++++----------------- src/components/index/bottomLeft.vue | 2 +- src/components/index/bottomRight.vue | 8 +- src/components/index/topCenter.vue | 177 +++++++++++-------- src/components/index/topLeft.vue | 46 +++-- src/components/index/topRight.vue | 14 +- src/view/index.vue | 40 ++--- 8 files changed, 257 insertions(+), 284 deletions(-) diff --git a/src/api.js b/src/api.js index 2b1c18f..076f320 100644 --- a/src/api.js +++ b/src/api.js @@ -8,8 +8,8 @@ let expire = localStorage.getItem("TRADE_USER") ? JSON.parse(localStorage.getIte // 创建axios 实例 const instacne = axios.create({ - // baseURL: "http://192.168.1.22:8545", - baseURL: "https://multi-store.lihaink.cn", + baseURL: "http://192.168.1.22:8545", + // baseURL: "https://multi-store.lihaink.cn", // baseURL: "https://shop.lihaink.cn/", timeout: 30000, }); @@ -70,15 +70,21 @@ export function getUserNumApi(params) { export function getOrderNumApi(params) { - return instacne.get('/api/dataview/order_statistics', { params }) + return instacne.get('/statistics/store_order_day', { params }) } export function getSalesRankApi(params) { return instacne.get('/statistics/sales_ranking', { params }) } +export function getSotreCountApi(params) { + return instacne.get('/statistics/sotre_count', { params }) +} +export function getProductCountSotreCountApi(params) { + return instacne.get('/statistics/product_count_sotre_count', { params }) +} export function getTodayOrderAmountApi(params) { - return instacne.get('/api/dataview/curr_day_order_amount', { params }) + return instacne.get('/statistics/store_order_day_two', { params }) } diff --git a/src/components/index/bottomCenter.vue b/src/components/index/bottomCenter.vue index de6536c..165aa49 100644 --- a/src/components/index/bottomCenter.vue +++ b/src/components/index/bottomCenter.vue @@ -1,117 +1,63 @@ + + + + + \ No newline at end of file diff --git a/src/components/index/bottomLeft.vue b/src/components/index/bottomLeft.vue index 4e1bbcc..099310c 100644 --- a/src/components/index/bottomLeft.vue +++ b/src/components/index/bottomLeft.vue @@ -32,7 +32,7 @@ const configs = reactive( ) getOrderNumApi(props.areaCodes).then(res => { - res.data.list.forEach(item => { + res.data.forEach(item => { configs.data.push( [item.street_name, item.dayOrderCount, item.dayOrderAmount, item.monthOrderCount, item.monthOrderAmount] ) diff --git a/src/components/index/bottomRight.vue b/src/components/index/bottomRight.vue index 25ecfe8..1b95b8d 100644 --- a/src/components/index/bottomRight.vue +++ b/src/components/index/bottomRight.vue @@ -14,19 +14,13 @@ const props = defineProps({ }) getTodayOrderAmountApi(props.areaCodes).then(res => { - - - let list = res.data.geoStreetList - list.forEach(item => { + res.data.forEach(item => { configs2.data.push([ item.street_name, item.today_order_amount, item.yesterday_order_amount ]) }) - - - }) const configs2 = reactive( diff --git a/src/components/index/topCenter.vue b/src/components/index/topCenter.vue index b8baf70..a5a6aeb 100644 --- a/src/components/index/topCenter.vue +++ b/src/components/index/topCenter.vue @@ -13,27 +13,26 @@
NUMBER OF COMMODITIES
{{ - data?.totalProductCounInfo.todayProductCount }} + data.totalProductCounInfo.todayProductCount }} 件
-
-
+
+
  - 昨日数据: {{ data?.totalProductCounInfo.yestertodayProductCount }} + 总数据: {{ data.totalProductCounInfo.yestertodayProductCount }}
-
+
  - 周环比: {{ percent(data?.totalProductCounInfo.weeklyProductTotalGrowthRate) }} + 周环比: {{ data.totalProductCounInfo.weeklyProductTotalGrowthRate }}%
-
- +
@@ -44,18 +43,18 @@
{{ - data?.newProductCountInfo?.todayNewProductCount }} + data.newProductCountInfo.todayNewProductCount }} 件
-
-
+
+
  - 昨日数据: {{ data?.newProductCountInfo?.yestertodayNewProductCount }} + 昨日数据: {{ data.newProductCountInfo.yestertodayNewProductCount }}
-
+
  - 周环比: {{ percent(data?.newProductCountInfo?.weeklyNewProductTotalGrowthRate) }} + 周环比: {{ data.newProductCountInfo.weeklyNewProductTotalGrowthRate }}%
@@ -63,7 +62,7 @@
- +
@@ -72,19 +71,24 @@
累 计 店 铺 总 数
ACCUMULATED NUMBERS OF SHOPS
-
{{ - data?.merchantCountInfo?.todayMerchantCount }} - 个
-
-
+
+ + {{ data.merchantCountInfo.todayMerchantCount }} + + + + 间
+
+
  - 昨日数据: {{ data?.merchantCountInfo?.yestertodayMerchantCount }} + 总数据: + {{ data.merchantCountInfo.yestertodayMerchantCount }}
-
+
  - 周环比: {{ percent(data?.merchantCountInfo?.weeklyMerchantGrowthRate) }} + 周环比: {{ data.merchantCountInfo.weeklyMerchantGrowthRate }}%
@@ -92,13 +96,14 @@
- +
-
昨日数据:{{ viewData.yesterday }}
-
当前浏览量: - 人正在浏览 + +
+ 实时收款金额: +
-
周环比:{{ percent(viewData.lastWeekRate) }}
+
@@ -106,69 +111,80 @@ \ No newline at end of file diff --git a/src/components/index/topLeft.vue b/src/components/index/topLeft.vue index 2f1a5ba..0a5b7df 100644 --- a/src/components/index/topLeft.vue +++ b/src/components/index/topLeft.vue @@ -12,8 +12,7 @@
-
+
{{ index + 1 }}
@@ -22,7 +21,9 @@