<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>

                # 附件十三 微信推送消息接口類庫源碼 ~~~ <?php /** * Created by PhpStorm. * Power By Mikkle * Email:776329498@qq.com * Date: 2017/9/15 * Time: 17:57 */ namespace mikkle\tp_wechat; use mikkle\tp_wechat\base\BaseWechatApi; /** * 微信信息同送接口操作類 * 推薦繼承或者復制本類進行修改即可 * Power: Mikkle * Email:776329498@qq.com * Class WechatApi * @package mikkle\tp_wechat */ class WechatApi extends BaseWechatApi { protected $options=[ //公眾號設置 'token'=>'***', 'appid'=>'*************', 'appsecret'=>'****************', 'encodingaeskey'=>'*************************************', ]; protected $valid = true; //網站第一次匹配 true 1為匹配 protected $isHook=true; //是否開啟鉤子 public function index() { try{ Log::notice($this->request); parent::index(); }catch (Exception $e){ Log::error($e); } } /** * 默認文本消息回復內容 * * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageText() { return '發送的是' . $this->weObj->getRevContent(); } /** * 默認圖片信息回復內容 * * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnMessageImage() { $newsarray = [ [ 'Title' => '你的圖片發送成功', 'Description' => '這是你發的圖片吧', 'PicUrl' => $this->data['PicUrl'], 'Url' => $this->request->domain(), ], ]; $reply = ['type' => 'news', 'message' => $newsarray]; return $reply; } /** * 默認語音信息回復內容處理方法 * * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageVoice() { if (!empty($this->data['Content'])) { $keyword = $this->data['Content']; //TODO::語音識別 語義分析 } else { $keyword = $this->data->type; } $reply = '發送的語音翻譯是:' . $keyword; return $reply; } /** * 默認音樂信息回復列表處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageMusic() { return '發送的是音樂'; } /** * 默認視頻信息回復處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageVideo() { return '發送的是視頻'; } /** * 默認發送地理位置回復信息處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageLocation() { return '發送的是地理位置'; } /** * 默認鏈接回復內容處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnMessageLink() { return '發送的是鏈接'; } /** * 默認關注回復處理方法 * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnEventSubscribe() { return ['type' => 'text', 'message' => '感謝你的關注']; } /** * 默認取消關注回復處理方法 * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnEventUnsubscribe() { return ['type' => 'text', 'message' => '期待你的再次關注']; } /** * 默認掃碼事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnEventScan() { $message = $this->weObj->getRevEvent(); if (isset($message["key"])) { return ['type' => 'text', 'message' => "你的掃碼成功,掃碼內容:{$message['key']}"]; } return ['type' => 'text', 'message' => '你的掃碼成功']; } /** * 默認上報地理事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnEventLocation() { return ['type' => 'text', 'message' => '地理位置上報成功']; } /** * 默認點擊菜單關鍵字處理方法 * Power: Mikkle * Email:776329498@qq.com * @return array */ protected function returnEventClick() { $message = $this->weObj->getRevEvent(); if (isset($message["key"])) { return ['type' => 'text', 'message' => "你的點擊成功,點擊關鍵字內容:{$message['key']}"]; } return ['type' => 'text', 'message' => '你的點擊成功']; } /** * 菜單調用掃碼事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @param $type * @return array */ protected function returnEventMenuScan($type) { $message = $this->weObj->getRevEvent(); switch ($type) { case "push": //推送 if (isset($message["key"])) { return ['type' => 'text', 'message' => "你的點擊菜單掃碼,關鍵字內容:{$message['key']}"]; } return ['type' => 'text', 'message' => '你的點擊菜單掃碼成功']; break; case "waitmsg": //等候 if (isset($message["key"])) { return ['type' => 'text', 'message' => "你的點擊菜單掃碼等待中,關鍵字內容:{$message['key']}"]; } return ['type' => 'text', 'message' => '你的點擊菜單掃碼等待中']; break; default: ; } } /** * 通過菜單上傳圖片處理方法 * Power: Mikkle * Email:776329498@qq.com * @param $type // sys 系統 | photo 相冊 | weixin 微信相冊 * @return array */ protected function returnEventMenuPic($type) { $message = $this->weObj->getRevEvent(); if (isset($message["key"])) { return ['type' => 'text', 'message' => "你的通過菜單上傳圖片成功,圖片方式{$type},關鍵字內容:{$message['key']}"]; } return ['type' => 'text', 'message' => "你的通過菜單上傳圖片成功,圖片方式{$type}"]; } /** * 菜單上報地理事件 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventMenuLocation() { return $reply['message'] = 'success'; } /** * 群發成功推送結果處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventSendMass() { return $reply['message'] = 'success'; } /** * 模版消息接收結果處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventSendTemplate() { return $reply['message'] = 'success'; } /** * 客服事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @param $type //create | close | switch * @return string */ protected function returnEvenKfSession($type) { return $reply['message'] = 'success'; } /** * 卡類時間 處理方法 * Power: Mikkle * Email:776329498@qq.com * @param $type //pass | notpass | user_get |user_dell * @return string */ protected function returnEventCard($type) { return $reply['message'] = 'success'; } /** * wifi連一連處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventWifiConnected() { return $reply['message'] = 'success'; } /** * 周圍搖一搖事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventAroundUserSnake() { return $reply['message'] = 'success'; } /** * 其他未知事件處理方法 * Power: Mikkle * Email:776329498@qq.com * @return string */ protected function returnEventOthers() { return $reply['message'] = 'success'; } } ~~~
                  <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>

                              哎呀哎呀视频在线观看