feat
This commit is contained in:
@ -7,18 +7,19 @@ import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
||||
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
||||
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
||||
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
||||
import { EventName } from '@/constants/app';
|
||||
import { DeclarationType, ProductType } from '@/constants/product';
|
||||
import { JobDetails } from '@/types/job';
|
||||
import { ProductInfo } from '@/types/product';
|
||||
import { GetProductIsUnlockResponse, ProductInfo } from '@/types/product';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { requestProductUseRecord, requestUseProduct } from '@/utils/product';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
import '../index.less';
|
||||
import { EventName } from '@/constants/app';
|
||||
|
||||
interface IProps {
|
||||
data: JobDetails;
|
||||
productRecord?: GetProductIsUnlockResponse;
|
||||
productInfo?: ProductInfo;
|
||||
onClose: () => void;
|
||||
}
|
||||
@ -27,7 +28,7 @@ const PRODUCT_CODE = ProductType.VIP;
|
||||
const log = logWithPrefix('product-contact-dialog');
|
||||
|
||||
function ProductContactDialog(props: Omit<IProps, 'visible'>) {
|
||||
const { data, productInfo: productInfoProps, onClose } = props;
|
||||
const { data, productInfo: productInfoProps, productRecord, onClose } = props;
|
||||
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
||||
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
||||
const initRef = useRef(() => {});
|
||||
@ -56,10 +57,9 @@ function ProductContactDialog(props: Omit<IProps, 'visible'>) {
|
||||
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||
// return;
|
||||
// }
|
||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||
log('requestProductUseRecord result', result);
|
||||
if (result) {
|
||||
handleContact(result.declarationTypeResult);
|
||||
log('requestProductUseRecord result', productRecord);
|
||||
if (productRecord) {
|
||||
handleContact(productRecord.declarationTypeResult);
|
||||
return;
|
||||
}
|
||||
if (!productInfoProps?.balance) {
|
||||
@ -76,7 +76,7 @@ function ProductContactDialog(props: Omit<IProps, 'visible'>) {
|
||||
Taro.hideLoading();
|
||||
}
|
||||
};
|
||||
}, [data, handleCloseDialog]);
|
||||
}, [data, handleCloseDialog, productRecord, productInfoProps?.balance]);
|
||||
|
||||
useEffect(() => {
|
||||
initRef.current();
|
||||
|
||||
Reference in New Issue
Block a user