Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
f2a9fd9b
Commit
f2a9fd9b
authored
Apr 13, 2022
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 更换优惠券领取和进货单优惠券查询接口
parent
d21a43c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
index.tsx
...urchaseOrder/commodityDetail/components/Coupons/index.tsx
+14
-5
index.tsx
...on/saleOrder/agentPurchaseOrder/commodityDetail/index.tsx
+2
-0
commodityItem.tsx
...eOrder/agentPurchaseOrder/purchaseOrder/commodityItem.tsx
+14
-3
No files found.
src/pages/transaction/saleOrder/agentPurchaseOrder/commodityDetail/components/Coupons/index.tsx
View file @
f2a9fd9b
...
...
@@ -4,7 +4,7 @@ import { CaretDownOutlined, CaretUpOutlined, CheckCircleFilled } from '@ant-desi
import
{
TagList
}
from
'@linkseeks/lingxi-mall-components'
import
{
LinkTo
}
from
'../../../utils'
import
moment
from
'moment'
import
{
postMarketingWebCouponReceive
}
from
'@/services/MarketingV2Api'
import
{
postMarketingWeb
Agent
CouponReceive
}
from
'@/services/MarketingV2Api'
import
{
CouponDataType
}
from
'../../types'
import
{
getMessage
}
from
'../../../utils'
import
styles
from
'./index.less'
...
...
@@ -12,10 +12,12 @@ import styles from './index.less'
interface
CouponsProps
{
data
:
CouponDataType
[]
|
undefined
,
mallId
:
number
,
agentMemberId
:
number
,
agentRoleId
:
number
,
}
const
Coupons
:
React
.
FC
<
CouponsProps
>
=
(
props
)
=>
{
const
{
data
,
mallId
}
=
props
const
{
data
,
mallId
,
agentMemberId
,
agentRoleId
}
=
props
const
[
couponsList
,
setCouponsList
]
=
useState
<
CouponDataType
[]
>
()
const
[
expand
,
setExpand
]
=
useState
<
boolean
>
(
false
)
const
SHOW_COUNT
=
2
// 默认显示数量
...
...
@@ -42,10 +44,15 @@ const Coupons: React.FC<CouponsProps> = (props) => {
belongType
:
couponInfo
.
belongType
,
couponId
:
couponInfo
.
couponId
}
const
res
=
await
postMarketingWebCouponReceive
(
param
)
message
.
destroy
()
const
headers
:
any
=
{
agentMemberId
,
agentRoleId
,
}
const
res
=
await
postMarketingWebAgentCouponReceive
(
param
,
{
headers
})
if
(
res
.
code
===
1000
&&
res
.
data
)
{
if
(
res
.
data
?.
canReceive
===
3
)
{
message
.
destroy
()
if
(
res
.
data
?.
canReceive
!==
1
)
{
const
newCoupons
=
couponsList
?
couponsList
.
map
((
item
)
=>
{
return
{
...
item
,
...
...
@@ -83,6 +90,8 @@ const Coupons: React.FC<CouponsProps> = (props) => {
</
div
>
)
})
}
else
{
message
.
info
(
getMessage
(
'coupons.incompatible'
))
}
}
}
catch
(
error
)
{
...
...
src/pages/transaction/saleOrder/agentPurchaseOrder/commodityDetail/index.tsx
View file @
f2a9fd9b
...
...
@@ -582,6 +582,8 @@ const CommodityDetail: React.FC = (props: any) => {
<
Coupons
data=
{
marketingData
?.
couponList
}
mallId=
{
mallId
}
agentMemberId=
{
agentPurchaseOrderInfo
?.
memberId
}
agentRoleId=
{
agentPurchaseOrderInfo
?.
roleId
}
/>
)
}
...
...
src/pages/transaction/saleOrder/agentPurchaseOrder/purchaseOrder/commodityItem.tsx
View file @
f2a9fd9b
...
...
@@ -6,7 +6,7 @@ import { Link } from 'react-router-dom';
import
{
fnGetActivityTips
}
from
'./callBlackTips'
;
import
{
CaretDownOutlined
,
RightOutlined
}
from
'@ant-design/icons'
;
import
InputNumber
from
'../components/InputNumber'
;
import
{
getMarketingWeb
CouponListByShop
,
postMarketingMobile
CouponReceive
}
from
'@/services/MarketingV2Api'
;
import
{
getMarketingWeb
AgentCouponListByShop
,
postMarketingWebAgent
CouponReceive
}
from
'@/services/MarketingV2Api'
;
import
{
priceFormat
,
numFormat
}
from
'../utils/numFormat'
import
{
LinkTo
,
getMessage
}
from
'../utils'
;
...
...
@@ -376,7 +376,13 @@ const CommodityItem: React.FC<any> = (props) => {
memberId
:
newShop
.
memberId
,
roleId
:
newShop
.
memberRoleId
,
};
getMarketingWebCouponListByShop
(
parmas
).
then
((
res
)
=>
{
const
headers
:
any
=
{
agentMemberId
:
buyerInfo
?.
memberId
,
agentRoleId
:
buyerInfo
?.
roleId
,
}
getMarketingWebAgentCouponListByShop
(
parmas
,
{
headers
}).
then
((
res
)
=>
{
setShowIsLoading
(
false
);
if
(
res
.
code
===
1000
)
{
setcouponList
(
res
.
data
);
...
...
@@ -405,8 +411,13 @@ const CommodityItem: React.FC<any> = (props) => {
belongType
:
item
.
belongType
,
couponId
:
item
.
couponId
,
}
postMarketingMobileCouponReceive
(
parmas
).
then
((
res
)
=>
{
const
headers
:
any
=
{
agentMemberId
:
buyerInfo
?.
memberId
,
agentRoleId
:
buyerInfo
?.
roleId
,
}
postMarketingWebAgentCouponReceive
(
parmas
,
{
headers
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
();
message
.
success
(
getMessage
(
'purchaseOrder.lingquchenggong'
,
'领取成功'
))
item
.
completeReceive
=
3
;
setcouponList
([...
couponList
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment