♻️ refactor: 重构京东E卡
This commit is contained in:
parent
c4d585e765
commit
8fb9a7213d
|
@ -88,9 +88,7 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
account_type: "",
|
||||
map_product_name: "",
|
||||
end_time: "",
|
||||
card_show: 2,
|
||||
messageVerify: 2,
|
||||
channelVerIfy: undefined
|
||||
card_show: 2
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -139,9 +137,11 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
setState({ loading: true })
|
||||
return new Promise((resolve, reject) => {
|
||||
if (directResellerId) {
|
||||
/* 京东E卡 */
|
||||
const isECard = model.product_type === 3
|
||||
let param = {
|
||||
reseller_id: directResellerId,
|
||||
type: model.product_type
|
||||
type: isECard ? 1 : model.product_type
|
||||
}
|
||||
getProductInfoSelect(param).then((res) => {
|
||||
handelResponse(
|
||||
|
@ -177,8 +177,6 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
if (productData) {
|
||||
setModel({
|
||||
goods_id: productData.goods_id,
|
||||
messageVerify: productData.messageVerify,
|
||||
channelVerIfy: productData.channelVerIfy,
|
||||
cost_price: productData.cost_price,
|
||||
weight: String(productData.weight),
|
||||
quantity: productData.quantity,
|
||||
|
@ -188,7 +186,7 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
product_id: productData.product_id,
|
||||
account_type: productData.account_type,
|
||||
map_product_name: productData.map_product_name,
|
||||
product_type: model.product_type,
|
||||
product_type: productData.isECard ? 1 : model.product_type,
|
||||
card_show: Number(productData.card_show),
|
||||
code_batch_id: productData.code_batch_id,
|
||||
end_time: productData.end_time,
|
||||
|
@ -245,9 +243,7 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
account_type: "",
|
||||
map_product_name: "",
|
||||
end_time: "",
|
||||
card_show: 2,
|
||||
messageVerify: 2,
|
||||
channelVerIfy: undefined
|
||||
card_show: 2
|
||||
})
|
||||
setTimeout(() => {
|
||||
setState({ isUpdatePic: !state.isUpdatePic })
|
||||
|
@ -255,9 +251,12 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
}
|
||||
// 获取表单数据
|
||||
const getFormModel = () => {
|
||||
/* 京东E卡 */
|
||||
const isECard = model.product_type === 3
|
||||
return {
|
||||
product_id: model.product_id,
|
||||
product_type: model.product_type,
|
||||
product_type: isECard ? 1 : model.product_type,
|
||||
isECard,
|
||||
product_name: model.product_name,
|
||||
contract_price: model.contract_price,
|
||||
cost_price: model.cost_price,
|
||||
|
@ -271,9 +270,7 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
map_product_name: model.product_name,
|
||||
goods_id: model.goods_id,
|
||||
end_time: model.end_time,
|
||||
card_show: model.card_show,
|
||||
messageVerify: model.messageVerify,
|
||||
channelVerIfy: model.channelVerIfy
|
||||
card_show: model.card_show
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,18 +511,7 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
>
|
||||
<RadioButton value={1}>直充</RadioButton>
|
||||
<RadioButton value={2}>卡密</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem labelname="是否短信验证" prop="product_id" id="product">
|
||||
<RadioGroup
|
||||
onChange={(e) => {
|
||||
setModel({ messageVerify: e.target.value })
|
||||
}}
|
||||
value={model.messageVerify}
|
||||
disabled={!!model.code_batch_id}
|
||||
>
|
||||
<RadioButton value={1}>是</RadioButton>
|
||||
<RadioButton value={2}>否</RadioButton>
|
||||
<RadioButton value={3}>京东E卡</RadioButton>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
{model.product_type === 2 ? (
|
||||
|
@ -556,19 +542,6 @@ const UseProductPop = forwardRef((props, ref) => {
|
|||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem labelname="验证渠道" prop="product_id" id="product">
|
||||
<Select
|
||||
clearable
|
||||
width={520}
|
||||
options={state.productOption}
|
||||
placeholder="请选择渠道"
|
||||
value={model.channelVerIfy}
|
||||
disabled={!!model.code_batch_id}
|
||||
onChange={(e) => {
|
||||
setModel({ channelVerIfy: e })
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
{model.product_type === 2 ? (
|
||||
<FormItem id="end_time" labelname="卡密有效期至" prop="end_time">
|
||||
<DatePicker
|
||||
|
|
Loading…
Reference in New Issue