위챗 공중번호 h5 페이지 사용자 정의 공유

3446 단어 위챗
"http://res.wx.qq.com/open/js/jweixin-1.2.0.js"</span>>

<span class="hljs-keyword">var</span> <span class="hljs-variable">$share</span>={
  title: <span class="hljs-string">'{$share.sharetitle}'</span>,
  desc: <span class="hljs-string">'{$share.shareintro}'</span>,
  link: <span class="hljs-string">'{$share.shareurl}'</span>,
  imgUrl: <span class="hljs-string">'{$share.sharelogo}'</span>,
  trigger: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> {</span>
    <span class="hljs-comment">//alert(' ');</span>
  },
  success: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> {</span>
    <span class="hljs-comment">//alert(' ');</span>
    shared();
  },
  cancel: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> {</span>
    <span class="hljs-comment">//alert(' ');</span>
  },
  fail: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> {</span>
  }
}; 
  wx.config({
      debug: <span class="hljs-keyword">false</span>,
      appId: <span class="hljs-string">'{$signpackage.appId}'</span>,
      timestamp: <span class="hljs-string">"{$signpackage.timestamp}"</span>,
      nonceStr: <span class="hljs-string">'{$signpackage.nonceStr}'</span>,
      signature: <span class="hljs-string">'{$signpackage.signature}'</span>,
      jsApiList: [
        <span class="hljs-string">'previewImage'</span>,
        <span class="hljs-string">'onMenuShareTimeline'</span>,
        <span class="hljs-string">'onMenuShareAppMessage'</span>
      ]
  });
wx.ready(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> {</span>
  wx.onMenuShareAppMessage(<span class="hljs-variable">$share</span>); 
  wx.onMenuShareTimeline(<span class="hljs-variable">$share</span>); 
});

    <notempty name=<span class="hljs-string">"images"</span>>
  $(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span>{</span>
     $(<span class="hljs-string">".pagecont img"</span>).on(<span class="hljs-string">"click"</span>,<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span>{</span>
         <span class="hljs-keyword">var</span> <span class="hljs-variable">$curl</span>=$(this).attr(<span class="hljs-string">"src"</span>); 
             wx.previewImage({ 
             current:<span class="hljs-variable">$curl</span>,
              urls: 
                {<span class="hljs-variable">$images</span>}
            });
     });

  });
</notempty>

좋은 웹페이지 즐겨찾기