Authored by 梁志锋

Merge remote-tracking branch 'origin/develop' into beta

@@ -22,12 +22,12 @@ class Yohobuy @@ -22,12 +22,12 @@ class Yohobuy
22 // const API_URL2 = 'http://api.open.yohobuy.com/'; 22 // const API_URL2 = 'http://api.open.yohobuy.com/';
23 // const SERVICE_URL = 'http://service.api.yohobuy.com/'; 23 // const SERVICE_URL = 'http://service.api.yohobuy.com/';
24 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 24 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
25 - 25 +
26 // const API_URL = 'http://apih5.yoho.cn/'; 26 // const API_URL = 'http://apih5.yoho.cn/';
27 // const API_URL2 = 'http://apih5.yoho.cn/'; 27 // const API_URL2 = 'http://apih5.yoho.cn/';
28 -// const SERVICE_URL = 'http://serviceh5.yoho.cn/';  
29 -// const YOHOBUY_URL = 'http://www.yohobuy.com/';  
30 -// const API_OLD = 'http://api2.open.yohobuy.com/'; 28 + // const SERVICE_URL = 'http://serviceh5.yoho.cn/';
  29 + // const YOHOBUY_URL = 'http://www.yohobuy.com/';
  30 + // const API_OLD = 'http://api2.open.yohobuy.com/';
31 31
32 // /* 测试环境 */ 32 // /* 测试环境 */
33 // const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关 33 // const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
@@ -45,7 +45,7 @@ class Yohobuy @@ -45,7 +45,7 @@ class Yohobuy
45 45
46 /* PC重构地址 */ 46 /* PC重构地址 */
47 // const API_URL = 'http://test.open.yohobuy.com/'; 47 // const API_URL = 'http://test.open.yohobuy.com/';
48 -// const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; 48 +// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
49 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 49 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
50 // const API_OLD = 'http://api2.open.yohobuy.com/'; 50 // const API_OLD = 'http://api2.open.yohobuy.com/';
51 51
@@ -72,9 +72,9 @@ class Yohobuy @@ -72,9 +72,9 @@ class Yohobuy
72 } 72 }
73 // 苹果IPAD 73 // 苹果IPAD
74 elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { 74 elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
75 - 75 +
76 return 'ipad'; 76 return 'ipad';
77 - } 77 + }
78 elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) { 78 elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
79 return 'android'; 79 return 'android';
80 } 80 }
@@ -179,7 +179,7 @@ class Yohobuy @@ -179,7 +179,7 @@ class Yohobuy
179 if (!$returnJson && !empty($result)) { 179 if (!$returnJson && !empty($result)) {
180 $result = json_decode($result, true); 180 $result = json_decode($result, true);
181 } 181 }
182 - 182 +
183 curl_close($ch); 183 curl_close($ch);
184 $data = array(); 184 $data = array();
185 185
@@ -9,12 +9,12 @@ var $ = require('jquery'), @@ -9,12 +9,12 @@ var $ = require('jquery'),
9 9
10 var commentsNum,consultsNum; 10 var commentsNum,consultsNum;
11 11
12 -var consultFooterEle = $('.consult-content-footer')[0],  
13 - consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),  
14 -  
15 - navtabEle = document.getElementById('nav-tab'), 12 +var navtabEle = document.getElementById('nav-tab'),
16 navtabHammer = navtabEle && new Hammer(navtabEle), 13 navtabHammer = navtabEle && new Hammer(navtabEle),
17 14
  15 + // consultFooterEle = $('.consult-content-footer')[0],
  16 + // consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
  17 +
18 gotoConsultEle = document.getElementById('goto-consult'), 18 gotoConsultEle = document.getElementById('goto-consult'),
19 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle), 19 gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
20 20
@@ -70,11 +70,11 @@ if (navtabHammer) { @@ -70,11 +70,11 @@ if (navtabHammer) {
70 }); 70 });
71 } 71 }
72 72
73 -if (consultFooterHammer) {  
74 - consultFooterHammer.on('tap', function() {  
75 - location.href = $(consultFooterEle).data('href');  
76 - });  
77 -} 73 +// if (consultFooterHammer) {
  74 +// consultFooterHammer.on('tap', function() {
  75 +// location.href = $(consultFooterEle).data('href');
  76 +// });
  77 +// }
78 78
79 if (gotoConsultHammer) { 79 if (gotoConsultHammer) {
80 gotoConsultHammer.on('tap', function() { 80 gotoConsultHammer.on('tap', function() {
1 .yoho-coin-new-page { 1 .yoho-coin-new-page {
2 padding-top: pxToRem(30px); 2 padding-top: pxToRem(30px);
3 - text-align: center;  
4 - 3 + .coin{
  4 + text-align: center;
  5 + }
5 .coin-num { 6 .coin-num {
6 color: #d0021b; 7 color: #d0021b;
7 font-size: pxToRem(66px); 8 font-size: pxToRem(66px);
@@ -31,7 +32,7 @@ @@ -31,7 +32,7 @@
31 margin: pxToRem(30px) 0; 32 margin: pxToRem(30px) 0;
32 color: #444; 33 color: #444;
33 font-size: pxToRem(24px); 34 font-size: pxToRem(24px);
34 - line-height: pxToRem(36px); 35 + line-height: pxToRem(40px);
35 width: pxToRem(152px); 36 width: pxToRem(152px);
36 height: pxToRem(36px); 37 height: pxToRem(36px);
37 text-align: center; 38 text-align: center;
1 -<?php  
2 - 1 +<?php
3 /** 2 /**
4 * 启动运行 3 * 启动运行
5 * 4 *
@@ -66,19 +65,21 @@ class Bootstrap extends Bootstrap_Abstract @@ -66,19 +65,21 @@ class Bootstrap extends Bootstrap_Abstract
66 { 65 {
67 $hostParts = explode('.', $dispatcher->getRequest()->getServer('HTTP_HOST', '')); 66 $hostParts = explode('.', $dispatcher->getRequest()->getServer('HTTP_HOST', ''));
68 $level = count($hostParts) - 1; 67 $level = count($hostParts) - 1;
69 - 68 +
70 /* 根据域名的级别,设置默认的模块、控制器、方法 */ 69 /* 根据域名的级别,设置默认的模块、控制器、方法 */
71 $module = 'Index'; 70 $module = 'Index';
72 $controller = 'Index'; 71 $controller = 'Index';
73 $action = 'Index'; 72 $action = 'Index';
74 -  
75 - // 二级域名 73 + // 三级域名
76 if (2 === $level) { 74 if (2 === $level) {
77 $subDomain = strval($hostParts[0]); 75 $subDomain = strval($hostParts[0]);
78 switch (strtolower($subDomain)) { 76 switch (strtolower($subDomain)) {
79 - case 'www': // 主站  
80 - case 'new': // 原新版  
81 - case 'dev': // 开发环境 77 + case 'm': // 老版(到频道选择)
  78 + case 'buy': // 测试环境的域名, 以后可去掉
  79 + case 'login': // 登录
  80 + break;
  81 + case 'new': // 原新版(到男生首页)
  82 + $controller = 'Boys';
82 break; 83 break;
83 case 'search': // 搜索 84 case 'search': // 搜索
84 $controller = 'Search'; 85 $controller = 'Search';
@@ -88,12 +89,12 @@ class Bootstrap extends Bootstrap_Abstract @@ -88,12 +89,12 @@ class Bootstrap extends Bootstrap_Abstract
88 $module = 'Guang'; 89 $module = 'Guang';
89 break; 90 break;
90 case 'list': // 商品列表 91 case 'list': // 商品列表
  92 + case 'item': // 商品详情
91 $module = 'Product'; 93 $module = 'Product';
92 break; 94 break;
93 - case 'sale'://促销  
94 - $module = 'Product';  
95 - $controller = 'sale';  
96 - 95 + case 'cart': // 购物车
  96 + $module = 'Cart';
  97 + break;
97 default: // 其它(识别为品牌) 98 default: // 其它(识别为品牌)
98 $module = 'Product'; 99 $module = 'Product';
99 $action = 'Brand'; 100 $action = 'Brand';
@@ -104,6 +105,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -104,6 +105,7 @@ class Bootstrap extends Bootstrap_Abstract
104 $dispatcher->getRequest()->module = $module; 105 $dispatcher->getRequest()->module = $module;
105 $dispatcher->getRequest()->controller = $controller; 106 $dispatcher->getRequest()->controller = $controller;
106 $dispatcher->getRequest()->action = $action; 107 $dispatcher->getRequest()->action = $action;
  108 +
107 /* 根据对应模块的配置,添加相应的路由规则 */ 109 /* 根据对应模块的配置,添加相应的路由规则 */
108 $iniFile = APPLICATION_PATH . '/configs/routes.' . strtolower($module) . '.ini'; 110 $iniFile = APPLICATION_PATH . '/configs/routes.' . strtolower($module) . '.ini';
109 if (file_exists($iniFile)) { 111 if (file_exists($iniFile)) {
1 <?php 1 <?php
2 -use Action\WebAction; 2 +use Action\WebAction;
3 use Index\HomeModel; 3 use Index\HomeModel;
4 - 4 +use Plugin\Captcha;
5 /** 5 /**
6 * 女首 6 * 女首
7 */ 7 */
@@ -18,4 +18,5 @@ class GirlsController extends WebAction @@ -18,4 +18,5 @@ class GirlsController extends WebAction
18 ); 18 );
19 $this->_view->display('index', $data); 19 $this->_view->display('index', $data);
20 } 20 }
  21 +
21 } 22 }
1 -<?php  
2 -use Action\WebAction;  
3 -use Plugin\Captcha;  
4 -class ImagesController extends WebAction  
5 -{  
6 - /**  
7 - * 验证码-生成  
8 - *  
9 - * @return mixed 验证码图片  
10 - */  
11 - public function indexAction()  
12 - {  
13 - $g = trim($this->get('g'));  
14 - $namespace = !empty($g) ? $g : 'passport_istration';  
15 - $imgCode = new Captcha();  
16 - $imgCode->setWidth(150)->setHeight(50)->setWordLen(4)->generate($namespace);  
17 - exit();  
18 - }  
19 -  
20 - /**  
21 - * 验证码-检测  
22 - *  
23 - * @param string auth_code (验证码)  
24 - * @return string true|false  
25 - */  
26 - public function verifyimgcodeAction ()  
27 - {  
28 - if (strtolower($this->get('auth_code')) !== strtolower(Captcha::getFromSession('passport_istration')))  
29 - {  
30 - die('false');  
31 - }  
32 - die('true');  
33 - } 1 +<?php
  2 +use Action\WebAction;
  3 +use Plugin\Captcha;
  4 +class ImagesController extends WebAction
  5 +{
  6 + /**
  7 + * 验证码-生成
  8 + *
  9 + * @return mixed 验证码图片
  10 + */
  11 + public function indexAction()
  12 + {
  13 + $g = trim($this->get('g'));
  14 + $namespace = !empty($g) ? $g : 'passport_istration';
  15 + $imgCode = new Captcha();
  16 + $imgCode->setWidth(150)->setHeight(50)->setWordLen(4)->generate($namespace);
  17 + exit();
  18 + }
  19 +
  20 + /**
  21 + * 验证码-检测
  22 + *
  23 + * @param string auth_code (验证码)
  24 + * @return string true|false
  25 + */
  26 + public function verifyimgcodeAction ()
  27 + {
  28 + if (strtolower($this->get('auth_code')) !== strtolower(Captcha::getFromSession('passport_istration')))
  29 + {
  30 + die('false');
  31 + }
  32 + die('true');
  33 + }
34 } 34 }
1 -<?php 1 +<?php
2 use Yaf\Application; 2 use Yaf\Application;
3 3
4 define('SITE_MAIN', 'http://web.dev.yohobuy.com'); // 网站主域名 4 define('SITE_MAIN', 'http://web.dev.yohobuy.com'); // 网站主域名