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
7c7c1ddd
Commit
7c7c1ddd
authored
Feb 24, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
cdfd7a29
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
27 deletions
+56
-27
Advertising.vue
components/Advertising.vue
+16
-13
_id.vue
pages/category/_id.vue
+15
-1
index.vue
pages/knowledge/index.vue
+25
-13
No files found.
components/Advertising.vue
View file @
7c7c1ddd
...
@@ -8,19 +8,19 @@
...
@@ -8,19 +8,19 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
const
QRCode
=
process
.
client
&&
require
(
'qrcodejs2'
);
const
QRCode
=
process
.
client
&&
require
(
"qrcodejs2"
);
export
default
{
export
default
{
name
:
'Advertising'
,
name
:
"Advertising"
,
data
()
{
data
()
{
return
{
return
{
qrcode
:
null
,
qrcode
:
null
,
siteName
:
''
siteName
:
""
,
};
};
},
},
computed
:
{
computed
:
{
forums
()
{
forums
()
{
return
this
.
$store
.
state
.
site
.
info
.
attributes
||
{};
return
this
.
$store
.
state
.
site
.
info
.
attributes
||
{};
}
}
,
},
},
watch
:
{
watch
:
{
forums
:
{
forums
:
{
...
@@ -28,17 +28,17 @@ export default {
...
@@ -28,17 +28,17 @@ export default {
if
(
val
&&
val
.
set_site
)
{
if
(
val
&&
val
.
set_site
)
{
this
.
siteName
=
val
.
set_site
.
site_name
this
.
siteName
=
val
.
set_site
.
site_name
?
val
.
set_site
.
site_name
?
val
.
set_site
.
site_name
:
'Discuz! Q'
;
:
"Discuz! Q"
;
}
}
},
},
deep
:
true
deep
:
true
,
}
}
,
},
},
mounted
()
{
mounted
()
{
this
.
siteName
this
.
siteName
=
=
this
.
forums
&&
this
.
forums
.
set_site
&&
this
.
forums
.
set_site
.
site_name
this
.
forums
&&
this
.
forums
.
set_site
&&
this
.
forums
.
set_site
.
site_name
?
this
.
forums
.
set_site
.
site_name
?
this
.
forums
.
set_site
.
site_name
:
'Discuz! Q'
;
:
"Discuz! Q"
;
this
.
createQrcode
(
window
.
location
.
href
);
this
.
createQrcode
(
window
.
location
.
href
);
},
},
destroyed
()
{
destroyed
()
{
...
@@ -52,18 +52,21 @@ export default {
...
@@ -52,18 +52,21 @@ export default {
* createQrcode('https://xxx.com/')
* createQrcode('https://xxx.com/')
*/
*/
createQrcode
(
link
)
{
createQrcode
(
link
)
{
if
(
link
==
"http://wiki.bailuntec.com/category"
)
{
link
=
"http://wiki.bailuntec.com/"
;
}
if
(
process
.
client
)
{
if
(
process
.
client
)
{
this
.
qrcode
=
null
;
this
.
qrcode
=
null
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
qrcode
=
new
QRCode
(
this
.
$refs
.
qrcode
,
{
this
.
qrcode
=
new
QRCode
(
this
.
$refs
.
qrcode
,
{
width
:
70
,
width
:
70
,
height
:
70
,
// 高度
height
:
70
,
// 高度
text
:
link
// 二维码内容
text
:
link
,
// 二维码内容
});
});
});
});
}
}
}
}
,
}
}
,
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
pages/category/_id.vue
View file @
7c7c1ddd
...
@@ -220,6 +220,7 @@ export default {
...
@@ -220,6 +220,7 @@ export default {
});
});
resData
.
categoryData
=
_categoryData
;
resData
.
categoryData
=
_categoryData
;
}
}
if
(
Array
.
isArray
(
recommendUser
))
{
if
(
Array
.
isArray
(
recommendUser
))
{
resData
.
recommendUserData
=
recommendUser
;
resData
.
recommendUserData
=
recommendUser
;
}
else
if
(
recommendUser
&&
recommendUser
.
_jv
&&
recommendUser
.
_jv
.
json
)
{
}
else
if
(
recommendUser
&&
recommendUser
.
_jv
&&
recommendUser
.
_jv
.
json
)
{
...
@@ -281,6 +282,8 @@ export default {
...
@@ -281,6 +282,8 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
//var isMobile = window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i); // 是否手机端
if
(
this
.
$route
.
params
.
id
)
{
if
(
this
.
$route
.
params
.
id
)
{
this
.
categoryId
=
this
.
$route
.
params
.
id
;
this
.
categoryId
=
this
.
$route
.
params
.
id
;
this
.
getCategoryList
();
this
.
getCategoryList
();
...
@@ -306,6 +309,10 @@ export default {
...
@@ -306,6 +309,10 @@ export default {
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
},
},
methods
:
{
methods
:
{
_isMobile
(){
let
flag
=
navigator
.
userAgent
.
match
(
/
(
phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone
)
/i
)
return
flag
;
},
// 置顶主题
// 置顶主题
getThreadsSticky
()
{
getThreadsSticky
()
{
this
.
threadsStickyData
=
[];
this
.
threadsStickyData
=
[];
...
@@ -394,6 +401,7 @@ export default {
...
@@ -394,6 +401,7 @@ export default {
});
});
},
},
// 获取分类列表 用于head title显示
// 获取分类列表 用于head title显示
getCategoryList
()
{
getCategoryList
()
{
this
.
$store
.
dispatch
(
'jv/get'
,
[
'categories'
,
{}]).
then
(
this
.
$store
.
dispatch
(
'jv/get'
,
[
'categories'
,
{}]).
then
(
res
=>
{
res
=>
{
...
@@ -402,6 +410,7 @@ export default {
...
@@ -402,6 +410,7 @@ export default {
const
currentCategory
=
resData
.
find
(
item
=>
{
const
currentCategory
=
resData
.
find
(
item
=>
{
return
item
.
_jv
&&
+
item
.
_jv
.
id
===
+
this
.
categoryId
;
return
item
.
_jv
&&
+
item
.
_jv
.
id
===
+
this
.
categoryId
;
});
});
if
(
currentCategory
)
{
if
(
currentCategory
)
{
this
.
title
=
currentCategory
.
name
;
this
.
title
=
currentCategory
.
name
;
}
}
...
@@ -503,7 +512,12 @@ export default {
...
@@ -503,7 +512,12 @@ export default {
this
.
threadVideo
=
video
;
this
.
threadVideo
=
video
;
this
.
showVideoPop
=
true
;
this
.
showVideoPop
=
true
;
}
}
}
},
head
()
{
return
{
title
:
"百伦维基论坛"
,
};
},
};
};
</
script
>
</
script
>
...
...
pages/knowledge/index.vue
View file @
7c7c1ddd
...
@@ -39,20 +39,20 @@ export default {
...
@@ -39,20 +39,20 @@ export default {
userInfo
:
""
,
userInfo
:
""
,
qywxUserid
:
""
,
qywxUserid
:
""
,
loading
:
false
,
loading
:
false
,
knowledgeList
:
[]
knowledgeList
:
[]
,
};
};
},
},
computed
:
{},
computed
:
{},
mounted
()
{
mounted
()
{
const
params
=
{
const
params
=
{
include
:
"groups,wechat"
include
:
"groups,wechat"
,
};
};
if
(
!
this
.
userId
)
{
if
(
!
this
.
userId
)
{
this
.
getCode
();
this
.
getCode
();
}
}
this
.
$store
this
.
$store
.
dispatch
(
"jv/get"
,
[
`users/
${
this
.
userId
}
`
,
{
params
}])
.
dispatch
(
"jv/get"
,
[
`users/
${
this
.
userId
}
`
,
{
params
}])
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
userInfo
=
JSON
.
parse
(
res
.
wechat_info
);
this
.
userInfo
=
JSON
.
parse
(
res
.
wechat_info
);
this
.
qywxUserid
=
this
.
userInfo
.
userid
;
this
.
qywxUserid
=
this
.
userInfo
.
userid
;
if
(
!
this
.
qywxUserid
)
{
if
(
!
this
.
qywxUserid
)
{
...
@@ -64,14 +64,21 @@ export default {
...
@@ -64,14 +64,21 @@ export default {
.
get
(
.
get
(
`
${
config
.
WEI_PAN_URL
}
/weipan/getfirstfilelist?userId=
${
this
.
qywxUserid
}
`
`
${
config
.
WEI_PAN_URL
}
/weipan/getfirstfilelist?userId=
${
this
.
qywxUserid
}
`
)
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
data
.
result
.
file_list
!=
null
)
{
if
(
res
.
data
.
result
.
file_list
!=
null
)
{
const
filelist
=
res
.
data
.
result
.
file_list
.
item
;
const
filelist
=
res
.
data
.
result
.
file_list
.
item
;
this
.
knowledgeList
=
[];
this
.
knowledgeList
=
[];
filelist
.
forEach
(
element
=>
{
filelist
.
forEach
(
(
element
)
=>
{
if
(
element
.
file_status
==
"1"
)
{
if
(
element
.
file_status
==
"1"
)
{
var
date
=
element
.
ctime
.
split
(
' '
)[
0
].
split
(
"/"
)[
2
]
+
'/'
+
element
.
ctime
.
split
(
' '
)[
0
].
split
(
"/"
)[
1
]
+
'/'
+
element
.
ctime
.
split
(
' '
)[
0
].
split
(
"/"
)[
0
]
+
' '
+
element
.
ctime
.
split
(
' '
)[
1
];
var
date
=
element
.
ctime
.
split
(
" "
)[
0
].
split
(
"/"
)[
2
]
+
"/"
+
element
.
ctime
.
split
(
" "
)[
0
].
split
(
"/"
)[
1
]
+
"/"
+
element
.
ctime
.
split
(
" "
)[
0
].
split
(
"/"
)[
0
]
+
" "
+
element
.
ctime
.
split
(
" "
)[
1
];
const
knowledge
=
{
const
knowledge
=
{
title
:
element
.
file_name
,
title
:
element
.
file_name
,
...
@@ -79,7 +86,7 @@ export default {
...
@@ -79,7 +86,7 @@ export default {
time
:
date
,
time
:
date
,
fileid
:
element
.
fileid
,
fileid
:
element
.
fileid
,
fatherid
:
element
.
fatherid
,
fatherid
:
element
.
fatherid
,
filetype
:
element
.
file_type
filetype
:
element
.
file_type
,
};
};
this
.
knowledgeList
.
push
(
knowledge
);
this
.
knowledgeList
.
push
(
knowledge
);
}
}
...
@@ -102,7 +109,7 @@ export default {
...
@@ -102,7 +109,7 @@ export default {
)
{
)
{
// 静默授权
// 静默授权
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
//const code = this.getUrlParam("code"); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
const
local
=
"http://
discuz
.bailuntec.com/user/login"
;
const
local
=
"http://
wiki
.bailuntec.com/user/login"
;
const
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
const
APPID
=
"ww833808f6b8dc0745"
;
// 企业微信
window
.
location
.
href
=
window
.
location
.
href
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
...
@@ -110,7 +117,7 @@ export default {
...
@@ -110,7 +117,7 @@ export default {
"&redirect_uri="
+
"&redirect_uri="
+
encodeURIComponent
(
local
)
+
encodeURIComponent
(
local
)
+
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
;
"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
;
}
else
{
}
else
{
this
.
$message
.
warning
(
`请先登录`
);
this
.
$message
.
warning
(
`请先登录`
);
}
}
}
}
...
@@ -121,11 +128,16 @@ export default {
...
@@ -121,11 +128,16 @@ export default {
query
:
{
query
:
{
id
:
fileid
,
id
:
fileid
,
fatherid
:
fatherid
,
fatherid
:
fatherid
,
useid
:
this
.
qywxUserid
useid
:
this
.
qywxUserid
,
}
}
,
});
});
}
},
}
},
head
()
{
return
{
title
:
"知识库"
,
};
},
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
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