From b5b33a27ea93cef4228b606ae0eb64a5c440738c Mon Sep 17 00:00:00 2001 From: xuan Date: Fri, 3 Mar 2023 18:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(ID1001438):=20=E3=80=90?= =?UTF-8?q?=E9=9D=A2=E6=96=99=E4=BC=98=E9=80=89=E3=80=91=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E8=89=B2=E5=8D=A1=E5=89=AA=E6=A0=B7=E6=97=B6=EF=BC=8C=E8=8B=A5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B2=A1=E6=9C=89=E7=99=BB=E9=99=86=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A2=86=E8=89=B2=E5=8D=A1=E5=92=8C=E9=A2=86=E5=89=AA=E6=A0=B7?= =?UTF-8?q?=E6=97=B6=E5=BC=B9=E5=87=BA=E9=9C=80=E8=A6=81=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【【面料优选】领取色卡剪样时,若用户没有登陆,在商品详情点击领色卡和领剪样时弹出需要授权手机号】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001438 --- src/pages/colorCardOrder/index.tsx | 4 ++-- src/pages/details/index.tsx | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/colorCardOrder/index.tsx b/src/pages/colorCardOrder/index.tsx index d5ed7f2..9d07d86 100644 --- a/src/pages/colorCardOrder/index.tsx +++ b/src/pages/colorCardOrder/index.tsx @@ -127,7 +127,7 @@ export default () => { const { fetchData: addressListFetchData, state } = addressListApi() const getAddressDefault = async() => { const res = await addressListFetchData() - let defaultInfo: AddressItem|null = null + let defaultInfo: AddressItem = {} as AddressItem res?.data.list?.map((item) => { if (item.is_default) { defaultInfo = { @@ -138,7 +138,7 @@ export default () => { } } }) - submitData.current.address_id = defaultInfo!.id + submitData.current.address_id = defaultInfo?.id setAddressInfo(defaultInfo!) } diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 1f857bb..141628f 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -46,6 +46,7 @@ interface CurrentDialogDetail { last_bulk_price: number } const Details = (props: Params) => { + // const userInfo = useSelector(state => state.userInfo) const { getPhoneNumber, userInfo } = useLogin() // 获取参数(有两种参数:1.商品id, 2.页面分享) @@ -238,6 +239,9 @@ const Details = (props: Params) => { const { fetchData: colorCardFetchData } = GetColorCardOrderByProductApi() const getColorCardData = async() => { + if (!userInfo?.adminUserInfo?.phone) { + return goLink('/pages/login/index') + } const res = await colorCardFetchData({ product_id: productInfo.id }) if (res.data) { res.data.count = 1 @@ -250,6 +254,9 @@ const Details = (props: Params) => { const [showColorSelect, setShowColorSelect] = useState(false) const openColorSelect = () => { + if (!userInfo?.adminUserInfo?.phone) { + return goLink('/pages/login/index') + } setShowColorSelect(true) }