$params = [
'button' => [
[
'type'=>'click',
'name'=>'就送帽子',
'key'=>'V1001_PRESENT',
],
]
];
后台监听处理
if ($postObj->Event == 'CLICK') {
//------------------- 点击事件 start ------------------------
$event_key = $postObj->EventKey; // 获取key
if($event_key=='V1001_PRESENT'){ // 送帽子
$arr = array(
array(
'title' => '推荐关注,送Rofeia拉菲草帽',
'description' => "Rofeia,时尚轻奢拉菲草帽,今天免费送给你!",
'picUrl' => 'xxx.jpg',
'url' => 'xxx.html',
),
);
$this->_send_news($arr,$toUser,$fromUser);
}
//------------------- 点击事件 end ------------------------
}