From 3282e95db0207ee133d1e98d9771dec9d83b0fc4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 02 四月 2026 16:24:38 +0800
Subject: [PATCH] 2026.4.2 新增专题管理功能
---
pages/home/supervision-proxy.js | 55 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/pages/home/supervision-proxy.js b/pages/home/supervision-proxy.js
index ba39bdc..24823c8 100644
--- a/pages/home/supervision-proxy.js
+++ b/pages/home/supervision-proxy.js
@@ -13,6 +13,8 @@
riskRes: [],
creditPeriod: '',
creditRes: [],
+ // 鍙栨秷缃戠粶璇锋眰鏍囧織
+ cancelFetch: [],
},
lifetimes: {
attached: function () {},
@@ -22,33 +24,53 @@
* 绾夸笂鐩戠缁熻淇℃伅
*/
fetchSupervision(page) {
+ const { provinceName, cityName, districtName, townName, sceneTypeValue } = this.data;
+ const params = { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue };
+ this._fetchSupervision(page, params);
+ },
+
+ _fetchSupervision(page, params) {
+ // 鍙栨秷姝e湪杩涜涓殑涓婁竴娆¤姹�
+ let { cancelFetch } = this.data;
+ if (cancelFetch.length > 0) {
+ cancelFetch[0] = true;
+ cancelFetch = [];
+ }
+ let abort = false;
+ cancelFetch.push(abort);
+ this.setData({ cancelFetch });
this.setData({ supervisionLoading: true });
// 浼佷笟鏁伴噺
- const { provinceName, cityName, districtName, townName, sceneTypeValue } = this.data;
const f1 = fetchEnterpriseCount({
- data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue },
+ data: params,
}).then(res => {
- this.setData({
- enterpriseCountRes: res.data,
- });
+ if (!abort) {
+ this.setData({
+ enterpriseCountRes: res.data,
+ });
+ }
});
// 缁煎悎椋庨櫓
const f2 = fetchRiskCount({
- data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue },
+ data: params,
}).then(res => {
- this.setData({
- riskPeriod: res.data.period,
- riskRes: res.data.count,
- });
+ if (!abort) {
+ this.setData({
+ riskPeriod: res.data.period,
+ riskRes: res.data.count,
+ });
+ }
});
// 鐜俊鐮�
const f3 = fetchCreditCodeCount({
- data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue },
+ data: params,
}).then(res => {
- this.setData({
- creditPeriod: res.data.period,
- creditRes: res.data.count,
- });
+ if (!abort) {
+ this.setData({
+ creditPeriod: res.data.period,
+ creditRes: res.data.count,
+ });
+ }
});
Promise.all([f1, f2, f3]).finally(() => {
@@ -87,7 +109,8 @@
},
_navParams() {
- const { provinceName, cityName, districtName, townName, sceneTypeValue, locationValue } = this.data;
+ const { provinceName, cityName, districtName, townName, sceneTypeValue, locationValue } =
+ this.data;
let url = `?sceneType=${sceneTypeValue[0]}`;
if (provinceName) url += `&province=${provinceName}`;
if (cityName) url += `&city=${cityName}`;
--
Gitblit v1.9.3