//需要注意的是获取微信签名的时候 URL不要变 不然签名会失败
//分享
shareWx(){
let shareUrl=this.$loginUrl+'/#/pages/mine/addAgent/agentInput?share=share'
let req={
title:'代理人增员',
content:'点击进行代理人增员',
imageUrl:'我是分享图片',
shareUrl:shareUrl,
type:'01',//type 01默认分享链接、02图片分享
}
nativeWechatShare(req)
},
//微信分享
export const nativeWechatShare = function(params) {
var u = navigator.userAgent,
app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//Android调用分享
window.androidBridge.nativeWechatShare(JSON.stringify(params));
}
if (isiOS) {
window.webkit.messageHandlers.nativeWechatShare.postMessage(params);
}
}