1
This commit is contained in:
commit
492a20e7cb
@ -21,7 +21,7 @@ interface Param { invitation_code: string; name: string; phone: string }
|
||||
interface params {
|
||||
onSuccess?: () => void
|
||||
}
|
||||
interface SalesManDialogRef {
|
||||
export interface SalesManDialogRef {
|
||||
show: boolean
|
||||
handleChange: (show: boolean) => void
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { Image, ScrollView, View } from '@tarojs/components'
|
||||
import Taro from '@tarojs/taro'
|
||||
import classnames from 'classnames'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState, useTransition } from 'react'
|
||||
import { Ref, useCallback, useEffect, useMemo, useRef, useState, useTransition } from 'react'
|
||||
import Counter from '../counter'
|
||||
import BindSalesmanPopup from '../bindSalesmanPopup'
|
||||
import type { SalesManDialogRef } from '../bindSalesManDialog'
|
||||
import BindSalesManDialog from '../bindSalesManDialog'
|
||||
import LabAndImgShow from '../LabAndImgShow'
|
||||
import LabAndImg from '../LabAndImg'
|
||||
import styles from './index.module.scss'
|
||||
@ -44,7 +45,7 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
{ value: 1, title: '剪板', unit: '米', eunit: 'm', step: 1, digits: 2, minNum: 0.5, maxNum: 9.99, defaultNum: 1 },
|
||||
{ value: 2, title: '散剪', unit: '米', eunit: 'kg', step: 1, digits: 2, minNum: 3, maxNum: 100000, defaultNum: 3 },
|
||||
]
|
||||
|
||||
const bindSalesManDialogRef = useRef<SalesManDialogRef | null>(null)
|
||||
const [isPending, startTransition] = useTransition()
|
||||
|
||||
// 切换面料类型
|
||||
@ -121,8 +122,6 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
setList(() => ({ ...list }))
|
||||
}
|
||||
|
||||
// 绑定业务员和电话号码
|
||||
const [showBindSalesman, setShowBindSalesman] = useState(false)
|
||||
// 显示时展示数据
|
||||
useEffect(() => {
|
||||
if (!show) {
|
||||
@ -132,7 +131,8 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
else {
|
||||
setLoading(true)
|
||||
getShoppingCart()
|
||||
setShowBindSalesman(() => false)
|
||||
// setShowBindSalesman(() => false)
|
||||
bindSalesManDialogRef.current?.handleChange(false)
|
||||
}
|
||||
}, [show])
|
||||
|
||||
@ -265,7 +265,8 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
const res = await FetchData()
|
||||
if (res.data.order_access_status !== 3) {
|
||||
if (res.data.order_access_status == 1) { applyOrderAccessFetchData() }
|
||||
setShowBindSalesman(() => true)
|
||||
bindSalesManDialogRef.current?.handleChange(true)
|
||||
// setShowBindSalesman(() => true)
|
||||
onClose?.()
|
||||
return false
|
||||
}
|
||||
@ -372,7 +373,7 @@ const ShopCart = ({ show = false, onClose, intoStatus = 'shop', default_sale_mod
|
||||
</View>
|
||||
</Popup>
|
||||
<View>
|
||||
<BindSalesmanPopup show={showBindSalesman} onClose={() => setShowBindSalesman(false)} />
|
||||
<BindSalesManDialog ref={bindSalesManDialogRef} />
|
||||
</View>
|
||||
<View>
|
||||
<LabAndImgShow value={labImageValue} show={showLabImage} onClose={closeLabImgShow} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user