• 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 为方便开心洋葱网用户,开心洋葱官网已经开启复制功能!
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!
  • 由于近期流量激增,小站的ECS没能经的起亲们的访问,本站依然没有盈利,如果各位看如果觉着文字不错,还请看官给小站打个赏~~~~~~~~~~~~~!

微信公众自定义分享朋友圈/分享朋友url 地址内容信息

实用代码 开心洋葱 1926次浏览 0个评论

微信公众自定义分享朋友圈/分享朋友url 地址内容信息

 

<?php
require('./Awzsr/Lib/ORG/JSSDK.php');
$jssdk = new JSSDK("wwwwwxf40abd99cd16e4711111","88888b5cd7ba16d3c8992739f08ecd33a9f99999");
//$jssdk = new JSSDK("wwwwwx0b248f58042db26ccccc","00000c34675f629601689713ce74447790466666");

$signPackage = $jssdk->GetSignPackage();
?>


wx.config({
debug: true,
appId: "<?php echo $signPackage['appId'];?>",
timestamp: "<?php echo $signPackage['timestamp'];?>",
nonceStr: "<?php echo $signPackage['nonceStr'];?>",
signature: "<?php echo $signPackage['signature'];?>",
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone',
'hideMenuItems',
'showMenuItems',
'hideAllNonBaseMenuItem',
'showAllNonBaseMenuItem',
'translateVoice',
'startRecord',
'stopRecord',
'onVoiceRecordEnd',
'playVoice',
'onVoicePlayEnd',
'pauseVoice',
'stopVoice',
'uploadVoice',
'downloadVoice',
'chooseImage',
'previewImage',
'uploadImage',
'downloadImage',
'getNetworkType',
'openLocation',
'getLocation',
'hideOptionMenu',
'showOptionMenu',
'closeWindow',
'scanQRCode',
'chooseWXPay',
'openProductSpecificView',
'addCard',
'chooseCard',
'openCard'
]
});



title = "bbbb";//document.title+"abc";
desc = "";
imgUrl = "";
url = window.location.href;
var wecha_id = getCurUrl();
var new_url = url.replace("wecha_id="+wecha_id+"","");
link = "http://www.baidu.com";//new_url;

wx.ready(function () {
//alert(new_url);
setTimeout(shareUrlReplace(),1000);

});



function getCurUrl(){
var name = "wecha_id";
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
return  '';
}

function shareUrlReplace(){

		wx.ready(function () {
		
			alert('begin replace');
			
			wx.onMenuShareAppMessage({
			title: title,
			desc: desc,
			link:  link,
			imgUrl: imgUrl
			});
			
			wx.onMenuShareTimeline({
			title: title,
			link: link,
			imgUrl:imgUrl
			});
			
			wx.hideMenuItems({
      menuList: [
        'menuItem:share:email', 
        'menuItem:copyUrl',
        'menuItem:originPage'
      ],
      success: function (res) {
        //alert('“复制链接”等按钮');
      },
      fail: function (res) {
        //alert(JSON.stringify(res));
      }
    });
			
			alert('replace success');
		});
}

 


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明微信公众自定义分享朋友圈/分享朋友url 地址内容信息
喜欢 (0)

您必须 登录 才能发表评论!

加载中……