Commit 15fbcfd4 authored by Bill's avatar Bill

fix: 修改装修以及结算

parent 65426d1d
......@@ -575,4 +575,5 @@ export default {
'balance.jisongriqi': '寄送日期',
'balance.fapiaohaoma': '发票号码',
'balance.querenduizhangdan': '确认对账单',
'balance.woyifukuan': '我已付款'
}
......@@ -38,6 +38,7 @@ const OtherPayModal: React.FC<Iprops> = (props: Iprops) => {
const {visible, balanceInfo, onConfirm, onClose, confirmLoading} = props;
const [payChannelOptions, setPayChannelOptions] = useState<{label: string, value: number}[]>([]);
const [activeChannel, setActiveChannel] = useState<number | null>(null);
const [flag, setFlag] = useState(0);
const handleClose = () => {
onClose?.()
......@@ -74,6 +75,7 @@ const OtherPayModal: React.FC<Iprops> = (props: Iprops) => {
if (!visible) {
return;
}
setFlag(0);
getPayChannel()
}, [visible])
......@@ -82,6 +84,7 @@ const OtherPayModal: React.FC<Iprops> = (props: Iprops) => {
}
const handleOnOk = () => {
setFlag(1)
onConfirm?.({
payChannel: activeChannel
})
......@@ -93,7 +96,7 @@ const OtherPayModal: React.FC<Iprops> = (props: Iprops) => {
title={intl.formatMessage({id: 'balance.fukuan'})}
onCancel={handleClose}
visible={visible}
okText={intl.formatMessage({id: 'balance.quedingfukuan'})}
okText={flag === 1 ? intl.formatMessage({id: 'balance.woyifukuan'}) : intl.formatMessage({id: 'balance.quedingfukuan'})}
onOk={handleOnOk}
confirmLoading={confirmLoading}
>
......
......@@ -58,6 +58,8 @@ type ModalsType = {
qrcodeModal: boolean,
/** 获取短信验证码 */
smsCodeModal: boolean,
/** 网银支付,标志位,没有弹窗 */
unionPay: boolean,
}
function useHandleSettlementList() {
......@@ -71,9 +73,10 @@ function useHandleSettlementList() {
universalPay: false,
qrcodeModal: false,
smsCodeModal: false,
unionPay: false
})
/** 这里不对其他key 做限制,即可存在多个为true的时候 */
const handleOpen = useCallback((key: keyof ModalsType) => {
setModals({
...modals,
......
......@@ -170,24 +170,24 @@ const SettlementList = () => {
return;
}
handleClose('smsCodeModal');
formActions.submit();
setTimeout(() => {
formActions.submit();
}, 1500)
}
/** 通联支付, 付款 */
const handleUniversalPay = async (params: {payChannel: number}) => {
// 如果是网银支付
if (modals.unionPay) {
handleClose('universalPay')
handleClose('unionPay')
formActions.submit();
return;
}
const channel = params.payChannel;
try {
setUniversalPayLoading(true)
const res = await getSettleAccountsMemberSettlementGetCommunicationPayTradeNo({
id: itemInfo.id.toString()
})
if (res.code !== 1000) {
message.error(res.message);
return;
}
setRandomCode(res.data);
// TODO 加一个随机数
const { data, code, message: msg } = await postSettleAccountsMemberSettlementCommunicationPay({
id: itemInfo.id,
payChannelType: params.payChannel,
......@@ -197,6 +197,7 @@ const SettlementList = () => {
return;
}
setCurrentUniversalPay(channel as UniversalPay);
if ([UNIVERSAL_PAY_WECHAT, UNIVERSAL_PAY_ALIPAY].includes(channel)) {
message.loading({
......@@ -209,6 +210,16 @@ const SettlementList = () => {
}
// 快捷支付 或者 余额支付
if (channel === UNIVERSAL_PAY_QUICK || channel === UNIVERSAL_PAY_BALANCE) {
// TODO 加一个随机数
const res = await getSettleAccountsMemberSettlementGetCommunicationPayTradeNo({
id: itemInfo.id.toString()
})
if (res.code !== 1000) {
message.error(res.message);
return;
}
setRandomCode(res.data);
handleClose('universalPay');
handleOpen('smsCodeModal')
// handleOpen()
......@@ -216,6 +227,7 @@ const SettlementList = () => {
}
if (channel === UNIVERSAL_PAY_UNION) {
handleOpen('unionPay')
window.open(data);
}
......
......@@ -227,7 +227,7 @@ const MemberSettleAdd: React.FC = () => {
active: res.data.settlementWay,
otherValues: [res.data.settlementDays, res.data.settlementDate],
},
settlementPaymentType: res.data.settlementOrderType.toString(),
settlementPaymentType: res.data.settlementPaymentType,
})
const list = res.data.memberList.map((item) => ({
...item,
......
......@@ -95,13 +95,13 @@ const template = {
*/
const mallLayoutConfig: PageConfigType = {
"0": {
"componentName": "MallLayout",
"componentName": "div",
title: intl.formatMessage({ id: 'editor.node.tree' }),
"props": {
"style": {
"width": "100%",
"minHeight": "100%",
// "background": "#DD3041",
"background": "#f9f9f9",
"overflowX": "hidden",
"paddingBottom": "50px",
}
......
import React from 'react';
import Container from '../Container';
import { useIntl } from 'umi'
import { getIntl } from 'umi'
const intl = getIntl();
const ProductContainer = (props) => {
const { children, status } = props;
const intl = useIntl()
const listStyle = {
marginRight: '-8px',
......
import React, { useEffect } from 'react';
import { SimpleCommodity, CustomizeTag } from '@linkseeks/design-ui';
import cs from 'classnames';
import { useIntl } from 'umi'
import { getIntl } from 'umi'
import { PlusOutlined } from '@ant-design/icons';
import styles from './simple.less';
import Container from '../Container';
import { useSelector, getIframe, getSelectedNode } from '@linkseeks/design-react';
const intl = getIntl()
interface Iprops {
children: React.ReactElement,
title: string,
......@@ -46,7 +47,6 @@ const scrollNode = (key: string) => {
const SimpleCommodityList: React.FC<Iprops> & { Item: typeof SimpleItem } = (props: Iprops) => {
// console.log(props);
const { children, title, status } = props;
const intl = useIntl()
const cardProps = {
title: title || intl.formatMessage({ id: 'editor.setting.form.title' }),
headStyle: {
......@@ -120,7 +120,6 @@ const SimpleItem: React.FC<IsimpleItemprops> = (props: IsimpleItemprops | Isimpl
const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver
};
const intl = useIntl()
const rest = sale ? { footer: <CustomizeTag mode="doubleColor" background="#FFF0F2" color="#EF3346">{intl.formatMessage({ id: 'editor.category.month.sales' })}{sale}{intl.formatMessage({ id: 'common.text.unit.piece', defaultMessage: '件'})}</CustomizeTag> } : { originalPrice: price };
const wrapClass = cs(className, styles.simple);
......
......@@ -6,8 +6,8 @@ import CustomLayouts from '../../components/Layouts';
// import MobileQuickNav from '@/pages/pageCustomized/configs/componentConfigs/LingXiUI/MobileQuickNav';
const componentSchemasMap = { ...schema, ...HTML };
const originalComponents = { ...LxUI, ...CustomLayouts };
const componentSchemasMap = { ...schema, ...HTML };
// /**
// * 容器组件分类
......@@ -25,7 +25,7 @@ const originalComponents = { ...LxUI, ...CustomLayouts };
*/
const config: ConfigType = {
componentsMap: originalComponents,
componentSchemasMap: componentSchemasMap,
componentSchemasMap: componentSchemasMap as any,
};
export default config;
......@@ -116,6 +116,16 @@ const WrapCommodityList = {
}
};
/** 组合出校 */
const Combination = {
Combination: {
propsConfig: {}
},
'Combination.Item': {
propsConfig: {}
}
}
const MallLayout = {
propsConfig: {},
}
......@@ -133,7 +143,6 @@ const CustomizeTabs = {
export default {
MallLayout,
Commodity,
WrapCommodityList,
Advertisement,
View,
HeaderNav,
......@@ -141,4 +150,6 @@ export default {
...Coupon,
...MarketingCard,
...CommodityList,
...WrapCommodityList,
...Combination,
};
......@@ -366,7 +366,7 @@ function useGetLayout() {
}
pageConfig = {
0: {
"componentName": "MallLayout",
"componentName": "div",
title: `${intl.formatMessage({ id: 'marketingAbility.zujianshu'})}`,
"props": {
"style": {
......
.combiantion {
margin-top: 24px;
padding: 0 8px;
.title {
font-size: 20px;
color: #fff;
padding: 4px 0;
line-height: 20px;
}
.container {
background-color: #fff;
min-height: 200px;
border-radius: 8px;
// margin-left: -12px;
.wrap {
padding: 12px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-right: -12px;
}
}
}
.empty {
align-items: center;
justify-content: center;
}
.simple {
width: 33.3%;
height: 150px;
padding-right: 12px;
// background-color: red;
display: flex;
.wrapClass {
height: 100%;
width: 100%;
}
}
import React from 'react';
import styles from './index.less';
import { SimpleCommodity, CustomizeTag } from '@linkseeks/design-ui';
import cx from 'classnames';
import { PlusOutlined } from '@ant-design/icons';
interface Iprops {
children,
className: string
title: string,
visible?: boolean,
theme: number
}
const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props: Iprops) => {
const { children, className, title, theme, visible = true, ...other } = props;
const classNameStr = cx(styles.combiantion, className, { [styles.hide]: !visible });
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState } = other as any;
const renderChildren = () => {
return (
<div className={styles.wrap}>
{
React.Children.map(children, (_child: any) => {
if (_child === null) {
return null;
}
return React.cloneElement(_child, {..._child?.props || {}, customizeClassName: styles.commodityItem });
})
}
</div>
);
};
return (
<div className={classNameStr} {...other}>
<p className={styles.title}>{title}</p>
<div className={styles.container}>
{renderChildren()}
</div>
</div>
)
}
const CombinationItem: React.FC<any> = (props: any) => {
const { productImgUrl, discount, price, footer, sale, productName, id, activityPrice } = props as any;
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState, className } = props as any;
const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver
};
// const wrapClass = cx(styles.simple);
const wrapClass = cx(styles.section, className)
const isEmpty = typeof productName === 'undefined' && typeof id === 'undefined';
if (isEmpty) {
return (
<div className={cx(styles.simple, styles.empty)} >
<div className={wrapClass} {...divProps}>
<PlusOutlined />
</div>
</div>
);
}
const simpleData = {
productName: "",
image: productImgUrl,
// price: price,
// discount: (props as IsimpleProductItemProps).min || activityPrice,
};
return (
<div className={styles.simple}>
<div className={wrapClass} {...divProps}>
<SimpleCommodity {...simpleData} />
</div>
</div>
);
};
Combination.Item = CombinationItem
export default Combination;
......@@ -107,7 +107,8 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => {
};
const { productName: name, productImgUrl: image, mode = "horizontal", price: originalPrice, discount, activityPrice, label, ...otherRestProps } = rest as any;
const withLabel = label ? {label: [label]} : {};
const withLabel = label ? {tags: [label]} : {};
console.log(rest);
const horizontalData = {
name,
image,
......@@ -249,5 +250,6 @@ CommodityList.CommodityTab = CommodityGroup;
CommodityList.SwapCoupon = SwapCoupon;
CommodityList.SwapProduct = SwapProduct;
// CommodityList.
export default CommodityList;
......@@ -7,13 +7,13 @@ import cs from 'classnames';
import styles from './swapCoupon.less';
import Tabbar from './tabbar';
import TabFooter from './tabFooter';
import { useIntl} from 'umi'
import { getIntl } from 'umi'
const intl = getIntl();
const { TabPane } = Tabs;
const SwapCoupon = (props) => {
const intl = useIntl();
// const intl = useIntl();
const { className, ...other } = props;
const [activeKey, setActiveKey] = useState<string>("1");
const restProps = omit(other, ["getOperateState", "onClick", "onDrag", "onDragEnd", "onDragEnter", "onDragStart", "onMouseOver", "draggable"]);
......
......@@ -7,13 +7,13 @@ import cs from 'classnames';
import styles from './swapProduct.less';
import Tabbar from './tabbar';
import TabFooter from './tabFooter';
import { useIntl} from 'umi'
// import { useIntl} from 'umi'
import { getIntl } from 'umi'
const intl = getIntl();
const { TabPane } = Tabs;
const SwapProduct = (props) => {
const intl = useIntl();
const { className, ...other } = props;
const [activeKey, setActiveKey] = useState<string>("1");
const restProps = omit(other, ["getOperateState", "onClick", "onDrag", "onDragEnd", "onDragEnter", "onDragStart", "onMouseOver", "draggable"]);
......
......@@ -2,10 +2,12 @@ import Advertisement from './Advertisement';
import Coupon from './Coupon';
import CommodityList from './CommodityList';
import WrapCommodityList from './WrapCommodityList';
import Combination from './Combination';
export default {
Advertisement,
Coupon,
CommodityList,
WrapCommodityList
WrapCommodityList,
Combination
};
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