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
7418f22f
Commit
7418f22f
authored
Nov 25, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:对接积分兑换
parent
1281ab95
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
47 deletions
+33
-47
index.tsx
src/pages/lxMall/commodity/index.tsx
+3
-4
index.tsx
src/pages/lxMall/index/index.tsx
+7
-10
LXShopLayout.tsx
src/pages/lxMall/layouts/LXShopLayout.tsx
+2
-8
index.tsx
src/pages/lxMall/pay/components/balance/index.tsx
+3
-6
index.tsx
src/pages/lxMall/pay/components/credit/index.tsx
+4
-4
index.tsx
src/pages/lxMall/pay/components/point/index.tsx
+5
-6
index.tsx
src/pages/lxMall/pointsMall/index.tsx
+4
-5
cryptoAes.ts
src/utils/cryptoAes.ts
+5
-4
No files found.
src/pages/lxMall/commodity/index.tsx
View file @
7418f22f
...
...
@@ -26,7 +26,7 @@ interface CommodityPropsType {
}
interface
f
ilterQuery
{
interface
F
ilterQuery
{
current
:
number
;
pageSize
:
number
;
name
?:
string
;
...
...
@@ -98,7 +98,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
useEffect
(()
=>
{
if
(
userInfo
&&
layoutType
===
LAYOUT_TYPE
.
mall
)
{
le
t
temp
=
JSON
.
parse
(
JSON
.
stringify
(
filterConfig
))
cons
t
temp
=
JSON
.
parse
(
JSON
.
stringify
(
filterConfig
))
temp
.
unshift
(
FILTER_TYPE
.
commonlyUsed
)
setFilterConfig
(
temp
)
}
...
...
@@ -108,7 +108,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
},
[
layoutType
])
const
fetchCommodityList
=
(
currentParam
?:
number
)
=>
{
let
param
:
f
ilterQuery
=
{
let
param
:
F
ilterQuery
=
{
current
:
currentParam
?
currentParam
:
current
,
pageSize
}
...
...
@@ -149,7 +149,6 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
break
}
//@ts-ignore
getFn
&&
getFn
(
param
,
{
headers
}).
then
(
res
=>
{
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
...
...
src/pages/lxMall/index/index.tsx
View file @
7418f22f
...
...
@@ -37,11 +37,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
},
[
mallTemplateId
])
const
findFirstAdvertsByType
=
()
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
mallTemplateId
,
type
:
1
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
...
...
@@ -50,11 +49,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
}
const
findSecondAdvertsByType
=
()
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
mallTemplateId
,
type
:
2
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
...
...
@@ -81,12 +79,11 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
mallTemplateId
,
categoryId
}
// @ts-ignore
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
...
...
@@ -96,12 +93,12 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
}
const
getCategoryComponents
=
async
()
=>
{
le
t
result
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
result
=
[]
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
if
(
item
.
id
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
result
.
push
(
<
FloorLine
linkUrl=
{
`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`
}
...
...
src/pages/lxMall/layouts/LXShopLayout.tsx
View file @
7418f22f
...
...
@@ -27,11 +27,6 @@ interface LXMallLayoutPropsType {
SiteStore
?:
any
;
}
interface
queryType
{
shopId
:
number
;
memberId
:
number
;
}
const
LXShopLayout
:
React
.
FC
<
LXMallLayoutPropsType
>
=
(
props
)
=>
{
const
{
children
,
location
}
=
props
...
...
@@ -56,7 +51,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const
getWebMallInfo
=
()
=>
{
const
shopInfo
=
GlobalConfig
.
web
.
shopInfo
le
t
webMallInfo
=
shopInfo
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
cons
t
webMallInfo
=
shopInfo
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
setMallInfo
(
webMallInfo
)
}
...
...
@@ -67,7 +62,6 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
},
[
query
])
const
fetchShopInfo
=
(
memberId
)
=>
{
//@ts-ignore
PublicApi
.
getTemplateShopFindShop
({
memberId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
...
...
@@ -79,7 +73,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
}
useEffect
(()
=>
{
le
t
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
cons
t
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
if
(
shopInfo
)
{
body
.
className
=
shopInfo
.
fileName
?
`theme-shop-
${
shopInfo
.
fileName
}
`
:
templateName
;
}
else
{
...
...
src/pages/lxMall/pay/components/balance/index.tsx
View file @
7418f22f
...
...
@@ -43,12 +43,12 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
},
[
orderInfo
,
payInfo
])
const
fetchBalanceInfo
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
payType
:
payInfo
.
ruleConfigurationId
,
parentMemberId
:
orderInfo
.
supplyMembersId
,
parentMemberRoleId
:
orderInfo
.
supplyMembersRoleId
}
//@ts-ignore
PublicApi
.
getPayAssetAccountGetUserBalance
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setBalanceInfo
(
res
.
data
)
...
...
@@ -57,8 +57,6 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
setPageLoading
(
false
)
onChange
(
true
,
res
.
message
)
}
}).
catch
(()
=>
{
})
}
...
...
@@ -80,14 +78,13 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
message
.
info
(
"请输入支付密码"
)
return
}
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
encryptedByAES
(
payPassword
)
}
setConfirmLoading
(
true
)
//@ts-ignore
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
src/pages/lxMall/pay/components/credit/index.tsx
View file @
7418f22f
...
...
@@ -10,6 +10,7 @@ import { numFormat } from '@/utils/numberFomat'
import
{
linkToUrl
}
from
'../../utils'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
styles
from
'./index.less'
import
{
encryptedByAES
}
from
'@/utils/cryptoAes'
import
{
message
,
Button
,
Spin
}
from
'antd'
interface
CreditPayWayPropsType
{
...
...
@@ -43,7 +44,7 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
},
[
orderInfo
])
const
fetchCreditInfo
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
parentMemberId
:
orderInfo
.
supplyMembersId
,
parentMemberRoleId
:
orderInfo
.
supplyMembersRoleId
}
...
...
@@ -77,14 +78,13 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
message
.
error
(
"请输入支付密码"
)
return
}
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
Number
(
payPassword
)
payPassword
:
encryptedByAES
(
payPassword
)
}
setConfirmLoading
(
true
)
//@ts-ignore
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
src/pages/lxMall/pay/components/point/index.tsx
View file @
7418f22f
...
...
@@ -47,11 +47,11 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
},
[
orderInfo
])
const
fetchPointInfo
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
memberId
:
orderInfo
.
supplyMembersId
,
roleId
:
orderInfo
.
supplyMembersRoleId
}
//@ts-ignore
PublicApi
.
getMemberBusinessLrcRightPointGet
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setPointInfo
(
res
.
data
)
...
...
@@ -60,8 +60,6 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
setPageLoading
(
false
)
onChange
(
true
,
res
.
message
)
}
}).
catch
(()
=>
{
})
}
...
...
@@ -83,14 +81,15 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
message
.
error
(
"请输入支付密码"
)
return
}
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
relType
,
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
encryptedByAES
(
payPassword
)
}
setConfirmLoading
(
true
)
//@ts-ignore
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
src/pages/lxMall/pointsMall/index.tsx
View file @
7418f22f
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
CaretUpOutlined
,
CaretDownOutlined
,
UnorderedListOutlined
,
AppstoreOutlined
,
CloseOutlined
}
from
'@ant-design/icons'
import
{
CaretUpOutlined
,
CaretDownOutlined
,
CloseOutlined
}
from
'@ant-design/icons'
import
Filter
from
'../components/Filter'
import
{
FILTER_TYPE
}
from
'@/constants'
import
{
Pagination
}
from
'antd'
...
...
@@ -13,7 +13,7 @@ import { PublicApi } from '@/services/api'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
cx
from
'classnames'
import
{
PostSearchShopEnterpriseGetCommodityListResponseDetail
}
from
'@/services/SearchApi'
import
bannerImg
from
'@/assets/imgs/banner_2.png'
//
import bannerImg from '@/assets/imgs/banner_2.png'
import
styles
from
'./index.less'
interface
CommodityPropsType
{
...
...
@@ -23,7 +23,7 @@ interface CommodityPropsType {
shopId
:
number
;
}
interface
f
ilterQuery
{
interface
F
ilterQuery
{
current
:
number
;
pageSize
:
number
;
name
?:
string
;
...
...
@@ -73,7 +73,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
},
[])
const
fetchCommodityList
=
(
currentParam
?:
number
)
=>
{
let
param
:
f
ilterQuery
=
{
let
param
:
F
ilterQuery
=
{
current
:
currentParam
?
currentParam
:
current
,
pageSize
}
...
...
@@ -98,7 +98,6 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
break
}
//@ts-ignore
getFn
(
param
,
{
headers
}).
then
(
res
=>
{
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
...
...
src/utils/cryptoAes.ts
View file @
7418f22f
import
CryptoJS
from
'crypto-js'
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
'GzSsyLingxi2.0.0'
);
const
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
'GzSsyLingxi2.0.0'
);
// var iv = CryptoJS.enc.Utf8.parse('JlM6cyqmrC2zKNsx');
/**
...
...
@@ -8,8 +8,8 @@ var key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0');
* 加密方法
*/
export
const
encryptedByAES
=
(
source
:
string
)
=>
{
var
password
=
CryptoJS
.
enc
.
Utf8
.
parse
(
source
);
var
encrypted
=
CryptoJS
.
AES
.
encrypt
(
password
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
//CryptoJS.pad.Pkcs7
const
password
=
CryptoJS
.
enc
.
Utf8
.
parse
(
source
);
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
password
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
//CryptoJS.pad.Pkcs7
return
encrypted
.
toString
()
// 加密后的base64
}
...
...
@@ -18,6 +18,6 @@ export const encryptedByAES = (source: string) => {
* 解密方法
*/
export
const
decryptedByAES
=
(
source
:
string
)
=>
{
var
decrypted
=
CryptoJS
.
AES
.
decrypt
(
source
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
//CryptoJS.pad.Pkcs7
const
decrypted
=
CryptoJS
.
AES
.
decrypt
(
source
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
});
//CryptoJS.pad.Pkcs7
return
decrypted
.
toString
(
CryptoJS
.
enc
.
Utf8
)
// 解密后的原始字符串
}
\ No newline at end of file
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