Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DiscuzWeb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Discuz
DiscuzWeb
Commits
9a3bfd85
Commit
9a3bfd85
authored
Jan 23, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d17eed53
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
294 additions
and
168 deletions
+294
-168
Header.vue
components/Header.vue
+1
-0
TopicItem.vue
components/TopicItem.vue
+0
-0
NoticeItem.vue
components/my/NoticeItem.vue
+124
-62
config.js
config.js
+2
-2
notice.vue
pages/my/notice.vue
+167
-104
No files found.
components/Header.vue
View file @
9a3bfd85
...
@@ -171,6 +171,7 @@ export default {
...
@@ -171,6 +171,7 @@ export default {
// 更加微信用户id获取对应得用户信息并返回
// 更加微信用户id获取对应得用户信息并返回
axios
axios
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
//.get(`http://discuz.bailuntec.com/api/login?useid=chenzekai`)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
localStorage
.
setItem
(
...
...
components/TopicItem.vue
View file @
9a3bfd85
components/my/NoticeItem.vue
View file @
9a3bfd85
<
template
>
<
template
>
<div
class=
"notice-item"
>
<div
class=
"notice-item"
>
<div
class=
"avatar"
>
<div
class=
"avatar"
>
<div
<div
v-if=
"item.type === 'system'"
class=
"system-avatar"
>
v-if=
"item.type === 'system'"
<svg-icon
type=
"system-notice"
class=
"icon"
/>
class=
"system-avatar"
>
<svg-icon
type=
"system-notice"
class=
"icon"
/>
</div>
</div>
<avatar
<avatar
v-else
v-else
:user=
"
{ id: item.user_id,username: item.user_name, avatarUrl: item.user_avatar}"
:user=
"
{
id: item.user_id,
username: item.user_name,
avatarUrl: item.user_avatar,
}"
:size="50"
:size="50"
/>
/>
</div>
</div>
...
@@ -28,37 +26,51 @@
...
@@ -28,37 +26,51 @@
<span
class=
"text"
>
<span
class=
"text"
>
<template
v-if=
"item.type === 'questioned'"
>
<template
v-if=
"item.type === 'questioned'"
>
<template
v-if=
"item.is_answer === 0"
>
<template
v-if=
"item.is_answer === 0"
>
{{
$t
(
'notice.questions'
)
}}
{{
$t
(
"notice.questions"
)
}}
</
template
>
</
template
>
<
template
v-if=
"item.is_answer === 1"
>
<
template
v-if=
"item.is_answer === 1"
>
{{
$t
(
'notice.answersMe'
)
}}
{{
$t
(
"notice.answersMe"
)
}}
</
template
>
</
template
>
</template>
</template>
<
template
v-else-if=
"item.type === 'rewarded'"
>
<
template
v-else-if=
"item.type === 'rewarded'"
>
<template
v-if=
"item.isScale"
>
<template
v-if=
"item.isScale"
>
{{
item
.
order_type
===
1
{{
?
typeMap
[
'registerScale'
]
:
item
.
order_type
===
2
item
.
order_type
===
1
?
typeMap
[
'rewardScale'
]
:
item
.
order_type
===
3
?
typeMap
[
"registerScale"
]
?
typeMap
[
'payScale'
]
:
typeMap
[
item
.
type
]
}}
:
item
.
order_type
===
2
?
typeMap
[
"rewardScale"
]
:
item
.
order_type
===
3
?
typeMap
[
"payScale"
]
:
typeMap
[
item
.
type
]
}}
</
template
>
</
template
>
<
template
v-else-if=
"item.order_type === 3"
>
{{
typeMap
[
'payMe'
]
}}
</
template
>
<
template
v-else-if=
"item.order_type === 3"
>
{{
<
template
v-else-if=
"item.order_type === 5"
>
{{
typeMap
[
'questions'
]
}}
</
template
>
typeMap
[
"payMe"
]
<
template
v-else-if=
"item.order_type === 6"
>
{{
typeMap
[
'watchedMe'
]
}}
</
template
>
}}
</
template
>
<
template
v-else-if=
"item.order_type === 5"
>
{{
typeMap
[
"questions"
]
}}
</
template
>
<
template
v-else-if=
"item.order_type === 6"
>
{{
typeMap
[
"watchedMe"
]
}}
</
template
>
<
template
v-else
>
{{
typeMap
[
item
.
type
]
}}
</
template
>
<
template
v-else
>
{{
typeMap
[
item
.
type
]
}}
</
template
>
</template>
</template>
<
template
v-else
>
{{
typeMap
[
item
.
type
]
}}
</
template
>
<
template
v-else
>
{{
typeMap
[
item
.
type
]
}}
</
template
>
</span>
</span>
</template>
</template>
<div
<div
v-if=
"item.title && item.type === 'system'"
class=
"user-name"
>
v-if=
"item.title && item.type === 'system'"
{{ item.title }}
class=
"user-name"
>
{{ item.title }}
</div>
<div
class=
"time"
>
{{ timerDiff(item.created_at) + $t('topic.before') }}
</div>
</div>
</div>
<div
class=
"time"
>
{{ timerDiff(item.created_at) + $t("topic.before") }}
</div>
</div>
<nuxt-link
<nuxt-link
v-if=
"item.post_content"
v-if=
"item.post_content"
:to=
"`/thread/comment?threadId=${item.thread_id}&commentId=${item.reply_post_id !== 0
:to=
"`/thread/comment?threadId=${item.thread_id}&commentId=${
? item.reply_post_id : item.post_id}`"
item.reply_post_id !== 0 ? item.reply_post_id : item.post_id
}`"
class=
"post-content"
class=
"post-content"
v-html=
"$xss(item.post_content)"
v-html=
"$xss(item.post_content)"
/>
/>
...
@@ -68,8 +80,38 @@
...
@@ -68,8 +80,38 @@
class=
"post-content"
class=
"post-content"
v-html=
"$xss(item.answer_content)"
v-html=
"$xss(item.answer_content)"
/>
/>
<div
class=
"thread"
>
<div
class=
"thread-user-name"
>
{{ item.thread_username }}:
</div>
<div
class=
"thread-title"
>
<div
v-if=
"item.thread_title"
v-html=
"$xss(item.thread_title)"
/>
<div
v-else-if=
"item.content"
v-html=
"$xss(item.content)"
/>
</div>
<div
class=
"to-detail"
@
click=
"onClickContent(item)"
>
{{ $t("notice.toDetail") }}
</div>
</div>
<!-- <nuxt-link
v-if="item.fileid!=null"
:to="`/knowledge/knowledgeDetail?id=${item.fileid}&useid=${item.qywxUserid}`"
class="thread"
target="_blank"
>
<div class="thread-user-name">{{ item.thread_username }}:</div>
<div class="thread-title">
<div
v-if="item.thread_title"
v-html="$xss(item.thread_title)"
/>
<div
v-else-if="item.content"
v-html="$xss(item.content)"
/>
</div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div>
</nuxt-link>
<nuxt-link
<nuxt-link
v-if=
"(item.thread_title || item.content) && item.type !== 'system'"
v-if="(item.thread_title || item.content) && item.type !== 'system'
&&item.fileid==null
"
:to="`/thread/${item.thread_id}`"
:to="`/thread/${item.thread_id}`"
class="thread"
class="thread"
target="_blank"
target="_blank"
...
@@ -86,69 +128,88 @@
...
@@ -86,69 +128,88 @@
/>
/>
</div>
</div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div>
</nuxt-link>
</nuxt-link>
-->
<div
<div
v-if=
"item.type === 'system'"
v-if=
"item.type === 'system'"
class=
"post-content"
class=
"post-content"
v-html=
"$xss(item.content)"
v-html=
"$xss(item.content)"
/>
/>
<div
<div
v-if=
"item.type === 'withdrawal'"
class=
"thread"
>
v-if=
"item.type === 'withdrawal'"
<
template
v-if=
"item.cash_status === 2"
>
{{
class=
"thread"
$t
(
"notice.approved"
)
>
}}
</
template
>
<
template
v-if=
"item.cash_status === 2"
>
{{
$t
(
'notice.approved'
)
}}
</
template
>
<
template
v-if=
"item.cash_status === 3"
>
{{
<
template
v-if=
"item.cash_status === 3"
>
{{
$t
(
'notice.unapproved'
)
}}
</
template
>
$t
(
"notice.unapproved"
)
}}
</
template
>
</div>
</div>
<div
<div
v-if=
"item.type === 'withdrawal' && item.cash_actual_amount"
v-if=
"item.type === 'withdrawal' && item.cash_actual_amount"
class=
"amount green"
class=
"amount green"
>
>
- {{ $t(
'post.yuanItem'
) + item.cash_actual_amount }}
- {{ $t(
"post.yuanItem"
) + item.cash_actual_amount }}
</div>
</div>
<div
<div
v-if=
"item.type === 'rewarded' && item.amount"
class=
"amount"
>
v-if=
"item.type === 'rewarded' && item.amount"
+ {{ $t("post.yuanItem") + item.amount }}
class=
"amount"
>
+ {{ $t('post.yuanItem') + item.amount }}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
handleError
from
'@/mixin/handleError'
;
import
handleError
from
"@/mixin/handleError"
;
import
timerDiff
from
'@/mixin/timerDiff'
;
import
timerDiff
from
"@/mixin/timerDiff"
;
import
axios
from
"@/plugins/axios.js"
;
import
config
from
"@/config.js"
;
export
default
{
export
default
{
name
:
'NoticeItem'
,
name
:
"NoticeItem"
,
mixins
:
[
timerDiff
,
handleError
],
mixins
:
[
timerDiff
,
handleError
],
props
:
{
props
:
{
item
:
{
item
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
},
}
}
,
},
},
data
()
{
data
()
{
return
{
return
{
typeMap
:
{
typeMap
:
{
related
:
this
.
$t
(
'notice.relatedMe'
),
related
:
this
.
$t
(
"notice.relatedMe"
),
replied
:
this
.
$t
(
'notice.repliedMe'
),
replied
:
this
.
$t
(
"notice.repliedMe"
),
liked
:
this
.
$t
(
'notice.likedMe'
),
liked
:
this
.
$t
(
"notice.likedMe"
),
rewarded
:
this
.
$t
(
'notice.rewardedMe'
),
rewarded
:
this
.
$t
(
"notice.rewardedMe"
),
payMe
:
this
.
$t
(
'notice.payMe'
),
payMe
:
this
.
$t
(
"notice.payMe"
),
registerScale
:
this
.
$t
(
'notice.registerScale'
),
registerScale
:
this
.
$t
(
"notice.registerScale"
),
rewardScale
:
this
.
$t
(
'notice.rewardScale'
),
rewardScale
:
this
.
$t
(
"notice.rewardScale"
),
payScale
:
this
.
$t
(
'notice.payScale'
),
payScale
:
this
.
$t
(
"notice.payScale"
),
system
:
this
.
$t
(
'notice.system'
),
system
:
this
.
$t
(
"notice.system"
),
questions
:
this
.
$t
(
'notice.questions'
),
questions
:
this
.
$t
(
"notice.questions"
),
watchedMe
:
this
.
$t
(
'notice.watchedMe'
),
watchedMe
:
this
.
$t
(
"notice.watchedMe"
),
payedMe
:
this
.
$t
(
'notice.payedMe'
),
payedMe
:
this
.
$t
(
"notice.payedMe"
),
answersMe
:
this
.
$t
(
'notice.answersMe'
),
answersMe
:
this
.
$t
(
"notice.answersMe"
),
questioned
:
this
.
$t
(
'notice.questions'
)
questioned
:
this
.
$t
(
"notice.questions"
),
}
}
,
};
};
},
},
methods
:
{
methods
:
{
onClickContent
(
item
)
{
let
fileid
=
null
;
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/GetWeiPanFileByThreadId?threadId=
${
item
.
thread_id
}
`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
statusCode
==
200
)
{
fileid
=
res
.
data
.
result
.
fileId
;
}
if
(
!!
fileid
)
{
window
.
open
(
`/knowledge/knowledgeDetail?id=
${
fileid
}
&useid=
${
item
.
qywxUserid
}
`
,
"_blank"
);
}
else
{
window
.
open
(
`/thread/
${
item
.
thread_id
}
`
,
"_blank"
);
}
}
});
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -246,6 +307,7 @@ export default {
...
@@ -246,6 +307,7 @@ export default {
}
}
.to-detail
{
.to-detail
{
color
:
$
color-blue-base
;
color
:
$
color-blue-base
;
cursor
:
pointer
;
}
}
}
}
.amount
{
.amount
{
...
@@ -254,8 +316,8 @@ export default {
...
@@ -254,8 +316,8 @@ export default {
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#fa5151
;
color
:
#fa5151
;
}
}
.green
{
.green
{
color
:
#09
BB
07
;
color
:
#09
bb
07
;
}
}
}
}
}
}
...
...
config.js
View file @
9a3bfd85
...
@@ -5,6 +5,6 @@ export default {
...
@@ -5,6 +5,6 @@ export default {
DEV_API_URL
:
'http://discuz.bailuntec.com'
,
DEV_API_URL
:
'http://discuz.bailuntec.com'
,
// ssr api url
// ssr api url
SSR_API_URL
:
'http://discuz.bailuntec.com'
,
SSR_API_URL
:
'http://discuz.bailuntec.com'
,
//
WEI_PAN_URL: 'http://localhost:5008'
WEI_PAN_URL
:
'http://localhost:5008'
WEI_PAN_URL
:
'http://pps.bailuntec.com/DiscuzApi'
//
WEI_PAN_URL: 'http://pps.bailuntec.com/DiscuzApi'
};
};
pages/my/notice.vue
View file @
9a3bfd85
<
template
>
<
template
>
<div
class=
"notice-container"
>
<div
class=
"notice-container"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
v-for=
"(item, index) in noticeTypeList"
:key=
"index"
:name=
"item.value"
>
<el-tab-pane
v-for=
"(item, index) in noticeTypeList"
:key=
"index"
:name=
"item.value"
>
<span
slot=
"label"
>
<span
slot=
"label"
>
<el-badge
<el-badge
:is-dot=
"item.value !== 'chat'
:is-dot=
"
&& userInfo.typeUnreadNotifications
item.value !== 'chat' &&
&& userInfo.typeUnreadNotifications[item.value]
userInfo.typeUnreadNotifications &&
? true : false"
userInfo.typeUnreadNotifications[item.value]
? true
: false
"
class=
"badge-item"
class=
"badge-item"
>
{{
item
.
label
}}
</el-badge>
>
{{
item
.
label
}}
</el-badge
>
</span>
</span>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
<div
class=
"notice-list"
>
<div
class=
"notice-list"
>
<template
v-if=
"activeName === 'chat'"
>
<template
v-if=
"activeName === 'chat'"
>
<div
v-for=
"(item, index) in dialog.list"
:key=
"index"
class=
"notice-item"
>
<div
<chat-item
:user-id=
"userInfo.id"
:item=
"item"
@
show-chat-box=
"showChatBox"
/>
v-for=
"(item, index) in dialog.list"
<div
class=
"delete"
@
click=
"handleDelete(item._jv && item._jv.id, index, 'chat')"
>
:key=
"index"
class=
"notice-item"
>
<chat-item
:user-id=
"userInfo.id"
:item=
"item"
@
show-chat-box=
"showChatBox"
/>
<div
class=
"delete"
@
click=
"handleDelete(item._jv && item._jv.id, index, 'chat')"
>
<svg-icon
type=
"close"
/>
<svg-icon
type=
"close"
/>
</div>
</div>
</div>
</div>
...
@@ -31,7 +50,11 @@
...
@@ -31,7 +50,11 @@
/>
/>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div
v-for=
"(item, index) in noticeList"
:key=
"index"
class=
"notice-item"
>
<div
v-for=
"(item, index) in noticeList"
:key=
"index"
class=
"notice-item"
>
<notice-item
:item=
"item"
/>
<notice-item
:item=
"item"
/>
<div
class=
"delete"
@
click=
"handleDelete(item.id, index, 'notice')"
>
<div
class=
"delete"
@
click=
"handleDelete(item.id, index, 'notice')"
>
<svg-icon
type=
"close"
/>
<svg-icon
type=
"close"
/>
...
@@ -48,45 +71,55 @@
...
@@ -48,45 +71,55 @@
</
template
>
</
template
>
</div>
</div>
<!-- 聊天框 -->
<!-- 聊天框 -->
<chat-box
v-if=
"chatting"
:dialog=
"dialogData || {}"
@
close=
"closeChatBox"
/>
<chat-box
v-if=
"chatting"
:dialog=
"dialogData || {}"
@
close=
"closeChatBox"
/>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
head
from
'@/mixin/head'
;
import
head
from
"@/mixin/head"
;
import
handleError
from
'@/mixin/handleError'
;
import
handleError
from
"@/mixin/handleError"
;
export
default
{
export
default
{
name
:
'Notice'
,
name
:
"Notice"
,
layout
:
'center_layout'
,
layout
:
"center_layout"
,
mixins
:
[
head
,
handleError
],
mixins
:
[
head
,
handleError
],
data
()
{
data
()
{
return
{
return
{
title
:
this
.
$t
(
'profile.notice'
),
title
:
this
.
$t
(
"profile.notice"
),
activeName
:
'chat'
,
activeName
:
"chat"
,
// 消息类型
// 消息类型
noticeTypeList
:
[
noticeTypeList
:
[
{
{
label
:
this
.
$t
(
'notice.message'
),
label
:
this
.
$t
(
"notice.message"
),
value
:
'chat'
value
:
"chat"
,
},
{
},
label
:
this
.
$t
(
'notice.relate'
),
{
value
:
'related'
label
:
this
.
$t
(
"notice.relate"
),
},
{
value
:
"related"
,
label
:
this
.
$t
(
'notice.reply'
),
},
value
:
'replied'
{
},
{
label
:
this
.
$t
(
"notice.reply"
),
label
:
this
.
$t
(
'notice.like'
),
value
:
"replied"
,
value
:
'liked'
},
},
{
{
label
:
this
.
$t
(
'notice.reward'
),
label
:
this
.
$t
(
"notice.like"
),
value
:
'rewarded'
value
:
"liked"
,
},
{
},
label
:
this
.
$t
(
'notice.questionsAnswers'
),
{
value
:
'questioned'
label
:
this
.
$t
(
"notice.reward"
),
},
{
value
:
"rewarded"
,
label
:
this
.
$t
(
'notice.system'
),
},
value
:
'system'
{
}
label
:
this
.
$t
(
"notice.questionsAnswers"
),
value
:
"questioned"
,
},
{
label
:
this
.
$t
(
"notice.system"
),
value
:
"system"
,
},
],
],
noticeList
:
[],
noticeList
:
[],
pageNum
:
1
,
pageNum
:
1
,
...
@@ -99,10 +132,10 @@ export default {
...
@@ -99,10 +132,10 @@ export default {
pageSize
:
10
,
pageSize
:
10
,
list
:
[],
list
:
[],
hasMore
:
false
,
hasMore
:
false
,
loading
:
false
loading
:
false
,
},
},
chatting
:
false
,
chatting
:
false
,
dialogData
:
{
id
:
''
,
name
:
''
}
dialogData
:
{
id
:
""
,
name
:
""
},
};
};
},
},
computed
:
{
computed
:
{
...
@@ -110,8 +143,8 @@ export default {
...
@@ -110,8 +143,8 @@ export default {
return
this
.
$store
.
state
.
user
.
info
.
attributes
||
{};
return
this
.
$store
.
state
.
user
.
info
.
attributes
||
{};
},
},
userId
()
{
userId
()
{
return
this
.
$store
.
getters
[
'session/get'
](
'userId'
);
return
this
.
$store
.
getters
[
"session/get"
](
"userId"
);
}
}
,
},
},
mounted
()
{
mounted
()
{
this
.
getDialogList
();
this
.
getDialogList
();
...
@@ -121,12 +154,16 @@ export default {
...
@@ -121,12 +154,16 @@ export default {
getDialogList
()
{
getDialogList
()
{
this
.
dialog
.
loading
=
true
;
this
.
dialog
.
loading
=
true
;
const
params
=
{
const
params
=
{
include
:
'dialogMessage,sender,recipient,sender.groups,recipient.groups'
,
include
:
sort
:
'-dialogMessageId'
,
"dialogMessage,sender,recipient,sender.groups,recipient.groups"
,
'page[number]'
:
this
.
dialog
.
pageNum
,
sort
:
"-dialogMessageId"
,
'page[limit]'
:
this
.
dialog
.
pageSize
"page[number]"
:
this
.
dialog
.
pageNum
,
"page[limit]"
:
this
.
dialog
.
pageSize
,
};
};
this
.
$store
.
dispatch
(
'jv/get'
,
[
'dialog'
,
{
params
}]).
then
(
async
(
data
)
=>
{
this
.
$store
.
dispatch
(
"jv/get"
,
[
"dialog"
,
{
params
}])
.
then
(
async
(
data
)
=>
{
this
.
dialog
.
hasMore
=
data
.
length
===
this
.
dialog
.
pageSize
;
this
.
dialog
.
hasMore
=
data
.
length
===
this
.
dialog
.
pageSize
;
if
(
this
.
dialog
.
pageNum
===
1
)
{
if
(
this
.
dialog
.
pageNum
===
1
)
{
this
.
dialog
.
list
=
data
;
this
.
dialog
.
list
=
data
;
...
@@ -135,53 +172,71 @@ export default {
...
@@ -135,53 +172,71 @@ export default {
}
}
this
.
dialog
.
pageNum
+=
1
;
this
.
dialog
.
pageNum
+=
1
;
if
(
data
.
_jv
&&
data
.
_jv
.
json
&&
data
.
_jv
.
json
.
meta
)
{
if
(
data
.
_jv
&&
data
.
_jv
.
json
&&
data
.
_jv
.
json
.
meta
)
{
this
.
dialog
.
hasMore
=
this
.
dialog
.
list
.
length
<
data
.
_jv
.
json
.
meta
.
total
this
.
dialog
.
hasMore
=
&&
this
.
dialog
.
list
.
length
>=
this
.
dialog
.
pageSize
;
this
.
dialog
.
list
.
length
<
data
.
_jv
.
json
.
meta
.
total
&&
this
.
dialog
.
list
.
length
>=
this
.
dialog
.
pageSize
;
this
.
surplus
=
data
.
_jv
.
json
.
meta
.
total
-
this
.
dialog
.
list
.
length
;
this
.
surplus
=
data
.
_jv
.
json
.
meta
.
total
-
this
.
dialog
.
list
.
length
;
}
}
},
(
e
)
=>
{
},
(
e
)
=>
{
this
.
handleError
(
e
);
this
.
handleError
(
e
);
})
}
)
.
finally
(()
=>
{
.
finally
(()
=>
{
this
.
dialog
.
loading
=
false
;
this
.
dialog
.
loading
=
false
;
});
});
},
},
// 获取消息列表
// 获取消息列表
getNoticeList
()
{
getNoticeList
()
{
self
=
this
;
this
.
loading
=
true
;
this
.
loading
=
true
;
const
params
=
{
const
params
=
{
'filter[type]'
:
this
.
activeName
,
"filter[type]"
:
this
.
activeName
,
'page[number]'
:
this
.
pageNum
,
"page[number]"
:
this
.
pageNum
,
'page[limit]'
:
this
.
pageSize
"page[limit]"
:
this
.
pageSize
,
};
};
// 财务通知里面包括提现信息
// 财务通知里面包括提现信息
if
(
this
.
activeName
===
'rewarded'
)
{
if
(
this
.
activeName
===
"rewarded"
)
{
params
[
'filter[type]'
]
=
'rewarded,withdrawal'
;
params
[
"filter[type]"
]
=
"rewarded,withdrawal"
;
}
}
this
.
$store
.
dispatch
(
'jv/get'
,
[
'notification'
,
{
params
}]).
then
(
async
(
data
)
=>
{
this
.
$store
this
.
hasMore
=
data
.
length
===
this
.
pageSize
;
.
dispatch
(
"jv/get"
,
[
"notification"
,
{
params
}])
if
(
this
.
pageNum
===
1
)
{
.
then
(
this
.
noticeList
=
data
;
async
(
data
)
=>
{
let
userInfo
=
JSON
.
parse
(
this
.
userInfo
.
wechat_info
);
let
qywxUserid
=
userInfo
.
userid
;
data
.
forEach
((
u
)
=>
{
u
.
qywxUserid
=
qywxUserid
;
self
.
hasMore
=
data
.
length
===
self
.
pageSize
;
if
(
self
.
pageNum
===
1
)
{
self
.
noticeList
=
data
;
}
else
{
}
else
{
this
.
noticeList
=
[...
this
.
noticeList
,
...
data
];
self
.
noticeList
=
[...
self
.
noticeList
,
...
data
];
}
}
if
(
data
.
_jv
&&
data
.
_jv
.
json
&&
data
.
_jv
.
json
.
meta
)
{
if
(
data
.
_jv
&&
data
.
_jv
.
json
&&
data
.
_jv
.
json
.
meta
)
{
this
.
hasMore
=
this
.
noticeList
.
length
<
data
.
_jv
.
json
.
meta
.
total
&&
this
.
noticeList
.
length
>=
this
.
pageSize
;
self
.
hasMore
=
this
.
surplus
=
data
.
_jv
.
json
.
meta
.
total
-
this
.
noticeList
.
length
;
self
.
noticeList
.
length
<
data
.
_jv
.
json
.
meta
.
total
&&
self
.
noticeList
.
length
>=
self
.
pageSize
;
self
.
surplus
=
data
.
_jv
.
json
.
meta
.
total
-
self
.
noticeList
.
length
;
}
}
this
.
pageNum
+=
1
;
self
.
pageNum
+=
1
;
});
try
{
try
{
await
this
.
$store
.
dispatch
(
'user/getUserInfo'
,
this
.
userInfo
.
id
);
await
this
.
$store
.
dispatch
(
"user/getUserInfo"
,
this
.
userInfo
.
id
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'getUserInfo err'
,
err
);
console
.
log
(
"getUserInfo err"
,
err
);
}
}
},
(
e
)
=>
{
},
(
e
)
=>
{
this
.
handleError
(
e
);
this
.
handleError
(
e
);
})
}
)
.
finally
(()
=>
{
.
finally
(()
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
});
});
},
},
loadMore
()
{
loadMore
()
{
this
.
getNoticeList
();
this
.
getNoticeList
();
},
},
...
@@ -190,21 +245,28 @@ export default {
...
@@ -190,21 +245,28 @@ export default {
},
},
// 删除
// 删除
handleDelete
(
id
,
index
,
type
)
{
handleDelete
(
id
,
index
,
type
)
{
this
.
$confirm
(
this
.
$t
(
'topic.confirmDelete'
),
this
.
$t
(
'discuzq.msgBox.title'
),
{
this
.
$confirm
(
confirmButtonText
:
this
.
$t
(
'discuzq.msgBox.confirm'
),
this
.
$t
(
"topic.confirmDelete"
),
cancelButtonText
:
this
.
$t
(
'discuzq.msgBox.cancel'
)
this
.
$t
(
"discuzq.msgBox.title"
),
}).
then
(()
=>
{
{
if
(
type
===
'chat'
)
{
confirmButtonText
:
this
.
$t
(
"discuzq.msgBox.confirm"
),
this
.
$store
.
dispatch
(
'jv/delete'
,
`dialog/
${
id
}
`
).
then
((
res
)
=>
{
cancelButtonText
:
this
.
$t
(
"discuzq.msgBox.cancel"
),
}
)
.
then
(()
=>
{
if
(
type
===
"chat"
)
{
this
.
$store
.
dispatch
(
"jv/delete"
,
`dialog/
${
id
}
`
).
then
((
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
.
success
(
this
.
$t
(
'topic.deleteSuccess'
));
this
.
$message
.
success
(
this
.
$t
(
"topic.deleteSuccess"
));
this
.
dialog
.
list
.
splice
(
index
,
1
);
this
.
dialog
.
list
.
splice
(
index
,
1
);
}
}
});
});
}
else
{
}
else
{
this
.
$store
.
dispatch
(
'jv/delete'
,
`notification/
${
id
}
`
).
then
((
res
)
=>
{
this
.
$store
.
dispatch
(
"jv/delete"
,
`notification/
${
id
}
`
)
.
then
((
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
.
success
(
this
.
$t
(
'topic.deleteSuccess'
));
this
.
$message
.
success
(
this
.
$t
(
"topic.deleteSuccess"
));
this
.
noticeList
.
splice
(
index
,
1
);
this
.
noticeList
.
splice
(
index
,
1
);
}
}
});
});
...
@@ -213,7 +275,7 @@ export default {
...
@@ -213,7 +275,7 @@ export default {
.
catch
(()
=>
{});
.
catch
(()
=>
{});
},
},
handleClick
(
e
)
{
handleClick
(
e
)
{
if
(
e
.
name
!==
'chat'
)
{
if
(
e
.
name
!==
"chat"
)
{
this
.
pageNum
=
1
;
this
.
pageNum
=
1
;
this
.
noticeList
=
[];
this
.
noticeList
=
[];
this
.
getNoticeList
();
this
.
getNoticeList
();
...
@@ -226,11 +288,11 @@ export default {
...
@@ -226,11 +288,11 @@ export default {
// 显示聊天框
// 显示聊天框
showChatBox
(
item
)
{
showChatBox
(
item
)
{
if
(
!
item
)
return
;
if
(
!
item
)
return
;
this
.
dialogData
.
id
=
item
.
_jv
?
item
.
_jv
.
id
:
''
;
this
.
dialogData
.
id
=
item
.
_jv
?
item
.
_jv
.
id
:
""
;
if
(
this
.
userId
*
1
!==
item
.
sender_user_id
)
{
if
(
this
.
userId
*
1
!==
item
.
sender_user_id
)
{
this
.
dialogData
.
name
=
item
.
sender
?
item
.
sender
.
username
:
''
;
this
.
dialogData
.
name
=
item
.
sender
?
item
.
sender
.
username
:
""
;
}
else
{
}
else
{
this
.
dialogData
.
name
=
item
.
recipient
?
item
.
recipient
.
username
:
''
;
this
.
dialogData
.
name
=
item
.
recipient
?
item
.
recipient
.
username
:
""
;
}
}
this
.
chatting
=
true
;
this
.
chatting
=
true
;
},
},
...
@@ -239,55 +301,56 @@ export default {
...
@@ -239,55 +301,56 @@ export default {
this
.
chatting
=
false
;
this
.
chatting
=
false
;
this
.
dialog
.
pageNum
=
1
;
this
.
dialog
.
pageNum
=
1
;
this
.
getDialogList
();
this
.
getDialogList
();
}
}
,
}
}
,
};
};
</
script
>
</
script
>
<
style
lang=
'scss'
scoped
>
<
style
lang=
'scss'
scoped
>
@import
'@/assets/css/variable/color.scss'
;
@import
"@/assets/css/variable/color.scss"
;
.notice-container
{
.notice-container
{
.
el-tabs
::
v-deep
{
.
el-tabs
::
v-deep
{
.
el-tabs__header
{
.
el-tabs__header
{
margin
:
0
;
margin
:
0
;
}
}
.el-tabs__active-bar
,
.el-tabs__nav-wrap
::after
{
.el-tabs__active-bar
,
.el-tabs__nav-wrap
::after
{
height
:
0
;
height
:
0
;
}
}
.el-tabs__nav-wrap
{
.el-tabs__nav-wrap
{
border-bottom
:
1px
solid
$
line-color-base
;
border-bottom
:
1px
solid
$
line-color-base
;
padding-bottom
:
5px
;
padding-bottom
:
5px
;
padding-left
:
30px
;
padding-left
:
30px
;
}
}
.el-tabs__item
{
.el-tabs__item
{
font-size
:
16px
;
font-size
:
16px
;
color
:
#
B5B5B
5
;
color
:
#
b5b5b
5
;
&.is-active{
&.is-active
{
color
:
#000
;
color
:
#000
;
font-size
:
18px
;
font-size
:
18px
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
}
}
}
}
.badge-item
{
.badge-item
{
::v-deep
.el-badge__content.is-fixed{
::v-deep
.el-badge__content.is-fixed
{
top
:
10px
;
top
:
10px
;
}
}
}
}
.notice-list
{
.notice-list
{
min-height
:
400px
;
min-height
:
400px
;
.notice-item{
.notice-item
{
position
:
relative
;
position
:
relative
;
transition
:
all
0.2s
ease-in-out
;
transition
:
all
0.2s
ease-in-out
;
&:hover{
&:hover
{
background
:
#
FAFBFC
;
background
:
#
fafbfc
;
.delete{
.delete
{
display
:
block
;
display
:
block
;
}
}
}
}
.delete
{
.delete
{
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
top
:
32px
;
top
:
32px
;
right
:
32px
;
right
:
32px
;
cursor
:
pointer
;
cursor
:
pointer
;
color
:
#6d6d6d
;
color
:
#6d6d6d
;
...
...
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