<?php
class elmAction extends FirstendAction
{
	
public function index(){
vendor('taobao.TopSdk');
$pid = trim(C('yh_taobao_pid'));
$apppid=explode('_', $pid);
$AdzoneId=$apppid[3];
$c = new \TopClient();
$appkey=trim(C('yh_taobao_appkey'));
$appsecret=trim(C('yh_taobao_appsecret'));
$c->appkey = $appkey;
$c->secretKey = $appsecret;
$req = new \TbkActivityInfoGetRequest();
$req->setActivityMaterialId("20150318019998877");
$track_val=cookie('trackid');
if($track_val){
$track=unserialize($track_val);
$AdzoneId = $track['t_pid'];
}
$req->setAdzoneId($AdzoneId);
$resp = $c->execute($req);
$resp = json_decode(json_encode($resp), true);
$link = $resp['data']['click_url'];

$kouling=kouling('https://img.alicdn.com/bao/uploaded/i1/2219509495/O1CN01yA0cYi2K0lETuFHN8_!!0-item_pic.jpg','饿了么外卖红包',$link);
$this->assign('kouling',$kouling);
$this->assign('qrcode',$resp['data']['wx_qrcode_url']);
	$this->_config_seo(array(
            'title' => '饿了么外卖红包每天领-'.C('yh_site_name'),
       ));
	$this->display();
	
}
	

}

