Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

Conflicts:
	library/Action/AbstractAction.php
	yohobuy/m.yohobuy.com/application/controllers/Girls.php
存放生成的HTML文件等
\ No newline at end of file
... ...
... ... @@ -9,11 +9,11 @@
* @version 1.0 (2015-9-15 11:55:25)
* @author fei.hong <fei.hong@yoho.cn>
*/
namespace Action;
use Yaf\Controller_Abstract;
use Yaf\Dispatcher;
use Hood\Cache;
class AbstractAction extends Controller_Abstract
... ... @@ -57,7 +57,7 @@ class AbstractAction extends Controller_Abstract
{
return $this->_request->getPost($key, $default);
}
/**
* 使用Memcache缓存
*
... ... @@ -67,13 +67,16 @@ class AbstractAction extends Controller_Abstract
*/
protected function memcache($node = null, $childNode = 'hosts')
{
// WINDOWS
if (PATH_SEPARATOR === '\\') {
return Cache::memcache($node, $childNode);
} else {
}
// LINUX
else {
return Cache::memcached($node, $childNode);
}
}
/**
* 关闭模板自动渲染
*
... ... @@ -83,7 +86,7 @@ class AbstractAction extends Controller_Abstract
{
Dispatcher::getInstance()->autoRender(false);
}
/**
* 输出JSON数据到浏览器
*
... ... @@ -92,14 +95,14 @@ class AbstractAction extends Controller_Abstract
protected function echoJson($json)
{
headers_sent() || header('Content-Type: application/json; charset=utf-8;');
if(is_array($json))
{
if (is_array($json)) {
$json = json_encode($json);
}
echo $json;
}
/**
* 返回JSON数据
*
... ... @@ -116,7 +119,7 @@ class AbstractAction extends Controller_Abstract
'data' => $data,
));
}
/**
* 判断是不是AJAX请求
*
... ... @@ -126,14 +129,14 @@ class AbstractAction extends Controller_Abstract
{
return $this->_request->isXmlHttpRequest();
}
/**
* 跳转到错误页面
*/
protected function error()
{
headers_sent() || header('Location: /error.html');
exit;
}
... ... @@ -175,4 +178,87 @@ class AbstractAction extends Controller_Abstract
);
}
/*
* 设置网站SEO的标题
*
* @param string $title 标题
* @return void
*/
protected function setTitle($title)
{
$this->_view->assign('title', $title);
}
/**
* 设置网站SEO的关键词
*
* @param string $keywords 关键词,多个之间用","逗号分隔
* @return void
*/
protected function setKeywords($keywords)
{
$this->_view->assign('keywords', $keywords);
}
/**
* 设置网站SEO的描述内容
*
* @param string $description 描述内容
* @return void
*/
protected function setDescription($description)
{
$this->_view->assign('description', $description);
}
/**
* 设置网站导航头部信息
*
* @param string $backUrl 返回的链接
* @param string $title 头部标题
* @param string $homeUrl 返回首页的链接
* @return void
*/
protected function setNavHeader($backUrl, $title, $homeUrl)
{
$header = array();
if (!empty($backUrl)) {
$header['pageHeader']['navBack'] = $backUrl;
}
if (!empty($title)) {
$header['pageHeader']['navTitle'] = $title;
}
if (!empty($homeUrl)) {
$header['pageHeader']['navHome'] = $homeUrl;
}
$this->_view->assign('header', $header);
}
/**
* 设置网站导航底部信息
*
* @return void
*/
protected function setNavFooter()
{
$footer = array();
// 已登录 @todo
if (false) {
$footer['pageFooter']['user'] = array();
$footer['pageFooter']['user']['name'] = 'goodboy'; // 昵称
$footer['pageFooter']['user']['url'] = ''; // 个人中心链接
$footer['pageFooter']['user']['signoutUrl'] = ''; // 登出链接
}
// 未登录
else {
$footer['pageFooter'] = array();
$footer['pageFooter']['loginUrl'] = ''; // 登录链接
$footer['pageFooter']['signupUrl'] = ''; // 注册链接
}
$this->_view->assign('footer', $footer);
}
... ...
... ... @@ -19,14 +19,16 @@ class LoginData
/**
* 登录
*
* @param string $area 地区编号
* @param string $profile 邮箱或手机号
* @param string $password 密码
* @return array
*/
public static function signin($profile, $password)
public static function signin($area, $profile, $password)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.signin';
$param['area'] = $area;
$param['profile'] = $profile;
$param['password'] = $password;
... ...
... ... @@ -33,7 +33,7 @@ class Helpers
if (!isset($productData['product_skn'])) {
return false;
}
// 市场价和售价一样,则不显示市场价
if (intval($productData['market_price']) === intval($productData['sales_price'])) {
$productData['market_price'] = false;
... ... @@ -46,31 +46,168 @@ class Helpers
$result['name'] = $productData['product_name'];
$result['price'] = $productData['market_price'];
$result['salePrice'] = $productData['sales_price'];
$result['isFew'] = ($productData['is_soon_sold_out'] === 'Y') ? true : false;
$result['isFew'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = ''; // @todo
$result['tags'] = array(
'isNew' => false, // 新品
'isSale' => false, // 在售
'isLimit' => false, // 限量
'isNewFestival' => false, // 新品节
'isReNew' => false, // 再到着
'isYohood' => false, // YOHOOD
'midYear' => false, // 年中
'yearEnd' => false, // 年末
);
foreach ($productData['tags'] as $tag) {
if ($tag['is_limited'] === 'Y') {
$result['tags']['isLimit'] = true;
} elseif ($tag['is_yohood'] === 'Y') {
$result['tags']['isYohood'] = true;
} elseif ($tag['is_new'] === 'Y') {
$result['tags']['isNew'] = true;
$result['tags'] = array();
$result['tags']['isNew'] = isset($productData['is_new']) && $productData['is_new'] === 'Y'; // 新品
$result['tags']['isSale'] = isset($productData['is_discount']) && $productData['is_discount'] === 'Y'; // 在售
$result['tags']['isLimit'] = isset($productData['is_limited']) && $productData['is_limited'] === 'Y'; // 限量
$result['tags']['isYohood'] = isset($productData['is_yohood']) && $productData['is_yohood'] === 'Y'; // YOHOOD
$result['tags']['midYear'] = isset($productData['mid-year']) && $productData['mid-year'] === 'Y'; // 年中
$result['tags']['yearEnd'] = isset($productData['year-end']) && $productData['year-end'] === 'Y'; // 年末
$result['tags']['isReNew'] = false; // 再到着
$result['tags']['isNewFestival'] = false; // 新品节
return $result;
}
/**
* 生成公开的TOKEN凭证
*
* @param string $string 字符串
* @return string
*/
public static function makeToken($string)
{
return md5(md5($string . '#@!@#'));
}
/**
* 验证TOKEN凭证
*
* @param string $string 字符串
* @param string $token 公开访问TOKEN
* @return bool
*/
public static function verifyToken($string, $token)
{
if ($token === self::makeToken($string)) {
return true;
}
else {
return false;
}
}
/**
* 验证手机是否合法
*
* @param int $mobile
* @return boolean
*/
public static function verifyMobile($mobile)
{
if (empty($mobile)) {
return false;
}
return (bool) preg_match('/^1[3|4|5|8|7][0-9]{9}$/', trim($mobile));
}
/**
* 验证密码是否合法
*
* @param int $password
* @return boolean
*/
public static function verifyPassword($password)
{
if (empty($password)) {
return false;
}
return (bool) preg_match('/^([a-zA-Z0-9\-\+_!@\#$%\^&\*\(\)\:\;\.=\[\]\\\',\?]){6,20}$/', trim($password));
}
/**
* 验证邮箱是否合法
*
* @param string $email
* @return boolean
*/
public static function verifyEmail($email)
{
if (empty($email)) {
return false;
}
return !!filter_var($email, FILTER_VALIDATE_EMAIL);
}
/**
* 验证国际手机号是否合法
*
* @param string $areaMobile
* @return boolean
*/
public static function verifyAreaMobile($areaMobile)
{
if (empty($areaMobile)) {
return false;
}
if (!strpos($areaMobile, '-')) {
return self::areaMobielVerify($areaMobile);
} else {
$mobileData = explode('-', $areaMobile);
if (count($mobileData) != 2) {
return false;
}
}
return $result;
return self::areaMobielVerify($mobileData[1], $mobileData[0]);
}
}
\ No newline at end of file
/**
* 各国手机号规则
*/
private static function areaMobielVerify($mobile, $area = 86)
{
$verify = array(
86 => array(
'name' => '中国',
'match' => (bool) preg_match('/^1[3|4|5|8|7][0-9]{9}$/', trim($mobile)),
),
852 => array(
'name' => '中国香港',
'match' => (bool) preg_match('/^[9|6|5][0-9]{7}$/', trim($mobile)),
),
853 => array(
'name' => '中国澳门',
'match' => (bool) preg_match('/^[0-9]{8}$/', trim($mobile)),
),
886 => array(
'name' => '中国台湾',
'match' => (bool) preg_match('/^[0-9]{10}$/', trim($mobile)),
),
65 => array(
'name' => '新加坡',
'match' => (bool) preg_match('/^[9|8][0-9]{7}$/', trim($mobile)),
),
60 => array(
'name' => '马来西亚',
'match' => (bool) preg_match('/^1[1|2|3|4|6|7|9][0-9]{8}$/', trim($mobile)),
),
1 => array(
'name' => '加拿大&美国',
'match' => (bool) preg_match('/^[0-9]{10}$/', trim($mobile)),
),
82 => array(
'name' => '韩国',
'match' => (bool) preg_match('/^01[0-9]{9}$/', trim($mobile)),
),
44 => array(
'name' => '英国',
'match' => (bool) preg_match('/^7[7|8|9][0-9]{8}$/', trim($mobile)),
),
81 => array(
'name' => '日本',
'match' => (bool) preg_match('/^0[9|8|7][0-9]{9}$/', trim($mobile)),
),
61 => array(
'name' => '澳大利亚',
'match' => (bool) preg_match('/^[0-9]{11}$/', trim($mobile)),
),
);
if (isset($verify[$area])) {
return $verify[$area]['match'];
}
return false;
}
}
... ...
server
{
listen 80;
server_name wap.yohobuy.com;
#access_log /Data/logs/access.wap.yohobuy.com.log combined;
error_log /Data/logs/error.wap.yohobuy.com.log warn;
root /Data/PE/yohobuy/yohobuy/m.yohobuy.com/public;
location ~* \.html$ {
root /Data/PE/yohobuy/assets;
if (!-f $request_filename){
root /Data/PE/yohobuy/yohobuy/m.yohobuy.com/public;
rewrite ^/(.+)$ /index.php?$1& last;
}
expires 7d;
}
location / {
index index.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index.php?$1& last;
}
}
location ~* \.(ico|woff)$ {
expires 7d;
}
location = /crossdomain.xml {
expires 7d;
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 403 = http://wap.yohobuy.com;
error_page 404 = http://wap.yohobuy.com/error.html;
}
server
{
listen 80;
server_name static.wap.yohobuy.com;
#access_log /Data/logs/access.static.wap.yohobuy.com.log combined;
#error_log /Data/logs/error.static.wap.yohobuy.com.log warn;
root /Data/PE/yohobuy/static;
location / {
log_not_found off;
access_log off;
expires 30d;
}
location ~* \.(svg|eot|ttf|woff|otf)$ {
add_header Access-Control-Allow-Origin *;
expires 30d;
}
}
\ No newline at end of file
... ...
... ... @@ -360,3 +360,21 @@
172.16.6.241 - - [13/Oct/2015:14:17:09 +0800] "GET /img/layout/back.png?1444369440 HTTP/1.1" 200 1063 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:14:17:09 +0800] "GET /font/iconfont.woff?1444612439 HTTP/1.1" 200 7740 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:14:17:09 +0800] "GET /img/layout/home.png?1444369440 HTTP/1.1" 200 1226 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:16:30:43 +0800] "GET /css/index.css HTTP/1.1" 200 36732 "http://m.dev.yohobuy.com/passport/back/email" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:16:30:45 +0800] "GET /css/index.css HTTP/1.1" 200 36732 "http://m.dev.yohobuy.com/passport/back/email" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:16:30:46 +0800] "GET /css/index.css HTTP/1.1" 200 36732 "http://m.dev.yohobuy.com/passport/back/email" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.241 - - [13/Oct/2015:16:31:03 +0800] "-" 400 0 "-" "-"
172.16.6.241 - - [13/Oct/2015:16:31:03 +0800] "-" 400 0 "-" "-"
172.16.6.248 - - [13/Oct/2015:16:31:13 +0800] "-" 400 0 "-" "-"
127.0.0.1 - - [13/Oct/2015:16:31:13 +0800] "-" 400 0 "-" "-"
127.0.0.1 - - [13/Oct/2015:16:31:20 +0800] "GET /girls HTTP/1.1" 499 0 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
127.0.0.1 - - [13/Oct/2015:16:31:23 +0800] "GET /girls HTTP/1.1" 200 2067 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
172.16.6.248 - - [13/Oct/2015:16:31:23 +0800] "GET /img/app-logo.png?1441873709 HTTP/1.1" 200 5598 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
172.16.6.248 - - [13/Oct/2015:16:31:23 +0800] "GET /font/iconfont.woff?1444716801 HTTP/1.1" 200 7740 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
172.16.6.248 - - [13/Oct/2015:16:31:23 +0800] "GET /img/close-icon.png?1441873709 HTTP/1.1" 200 1700 "http://172.16.6.248:8088/css/index.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
127.0.0.1 - - [13/Oct/2015:16:33:28 +0800] "GET /girls HTTP/1.1" 200 8465 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.248 - - [13/Oct/2015:16:33:28 +0800] "GET /css/index.css HTTP/1.1" 200 36732 "http://m.dev.yohobuy.com/girls" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.248 - - [13/Oct/2015:16:33:28 +0800] "GET /img/app-logo.png?1441873709 HTTP/1.1" 304 0 "http://m.dev.yohobuy.com/girls" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.248 - - [13/Oct/2015:16:33:28 +0800] "GET /font/iconfont.woff?1444716801 HTTP/1.1" 304 0 "http://m.dev.yohobuy.com/girls" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
172.16.6.248 - - [13/Oct/2015:16:33:28 +0800] "GET /img/close-icon.png?1441873709 HTTP/1.1" 304 0 "http://m.dev.yohobuy.com/girls" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
127.0.0.1 - - [13/Oct/2015:16:33:28 +0800] "GET /favicon.ico HTTP/1.1" 200 1150 "http://m.dev.yohobuy.com/girls" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"
... ...
... ... @@ -14,6 +14,8 @@ var tip = require('../../plugin/tip');
var trim = $.trim;
var showErrTip = tip.show;
var $mobile = $('#mobile');
api.bindEyesEvt();
$pwd.bind('input', function() {
... ... @@ -25,19 +27,45 @@ $pwd.bind('input', function() {
});
$btnOk.on('touchstart', function() {
var pwd = trim($pwd.val());
var pwd = trim($pwd.val()),
mobileBack = true,
setting,
url;
if ($btnOk.hasClass('disable')) {
return;
}
setting = {
password: pwd
};
if ($mobile.length === 0) {
mobileBack = false;
}
if (mobileBack) {
$.extend(setting, {
mobile: $mobile.val(),
areaCode: $('#areaCode').val(),
token: $('#token').val()
});
url = '/passport/back/passwordByMobile';
} else {
$.extend(setting, {
code: $('#email-code').val()
});
url = '/passport/back/passwordByEmail';
}
if (api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: '/passport/back/update',
data: {
password: pwd
},
data: setting,
success: function(data) {
if (data.code === 200) {
showErrTip('密码修改成功');
... ...
/* @include keyframes(turn) {
1% {
@include rotateX(90deg);
background: image-url('yohologo02.png') no-repeat center center;
background-size: 100%
}
2% {
@include rotateX(180deg);
background: image-url('yohologo01.png') no-repeat center center;
background-size: 100%
}
3% {
@include rotateX(90deg);
background: image-url('yohologo02.png') no-repeat center center;
background-size: 100%
}
4% {
@include rotateX(0deg);
background: image-url('yohologo02.png') no-repeat center center;
background-size: 100%
}
100% {
@include rotateX(0deg);
background: image-url('yohologo02.png') no-repeat center center;
background-size: 100%
}
} */
.home-header {
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
@include background-image(linear-gradient(#323232, #414141));
position: relative;
.iconfont {
color: #fff;
}
.nav-btn {
position: absolute;
left: 32rem / $pxConvertRem;
top: 0;
bottom: 0;
z-index: 2;
}
.logo {
display: block;
margin: 0 auto;
width: 208rem / $pxConvertRem;
height: 87rem / $pxConvertRem;
background: image-url("yohologo02.png") no-repeat center center;
background-size: 100%;
/*@include animation(60s turn infinite);*/
&.animate{
background: image-url("yohologo01.png") no-repeat center center;
background-size: 100%;
}
}
.search-btn {
position: absolute;
right: 32rem / $pxConvertRem;
top: 0;
bottom: 0;
a{
color: #fff;
}
}
}
.girls-wrap .home-header {
background: #FF88AE;
}
.kids-wrap .logo {
font-style: italic;
font-family: "helvetica","Arial","榛戜綋";
font-weight: bold;
color: #fff;
}
\ No newline at end of file
... ...
.search-input{
position: relative;
padding:13rem / $pxConvertRem 20rem / $pxConvertRem;
input{
display: block;
width: 547rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
border: none;
padding: 0 0 0 53rem / $pxConvertRem;
margin: 0;
outline: none;
font-family: helvetica,Arial,"黑体";
border-radius: 50rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
}
.search-icon{
position: absolute;
top: 0;
bottom: 0;
color: #999;
line-height: 86rem / $pxConvertRem;
left: 43rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
.two-column-goods {
margin: (30rem / $pxConvertRem) 0 0;
padding: (36rem / $pxConvertRem) 0 0;
background: #fff;
border-top: 1px solid #e0e0e0;
.column-nav {
padding: 0 0 (30rem / $pxConvertRem);
line-height: 32rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
border-bottom: 1px solid #f1f1f1;
li {
float: left;
width: 319rem / $pxConvertRem;
text-align: center;
color: #aaa;
}
li.current {
color: #000;
}
li:first-child {
border-right: 1px solid #e6e6e6;
}
}
.goods-list {
padding-left: 15rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
... ... @@ -7,5 +7,14 @@
</div>
<span id="btn-ok" class="btn btn-ok disable">完成</span>
</div>
{{#if mobile}}
<input id="mobile" type="hidden" value={{mobile}}>
<input id="area" type="hidden" value={{areaCode}}>
<input id="token" type="hidden" value={{token}}>
{{/if}}
{{# code}}
<input id="email-code" type="hidden" value={{.}}>
{{/ code}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
<div class="home-header clearfix" {{# bgColor}}style="background-color:{{.}};background-image:none"{{/ bgColor}}>
<span class="nav-btn iconfont">&#xe60b;</span>
<span class="logo"></span>
<span class="search-btn iconfont"><a href="{{searchUrl}}">&#xe60f;</a></span>
</div>
\ No newline at end of file
... ...
<div class="search-input">
<a href="{{searchUrl}}">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索商品">
</a>
</div>
\ No newline at end of file
... ...
<div class="two-column-goods">
<ul class="column-nav clearfix">
{{# columnNav}}
<li data-url="{{url}}">{{textCn}}</li>
{{/ columnNav}}
</ul>
<div class="goods-list clearfix">
{{# goods}}
{{> common/good_info}}
{{/ goods}}
</div>
</div>
\ No newline at end of file
... ...
<div class="hot-brands girls">
{{> common/floor_header_more}}
<div class="brands-swiper">
<ul class="brands-list swiper-wrapper clearfix">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}" alt="">
<span class="brands-title">{{textCn}}</span>
</a>
</li>
{{/ list}}
</ul>
</div>
</div>
\ No newline at end of file
... ...
<div class="hot-category">
<div class="category-banner">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="">
</a>
</div>
<ul class="category-list clearfix">
{{# list}}
<li>
<a href="{{url}}">
<div class="img-box">
<img class="lazy" data-original="{{img}}" alt="">
</div>
<p class="category-title">{{textCn}}</p>
</a>
</li>
{{/ list}}
</ul>
</div>
\ No newline at end of file
... ...
... ... @@ -15,7 +15,6 @@
var docEl = doc.documentElement;
(function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
... ...
... ... @@ -10,41 +10,392 @@ class GirlsController extends AbstractAction
public function indexAction()
{
$data = array(
'headerDownload' => array(
'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480',
'url' => 'http://www.baidu.com'
),
'homeHeader' => array(
'bgColor' => '#FF88AE',
'searchUrl' => ''
),
'searchUrl' => '',
'sideNav' => array(
array(
'textCn' => '男生',
'textEn' => 'Boys',
'styleClass' => 'boys',
'url' => ''
),
array(
'textCn' => '女生',
'textEn' => 'GIRLS',
'styleClass' => 'girls',
'url' => ''
),
array(
'textCn' => '潮童',
'textEn' => 'KIDS',
'styleClass' => 'kids',
'url' => ''
),
array(
'textCn' => '创意生活',
'textEn' => 'LIFE STYLE',
'styleClass' => 'life',
'url' => ''
),
array(
'textCn' => '逛',
'textEn' => 'TRENDFINDER',
'styleClass' => 'guang',
'subNav' => array(
'list' => array(
array(
'textCn' => '逛',
'textEn' => 'TrendFinder',
'back' => true,
'bgColor' => '#fd307f'
),
array(
'textCn' => '查看全部',
'url' => ''
),
array(
'textCn' => '只看男生',
'textEn' => 'Boys',
'url' => ''
),
array(
'textCn' => '只看女生',
'textEn' => 'Girls',
'url' => '',
'isSelect' => true
)
)
)
)
),
'content' => array(
'bannerTop' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'
)
)
),
'iconsEnter' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '新品到着'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '全球优选'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '明星潮牌'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '全部品类'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '逛'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '搭配指南'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '潮品推荐'
),
array(
'url' => '',
'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'text' => '折扣精选'
)
)
),
'hotCategory' => array(
'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480',
'url' => 'http://www.baidu.com',
'list' => array(
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => '打底衫',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'hotBrandsScroll' => array(
'name' => '热门品牌',
'list' => array(
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'textCn' => 'Moussy',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'hotBrands' => array(
'name' => '热门品牌',
'more' => 'www.baidu.com',
'brands' => array(
array(
'name' => 'Front Row Shop',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'name' => 'dress lab',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'name' => 'DEVIL NUT',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'name' => 'casselini',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'name' => 'haso',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'name' => 'EVISU',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'trendColloaction' => array(
'name' => '潮人 ▪ 搭配',
'more' => '',
'leftspan' => array(
'url' => '',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg'
),
'rightspan' => array(
'url' => '',
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg'
),
'recommendlist' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'trendTopics' => array(
'name' => '潮品 ▪ 话题',
'more' => '',
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'title' => '现代裁剪',
'time' => '2月13日 12:34'
)
)
),
'goodsCategory' => array(
'name' => '经典裤装',
'more' => '',
'banner' => array(
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => ''
)
)
),
'list' => array(
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '手表'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '烛台'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '围巾'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '盘子'
),
array(
'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',
'url' => '',
'textCn' => '耳机'
)
)
)
),
// 频道数据
$channelData = Index::getUserChannelData(0, '2,3', '201504091403002');
echo '<pre>';
print_r($channelData);
$data = array(
'headerDownload' => $this->getHeaderDownload(),
'searchUrl' => '',
'sideNav' => array(
'textCn' => '男生',
'textEn' => 'Boys',
'url' => false,
'subNav' => array(
'list' => array(
array(
'textCn' => '男生',
'img' => 'http://res.yohoboys.com/res/new/boys/images/about/thirdbtn-sina.png',
'url' => ''
),
array(
'textCn' => '新品到着',
'img' => 'http://res.yohoboys.com/res/new/boys/images/about/thirdbtn-sina.png',
'url' => ''
)
)
)
),
);
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('index', $data);
// // 频道数据
// $channelData = Index::getUserChannelData(0, '2,3', '201504091403002');
// echo '<pre>';
// print_r($channelData);
// $this->_view->assign('title', 'YOHO!有货');
// $this->_view->display('girls', compact('channelData'));
}
}
\ No newline at end of file
... ...
... ... @@ -120,7 +120,7 @@ class PlusstarController extends AbstractAction
$data['ps']['name'] = $brandInfo['getBrandInfo']['brand_name'];
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
$data['ps']['likeUrl'] = "http://guang.m.yohobuy.com/plustar/brandinfo?id=285&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";
$data['ps']['intro'] = empty($brandInfo['brand_intro']) ? '' : strip_tags($brandInfo['brand_intro']);
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['brand_intro']), 'nbsp;', ' ');
$data['ps']['newArrival'] = array();
$data['ps']['newArrival']['moreUrl'] = ''; // @todo
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
... ...
<?php
use Action\AbstractAction;
use Plugin\Partner\Factory;
use LibModels\Wap\Passport\LoginData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
use Plugin\Partner\Factory;
/**
* 登录的控制器
*/
class LoginController extends AbstractAction
{
/**
* 登录页
*/
public function indexAction()
{
$this->setTitle('登录');
$data = array(
'backUrl' => 'm.yohobuy.com',
'loginIndex' => true,
'backUrl' => '/',
'showHeaderImg' => true,
'isPassportPage' => true,
'modulePath' => 'passport/login/login'
'registerUrl' => '/reg.html',
'interationalUrl' => '/login.html',
'phoneRetriveUrl' => '',
'emailRetriveUrl' => '',
);
$this->_view->assign('title', '登录');
$this->_view->display('index', $data);
}
/**
* 国际账号登录页
*/
public function interationalAction()
{
$data = array(
'backUrl' => 'm.yohobuy.com',
'headerText' => '登录',
'isPassportPage' => true,
'modulePath' => 'passport/login/interational',
'countrys' => array(
array(
'areaCode' => '+86',
'selected' => true,
'name' => '中国'
),
array(
'areaCode' => '+864',
'name' => '中国香港'
)
),
'countryCode' => '+86'
);
$this->setTitle('国际账号登录');
$data = array();
$data['loginInterational'] = true;
$data['backUrl'] = '/';
$data['headerText'] = '登录';
$data['isPassportPage'] = true;
$data['countryCode'] = '+86';
// 获取地区数据列表
$area = RegData::getAreasData();
// 有数据
if (!empty($area['data'])) {
$build = array();
foreach ($area['data'] as $value) {
$build = array();
$build['areaCode'] = '+' . $value['area'];
$build['selected'] = $value['area'] === '86';
$build['name'] = $value['name'];
$data['countrys'][] = $build;
}
}
// 没数据
else {
$data['countrys'][0] = array();
$data['countrys'][0]['areaCode'] = '+86';
$data['countrys'][0]['selected'] = true;
$data['countrys'][0]['name'] = '中国';
}
$this->_view->assign('title', '国际账号登录');
$this->_view->display('interational', $data);
$data = array();
$area = array();
}
/**
* 登录操作
*
* @param string area 地区编号, 不需要+号
* @param string profile 账号(邮箱或手机号)
* @param string password 密码
* @return json
*/
public function authAction()
{
$data = array('code' => 400, 'message' => '账号或密码不正确', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
/* 判断参数是否传递 */
$area = $this->post('area', '86');
$profile = $this->post('profile');
$password = $this->post('password');
if (!is_numeric($area) || empty($profile) || empty($password)) {
break;
}
/* 判断参数是否有效 */
$verifyEmail = Helpers::verifyEmail($profile);
$verifyMobile = ($area === '86') ? Helpers::verifyMobile($profile)
: Helpers::verifyAreaMobile($profile);
if (!$verifyEmail && !$verifyMobile) {
break;
}
/* 调用登录接口进行登录 */
$data = LoginData::signin($area, $profile, $password);
} while (false);
$this->echoJson($data);
}
/**
* 支付宝账号登录:授权页面
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
/**
* 注册的控制器
*/
class RegController extends AbstractAction
{
/**
* 注册页
*/
public function indexAction()
{
$data = array(
'backUrl' => 'm.yohobuy.com',
'headerText' => '注册',
'isPassportPage' => true,
'modulePath' => 'passport/register/register',
'countrys' => array(
array(
'areaCode' => '+86',
'selected' => true,
'name' => '中国'
),
array(
'areaCode' => '+864',
'name' => '中国香港'
)
),
'countryCode' => '+86'
);
$this->_view->assign('title', '注册');
$this->setTitle('注册');
$data = array();
$data['regIndex'] = true;
$data['backUrl'] = '/';
$data['headerText'] = '注册';
$data['isPassportPage'] = true;
$data['countrys'] = array();
// 获取地区数据列表
$area = RegData::getAreasData();
// 有数据
if (!empty($area['data'])) {
$build = array();
foreach ($area['data'] as $value) {
$build = array();
$build['areaCode'] = '+' . $value['area'];
$build['selected'] = $value['area'] === '86';
$build['name'] = $value['name'];
$data['countrys'][] = $build;
}
}
// 没数据
else {
$data['countrys'][0] = array();
$data['countrys'][0]['areaCode'] = '+86';
$data['countrys'][0]['selected'] = true;
$data['countrys'][0]['name'] = '中国';
}
$this->_view->display('index', $data);
$data = array();
$area = array();
}
/**
* 验证码
*
* @param string area 地区编号
* @param string mobile 手机号
* @param string token 访问TOKEN凭证
*/
public function codeAction()
{
$data = array(
'backUrl' => 'm.yohobuy.com',
'headerText' => '注册',
'isPassportPage' => true,
'modulePath' => 'passport/register/code',
'areaCode' => '+86',
'phoneNum' => '15895869035'
);
$this->_view->assign('title', '注册-验证码');
$token = $this->get('token');
$mobile = $this->get('mobile');
$area = $this->get('area', '86');
// 判断是否允许访问, 不允许则跳转到错误页面
if (!is_string($token) || !is_numeric($mobile) || !Helpers::verifyToken($mobile, $token)) {
$this->error();
}
$this->setTitle('注册-验证码');
$data = array();
$data['regCode'] = true;
$data['backUrl'] = '/';
$data['headerText'] = '注册';
$data['isPassportPage'] = true;
$data['areaCode'] = $area;
$data['phoneNum'] = $mobile;
$data['token'] = $token;
$this->_view->display('code', $data);
}
/**
* 填写密码页面
*
* @param string area 地区编号
* @param string mobile 手机号
* @param string token 访问TOKEN凭证
*/
public function passwordAction()
{
$data = array(
'backUrl' => 'm.yohobuy.com',
'headerText' => '注册',
'isPassportPage' => true,
'modulePath' => 'passport/register/password'
);
$this->_view->assign('title', '注册-密码');
$token = $this->get('token');
$mobile = $this->get('mobile');
$area = $this->get('area', '86');
// 判断是否允许访问, 不允许则跳转到错误页面
if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area)
|| !Helpers::verifyToken($mobile, $token)) {
$this->error();
}
$this->setTitle('注册-设置密码');
$data = array();
$data['regPwd'] = true;
$data['backUrl'] = '/';
$data['headerText'] = '注册';
$data['isPassportPage'] = true;
$data['areaCode'] = $area;
$data['phoneNum'] = $mobile;
$data['token'] = $token;
$this->_view->display('password', $data);
}
/**
* 验证注册的手机号
*
* @param string area 地区编号,注意不需要+号
* @param string mobile 手机号
* @return json
*/
public function verifymobileAction()
{
$data = array('code' => 400, 'message' => '参数不正确!', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$mobile = $this->post('mobile');
$area = $this->post('area', '86');
/* 判断参数是否合法 */
if (!is_numeric($mobile) || !is_numeric($area)) {
break;
}
/* 向手机发送注册验证码 */
$data = RegData::sendCodeToMobile($area, $mobile);
if (!isset($data['code'])) {
break;
}
/* 返回跳转到验证页面的链接*/
if ($data['code'] == 200) {
$token = Helpers::makeToken($mobile);
$data['data'] = '/passport/reg/code?token='.$token.'&mobile='.$mobile.'&area='.$area;
}
} while (false);
$this->echoJson($data);
}
/**
* 验证注册的识别码
*
* @param string area 地区编号,注意不需要+号
* @param string mobile 手机号
* @param string token 访问TOKEN凭证
* @param int code 验证码, 手机上收到的
* @return json
*/
public function verifycodeAction()
{
$data = array('code' => 400, 'message' => '参数不正确!', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$mobile = $this->post('mobile');
$area = $this->post('area');
$code = $this->post('code');
/* 判断参数是否合法 */
if (!is_numeric($mobile) || !is_numeric($area) || !isset($code)) {
break;
}
/* 验证注册的标识码是否有效 */
$data = RegData::validMobileCode($area, $mobile, $code);
if (!isset($data['code'])) {
break;
}
/* 返回跳转到设置密码的链接*/
if ($data['code'] == 200) {
$token = Helpers::makeToken($mobile);
$data['data'] = '/passport/reg/password?token='.$token.'&mobile='.$mobile.'&area='.$area;
}
} while (false);
$this->echoJson($data);
}
/**
* 发送验证码
*
* @param string area 地区编号,注意不需要+号
* @param string mobile 手机号
* @return json
*/
public function sendcodeAction()
{
$data = array('code' => 400, 'message' => '参数不正确!', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$mobile = $this->post('mobile');
$area = $this->post('area', '86');
/* 判断参数是否合法 */
if (!is_numeric($mobile) || !is_numeric($area)) {
break;
}
/* 向手机发送注册验证码 */
$data = RegData::sendCodeToMobile($area, $mobile);
if (!isset($data['code'])) {
break;
}
} while (false);
$this->echoJson($data);
}
/**
* 设置密码
*
* @param string area 地区编号,注意不需要+号
* @param string mobile 手机号
* @param string token 访问TOKEN凭证
* @param string password 用户设置的密码
* @return json
*/
public function setpasswordAction()
{
$data = array('code' => 400, 'message' => '密码格式不正确!', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$token = $this->post('token');
$mobile = $this->post('mobile');
$area = $this->post('area');
$password = $this->post('password');
/* 判断参数是否合法 */
if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) || !isset($password)) {
break;
}
/* 判断是否允许访问 */
if (!Helpers::verifyToken($mobile, $token)) {
break;
}
/* 验证注册的标识码是否有效 */
$data = RegData::regMobile($area, $mobile, $password);
if (!isset($data['code'])) {
break;
}
/* 返回跳转到来源页面 */
if ($data['code'] == 200) {
$data['data'] = '/passport/reg/password?token='.$token.'&mobile='.$mobile.'&area='.$area;
}
} while (false);
$this->echoJson($data);
}
}
\ No newline at end of file
... ...
; default
; 默认页
routes.index.type = "rewrite"
routes.index.match = "/index.html$"
routes.index.route.module = Index
routes.index.route.controller = Index
routes.index.route.action = Index
; error
routes.notfound.type = "rewrite"
routes.notfound.match = "/error.html$"
routes.notfound.route.module = Index
routes.notfound.route.controller = Error
routes.notfound.route.action = Index
\ No newline at end of file
; 错误页
routes.error.type = "rewrite"
routes.error.match = "/error.html$"
routes.error.route.module = Index
routes.error.route.controller = Error
routes.error.route.action = Index
; 注册页
routes.reg.type = "rewrite"
routes.reg.match = "/reg.html$"
routes.reg.route.module = Passport
routes.reg.route.controller = Reg
routes.reg.route.action = Index
; 登录页
routes.login.type = "rewrite"
routes.login.match = "/signin.html$"
routes.login.route.module = Passport
routes.login.route.controller = Login
routes.login.route.action = Index
; 登录页(国际账号)
routes.interational.type = "rewrite"
routes.interational.match = "/login.html$"
routes.interational.route.module = Passport
routes.interational.route.controller = Login
routes.interational.route.action = Interational
... ...