Commit 35b8fd8b authored by zhangyanni's avatar zhangyanni

ceshi

parent 4207440b
......@@ -201,6 +201,23 @@
//分享
handleOpreation(){
this.popupVisible = true;
// this.vueQrVisible = true;
// api.selectBasicParams().then(response => {
// if(response.code == 0) {
// this.url = response.result.websitePrefix +"#/activitydetail?id="+this.$route.query.id;
// } else {
// this.$toast(response.msgCode);
// }
// }).catch(error => {
// console.log("提交出错");
// return false;
// });
},
//分享给好友
handleShareFriendSquare(){
var that = this;
let params = {
appUrl:window.location.href //document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1]
......@@ -214,14 +231,11 @@
nonceStr:res.result.nonceStr,// 随机字符串
signature:res.result.signature,// 签名
jsApiList:[
'onMenuShareTimeline',
'onMenuShareAppMessage'
]// 需要使用的JS接口列表
});
this.popupVisible = true;
wx.ready(() => {
......@@ -263,6 +277,41 @@
//分享到朋友圈
})
}else{
this.$toast(res.msg);
}
}).catch((err)=>{
this.$toast(err);
})
},
//分享到朋友圈
handleShareFriend(){
var that = this;
let params = {
appUrl:window.location.href //document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1]
};
api.getConfigAxios(params).then((res)=>{
if(res.code==0){
wx.config({
debug:true,// 是否开启调试模式
appId:res.result.appId,//appid
timestamp:res.result.timestamp,// 时间戳
nonceStr:res.result.nonceStr,// 随机字符串
signature:res.result.signature,// 签名
jsApiList:[
'onMenuShareTimeline'
]// 需要使用的JS接口列表
});
wx.ready(() => {
//分享到朋友圈
wx.onMenuShareTimeline({
title: '您的好友邀请您参加'+that.detailInfo.channelTitle, // 分享标题
......@@ -296,92 +345,6 @@
}).catch((err)=>{
this.$toast(err);
})
// this.vueQrVisible = true;
// api.selectBasicParams().then(response => {
// if(response.code == 0) {
// this.url = response.result.websitePrefix +"#/activitydetail?id="+this.$route.query.id;
// } else {
// this.$toast(response.msgCode);
// }
// }).catch(error => {
// console.log("提交出错");
// return false;
// });
},
//分享给好友
handleShareFriendSquare(){
var that = this;
wx.onMenuShareAppMessage({
title: '您的好友邀请您参加'+that.detailInfo.channelTitle, // 分享标题
desc: that.detailInfo.channelTitle, // 分享描述
link: document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: require("../../../assets/img/bigBusinessLogo@2x.png"), // 分享图标
type: '', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
},
cancel: function () {
// 用户取消分享后执行的回调函数
// alert('cancel')
// _this.wxShare()  //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写 
}
})
},
//分享到朋友圈
handleShareFriend(){
var that = this;
wx.ready(() => {
//分享到朋友圈
wx.onMenuShareTimeline({
title: '您的好友邀请您参加'+that.detailInfo.channelTitle, // 分享标题
link: document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: require("../../../assets/img/bigBusinessLogo@2x.png"), // 分享图标
success: function () {
// 用户确认分享后执行的回调函数
// _this.$router.push({path:'/me',query:{}})
},
cancel: function () {
// 用户取消分享后执行的回调函数
// _this.wxShare()
}
})
})
},
//二维码
......
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