Authored by 郭成尧

APP_code_ADD

17.1 KB | W: | H:

21.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -45,7 +45,7 @@ class CouponController extends AbstractAction
if (!$this->isApp()) {
$this->setNavHeader($receiveData['title'], true, SITE_MAIN);
} else {
$this->setTitle($receiveData['title'],false,null);
$this->setTitle($receiveData['title'], false, null);
}
$this->_view->display('index', array(
'content' => $result,
... ... @@ -63,7 +63,8 @@ class CouponController extends AbstractAction
$returnData = array();
// 获取优惠券 ID
$receiveData = filter_input_array(INPUT_GET, array(
'couponID' => FILTER_DEFAULT
'couponID' => FILTER_DEFAULT,
'code' => FILTER_DEFAULT,
));
// 跳转 URl
$playUrl = Helpers::url('/coupon/floor');
... ... @@ -85,7 +86,7 @@ class CouponController extends AbstractAction
$returnData['url'] = Helpers::url('/signin.html', array('refer' => $playUrl), 'default');
} else {
$playUrlEncode = strtr($playUrl, array('/' => '\\/'));
$returnData['url'] = $playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}';
$returnData['url'] = $playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app","code":' . $receiveData['code'] . '}},"requesturl":{"url":"","param":{}},"priority":"N"}}';
}
} else {
// 登录后调用领券接口
... ... @@ -115,18 +116,6 @@ class CouponController extends AbstractAction
*/
public function isApp()
{
/* $userAgent = $this->getUserAgent();
if (stristr($userAgent, 'ipad')) {
return false;
}
$mobileAgents = array('iphone', 'android', "240x320", "acer", "acoon", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "anywhereyougo.com", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq", "bilbo", "bird", "blackberry", "blazer", "bleu", "cdm-", "compal", "coolpad", "danger", "dbtel", "dopod", "elaine", "eric", "etouch", "fly ", "fly_", "fly-", "go.web", "goodaccess", "gradiente", "grundig", "haier", "hedy", "hitachi", "htc", "huawei", "hutchison", "inno", "ipad", "ipaq", "ipod", "jbrowser", "kddi", "kgt", "kwc", "lenovo", "lg ", "lg2", "lg3", "lg4", "lg5", "lg7", "lg8", "lg9", "lg-", "lge-", "lge9", "longcos", "maemo", "mercator", "meridian", "micromax", "midp", "mini", "mitsu", "mmm", "mmp", "mobi", "mot-", "moto", "nec-", "netfront", "newgen", "nexian", "nf-browser", "nintendo", "nitro", "nokia", "nook", "novarra", "obigo", "palm", "panasonic", "pantech", "philips", "phone", "pg-", "playstation", "pocket", "pt-", "qc-", "qtek", "rover", "sagem", "sama", "samu", "sanyo", "samsung", "sch-", "scooter", "sec-", "sendo", "sgh-", "sharp", "siemens", "sie-", "softbank", "sony", "spice", "sprint", "spv", "symbian", "tablet", "talkabout", "tcl-", "teleca", "telit", "tianyu", "tim-", "toshiba", "tsm", "up.browser", "utec", "utstar", "verykool", "virgin", "vk-", "voda", "voxtel", "vx", "wap", "wellco", "wig browser", "wii", "windows ce", "wireless", "xda", "xde", "zte");
$isMobile = false;
foreach ($mobileAgents as $device) {
if (stristr($userAgent, $device)) {
$isMobile = true;
break;
}
}*/
$isMobile = $this->get('app_version');
return !empty($isMobile);
}
... ...