<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 微信jssdk - 拉起卡券 > 所有需要微信jssdk中 拉起卡券的業務模塊,只需在需分享頁面</body>標簽前使用 WechatIndex.php ~~~ 構建參數: $throw_wechat_card_params = [ 'appid'=>$this->wechat_account_info['authorizer_appid'], 'card_id'=>[ 'p_7k0xKFsNiPiJ31cEw7weu8FFzY' ] ]; 傳遞參數至模板引擎: return $this->fetch($this->addon_template.'/wechat_index/entry',[ 'throw_wechat_card_params'=>$throw_wechat_card_params, ]); ~~~ HTML ~~~ {:hook('throwWechatCard',$throw_wechat_card_params)} 此時底層會自動生成一個拉起卡券的方法,如下: function _add_wechat_card(success_callback,cancel_callback) { console.log(success_callback); wx.addCard({ cardList: card, success: function (res) { //成功領卡后回調 success_callback(res); }, cancel: function (res) { //取消后 回調 cancel_callback(res); } }); } 需要前端工程師編寫回調函數。即 success_callback cancel_callback 接受參數為領卡或者取消領卡的返回值。 _add_wechat_card(success_callback,cancel_callback) 如: function success_callback(res){alert('666')} function cancel_callback(res){alert('666')} ~~~ #### 舉例完整頁面 ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> entry <script> function alert() { console.log('sssss'); } </script> <button onclick="_add_wechat_card(alert,alert)">sss</button> <!--引入公共js類庫--> <script src="{php} echo config('static_host');{/php}/common/jquery.min.js"></script> <!--引入第三方類庫--> <script src="{php} echo config('static_host');{/php}/extend/layui/layui.js"></script> <!--引入模塊js--> <script src="{php} echo config('static_host');{/php}/addon/{$addon_info['name']}/{$addon_setting['template']}/main.js"></script> {:hook('wechatJssdk',$wechat_jssdk_hook_params)} {:hook('shareWechatJssdk')} {:hook('throwWechatCard',$throw_wechat_card_params)} </body> </html> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看