Merge branch 'feature/coupon' of http://git.dev.yoho.cn/web/yohobuywap into feature/coupon
Showing
1 changed file
with
21 additions
and
24 deletions
@@ -22,12 +22,9 @@ class CouponController extends AbstractAction | @@ -22,12 +22,9 @@ class CouponController extends AbstractAction | ||
22 | */ | 22 | */ |
23 | public function floorAction() | 23 | public function floorAction() |
24 | { | 24 | { |
25 | - | ||
26 | - if (!$this->isApp()) { | ||
27 | - $this->setNavHeader('领券中心', true, SITE_MAIN); | ||
28 | - } | ||
29 | $receiveData = filter_input_array(INPUT_GET, array( | 25 | $receiveData = filter_input_array(INPUT_GET, array( |
30 | - 'code' => FILTER_DEFAULT | 26 | + 'code' => FILTER_DEFAULT, |
27 | + 'title' => FILTER_DEFAULT, | ||
31 | )); | 28 | )); |
32 | $result = array(); | 29 | $result = array(); |
33 | $uid = ''; | 30 | $uid = ''; |
@@ -39,17 +36,17 @@ class CouponController extends AbstractAction | @@ -39,17 +36,17 @@ class CouponController extends AbstractAction | ||
39 | $resource = CouponData::getCouponRousource($receiveData['code'], $uid); | 36 | $resource = CouponData::getCouponRousource($receiveData['code'], $uid); |
40 | if (isset($resource['code']) && $resource['code'] === 200) { | 37 | if (isset($resource['code']) && $resource['code'] === 200) { |
41 | $result = CouponFloorProcess::getContent($resource['data']); | 38 | $result = CouponFloorProcess::getContent($resource['data']); |
42 | - }else{ | ||
43 | - $this->_view->display('index', array( | ||
44 | - 'content' => array( | ||
45 | - 'noData' => true, | ||
46 | - ), | ||
47 | - 'floorPage' => true | ||
48 | - )); | 39 | + } else { |
40 | + $result['noData'] = true; | ||
49 | } | 41 | } |
50 | // 分享 | 42 | // 分享 |
51 | $shareData = CouponFloorProcess::getShare($receiveData['code'], '领券中心'); | 43 | $shareData = CouponFloorProcess::getShare($receiveData['code'], '领券中心'); |
52 | $result[count($result)] = $shareData; | 44 | $result[count($result)] = $shareData; |
45 | + if (!$this->isApp()) { | ||
46 | + $this->setNavHeader($receiveData['title'], true, SITE_MAIN); | ||
47 | + } else { | ||
48 | + $this->setTitle($receiveData['title']); | ||
49 | + } | ||
53 | $this->_view->display('index', array( | 50 | $this->_view->display('index', array( |
54 | 'content' => $result, | 51 | 'content' => $result, |
55 | 'floorPage' => true | 52 | 'floorPage' => true |
@@ -118,18 +115,18 @@ class CouponController extends AbstractAction | @@ -118,18 +115,18 @@ class CouponController extends AbstractAction | ||
118 | */ | 115 | */ |
119 | public function isApp() | 116 | public function isApp() |
120 | { | 117 | { |
121 | - /* $userAgent = $this->getUserAgent(); | ||
122 | - if (stristr($userAgent, 'ipad')) { | ||
123 | - return false; | ||
124 | - } | ||
125 | - $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"); | ||
126 | - $isMobile = false; | ||
127 | - foreach ($mobileAgents as $device) { | ||
128 | - if (stristr($userAgent, $device)) { | ||
129 | - $isMobile = true; | ||
130 | - break; | ||
131 | - } | ||
132 | - }*/ | 118 | + /* $userAgent = $this->getUserAgent(); |
119 | + if (stristr($userAgent, 'ipad')) { | ||
120 | + return false; | ||
121 | + } | ||
122 | + $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"); | ||
123 | + $isMobile = false; | ||
124 | + foreach ($mobileAgents as $device) { | ||
125 | + if (stristr($userAgent, $device)) { | ||
126 | + $isMobile = true; | ||
127 | + break; | ||
128 | + } | ||
129 | + }*/ | ||
133 | $isMobile = $this->get('app_version'); | 130 | $isMobile = $this->get('app_version'); |
134 | return !empty($isMobile); | 131 | return !empty($isMobile); |
135 | } | 132 | } |
-
Please register or login to post a comment