Authored by 梁志锋

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

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