Authored by yangyang

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

framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -18,9 +18,9 @@ class Yohobuy @@ -18,9 +18,9 @@ class Yohobuy
18 { 18 {
19 19
20 /* 正式环境 */ 20 /* 正式环境 */
21 -// const API_URL = 'http://api2.open.yohobuy.com/';  
22 -// const SERVICE_URL = 'http://service.api.yohobuy.com/';  
23 -// const YOHOBUY_URL = 'http://www.yohobuy.com/'; 21 + // const API_URL = 'http://api2.open.yohobuy.com/';
  22 + // const SERVICE_URL = 'http://service.api.yohobuy.com/';
  23 + // const YOHOBUY_URL = 'http://www.yohobuy.com/';
24 24
25 // /* 测试环境 */ 25 // /* 测试环境 */
26 const API_URL = 'http://test2.open.yohobuy.com/'; 26 const API_URL = 'http://test2.open.yohobuy.com/';
@@ -182,7 +182,7 @@ class UserData @@ -182,7 +182,7 @@ class UserData
182 * @param int $suggest_type 意见类型 182 * @param int $suggest_type 意见类型
183 * @return array 意见反馈接口返回的数据 183 * @return array 意见反馈接口返回的数据
184 */ 184 */
185 - public static function suggestData($uid, $content, $suggest_type, $limit = 30) 185 + public static function savesuggestData($uid, $content, $suggest_type, $limit = 30)
186 { 186 {
187 $param = Yohobuy::param(); 187 $param = Yohobuy::param();
188 $param['uid'] = $uid; 188 $param['uid'] = $uid;
@@ -43,7 +43,7 @@ $fixTitleBar.css({ @@ -43,7 +43,7 @@ $fixTitleBar.css({
43 top: brandSwipe 43 top: brandSwipe
44 }).hide(); 44 }).hide();
45 minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight(); 45 minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
46 -$('.brand-list').last().append($fixTitleBar); 46 +$brandList.last().append($fixTitleBar);
47 47
48 $(window).scroll(function() { 48 $(window).scroll(function() {
49 var scrTop = $(window).scrollTop(); 49 var scrTop = $(window).scrollTop();
@@ -64,6 +64,19 @@ $(window).scroll(function() { @@ -64,6 +64,19 @@ $(window).scroll(function() {
64 }); 64 });
65 }); 65 });
66 66
  67 +
  68 +function changeBackground() {
  69 + var $brandList = $('.brand-list').find('p');
  70 +
  71 + $brandList.on('touchstart', function() {
  72 + $brandList.css('background', '#fff');
  73 + $(this).css('background', '#eee');
  74 + }).on('touchend touchcancel', function() {
  75 + $(this).css('background', '#fff');
  76 + });
  77 +}
  78 +changeBackground();
  79 +
67 function searchResult() { 80 function searchResult() {
68 var keyword = ($keyword.val() + '').toLowerCase(); 81 var keyword = ($keyword.val() + '').toLowerCase();
69 var result = {}, 82 var result = {},
@@ -113,6 +126,7 @@ function searchResult() { @@ -113,6 +126,7 @@ function searchResult() {
113 126
114 // 插入 dom,绑定事件 127 // 插入 dom,绑定事件
115 $('.search-result').html(html); 128 $('.search-result').html(html);
  129 + changeBackground();
116 } 130 }
117 131
118 if ($('.brand-search-page').length) { 132 if ($('.brand-search-page').length) {
@@ -94,6 +94,20 @@ $subNav.each(function () { @@ -94,6 +94,20 @@ $subNav.each(function () {
94 } 94 }
95 }); 95 });
96 96
  97 +$sideNav.children('ul').children('li').on('touchstart', function() {
  98 + $sideNav.children('ul').children('li').css('background', '#fff');
  99 + $(this).css('background', '#eee');
  100 +}).on('touchend touchcancel', function() {
  101 + $(this).css('background', '#fff');
  102 +});
  103 +
  104 +// $sideNav.children('ul').children('li').each(function() {
  105 +// var liHammer = new Hammer($(this)[0]);
  106 +// liHammer.on('', function() {
  107 +
  108 +// });
  109 +// });
  110 +
97 //头部banner轮播 111 //头部banner轮播
98 if ($('.banner-swiper').find('li').size() > 1) { 112 if ($('.banner-swiper').find('li').size() > 1) {
99 bannerSwiper = new Swiper('.banner-swiper', { 113 bannerSwiper = new Swiper('.banner-swiper', {
@@ -8,7 +8,8 @@ var $ = require('jquery'); @@ -8,7 +8,8 @@ var $ = require('jquery');
8 var $searchBox = $('.search-box'), 8 var $searchBox = $('.search-box'),
9 $box = $('.box'), 9 $box = $('.box'),
10 $indexSearch = $('.index-search'), 10 $indexSearch = $('.index-search'),
11 - $indexLogo = $('.index-logo'); 11 + $indexLogo = $('.index-logo'),
  12 + $channelLink = $('.index-channel a');
12 13
13 var $search = $searchBox.children('input[type="text"]'), 14 var $search = $searchBox.children('input[type="text"]'),
14 $cancelSearch = $box.children('.no-search'), 15 $cancelSearch = $box.children('.no-search'),
@@ -42,6 +43,25 @@ $searchBox.children('.search-icon').on('touchstart', function() { @@ -42,6 +43,25 @@ $searchBox.children('.search-icon').on('touchstart', function() {
42 $indexSearch.submit(); 43 $indexSearch.submit();
43 }); 44 });
44 45
45 -$('.index-channel img').on('load', function() {  
46 - window.rePosFooter(); 46 +$channelLink.on('touchstart', function() {
  47 + $channelLink.css({
  48 + background: '#000',
  49 + color: '#fff',
  50 + borderColor: '#fff'
  51 + });
  52 + $(this).css({
  53 + background: 'rgba(255, 255, 255, 0.5)',
  54 + color: '#000',
  55 + borderColor: '#000'
  56 + });
  57 +}).on('touchend touchcancel', function() {
  58 + $(this).css({
  59 + background: '#000',
  60 + color: '#fff',
  61 + borderColor: '#fff'
  62 + });
  63 +});
  64 +
  65 +$('.index-channel img').on('load error', function() {
  66 + window.rePosFooter && window.rePosFooter();
47 }); 67 });
@@ -103,4 +103,4 @@ a { @@ -103,4 +103,4 @@ a {
103 @include border-radius(10px); 103 @include border-radius(10px);
104 } 104 }
105 105
106 -@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "loading", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index"; 106 +@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "loading", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index", "mine/index";
@@ -10,13 +10,11 @@ @@ -10,13 +10,11 @@
10 line-height: 96rem / $pxConvertRem; 10 line-height: 96rem / $pxConvertRem;
11 11
12 .index-logo { 12 .index-logo {
13 - display: table-cell;  
14 float: left; 13 float: left;
15 - font-size: 50rem / $pxConvertRem;  
16 width: 216rem / $pxConvertRem; 14 width: 216rem / $pxConvertRem;
17 height: 96rem / $pxConvertRem; 15 height: 96rem / $pxConvertRem;
18 - color: #343434;  
19 - vertical-align: middle; 16 + background: url(../img/yohologo.png) left center no-repeat;
  17 + background-size: 104px 25px;
20 opacity: 1; 18 opacity: 1;
21 transition: all 400ms; 19 transition: all 400ms;
22 20
  1 +.mine-page {
  2 + .user-info {
  3 + padding: 0 30rem / $pxConvertRem;
  4 + color: #fff;
  5 + background: #ccc;
  6 + font-size: 34rem / $pxConvertRem;
  7 + line-height: 164rem / $pxConvertRem;
  8 + height: 164rem / $pxConvertRem;
  9 + .user-avatar {
  10 + display: inline;
  11 + }
  12 + }
  13 +}
  1 +@import "home";
  1 +{{> layout/header}}
  2 + <div class="mine-page yoho-page">
  3 + <div class="mine-header">
  4 + <div class="user-info">
  5 + <img class="user-avatar" src="{{head_ico}}">
  6 + <span class="username">{{profile_name}}</span>
  7 + {{#user_info}}
  8 + <span class="user-level user-level-{{cur_level}}"></span>
  9 + {{/user_info}}
  10 + </div>
  11 + <div class="iconfont more-icon">2</div>
  12 + </div>
  13 + </div>
  14 +{{> layout/footer}}
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 <div class="index-container"> 3 <div class="index-container">
4 <div class="index-header clearfix"> 4 <div class="index-header clearfix">
5 <div class="index-logo"> 5 <div class="index-logo">
6 - <img src="http://static.dev.yohobuy.com/img/yohologo.png">  
7 </div> 6 </div>
8 <div class="box"> 7 <div class="box">
9 <a href="javascript:void(0);" class="no-search">取消</a> 8 <a href="javascript:void(0);" class="no-search">取消</a>
@@ -20,11 +20,19 @@ class HomeController extends AbstractAction @@ -20,11 +20,19 @@ class HomeController extends AbstractAction
20 */ 20 */
21 public function indexAction() 21 public function indexAction()
22 { 22 {
23 - $uid = $uid = $this->getUid();; 23 + // $uid = $uid = $this->getUid();
  24 + $uid = 967016;
24 25
25 $data = \Index\UserModel::getUserProfileData($uid); 26 $data = \Index\UserModel::getUserProfileData($uid);
26 27
27 - print_r($data); 28 + // print_r($data);
  29 + $data['homeHeader'] = array('searchUrl' => Helpers::url('/search', null, 'search'));
  30 + $data['pageFooter'] = true;
  31 +
  32 + // 设置网站标题
  33 + $this->setTitle('男生首页');
  34 +
  35 + $this->_view->display('index', $data);
28 } 36 }
29 37
30 /** 38 /**
@@ -204,7 +204,7 @@ class UserModel @@ -204,7 +204,7 @@ class UserModel
204 $result = array(); 204 $result = array();
205 205
206 // 调用接口保存意见反馈数据 206 // 调用接口保存意见反馈数据
207 - return UserData::suggestData($uid, $content, $suggest_type); 207 + return UserData::savesuggestData($uid, $content, $suggest_type);
208 } 208 }
209 209
210 } 210 }