Commit 7418f22f authored by GuanHua's avatar GuanHua

feat:对接积分兑换

parent 1281ab95
...@@ -26,7 +26,7 @@ interface CommodityPropsType { ...@@ -26,7 +26,7 @@ interface CommodityPropsType {
} }
interface filterQuery { interface FilterQuery {
current: number; current: number;
pageSize: number; pageSize: number;
name?: string; name?: string;
...@@ -98,7 +98,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => { ...@@ -98,7 +98,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
useEffect(() => { useEffect(() => {
if (userInfo && layoutType === LAYOUT_TYPE.mall) { if (userInfo && layoutType === LAYOUT_TYPE.mall) {
let temp = JSON.parse(JSON.stringify(filterConfig)) const temp = JSON.parse(JSON.stringify(filterConfig))
temp.unshift(FILTER_TYPE.commonlyUsed) temp.unshift(FILTER_TYPE.commonlyUsed)
setFilterConfig(temp) setFilterConfig(temp)
} }
...@@ -108,7 +108,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => { ...@@ -108,7 +108,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
}, [layoutType]) }, [layoutType])
const fetchCommodityList = (currentParam?: number) => { const fetchCommodityList = (currentParam?: number) => {
let param: filterQuery = { let param: FilterQuery = {
current: currentParam ? currentParam : current, current: currentParam ? currentParam : current,
pageSize pageSize
} }
...@@ -149,7 +149,6 @@ const Commodity: React.FC<CommodityPropsType> = (props) => { ...@@ -149,7 +149,6 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
break break
} }
//@ts-ignore
getFn && getFn(param, { headers }).then(res => { getFn && getFn(param, { headers }).then(res => {
setLoading(false) setLoading(false)
if (res.code === 1000) { if (res.code === 1000) {
......
...@@ -37,11 +37,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -37,11 +37,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
}, [mallTemplateId]) }, [mallTemplateId])
const findFirstAdvertsByType = () => { const findFirstAdvertsByType = () => {
let params = { const params: any = {
templateId: mallTemplateId, templateId: mallTemplateId,
type: 1 type: 1
} }
//@ts-ignore
PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => { PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setFirstAdvertList(res.data) setFirstAdvertList(res.data)
...@@ -50,11 +49,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -50,11 +49,10 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
} }
const findSecondAdvertsByType = () => { const findSecondAdvertsByType = () => {
let params = { const params: any = {
templateId: mallTemplateId, templateId: mallTemplateId,
type: 2 type: 2
} }
//@ts-ignore
PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => { PublicApi.getTemplatePlatformFindAdvertsByType(params).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setSecondAdvertList(res.data) setSecondAdvertList(res.data)
...@@ -81,12 +79,11 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -81,12 +79,11 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
*/ */
const fetchCategoryById = (categoryId) => { const fetchCategoryById = (categoryId) => {
return new Promise((resolve) => { return new Promise((resolve) => {
let param = { const param: any = {
templateId: mallTemplateId, templateId: mallTemplateId,
categoryId categoryId
} }
// @ts-ignore
PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => { PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
...@@ -96,12 +93,12 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => { ...@@ -96,12 +93,12 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
} }
const getCategoryComponents = async () => { const getCategoryComponents = async () => {
let result = [] const result = []
let firstCategory: any = await fetchFirstCategory() const firstCategory: any = await fetchFirstCategory()
for (let item of firstCategory) { for (const item of firstCategory) {
if (item.id) { if (item.id) {
let categoryDetail: any = await fetchCategoryById(item.id) const categoryDetail: any = await fetchCategoryById(item.id)
result.push( result.push(
<FloorLine <FloorLine
linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`} linkUrl={`/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
......
...@@ -27,11 +27,6 @@ interface LXMallLayoutPropsType { ...@@ -27,11 +27,6 @@ interface LXMallLayoutPropsType {
SiteStore?: any; SiteStore?: any;
} }
interface queryType {
shopId: number;
memberId: number;
}
const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const { children, location } = props const { children, location } = props
...@@ -56,7 +51,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -56,7 +51,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const getWebMallInfo = () => { const getWebMallInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo const shopInfo = GlobalConfig.web.shopInfo
let webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0] const webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0]
setMallInfo(webMallInfo) setMallInfo(webMallInfo)
} }
...@@ -67,7 +62,6 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -67,7 +62,6 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
}, [query]) }, [query])
const fetchShopInfo = (memberId) => { const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateShopFindShop({ memberId }).then(res => { PublicApi.getTemplateShopFindShop({ memberId }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setShopInfo(res.data) setShopInfo(res.data)
...@@ -79,7 +73,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => { ...@@ -79,7 +73,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
} }
useEffect(() => { useEffect(() => {
let body = document.getElementsByTagName('body')[0]; const body = document.getElementsByTagName('body')[0];
if (shopInfo) { if (shopInfo) {
body.className = shopInfo.fileName ? `theme-shop-${shopInfo.fileName}` : templateName; body.className = shopInfo.fileName ? `theme-shop-${shopInfo.fileName}` : templateName;
} else { } else {
......
...@@ -43,12 +43,12 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => { ...@@ -43,12 +43,12 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
}, [orderInfo, payInfo]) }, [orderInfo, payInfo])
const fetchBalanceInfo = () => { const fetchBalanceInfo = () => {
let param = { const param: any = {
payType: payInfo.ruleConfigurationId, payType: payInfo.ruleConfigurationId,
parentMemberId: orderInfo.supplyMembersId, parentMemberId: orderInfo.supplyMembersId,
parentMemberRoleId: orderInfo.supplyMembersRoleId parentMemberRoleId: orderInfo.supplyMembersRoleId
} }
//@ts-ignore
PublicApi.getPayAssetAccountGetUserBalance(param).then(res => { PublicApi.getPayAssetAccountGetUserBalance(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setBalanceInfo(res.data) setBalanceInfo(res.data)
...@@ -57,8 +57,6 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => { ...@@ -57,8 +57,6 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
setPageLoading(false) setPageLoading(false)
onChange(true, res.message) onChange(true, res.message)
} }
}).catch(() => {
}) })
} }
...@@ -80,14 +78,13 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => { ...@@ -80,14 +78,13 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
message.info("请输入支付密码") message.info("请输入支付密码")
return return
} }
let param = { const param: any = {
id: Number(orderId), id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId), paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId, payTypeId: payInfo.paymentChannelsId,
payPassword: encryptedByAES(payPassword) payPassword: encryptedByAES(payPassword)
} }
setConfirmLoading(true) setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => { PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
message.destroy() message.destroy()
......
...@@ -10,6 +10,7 @@ import { numFormat } from '@/utils/numberFomat' ...@@ -10,6 +10,7 @@ import { numFormat } from '@/utils/numberFomat'
import { linkToUrl } from '../../utils' import { linkToUrl } from '../../utils'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import styles from './index.less' import styles from './index.less'
import { encryptedByAES } from '@/utils/cryptoAes'
import { message, Button, Spin } from 'antd' import { message, Button, Spin } from 'antd'
interface CreditPayWayPropsType { interface CreditPayWayPropsType {
...@@ -43,7 +44,7 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => { ...@@ -43,7 +44,7 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
}, [orderInfo]) }, [orderInfo])
const fetchCreditInfo = () => { const fetchCreditInfo = () => {
let param = { const param: any = {
parentMemberId: orderInfo.supplyMembersId, parentMemberId: orderInfo.supplyMembersId,
parentMemberRoleId: orderInfo.supplyMembersRoleId parentMemberRoleId: orderInfo.supplyMembersRoleId
} }
...@@ -77,14 +78,13 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => { ...@@ -77,14 +78,13 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
message.error("请输入支付密码") message.error("请输入支付密码")
return return
} }
let param = { const param: any = {
id: Number(orderId), id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId), paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId, payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword) payPassword: encryptedByAES(payPassword)
} }
setConfirmLoading(true) setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => { PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
message.destroy() message.destroy()
......
...@@ -47,11 +47,11 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => { ...@@ -47,11 +47,11 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
}, [orderInfo]) }, [orderInfo])
const fetchPointInfo = () => { const fetchPointInfo = () => {
let param = { const param: any = {
memberId: orderInfo.supplyMembersId, memberId: orderInfo.supplyMembersId,
roleId: orderInfo.supplyMembersRoleId roleId: orderInfo.supplyMembersRoleId
} }
//@ts-ignore
PublicApi.getMemberBusinessLrcRightPointGet(param).then(res => { PublicApi.getMemberBusinessLrcRightPointGet(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setPointInfo(res.data) setPointInfo(res.data)
...@@ -60,8 +60,6 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => { ...@@ -60,8 +60,6 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
setPageLoading(false) setPageLoading(false)
onChange(true, res.message) onChange(true, res.message)
} }
}).catch(() => {
}) })
} }
...@@ -83,14 +81,15 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => { ...@@ -83,14 +81,15 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
message.error("请输入支付密码") message.error("请输入支付密码")
return return
} }
let param = { const param: any = {
id: Number(orderId), id: Number(orderId),
relType,
paymentInformationId: Number(payInfo.paymentInformationId), paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId, payTypeId: payInfo.paymentChannelsId,
payPassword: encryptedByAES(payPassword) payPassword: encryptedByAES(payPassword)
} }
setConfirmLoading(true) setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => { PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
message.destroy() message.destroy()
......
import React, { useState, useEffect } from 'react' 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 from '../components/Filter'
import { FILTER_TYPE } from '@/constants' import { FILTER_TYPE } from '@/constants'
import { Pagination } from 'antd' import { Pagination } from 'antd'
...@@ -13,7 +13,7 @@ import { PublicApi } from '@/services/api' ...@@ -13,7 +13,7 @@ import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import cx from 'classnames' import cx from 'classnames'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi' 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' import styles from './index.less'
interface CommodityPropsType { interface CommodityPropsType {
...@@ -23,7 +23,7 @@ interface CommodityPropsType { ...@@ -23,7 +23,7 @@ interface CommodityPropsType {
shopId: number; shopId: number;
} }
interface filterQuery { interface FilterQuery {
current: number; current: number;
pageSize: number; pageSize: number;
name?: string; name?: string;
...@@ -73,7 +73,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => { ...@@ -73,7 +73,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
}, []) }, [])
const fetchCommodityList = (currentParam?: number) => { const fetchCommodityList = (currentParam?: number) => {
let param: filterQuery = { let param: FilterQuery = {
current: currentParam ? currentParam : current, current: currentParam ? currentParam : current,
pageSize pageSize
} }
...@@ -98,7 +98,6 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => { ...@@ -98,7 +98,6 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
break break
} }
//@ts-ignore
getFn(param, { headers }).then(res => { getFn(param, { headers }).then(res => {
setLoading(false) setLoading(false)
if (res.code === 1000) { if (res.code === 1000) {
......
import CryptoJS from 'crypto-js' 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'); // var iv = CryptoJS.enc.Utf8.parse('JlM6cyqmrC2zKNsx');
/** /**
...@@ -8,8 +8,8 @@ var key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0'); ...@@ -8,8 +8,8 @@ var key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0');
* 加密方法 * 加密方法
*/ */
export const encryptedByAES = (source: string) => { export const encryptedByAES = (source: string) => {
var password=CryptoJS.enc.Utf8.parse(source); const 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 encrypted = CryptoJS.AES.encrypt(password, key, {mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}); //CryptoJS.pad.Pkcs7
return encrypted.toString() // 加密后的base64 return encrypted.toString() // 加密后的base64
} }
...@@ -18,6 +18,6 @@ export const encryptedByAES = (source: string) => { ...@@ -18,6 +18,6 @@ export const encryptedByAES = (source: string) => {
* 解密方法 * 解密方法
*/ */
export const decryptedByAES = (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) // 解密后的原始字符串 return decrypted.toString(CryptoJS.enc.Utf8) // 解密后的原始字符串
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment