Commit 808a7785 authored by zhangyanni's avatar zhangyanni

试一下分享

parent 1011a589
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
type: Object, type: Object,
default: () => { default: () => {
} }
},
pageType:{
type:Number,
default:1
} }
}, },
methods: { methods: {
...@@ -194,39 +198,77 @@ ...@@ -194,39 +198,77 @@
let dataVal; let dataVal;
if(this.detailInfo){ if(this.detailInfo){
dataVal = { if(this.pageType==1){
dataVal = {
title: '您的好友邀请您参与'+that.detailInfo.channelTitle, // 分享标题
desc: that.detailInfo.channelTitle, // 分享描述
link: document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: that.detailInfo.channelPic, // 分享图标
type: '', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
},
title: '您的好友邀请您参与'+that.detailInfo.channelTitle, // 分享标题 cancel: function () {
desc: that.detailInfo.channelTitle, // 分享描述 // 用户取消分享后执行的回调函数
link: document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 // alert('cancel')
imgUrl: that.detailInfo.channelPic, // 分享图标 // _this.wxShare()  //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写 
type: '', // 分享类型,music、video或link,不填默认为link }
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 };
}else{
dataVal = {
success: function () { title: that.detailInfo.contentTitle, // 分享标题
// // 用户确认分享后执行的回调函数 desc: that.detailInfo.contentValidity, // 分享描述
//
// _this.$router.push({path:'/me',query:{}})
}, link: document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
cancel: function () { imgUrl: require('../assets/img/defaultlogo.png'), // 分享图标
// 用户取消分享后执行的回调函数 type: '', // 分享类型,music、video或link,不填默认为link
// alert('cancel') dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
// _this.wxShare()  //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写  success: function () {
} // // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
},
cancel: function () {
// 用户取消分享后执行的回调函数
// alert('cancel')
// _this.wxShare()  //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写 
}
};
}
};
if(dataVal){ if(dataVal){
setTimeout(function(){ setTimeout(function(){
wx.ready(function(){ wx.ready(function(){
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<i class="iconfont icon-dingbu"></i> <i class="iconfont icon-dingbu"></i>
</div> </div>
<div class="applyBtn" @click="$router.go(-1)"> <div class="applyBtn" @click="handleMore">
<p><i class="iconfont icon-iconnews"></i></p> <p><i class="iconfont icon-iconnews"></i></p>
<p>更多</p> <p>更多</p>
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
<reportCmpt v-if="reportVisible" @showReportVisible="showReportVisible" :visible="reportVisible" :reportType="1" :commentsId="commentsId" :class-name="className"></reportCmpt> <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> <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> <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"> <div class="dialogTips" v-if="dialogVisible" @click="dialogVisible = false">
<img src="../../../assets/jiantou.gif" alt=""> <img src="../../../assets/jiantou.gif" alt="">
<p>点击右上角</p> <p>点击右上角</p>
...@@ -257,8 +257,8 @@ ...@@ -257,8 +257,8 @@
handleShare(){ handleShare(){
this.configVal = { this.configVal = {
title: this.articleInfo.contentTitle, title: this.articleInfo.contentTitle,
desc: this.articleInfo.projectName, desc: this.articleInfo.contentValidity,
img: this.articleInfo.coverUrl, img: require('../../../assets/img/defaultlogo.png'),
link: document.location.href+"&rDeviceId="+this.publicFun.getCookie("getGuid32")+"&rEmpId="+(this.userInfo?this.userInfo.empId:undefined)+"&rTargetType=" link: document.location.href+"&rDeviceId="+this.publicFun.getCookie("getGuid32")+"&rEmpId="+(this.userInfo?this.userInfo.empId:undefined)+"&rTargetType="
} }
if(Object.keys(this.configVal).length!=0){ if(Object.keys(this.configVal).length!=0){
...@@ -279,24 +279,10 @@ ...@@ -279,24 +279,10 @@
//去专家详情 //去专家详情
handleToMasterDetail(data){ handleToMasterDetail(data){
if(data.isProfessor>0){ 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) { getScroll(e) {
this.top = event.target.scrollTop; this.top = event.target.scrollTop;
if(this.top>window.innerHeight) this.isShowTop = true; if(this.top>window.innerHeight) this.isShowTop = true;
...@@ -645,14 +631,6 @@ ...@@ -645,14 +631,6 @@
} }
}, },
//查看回复更多
handleToCommentMore(data){
let query = this.$route.query;
query.commentsId = data.id;
this.$router.push({path:"/commentMore",query:query})
},
//获取浏览器前缀 //获取浏览器前缀
getDocumentFunc(){ getDocumentFunc(){
api.getDocumentAxios().then(response => { api.getDocumentAxios().then(response => {
...@@ -693,30 +671,6 @@ ...@@ -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(){ configFunc(){
let params = { let params = {
appUrl:window.location.href //document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1] appUrl:window.location.href //document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1]
...@@ -737,7 +691,7 @@ ...@@ -737,7 +691,7 @@
}); });
let dataVal; let dataVal;
if(this.articleInfo.coverUrl){ if(this.articleInfo){
dataVal = { dataVal = {
title: this.articleInfo.contentTitle, // 分享标题 title: this.articleInfo.contentTitle, // 分享标题
...@@ -746,7 +700,7 @@ ...@@ -746,7 +700,7 @@
link: document.location.href+"&rDeviceId="+that.publicFun.getCookie("getGuid32")+"&rEmpId="+(that.userInfo?that.userInfo.empId:undefined)+"&rTargetType=1", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 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 () { success: function () {
...@@ -826,16 +780,20 @@ ...@@ -826,16 +780,20 @@
}).catch((err)=>{ }).catch((err)=>{
this.$toast(err); this.$toast(err);
}) })
},
handleMore(){
this.$router.push("/articleList")
} }
}, },
mounted(){ mounted(){
this.getArticleDetail(); this.getArticleDetail();
this.getRecommendListDetail(); this.getRecommendListDetail();
// this.setCookieFunc(); this.setCookieFunc();
// globalMsg.$on("scrollToTop",()=>{ globalMsg.$on("scrollToTop",()=>{
// this.checkWxScroll(); this.checkWxScroll();
// }) })
}, },
watch:{ watch:{
//监听相同路由下参数变化的时候,从而实现异步刷新 //监听相同路由下参数变化的时候,从而实现异步刷新
...@@ -844,20 +802,10 @@ ...@@ -844,20 +802,10 @@
this.getRecommendListDetail(); this.getRecommendListDetail();
}, },
} },
// beforeDestroy () { beforeDestroy () {
// globalMsg.$off('scrollToTop') 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})
// }
// })
// },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment