zoukankan      html  css  js  c++  java
  • 微信等待验证的功能

    1.一键关注<a href="weixin://contacts/profile/gh_f909cde51807">点我关注</a>
    
    2.
    
    var url = document.URL;
    var title= document.title;
    var 	dec;
    if(document.getElementById("description") == null){
    	dec =url;
    }else{
    	dec = document.getElementById("description").content;
    }
    var pageImg = document.getElementById("pageImg").src;
    
    
    var dataForWeixin={
       appId:"",
       MsgImg:pageImg,
       TLImg:pageImg,
       url:url,
       title:title,
       desc:dec,
       fakeid:"",
       callback:function(){}
    };
    (function(){
       var onBridgeReady=function(){
       WeixinJSBridge.on('menu:share:appmessage', function(argv){
          WeixinJSBridge.invoke('sendAppMessage',{
             "appid":dataForWeixin.appId,
             "img_url":dataForWeixin.MsgImg,
             "img_width":"120",
             "img_height":"120",
             "link":dataForWeixin.url,
             "desc":dataForWeixin.desc,
             "title":dataForWeixin.title
          }, function(res){(dataForWeixin.callback)();});
       });
       WeixinJSBridge.on('menu:share:timeline', function(argv){
          (dataForWeixin.callback)();
          WeixinJSBridge.invoke('shareTimeline',{
             "img_url":dataForWeixin.TLImg,
             "img_width":"120",
             "img_height":"120",
             "link":dataForWeixin.url,
             "desc":dataForWeixin.desc,
             "title":dataForWeixin.title
          }, function(res){});
       });
       WeixinJSBridge.on('menu:share:weibo', function(argv){
          WeixinJSBridge.invoke('shareWeibo',{
             "content":dataForWeixin.title,
             "url":dataForWeixin.url
          }, function(res){(dataForWeixin.callback)();});
       });
       WeixinJSBridge.on('menu:share:facebook', function(argv){
          (dataForWeixin.callback)();
          WeixinJSBridge.invoke('shareFB',{
             "img_url":dataForWeixin.TLImg,
             "img_width":"120",
             "img_height":"120",
             "link":dataForWeixin.url,
             "desc":dataForWeixin.desc,
             "title":dataForWeixin.title
          }, function(res){});
       });
    };
    if(document.addEventListener){
       document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
    }else if(document.attachEvent){
       document.attachEvent('WeixinJSBridgeReady'   , onBridgeReady);
       document.attachEvent('onWeixinJSBridgeReady' , onBridgeReady);
    }
    })();
    
    
    <meta name="description" content="成品供应,西装工艺,真正的好窗帘。打造中国布艺第一品牌"  id="description" />
    
    <img id="pageImg" style=" display:none"  src="http://oss.team.qaz.so/forum/201403/05/100724xjtihurntjrhtibj.png" />
    
    3.直接返回界面 WeixinJSBridge.call('closeWindow');
    
  • 相关阅读:
    三级听力
    查找算法集(数组实现、链表实现)(转贴)
    男人一生必须要做10件事(转载)
    经典源码网(集合)
    ubuntu8.04下mplayer错误error:could not open required directshow codec drvc.dll
    asp.net 访问 iis的权限 问题
    OPENROWSET 说明
    vb多线程问题
    收缩数据库日志文件(转贴)
    Update 两个表之间数据更新
  • 原文地址:https://www.cnblogs.com/Codenewbie/p/3642032.html
Copyright © 2011-2022 走看看