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
陈智峰
jinfa-platform
Commits
76b137af
Commit
76b137af
authored
Sep 17, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:渠道商品下单
parent
f1839341
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
18 deletions
+41
-18
index.ts
config/channelRoutes/index.ts
+9
-0
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+4
-4
index.tsx
src/pages/lxMall/components/CommonHeader/index.tsx
+5
-5
index.tsx
src/pages/lxMall/components/SideNav/index.tsx
+1
-1
index.tsx
src/pages/lxMall/order/index.tsx
+18
-5
index.tsx
src/pages/lxMall/purchaseOrder/index.tsx
+4
-3
No files found.
config/channelRoutes/index.ts
View file @
76b137af
...
...
@@ -81,6 +81,15 @@ const shopRoute = {
component
:
'@/pages/lxMall/purchaseOrder'
,
},
{
// 渠道订单
path
:
`/channelmall/order`
,
name
:
'order'
,
key
:
'order'
,
hide
:
true
,
hideHeader
:
true
,
component
:
'@/pages/lxMall/order'
,
},
{
path
:
'/noAuth'
,
component
:
'@/pages/403'
,
},
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
76b137af
...
...
@@ -55,7 +55,7 @@ interface imgItemType {
const
CommodityDetail
=
(
props
)
=>
{
const
{
query
:
{
id
}
}
=
props
.
location
const
{
shopInfo
=
{},
layoutType
,
memberId
}
=
props
const
{
shopInfo
=
{},
layoutType
,
memberId
,
shopUrlParam
}
=
props
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
{
updateOrderInfo
}
=
OrderStore
const
[
addSuccessVisible
,
setAddSuccessVisible
]
=
useState
<
boolean
>
(
false
)
...
...
@@ -299,7 +299,7 @@ const CommodityDetail = (props) => {
}]
}
updateOrderInfo
(
buyOrderInfo
,
sessionKey
).
then
(()
=>
{
history
.
push
(
`
/order?spam_id=
${
sessionKey
}
&scence=prompt
`
)
history
.
push
(
`
${
layoutType
===
LAYOUT_TYPE
.
channel
?
'/channelmall'
:
''
}
/order?spam_id=
${
sessionKey
}
&scence=prompt
${
layoutType
===
LAYOUT_TYPE
.
channel
?
'&channelId='
+
shopUrlParam
:
''
}
`
)
})
clickFlag
=
true
}
else
{
...
...
@@ -514,7 +514,7 @@ const CommodityDetail = (props) => {
let
result
=
true
let
newSelectAttrVal
=
JSON
.
parse
(
JSON
.
stringify
(
selectAttrVal
))
if
(
selectAttrVal
.
length
>
0
)
{
newSelectAttrVal
.
pop
()
//
newSelectAttrVal.pop()
if
(
commodityDetail
?.
unitPriceAndPicList
)
{
let
tempList
=
[]
for
(
let
item
of
commodityDetail
?.
unitPriceAndPicList
)
{
...
...
@@ -726,7 +726,7 @@ const CommodityDetail = (props) => {
<
span
>
种商品
</
span
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
add_success_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
history
.
push
(
'/purchaseOrder'
)
}
>
去结算
</
div
>
<
div
className=
{
cx
(
styles
.
add_success_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
history
.
push
(
`${layoutType === LAYOUT_TYPE.channel ? '/channelmall' : ''}/purchaseOrder${layoutType === LAYOUT_TYPE.channel ? '?channelId=' + shopUrlParam : ''}`
)
}
>
去结算
</
div
>
<
div
className=
{
styles
.
add_success_btn
}
onClick=
{
()
=>
setAddSuccessVisible
(
false
)
}
>
继续购物
</
div
>
</
div
>
<
InterestedCommodity
/>
...
...
src/pages/lxMall/components/CommonHeader/index.tsx
View file @
76b137af
...
...
@@ -5,7 +5,7 @@ import { LAYOUT_TYPE } from '@/constants'
interface
ShopHeaderPropsType
{
title
?:
string
;
type
:
LAYOUT_TYPE
;
type
?
:
LAYOUT_TYPE
;
logoUrl
?:
string
;
shopUrlParam
?:
string
;
}
...
...
@@ -18,7 +18,7 @@ const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => {
let
link
=
'/'
switch
(
type
)
{
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall?
i
d=
${
shopUrlParam
}
`
link
=
`/channelmall?
channelI
d=
${
shopUrlParam
}
`
break
case
LAYOUT_TYPE
.
mall
:
case
LAYOUT_TYPE
.
shop
:
...
...
@@ -33,9 +33,9 @@ const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => {
<
div
className=
{
styles
.
common_header
}
>
<
div
className=
{
styles
.
common_header_container
}
>
<
div
className=
{
styles
.
logo
}
>
<
Link
to=
{
getHomeLink
()
}
>
<
img
src=
{
logoUrl
}
/>
</
Link
>
{
/* <Link to={getHomeLink()}> */
}
<
img
src=
{
logoUrl
}
/>
{
/* </Link> */
}
</
div
>
<
div
className=
{
styles
.
common_header_split
}
></
div
>
<
div
className=
{
styles
.
common_header_title
}
>
{
title
}
</
div
>
...
...
src/pages/lxMall/components/SideNav/index.tsx
View file @
76b137af
...
...
@@ -26,7 +26,7 @@ const SideNav: React.FC<SideNavPropsType> = (props) => {
let
link
=
'/purchaseOrder'
switch
(
type
)
{
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall/purchaseOrder?
i
d=
${
shopUrlParam
}
`
link
=
`/channelmall/purchaseOrder?
channelI
d=
${
shopUrlParam
}
`
break
default
:
link
=
'/purchaseOrder'
...
...
src/pages/lxMall/order/index.tsx
View file @
76b137af
...
...
@@ -15,12 +15,18 @@ import styles from './index.less'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetLogisticsReceiverAddressGetResponse
}
from
'@/services/LogisticsApi'
import
{
isEmpty
}
from
'lodash'
import
{
LAYOUT_TYPE
}
from
'@/constants'
interface
OrderPropsType
{
location
:
any
location
:
any
;
shopInfo
:
any
;
mallInfo
:
any
;
layoutType
:
LAYOUT_TYPE
;
}
const
Order
:
React
.
FC
<
OrderPropsType
>
=
(
props
)
=>
{
const
{
shopInfo
,
mallInfo
,
layoutType
}
=
props
console
.
log
(
shopInfo
,
"shopInfo"
)
const
{
spam_id
}
=
props
.
location
.
query
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
{
clearOrderInfo
,
getOrderInfo
}
=
OrderStore
...
...
@@ -53,7 +59,11 @@ const Order: React.FC<OrderPropsType> = (props) => {
for
(
let
orderItem
of
item
.
orderList
)
{
let
resData
:
any
=
{}
if
(
orderItem
.
logistics
?.
sendAddress
)
{
resData
=
await
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
orderItem
.
logistics
.
sendAddress
})
try
{
resData
=
await
PublicApi
.
getLogisticsShipperAddressGet
({
id
:
orderItem
.
logistics
.
sendAddress
})
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
message
.
destroy
()
orderItem
.
logisticsInfo
=
resData
.
data
||
{}
...
...
@@ -62,7 +72,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
item
.
orderList
=
tempOrderList
result
.
push
(
item
)
}
console
.
log
(
result
,
"result"
)
setOrderList
(
result
)
setOrderInfo
(
sessionOrderInfo
)
setSpinningState
(
false
)
...
...
@@ -131,7 +141,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
return
}
let
params
:
any
=
{
orderModel
:
5
,
// 下单模式
orderModel
:
layoutType
===
LAYOUT_TYPE
.
channel
?
12
:
5
,
// 下单模式
deliveryAddresId
:
selectAddressInfo
.
id
,
addresName
:
selectAddressInfo
.
receiverName
,
isDefault
:
selectAddressInfo
.
isDefault
,
...
...
@@ -184,7 +194,10 @@ const Order: React.FC<OrderPropsType> = (props) => {
return
orderInfo
&&
(
<
Spin
spinning=
{
spinningState
}
>
<
div
className=
{
styles
.
order
}
>
<
CommonHeader
title=
"订单结算"
/>
<
CommonHeader
logoUrl=
{
layoutType
===
LAYOUT_TYPE
.
channel
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
title=
"订单结算"
/>
<
div
className=
{
styles
.
order_container
}
>
{
orderInfo
.
logistics
.
deliveryType
===
1
&&
(
...
...
src/pages/lxMall/purchaseOrder/index.tsx
View file @
76b137af
...
...
@@ -19,11 +19,12 @@ import { isEmpty } from 'lodash'
interface
PurchaseOrderPropsType
{
layoutType
:
LAYOUT_TYPE
,
shopInfo
:
GetTemplateChannelFindChannelResponse
,
shopUrlParam
:
string
shopUrlParam
:
string
,
mallInfo
:
any
}
const
PurchaseOrder
:
React
.
FC
<
PurchaseOrderPropsType
>
=
(
props
)
=>
{
const
{
layoutType
,
shopInfo
,
shopUrlParam
}
=
props
const
{
layoutType
,
shopInfo
,
shopUrlParam
,
mallInfo
}
=
props
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
{
updateOrderInfo
}
=
OrderStore
const
[
indeterminate
,
setIndeterminate
]
=
useState
<
boolean
>
(
false
)
...
...
@@ -511,7 +512,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
<
CommonHeader
title=
"我的进货单"
type=
{
layoutType
}
logoUrl=
{
layoutType
===
LAYOUT_TYPE
.
channel
?
shopInfo
?.
logo
:
GlobalConfig
.
global
.
logo
}
logoUrl=
{
layoutType
===
LAYOUT_TYPE
.
channel
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
shopUrlParam=
{
shopUrlParam
}
/>
<
div
className=
{
styles
.
purchase_order_title
}
>
...
...
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