Commit f0a27950 authored by zhangyanni's avatar zhangyanni

ceshi

parent ab90494d
......@@ -53,12 +53,7 @@
<qrCmpt :url="url" @sendVisible="isVueQrVisible"></qrCmpt>
</div>
<div class="wechatShare" v-if="popupVisible">
<mt-popup
v-model="popupVisible"
position="bottom">
<el-button @click="handleShareFriend">分享给好友</el-button>
<el-button @click="handleShareFriendSquare">分享到朋友圈</el-button>
</mt-popup>
<shareCmpt :detailInfo="detailInfo"></shareCmpt>
</div>
</div>
</template>
......@@ -68,6 +63,7 @@
import breadTop from '../../../components/mobile/breadTop';
import qrCmpt from '../../../components/common/qrcodeCmpt';
import publicFunc from '../../../common/public';
import shareCmpt from '../../../components/shareCmpt';
// import wx from 'weixin-jsapi';
import api from './api';
import {Toast,Popup} from 'mint-ui';
......@@ -77,7 +73,8 @@
breadTop,
applyCmpt,
applyProCmpt,
qrCmpt
qrCmpt,
shareCmpt
},
data(){
return {
......@@ -200,9 +197,7 @@
//分享
handleOpreation(){
this.shareFunc();
// this.popupVisible = true;
this.popupVisible = true;
// this.vueQrVisible = true;
// api.selectBasicParams().then(response => {
// if(response.code == 0) {
......@@ -301,97 +296,10 @@
this.getDetailInfo();
},
shareFunc(){
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:[
'onMenuShareAppMessage',
'onMenuShareTimeline'
]// 需要使用的JS接口列表
});
wx.ready(()=>{
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()  //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写 
}
})
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()
}
})
})
}else{
this.$toast(res.msg);
}
}).catch((err)=>{
this.$toast(err);
})
}
},
mounted(){
this.getDetailInfo();
// this.shareFunc();
}
}
</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