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
30ba12f0
Commit
30ba12f0
authored
Oct 31, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复设置已读数量更新问题
parent
7faf76a8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
27 deletions
+45
-27
env.config.js
config/env.config.js
+10
-10
index.jsx
src/components/MessageReminder/Complex/index.jsx
+14
-11
index.jsx
src/components/MessageReminder/Simple/index.jsx
+3
-3
messageReminder.js
src/models/messageReminder.js
+11
-2
data.js
src/pages/AfterSaleManage/data.js
+1
-1
websocket.js
src/utils/websocket.js
+6
-0
No files found.
config/env.config.js
View file @
30ba12f0
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
environment
=
'
sc
'
;
const
envAPi
=
{
const
envAPi
=
{
api
:
'
https://security-yxm.liangkebang.net
'
,
//'https://security-xyqb.liangkebang.net',
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
kdspOpApi
:
'
https://sc-merchant-api-yxm.liangkebang.net
'
,
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
kdspApi
:
'
https://sc-merchant-api-yxm.liangkebang.net
'
,
kdspApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
goodsApi
:
'
https://sc-merchant-api-yxm.liangkebang.net
'
,
goodsApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
// kdspOpApi: 'https://kdsp-operation-xyqb.liangkebang.net',
// kdspOpApi: 'https://kdsp-operation-xyqb.liangkebang.net',
// kdspApi: 'https://sc-op-api-xyqb.liangkebang.net',
// kdspApi: 'https://sc-op-api-xyqb.liangkebang.net',
// goodsApi: 'https://sc-op-api-xyqb.liangkebang.net',
// goodsApi: 'https://sc-op-api-xyqb.liangkebang.net',
querysApi
:
'
https://sc-merchant-api-yxm.liangkebang.net
'
,
querysApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
// goodsApi: '//192.168.188.111:7000',
// goodsApi: '//192.168.188.111:7000',
prologueDomain
:
'
https://mall-yxm.liangkebang.net
'
,
prologueDomain
:
`https://mall-
${
environment
}
.liangkebang.net`
,
// qiniuHost: 'https://appsync.lkbang.net',
// qiniuHost: 'https://appsync.lkbang.net',
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
opapiHost
:
'
https://opapi-yxm.liangkebang.net
'
,
opapiHost
:
`https://opapi-
${
environment
}
.liangkebang.net`
,
wsApi
:
'
ws://ws-sc.liangkebang.net
'
,
wsApi
:
`ws://ws-
${
environment
}
.liangkebang.net`
,
msgApi
:
'
https://msgapi-yxm.liangkebang.net
'
,
msgApi
:
`https://msgapi-
${
environment
}
.liangkebang.net`
,
};
};
const
prodApi
=
{
const
prodApi
=
{
...
...
src/components/MessageReminder/Complex/index.jsx
View file @
30ba12f0
...
@@ -42,7 +42,7 @@ const MessageItem = props => {
...
@@ -42,7 +42,7 @@ const MessageItem = props => {
<
span
className=
{
styles
[
'
order-number
'
]
}
>
订单编号:
{
message
.
orderNo
}
</
span
>
<
span
className=
{
styles
[
'
order-number
'
]
}
>
订单编号:
{
message
.
orderNo
}
</
span
>
<
span
className=
{
styles
.
time
}
>
订单时间:
{
message
.
time
}
</
span
>
<
span
className=
{
styles
.
time
}
>
订单时间:
{
message
.
time
}
</
span
>
{
readStatus
===
0
?
(
{
readStatus
===
0
?
(
<
a
className=
{
styles
[
'
read-status
'
]
}
onClick=
{
()
=>
onMark
([
item
.
id
])
}
>
<
a
className=
{
styles
[
'
read-status
'
]
}
onClick=
{
()
=>
onMark
([
item
.
id
]
,
item
)
}
>
标记为已读
标记为已读
</
a
>
</
a
>
)
:
(
)
:
(
...
@@ -139,6 +139,10 @@ const Complex = props => {
...
@@ -139,6 +139,10 @@ const Complex = props => {
});
});
};
};
// 过滤参数,获取当前页未读消息数据的id
const
onFilterMessageParams
=
msgList
=>
msgList
.
filter
(
message
=>
message
.
readStatus
===
0
).
map
(
item
=>
item
.
id
);
const
open
=
()
=>
{
const
open
=
()
=>
{
setVisible
(
true
);
setVisible
(
true
);
getMsgReadCount
();
getMsgReadCount
();
...
@@ -190,20 +194,25 @@ const Complex = props => {
...
@@ -190,20 +194,25 @@ const Complex = props => {
};
};
// 标记已读
// 标记已读
const
onMark
=
idList
=>
{
const
onMark
=
(
idsList
,
item
)
=>
{
if
(
!
idList
.
length
)
{
if
(
!
id
s
List
.
length
)
{
return
;
return
;
}
}
const
payload
=
{
const
payload
=
{
channelId
:
CHANNEL_ID
,
channelId
:
CHANNEL_ID
,
bussinessId
:
userInfo
.
supplierCode
,
bussinessId
:
userInfo
.
supplierCode
,
idList
,
type
:
Number
(
queryParams
.
type
),
idsList
,
};
};
dispatch
({
dispatch
({
type
:
'
messageReminder/setMarkRead
'
,
type
:
'
messageReminder/setMarkRead
'
,
payload
,
payload
,
options
:
{
options
:
{
setLoading
,
setLoading
,
callback
:
()
=>
{
getMsgReadCount
();
getMsgList
();
},
},
},
});
});
};
};
...
@@ -270,13 +279,7 @@ const Complex = props => {
...
@@ -270,13 +279,7 @@ const Complex = props => {
</
Checkbox
>
</
Checkbox
>
</
div
>
</
div
>
<
div
className=
{
styles
[
'
filter-box__actions
'
]
}
>
<
div
className=
{
styles
[
'
filter-box__actions
'
]
}
>
<
a
<
a
onClick=
{
()
=>
onMark
(
onFilterMessageParams
(
messageData
))
}
>
全部标记为已读
</
a
>
onClick=
{
()
=>
onMark
(
messageData
.
filter
(
message
=>
message
.
readStatus
===
0
).
map
(
item
=>
item
.
id
))
}
>
全部标记为已读
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/components/MessageReminder/Simple/index.jsx
View file @
30ba12f0
...
@@ -167,14 +167,14 @@ const Simple = props => {
...
@@ -167,14 +167,14 @@ const Simple = props => {
};
};
// 标记已读信息
// 标记已读信息
const
onMark
=
idList
=>
{
const
onMark
=
id
s
List
=>
{
if
(
!
idList
.
length
)
{
if
(
!
id
s
List
.
length
)
{
return
;
return
;
}
}
const
payload
=
{
const
payload
=
{
channelId
:
CHANNEL_ID
,
channelId
:
CHANNEL_ID
,
bussinessId
:
userInfo
.
supplierCode
,
bussinessId
:
userInfo
.
supplierCode
,
idList
,
id
s
List
,
};
};
dispatch
({
dispatch
({
type
:
'
messageReminder/setMarkRead
'
,
type
:
'
messageReminder/setMarkRead
'
,
...
...
src/models/messageReminder.js
View file @
30ba12f0
...
@@ -26,6 +26,15 @@ const MessageReminderModel = {
...
@@ -26,6 +26,15 @@ const MessageReminderModel = {
if
(
setLoading
)
{
if
(
setLoading
)
{
setLoading
(
false
);
setLoading
(
false
);
}
}
if
(
res
.
code
!==
'
0000
'
)
{
return
;
}
if
(
Object
.
hasOwnProperty
.
call
(
options
,
'
callback
'
)
&&
typeof
options
.
callback
===
'
function
'
)
{
options
.
callback
(
res
);
}
yield
put
({
yield
put
({
type
:
'
updateUnReadData
'
,
type
:
'
updateUnReadData
'
,
payload
,
payload
,
...
@@ -46,9 +55,9 @@ const MessageReminderModel = {
...
@@ -46,9 +55,9 @@ const MessageReminderModel = {
},
},
updateUnReadData
(
state
,
{
payload
,
options
=
{}
})
{
updateUnReadData
(
state
,
{
payload
,
options
=
{}
})
{
// 删除已读的数据
// 删除已读的数据
const
currentData
=
state
.
unReadData
.
filter
(
message
=>
!
payload
.
idList
.
includes
(
message
.
id
));
const
currentData
=
state
.
unReadData
.
filter
(
message
=>
!
payload
.
id
s
List
.
includes
(
message
.
id
));
// 重置当前未读数量
// 重置当前未读数量
const
unReadCount
=
currentData
.
length
;
// state.unReadCount - (options.readCount || payload.idList.length || 1)
const
unReadCount
=
currentData
.
length
;
// state.unReadCount - (options.readCount || payload.id
s
List.length || 1)
return
{
...
state
,
unReadCount
,
unReadData
:
currentData
};
return
{
...
state
,
unReadCount
,
unReadData
:
currentData
};
},
},
},
},
...
...
src/pages/AfterSaleManage/data.js
View file @
30ba12f0
...
@@ -384,7 +384,7 @@ export const getColumns = props => {
...
@@ -384,7 +384,7 @@ export const getColumns = props => {
showRefunded
,
showRefunded
,
}
=
record
;
}
=
record
;
// 是否是服务类商品
// 是否是服务类商品
const
isServiceGoods
=
!
[
'
vip
'
,
'
self
'
].
includes
(
supplierType
);
const
isServiceGoods
=
[
'
pop
'
].
includes
(
supplierType
);
// 按钮通用属性
// 按钮通用属性
const
btnProps
=
{
const
btnProps
=
{
className
:
'
mr10 mt10
'
,
className
:
'
mr10 mt10
'
,
...
...
src/utils/websocket.js
View file @
30ba12f0
...
@@ -113,6 +113,12 @@ class Socket extends EventEmitter {
...
@@ -113,6 +113,12 @@ class Socket extends EventEmitter {
this
.
checkWaitingData
();
this
.
checkWaitingData
();
}
}
}
}
hearBeat
()
{
setTimeout
(()
=>
{
this
.
sendMessage
(
'
HeartBeat
'
);
},
300000
);
}
}
}
export
default
Socket
;
export
default
Socket
;
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