Commit fca796b1 authored by XieZhiXiong's avatar XieZhiXiong

feat: 处理积分订单价格展示问题

parent 878264a5
......@@ -646,3 +646,10 @@ export const h5PageAddressByScan = 'http://download-h5.shushangyun.com:13880/dow
/** 需要app扫码 访问拼团详情链接地址 */
export const groupDetailByScan = 'http://pt-h5.shushangyun.com:13880/'
/**
* 判断订单类型是否是积分订单
* @param orderType 订单类型 number
* @returns
*/
export const checkIsPointsOrder = (orderType: number) => orderType === ORDER_TYPE_POINTS || orderType === ORDER_TYPE_CHANNEL_POINTS;
......@@ -102,6 +102,7 @@
/** other */
'common.money':'$',
'common.money.yuan':'yuan',
'common.currency.points': 'points',
'common.weizhiyonghu': 'Unknown user',
'common.xiugaimima': 'Change the password',
'common.tuichudenglu': 'Log out',
......
......@@ -102,6 +102,7 @@ export default {
/** 其他 */
'common.money': '₩',
'common.money.yuan': '원.',
'common.currency.points': '점',
'common.weizhiyonghu': '알 수 없는 사용자',
'common.xiugaimima': '비밀번호 변경',
'common.tuichudenglu': '로그아웃',
......
......@@ -102,6 +102,7 @@ export default {
/** 其他 */
'common.money': '¥',
'common.money.yuan': '元',
'common.currency.points': '积分',
'common.weizhiyonghu': '未知用户',
'common.xiugaimima': '修改密码',
'common.tuichudenglu': '退出登录',
......
......@@ -3,7 +3,9 @@
*/
import React from 'react';
import { getIntl } from 'umi';
import { checkIsPointsOrder } from '@/constants/order';
import styles from './index.less';
const intl = getIntl();
export type EtProductInfoType = {
......@@ -46,10 +48,14 @@ interface EtProductInfoProps {
* 值
*/
value: EtProductInfoType,
/**
* 订单类型
*/
orderType: number,
}
const EtProductInfo = (props: EtProductInfoProps) => {
const { value } = props;
const { value, orderType } = props;
return (
<div className={styles['et-product']}>
......@@ -59,9 +65,9 @@ const EtProductInfo = (props: EtProductInfoProps) => {
<div className={styles['et-product-right']}>
<div className={styles['et-product-title']}>{value.productName}</div>
<div className={styles['et-product-price']}>
{`${intl.formatMessage({id: 'common.money'})} ${value.totalPrice}`}
{`${!checkIsPointsOrder(orderType) ? intl.formatMessage({id: 'common.money'}) : ''} ${value.totalPrice} ${checkIsPointsOrder(orderType) ? intl.formatMessage({id: 'common.currency.points'}) : ''}`}
<span className={styles['et-product-desc']}>
{`${intl.formatMessage({id: 'common.money'})} ${value.price}/${value.unit || ''},`}
{`${!checkIsPointsOrder(orderType) ? intl.formatMessage({id: 'common.money'}) : ''} ${value.price}${checkIsPointsOrder(orderType) ? intl.formatMessage({id: 'common.currency.points'}) : ''}/${value.unit || ''},`}
{intl.formatMessage({id: 'common.text.common'})} {value.purchaseCount || ''}
{value.unit || ''}
</span>
......
......@@ -87,6 +87,10 @@ interface EvaluationFormProps {
* 是否显示解释,默认 false
*/
interpretation?: boolean,
/**
* 订单类型
*/
orderType: number,
}
export interface EvaluationFormRefHandle {
......@@ -100,44 +104,10 @@ export interface EvaluationFormRefHandle {
const EvaluationForm: React.ForwardRefRenderFunction<EvaluationFormRefHandle, EvaluationFormProps> = (props: EvaluationFormProps, ref) => {
const {
ediabled,
value = {
comments: [
{
good: {
orderProductId: 5869,
pic: "https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/QQ截图20180529111140cde1d92dc3e847bbad66a2347619c809.png",
price: 20,
productId: 957,
productName: "副单位商品-有阶梯+无阶梯",
purchaseCount: 2,
totalPrice: 40,
unit: "台",
},
smile: 4,
star: 4,
comment: '111111111',
picture: [],
},
{
good: {
orderProductId: 5869,
pic: "https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/QQ截图20180529111140cde1d92dc3e847bbad66a2347619c809.png",
price: 20,
productId: 957,
productName: "副单位商品-有阶梯+无阶梯",
purchaseCount: 2,
totalPrice: 40,
unit: "台",
},
smile: 3,
star: 3,
comment: '22222222',
picture: [],
}
]
},
value,
onSubmit,
interpretation = false,
orderType,
} = props;
const [unsaved, setUnsaved] = useState(false);
......@@ -215,6 +185,7 @@ const EvaluationForm: React.ForwardRefRenderFunction<EvaluationFormRefHandle, Ev
<FormItem
name={`comments.${index}.good`}
component={EtProductInfo}
orderType={orderType}
/>
</Col>
<Col>
......
......@@ -21,6 +21,7 @@ interface OrderInfo {
orderNo: string,
dealTime: string,
memberName: string,
orderType: number,
};
const ReceivedDetail: React.FC = () => {
......@@ -58,6 +59,7 @@ const ReceivedDetail: React.FC = () => {
orderNo: res.data?.orderNo,
dealTime: res.data?.dealTime as string,
memberName: res.data?.memberName,
orderType: res.data?.orderType,
});
}
}).catch((err) => {
......@@ -110,6 +112,7 @@ const ReceivedDetail: React.FC = () => {
comments: evaluationInfo,
}}
ediabled={false}
orderType={orderInfo?.orderType}
/>
</PageHeaderWrapper>
</Spin>
......
......@@ -22,6 +22,7 @@ interface OrderInfo {
orderNo: string,
dealTime: string,
memberName: string,
orderType: number,
};
interface PurchaserEvaluationInfoProps {
......@@ -76,6 +77,7 @@ const PurchaserEvaluationInfo: React.FC<PurchaserEvaluationInfoProps> = ({
orderNo: res.data?.orderNo,
dealTime: res.data?.dealTime as string,
memberName: res.data?.memberName,
orderType: res.data?.orderType,
});
}
}).catch((err) => {
......@@ -182,6 +184,7 @@ const PurchaserEvaluationInfo: React.FC<PurchaserEvaluationInfoProps> = ({
ref={EvaluationFormRef}
onSubmit={handleSubmit}
ediabled={ediabled}
orderType={orderInfo?.orderType}
/>
</PageHeaderWrapper>
</Spin>
......
......@@ -142,6 +142,7 @@ const PurchaserEvaluateOrder: React.FC = () => {
}}
ref={EvaluationFormRef}
onSubmit={handleSubmit}
orderType={orderInfo?.orderType}
ediabled
/>
</PageHeaderWrapper>
......
......@@ -9,6 +9,7 @@ import moment from 'moment';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getMemberOrderCommentBuyerPage } from '@/services/MemberV2Api';
import { checkIsPointsOrder } from '@/constants/order';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
......@@ -55,7 +56,7 @@ const Unevaluated: React.FC = () => {
title: intl.formatMessage({ id: 'purchaserEvaluation.dingdanzonge' }),
dataIndex: 'totalAmount',
align: 'center',
render: (text) => `${intl.formatMessage({ id: 'common.money' })}${text}`,
render: (text, record) => !checkIsPointsOrder(record.orderType) ? `${intl.formatMessage({id: 'common.money'})}${text}` : `${text}${intl.formatMessage({id: 'common.currency.points'})}`,
},
{
title: intl.formatMessage({ id: 'purchaserEvaluation.dingdanleixing' }),
......
......@@ -21,6 +21,7 @@ interface OrderInfo {
orderNo: string,
dealTime: string,
memberName: string,
orderType: number,
};
const SupplierReceivedDetail: React.FC = () => {
......@@ -62,6 +63,7 @@ const SupplierReceivedDetail: React.FC = () => {
orderNo: res.data.orderNo,
dealTime: res.data.dealTime as string,
memberName: res.data.memberName,
orderType: res.data.orderType,
});
}
}).catch((err) => {
......@@ -114,6 +116,7 @@ const SupplierReceivedDetail: React.FC = () => {
comments: evaluationInfo,
}}
ediabled={false}
orderType={orderInfo?.orderType}
interpretation
/>
</PageHeaderWrapper>
......
......@@ -21,6 +21,7 @@ interface OrderInfo {
orderNo: string,
dealTime: string,
memberName: string,
orderType: number,
};
interface SupplierEvaluationInfoProps {
......@@ -74,6 +75,7 @@ const SupplierEvaluationInfo: React.FC<SupplierEvaluationInfoProps> = ({
orderNo: res.data.orderNo,
dealTime: res.data.dealTime as string,
memberName: res.data.memberName,
orderType: res.data.orderType,
});
}
}).catch((err) => {
......@@ -182,6 +184,7 @@ const SupplierEvaluationInfo: React.FC<SupplierEvaluationInfoProps> = ({
ref={EvaluationFormRef}
onSubmit={handleSubmit}
ediabled={ediabled}
orderType={orderInfo?.orderType}
/>
</PageHeaderWrapper>
</Spin>
......
......@@ -141,6 +141,7 @@ const SupplierEvaluateOrder: React.FC = () => {
}}
ref={EvaluationFormRef}
onSubmit={handleSubmit}
orderType={orderInfo?.orderType}
ediabled
/>
</PageHeaderWrapper>
......
......@@ -9,6 +9,7 @@ import moment from 'moment';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getMemberOrderCommentVendorPage } from '@/services/MemberV2Api';
import { checkIsPointsOrder } from '@/constants/order';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
......@@ -55,7 +56,7 @@ const Unevaluated: React.FC = () => {
title: intl.formatMessage({id: 'supplierEvaluation.dingdanzonge'}),
dataIndex: 'totalAmount',
align: 'center',
render: (text) => `${intl.formatMessage({id: 'common.money'})}${text}`,
render: (text, record) => !checkIsPointsOrder(record.orderType) ? `${intl.formatMessage({id: 'common.money'})}${text}` : `${text}${intl.formatMessage({id: 'common.currency.points'})}`,
},
{
title: intl.formatMessage({id: 'supplierEvaluation.dingdanleixing'}),
......
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