From a74822a0c664d1ebcf994b2d2ba1da088dc725c0 Mon Sep 17 00:00:00 2001 From: xuan Date: Mon, 14 Nov 2022 18:17:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E8=B4=AD=E7=89=A9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2):=20=E5=BD=93=E8=B4=AD=E7=89=A9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A9=BA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/constant.ts | 4 ++-- src/common/util.ts | 3 ++- src/pages/shopping/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/constant.ts b/src/common/constant.ts index 7dedbec..bd290ea 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,4 +1,4 @@ -export const BASE_URL = CURRENT_BASE_URL +// export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` @@ -15,7 +15,7 @@ export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 // export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰 // export const BASE_URL = `http://192.168.1.95:40001/lymarket` // 华 -// export const BASE_URL = 'http://192.168.1.22:50002/lymarket' // 婷 +export const BASE_URL = 'http://192.168.1.28:50002/lymarket' // 婷 // CDN // 生成密钥 diff --git a/src/common/util.ts b/src/common/util.ts index 09195f6..4d5ae00 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -99,7 +99,8 @@ interface DataLoadingStatus { status: boolean } //获取数据加载状态 //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据 -export const dataLoadingStatus = ({ list = [], total = 0, status = true }: DataLoadingStatus) => { +export const dataLoadingStatus = ({ list = [], total = 0, status = false }: DataLoadingStatus) => { + console.log('list & status',list, status); // 类型校验 if (Object.prototype.toString.call(list) !== '[object Array]') { list = [] diff --git a/src/pages/shopping/index.tsx b/src/pages/shopping/index.tsx index b501dac..94a115d 100644 --- a/src/pages/shopping/index.tsx +++ b/src/pages/shopping/index.tsx @@ -93,7 +93,7 @@ const ShoppingCartContainer: FC = () => { const status = dataLoadingStatus({ list: shoppingCartData.list, total: shoppingCartData.total, - status: state.loading || true, + status: state.loading!, }) console.log('status==>', status) return status @@ -124,7 +124,7 @@ const ShoppingCartContainer: FC = () => { useEffect(() => { if (state.success) { // startTransition(() => { - setShoppingCartData({ list: state.data, total: state.data.length }) + setShoppingCartData({ list: state.data.list, total: state.data.total }) // }) } }, [state])