Commit 1d39ff57 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 6f97f07e f59ae35c
......@@ -5,8 +5,7 @@ import godEvent from '@/utils/event'
import { RiskCheck } from 'god';
import { decryptedByAES, encryptedByAES } from '@/utils/cryptoAes';
import { getMemberCaptcha, getMemberRegisterPhoneCheck, postMemberRegisterPswSms, postMemberRegisterSms } from '@/services/MemberV2Api';
import { getIntl } from 'umi';
const intl = getIntl();
import { useIntl } from 'umi';
// 滑块尺寸
const FLAG_SIZE = 60
const IMG_WIDTH = 352
......@@ -18,6 +17,7 @@ const prefixCode = '+86'
const Phone = (props) => {
const { value, form, schema } = props
const intl = useIntl();
const {text, isActive, start} = useCountDown({
maxTime: 60,
minTime: 0,
......@@ -212,7 +212,7 @@ const Phone = (props) => {
yPoint={remoteImg.y}
shadowSize={FLAG_SIZE}
differ={10}
tipText={intl.formatMessage({ id: 'component.riskCheckTips', defaultMessage: '' })}
tipText={intl.formatMessage({ id: 'components.riskCheckTips', defaultMessage: '' })}
onSuccess={handleCheckSuccess}
/>
</Modal>
......
......@@ -39,7 +39,7 @@ const FormilyRangeTime: React.FC<Iprops> = (props: Iprops) => {
};
return (
<div>
<div style={{ width: '100%' }}>
<RangeTime disabled={!editable} rangeTime={momentValue} onChange={onChange} {...componentProps} />
{
hasError && (
......
......@@ -95,9 +95,9 @@ const RangeTime: React.FC<Iprops> = (props: Iprops) => {
}
if (partial === 'end') {
return {
disabledHours: () => range(0, 24).splice(0, startTime.get('hour')),
disabledMinutes: () => range(0, 60).splice(0, current && current.isSame(startTime, 'hour') ? startTime.get('minute') : 0),
disabledSeconds: () => range(0, 60).splice(0, current && current.isSame(startTime, 'hour') && current.isSame(startTime, 'minute') ? startTime.get('second') + 1 : 0),
disabledHours: () => range(0, 24).splice(0, startTime?.get('hour')),
disabledMinutes: () => range(0, 60).splice(0, current && current.isSame(startTime, 'hour') ? startTime?.get('minute') : 0),
disabledSeconds: () => range(0, 60).splice(0, current && current.isSame(startTime, 'hour') && current.isSame(startTime, 'minute') ? startTime?.get('second') + 1 : 0),
};
}
return {};
......
......@@ -60,6 +60,9 @@ import korenImg from '../../../mockStatic/koren.png'
import us from '../../../mockStatic/us.png'
import '../styles/SelectLang.less'
import { getCookie, removeCookie } from '@/utils/cookie'
import { getTopDomainByHost } from '@/utils'
import { TOP_DOMAIN_NO_PORT } from '@/constants'
interface countryItem {
name: string,
......@@ -69,9 +72,14 @@ interface countryItem {
const HeaderDropdown: React.FC = () => {
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const [currentLangKey, setCurrentLangKey] = useState<string>('cn')
const [currentLangKey, setCurrentLangKey] = useState<string>('cn');
const locales = getCookie('locales');
useEffect(() => {
console.log(getLocale(), "locale")
if (locales) {
setLocale(locales as any, true);
removeCookie('locales', { path: '/', domain: getTopDomainByHost(TOP_DOMAIN_NO_PORT, true) })
}
setCurrentLangKey(getLocale())
}, [])
......
......@@ -34,6 +34,7 @@ import balance from './en-US/balance'
import processRuleSetting from './en-US/system/processRuleSetting'
import afterService from './en-US/afterService';
import marketing from './en-US/marketing'
import responseCode from './en-US/responseCode'
export default {
'global.siteName': '瓴犀',
......@@ -73,4 +74,5 @@ export default {
...afterService,
...balance,
...marketing,
...responseCode,
}
......@@ -211,6 +211,7 @@ export default {
'afterService.apply.pickupAddress-replace.required':'Please select the replacement pickup address',
'afterService.apply.purchaser.nothing':'Please select purchasing member first',
'afterService.apply.purchaser':'Purchasing member',
'afterService.apply.purchaser.placeholder': 'Please enter the name of the purchasing member',
'afterService.apply.repairCount':'Repair Quantity',
'afterService.apply.repairCount.required':'Please fill in the repair quantity',
'afterService.apply.repairCount.legal':'Please fill in a positive number and keep up to 3 decimal places',
......
This diff is collapsed.
......@@ -34,6 +34,7 @@ import balance from './ko-KR/balance'
import processRuleSetting from './ko-KR/system/processRuleSetting'
import afterService from './ko-KR/afterService';
import marketing from './ko-KR/marketing'
import responseCode from './ko-KR/responseCode'
export default {
'global.siteName': '瓴犀',
......@@ -73,4 +74,5 @@ export default {
...afterService,
...balance,
...marketing,
...responseCode,
}
......@@ -211,6 +211,7 @@ export default {
'afterService.apply.pickupAddress-replace.required': '교환 인수 주소 선택',
'afterService.apply.purchaser.nothing': '먼저 구매 회원을 선택하세요',
'afterService.apply.purchaser': '구매 회원',
'afterService.apply.purchaser.placeholder': '구매 회원 명칭을 입력하세요',
'afterService.apply.repairCount': '수리 수량',
'afterService.apply.repairCount.required': '수리 수량을 기입해 주십시오',
'afterService.apply.repairCount.legal': '정수를 기입하시고, 최대 3자리의 소수를 보존하십시오',
......
This diff is collapsed.
......@@ -34,6 +34,7 @@ import balance from './zh-CN/balance'
import processRuleSetting from './zh-CN/system/processRuleSetting'
import afterService from './zh-CN/afterService';
import marketing from './zh-CN/marketing'
import responseCode from './zh-CN/responseCode'
export default {
'global.siteName': '瓴犀',
......@@ -73,4 +74,5 @@ export default {
...afterService,
...balance,
...marketing,
...responseCode,
}
......@@ -211,6 +211,7 @@ export default {
'afterService.apply.pickupAddress-replace.required': '请选择换货自提地址',
'afterService.apply.purchaser.nothing': '请先选择采购会员',
'afterService.apply.purchaser': '采购会员',
'afterService.apply.purchaser.placeholder': '请输入采购会员名称',
'afterService.apply.repairCount': '维修数量',
'afterService.apply.repairCount.required': '请填写维修数量',
'afterService.apply.repairCount.legal': '请填写正数,最多保留3位小数',
......
This diff is collapsed.
......@@ -75,6 +75,7 @@ export const addSchema = (orderType: number): ISchema => {
title: intl.formatMessage({ id: 'afterService.apply.purchaser' }, { default: '采购会员' }),
enum: [],
'x-component-props': {
placeholder: intl.formatMessage({ id: 'afterService.apply.purchaser.placeholder' }, { default: '请输入采购会员名称' }),
showSearch: true,
defaultActiveFirstOption: false,
showArrow: false,
......
import { useIntl } from 'umi';
/*
* @Author: XieZhiXiong
* @Date: 2021-06-25 14:43:51
......@@ -7,6 +6,7 @@ import { useIntl } from 'umi';
* @Description: formily 品牌列表
*/
import React from 'react';
import { useIntl } from 'umi';
import { Row, Col, Button } from 'antd';
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
import { ArrayList } from '@formily/react-shared-components';
......
import { useIntl } from 'umi';
/*
* @Author: XieZhiXiong
* @Date: 2021-06-25 11:34:36
......@@ -7,6 +6,7 @@ import { useIntl } from 'umi';
* @Description: 会员方块复选框
*/
import React, { useState, useEffect, useRef } from 'react';
import { useIntl } from 'umi';
import { Checkbox, Row, Col, Button } from 'antd';
import classNames from 'classnames';
import { checkMore } from '@/utils';
......@@ -96,7 +96,6 @@ export type MemberCheckboxGroupProps = {
};
const MemberCheckboxGroup: React.FC<MemberCheckboxGroupProps> = (props) => {
const intl = useIntl();
const {
options,
value: outerValue,
......@@ -116,6 +115,8 @@ const MemberCheckboxGroup: React.FC<MemberCheckboxGroupProps> = (props) => {
const sizeRef = useRef<number>(PAGE_SIZE);
const hasMoreRef = useRef<boolean>(true);
const intl = useIntl();
const getOptions: () => Promise<ResponseType> = () => {
if (fetchOptions) {
if (!hasMoreRef.current) {
......
......@@ -6,14 +6,13 @@
* @Description: 适用商品 Form Item
*/
import React, { useState } from 'react';
import { useIntl } from 'umi';
import { Button, message } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import PolymericTable, { EditableColumns } from '@/components/PolymericTable';
import { normalizeUnitPrice } from '../../../utils';
import GoodsDrawer, { ProductItemType } from '../GoodsDrawer';
import styles from './index.less';
import { getIntl} from 'umi'
const intl = getIntl();
const ApplicableGoodsFormItem = (props) => {
const {
......@@ -25,6 +24,8 @@ const ApplicableGoodsFormItem = (props) => {
const [visibleGoodsDrawer, setVisibleGoodsDrawer] = useState(false);
const intl = useIntl();
const handleDelete = (id: number) => {
const newData = [...value];
const index = value.findIndex((item) => item.id === id);
......
......@@ -7,7 +7,6 @@
*/
import React from 'react';
import { Cascader } from 'antd';
import { CascaderValueType } from 'antd/lib/cascader';
const CascaderFormItem = (props) => {
const {
......@@ -16,7 +15,7 @@ const CascaderFormItem = (props) => {
editable,
} = props;
const handleChange = (next: CascaderValueType) => {
const handleChange = (next: React.Key[]) => {
mutators.change(next);
};
......
......@@ -6,6 +6,7 @@
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
import { getIntl } from 'umi';
import moment from 'moment';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
......@@ -23,7 +24,6 @@ import {
SUITABLE_TYPE_NEW_MEMBER,
SUITABLE_TYPE_OLD_MEMBER,
} from '@/constants/marketing';
import { useIntl} from 'umi'
const {
onFieldInputChange$,
......@@ -32,7 +32,7 @@ const {
export const useBusinessEffects = (context, actions: IFormActions) => {
const { getFieldValue, setFieldState, setFieldValue, getFieldState } = actions;
const intl = useIntl();
const intl = getIntl();
const linkage = useLinkageUtils();
......
......@@ -10,7 +10,7 @@ import { Spin, Button, message } from 'antd';
import { DeleteOutlined, SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { Radio, DatePicker, ArrayTable } from '@formily/antd-components';
import { history, Prompt } from 'umi';
import { history, Prompt, useIntl } from 'umi';
import moment from 'moment';
import {
MERCHANT_COUPON_TYPE_UNIVERSAL,
......@@ -19,6 +19,7 @@ import {
MERCHANT_COUPON_TYPE_PRODUCT,
MERCHANT_COUPON_TYPE_VOUCHER,
} from '@/constants/marketing';
import { getMarketingCouponWaitAuditGet, postMarketingCouponWaitAuditAdd, postMarketingCouponWaitAuditUpdate } from '@/services/MarketingV2Api';
import AnchorPage from '@/components/AnchorPage';
import NiceForm from '@/components/NiceForm';
import FormilyRangeTime from '@/components/RangeTime/FormilyRangeTime';
......@@ -32,8 +33,6 @@ import MemberCheckboxGroup from '../../../../components/FormilyFieldItem/MemberC
import ApplicableList from '../../../../components/FormilyFieldItem/ApplicableList';
import CategoriesList from '../../../../components/FormilyFieldItem/CategoriesList';
import styles from './index.less';
import { getMarketingCouponWaitAuditGet, postMarketingCouponWaitAuditAdd, postMarketingCouponWaitAuditUpdate } from '@/services/MarketingV2Api';
import { useIntl} from 'umi'
const formActions = createFormActions();
const {
......
import { useIntl } from 'umi';
/*
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57
......@@ -10,7 +9,7 @@ import { ISchema } from '@formily/antd';
import moment from 'moment';
import themeConfig from '@/../config/lingxi.theme.config';
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl} from 'umi'
import { getIntl } from 'umi'
const intl = getIntl();
......
......@@ -16,6 +16,7 @@ export interface AuthInfo extends GetMemberLoginRegetResponse {
creditPoint: number,
memberRoleType: number,
memberRoleId: number,
locales?: string
}
const AUTH_KEY = 'AUTH'
......@@ -32,6 +33,7 @@ export const setAuth = (info: AuthInfo) => {
memberRoleType: info.memberRoleType,
memberRoleId: info.memberRoleId,
memberType: info.memberType,
locales: info.locales,
}
setCookie(AUTH_KEY, JSON.stringify(auth), { domain: TOP_DOMAIN_NO_PORT})
setCookie(AUTH_ROLES_KEY, JSON.stringify(info.roles), { domain: TOP_DOMAIN_NO_PORT })
......
import { extend, ResponseError, OnionOptions, RequestOptionsInit, ResponseInterceptor, OnionMiddleware, Context, RequestMethod } from 'umi-request';
import responseCode from '@/constants/responseCode'
import { IRequestError, IRequestSuccess } from '..';
import { history } from 'umi'
import { getIntl } from 'umi'
import { message } from 'antd'
import { getCookieAuth, removeAuth } from './auth';
import { GlobalConfig } from '@/global/config';
......@@ -25,6 +25,8 @@ export interface IApiRequest extends RequestOptionsInit {
type httpStatus = {
[key: number]: string
}
const intl = getIntl()
const errorMessage: httpStatus = {
400: "发出的请求有错误,服务器没有进行新建或修改数据的操作。",
401: "用户没有权限(令牌、用户名、密码错误)。",
......@@ -142,7 +144,7 @@ class ApiRequest {
if (url != '/member/loginInfo') {
// 这是展示接口错误信息,任何 ctlType 都可以,不然一些 get 请求出错了
// 错误信息无法展示给用户
res.message && message.info(res.message)
res.message && message.info(intl.formatMessage({ id: res.code, defaultMessage: res.message}))
}
}
......
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