Authored by Rock Zhang

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

  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="utf-8">
  5 + <title>注册</title>
  6 + <meta name="keywords" content="">
  7 + <meta name="description" content="">
  8 + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  9 + <meta http-equiv="cleartype" content="on">
  10 + <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  11 + <meta content="telephone=no" name="format-detection" />
  12 + <meta content="email=no" name="format-detection" />
  13 + <script type="text/javascript">
  14 + (function (doc, win) {
  15 + var docEl = doc.documentElement;
  16 + (function () {
  17 + var clientWidth = docEl.clientWidth;
  18 + if (!clientWidth) {
  19 + return;
  20 + }
  21 + docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
  22 + }());
  23 + })(document, window);
  24 + </script>
  25 +
  26 +
  27 + <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
  28 +
  29 +</head>
  30 +<body class=passport-body>
  31 +<div class="reg-page passport-page yoho-page">
  32 + <div class="header">
  33 + <a class="go-back" href=/>
  34 + <img src="http://static.dev.yohobuy.com/img/passport/go-back.png">
  35 + </a>
  36 + <p class="title">注册</p>
  37 + </div> <div class="content">
  38 + <div class="select-container row">
  39 + <span class="select-title">国家和地区</span>
  40 + <select id="country-select" class="country-select select in-android-uc">
  41 + <option value=+61 >澳大利亚</option>
  42 + <option value=+82 >韩国</option>
  43 + <option value=+1 >加拿大</option>
  44 + <option value=+60 >马来西亚</option>
  45 + <option value=+1 >美国</option>
  46 + <option value=+81 >日本</option>
  47 + <option value=+65 >新加坡</option>
  48 + <option value=+44 >英国</option>
  49 + <option value=+86 selected>中国</option>
  50 + <option value=+853 >中国澳门</option>
  51 + <option value=+886 >中国台湾</option>
  52 + <option value=+852 >中国香港</option>
  53 + </select>
  54 + <div class="arrow-right"></div>
  55 + </div> <div class="input-container phone-container row has-clear">
  56 + <span id="area-code" class="area-code">+86</span>
  57 + <input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
  58 + </div>
  59 + <span id="btn-next" class="btn btn-next disable row">下一步</span>
  60 + <p class="register-tip">YOHO!Family账号可登录YOHO!有货、YOHO!Boys、YOHO!Girls及SHOW</p>
  61 + </div>
  62 +</div>
  63 +
  64 +
  65 + <script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
  66 + <script>
  67 + seajs.config({
  68 + base: 'http://localhost:8000/'
  69 + });
  70 + </script>
  71 +
  72 +
  73 + <script>
  74 + seajs.use('js/passport/register/register');
  75 + </script>
  76 +
  77 +
  78 +
  79 +
  80 +
  81 +</body>
  82 +</html>
framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 2
3 namespace LibModels\Wap\Guang; 3 namespace LibModels\Wap\Guang;
4 4
5 -use Api\Sign;  
6 use Api\Yohobuy; 5 use Api\Yohobuy;
7 6
8 /** 7 /**
@@ -27,7 +26,7 @@ class OptData @@ -27,7 +26,7 @@ class OptData
27 */ 26 */
28 public static function favoriteBrand($uid, $id, $opt = 'ok') 27 public static function favoriteBrand($uid, $id, $opt = 'ok')
29 { 28 {
30 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'toggleBrandFav', array($uid, $id)); 29 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'toggleBrand', array($uid, $id) );
31 } 30 }
32 31
33 /** 32 /**
@@ -41,48 +40,26 @@ class OptData @@ -41,48 +40,26 @@ class OptData
41 public static function favoriteProduct($uid, $skn, $opt = 'ok') 40 public static function favoriteProduct($uid, $skn, $opt = 'ok')
42 { 41 {
43 if ($opt === 'cancel') { 42 if ($opt === 'cancel') {
44 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'addUidProductFav', array($uid, $skn)); 43 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'addUidProductFav', array($uid, $skn) );
45 } else { 44 } else {
46 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'delUidProductFav', array($uid, $skn));  
47 - }  
48 - }  
49 -  
50 - /**  
51 - * 品牌相关资讯点赞/取消赞  
52 - *  
53 - * @param int $uid 用户ID  
54 - * @param int $id 唯一的ID  
55 - * @param string $opt 操作(ok:表示确定,cancel:表示取消)  
56 - * @return array  
57 - */  
58 - public static function praiseBrandArticle($uid, $id, $opt = 'ok')  
59 - {  
60 - if ($opt === 'cancel') {  
61 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'cancelPraise', array($id, $uid));  
62 - } else {  
63 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'setPraise', array($id, $uid)); 45 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'delUidProductFav', array($uid, $skn) );
64 } 46 }
65 } 47 }
66 48
67 /** 49 /**
68 * 逛资讯点赞/取消赞 50 * 逛资讯点赞/取消赞
69 * 51 *
70 - * @param int $udid 唯一客户端cookie标识 52 + * @param int $udid 唯一客户端标识
71 * @param int $id 唯一资讯的ID 53 * @param int $id 唯一资讯的ID
72 * @param string $opt 操作(ok:表示确定,cancel:表示取消) 54 * @param string $opt 操作(ok:表示确定,cancel:表示取消)
73 * @return array 55 * @return array
74 */ 56 */
75 public static function praiseArticle($udid, $id, $opt = 'ok') 57 public static function praiseArticle($udid, $id, $opt = 'ok')
76 { 58 {
77 - $param = Yohobuy::param();  
78 - $param['udid'] = $udid;  
79 - $param['article_id'] = $id;  
80 - $param['client_secret'] = Sign::getSign($param);  
81 -  
82 if ($opt === 'cancel') { 59 if ($opt === 'cancel') {
83 - return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v2/praise/setPraise', $param); 60 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid) );
84 } else { 61 } else {
85 - return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v2/praise/cancel', $param); 62 + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid) );
86 } 63 }
87 } 64 }
88 65
@@ -36,7 +36,7 @@ class RecomData @@ -36,7 +36,7 @@ class RecomData
36 $param['yh_channel'] = $channel; 36 $param['yh_channel'] = $channel;
37 $param['client_secret'] = Sign::getSign($param); 37 $param['client_secret'] = Sign::getSign($param);
38 38
39 - return Yohobuy::get(Yohobuy::API_URL, $param, true); 39 + return Yohobuy::get(Yohobuy::API_URL, $param);
40 } 40 }
41 41
42 /** 42 /**
@@ -55,7 +55,7 @@ class RecomData @@ -55,7 +55,7 @@ class RecomData
55 $param['yh_channel'] = '3'; 55 $param['yh_channel'] = '3';
56 $param['client_secret'] = Sign::getSign($param); 56 $param['client_secret'] = Sign::getSign($param);
57 57
58 - return Yohobuy::get(Yohobuy::API_URL, $param, true); 58 + return Yohobuy::get(Yohobuy::API_URL, $param);
59 } 59 }
60 60
61 /** 61 /**
@@ -74,7 +74,7 @@ class RecomData @@ -74,7 +74,7 @@ class RecomData
74 $param['yh_channel'] = '4'; 74 $param['yh_channel'] = '4';
75 $param['client_secret'] = Sign::getSign($param); 75 $param['client_secret'] = Sign::getSign($param);
76 76
77 - return Yohobuy::get(Yohobuy::API_URL, $param, true); 77 + return Yohobuy::get(Yohobuy::API_URL, $param);
78 } 78 }
79 79
80 } 80 }
@@ -64,7 +64,7 @@ class Cache @@ -64,7 +64,7 @@ class Cache
64 } 64 }
65 // LINUX 65 // LINUX
66 else { 66 else {
67 - $result = HoodCache::Memcached($node)->set(self::makeKey($key, $node)); 67 + $result = HoodCache::Memcached($node)->get(self::makeKey($key, $node));
68 } 68 }
69 69
70 return $result; 70 return $result;
@@ -46,19 +46,18 @@ class Helpers @@ -46,19 +46,18 @@ class Helpers
46 $result['name'] = $productData['product_name']; 46 $result['name'] = $productData['product_name'];
47 $result['price'] = $productData['market_price']; 47 $result['price'] = $productData['market_price'];
48 $result['salePrice'] = $productData['sales_price']; 48 $result['salePrice'] = $productData['sales_price'];
49 - $result['isFew'] = ($productData['is_soon_sold_out'] === 'Y'); 49 + $result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
50 $result['url'] = ''; // @todo 50 $result['url'] = ''; // @todo
51 - 51 +
52 if ($showTags) { 52 if ($showTags) {
53 $result['tags'] = array(); 53 $result['tags'] = array();
54 - $result['tags']['isNew'] = isset($productData['is_new']) && $productData['is_new'] === 'Y'; // 新品  
55 - $result['tags']['isSale'] = isset($productData['is_discount']) && $productData['is_discount'] === 'Y'; // 在售  
56 - $result['tags']['isLimit'] = isset($productData['is_limited']) && $productData['is_limited'] === 'Y'; // 限量  
57 - $result['tags']['isYohood'] = isset($productData['is_yohood']) && $productData['is_yohood'] === 'Y'; // YOHOOD 54 + $result['tags']['is_new'] = isset($productData['is_new']) && $productData['is_new'] === 'Y'; // 新品
  55 + $result['tags']['is_discount'] = isset($productData['is_discount']) && $productData['is_discount'] === 'Y'; // 在售
  56 + $result['tags']['is_limited'] = isset($productData['is_limited']) && $productData['is_limited'] === 'Y'; // 限量
  57 + $result['tags']['is_yohood'] = isset($productData['is_yohood']) && $productData['is_yohood'] === 'Y'; // YOHOOD
58 $result['tags']['midYear'] = isset($productData['mid-year']) && $productData['mid-year'] === 'Y'; // 年中 58 $result['tags']['midYear'] = isset($productData['mid-year']) && $productData['mid-year'] === 'Y'; // 年中
59 $result['tags']['yearEnd'] = isset($productData['year-end']) && $productData['year-end'] === 'Y'; // 年末 59 $result['tags']['yearEnd'] = isset($productData['year-end']) && $productData['year-end'] === 'Y'; // 年末
60 - $result['tags']['isReNew'] = false; // 再到着  
61 - $result['tags']['isNewFestival'] = false; // 新品节 60 + $result['tags']['is_advance'] = isset($productData['is_advance']) && $productData['is_advance'] === 'Y'; // 再到着
62 } 61 }
63 62
64 return $result; 63 return $result;
@@ -84,7 +83,7 @@ class Helpers @@ -84,7 +83,7 @@ class Helpers
84 $result['id'] = $articleData['id']; 83 $result['id'] = $articleData['id'];
85 $result['showTags'] = $showTag; 84 $result['showTags'] = $showTag;
86 $result['img'] = self::getImageUrl($articleData['src'], 640, 640); 85 $result['img'] = self::getImageUrl($articleData['src'], 640, 640);
87 - $result['url'] = $articleData['url']; // @todo 86 + $result['url'] = '/guang/detail/index?id=' . $articleData['id']; // @todo
88 $result['title'] = $articleData['title']; 87 $result['title'] = $articleData['title'];
89 $result['text'] = $articleData['intro']; 88 $result['text'] = $articleData['intro'];
90 $result['publishTime'] = $articleData['publish_time']; 89 $result['publishTime'] = $articleData['publish_time'];
@@ -115,6 +115,8 @@ class TemplateLayout implements View_Interface @@ -115,6 +115,8 @@ class TemplateLayout implements View_Interface
115 if (is_array($this->_tpl_vars)) { 115 if (is_array($this->_tpl_vars)) {
116 $tpl_vars = array_merge($this->_tpl_vars, $tpl_vars); 116 $tpl_vars = array_merge($this->_tpl_vars, $tpl_vars);
117 } 117 }
  118 + // 应用版本号
  119 + $tpl_vars['version'] = $config->version;
118 120
119 // 取得模板的最后修改时间戳 121 // 取得模板的最后修改时间戳
120 $lastModifyTime = filemtime($viewName); 122 $lastModifyTime = filemtime($viewName);
  1 +{{# goods}}
  2 + {{> good}}
  3 +{{/ goods}}
  1 +{{# goodsContainer}}
  2 + <div class="goods-list {{^show}}hide{{/show}}">
  3 + {{# goods}}
  4 + {{> good}}
  5 + {{/ goods}}
  6 + </div>
  7 +{{/ goodsContainer}}
@@ -37,4 +37,4 @@ @@ -37,4 +37,4 @@
37 {{/price}} 37 {{/price}}
38 </div> 38 </div>
39 </div> 39 </div>
40 -</div>  
  40 +</div>
  1 +<?php
  2 +
  3 +use Action\AbstractAction;
  4 +use LibModels\Wap\Product\RecomData;
  5 +use Plugin\Helpers;
  6 +
  7 +/**
  8 + * 推荐相关的控制器
  9 + */
  10 +class RecomController extends AbstractAction
  11 +{
  12 +
  13 + /**
  14 + * 你可能喜欢的BOYS或GIRLS的商品列表
  15 + *
  16 + * @param string gender 1,3表示男, 2,3表示女
  17 + * @param int page 分页的页码
  18 + * @return html
  19 + */
  20 + public function maylikeAction()
  21 + {
  22 + do {
  23 + /* 判断是否是AJAX请求 */
  24 + if (!$this->isAjax()) {
  25 + break;
  26 + }
  27 +
  28 + /* 判断分页参数是否有效 */
  29 + $page = $this->get('page', 1);
  30 + if (!is_numeric($page)) {
  31 + break;
  32 + }
  33 +
  34 + /* 取可能喜欢的数据 */
  35 + $recom = array();
  36 + $gender = $this->get('gender', '1,3');
  37 + // 女
  38 + if ($gender === '2,3') {
  39 + $recom = RecomData::mayLike('2,3', 2);
  40 + }
  41 + // 男
  42 + else {
  43 + $recom = RecomData::mayLike('1,3', 1);
  44 + }
  45 +
  46 + /* 判断是否有内容返回 */
  47 + if (empty($recom['data']['product_list'])) {
  48 + break;
  49 + }
  50 +
  51 + /* 构建商品数据 */
  52 + $data = array();
  53 + foreach ($recom['data']['product_list'] as $value) {
  54 + $data['goods'][] = Helpers::formatProduct($value, true);
  55 + }
  56 + $this->_view->display('maylike', $data);
  57 + }
  58 + while (false);
  59 +
  60 + echo ' ';
  61 + }
  62 +
  63 + /**
  64 + * 你可能喜欢的潮童的商品列表
  65 + *
  66 + * @param int page 分页的页码
  67 + * @return html
  68 + */
  69 + public function maylikekidsAction()
  70 + {
  71 + do {
  72 + /* 判断是否是AJAX请求 */
  73 + if (!$this->isAjax()) {
  74 + break;
  75 + }
  76 +
  77 + /* 判断分页参数是否有效 */
  78 + $page = $this->get('page', 1);
  79 + if (!is_numeric($page)) {
  80 + break;
  81 + }
  82 +
  83 + /* 取可能喜欢的数据 */
  84 + $recom = RecomData::mayLikeKids();
  85 + if (empty($recom['data']['product_list'])) {
  86 + break;
  87 + }
  88 +
  89 + /* 构建模板需要的商品数据 */
  90 + $data = array();
  91 + foreach ($recom['data']['product_list'] as $value) {
  92 + $data['goods'][] = Helpers::formatProduct($value, true);
  93 + }
  94 + $this->_view->display('maylike', $data);
  95 + }
  96 + while (false);
  97 +
  98 + echo ' ';
  99 + }
  100 +
  101 + /**
  102 + * 你可能喜欢的创意生活的新品到着和人气单品列表
  103 + *
  104 + * @return html
  105 + */
  106 + public function maylikelifeAction()
  107 + {
  108 + do {
  109 + /* 判断是否是AJAX请求 */
  110 + if (!$this->isAjax()) {
  111 + break;
  112 + }
  113 +
  114 + /* 判断分页参数是否有效 */
  115 + $page = $this->get('page', 1);
  116 + if (!is_numeric($page)) {
  117 + break;
  118 + }
  119 +
  120 + /* 取可能喜欢的数据 */
  121 + $recom = RecomData::mayLikeLifestyle();
  122 + if (empty($recom['data']['product_list'])) {
  123 + break;
  124 + }
  125 +
  126 + /* 构建模板需要的商品数据 */
  127 + $data = array();
  128 + $build = array();
  129 + if (!empty($recom['data']['product_list']['top'])) {
  130 + $build = array();
  131 + $build['show'] = true;
  132 + foreach ($recom['data']['product_list']['top'] as $value) {
  133 + $build['goods'][] = Helpers::formatProduct($value, true);
  134 + }
  135 + $data['goodsContainer'][] = $build;
  136 + }
  137 + if (!empty($recom['data']['product_list']['new'])) {
  138 + $build = array();
  139 + foreach ($recom['data']['product_list']['new'] as $value) {
  140 + $build['show'] = false;
  141 + $build['goods'][] = Helpers::formatProduct($value, true);
  142 + }
  143 + $data['goodsContainer'][] = $build;
  144 + }
  145 + $this->_view->display('maylikelife', $data);
  146 + }
  147 + while (false);
  148 +
  149 + echo ' ';
  150 + }
  151 +
  152 +}
  1 +<?php
  2 +
  3 +use Action\AbstractAction;
  4 +use LibModels\Wap\Guang\OptData;
  5 +
  6 +/**
  7 + * 逛操作
  8 + */
  9 +class OptController extends AbstractAction
  10 +{
  11 + /**
  12 + * 资讯文章点赞
  13 + *
  14 + * @param int $id 唯一的资讯ID
  15 + * @param string $opt 操作(ok:表示确定,cancel:表示取消)
  16 + * @return json
  17 + */
  18 + public function praiseArticleAction()
  19 + {
  20 + $result = array();
  21 +
  22 + do {
  23 + /* 判断是不是AJAX请求 */
  24 + if (!$this->isAjax()) {
  25 + break;
  26 + }
  27 +
  28 + /* 判断参数是否有效 */
  29 + $id = $this->post('id');
  30 + if (!is_numeric($id)) {
  31 + break;
  32 + }
  33 +
  34 + /* 执行点赞或取消操作 */
  35 + $opt = $this->post('opt', 'ok');
  36 + $udid = $this->getUdid();
  37 + $result = OptData::praiseArticle($udid, $id, $opt);
  38 + }
  39 + while (false);
  40 +
  41 + $this->echoJson($result);
  42 + }
  43 +
  44 + /**
  45 + * 品牌收藏
  46 + *
  47 + * @param int $id 品牌的ID
  48 + * @param string $opt 操作(ok:表示确定,cancel:表示取消)
  49 + * @return json
  50 + */
  51 + public function favoriteBrandAction()
  52 + {
  53 + $result = array('code' => 400, 'message' => '未登录', 'data' => false);
  54 +
  55 + do {
  56 + /* 判断是不是AJAX请求 */
  57 + if (!$this->isAjax()) {
  58 + break;
  59 + }
  60 +
  61 + /* 判断参数是否有效 */
  62 + $id = $this->post('id');
  63 + if (!is_numeric($id)) {
  64 + break;
  65 + }
  66 +
  67 + /* 检查用户是否登录 */
  68 + $uid = $this->getUid();
  69 + if (!$uid) {
  70 + break;
  71 + }
  72 +
  73 + /* 执行点赞或取消操作 */
  74 + $opt = $this->post('opt', 'ok');
  75 + $status = OptData::favoriteBrand($uid, $id, $opt);
  76 + if (!$status) {
  77 + break;
  78 + }
  79 + $result = array('code' => 200, 'message' => '收藏成功', 'data' => $status);
  80 + }
  81 + while (false);
  82 +
  83 + $this->echoJson($result);
  84 + }
  85 +
  86 +}
@@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials" @@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
47 application.template.ext = ".phtml" 47 application.template.ext = ".phtml"
48 48
49 ;静态HTML页面的存放目录, 该目录需要有读写权限 49 ;静态HTML页面的存放目录, 该目录需要有读写权限
50 -application.assets.path = ROOT_PATH "/assets"  
  50 +application.assets.path = ROOT_PATH "/assets"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
@@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials" @@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
47 application.template.ext = ".phtml" 47 application.template.ext = ".phtml"
48 48
49 ;静态HTML页面的存放目录, 该目录需要有读写权限 49 ;静态HTML页面的存放目录, 该目录需要有读写权限
50 -application.assets.path = ROOT_PATH "/assets"  
  50 +application.assets.path = ROOT_PATH "/assets"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
@@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials" @@ -47,4 +47,7 @@ application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
47 application.template.ext = ".phtml" 47 application.template.ext = ".phtml"
48 48
49 ;静态HTML页面的存放目录, 该目录需要有读写权限 49 ;静态HTML页面的存放目录, 该目录需要有读写权限
50 -application.assets.path = ROOT_PATH "/assets"  
  50 +application.assets.path = ROOT_PATH "/assets"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"