Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
488cb180
Commit
488cb180
authored
Oct 28, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善消息提醒跳转
parent
cd6b961e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
27 deletions
+71
-27
index.jsx
src/components/MessageReminder/Complex/index.jsx
+26
-12
index.jsx
src/components/MessageReminder/Simple/index.jsx
+26
-2
BasicLayout.jsx
src/layouts/BasicLayout.jsx
+11
-11
index.jsx
src/pages/AfterSaleManage/index.jsx
+6
-0
websocket.js
src/utils/websocket.js
+2
-2
No files found.
src/components/MessageReminder/Complex/index.jsx
View file @
488cb180
...
@@ -148,21 +148,35 @@ const Complex = props => {
...
@@ -148,21 +148,35 @@ const Complex = props => {
setVisible
(
false
);
setVisible
(
false
);
};
};
// 跳转到详情
//
const
viewDetail
=
message
=>
{
console
.
log
(
message
);
const
{
orderNo
}
=
message
;
// 待发货
history
.
push
({
pathname
:
'
/orderManage/pendingDeliveryOrder
'
,
query
:
{
orderNo
},
});
// 已发货
/**
// /orderManage/deliveryOrder
* 跳转到详情
* type
* 1-待发货订单
* 2-超时发货
* 3-仅退款(未发货)申请单
* 4-仅退款申请单
* 5-退货退款申请单
* 6-退货入库待审核
*/
const
viewDetail
=
message
=>
{
const
{
orderNo
,
type
}
=
message
;
console
.
log
(
type
);
// 售后
if
([
1
,
2
].
includes
(
type
))
{
history
.
push
({
pathname
:
'
/orderManage/pendingDeliveryOrder
'
,
query
:
{
orderNo
},
});
}
if
([
3
,
4
,
5
,
6
].
includes
(
type
))
{
history
.
push
({
pathname
:
'
/afterSaleManage
'
,
query
:
{
orderNo
},
});
}
close
();
close
();
};
};
...
...
src/components/MessageReminder/Simple/index.jsx
View file @
488cb180
...
@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
...
@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
import
{
Badge
,
notification
,
Spin
}
from
'
antd
'
;
import
{
Badge
,
notification
,
Spin
}
from
'
antd
'
;
import
{
CloseOutlined
}
from
'
@ant-design/icons
'
;
import
{
CloseOutlined
}
from
'
@ant-design/icons
'
;
import
classNames
from
'
classnames
'
;
import
classNames
from
'
classnames
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
// import copy from 'copy-to-clipboard';
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
apiGetBussinessMsgList
}
from
'
@/services/messageReminder
'
;
import
{
apiGetBussinessMsgList
}
from
'
@/services/messageReminder
'
;
import
Empty
from
'
../Empty
'
;
import
Empty
from
'
../Empty
'
;
...
@@ -21,7 +23,7 @@ const Horn = props => {
...
@@ -21,7 +23,7 @@ const Horn = props => {
};
};
const
Message
=
props
=>
{
const
Message
=
props
=>
{
const
{
toggle
,
animationClass
,
messageData
,
openComplex
,
onMark
,
loading
}
=
props
;
const
{
toggle
,
animationClass
,
messageData
,
openComplex
,
onMark
,
loading
,
viewDetail
}
=
props
;
const
ReminderItem
=
args
=>
{
const
ReminderItem
=
args
=>
{
const
{
item
}
=
args
;
const
{
item
}
=
args
;
...
@@ -44,7 +46,7 @@ const Message = props => {
...
@@ -44,7 +46,7 @@ const Message = props => {
<
span
>
{
message
.
createdAt
}
</
span
>
<
span
>
{
message
.
createdAt
}
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
notice
}
>
<
div
className=
{
styles
.
notice
}
>
<
a
>
{
message
.
title
}
,请查看
</
a
>
<
a
onClick=
{
()
=>
viewDetail
(
message
)
}
>
{
message
.
title
}
,请查看
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
@@ -94,6 +96,7 @@ const Message = props => {
...
@@ -94,6 +96,7 @@ const Message = props => {
const
Simple
=
props
=>
{
const
Simple
=
props
=>
{
const
{
dispatch
,
unReadCount
,
complexRef
,
unReadData
}
=
props
;
const
{
dispatch
,
unReadCount
,
complexRef
,
unReadData
}
=
props
;
const
history
=
useHistory
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
count
,
setCount
]
=
useState
(
0
);
...
@@ -137,6 +140,26 @@ const Simple = props => {
...
@@ -137,6 +140,26 @@ const Simple = props => {
});
});
};
};
const
viewDetail
=
message
=>
{
const
{
orderNo
,
type
}
=
message
;
console
.
log
(
type
);
if
([
1
,
2
].
includes
(
type
))
{
history
.
push
({
pathname
:
'
/orderManage/pendingDeliveryOrder
'
,
query
:
{
orderNo
},
});
}
if
([
3
,
4
,
5
,
6
].
includes
(
type
))
{
history
.
push
({
pathname
:
'
/afterSaleManage
'
,
query
:
{
orderNo
},
});
}
toggle
();
};
// 打开消息提醒弹框
// 打开消息提醒弹框
const
openComplex
=
()
=>
{
const
openComplex
=
()
=>
{
complexRef
.
current
.
open
();
complexRef
.
current
.
open
();
...
@@ -192,6 +215,7 @@ const Simple = props => {
...
@@ -192,6 +215,7 @@ const Simple = props => {
openComplex
,
openComplex
,
onMark
,
onMark
,
loading
,
loading
,
viewDetail
,
};
};
// 隐藏消息提醒
// 隐藏消息提醒
...
...
src/layouts/BasicLayout.jsx
View file @
488cb180
...
@@ -55,18 +55,18 @@ const BasicLayout = props => {
...
@@ -55,18 +55,18 @@ const BasicLayout = props => {
const
messageReminderComplexRef
=
useRef
();
const
messageReminderComplexRef
=
useRef
();
// const audioRef = useRef()
// const audioRef = useRef()
const
token
=
window
.
localStorage
.
getItem
(
'
token
'
);
const
channelId
=
100001
;
const
socket
=
new
Socket
({
url
:
getSocketUrl
({
token
,
channelId
}),
});
socket
.
connection
();
socket
.
event
.
on
(
'
open
'
,
()
=>
{
console
.
log
(
'
连接成功3
'
);
});
useEffect
(()
=>
{
useEffect
(()
=>
{
const
token
=
window
.
localStorage
.
getItem
(
'
token
'
);
const
channelId
=
100001
;
console
.
log
(
'
666666666666
'
);
const
socket
=
new
Socket
({
url
:
getSocketUrl
({
token
,
channelId
}),
});
socket
.
connection
();
socket
.
event
.
on
(
'
open
'
,
()
=>
{
console
.
log
(
'
连接成功3
'
);
});
socket
.
event
.
on
(
'
message
'
,
msg
=>
{
socket
.
event
.
on
(
'
message
'
,
msg
=>
{
// audioRef.current.click()
// audioRef.current.click()
dispatch
({
dispatch
({
...
...
src/pages/AfterSaleManage/index.jsx
View file @
488cb180
...
@@ -6,6 +6,7 @@ import { AFTER_SALE_ORDER } from '@/../config/permission.config';
...
@@ -6,6 +6,7 @@ import { AFTER_SALE_ORDER } from '@/../config/permission.config';
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
FormSearch
}
from
'
@/components/FormSearch
'
;
import
{
FormSearch
}
from
'
@/components/FormSearch
'
;
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
import
{
useLocation
}
from
'
react-router-dom
'
;
import
AuditModal
from
'
./components/auditModal
'
;
import
AuditModal
from
'
./components/auditModal
'
;
import
DetailTable
from
'
./components/detailTable
'
;
import
DetailTable
from
'
./components/detailTable
'
;
import
ProofsModal
from
'
./components/proofsModal
'
;
import
ProofsModal
from
'
./components/proofsModal
'
;
...
@@ -38,6 +39,9 @@ const { confirm } = Modal;
...
@@ -38,6 +39,9 @@ const { confirm } = Modal;
const
AfterSale
=
props
=>
{
const
AfterSale
=
props
=>
{
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
];
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
];
const
location
=
useLocation
();
const
pageQueryOrderNo
=
location
.
query
?.
orderNo
||
''
;
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
formRef
=
useRef
();
const
formRef
=
useRef
();
const
[
tableParams
,
setTableParams
]
=
useState
({});
const
[
tableParams
,
setTableParams
]
=
useState
({});
...
@@ -233,6 +237,7 @@ const AfterSale = props => {
...
@@ -233,6 +237,7 @@ const AfterSale = props => {
form
,
form
,
initialValues
:
{
initialValues
:
{
afterTime
,
afterTime
,
orderNo
:
pageQueryOrderNo
,
},
},
formOptions
:
{},
formOptions
:
{},
...
formConfig
,
...
formConfig
,
...
@@ -284,6 +289,7 @@ const AfterSale = props => {
...
@@ -284,6 +289,7 @@ const AfterSale = props => {
const
requestParams
=
{
const
requestParams
=
{
page
,
page
,
size
,
size
,
orderNo
:
pageQueryOrderNo
,
...
params
,
...
params
,
startDate
,
startDate
,
endDate
,
endDate
,
...
...
src/utils/websocket.js
View file @
488cb180
...
@@ -46,7 +46,7 @@ class Socket extends EventEmitter {
...
@@ -46,7 +46,7 @@ class Socket extends EventEmitter {
console
.
log
(
'
主动触发关闭
'
);
console
.
log
(
'
主动触发关闭
'
);
this
.
socket
.
close
();
this
.
socket
.
close
();
}
}
clear
Interval
(
time
);
clear
Timeout
(
time
);
},
timeout
);
},
timeout
);
}
}
};
};
...
@@ -86,7 +86,7 @@ class Socket extends EventEmitter {
...
@@ -86,7 +86,7 @@ class Socket extends EventEmitter {
this
.
connection
();
this
.
connection
();
reconnect
();
reconnect
();
}
}
},
2000
);
},
2000
0
);
};
};
reconnect
();
reconnect
();
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment