Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
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
front-end-dev
techbook
Commits
808a7785
Commit
808a7785
authored
May 15, 2020
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试一下分享
parent
1011a589
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
71 deletions
+61
-71
shareActCmpt.vue
src/components/shareActCmpt.vue
+42
-0
detail.vue
src/views/mobile/article/detail.vue
+19
-71
No files found.
src/components/shareActCmpt.vue
View file @
808a7785
...
...
@@ -69,6 +69,10 @@
type
:
Object
,
default
:
()
=>
{
}
},
pageType
:{
type
:
Number
,
default
:
1
}
},
methods
:
{
...
...
@@ -194,6 +198,7 @@
let
dataVal
;
if
(
this
.
detailInfo
){
if
(
this
.
pageType
==
1
){
dataVal
=
{
title
:
'您的好友邀请您参与'
+
that
.
detailInfo
.
channelTitle
,
// 分享标题
...
...
@@ -227,6 +232,43 @@
}
};
}
else
{
dataVal
=
{
title
:
that
.
detailInfo
.
contentTitle
,
// 分享标题
desc
:
that
.
detailInfo
.
contentValidity
,
// 分享描述
link
:
document
.
location
.
href
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
require
(
'../assets/img/defaultlogo.png'
),
// 分享图标
type
:
''
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
// // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
// alert('cancel')
// _this.wxShare() //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写
}
};
}
if
(
dataVal
){
setTimeout
(
function
(){
wx
.
ready
(
function
(){
...
...
src/views/mobile/article/detail.vue
View file @
808a7785
...
...
@@ -171,7 +171,7 @@
<i
class=
"iconfont icon-dingbu"
></i>
</div>
<div
class=
"applyBtn"
@
click=
"
$router.go(-1)
"
>
<div
class=
"applyBtn"
@
click=
"
handleMore
"
>
<p><i
class=
"iconfont icon-iconnews"
></i></p>
<p>
更多
</p>
...
...
@@ -180,7 +180,7 @@
<reportCmpt
v-if=
"reportVisible"
@
showReportVisible=
"showReportVisible"
:visible=
"reportVisible"
:reportType=
"1"
:commentsId=
"commentsId"
:class-name=
"className"
></reportCmpt>
<commentCmpt
@
showCommentVisible=
"showCommentVisible"
:isArticle=
"true"
v-if=
"commentVisible"
:hasScore=
"hasScore"
:hasImportant=
"false"
:commentsId=
"commentsId"
:commentsDeepId=
"commentsDeepId"
:replyCreatedBy=
"replyCreatedBy"
:isReply=
"isReply"
:isDeepReply=
"isDeepReply"
:class-name=
"className"
@
commentVisible=
"commentDialogFunc"
:visible=
"commentVisible"
></commentCmpt>
<applyLoginCmpt
v-if=
"isLogin"
@
isShowLoginDialogFunc=
"isShowLoginDialogFunc"
:activityId=
"$route.query.activityId"
:registerType=
"66"
:visible=
"isLogin"
></applyLoginCmpt>
<shareCmpt
:configVal=
"configVal"
@
postLog=
"postLog"
@
showDialogVisible=
"showDialogVisible"
@
closeShareDialog=
"closeShareDialog"
:detailInfo=
"articleInfo"
:visible=
"isShare"
:isActivityList=
"false"
v-if=
"articleInfo"
></shareCmpt>
<shareCmpt
:
pageType=
"2"
:
configVal=
"configVal"
@
postLog=
"postLog"
@
showDialogVisible=
"showDialogVisible"
@
closeShareDialog=
"closeShareDialog"
:detailInfo=
"articleInfo"
:visible=
"isShare"
:isActivityList=
"false"
v-if=
"articleInfo"
></shareCmpt>
<div
class=
"dialogTips"
v-if=
"dialogVisible"
@
click=
"dialogVisible = false"
>
<img
src=
"../../../assets/jiantou.gif"
alt=
""
>
<p>
点击右上角
</p>
...
...
@@ -257,8 +257,8 @@
handleShare
(){
this
.
configVal
=
{
title
:
this
.
articleInfo
.
contentTitle
,
desc
:
this
.
articleInfo
.
projectName
,
img
:
this
.
articleInfo
.
coverUrl
,
desc
:
this
.
articleInfo
.
contentValidity
,
img
:
require
(
'../../../assets/img/defaultlogo.png'
)
,
link
:
document
.
location
.
href
+
"&rDeviceId="
+
this
.
publicFun
.
getCookie
(
"getGuid32"
)
+
"&rEmpId="
+
(
this
.
userInfo
?
this
.
userInfo
.
empId
:
undefined
)
+
"&rTargetType="
}
if
(
Object
.
keys
(
this
.
configVal
).
length
!=
0
){
...
...
@@ -279,24 +279,10 @@
//去专家详情
handleToMasterDetail
(
data
){
if
(
data
.
isProfessor
>
0
){
this
.
$router
.
push
({
path
:
"/masterDetail"
,
query
:{
id
:
data
.
createdBy
,
stage
:
this
.
$route
.
query
.
stage
}})
this
.
$router
.
push
({
path
:
"/masterDetail"
,
query
:{
id
:
data
.
createdBy
,
stage
:
0
}})
}
},
handleSelect
(
type
){
this
.
isReturnBy
=
type
;
this
.
tipsSelect
=
false
;
this
.
page
=
1
;
// this.$store.dispatch('subjectProjectDetailCommentListAction',{path:this.$route.path,pars:this.page});
this
.
getCommentListFunc
();
},
//返回项目
handleToSecondPage
(){
this
.
$router
.
push
({
path
:
"/secondStage"
,
query
:{
id
:
this
.
$route
.
query
.
activityId
,
stage
:
this
.
$route
.
query
.
stage
}})
},
getScroll
(
e
)
{
this
.
top
=
event
.
target
.
scrollTop
;
if
(
this
.
top
>
window
.
innerHeight
)
this
.
isShowTop
=
true
;
...
...
@@ -645,14 +631,6 @@
}
},
//查看回复更多
handleToCommentMore
(
data
){
let
query
=
this
.
$route
.
query
;
query
.
commentsId
=
data
.
id
;
this
.
$router
.
push
({
path
:
"/commentMore"
,
query
:
query
})
},
//获取浏览器前缀
getDocumentFunc
(){
api
.
getDocumentAxios
().
then
(
response
=>
{
...
...
@@ -693,30 +671,6 @@
})
},
//是否显示头部和底部信息
hideTopAndBottom
(
index
,
data
){
this
.
isShowVideoInfo
=
data
;
let
params
=
{
subjectProjectId
:
this
.
$route
.
query
.
subId
};
if
(
!
data
){
api
.
playingAxios
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
this
.
$set
(
this
.
articleInfo
,
"projectPlay"
,
res
.
result
)
}
else
{
this
.
$toast
(
res
.
msg
);
}
}).
catch
((
err
)
=>
{
this
.
$toast
(
err
);
})
}
},
//展示朋友和朋友圈
showShareAndDetail
(
data
){
this
.
isShowVideoInfo
=
false
;
},
configFunc
(){
let
params
=
{
appUrl
:
window
.
location
.
href
//document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1]
...
...
@@ -737,7 +691,7 @@
});
let
dataVal
;
if
(
this
.
articleInfo
.
coverUrl
){
if
(
this
.
articleInfo
){
dataVal
=
{
title
:
this
.
articleInfo
.
contentTitle
,
// 分享标题
...
...
@@ -746,7 +700,7 @@
link
:
document
.
location
.
href
+
"&rDeviceId="
+
that
.
publicFun
.
getCookie
(
"getGuid32"
)
+
"&rEmpId="
+
(
that
.
userInfo
?
that
.
userInfo
.
empId
:
undefined
)
+
"&rTargetType=1"
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
that
.
articleInfo
.
coverUrl
,
// 分享图标
imgUrl
:
require
(
'../../../assets/img/defaultlogo.png'
)
,
// 分享图标
success
:
function
()
{
...
...
@@ -826,16 +780,20 @@
}).
catch
((
err
)
=>
{
this
.
$toast
(
err
);
})
},
handleMore
(){
this
.
$router
.
push
(
"/articleList"
)
}
},
mounted
(){
this
.
getArticleDetail
();
this
.
getRecommendListDetail
();
//
this.setCookieFunc();
//
globalMsg.$on("scrollToTop",()=>{
//
this.checkWxScroll();
//
})
this
.
setCookieFunc
();
globalMsg
.
$on
(
"scrollToTop"
,()
=>
{
this
.
checkWxScroll
();
})
},
watch
:{
//监听相同路由下参数变化的时候,从而实现异步刷新
...
...
@@ -844,20 +802,10 @@
this
.
getRecommendListDetail
();
},
}
// beforeDestroy () {
// globalMsg.$off('scrollToTop')
// },
// beforeRouteEnter(to, from, next) {
// next(vm=>{ // 这里的vm指的就是vue实例,可以用来当做this使用
// vm.pathfrom =from.fullPath;
// if(from.name!="subjectsecondStage"){
// let query = vm.$route.query;
// query.isList = false;
// vm.$router.replace({path:"/secondStageDetail",query:query})
// }
// })
// },
},
beforeDestroy
()
{
globalMsg
.
$off
(
'scrollToTop'
)
},
}
</
script
>
...
...
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