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