Browse Source

活动

tags/小炒逻辑变更前
gwbvipvip 2 years ago
parent
commit
e294a21420
2 changed files with 78 additions and 14 deletions
  1. +75
    -10
      src/pages/activity/activityInfo/components/CreateForm.jsx
  2. +3
    -4
      src/pages/activity/activityInfo/index.jsx

+ 75
- 10
src/pages/activity/activityInfo/components/CreateForm.jsx View File

@@ -3,6 +3,7 @@ import {
InputNumber,
Row,
Col,
Switch,
Checkbox,
Space,
Steps,
@@ -252,25 +253,89 @@ const CreateForm = (props) => {
{'买满赠送(商品)'}
</Option>
<Option key={6} value={6}>
{'消费次数换购(阶梯)'}
{'累计消费换购(阶梯)'}
</Option>
<Option key={7} value={7}>
{'消费次数换购(循环)'}
{'累计消费换购(循环)'}
</Option >
<Option key={8} value={8}>
{'加价换购'}
</Option>
</Select >
</Form.Item >

<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
prevValues.activityType !== currentValues.activityType
}
>
} >
{({ getFieldValue }) =>
(getFieldValue('activityType') == '6' || getFieldValue('activityType') == '7') ? (
<Form.Item>
<Form.Item
name="isGiftGoodsParticipate"
label="赠送商品是否参与活动"
rules={[
{
required: true,
},
]}
>
<Select
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="请选活动消费类型"
>
<Option key={1} value={1}>
{'是'}
</Option>
<Option key={0} value={0}>
{'否'}
</Option>
</Select >
</Form.Item>
<Form.Item
name="consumptionType"
label="活动消费类型"
rules={[
{
required: true,
},
]}
>
<Select
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="请选活动消费类型"
>
<Option key={1} value={1}>
{'钱(元)'}
</Option>
<Option key={2} value={2}>
{'数量(杯/碗/盒/个/.....)'}
</Option>
</Select >
</Form.Item>
</Form.Item>

) : null
}
</Form.Item>



<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
prevValues.activityType !== currentValues.activityType
} >
{({ getFieldValue }) =>
// (getFieldValue('activityType') == '6' || getFieldValue('activityType') == '7') ? (

// <Form.Item label="消费次数">
@@ -376,12 +441,12 @@ const CreateForm = (props) => {
})}
</Select>) :
(getFieldValue('activityType') == '5' || getFieldValue('activityType') == '8') ? (
<Select style={{ width: 200 }}
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
} >
<Select style={{ width: 200 }}
showSearch
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
} >
{goodsInfo.map((item, index) => {
return (
<Option index={index} value={item.id} key={item.id}>


+ 3
- 4
src/pages/activity/activityInfo/index.jsx View File

@@ -86,9 +86,8 @@ const activityInfManage = () => {
const handleUpdate = async (fields) => {
message.loading('正在修改...', key);
try {
debugger
if(fields.activityType==3){
debugger
fields.activityRewards.forEach(element => {
element.value=`[${element.value.join()}]`
});
@@ -164,8 +163,8 @@ const activityInfManage = () => {
3: { text: '商品促销', status: 'Success' },
4: { text: '买满赠送(优惠券)', status: 'Success' },
5: { text: '买满赠送(商品)', status: 'Success' },
6: { text: '消费次数换购(阶梯)', status: 'Success' },
7: { text: '消费次数换购(循环)', status: 'Success' },
6: { text: '累计消费换购(阶梯)', status: 'Success' },
7: { text: '累计消费换购(循环)', status: 'Success' },
8: { text: '加价换购', status: 'Success' },
},
},


Loading…
Cancel
Save