Commit 917e826b authored by Bill's avatar Bill

fix: 加工物流单, 修改密码页自适应,

parent ae6e3738
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { LogoutOutlined, LockOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import React from 'react';
import { history } from 'umi';
import { history, Link } from 'umi';
import PersonDropdown from './PersonDropdown'
import styles from '../styles/RightContent.less';
import { removeAuth, removeRouters, getAuth } from '@/utils/auth';
......@@ -30,6 +30,9 @@ const AvatarDropdown = () => {
个人设置
</Menu.Item>
<Menu.Divider /> */}
<Menu.Item>
<Link to="/memberCenter/systemSetting/accountSetting"><LockOutlined />修改密码</Link>
</Menu.Item>
<Menu.Item onClick={logout} key="logout">
<LogoutOutlined />
退出登录
......@@ -47,4 +50,4 @@ const AvatarDropdown = () => {
)
}
export default AvatarDropdown
\ No newline at end of file
export default AvatarDropdown
......@@ -30,7 +30,6 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
const ws = useRef<WebSocket | null>(null);
const webSocketInit = useCallback(() => {
console.log(ws.current)
if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
const url = `${SOCKET_URL}/report/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
ws.current = new WebSocket(url);
......@@ -39,8 +38,9 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
}
ws.current.onmessage = (e) => {
console.log(e)
if(e.data.type === NOT_READ_MESSAGE) {
setMessage(e.data.data);
const data = JSON.parse(e.data);
if(data.type === NOT_READ_MESSAGE) {
setMessage(data.data);
}
};
ws.current.onclose = (e) => {
......
import React, { useState, useEffect, useCallback } from 'react';
// import { SchemaForm } from '@formily/antd';
// import { SchemaForm } from '@formily/antd';
import { Form, Input, Row, Col, Button, Select, message, AutoComplete } from 'antd';
import styles from './index.less';
import { StepForwardOutlined, CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
......@@ -7,7 +7,6 @@ import GetCaptchaCode from '../GetCaptchaCode';
import classNames from 'classnames'
import { PublicApi } from '@/services/api';
import phoneRegExp from './utils';
import options from '@/pages/editor/settingsPanel/propsSettings/Animate/config';
const Option = Select.Option;
const EditDataComponent = (props) => {
......@@ -19,7 +18,7 @@ const EditDataComponent = (props) => {
const passwordValidator = async (rule, value) => {
let temp = {}
let length = value && value.length >= 8 && value.length <= 20;
let trim = !(/\s\S+|^\s\S+|\s$/.test(value)) //
let trim = !(/\s\S+|^\s\S+|\s$/.test(value)) //
let compact = /^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*)/.test(value); // 必须含有大小写和数字
temp['length'] = length
temp['trim'] = trim
......@@ -48,7 +47,7 @@ const EditDataComponent = (props) => {
throw new Error("请填写正确的手机号")
}
setCanSandCode(true);
}
}
// 邮箱验证
const emailValidator = async (rule, value) => {
......@@ -69,7 +68,7 @@ const EditDataComponent = (props) => {
}
getAllCountryCode();
}
}, [])
}, [])
// 获取新手机手机验证码
const getCode = () => {
......@@ -82,7 +81,7 @@ const EditDataComponent = (props) => {
const service = SERVICE_CHECK[type];
const postData = (
props.type == 'phone'
? {
? {
countryCode: form.getFieldValue('country'),
phone: form.getFieldValue('newPhone')
}
......@@ -126,7 +125,7 @@ const EditDataComponent = (props) => {
[styles.success]: pwdStatus.length,
})}>{pwdStatus.length ? <CheckCircleOutlined /> : <CloseCircleOutlined/>}</span>
密码长度8-20个字符</p>
<p className={styles.trim}>
<p className={styles.trim}>
<span className={classNames({
[styles.icon]: !pwdStatus.trim,
[styles.success]: pwdStatus.trim,
......@@ -135,13 +134,13 @@ const EditDataComponent = (props) => {
</span>
密码不能包含空格
</p>
<p className={styles.compact}>
<p className={styles.compact}>
<span className={classNames({
[styles.icon]: !pwdStatus.compact,
[styles.success]: pwdStatus.compact,
})}>
{pwdStatus.compact ? <CheckCircleOutlined /> : <CloseCircleOutlined/>}
</span>
</span>
密码必须包含大小写、小写字母和数字
</p>
</div>
......@@ -223,7 +222,7 @@ const EditDataComponent = (props) => {
}
</Select>
</Form.Item>
</Col>
<Col span={14}>
<Form.Item
......@@ -236,7 +235,7 @@ const EditDataComponent = (props) => {
<Input disabled={!inputCanEdit}/>
</Form.Item>
</Col>
</Row>
</Form.Item>
<Form.Item label="验证码">
......@@ -263,4 +262,4 @@ const EditDataComponent = (props) => {
)
}
export default EditDataComponent
\ No newline at end of file
export default EditDataComponent
......@@ -5,12 +5,14 @@
align-items: center;
background-color: #fff;
padding: 36px 24px;
width: 610px;
height: 156px;
width: 100%;
overflow: hidden;
.infos {
display: flex;
flex-direction: row;
align-items: center;
.image {
margin-right: 22px;
......@@ -27,7 +29,7 @@
line-height: 24px;
margin-bottom: 16px;
}
.tips {
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
......@@ -35,14 +37,14 @@
color: #42526E;
line-height: 22px;
margin-bottom: 0;
}
}
}
.controls {
width: 90px;
text-align: right;
// cursor: pointer;
}
}
\ No newline at end of file
}
import React, { useState, useCallback } from 'react';
// import { SchemaForm } from '@formily/antd';
// import { SchemaForm } from '@formily/antd';
import { Form, Input, Button, Row, Col, message } from 'antd';
import SafeVerification from '../../SafeVerification';
import TypeForHeader from '../../TypeForHeader';
......@@ -129,7 +129,7 @@ const EmailVerifyPanel = (props) => {
}
{
visible
? <>
? <>
<EditDataComponent type={pageType} form={form}/>
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
......@@ -144,4 +144,4 @@ const EmailVerifyPanel = (props) => {
)
}
export default EmailVerifyPanel;
\ No newline at end of file
export default EmailVerifyPanel;
import React, {useState} from 'react';
// import { SchemaForm } from '@formily/antd';
// import { SchemaForm } from '@formily/antd';
import { Form, Input, Button, Row, Col, message } from 'antd';
import SafeVerification from '../../SafeVerification';
import EditDataComponent from '../../EditDataComponent';
......@@ -7,6 +7,7 @@ import { PublicApi } from '@/services/api';
import { history } from 'umi'
import { encryptedByAES } from '@/utils/cryptoAes'
const layout = {
labelCol: { span: 3 },
wrapperCol: { span: 13 },
......@@ -18,7 +19,7 @@ const tailLayout = {
interface IProps {
// 当前页面是属于 修改密码还是修改邮箱,还是修改手机
pageType: string,
pageType: string,
}
const PaycodeVerifyPanel: React.FC<IProps> = (props) => {
......@@ -85,7 +86,7 @@ const PaycodeVerifyPanel: React.FC<IProps> = (props) => {
form={form}
onFinish={handleFinish}
>
{
!visible
? <>
......@@ -110,7 +111,7 @@ const PaycodeVerifyPanel: React.FC<IProps> = (props) => {
}
{
visible
? <>
? <>
<EditDataComponent type={pageType} form={form} />
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
......@@ -126,4 +127,4 @@ const PaycodeVerifyPanel: React.FC<IProps> = (props) => {
)
}
export default PaycodeVerifyPanel;
\ No newline at end of file
export default PaycodeVerifyPanel;
import React, { useCallback, useState } from 'react';
// import { SchemaForm } from '@formily/antd';
// import { SchemaForm } from '@formily/antd';
import { Form, Input, Button, Row, Col, message } from 'antd';
import SafeVerification from '../../SafeVerification';
import TypeForHeader from '../../TypeForHeader';
......@@ -21,7 +21,7 @@ const tailLayout = {
interface IProps {
phone: string,
// 当前页面是属于 修改密码还是修改邮箱,还是修改手机
pageType: string,
pageType: string,
}
const PhoneVerifyPanel: React.FC<IProps> = (props) => {
......@@ -129,11 +129,9 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
</>
: null
}
{
visible
? <>
? <>
<EditDataComponent type={pageType} form={form} />
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
......@@ -143,10 +141,10 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
</>
: null
}
</Form>
</div>
)
}
export default PhoneVerifyPanel;
\ No newline at end of file
export default PhoneVerifyPanel;
......@@ -5,7 +5,7 @@ import GetCaptchaCode from '../../GetCaptchaCode';
import SafeVerification from '../../SafeVerification';
import TypeForHeader from '../../TypeForHeader';
import { history } from 'umi'
import { encryptedByAES } from '@/utils/cryptoAes'
const layout = {
labelCol: { span: 3 },
wrapperCol: { span: 13 },
......@@ -18,7 +18,7 @@ const tailLayout = {
interface IProps {
phone: string,
// 当前页面是属于 修改密码还是修改邮箱,还是修改手机
pageType: string,
pageType: string,
}
const ResetPayCode: React.FC<IProps> = (props) => {
......@@ -27,7 +27,7 @@ const ResetPayCode: React.FC<IProps> = (props) => {
const { phone, pageType } = props;
const onFinish = (values) => {
const postData = {
payPassword: values.password
payPassword: encryptedByAES(values.password)
}
// /member/security/pay/update
const service = PublicApi.postMemberSecurityPayUpdate;
......@@ -158,7 +158,7 @@ const ResetPayCode: React.FC<IProps> = (props) => {
}
{
visible
? <>
? <>
{
renderPwd()
}
......@@ -170,10 +170,10 @@ const ResetPayCode: React.FC<IProps> = (props) => {
</>
: null
}
</Form>
</div>
)
}
export default ResetPayCode
\ No newline at end of file
export default ResetPayCode
import React, { useEffect, useState } from 'react';
import { Card } from 'antd';
import { Row, Col } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import TypeVerify from './components/TypeVerify';
import styles from './index.less';
import { PublicApi } from '@/services/api';
const getData = async () => {
......@@ -22,26 +21,27 @@ const AccountSetting = () => {
const TYPES = ['loginPwd', 'email', 'phone', 'paycode']
return (
<PageHeaderWrapper>
<div className={styles.page}>
<div >
<Row gutter={[24,24]}>
{
TYPES.map((item) => {
return (
<div className={styles.item} key={item}>
<TypeVerify
type={item}
phone={account.phone}
email={account.email}
<Col xxl={12} xl={12} lg={24} md={24} sm={24} xs={24} key={item}>
<TypeVerify
type={item}
phone={account.phone}
email={account.email}
paycode={account.hasPayPassword}
/>
</div>
</Col>
)
})
}
</Row>
</div>
</PageHeaderWrapper>
)
}
export default AccountSetting;
\ No newline at end of file
export default AccountSetting;
......@@ -60,7 +60,7 @@ enum OuterAndInnerStatus {
/**
* 待确认物流单
*/
pending_confirm_logistics = '待确认物流单',
pending_confirm_logistics = '4_17',
/**
* 待确认发货
*/
......@@ -174,8 +174,8 @@ const processStock: React.FC<{}> = () => {
<a onClick={() => handleVisible(record.id)}>审核</a>
</Popconfirm>
),
[OuterAndInnerStatus.pending_add_logistics]: <Link to={`${ADD_LOGISTICS_PATH}`}>新增</Link>,
[OuterAndInnerStatus.pending_confirm_logistics]: <a>查看</a>,
[OuterAndInnerStatus.pending_add_logistics]: <Link to={`${ADD_LOGISTICS_PATH}?createType=3&shipmentOrderId=${record.deliveryId}&shipmentOrderCode=${record.deliveryNo}&relevanceOrderId=${record.id}`}>新增物流单</Link>,
[OuterAndInnerStatus.pending_confirm_logistics]: <Link to={`${ADD_LOGISTICS_PATH}?createType=3&shipmentOrderId=${record.deliveryId}&shipmentOrderCode=${record.deliveryNo}&relevanceOrderId=${record.id}&isPreview=1`}>查看物流单</Link>,
[OuterAndInnerStatus.pending_confirm_deliver]: <Link to={`${PENDING_DELIVERD_PATH}/detail?id=${record.id}`}>发货</Link>,
[OuterAndInnerStatus.pending_add_process_in_warehouse]: (
<Link
......@@ -201,7 +201,7 @@ const processStock: React.FC<{}> = () => {
[OuterAndInnerStatus.pending_confirm_receive]: <Link to={`${ASSIGN_PENDING_RECEIVE}/detail?id=${record.id}`}>收货</Link>,
[OuterAndInnerStatus.pending_confirm_receipt]: <Link to={`${PENDING_RECEIPT_PATH}/detail?id=${record.id}`}>确认回单</Link>
}
return MAP[`${outerStatus}_${innerStatus}`] || MAP[record.innerStatusName]
return MAP[`${outerStatus}_${innerStatus}`]
}
}
]
......
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