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
a1007da1
Commit
a1007da1
authored
Jan 25, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2053ffdc
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
192 deletions
+189
-192
Header.vue
components/Header.vue
+4
-4
PostItem.vue
components/PostItem.vue
+4
-1
NoticeItem.vue
components/my/NoticeItem.vue
+3
-1
config.js
config.js
+2
-2
knowledgeDetail.vue
pages/knowledge/knowledgeDetail.vue
+176
-184
No files found.
components/Header.vue
View file @
a1007da1
...
...
@@ -182,8 +182,8 @@ export default {
this
.
showSyncWanPan
=
false
;
// 获取cookies拿到token
var
token
=
this
.
getCookie
(
"BailunToken"
);
var
token
=
"Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2N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BNJF3OtQKXnGtGSaUC8rMTxzg";
var
token
=
token
.
replace
(
"Bearer%20"
,
""
).
replace
(
"Bearer "
,
""
);
if
(
token
)
{
...
...
@@ -193,8 +193,8 @@ export default {
// 更加微信用户id获取对应得用户信息并返回
axios
//
.get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`)
.
get
(
`http://discuz.bailuntec.com/api/login?useid=xiongyuwen
`
)
.
get
(
`http://discuz.bailuntec.com/api/login?useid=
${
wxUserid
}
`
)
// .get(`http://discuz.bailuntec.com/api/login?useid=chenzekai
`)
.
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
relationships
.
users
.
data
.
id
)
{
localStorage
.
setItem
(
...
...
components/PostItem.vue
View file @
a1007da1
...
...
@@ -367,6 +367,7 @@ export default {
showVideoPop
:
false
,
// 视频弹窗
isLiked
:
false
,
// 当前主题是否点赞
fileid
:
null
,
firstFileId
:
null
,
qywxUserid
:
""
,
currentAudio
:
{
id
:
""
,
...
...
@@ -416,6 +417,7 @@ export default {
if
(
res
.
data
.
statusCode
==
200
)
{
this
.
showAvatar
=
false
;
this
.
fileid
=
res
.
data
.
result
.
fileId
;
this
.
firstFileId
=
res
.
data
.
result
.
firstFileId
;;
}
});
},
...
...
@@ -504,8 +506,9 @@ export default {
// 详情路由
routerLink
()
{
if
(
!!
this
.
fileid
)
{
window
.
open
(
`/knowledge/knowledgeDetail?id=
${
this
.
fileid
}
&useid=
${
this
.
qywxUserid
}
`
,
`/knowledge/knowledgeDetail?
firstfileid=
${
this
.
firstFileId
}
&appointfile
id=
${
this
.
fileid
}
&useid=
${
this
.
qywxUserid
}
`
,
"_blank"
);
}
else
{
...
...
components/my/NoticeItem.vue
View file @
a1007da1
...
...
@@ -191,6 +191,7 @@ export default {
methods
:
{
onClickContent
(
item
)
{
let
fileid
=
null
;
let
firstFileId
=
null
;
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/GetWeiPanFileByThreadId?threadId=
${
item
.
thread_id
}
`
...
...
@@ -198,10 +199,11 @@ export default {
.
then
((
res
)
=>
{
if
(
res
.
data
.
statusCode
==
200
)
{
fileid
=
res
.
data
.
result
.
fileId
;
firstFileId
=
res
.
data
.
result
.
firstFileId
;
}
if
(
!!
fileid
)
{
window
.
open
(
`/knowledge/knowledgeDetail?id=
${
fileid
}
&useid=
${
item
.
qywxUserid
}
`
,
`/knowledge/knowledgeDetail?
firstfileid=
${
firstFileId
}
&appointfile
id=
${
fileid
}
&useid=
${
item
.
qywxUserid
}
`
,
"_blank"
);
}
else
{
...
...
config.js
View file @
a1007da1
...
...
@@ -5,6 +5,6 @@ export default {
DEV_API_URL
:
'http://discuz.bailuntec.com'
,
// ssr api url
SSR_API_URL
:
'http://discuz.bailuntec.com'
,
WEI_PAN_URL
:
'http://localhost:5008'
//
WEI_PAN_URL: 'http://pps.bailuntec.com/DiscuzApi'
//
WEI_PAN_URL: 'http://localhost:5008'
WEI_PAN_URL
:
'http://pps.bailuntec.com/DiscuzApi'
};
pages/knowledge/knowledgeDetail.vue
View file @
a1007da1
...
...
@@ -11,7 +11,7 @@
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
>
<div
slot-scope=
"
{ node, data }" style="display:flex">
<div
slot-scope=
"
{ node, data }" style="display:
flex">
<div
class=
"detail-content-left-text-custom"
>
{{
data
.
label
}}
</div>
...
...
@@ -35,12 +35,12 @@
frameborder=
"0"
mainview
.
height=
"0"
mainview
.
wdith=
"0"
style=
"border:none"
style=
"border:
none"
class=
"detail-content-right-text"
/>
</div>
<div
v-if=
"isfile == false"
>
<img
:src=
"fileSrc"
class=
"detail-content-right-img"
>
<img
:src=
"fileSrc"
class=
"detail-content-right-img"
/
>
</div>
</div>
<!--
<el-input
...
...
@@ -58,71 +58,45 @@
<div
class=
"list-top-item"
>
<nuxt-link
:to=
"`/thread/`"
target=
"_blank"
class=
"top-title"
>
<template>
百伦论坛知识库
</
template
>
<template>
百伦论坛知识库
</
template
>
<div
/>
</nuxt-link>
</div>
<topic-reward-list
:author=
"thread.user || {}"
:paid-information=
"paidInformation"
:can-paid=
"forums && forums.paycenter && forums.paycenter.wxpay_close"
:can-reward=
"
forums &&
forums.paycenter &&
forums.paycenter.wxpay_close &&
thread.canBeReward
"
:thread-type=
"thread.type || 0"
:user-lists=
"[
thread.paidUsers || [],
thread.rewardedUsers || [],
article.likedUsers || [],
[]
]"
@
payOrReward=
"showCheckoutCounter = true"
/>
<topic-actions
:thread-id=
"threadId"
:actions=
"actions || []"
@
clickAction=
"postCommand"
/>
<comment
v-if=
"renderComponent"
ref=
"comment"
:thread-id=
"threadId"
/>
</div>
</div>
</div>
</template>
<
script
>
import
axios
from
'@/plugins/axios.js'
;
import
handleError
from
'@/mixin/handleError'
;
const
threadInclude
=
'posts.replyUser,threadAudio,user.groups,user,'
+
'user.groups.permissionWithoutCategories,posts,posts.user,posts.likedUsers,posts.images,'
+
'firstPost,firstPost.likedUsers,firstPost.images,firstPost.attachments,rewardedUsers,'
+
'category,threadVideo,paidUsers,question,question.beUser,question.images,onlookers'
;
import
env
from
'@/utils/env'
;
import
config
from
'@/config.js'
;
import
axios
from
"@/plugins/axios.js"
;
import
handleError
from
"@/mixin/handleError"
;
const
threadInclude
=
"posts.replyUser,threadAudio,user.groups,user,"
+
"user.groups.permissionWithoutCategories,posts,posts.user,posts.likedUsers,posts.images,"
+
"firstPost,firstPost.likedUsers,firstPost.images,firstPost.attachments,rewardedUsers,"
+
"category,threadVideo,paidUsers,question,question.beUser,question.images,onlookers"
;
import
env
from
"@/utils/env"
;
import
config
from
"@/config.js"
;
export
default
{
data
()
{
return
{
threadId
:
'26'
,
threadId
:
"26"
,
renderComponent
:
true
,
loading
:
false
,
showViewloading
:
false
,
isShowView
:
false
,
isfile
:
true
,
fileSrc
:
''
,
fileSrc
:
""
,
isPost
:
true
,
qywxUserid
:
''
,
publishType
:
'knowledge'
,
fileMd5
:
''
,
title
:
''
,
inputContent
:
''
,
qywxUserid
:
""
,
publishType
:
"knowledge"
,
fileMd5
:
""
,
title
:
""
,
inputContent
:
""
,
data
:
[],
defaultProps
:
{
children
:
'children'
,
label
:
'label'
children
:
"children"
,
label
:
"label"
,
},
list
:
[],
thread
:
{},
...
...
@@ -131,77 +105,77 @@ export default {
postId
:
0
,
actions
:
[
{
text
:
this
.
$t
(
'topic.read'
),
text
:
this
.
$t
(
"topic.read"
),
count
:
0
,
command
:
''
,
command
:
""
,
canOpera
:
false
,
icon
:
'book'
icon
:
"book"
,
},
{
text
:
this
.
$t
(
'topic.getLike'
),
text
:
this
.
$t
(
"topic.getLike"
),
count
:
0
,
command
:
'isLiked'
,
command
:
"isLiked"
,
canOpera
:
true
,
isStatus
:
false
,
icon
:
'like'
icon
:
"like"
,
},
{
text
:
this
.
$t
(
'topic.collection'
),
command
:
'isFavorite'
,
text
:
this
.
$t
(
"topic.collection"
),
command
:
"isFavorite"
,
canOpera
:
true
,
isStatus
:
false
,
icon
:
'favor'
icon
:
"favor"
,
},
{
text
:
this
.
$t
(
'topic.share'
),
command
:
'showLink'
,
text
:
this
.
$t
(
"topic.share"
),
command
:
"showLink"
,
canOpera
:
true
,
icon
:
'link'
}
icon
:
"link"
,
}
,
],
paidInformation
:
{
price
:
'0'
,
price
:
"0"
,
paid
:
false
,
paidUsers
:
[],
paidCount
:
0
,
isPaidAttachment
:
false
,
attachmentPrice
:
'0'
attachmentPrice
:
"0"
,
},
payment
:
{
wechat_qrcode
:
''
,
rewardAmount
:
''
},
location
:
{
location
:
''
,
latitude
:
''
,
longitude
:
''
},
payment
:
{
wechat_qrcode
:
""
,
rewardAmount
:
""
},
location
:
{
location
:
""
,
latitude
:
""
,
longitude
:
""
},
managementList
:
[
{
name
:
'canEdit'
,
command
:
'toEdit'
,
name
:
"canEdit"
,
command
:
"toEdit"
,
isStatus
:
false
,
canOpera
:
false
,
text
:
this
.
$t
(
'topic.edit'
),
type
:
'0'
text
:
this
.
$t
(
"topic.edit"
),
type
:
"0"
,
},
{
name
:
'canEssence'
,
command
:
'isEssence'
,
name
:
"canEssence"
,
command
:
"isEssence"
,
isStatus
:
false
,
canOpera
:
false
,
text
:
this
.
$t
(
'topic.essence'
),
type
:
'1'
text
:
this
.
$t
(
"topic.essence"
),
type
:
"1"
,
},
{
name
:
'canSticky'
,
command
:
'isSticky'
,
name
:
"canSticky"
,
command
:
"isSticky"
,
isStatus
:
false
,
canOpera
:
false
,
text
:
this
.
$t
(
'topic.sticky'
),
type
:
'2'
text
:
this
.
$t
(
"topic.sticky"
),
type
:
"2"
,
},
{
name
:
'canHide'
,
command
:
'isDeleted'
,
name
:
"canHide"
,
command
:
"isDeleted"
,
isStatus
:
false
,
canOpera
:
false
,
text
:
this
.
$t
(
'topic.delete'
),
type
:
'3'
}
text
:
this
.
$t
(
"topic.delete"
),
type
:
"3"
,
}
,
],
showCheckoutCounter
:
false
,
showPasswordInput
:
false
,
...
...
@@ -209,8 +183,8 @@ export default {
defaultLoading
:
false
,
articleLoading
:
false
,
passwordError
:
false
,
passwordErrorTip
:
''
,
findPassword
:
false
passwordErrorTip
:
""
,
findPassword
:
false
,
};
},
computed
:
{
...
...
@@ -226,21 +200,21 @@ export default {
rewardOrPay
()
{
const
price
=
parseFloat
(
this
.
paidInformation
.
price
);
const
attachmentPrice
=
parseFloat
(
this
.
paidInformation
.
attachmentPrice
);
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
?
parseFloat
(
this
.
question
.
onlooker_unit_price
)
:
0
;
return
price
>
0
||
attachmentPrice
>
0
||
questionPrice
>
0
?
'pay'
:
'reward'
;
?
"pay"
:
"reward"
;
},
payOrRewardAmount
()
{
const
price
=
parseFloat
(
this
.
paidInformation
.
price
||
'0'
);
const
price
=
parseFloat
(
this
.
paidInformation
.
price
||
"0"
);
const
attachmentPrice
=
parseFloat
(
this
.
paidInformation
.
attachmentPrice
||
'0'
this
.
paidInformation
.
attachmentPrice
||
"0"
);
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
?
parseFloat
(
this
.
question
.
onlooker_unit_price
)
:
0
;
return
(
...
...
@@ -248,12 +222,12 @@ export default {
);
},
payOrderType
()
{
const
price
=
parseFloat
(
this
.
paidInformation
.
price
||
'0'
);
const
price
=
parseFloat
(
this
.
paidInformation
.
price
||
"0"
);
const
attachmentPrice
=
parseFloat
(
this
.
paidInformation
.
attachmentPrice
||
'0'
this
.
paidInformation
.
attachmentPrice
||
"0"
);
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
const
questionPrice
=
Object
.
keys
(
this
.
question
).
length
>
0
?
parseFloat
(
this
.
question
.
onlooker_unit_price
)
:
0
;
// 1:注册,2:打赏,3:付费主题,4:付费用户组,5:问答提问支付,6:问答围观付费, 7: 付费附件
...
...
@@ -266,40 +240,55 @@ export default {
}
else
{
return
2
;
}
}
}
,
},
created
()
{
this
.
fileSrc
=
''
;
this
.
fileSrc
=
""
;
this
.
isShowView
=
false
;
this
.
inputContent
=
''
;
this
.
title
=
''
;
this
.
qywxUserid
=
''
;
this
.
inputContent
=
""
;
this
.
title
=
""
;
this
.
qywxUserid
=
""
;
this
.
data
=
[];
this
.
loading
=
true
;
// 获取知识库带过来的id
cons
t
fildId
=
this
.
$route
.
query
.
id
;
le
t
fildId
=
this
.
$route
.
query
.
id
;
const
qywxUserid
=
this
.
$route
.
query
.
useid
;
this
.
qywxUserid
=
this
.
$route
.
query
.
useid
;
const
fatherid
=
this
.
$route
.
query
.
fatherid
;
const
appointfileid
=
this
.
$route
.
query
.
appointfileid
;
const
firstfileid
=
this
.
$route
.
query
.
firstfileid
;
if
(
!!
appointfileid
)
{
fildId
=
firstfileid
;
}
// 获取树状数据
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/getfilelisttree?userId=
${
qywxUserid
}
&fildId=
${
fildId
}
&fatherid=
${
fatherid
}
`
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
// this.data = res.data.result;
this
.
data
=
this
.
deleteChildren
(
res
.
data
.
result
);
this
.
loading
=
false
;
if
(
!!
this
.
data
)
{
let
file
=
this
.
data
.
filter
(
item
=>
item
.
file
==
true
);
if
(
!!
file
)
{
if
(
!!
this
.
data
)
{
if
(
!!
appointfileid
)
{
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/getfilelisttree?userId=
${
qywxUserid
}
&fildId=
${
appointfileid
}
`
)
.
then
((
res
)
=>
{
let
file
=
res
.
data
.
result
;
// 触发点击事件
this
.
handleNodeClick
(
file
[
0
]);
});
}
else
{
let
file
=
this
.
data
.
filter
((
item
)
=>
item
.
file
==
true
);
if
(
!!
file
)
{
// 触发点击事件
this
.
handleNodeClick
(
file
[
0
]);
}
}
}
});
if
(
Object
.
keys
(
this
.
thread
).
length
===
0
)
this
.
getThread
();
else
this
.
initData
();
...
...
@@ -333,7 +322,7 @@ export default {
return
arr
;
},
openNewForm
()
{
window
.
open
(
this
.
fileSrc
,
'_blank'
);
window
.
open
(
this
.
fileSrc
,
"_blank"
);
},
handleNodeClick
(
data
)
{
self
=
this
;
...
...
@@ -341,7 +330,7 @@ export default {
this
.
showViewloading
=
true
;
axios
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/GetFileInfo?fileId=
${
data
.
id
}
`
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
// const ele = document.querySelector(".WACPageBorder");
// ele.style.border = "none";
// console.log(ele, "ele");
...
...
@@ -378,24 +367,24 @@ export default {
},
getThread
()
{
return
this
.
$store
.
dispatch
(
'jv/get'
,
[
.
dispatch
(
"jv/get"
,
[
`threads/
${
this
.
threadId
}
`
,
{
params
:
{
include
:
threadInclude
}
}
{
params
:
{
include
:
threadInclude
}
},
])
.
then
(
data
=>
{
if
(
data
.
isDeleted
)
return
this
.
$router
.
replace
(
'/error'
);
(
data
)
=>
{
if
(
data
.
isDeleted
)
return
this
.
$router
.
replace
(
"/error"
);
this
.
articleLoading
=
false
;
this
.
thread
=
data
;
this
.
article
=
data
.
firstPost
;
this
.
postId
=
this
.
article
.
_jv
.
id
;
this
.
initData
();
},
e
=>
this
.
handleError
(
e
,
'thread'
)
(
e
)
=>
this
.
handleError
(
e
,
"thread"
)
);
},
initData
()
{
console
.
log
(
'thread => '
,
this
.
thread
);
console
.
log
(
"thread => "
,
this
.
thread
);
this
.
initManagementList
(
this
.
thread
);
this
.
initPaidInformation
(
this
.
thread
);
this
.
initActions
(
this
.
thread
,
this
.
article
);
...
...
@@ -406,13 +395,13 @@ export default {
filterImages
()
{
this
.
article
.
imageSource
=
this
.
article
.
images
;
// 把原图路径记为 imageSource
if
(
this
.
article
.
contentAttachIds
&&
this
.
article
.
contentAttachIds
.
length
>
0
&&
this
.
article
.
images
&&
this
.
article
.
images
.
length
>
0
this
.
article
.
contentAttachIds
&&
this
.
article
.
contentAttachIds
.
length
>
0
&&
this
.
article
.
images
&&
this
.
article
.
images
.
length
>
0
)
{
this
.
article
.
images
=
this
.
article
.
images
.
filter
(
image
=>
this
.
article
.
contentAttachIds
.
indexOf
(
image
.
_jv
.
id
)
<
0
(
image
)
=>
this
.
article
.
contentAttachIds
.
indexOf
(
image
.
_jv
.
id
)
<
0
);
}
},
...
...
@@ -420,7 +409,7 @@ export default {
if
(
!
data
.
question
)
return
;
this
.
question
=
data
.
question
;
this
.
question
.
onlookerState
=
data
.
onlookerState
;
console
.
log
(
this
.
question
,
'question'
);
console
.
log
(
this
.
question
,
"question"
);
},
initLocation
(
data
)
{
for
(
const
key
in
this
.
location
)
this
.
location
[
key
]
=
data
[
key
];
...
...
@@ -431,31 +420,31 @@ export default {
}
},
initManagementList
(
data
)
{
this
.
managementList
.
forEach
(
item
=>
{
this
.
managementList
.
forEach
(
(
item
)
=>
{
item
.
canOpera
=
data
[
item
.
name
];
if
(
item
.
name
===
'canEssence'
)
{
if
(
item
.
name
===
"canEssence"
)
{
item
.
isStatus
=
data
.
isEssence
;
item
.
text
=
item
.
isStatus
?
this
.
$t
(
'topic.cancelEssence'
)
:
this
.
$t
(
'topic.essence'
);
}
else
if
(
item
.
name
===
'canSticky'
)
{
?
this
.
$t
(
"topic.cancelEssence"
)
:
this
.
$t
(
"topic.essence"
);
}
else
if
(
item
.
name
===
"canSticky"
)
{
item
.
isStatus
=
data
.
isSticky
;
item
.
text
=
item
.
isStatus
?
this
.
$t
(
'topic.cancelSticky'
)
:
this
.
$t
(
'topic.sticky'
);
?
this
.
$t
(
"topic.cancelSticky"
)
:
this
.
$t
(
"topic.sticky"
);
}
});
if
(
(
this
.
thread
.
type
===
4
||
this
.
thread
.
type
===
5
)
&&
this
.
managementList
.
filter
(
item
=>
item
.
name
===
'canEdit'
).
length
>
0
(
this
.
thread
.
type
===
4
||
this
.
thread
.
type
===
5
)
&&
this
.
managementList
.
filter
((
item
)
=>
item
.
name
===
"canEdit"
).
length
>
0
)
{
// 语音贴和问答帖,不支持编辑
this
.
managementList
.
filter
(
item
=>
item
.
name
===
'canEdit'
(
item
)
=>
item
.
name
===
"canEdit"
)[
0
].
canOpera
=
false
;
}
this
.
thread
.
isEssence
=
data
.
isEssence
;
this
.
managementList
=
this
.
managementList
.
filter
(
item
=>
item
.
canOpera
);
this
.
managementList
=
this
.
managementList
.
filter
(
(
item
)
=>
item
.
canOpera
);
},
initActions
(
data
,
firstPost
)
{
const
viewInfo
=
{
...
this
.
actions
[
0
]
};
...
...
@@ -465,9 +454,9 @@ export default {
viewInfo
.
count
=
data
.
viewCount
;
favorInfo
.
isStatus
=
data
.
isFavorite
;
favorInfo
.
text
=
favorInfo
.
isStatus
?
this
.
$t
(
'topic.collectionAlready'
)
:
this
.
$t
(
'topic.collection'
);
favorInfo
.
icon
=
favorInfo
.
isStatus
?
'favored'
:
'favor'
;
?
this
.
$t
(
"topic.collectionAlready"
)
:
this
.
$t
(
"topic.collection"
);
favorInfo
.
icon
=
favorInfo
.
isStatus
?
"favored"
:
"favor"
;
favorInfo
.
canOpera
=
data
.
canFavorite
;
}
if
(
firstPost
)
{
...
...
@@ -475,9 +464,9 @@ export default {
likeInfo
.
isStatus
=
firstPost
.
isLiked
;
likeInfo
.
canOpera
=
firstPost
.
canLike
;
likeInfo
.
text
=
likeInfo
.
isStatus
?
this
.
$t
(
'topic.liked'
)
:
this
.
$t
(
'topic.getLike'
);
likeInfo
.
icon
=
likeInfo
.
isStatus
?
'liked'
:
'like'
;
?
this
.
$t
(
"topic.liked"
)
:
this
.
$t
(
"topic.getLike"
);
likeInfo
.
icon
=
likeInfo
.
isStatus
?
"liked"
:
"like"
;
}
this
.
$set
(
this
.
actions
,
0
,
viewInfo
);
...
...
@@ -486,14 +475,14 @@ export default {
},
paying
({
payWay
,
hideAvatar
,
rewardAmount
})
{
if
(
this
.
rewardOrPay
===
'reward'
&&
(
!
rewardAmount
||
parseFloat
(
rewardAmount
)
===
0
)
this
.
rewardOrPay
===
"reward"
&&
(
!
rewardAmount
||
parseFloat
(
rewardAmount
)
===
0
)
)
{
return
this
.
$message
.
error
(
this
.
$t
(
'pay.AmountCannotBeLessThan0'
));
return
this
.
$message
.
error
(
this
.
$t
(
"pay.AmountCannotBeLessThan0"
));
}
this
.
payment
.
rewardAmount
=
rewardAmount
;
this
.
showCheckoutCounter
=
false
;
if
(
payWay
===
'walletPay'
)
{
if
(
payWay
===
"walletPay"
)
{
this
.
showPasswordInput
=
true
;
this
.
createOrder
(
hideAvatar
,
...
...
@@ -503,9 +492,9 @@ export default {
).
finally
(()
=>
{
this
.
defaultLoading
=
false
;
});
}
else
if
(
payWay
===
'wxPay'
)
{
}
else
if
(
payWay
===
"wxPay"
)
{
if
(
!
this
.
forums
.
paycenter
.
wxpay_close
)
{
return
this
.
$message
.
warning
(
this
.
$t
(
'pay.wxPayClose'
));
return
this
.
$message
.
warning
(
this
.
$t
(
"pay.wxPayClose"
));
}
this
.
createOrder
(
hideAvatar
,
...
...
@@ -515,16 +504,16 @@ export default {
)
.
then
(()
=>
{
this
.
payOrder
().
then
(
wechatQrcode
=>
{
(
wechatQrcode
)
=>
{
this
.
payment
.
wechat_qrcode
=
wechatQrcode
;
this
.
wxPayActive
().
then
(
()
=>
{
this
.
getThread
();
},
()
=>
console
.
log
(
'支付失败'
)
()
=>
console
.
log
(
"支付失败"
)
);
},
()
=>
console
.
log
(
'支付失败'
)
()
=>
console
.
log
(
"支付失败"
)
);
})
.
finally
(()
=>
{
...
...
@@ -537,34 +526,34 @@ export default {
()
=>
{
this
.
getThread
();
},
()
=>
console
.
log
(
'支付失败'
)
()
=>
console
.
log
(
"支付失败"
)
);
},
postCommand
(
item
)
{
if
(
this
.
defaultLoading
)
return
;
this
.
defaultLoading
=
true
;
const
params
=
item
.
command
===
'isLiked'
?
{
_jv
:
{
type
:
`posts`
,
id
:
this
.
postId
}}
:
{
_jv
:
{
type
:
`threads`
,
id
:
this
.
threadId
}};
const
params
=
item
.
command
===
"isLiked"
?
{
_jv
:
{
type
:
`posts`
,
id
:
this
.
postId
}
}
:
{
_jv
:
{
type
:
`threads`
,
id
:
this
.
threadId
}
};
params
[
item
.
command
]
=
!
item
.
isStatus
;
return
this
.
$store
.
dispatch
(
'jv/patch'
,
params
)
.
dispatch
(
"jv/patch"
,
params
)
.
then
(
data
=>
{
(
data
)
=>
{
data
.
firstPost
&&
this
.
initManagementList
(
data
);
data
.
firstPost
&&
this
.
initActions
(
data
);
if
(
item
.
command
===
'isSticky'
)
{
if
(
item
.
command
===
"isSticky"
)
{
return
item
.
isStatus
?
this
.
$message
.
success
(
this
.
$t
(
'topic.stickySuccess'
))
:
this
.
$message
.
success
(
this
.
$t
(
'topic.cancelStickySuccess'
));
?
this
.
$message
.
success
(
this
.
$t
(
"topic.stickySuccess"
))
:
this
.
$message
.
success
(
this
.
$t
(
"topic.cancelStickySuccess"
));
}
if
(
item
.
command
===
'isLiked'
)
{
if
(
item
.
command
===
"isLiked"
)
{
return
this
.
setLikeUser
(
!
item
.
isStatus
,
data
);
}
if
(
item
.
command
===
'isDeleted'
)
return
this
.
afterDeleted
();
if
(
item
.
command
===
"isDeleted"
)
return
this
.
afterDeleted
();
},
e
=>
this
.
handleError
(
e
)
(
e
)
=>
this
.
handleError
(
e
)
)
.
finally
(()
=>
{
this
.
defaultLoading
=
false
;
...
...
@@ -580,43 +569,43 @@ export default {
},
afterDeleted
()
{
this
.
$message
({
typeInformation
:
'success'
,
message
:
this
.
$t
(
'topic.deleteSuccessAndJumpToBack'
)
typeInformation
:
"success"
,
message
:
this
.
$t
(
"topic.deleteSuccessAndJumpToBack"
),
});
setTimeout
(()
=>
{
this
.
$router
.
push
(
'/'
);
this
.
$router
.
push
(
"/"
);
},
1000
);
}
}
,
},
head
()
{
return
{
title
:
'知识库'
,
title
:
"知识库"
,
meta
:
[
{
hid
:
'keywords'
,
name
:
'keywords'
,
content
:
(
this
.
thread
.
category
&&
this
.
thread
.
category
.
name
)
||
''
hid
:
"keywords"
,
name
:
"keywords"
,
content
:
(
this
.
thread
.
category
&&
this
.
thread
.
category
.
name
)
||
""
,
},
{
hid
:
'description'
,
name
:
'description'
,
hid
:
"description"
,
name
:
"description"
,
content
:
(
this
.
thread
.
firstPost
&&
this
.
thread
.
firstPost
.
summaryText
.
slice
(
0
,
80
))
||
''
(
this
.
thread
.
firstPost
&&
this
.
thread
.
firstPost
.
summaryText
.
slice
(
0
,
80
))
||
""
,
},
{
name
:
'og:video'
,
name
:
"og:video"
,
content
:
(
this
.
thread
.
threadVideo
&&
this
.
thread
.
threadVideo
.
media_url
)
||
''
}
]
(
this
.
thread
.
threadVideo
&&
this
.
thread
.
threadVideo
.
media_url
)
||
""
,
},
],
};
},
textChange
()
{
alert
(
332
);
}
}
,
// },
// destroy() {
...
...
@@ -632,7 +621,10 @@ export default {
width: 200px;
overflow: hidden;
} */
.detail-content-left-text
.el-tree--highlight-current
.el-tree-node.is-current
>
.el-tree-node__content
{
.detail-content-left-text
.el-tree--highlight-current
.el-tree-node.is-current
>
.el-tree-node__content
{
color
:
#2e8cf0
!important
;
}
.detail-content-left-text
.el-tree-node
:focus
>
.el-tree-node__content
{
...
...
@@ -640,9 +632,9 @@ export default {
color
:
#2e8cf0
!important
;
}
.detail-content-left-text
.el-tree-node.is-current
>
.el-tree-node__content
{
background-color
:
transparent
!important
;
background-color
:
transparent
!important
;
}
.detail-content-left-text
.el-tree-node__hover
{
.detail-content-left-text
.el-tree-node__hover
{
color
:
#2e8cf0
!important
;
}
</
style
>
...
...
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