zoukankan      html  css  js  c++  java
  • 修改微信分享的链接地址。

    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
    wx.config({
    debug: false,
    appId: '{$wechatConfig.appId}', // 必填,公众号的唯一标识
    timestamp:'{$wechatConfig.timestamp}' , // 必填,生成签名的时间戳
    nonceStr: '{$wechatConfig.nonceStr}', // 必填,生成签名的随机串
    signature: '{$wechatConfig.signature}',// 必填,签名,见附录1
    jsApiList: [
    'onMenuShareTimeline',
    'onMenuShareAppMessage',
    'onMenuShareQQ',
    'onMenuShareWeibo',
    'onMenuShareQZone',
    'hideMenuItems',
    'showMenuItems'
    ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
    });
    var links = "{$links}";
    wx.ready(function(){
    wx.checkJsApi({
    jsApiList: [
    'onMenuShareTimeline',
    'onMenuShareAppMessage',
    'onMenuShareQQ',
    'onMenuShareWeibo',
    'onMenuShareQZone',
    'hideMenuItems',
    'showMenuItems'
    ]
    });
    wx.showMenuItems({
    menuList: ["menuItem:share:weiboApp","menuItem:share:weiboApp"] // 要显示的菜单项,所有menu项见附录3
    });
    wx.hideMenuItems({
    menuList: ["menuItem:openWithQQBrowser","menuItem:openWithSafari"] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
    });
    wx.onMenuShareTimeline({
    title: '童话之翼', // 分享标题
    link: links, // 分享链接
    desc: '关注童话之翼,领取现金红包', // 分享描述
    imgUrl: 'http://tonghua.feizhiyi.com/themes/default/img/images/headbanner.png', // 分享图标
    success: function () {
    // 用户确认分享后执行的回调函数
    },
    cancel: function () {
    // 用户取消分享后执行的回调函数
    }
    });
    wx.onMenuShareAppMessage({
    title: '童话之翼', // 分享标题
    desc: '关注童话之翼,领取现金红包', // 分享描述
    link: links, // 分享链接
    imgUrl: 'http://tonghua.feizhiyi.com/themes/default/img/images/headbanner.png', // 分享图标
    success: function () {
    // 用户确认分享后执行的回调函数
    },
    cancel: function () {
    // 用户取消分享后执行的回调函数
    }
    });
    wx.onMenuShareQQ({
    title: '童话之翼', // 分享标题
    desc: '关注童话之翼,领取现金红包', // 分享描述
    link: links, // 分享链接
    imgUrl: 'http://tonghua.feizhiyi.com/themes/default/img/images/headbanner.png', // 分享图标
    success: function () {
    // 用户确认分享后执行的回调函数
    },
    cancel: function () {
    // 用户取消分享后执行的回调函数
    }
    });
    wx.onMenuShareWeibo({
    title: '童话之翼', // 分享标题
    desc: '关注童话之翼,领取现金红包', // 分享描述
    link: links, // 分享链接
    imgUrl: 'http://tonghua.feizhiyi.com/themes/default/img/images/headbanner.png', // 分享图标
    success: function () {
    // 用户确认分享后执行的回调函数
    },
    cancel: function () {
    // 用户取消分享后执行的回调函数
    }
    });
    wx.onMenuShareQZone({
    title: '童话之翼', // 分享标题
    desc: '关注童话之翼,领取现金红包', // 分享描述
    link: "www.baidu.com", // 分享链接
    imgUrl: 'http://tonghua.feizhiyi.com/themes/default/img/images/headbanner.png', // 分享图标
    success: function () {
    // 用户确认分享后执行的回调函数
    },
    cancel: function () {
    // 用户取消分享后执行的回调函数
    }
    });
    });
    </script>

  • 相关阅读:
    双循环建表____1911年 为 辛亥年
    技巧方法
    sscanf
    02-02环境准备-pyenv与virtualenv以及venv方案对比
    02-01环境准备-virtualenv和venv
    02-01环境准备-pyenv
    【转】解决weblogic启动慢和创建域慢的方法
    chrome新版打开新标签页自动打开谷歌主页
    centos6分辨率设置
    12-openldap使用AD密码
  • 原文地址:https://www.cnblogs.com/ckf1988/p/6038482.html
Copyright © 2011-2022 走看看