feat:修改确认订单选择后无法渲染的问题,顶input框的高度问题

This commit is contained in:
Haiyi 2022-09-29 15:22:39 +08:00
parent 6b59d688db
commit 232d372796
19 changed files with 101 additions and 104 deletions

View File

@ -60,11 +60,15 @@ export default memo((props: prosObj) => {
const canBuy = useMemo(() => { const canBuy = useMemo(() => {
if ( if (
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1) || (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.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) (obj.sale_mode === 2 && obj.status === 7)
) { ) {
return true return true

View File

@ -33,8 +33,8 @@ export default memo((props: props) => {
const onInputEven = (e) => { const onInputEven = (e) => {
let res = e.detail.value let res = e.detail.value
if (props.modeFont == 0) { if (props.modeFont == 0) {
if (Number(res) < 0) { if (Number(res) < 1) {
setValue({ count: 1 }) setValue({ count: '' })
} }
} }
if (props.modeFont == 1) { if (props.modeFont == 1) {
@ -80,7 +80,7 @@ export default memo((props: props) => {
</View> </View>
</View> </View>
<View className={styles.numsBox}> <View className={styles.numsBox}>
<Input type={type as any} value={value.count} onInput={onInputEven} onBlur={(e) => props.onBlur?.(e, props.value.id)}></Input> <Input cursorSpacing={100} adjustPosition type={type as any} value={value.count} onInput={onInputEven} onBlur={(e) => props.onBlur?.(e, props.value.id)}></Input>
{/* <Input type={type as any} value={value.count} onInput={($event) => onInputEven($event, props.value)}></Input> */} {/* <Input type={type as any} value={value.count} onInput={($event) => onInputEven($event, props.value)}></Input> */}
</View> </View>

View File

@ -23,7 +23,8 @@ type Params = {
customRightSlot?: ReactNode customRightSlot?: ReactNode
adjustPosition?: boolean, adjustPosition?: boolean,
showScan?: boolean showScan?: boolean
handScan?: () => void handScan?: () => void,
cursorSpacing?: Number
} }
export default memo( export default memo(
@ -45,7 +46,8 @@ export default memo(
children, children,
customRightSlot, customRightSlot,
showScan = false, showScan = false,
handScan handScan,
cursorSpacing = 0
}: Params, }: Params,
ref, ref,
) => { ) => {
@ -94,6 +96,7 @@ export default memo(
)} )}
<View className={styles.input_bar}> <View className={styles.input_bar}>
<Input <Input
cursorSpacing={cursorSpacing as any}
adjustPosition={adjustPosition} adjustPosition={adjustPosition}
placeholderStyle='color:#ABABAB; font-size:26rpx' placeholderStyle='color:#ABABAB; font-size:26rpx'
onConfirm={onSearch} onConfirm={onSearch}

View File

@ -108,7 +108,7 @@
.scrollviewBig { .scrollviewBig {
.scrollview { .scrollview {
height: 300px; // height: 300px;
.kongBox { .kongBox {
height: 181px; height: 181px;

View File

@ -141,7 +141,7 @@ export default memo(forwardRef((props: prosObj, ref) => {
<View className={styles.danwei}>{modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}{showModefont}</View> <View className={styles.danwei}>{modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}{showModefont}</View>
</View> </View>
<View className={styles.searchBox}> <View className={styles.searchBox}>
<Search placeholder='请输入搜索布料' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} adjustPosition={true} /> <Search cursorSpacing={100} placeholder='请输入搜索布料' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} adjustPosition={true} />
</View> </View>
{ {
goodList.length > 0 && <> goodList.length > 0 && <>

View File

@ -23,7 +23,6 @@ type TabBarIndexMap = {
} }
const CustomTabBar: FC = () => { const CustomTabBar: FC = () => {
console.log('重新渲染')
const { selectedId, tabItem } = useSelector((state) => { const { selectedId, tabItem } = useSelector((state) => {
console.log('sdfasdfa', state) console.log('sdfasdfa', state)

View File

@ -258,18 +258,19 @@ export default () => {
} }
//输入框失焦 //输入框失焦
const onBlur = (e, id) => { const onBlur = (e, id) => {
goodList.map((item) => { goodList.map(item => {
if (item.id == id) { if (item.id == id) {
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) { if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
item.nums = 1
item.showInput = false 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 item.nums = e.detail.value
} }
if (search.modeId == 1 && Number(e.detail.value) < 0.5) { if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
item.nums = 0.5 item.nums = 0.5
item.showInput = false item.showInput = false
} else { } else if (search.modeId == 1 && Number(e.detail.value) >= 0.5) {
item.nums = e.detail.value item.nums = e.detail.value
} }
if (search.modeId == 2) { if (search.modeId == 2) {
@ -284,6 +285,7 @@ export default () => {
useEffect(() => { useEffect(() => {
setGoodlist(goodList) setGoodlist(goodList)
console.log(goodList, 'goodListgoodList')
}, [goodList]) }, [goodList])
return ( return (

View File

@ -561,7 +561,7 @@ export default () => {
title: '请稍等...', title: '请稍等...',
mask: true 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') { if (restult?.msg === 'success') {
Taro.showToast({ Taro.showToast({
title: '交易成功' title: '交易成功'

View File

@ -7,7 +7,8 @@ interface prosObj {
sale_mode?: Number, sale_mode?: Number,
collect_status?: Number | string, collect_status?: Number | string,
status?: Number, status?: Number,
payment_method?: Number payment_method?: Number,
settle_mode?: Number | string,
} }
handApplyGoods?: () => void, handApplyGoods?: () => void,
handApplyMoney?: () => void, handApplyMoney?: () => void,
@ -21,18 +22,21 @@ export default memo((props: prosObj) => {
collect_status: '', collect_status: '',
status: '', status: '',
payment_method: 0, payment_method: 0,
settle_mode: ''
}, },
handApplyGoods, handApplyGoods,
handApplyMoney, handApplyMoney,
handSureGoods handSureGoods
} = props } = props
//判断显示申请 //判断显示申请退
const showTuihuo = useMemo(() => { const showTuihuo = useMemo(() => {
if ( if (
(obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 2) || (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0) ||
(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 == 9 && obj.collect_status == 1) ||
(obj.sale_mode === 2 && obj.status === 9) (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 return true
} else return false } else return false
@ -40,14 +44,16 @@ export default memo((props: prosObj) => {
//判断显示申请退款 //判断显示申请退款
const showTuikuan = useMemo(() => { const showTuikuan = useMemo(() => {
if ( if (
(obj.sale_mode === 0 && obj.status === 11 && (obj.collect_status == 1 || obj.collect_status == 2)) || (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1) ||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 2) || (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1) || (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 == 2) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2) ||
(obj.sale_mode === 1 && obj.status === 0) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1) ||
(obj.sale_mode === 1 && obj.status === 9) || (obj.sale_mode === 1 && obj.status == 0) ||
(obj.sale_mode === 2 && 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 return true
} else return false } else return false
@ -55,10 +61,12 @@ export default memo((props: prosObj) => {
//判断显示确认收货 //判断显示确认收货
const showTake = useMemo(() => { const showTake = useMemo(() => {
if ( if (
(obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 2) || (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0) ||
(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 == 8 && obj.collect_status == 1) ||
(obj.sale_mode === 1 && obj.status === 8) || (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2) ||
(obj.sale_mode === 2 && obj.status === 8) (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 return true
} else return false } else return false

View File

@ -42,7 +42,6 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; /*这里设置几行*/ -webkit-line-clamp: 2; /*这里设置几行*/
overflow: hidden; overflow: hidden;
} }
.icon_more { .icon_more {
@ -67,6 +66,7 @@
margin-top: 24px; margin-top: 24px;
.name { .name {
line-height: 34px;
width: 84px; width: 84px;
height: 34px; height: 34px;
@include common_ellipsis(); @include common_ellipsis();
@ -78,6 +78,7 @@
} }
.phone { .phone {
height: 34px;
font-size: 28px; font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;

View File

@ -3,56 +3,44 @@ import { memo, useEffect, useMemo, useRef, useState } from "react";
import classnames from "classnames"; import classnames from "classnames";
import styles from './index.module.scss' import styles from './index.module.scss'
import IconFont from '@/components/iconfont/iconfont' import IconFont from '@/components/iconfont/iconfont'
import { alert } from '@/common/common'
interface propsObj { interface propsObj {
receivingStatus: Number | null, receivingStatus: Number | null,
onReceivingStatus?: (any, Number) => void, onReceivingStatus?: (any, Number) => void,
obj: any, obj?: any,
navSelect?: (any) => void navSelect?: (any) => void
} }
export default memo((props: propsObj) => { export default memo((props: propsObj) => {
const { const {
receivingStatus = 2, receivingStatus = null,
onReceivingStatus, onReceivingStatus,
obj = {}, obj = {},
navSelect navSelect
} = props } = 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 ( return (
<View className={styles.addressBox}> <View className={styles.addressBox}>
<View className={styles.topBox} onClick={() => navSelect?.(obj)}> <View className={styles.topBox} onClick={() => navSelect?.(obj)}>
<View className={styles.cirle}> <View className={styles.cirle}>
<IconFont name={'icon-dingwei'} size={26} color={'#ffffff'}></IconFont> <IconFont name={'icon-dingwei'} size={26} color={'#ffffff'}></IconFont>
{/* <View className={classnames('iconfont', 'icon-dingwei', styles.dingwei)}></View> */}
</View> </View>
<View className={styles.address}>{addressInfo}</View> {
receivingStatus == 1 && <View className={styles.address}>{obj.take_goods_address}</View>
}
{
(obj?.province_name != '' && receivingStatus == 2) &&
<View className={styles.address}>{obj?.province_name}{obj?.city_name}{obj?.district_name}{obj?.address_detail}</View>
}
{
(obj?.province_name == '' && receivingStatus == 2) &&
<View className={styles.address}>{''}</View>
}
{ {
receivingStatus !== 1 && receivingStatus !== 1 &&
<IconFont name={'icon-chakanquanbukehu'} size={50} ></IconFont> <IconFont name={'icon-chakanquanbukehu'} size={50} ></IconFont>
// <View className={classnames('iconfont', 'icon-chakanquanbukehu', styles.icon_more)}></View>
} }
</View> </View>
<View className={styles.line}></View> <View className={styles.line}></View>

View File

@ -49,7 +49,7 @@ export default () => {
//切换自提或者物流 //切换自提或者物流
const { fetchData: selectFetch } = mpsaleOrdershipmentMode() const { fetchData: selectFetch } = mpsaleOrdershipmentMode()
const onReceivingStatus = debounce(async (e, value) => { 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('不允许更改') alert.error('不允许更改')
return false return false
} }
@ -486,7 +486,7 @@ export default () => {
title: '请稍等...', title: '请稍等...',
mask: true 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') { if (restult?.msg === 'success') {
Taro.showToast({ Taro.showToast({
title: '交易成功' title: '交易成功'
@ -515,7 +515,7 @@ export default () => {
const [showOffline, setShowOffine] = useState(false) const [showOffline, setShowOffine] = useState(false)
//选择地址 //选择地址
const handSelect = (obj) => { 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('不允许更改') alert.error('不允许更改')
return false return false
} }

View File

@ -8,8 +8,8 @@
.pic { .pic {
width: 322px; width: 322px;
height: 322px; height: 322px;
background: #D8D8D8; background: #fff;
opacity: 0.3; // opacity: 0.3;
margin-bottom: 24px; margin-bottom: 24px;
} }

View File

@ -269,18 +269,18 @@ export default memo(() => {
//输入框失焦 //输入框失焦
const onBlur = (e, id) => { const onBlur = (e, id) => {
goodList.map((item) => { goodList.map(item => {
if (item.id == id) { if (item.id == id) {
if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) { if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) {
item.nums = 1
item.showInput = false 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 item.nums = e.detail.value
} }
if (search.modeId == 1 && Number(e.detail.value) < 0.5) { if (search.modeId == 1 && Number(e.detail.value) < 0.5) {
item.nums = 0.5 item.nums = 0.5
item.showInput = false item.showInput = false
} else { } else if (search.modeId == 1 && Number(e.detail.value) >= 0.5) {
item.nums = e.detail.value item.nums = e.detail.value
} }
if (search.modeId == 2) { if (search.modeId == 2) {
@ -334,7 +334,7 @@ export default memo(() => {
</View> </View>
} }
{ {
!histroyList.length && <Empty picUrl='' fonst={'无搜索历史'}></Empty> !histroyList.length && <Empty picUrl='https://cdn.zzfzyc.com/empty.png' fonst={'无搜索历史'}></Empty>
} }
</> </>
} }
@ -354,7 +354,7 @@ export default memo(() => {
}) })
} }
{ {
!searchList.length && <Empty picUrl='' fonst={'暂无数据'}></Empty> !searchList.length && <Empty picUrl='https://cdn.zzfzyc.com/empty.png' fonst={'暂无数据'}></Empty>
} }
</> </>
} }

View File

@ -21,7 +21,6 @@ type PropsType = {
const ColorKindItem: FC<PropsType> = memo( const ColorKindItem: FC<PropsType> = memo(
(props) => { (props) => {
const { purchaserId, itemData, orderType = EnumSaleMode.Bulk } = props const { purchaserId, itemData, orderType = EnumSaleMode.Bulk } = props
console.log('重新渲染 ColorKindItem', itemData.id, orderType, purchaserId)
const { setChangedCheckbox, colorStore } = useShoppingContext() const { setChangedCheckbox, colorStore } = useShoppingContext()
// @ts-ignore // @ts-ignore
const { checked } = useWatch(purchaserId, itemData?.id) const { checked } = useWatch(purchaserId, itemData?.id)
@ -42,7 +41,7 @@ const ColorKindItem: FC<PropsType> = memo(
}, []) }, [])
const handleSelect = () => { const handleSelect = () => {
console.log('handleSelect') // console.log('handleSelect')
setChangedCheckbox({ setChangedCheckbox({
purchaserId: purchaserId, purchaserId: purchaserId,
goodsKind: { [itemData.id]: { ...colorStore[purchaserId].goodsKind?.[itemData.id]!, checked: true } }, goodsKind: { [itemData.id]: { ...colorStore[purchaserId].goodsKind?.[itemData.id]!, checked: true } },
@ -105,7 +104,7 @@ const ColorKindItem: FC<PropsType> = memo(
(preProp, nextProp) => { (preProp, nextProp) => {
const stringifyPreProp = JSON.stringify(preProp.itemData) const stringifyPreProp = JSON.stringify(preProp.itemData)
const stringifyNextProp = JSON.stringify(nextProp.itemData) const stringifyNextProp = JSON.stringify(nextProp.itemData)
console.log('memo==>', preProp, nextProp) // console.log('memo==>', preProp, nextProp)
let needMemoized = true let needMemoized = true
if (preProp.purchaserId !== nextProp.purchaserId) { if (preProp.purchaserId !== nextProp.purchaserId) {
needMemoized = false needMemoized = false

View File

@ -18,7 +18,6 @@ export interface ShoppingCartPropsType {
// 购物车上下文组件 // 购物车上下文组件
export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => { export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
const { children, onTriggerCheckbox, initialValues, ref: refProps } = props const { children, onTriggerCheckbox, initialValues, ref: refProps } = props
console.log('重新渲染 ShoppingCart context', refProps)
const defaultShoppingCart = useShoppingCart() const defaultShoppingCart = useShoppingCart()
@ -38,7 +37,7 @@ export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
const [selectedAmount, setSelectedAmount] = useState(0) const [selectedAmount, setSelectedAmount] = useState(0)
const ctx: ShoppingContextValue = useMemo(() => { const ctx: ShoppingContextValue = useMemo(() => {
console.log('useMemo ShoppingContextValue') // console.log('useMemo ShoppingContextValue')
return { return {
isManageStatus, isManageStatus,
setManageStatus, setManageStatus,
@ -48,7 +47,7 @@ export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
setCurrentCheckedSaleMode, setCurrentCheckedSaleMode,
colorStore, colorStore,
setChangedCheckbox(changedGoods) { setChangedCheckbox(changedGoods) {
console.log('changedGoods==>', colorStore, changedGoods) // console.log('changedGoods==>', colorStore, changedGoods)
setColorStore((prev) => { setColorStore((prev) => {
const currentGoodsKind = { ...prev[changedGoods.purchaserId]?.goodsKind, ...changedGoods.goodsKind } const currentGoodsKind = { ...prev[changedGoods.purchaserId]?.goodsKind, ...changedGoods.goodsKind }
return { return {

View File

@ -35,12 +35,10 @@ enum BackEndSaleModeListFieldMap {
} }
export default memo<PropsType>(props => { export default memo<PropsType>(props => {
console.log('props==>', props)
const { itemData } = props const { itemData } = props
const { setCurrentCheckedSaleMode } = useShoppingContext() const { setCurrentCheckedSaleMode } = useShoppingContext()
console.log('重新渲染 shoppingCartItem')
const [openDetail, setOpenDetail] = useState(false) const [openDetail, setOpenDetail] = useState(false)
const handleOpenDetail = () => { const handleOpenDetail = () => {
@ -109,14 +107,12 @@ export default memo<PropsType>(props => {
if (currentCheckedPurchaserId === itemData?.purchaser_id) { if (currentCheckedPurchaserId === itemData?.purchaser_id) {
return return
} }
console.log('handleClickLayout')
setSelectedAmount(0) setSelectedAmount(0)
setCurrentCheckedSaleMode(selected) setCurrentCheckedSaleMode(selected)
setCurrentCheckedPurchaserId(itemData?.purchaser_id as number) setCurrentCheckedPurchaserId(itemData?.purchaser_id as number)
} }
const handleChecked = () => { const handleChecked = () => {
console.log('handleChecked')
// 初始化选中状态 // 初始化选中状态
setChangedCheckbox({ setChangedCheckbox({
purchaserId: itemData?.purchaser_id!, purchaserId: itemData?.purchaser_id!,
@ -124,7 +120,6 @@ export default memo<PropsType>(props => {
}) })
} }
const handleUnchecked = () => { const handleUnchecked = () => {
console.log('handleUnchecked')
// 初始化选中状态 // 初始化选中状态
setChangedCheckbox({ setChangedCheckbox({
purchaserId: itemData?.purchaser_id!, purchaserId: itemData?.purchaser_id!,
@ -134,7 +129,6 @@ export default memo<PropsType>(props => {
// 统计已选面料 // 统计已选面料
const materialChecked = useMemo(() => { const materialChecked = useMemo(() => {
const targetGoodsKind = colorStore?.[itemData?.purchaser_id!]?.['goodsKind'] const targetGoodsKind = colorStore?.[itemData?.purchaser_id!]?.['goodsKind']
console.log('targetGoodsKind==>', targetGoodsKind)
if (!targetGoodsKind || isEmptyObject(targetGoodsKind)) return 0 if (!targetGoodsKind || isEmptyObject(targetGoodsKind)) return 0
return new Set( return new Set(
Object.values(targetGoodsKind)?.reduce((prev, item: Goods) => { Object.values(targetGoodsKind)?.reduce((prev, item: Goods) => {

View File

@ -24,23 +24,24 @@ export default () => {
let currPage = pages[pages.length - 1]; // 获取当前页面 let currPage = pages[pages.length - 1]; // 获取当前页面
setInfoObj((val) => ({ setInfoObj((val) => ({
...val, ...val,
province_name: currPage.data?.addressObj?.province_name, province_name: currPage.data?.addressObj?.province_name ? currPage.data?.addressObj?.province_name : '---',
address_id: currPage.data?.addressObj?.id, address_id: currPage.data?.addressObj?.id ? currPage.data?.addressObj?.id : '',
city_name: currPage.data?.addressObj?.city_name, city_name: currPage.data?.addressObj?.city_name ? currPage.data?.addressObj?.city_name : '',
address_detail: currPage.data?.addressObj?.address_detail, address_detail: currPage.data?.addressObj?.address_detail ? currPage.data?.addressObj?.address_detail : '',
district_name: currPage.data?.addressObj?.district_name, district_name: currPage.data?.addressObj?.district_name ? currPage.data?.addressObj?.district_name : '',
target_user_name: currPage.data?.addressObj?.name, target_user_name: currPage.data?.addressObj?.name ? currPage.data?.addressObj?.name : '',
purchaser_phone: currPage.data?.addressObj?.phone, purchaser_phone: currPage.data?.addressObj?.phone ? currPage.data?.addressObj?.phone : '',
})) }))
if (!currPage.data?.addressObj) {
setReceivingStatus(1)
} else {
setReceivingStatus(2)
}
}) })
useEffect(() => { useEffect(() => {
getDetail() getDetail()
}, []) }, [])
useEffect(() => {
setInfoObj(infoObj)
console.log(infoObj, 66666)
}, [infoObj])
//收货方法,1:自提2物流 //收货方法,1:自提2物流
const [receivingStatus, setReceivingStatus] = useState<any>(null) const [receivingStatus, setReceivingStatus] = useState<any>(null)
@ -78,7 +79,6 @@ export default () => {
} }
const res = await infoFetch(query) const res = await infoFetch(query)
setInfoObj(res.data) setInfoObj(res.data)
setReceivingStatus(1)
} }
//备注操作 //备注操作

View File

@ -13,7 +13,7 @@ export const useTimeCountDown = () => {
const timeObj: any = useRef() const timeObj: any = useRef()
const endTime = useRef('') const endTime = useRef('')
const onStart = (val = '') => { const onStart = (val = '') => {
console.log('time:::', val) // console.log('time:::', val)
endTime.current = val endTime.current = val
if (endTime.current) { if (endTime.current) {
clearInterval(timeObj.current) clearInterval(timeObj.current)
@ -50,7 +50,7 @@ export const useTimeCountDown = () => {
var HH = ('00' + hh).slice(-2) var HH = ('00' + hh).slice(-2)
var MM = ('00' + mm).slice(-2) var MM = ('00' + mm).slice(-2)
var SS = ('00' + ss).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 })) setShowTime((e) => ({ ...e, DD, HH, MM, SS }))
} }
return { return {
@ -103,8 +103,8 @@ const defaultOptions = {
*/ */
export const useNeedMemoCallback = (options: Options = defaultOptions) => { export const useNeedMemoCallback = (options: Options = defaultOptions) => {
return (prevProps: NormalPropsType, nextProps: NormalPropsType) => { return (prevProps: NormalPropsType, nextProps: NormalPropsType) => {
console.log(options) // console.log(options)
console.log('memo==>', prevProps, nextProps) // console.log('memo==>', prevProps, nextProps)
let needMemoized = true let needMemoized = true
// 引用类型 // 引用类型
// function array object // function array object
@ -115,8 +115,8 @@ export const useNeedMemoCallback = (options: Options = defaultOptions) => {
const handleDiff = () => { const handleDiff = () => {
for (let [key, value] of Object.entries(prevProps)){ for (let [key, value] of Object.entries(prevProps)){
if (!Object.is(value, nextProps[key])) { if (!Object.is(value, nextProps[key])) {
console.log('函数不相等',value === nextProps[key]) // console.log('函数不相等',value === nextProps[key])
console.log('asdfasdf',value) // console.log('asdfasdf',value)
needMemoized = false needMemoized = false
break break
} }
@ -165,4 +165,4 @@ const bool = needMemo(
hobby: hobby, hobby: hobby,
}, },
) )
console.log('bool==>', bool) // console.log('bool==>', bool)