DiYunCMS手机微信共享编码

日期:2020-12-18 类型:科技新闻 

关键词:在线网页制作,建网页,个人简介网页制作,简单网页,建立网页

隶属频道:DiYunCms升级 著作人:不祥 公布:deepdfhy访问:0次

以内容模版中加上手机微信共享编码

可自定共享主要参数


{php \Phpcmf\Service::C()- init_file( weixin $signPackage = \Phpcmf\Service::L( jssdk ,  weixin )- GetSignPackage();}
 script src= open/js/jweixin-1.0.0.js /script  
 script type= text/javascript 
 wx.config({
 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 ,
  hideMenuItems ,
  showMenuItems ,
  hideAllNonBaseMenuItem ,
  showAllNonBaseMenuItem ,
  translateVoice ,
  startRecord ,
  stopRecord ,
  onRecordEnd ,
  playVoice ,
  pauseVoice ,
  stopVoice ,
  uploadVoice ,
  downloadVoice ,
  chooseImage ,
  previewImage ,
  uploadImage ,
  downloadImage ,
  getNetworkType ,
  openLocation ,
  getLocation ,
  hideOptionMenu ,
  showOptionMenu ,
  closeWindow ,
  scanQRCode ,
  chooseWXPay ,
  openProductSpecificView ,
  addCard ,
  chooseCard ,
  openCard 
 ]
 });
 wx.ready(function () {
 
 var shareData = {
 title:  {$title} ,
 desc:  {$description} ,
 link:  {dr_now_url()} ,
 imgUrl:  {dr_get_file($thumb)} ,
 };
 //共享朋友
 wx.onMenuShareAppMessage({
 title: shareData.title,
 desc: shareData.desc,
 link: shareData.link,
 imgUrl:shareData.imgUrl,
 trigger: function (res) {
 },
&ess: function (res) {
 window.location.href =adurl;
 },
 cancel: function (res) {
 },
 fail: function (res) {
 alert(JSON.stringify(res));
 }
 });
 //微信朋友圈
 wx.onMenuShareTimeline({
 title: shareData.title+ --- +shareData.desc,
 link: shareData.link,
 imgUrl:shareData.imgUrl,
 trigger: function (res) {
 },
&ess: function (res) {
 window.location.href =adurl;
 },
 cancel: function (res) {
 },
 fail: function (res) {
 alert(JSON.stringify(res));
 }
 }); 
 
 });
 /script