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
linweijiong
jinfa-platform
Commits
a8ff1c0b
Commit
a8ff1c0b
authored
Dec 01, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:下单添加是否会员折扣字段
parent
54d97bbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
71 deletions
+71
-71
index.tsx
...ingsPanel/propsSettings/components/GoodsSetting/index.tsx
+21
-27
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+2
-1
index.tsx
src/pages/lxMall/order/index.tsx
+28
-25
index.tsx
src/pages/lxMall/purchaseOrder/index.tsx
+20
-18
No files found.
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/index.tsx
View file @
a8ff1c0b
...
...
@@ -33,7 +33,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
[
form
]
=
Form
.
useForm
()
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
operationType
,
setOprationType
]
=
useState
<
string
>
(
OPERATION_TYPE
.
list
)
// 操作类型:list:显示已选列表;select:选择列表
le
t
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
cons
t
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
const
{
templateid
,
categoryid
,
goodsList
=
[],
templateType
}
=
props
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
...
...
@@ -49,33 +49,27 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
[
categoryResponseList
,
setCategoryResponseList
]
=
useState
<
any
>
([])
const
[
noSelectBrands
,
setNoSelectBrands
]
=
useState
<
any
[]
>
([])
const
changeNewProps
=
(
key
:
string
,
data
:
any
)
=>
{
const
newProps
=
{
...
props
}
newProps
[
key
]
=
data
setNewProps
(
newProps
)
}
useEffect
(()
=>
{
fetchBrandsList
()
fetchCategoryList
()
},
[])
const
fetchCategoryList
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
categoryId
:
categoryid
,
templateId
:
templateid
}
setSpinLoading
(
true
)
//@ts-ignore
PublicApi
.
getTemplatePlatformFindCategoryList
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
setCategoryResponseList
(
data
.
categoryBOList
||
[])
setSpinLoading
(
false
)
if
(
res
.
code
===
1000
)
{
const
data
=
res
.
data
setCategoryResponseList
(
data
.
categoryBOList
||
[])
}
})
}
const
fetchBrandsList
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
type
:
0
,
templateId
:
templateid
,
categoryId
:
categoryid
,
...
...
@@ -83,7 +77,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
pageSize
:
100
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindBrandList
(
param
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
const
dataInfo
=
res
.
data
...
...
@@ -98,7 +91,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
},
[
filterParam
,
current
])
const
fetchGoodsList
=
()
=>
{
let
param
=
{
let
param
:
any
=
{
type
:
0
,
templateId
:
templateid
,
categoryId
:
categoryid
,
...
...
@@ -115,13 +108,14 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
getFn
=
PublicApi
.
getTemplateShopFindGoodsList
}
//@ts-ignore
setSpinLoading
(
true
)
getFn
(
param
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
const
dataInfo
=
res
.
data
setTotalCount
(
dataInfo
.
totalCount
)
setNoSelectGoods
(
dataInfo
.
data
||
[])
}
setSpinLoading
(
false
)
})
}
...
...
@@ -154,7 +148,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
handleSearch
=
()
=>
{
setCurrent
(
1
)
le
t
param
=
filterProps
(
form
.
getFieldsValue
())
cons
t
param
=
filterProps
(
form
.
getFieldsValue
())
setFilterParam
(
param
)
}
...
...
@@ -194,7 +188,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
// if (selectGoodsList.length <= 0) {
// message.error("请选择要推荐的商品")
// return
// } else
// } else
if
(
selectGoodsList
.
length
>
10
)
{
message
.
error
(
"最多只能推荐10件商品"
)
return
...
...
@@ -228,13 +222,13 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
saveGoods
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
param
:
any
=
{
cons
t
param
:
any
=
{
templateId
:
templateid
,
categoryId
:
categoryid
,
}
le
t
ids
:
number
[]
=
[]
cons
t
ids
:
number
[]
=
[]
for
(
le
t
item
of
selectGoodsList
)
{
for
(
cons
t
item
of
selectGoodsList
)
{
ids
.
push
(
item
.
goodsId
)
}
param
.
goodsIds
=
ids
...
...
@@ -258,8 +252,8 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
handleChangeOprationType
=
(
type
:
string
)
=>
{
setOprationType
(
type
)
le
t
keys
:
number
[]
=
[]
for
(
le
t
item
of
selectGoodsList
)
{
cons
t
keys
:
number
[]
=
[]
for
(
cons
t
item
of
selectGoodsList
)
{
keys
.
push
(
item
.
goodsId
)
}
setGoodsIds
(
keys
)
...
...
@@ -314,7 +308,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
</
Col
>
<
Col
>
<
Button
onClick=
{
()
=>
setIsHighSearch
(
isHighSearch
=
!
isHighSearch
)
}
>
高级筛选
{
isHighSearch
?
<
CaretUpOutlined
/>
:
<
CaretDownOutlined
/>
}
</
Button
>
<
Button
onClick=
{
()
=>
setIsHighSearch
(
!
isHighSearch
)
}
>
高级筛选
{
isHighSearch
?
<
CaretUpOutlined
/>
:
<
CaretDownOutlined
/>
}
</
Button
>
</
Col
>
<
Col
>
<
Button
onClick=
{
()
=>
handleReset
()
}
>
重置
</
Button
>
...
...
@@ -336,7 +330,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
>
<
Select
placeholder=
"品类"
style=
{
{
width
:
180
}
}
>
{
categoryResponseList
.
map
((
item
,
index
)
=>
<
Select
.
Option
k
ye
=
{
`select_category_item_${index}`
}
value=
{
item
.
categoryId
}
>
{
item
.
categoryName
}
</
Select
.
Option
>)
categoryResponseList
.
map
((
item
,
index
)
=>
<
Select
.
Option
k
ey
=
{
`select_category_item_${index}`
}
value=
{
item
.
categoryId
}
>
{
item
.
categoryName
}
</
Select
.
Option
>)
}
</
Select
>
</
Form
.
Item
>
...
...
@@ -348,7 +342,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
>
<
Select
placeholder=
"品牌"
style=
{
{
width
:
180
}
}
>
{
noSelectBrands
.
map
((
item
,
index
)
=>
(<
Select
.
Option
k
ye
=
{
`select_brand_item_${index}`
}
value=
{
item
.
brandId
}
>
{
item
.
brandName
}
</
Select
.
Option
>))
noSelectBrands
.
map
((
item
,
index
)
=>
(<
Select
.
Option
k
ey
=
{
`select_brand_item_${index}`
}
value=
{
item
.
brandId
}
>
{
item
.
brandName
}
</
Select
.
Option
>))
}
</
Select
>
</
Form
.
Item
>
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
a8ff1c0b
...
...
@@ -501,7 +501,8 @@ const CommodityDetail = (props) => {
stockCount
:
stockCount
,
minOrder
:
commodityDetail
.
minOrder
,
commodityPic
:
attrAndValList
.
commodityPic
?
attrAndValList
.
commodityPic
[
0
]
:
commodityDetail
.
mainPic
,
attribute
:
attrAndValList
.
attributeAndValueList
attribute
:
attrAndValList
.
attributeAndValueList
,
isMemberPrice
:
commodityDetail
.
isMemberPrice
?
1
:
0
}
const
sessionKey
=
`
${
commodityDetail
.
id
}${
new
Date
().
getTime
()}
`
...
...
src/pages/lxMall/order/index.tsx
View file @
a8ff1c0b
...
...
@@ -73,11 +73,11 @@ const Order: React.FC<OrderPropsType> = (props) => {
},
[])
const
initOrderInfo
=
async
()
=>
{
le
t
result
=
[]
cons
t
result
=
[]
const
sessionOrderInfo
:
any
=
await
getOrderInfo
(
spam_id
)
for
(
le
t
item
of
sessionOrderInfo
.
orderList
)
{
le
t
tempOrderList
=
[]
for
(
le
t
orderItem
of
item
.
orderList
)
{
for
(
cons
t
item
of
sessionOrderInfo
.
orderList
)
{
cons
t
tempOrderList
=
[]
for
(
cons
t
orderItem
of
item
.
orderList
)
{
let
resData
:
any
=
{}
if
(
orderItem
.
logistics
?.
sendAddress
)
{
try
{
...
...
@@ -103,17 +103,17 @@ const Order: React.FC<OrderPropsType> = (props) => {
// 是否选用电子合同
if
(
data
.
isElectronicContract
)
{
setElectronicContractId
(
data
.
electronicContractId
)
if
(
!!
sessionStorage
.
getItem
(
`contract
${
spam_id
}
`
))
{
if
(
sessionStorage
.
getItem
(
`contract
${
spam_id
}
`
))
{
setContractInfo
(
JSON
.
parse
(
sessionStorage
.
getItem
(
`contract
${
spam_id
}
`
)))
setIsElectronicContract
(
true
)
}
else
{
// 根据电子合同模板id获取生成电子合同
let
param
=
{
const
param
:
any
=
{
contractTemplateId
:
data
.
electronicContractId
,
signMemberId
:
userInfo
?.
memberId
,
orderNo
:
new
Date
().
getTime
()
}
//@ts-ignore
const
signRes
=
await
PublicApi
.
postOrderSignatureSignContractCreate
(
param
)
const
signData
:
any
=
signRes
.
data
if
(
signRes
.
code
===
1000
)
{
...
...
@@ -173,8 +173,8 @@ const Order: React.FC<OrderPropsType> = (props) => {
const
getCommodityAmount
=
()
=>
{
let
amount
=
0
for
(
le
t
item
of
orderInfo
.
orderList
)
{
for
(
le
t
orderItem
of
item
.
orderList
)
{
for
(
cons
t
item
of
orderInfo
.
orderList
)
{
for
(
cons
t
orderItem
of
item
.
orderList
)
{
amount
+=
(
orderItem
.
unitPrice
*
orderItem
.
count
)
}
}
...
...
@@ -187,10 +187,10 @@ const Order: React.FC<OrderPropsType> = (props) => {
const
getLogisticsFeeAnync
=
async
()
=>
{
if
(
selectAddressInfo
)
{
le
t
orderProductList
=
[]
for
(
le
t
item
of
orderInfo
.
orderList
)
{
for
(
le
t
orderItem
of
item
.
orderList
)
{
le
t
templateId
=
orderItem
.
logistics
?.
templateId
cons
t
orderProductList
=
[]
for
(
cons
t
item
of
orderInfo
.
orderList
)
{
for
(
cons
t
orderItem
of
item
.
orderList
)
{
cons
t
templateId
=
orderItem
.
logistics
?.
templateId
// 判断是否物流的方式和由买家承担费用并使用了运费模板
if
(
orderItem
.
logistics
?.
deliveryType
===
1
&&
orderItem
.
logistics
?.
carriageType
===
2
&&
orderItem
.
logistics
?.
useTemplate
&&
templateId
)
{
orderProductList
.
push
({
...
...
@@ -202,7 +202,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
}
if
(
orderProductList
.
length
>
0
)
{
le
t
params
:
any
=
{
cons
t
params
:
any
=
{
orderProductList
,
receiverAddressId
:
selectAddressInfo
.
id
}
...
...
@@ -210,7 +210,9 @@ const Order: React.FC<OrderPropsType> = (props) => {
const
res
:
any
=
await
PublicApi
.
postLogisticsFreightTemplateCalFreightPrice
(
params
)
message
.
destroy
()
setLogisticsFee
(
Number
(
res
.
data
))
}
catch
(
error
)
{
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
}
}
...
...
@@ -261,7 +263,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
* 提交订单
*/
const
submitOrder
=
(
signatureLogId
?:
number
)
=>
{
le
t
params
:
any
=
{
cons
t
params
:
any
=
{
orderModel
:
getOrderMode
(),
// 下单模式
needTheInvoice
:
needTheInvoice
?
1
:
0
,
}
...
...
@@ -278,12 +280,12 @@ const Order: React.FC<OrderPropsType> = (props) => {
// params.addres = selectAddressInfo.address
}
le
t
orderProductRequests
=
[]
le
t
purchaseIds
=
[]
for
(
le
t
item
of
orderList
)
{
cons
t
orderProductRequests
=
[]
cons
t
purchaseIds
=
[]
for
(
cons
t
item
of
orderList
)
{
for
(
le
t
orderItem
of
item
.
orderList
)
{
le
t
temp
:
any
=
{}
for
(
cons
t
orderItem
of
item
.
orderList
)
{
cons
t
temp
:
any
=
{}
purchaseIds
.
push
(
orderItem
.
purchaseId
)
temp
.
imgUrl
=
orderItem
.
commodityPic
temp
.
productId
=
orderItem
.
id
...
...
@@ -299,6 +301,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
temp
.
minOrder
=
orderItem
.
minOrder
temp
.
memberId
=
orderInfo
.
supplyMembersId
temp
.
memberRoleId
=
orderInfo
.
supplyMembersRoleId
temp
.
isMemberPrice
=
orderItem
.
isMemberPrice
orderProductRequests
.
push
(
temp
)
}
}
...
...
@@ -316,7 +319,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
params
.
theInvoiceId
=
selectInvoiceInfo
.
id
params
.
theInvoiceInfo
=
selectInvoiceInfo
}
if
(
!!
orderInfo
.
purchaseOrder
)
{
if
(
orderInfo
.
purchaseOrder
)
{
params
.
idList
=
purchaseIds
params
.
productType
=
(
layoutType
===
LAYOUT_TYPE
.
channel
||
layoutType
===
LAYOUT_TYPE
.
ichannel
)
?
2
:
1
}
...
...
@@ -388,13 +391,13 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
const
handleSignModalConfirm
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
contractTemplateId
:
electronicContractId
,
contractName
:
contractInfo
.
contractName
,
contractUrl
:
contractInfo
.
contractUrl
,
}
setAgreeSignLoading
(
true
)
// @ts-ignore
PublicApi
.
postOrderSignatureOrderSettleSign
(
param
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
@@ -409,7 +412,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
const
pollingCheckStatus
=
(
signatureLogId
)
=>
{
le
t
param
=
{
cons
t
param
=
{
signatureLogId
}
PublicApi
.
getOrderSignatureOrderSettleSignDetail
(
param
).
then
(
res
=>
{
...
...
src/pages/lxMall/purchaseOrder/index.tsx
View file @
a8ff1c0b
...
...
@@ -89,8 +89,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 初始化进货单数据
* @param list
* @param initState
* @param list
* @param initState
*/
const
initPurchaseList
=
async
(
list
:
GetSearchShopPurchaseGetPurchaseListResponse
)
=>
{
let
result
=
[]
...
...
@@ -119,7 +119,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
price
:
isMemberPrice
?
Number
(
unitPrice
[
key
])
*
Number
(
parameter
)
:
unitPrice
[
key
]
})
})
item
.
commodityUnitPrice
[
'priceRange'
]
=
tempPriceRange
tempItem
.
orderList
=
[...
tempItem
.
orderList
,
item
]
tempResult
.
push
(
tempItem
)
...
...
@@ -234,8 +234,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 修改购买数量
* @param count
* @param id
* @param count
* @param id
*/
const
handleCountChange
=
(
count
:
number
,
id
:
number
,
type
:
string
)
=>
{
handleChangeFinishCount
(
count
,
id
)
...
...
@@ -273,8 +273,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 修改商品购买数量
* @param count
* @param id
* @param count
* @param id
*/
const
handleChangeFinishCount
=
(
count
,
id
)
=>
{
const
result
=
orderList
.
map
(
item
=>
{
...
...
@@ -291,8 +291,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 计算单个商品总价格
* @param priceRange
* @param count
* @param priceRange
* @param count
*/
const
computeItemPrice
=
(
priceRange
,
count
)
=>
{
count
=
Number
(
count
)
...
...
@@ -314,7 +314,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 删除进货单的商品
* @param id
* @param id
*/
const
handleDeleteItem
=
(
id
:
number
)
=>
{
Modal
.
confirm
({
...
...
@@ -387,7 +387,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 删除指定id的商品
* @param ids
* @param ids
*/
const
deleteListItems
=
(
ids
:
number
[])
=>
{
const
newOrderList
=
JSON
.
parse
(
JSON
.
stringify
(
orderList
))
...
...
@@ -436,8 +436,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 获取用户权益参数
* @param memberId
* @param memberRoleId
* @param memberId
* @param memberRoleId
*/
const
getMemberCredit
=
(
memberId
,
memberRoleId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
...
...
@@ -455,10 +455,10 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
/**
* 获取支付方式
* @param memberId
* @param memberId
*/
const
getPayWayListByMemberId
=
(
memberId
:
number
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
memberId
)
{
resolve
([])
return
...
...
@@ -469,6 +469,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
PublicApi
.
getPayPayWayList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
initPayWayList
(
res
.
data
))
}
else
{
resolve
([])
}
})
})
...
...
@@ -539,7 +541,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
purchaseIds
.
push
(
item
.
id
)
productIds
.
push
(
item
.
commodityUnitPrice
.
id
)
commonLogistics
=
item
.
commodityUnitPrice
.
commodity
.
logistics
if
(
item
.
commodityUnitPrice
.
commodity
.
logistics
.
deliveryType
===
1
)
{
hasLogistics
=
true
logisticsInfo
=
item
.
commodityUnitPrice
.
commodity
.
logistics
...
...
@@ -558,7 +560,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
brand
:
item
.
commodityUnitPrice
.
commodity
.
brand
.
name
,
commodityPic
:
item
.
commodityUnitPrice
.
commodity
.
mainPic
,
attribute
:
item
.
commodityUnitPrice
.
attributeAndValueList
,
stockCount
:
item
.
stockCount
||
0
stockCount
:
item
.
stockCount
||
0
,
isMemberPrice
:
item
.
commodityUnitPrice
.
commodity
.
isMemberPrice
?
1
:
0
}
if
(
item
.
commodityUnitPrice
.
commodity
.
isMemberPrice
)
{
...
...
@@ -582,7 +585,6 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
orderList
:
buyOrderlist
}]
}
buyOrderInfo
.
payWayList
=
await
getPayWayListByMemberId
(
selectItem
.
memberId
)
PublicApi
.
postOrderIsWorkFlow
({
productIds
,
memberId
:
selectItem
.
memberId
}).
then
(
res
=>
{
...
...
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