From 232d372796a0e52560fff1297747cfe5609461e9 Mon Sep 17 00:00:00 2001
From: Haiyi <1021441632@qq.com>
Date: Thu, 29 Sep 2022 15:22:39 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=E4=BF=AE=E6=94=B9=E7=A1=AE?=
=?UTF-8?q?=E8=AE=A4=E8=AE=A2=E5=8D=95=E9=80=89=E6=8B=A9=E5=90=8E=E6=97=A0?=
=?UTF-8?q?=E6=B3=95=E6=B8=B2=E6=9F=93=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?=
=?UTF-8?q?=E9=A1=B6input=E6=A1=86=E7=9A=84=E9=AB=98=E5=BA=A6=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/BottomBtns/index.tsx | 12 ++++--
src/components/goodsItem/index.tsx | 6 +--
src/components/search/index.tsx | 7 +++-
src/components/shoppingCart/index.module.scss | 2 +-
src/components/shoppingCart/index.tsx | 2 +-
src/custom-tab-bar/index.tsx | 1 -
src/pages/index/index.tsx | 10 +++--
src/pages/order/index.tsx | 2 +-
.../components/BottomApply/index.tsx | 42 +++++++++++--------
.../addressDetailBox/index.module.scss | 3 +-
.../components/addressDetailBox/index.tsx | 42 +++++++------------
src/pages/orderDetails/index.tsx | 6 +--
.../components/empty/index.module.scss | 4 +-
src/pages/searchPage/index.tsx | 12 +++---
.../components/colorKindItem/index.tsx | 5 +--
.../components/shoppingCart/index.tsx | 5 +--
.../components/shoppingCartItem/index.tsx | 6 ---
src/pages/submitOrder/index.tsx | 24 +++++------
src/use/useCommon.ts | 14 +++----
19 files changed, 101 insertions(+), 104 deletions(-)
diff --git a/src/components/BottomBtns/index.tsx b/src/components/BottomBtns/index.tsx
index e32b5fa..0842a19 100644
--- a/src/components/BottomBtns/index.tsx
+++ b/src/components/BottomBtns/index.tsx
@@ -60,11 +60,15 @@ export default memo((props: prosObj) => {
const canBuy = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1) ||
- (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1) ||
- (obj.sale_mode === 0 && obj.status === 3 && (obj.payment_method == 3 || obj.payment_method == 5)) ||
- (obj.sale_mode === 0 && obj.status === 8 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
- (obj.sale_mode === 0 && obj.status === 9 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status === 7 && obj.settle_mode == 3) ||
+ (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 0) ||
+ (obj.sale_mode === 2 && obj.status === 2) ||
(obj.sale_mode === 2 && obj.status === 7)
) {
return true
diff --git a/src/components/goodsItem/index.tsx b/src/components/goodsItem/index.tsx
index a6f4731..2204545 100644
--- a/src/components/goodsItem/index.tsx
+++ b/src/components/goodsItem/index.tsx
@@ -33,8 +33,8 @@ export default memo((props: props) => {
const onInputEven = (e) => {
let res = e.detail.value
if (props.modeFont == 0) {
- if (Number(res) < 0) {
- setValue({ count: 1 })
+ if (Number(res) < 1) {
+ setValue({ count: '' })
}
}
if (props.modeFont == 1) {
@@ -80,7 +80,7 @@ export default memo((props: props) => {
- props.onBlur?.(e, props.value.id)}>
+ props.onBlur?.(e, props.value.id)}>
{/* onInputEven($event, props.value)}> */}
diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx
index 7831615..a895882 100644
--- a/src/components/search/index.tsx
+++ b/src/components/search/index.tsx
@@ -23,7 +23,8 @@ type Params = {
customRightSlot?: ReactNode
adjustPosition?: boolean,
showScan?: boolean
- handScan?: () => void
+ handScan?: () => void,
+ cursorSpacing?: Number
}
export default memo(
@@ -45,7 +46,8 @@ export default memo(
children,
customRightSlot,
showScan = false,
- handScan
+ handScan,
+ cursorSpacing = 0
}: Params,
ref,
) => {
@@ -94,6 +96,7 @@ export default memo(
)}
{
{modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}单位:{showModefont}
-
+
{
goodList.length > 0 && <>
diff --git a/src/custom-tab-bar/index.tsx b/src/custom-tab-bar/index.tsx
index 13c2d05..36d491d 100644
--- a/src/custom-tab-bar/index.tsx
+++ b/src/custom-tab-bar/index.tsx
@@ -23,7 +23,6 @@ type TabBarIndexMap = {
}
const CustomTabBar: FC = () => {
- console.log('重新渲染')
const { selectedId, tabItem } = useSelector((state) => {
console.log('sdfasdfa', state)
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index ff5b540..54b323a 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -258,18 +258,19 @@ export default () => {
}
//输入框失焦
const onBlur = (e, id) => {
- goodList.map((item) => {
+ goodList.map(item => {
if (item.id == id) {
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
- item.nums = 1
item.showInput = false
- } else {
+ item.nums = 1
+
+ } else if (search.modeId == 0 && (e.detail.value != '' || Number(e.detail.value) > 0)) {
item.nums = e.detail.value
}
if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
item.nums = 0.5
item.showInput = false
- } else {
+ } else if (search.modeId == 1 && Number(e.detail.value) >= 0.5) {
item.nums = e.detail.value
}
if (search.modeId == 2) {
@@ -284,6 +285,7 @@ export default () => {
useEffect(() => {
setGoodlist(goodList)
+ console.log(goodList, 'goodListgoodList')
}, [goodList])
return (
diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx
index 0aa4f1d..d1be8a2 100644
--- a/src/pages/order/index.tsx
+++ b/src/pages/order/index.tsx
@@ -561,7 +561,7 @@ export default () => {
title: '请稍等...',
mask: true
})
- const restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) })
+ const restult = await (obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) }))
if (restult?.msg === 'success') {
Taro.showToast({
title: '交易成功'
diff --git a/src/pages/orderDetails/components/BottomApply/index.tsx b/src/pages/orderDetails/components/BottomApply/index.tsx
index dad7820..1107ba5 100644
--- a/src/pages/orderDetails/components/BottomApply/index.tsx
+++ b/src/pages/orderDetails/components/BottomApply/index.tsx
@@ -7,7 +7,8 @@ interface prosObj {
sale_mode?: Number,
collect_status?: Number | string,
status?: Number,
- payment_method?: Number
+ payment_method?: Number,
+ settle_mode?: Number | string,
}
handApplyGoods?: () => void,
handApplyMoney?: () => void,
@@ -21,18 +22,21 @@ export default memo((props: prosObj) => {
collect_status: '',
status: '',
payment_method: 0,
+ settle_mode: ''
},
handApplyGoods,
handApplyMoney,
handSureGoods
} = props
- //判断显示申请收货
+ //判断显示申请退货
const showTuihuo = useMemo(() => {
if (
- (obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 2) ||
- (obj.sale_mode === 0 && obj.status === 9 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status === 1)) ||
- (obj.sale_mode === 2 && obj.status === 9)
+ (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2) ||
+ (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3) ||
+ (obj.sale_mode === 2 && obj.status == 9)
) {
return true
} else return false
@@ -40,14 +44,16 @@ export default memo((props: prosObj) => {
//判断显示申请退款
const showTuikuan = useMemo(() => {
if (
- (obj.sale_mode === 0 && obj.status === 11 && (obj.collect_status == 1 || obj.collect_status == 2)) ||
- (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 2) ||
- (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1) ||
- (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 2) ||
- (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1) ||
- (obj.sale_mode === 1 && obj.status === 0) ||
- (obj.sale_mode === 1 && obj.status === 9) ||
- (obj.sale_mode === 2 && obj.status === 0)
+ (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2)) ||
+ (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2) ||
+ (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1) ||
+ (obj.sale_mode === 1 && obj.status == 0) ||
+ (obj.sale_mode === 1 && obj.status == 9) ||
+ (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1) ||
+ (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2)
) {
return true
} else return false
@@ -55,10 +61,12 @@ export default memo((props: prosObj) => {
//判断显示确认收货
const showTake = useMemo(() => {
if (
- (obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 2) ||
- (obj.sale_mode === 0 && obj.status === 8 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
- (obj.sale_mode === 1 && obj.status === 8) ||
- (obj.sale_mode === 2 && obj.status === 8)
+ (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0) ||
+ (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 1) ||
+ (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2) ||
+ (obj.sale_mode === 0 && obj.status == 8 && obj.settle_mode == 3) ||
+ (obj.sale_mode === 1 && obj.status == 8) ||
+ (obj.sale_mode === 2 && obj.status == 8)
) {
return true
} else return false
diff --git a/src/pages/orderDetails/components/addressDetailBox/index.module.scss b/src/pages/orderDetails/components/addressDetailBox/index.module.scss
index 1470373..bb27f29 100644
--- a/src/pages/orderDetails/components/addressDetailBox/index.module.scss
+++ b/src/pages/orderDetails/components/addressDetailBox/index.module.scss
@@ -42,7 +42,6 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /*这里设置几行*/
overflow: hidden;
-
}
.icon_more {
@@ -67,6 +66,7 @@
margin-top: 24px;
.name {
+ line-height: 34px;
width: 84px;
height: 34px;
@include common_ellipsis();
@@ -78,6 +78,7 @@
}
.phone {
+ height: 34px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
diff --git a/src/pages/orderDetails/components/addressDetailBox/index.tsx b/src/pages/orderDetails/components/addressDetailBox/index.tsx
index c0f6a43..13c50f2 100644
--- a/src/pages/orderDetails/components/addressDetailBox/index.tsx
+++ b/src/pages/orderDetails/components/addressDetailBox/index.tsx
@@ -3,56 +3,44 @@ import { memo, useEffect, useMemo, useRef, useState } from "react";
import classnames from "classnames";
import styles from './index.module.scss'
import IconFont from '@/components/iconfont/iconfont'
+import { alert } from '@/common/common'
+
interface propsObj {
receivingStatus: Number | null,
onReceivingStatus?: (any, Number) => void,
- obj: any,
+ obj?: any,
navSelect?: (any) => void
}
export default memo((props: propsObj) => {
const {
- receivingStatus = 2,
+ receivingStatus = null,
onReceivingStatus,
obj = {},
navSelect
} = props
- const addressInfo = useMemo(() => {
- if (receivingStatus == 1) {
- return obj.take_goods_address
- } else {
- return obj.province_name + obj.city_name + obj.district_name + obj.address_detail
- }
- }, [obj, receivingStatus])
- // const addressPone = useMemo(() => {
- // if (receivingStatus == 1) {
- // return 13242128982
- // } else {
- // return obj.purchaser_phone
- // }
- // }, [obj,receivingStatus])
-
- // const addressUser = useMemo(() => {
- // if (receivingStatus == 1) {
- // return '谭先生'
- // } else {
- // return obj.target_user_name
- // }
- // }, [obj,receivingStatus])
return (
navSelect?.(obj)}>
- {/* */}
- {addressInfo}
+ {
+ receivingStatus == 1 && {obj.take_goods_address}
+ }
+ {
+ (obj?.province_name != '' && receivingStatus == 2) &&
+ {obj?.province_name}{obj?.city_name}{obj?.district_name}{obj?.address_detail}
+ }
+ {
+ (obj?.province_name == '' && receivingStatus == 2) &&
+ {''}
+ }
{
receivingStatus !== 1 &&
- //
}
diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx
index 89a09e0..08e3e62 100644
--- a/src/pages/orderDetails/index.tsx
+++ b/src/pages/orderDetails/index.tsx
@@ -49,7 +49,7 @@ export default () => {
//切换自提或者物流
const { fetchData: selectFetch } = mpsaleOrdershipmentMode()
const onReceivingStatus = debounce(async (e, value) => {
- if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5) {
+ if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5 || infoObj.status === 3 || infoObj.status === 11) {
alert.error('不允许更改')
return false
}
@@ -486,7 +486,7 @@ export default () => {
title: '请稍等...',
mask: true
})
- let restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) })
+ let restult = await (obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) }))
if (restult?.msg === 'success') {
Taro.showToast({
title: '交易成功'
@@ -515,7 +515,7 @@ export default () => {
const [showOffline, setShowOffine] = useState(false)
//选择地址
const handSelect = (obj) => {
- if (receivingStatus === 1 || (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5)) {
+ if (receivingStatus === 1 || (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5 || infoObj.status === 11 || infoObj.status === 3)) {
alert.error('不允许更改')
return false
}
diff --git a/src/pages/searchPage/components/empty/index.module.scss b/src/pages/searchPage/components/empty/index.module.scss
index d7898be..222acb6 100644
--- a/src/pages/searchPage/components/empty/index.module.scss
+++ b/src/pages/searchPage/components/empty/index.module.scss
@@ -8,8 +8,8 @@
.pic {
width: 322px;
height: 322px;
- background: #D8D8D8;
- opacity: 0.3;
+ background: #fff;
+ // opacity: 0.3;
margin-bottom: 24px;
}
diff --git a/src/pages/searchPage/index.tsx b/src/pages/searchPage/index.tsx
index 94323ee..04ef636 100644
--- a/src/pages/searchPage/index.tsx
+++ b/src/pages/searchPage/index.tsx
@@ -269,18 +269,18 @@ export default memo(() => {
//输入框失焦
const onBlur = (e, id) => {
- goodList.map((item) => {
+ goodList.map(item => {
if (item.id == id) {
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
- item.nums = 1
item.showInput = false
- } else {
+ item.nums = 1
+ } else if (search.modeId == 0 && (e.detail.value != '' || Number(e.detail.value) > 0)) {
item.nums = e.detail.value
}
if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
item.nums = 0.5
item.showInput = false
- } else {
+ } else if (search.modeId == 1 && Number(e.detail.value) >= 0.5) {
item.nums = e.detail.value
}
if (search.modeId == 2) {
@@ -334,7 +334,7 @@ export default memo(() => {
}
{
- !histroyList.length &&
+ !histroyList.length &&
}
>
}
@@ -354,7 +354,7 @@ export default memo(() => {
})
}
{
- !searchList.length &&
+ !searchList.length &&
}
>
}
diff --git a/src/pages/shopping/components/colorKindItem/index.tsx b/src/pages/shopping/components/colorKindItem/index.tsx
index 265f133..123ea47 100644
--- a/src/pages/shopping/components/colorKindItem/index.tsx
+++ b/src/pages/shopping/components/colorKindItem/index.tsx
@@ -21,7 +21,6 @@ type PropsType = {
const ColorKindItem: FC = memo(
(props) => {
const { purchaserId, itemData, orderType = EnumSaleMode.Bulk } = props
- console.log('重新渲染 ColorKindItem', itemData.id, orderType, purchaserId)
const { setChangedCheckbox, colorStore } = useShoppingContext()
// @ts-ignore
const { checked } = useWatch(purchaserId, itemData?.id)
@@ -42,7 +41,7 @@ const ColorKindItem: FC = memo(
}, [])
const handleSelect = () => {
- console.log('handleSelect')
+ // console.log('handleSelect')
setChangedCheckbox({
purchaserId: purchaserId,
goodsKind: { [itemData.id]: { ...colorStore[purchaserId].goodsKind?.[itemData.id]!, checked: true } },
@@ -105,7 +104,7 @@ const ColorKindItem: FC = memo(
(preProp, nextProp) => {
const stringifyPreProp = JSON.stringify(preProp.itemData)
const stringifyNextProp = JSON.stringify(nextProp.itemData)
- console.log('memo==>', preProp, nextProp)
+ // console.log('memo==>', preProp, nextProp)
let needMemoized = true
if (preProp.purchaserId !== nextProp.purchaserId) {
needMemoized = false
diff --git a/src/pages/shopping/components/shoppingCart/index.tsx b/src/pages/shopping/components/shoppingCart/index.tsx
index 987cfd8..4da4844 100644
--- a/src/pages/shopping/components/shoppingCart/index.tsx
+++ b/src/pages/shopping/components/shoppingCart/index.tsx
@@ -18,7 +18,6 @@ export interface ShoppingCartPropsType {
// 购物车上下文组件
export const ShoppingCart: FC = (props) => {
const { children, onTriggerCheckbox, initialValues, ref: refProps } = props
- console.log('重新渲染 ShoppingCart context', refProps)
const defaultShoppingCart = useShoppingCart()
@@ -38,7 +37,7 @@ export const ShoppingCart: FC = (props) => {
const [selectedAmount, setSelectedAmount] = useState(0)
const ctx: ShoppingContextValue = useMemo(() => {
- console.log('useMemo ShoppingContextValue')
+ // console.log('useMemo ShoppingContextValue')
return {
isManageStatus,
setManageStatus,
@@ -48,7 +47,7 @@ export const ShoppingCart: FC = (props) => {
setCurrentCheckedSaleMode,
colorStore,
setChangedCheckbox(changedGoods) {
- console.log('changedGoods==>', colorStore, changedGoods)
+ // console.log('changedGoods==>', colorStore, changedGoods)
setColorStore((prev) => {
const currentGoodsKind = { ...prev[changedGoods.purchaserId]?.goodsKind, ...changedGoods.goodsKind }
return {
diff --git a/src/pages/shopping/components/shoppingCartItem/index.tsx b/src/pages/shopping/components/shoppingCartItem/index.tsx
index 1abd600..d72df41 100644
--- a/src/pages/shopping/components/shoppingCartItem/index.tsx
+++ b/src/pages/shopping/components/shoppingCartItem/index.tsx
@@ -35,12 +35,10 @@ enum BackEndSaleModeListFieldMap {
}
export default memo(props => {
- console.log('props==>', props)
const { itemData } = props
const { setCurrentCheckedSaleMode } = useShoppingContext()
- console.log('重新渲染 shoppingCartItem')
const [openDetail, setOpenDetail] = useState(false)
const handleOpenDetail = () => {
@@ -109,14 +107,12 @@ export default memo(props => {
if (currentCheckedPurchaserId === itemData?.purchaser_id) {
return
}
- console.log('handleClickLayout')
setSelectedAmount(0)
setCurrentCheckedSaleMode(selected)
setCurrentCheckedPurchaserId(itemData?.purchaser_id as number)
}
const handleChecked = () => {
- console.log('handleChecked')
// 初始化选中状态
setChangedCheckbox({
purchaserId: itemData?.purchaser_id!,
@@ -124,7 +120,6 @@ export default memo(props => {
})
}
const handleUnchecked = () => {
- console.log('handleUnchecked')
// 初始化选中状态
setChangedCheckbox({
purchaserId: itemData?.purchaser_id!,
@@ -134,7 +129,6 @@ export default memo(props => {
// 统计已选面料
const materialChecked = useMemo(() => {
const targetGoodsKind = colorStore?.[itemData?.purchaser_id!]?.['goodsKind']
- console.log('targetGoodsKind==>', targetGoodsKind)
if (!targetGoodsKind || isEmptyObject(targetGoodsKind)) return 0
return new Set(
Object.values(targetGoodsKind)?.reduce((prev, item: Goods) => {
diff --git a/src/pages/submitOrder/index.tsx b/src/pages/submitOrder/index.tsx
index c71fe46..6483eee 100644
--- a/src/pages/submitOrder/index.tsx
+++ b/src/pages/submitOrder/index.tsx
@@ -24,23 +24,24 @@ export default () => {
let currPage = pages[pages.length - 1]; // 获取当前页面
setInfoObj((val) => ({
...val,
- province_name: currPage.data?.addressObj?.province_name,
- address_id: currPage.data?.addressObj?.id,
- city_name: currPage.data?.addressObj?.city_name,
- address_detail: currPage.data?.addressObj?.address_detail,
- district_name: currPage.data?.addressObj?.district_name,
- target_user_name: currPage.data?.addressObj?.name,
- purchaser_phone: currPage.data?.addressObj?.phone,
+ province_name: currPage.data?.addressObj?.province_name ? currPage.data?.addressObj?.province_name : '---',
+ address_id: currPage.data?.addressObj?.id ? currPage.data?.addressObj?.id : '',
+ city_name: currPage.data?.addressObj?.city_name ? currPage.data?.addressObj?.city_name : '',
+ address_detail: currPage.data?.addressObj?.address_detail ? currPage.data?.addressObj?.address_detail : '',
+ district_name: currPage.data?.addressObj?.district_name ? currPage.data?.addressObj?.district_name : '',
+ target_user_name: currPage.data?.addressObj?.name ? currPage.data?.addressObj?.name : '',
+ purchaser_phone: currPage.data?.addressObj?.phone ? currPage.data?.addressObj?.phone : '',
}))
+ if (!currPage.data?.addressObj) {
+ setReceivingStatus(1)
+ } else {
+ setReceivingStatus(2)
+ }
})
useEffect(() => {
getDetail()
}, [])
- useEffect(() => {
- setInfoObj(infoObj)
- console.log(infoObj, 66666)
- }, [infoObj])
//收货方法,1:自提,2物流
const [receivingStatus, setReceivingStatus] = useState(null)
@@ -78,7 +79,6 @@ export default () => {
}
const res = await infoFetch(query)
setInfoObj(res.data)
- setReceivingStatus(1)
}
//备注操作
diff --git a/src/use/useCommon.ts b/src/use/useCommon.ts
index 2ed74e1..273ee13 100644
--- a/src/use/useCommon.ts
+++ b/src/use/useCommon.ts
@@ -13,7 +13,7 @@ export const useTimeCountDown = () => {
const timeObj: any = useRef()
const endTime = useRef('')
const onStart = (val = '') => {
- console.log('time:::', val)
+ // console.log('time:::', val)
endTime.current = val
if (endTime.current) {
clearInterval(timeObj.current)
@@ -50,7 +50,7 @@ export const useTimeCountDown = () => {
var HH = ('00' + hh).slice(-2)
var MM = ('00' + mm).slice(-2)
var SS = ('00' + ss).slice(-2)
- console.log('endTime::', `${DD}-${HH}-${MM}-${SS}`)
+ // console.log('endTime::', `${DD}-${HH}-${MM}-${SS}`)
setShowTime((e) => ({ ...e, DD, HH, MM, SS }))
}
return {
@@ -103,8 +103,8 @@ const defaultOptions = {
*/
export const useNeedMemoCallback = (options: Options = defaultOptions) => {
return (prevProps: NormalPropsType, nextProps: NormalPropsType) => {
- console.log(options)
- console.log('memo==>', prevProps, nextProps)
+ // console.log(options)
+ // console.log('memo==>', prevProps, nextProps)
let needMemoized = true
// 引用类型
// function array object
@@ -115,8 +115,8 @@ export const useNeedMemoCallback = (options: Options = defaultOptions) => {
const handleDiff = () => {
for (let [key, value] of Object.entries(prevProps)){
if (!Object.is(value, nextProps[key])) {
- console.log('函数不相等',value === nextProps[key])
- console.log('asdfasdf',value)
+ // console.log('函数不相等',value === nextProps[key])
+ // console.log('asdfasdf',value)
needMemoized = false
break
}
@@ -165,4 +165,4 @@ const bool = needMemo(
hobby: hobby,
},
)
-console.log('bool==>', bool)
+// console.log('bool==>', bool)