Authored by Rock Zhang

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

Conflicts:
	framework
... ... @@ -45,16 +45,17 @@ class GradeData
}
/**
* 获取用户基本信息数据??获取不到
* 获取用户基本信息数据
*/
// public function getUserProfileData($gender, $uid, $channel) {
// $param = Yohobuy::param();
// $param['gender'] = $gender;
// $param['uid'] = $uid;
// $param['yh_channel'] = $channel;
// $param['method'] = 'app.passport.profile';
// $param['client_secret'] = Sign::getSign($param);
// var_dump(Yohobuy::post(Yohobuy::API_URL,$param));
// }
public function getUserProfileData($gender, $uid, $channel) {
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['yh_channel'] = $channel;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get("http://api.open.yohobuy.com/",$param);
}
}
... ...
... ... @@ -4,6 +4,7 @@
* @date: 2015/11/10
*/
require('./index');
require('./order');
require('./coupons');
require('./fav');
require('./index');
require('./coupons');
\ No newline at end of file
... ...
/**
* 个人中心--收藏
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content');
var $curContainer = $favContainer.children('.fav-type').first();//保存当前显示的$favContainer
var favTabHammer;
//lazyLoad();
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
console.log(1);
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');
});
... ...
/**
* 个人中心--意见反馈
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content');
var $curContainer = $favContainer.children('.fav-type').first();//保存当前显示的$favContainer
var favTabHammer;
//lazyLoad();
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
console.log(1);
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');
});
... ...
var $ = require('jquery');
$.ajax({
type: 'POST',
url: 'http://m.dev.yohobuy.com/product/newsale/selectHotrank',
type: 'GET',
url: '/product/newsale/selectHotrank',
dataType: 'html',
success: function(date) {
$('#hotRank').append(date);
... ...
@charset "utf-8";
@import "compass", "compass/reset";
$pxConvertRem: 40;
... ... @@ -61,6 +63,9 @@ a {
.hide {
display: none;
}
#show {
display: block;
}
.overflow-hidden {
overflow: hidden;
... ... @@ -122,4 +127,17 @@ a {
background-size: pxToRem(sprite-width($map)) pxToRem(sprite-height($map));
}
@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", "me/index";
@import "layout/header";
@import "layout/footer";
@import "layout/footer_tab";
@import "good";
@import "filter";
@import "loading";
@import "passport/index";
@import "guang/index";
@import "home/index";
@import "category/index";
@import "product/index";
@import "index/index";
@import "shopping-cart/index";
@import "me/index"; //个人中心
... ...
$fav: sprite-map("me/fav/*.png",$spacing: 5px);
.yoho-favorite-page {
width: 100%;
height: auto;
// 选项卡切换
.fav-tab {
width: 100%;
height: pxToRem(88px);
line-height: pxToRem(88px);
border-bottom: 1px solid #e0e0e0;
color: #b0b0b0;
font-size: pxToRem(26px);
li {
width: 50%;
height: 100%;
float: left;
text-align: center;
&.active {
color: #444;
}
&:nth-last-of-type(1) {
float: right;
position: relative;
&:after {
content: '';
display: block;
width: 1px;
height: pxToRem(44px);
position: absolute;
left: 0;
top: pxToRem(22px);
background: #b0b0b0;
}
}
}
}
//收藏主体
.fav-content {
padding: 0 pxToRem(30px);
.fav-null {
font-size: pxToRem(22px);
color: #444;
display: block;
margin-top: pxToRem(100px);
text-align: center;
&:before {
content: '';
display: block;
@include rem-sprite($fav, fav-null);
width: pxToRem(image_width(sprite-file($fav, fav-null)));
height: pxToRem(image_height(sprite-file($fav, fav-null)));
margin: 0 auto pxToRem(45px) auto;
}
}
.go-shopping {
width: pxToRem(472px);
height: pxToRem(88px);
line-height: pxToRem(88px);
margin: pxToRem(125px) auto 0 auto;
background: #444;
text-align: center;
color: #fff;
display: block;
font-size: pxToRem(26px);
}
}
}
\ No newline at end of file
... ...
@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you";
\ No newline at end of file
@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest";
\ No newline at end of file
... ...
$suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
.yoho-suggest-page {
width: 100%;
height: auto;
// 意见反馈头部
.suggest-header {
text-align: center;
color: #fff;
font-size: pxToRem(26px);
line-height: pxToRem(46px);
overflow: hidden;
padding-bottom: pxToRem(20px);
@include background-image(linear-gradient(#383838, #505050));
&:before {
content: '';
display: block;
@include rem-sprite($suggest, suggest-logo);
width: pxToRem(image_width(sprite-file($suggest, suggest-logo)));
height: pxToRem(image_height(sprite-file($suggest, suggest-logo)));
margin: pxToRem(10px) auto pxToRem(15px) auto;
}
}
//意见反馈主体
.suggest-content {
border-top: pxToRem(30px) solid #fff;
.suggest-item {
width: 100%;
color: #444;
border-top: 1px solid #e0e0e0;
border-bottom: pxToRem(30px) solid #f0f0f0;
> img {
display: block;
overflow: hidden;
width: 100%;
}
> h2 {
font-size: pxToRem(38px);
margin: pxToRem(30px) 0 pxToRem(42px - 11px) 0;
padding: 0 pxToRem(35px);
}
> p {
font-size: pxToRem(26px);
line-height: pxToRem(48px);
padding: 0 pxToRem(35px);
}
.suggest-type {
margin-top: pxToRem(29px - 11px);
height: pxToRem(88px);
line-height: pxToRem(88px);
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
color: #b0b0b0;
font-size: pxToRem(26px);
display: none;
> div {
width: 50%;
float: left;
text-align: left;
padding-left: pxToRem(128px);
@include box-sizing();
&.active {
color: #444;
> span {
display: inline-block;
height: 100%;
overflow: hidden;
&:nth-of-type(1) {
@include rotate(180deg);
@include transition(transform .5);
}
}
}
&:nth-last-of-type(1) {
padding-left: pxToRem(0);
padding-right: pxToRem(128px);
text-align: right;
float: right;
}
}
&.active {
text-align: center;
color: #444;
}
}
}
}
}
\ No newline at end of file
... ...
$vip: sprite-map("me/vip/*.png");
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
.vip-grade-page {
background: #f0f0f0;
... ... @@ -22,8 +22,9 @@ $vip: sprite-map("me/vip/*.png");
.vip-icon {
display: inline-block;
width: pxToRem(70px);
height: pxToRem(30px);
width: pxToRem(72px);
height: pxToRem(32px);
vertical-align: sub;
}
.vip-3 {
... ... @@ -39,7 +40,7 @@ $vip: sprite-map("me/vip/*.png");
}
.grade-desc {
padding: 20rem / $pxConvertRem 0;
margin-top: 20rem / $pxConvertRem;
font-size: 22rem / $pxConvertRem;
color: #b0b0b0;
}
... ... @@ -49,6 +50,7 @@ $vip: sprite-map("me/vip/*.png");
> span {
font-style: italic;
font-size: 28rem / $pxConvertRem;
color: #d1021c;
}
}
... ... @@ -125,29 +127,6 @@ $vip: sprite-map("me/vip/*.png");
font-size: 30rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
}
.icon {
float: left;
display: block;
width: pxToRem(70px);
height: pxToRem(70px);
}
li {
height: 70rem / $pxConvertRem;
padding: 25rem / $pxConvertRem 0;
}
P {
font-size: 28rem / $pxConvertRem;
margin-left: 100rem / $pxConvertRem;
}
span {
display: block;
color: #b0b0b0;
font-size: 22rem / $pxConvertRem;
}
}
.all-privilege {
... ... @@ -163,4 +142,36 @@ $vip: sprite-map("me/vip/*.png");
}
}
}
.vip-privilege-page {
padding: 0 20rem / $pxConvertRem;
}
.privilege-list {
background: #fff;
.icon {
float: left;
display: block;
width: pxToRem(70px);
height: pxToRem(70px);
}
li {
height: 70rem / $pxConvertRem;
padding: 25rem / $pxConvertRem 0;
}
P {
font-size: 28rem / $pxConvertRem;
margin-left: 100rem / $pxConvertRem;
}
span {
display: block;
color: #b0b0b0;
font-size: 22rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="yoho-favorite-page yoho-page">
{{# favorite}}
<ul id="fav-tab" class="fav-tab">
<li class="active">收藏的商品</li>
<li>收藏的品牌</li>
</ul>
<div class="fav-content">
<div class="fav-type">
{{# hasFavProduct}}
{{/ hasFavProduct}}
{{^ hasFavProduct}}
<span class="fav-null">您暂无收藏任何商品</span>
<a class="go-shopping" href="#">随便逛逛</a>
{{/ hasFavProduct}}
</div>
<div class="fav-type hide">
{{# hasFavBrand}}
{{/ hasFavBrand}}
{{^ hasFavBrand}}
<span class="fav-null">您暂无收藏任何品牌</span>
<a class="go-shopping" href="#">随便逛逛</a>
{{/ hasFavBrand}}
</div>
</div>
{{/ favorite}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="vip-grade-page yoho-page">
<div class="vip-privilege-page yoho-page">
{{# vipGrade}}
{{> me/vip-grade/privilege}}
{{/ vipGrade}}
... ...
{{> layout/header}}
<div class="yoho-suggest-page yoho-page">
{{# suggest}}
<h2 class="suggest-header">
为了更好的改进我们的服务,提升用户体验,<br />
我们希望了解您的意见和建议
</h2>
<div class="suggest-content" id="suggest-content">
{{# suggestContent}}
<div class="suggest-item">
<img src="{{imgUrl}}" alt=""/>
<h2>{{title}}</h2>
<p>{{content}}</p>
<!--bad传true表示点了不靠谱,false表示没有任何动作-->
<!--good传true表示点了靠谱,false表示没有任何动作-->
<div id="{{^ good}}show{{/ good}}" class="suggest-type">
<div>
<span class="iconfont">&#xe601;</span>
<span>靠谱</span>
</div>
<div class="{{# bad}}active{{/ bad}}">
<span class="iconfont">&#xe601;</span>
<span>不靠谱</span>
</div>
</div>
<div id="{{# good}}show{{/ good}}" class="suggest-type active">
<span class="iconfont">&#xe601;</span>
<span>靠谱,谢谢您的反馈</span>
</div>
</div>
{{/ suggestContent}}
</div>
{{/ suggest}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -23,9 +23,9 @@
</div>
{{/unless}}
<a class="all-privilege block" href="{{allUrl}}" >
<a class="all-privilege block" href="{{allUrl}}">
查看全部VIP特权
<span class="iconfont>&#xe604;</span>
<span class="iconfont">&#xe604;</span>
</a>
{{/ vipGrade}}
</div>
... ...
... ... @@ -212,8 +212,16 @@
seajs.use('js/me/order');
</script>
{{/if}}
{{!-- 个人中心: 商品收藏&品牌收藏 --}}
{{#if favPage}}
<script>
seajs.use('js/me/fav');
</script>
{{/if}}
{{#if couponsPage}}
<script>
seajs.use('js/me/coupons');
</script>
{{/if}}
{{/if}}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
您已升级至最高的等级啦!
</p>
<p class="sum-cost">
年度累计金额<span>¥{{costOfThisYear}}</span>
年度累计金额<span> ¥ {{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -28,7 +28,7 @@
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span>¥{{costOfThisYear}}</span>
年度累计金额<span> ¥ {{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -51,7 +51,7 @@
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span>¥{{costOfThisYear}}</span>
年度累计金额<span> ¥ {{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -73,7 +73,7 @@
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span>¥{{costOfThisYear}}</span>
年度累计金额<span> ¥ {{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ...
<ul>
<ul class="privilege-list">
{{#each privilege}}
<li>
<img class="icon" src="{{pic}}">
... ...
... ... @@ -150,7 +150,20 @@ class HomeController extends AbstractAction
$favProducts = \Index\UserModel::getFavProductData($uid);
print_r($favProducts);
//print_r($favProducts);
$this->_view->display('favorite', array(
'favPage' => true,
'pageHeader' => array(
'navBack' => true,
'navTitle' => '我的收藏',
'navHome' => true
),
'pageFooter' => true,
'favorite' => true,
'hasFavProduct' => false,
'hasFavBrand' => false
));
}
/**
... ... @@ -268,7 +281,37 @@ class HomeController extends AbstractAction
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
print_r($suggest);
//print_r($suggest);
$this->_view->display('suggest', array(
'suggestPage' => true,
'pageHeader' => array(
'navBack' => true,
'navTitle' => '意见反馈'
),
'pageFooter' => true,
'suggest' => true,
'suggestContent' => array(
0 => array(
'imgUrl' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/12/06/0115bdfeb4a7dca4b4bfdf0e850f82f2a1.jpg?imageView/2/w/640/h/240',
'title' => '为什么手机不能退换货?',
'content' => 'YOHO!有货的退换货承诺:自您签收商品7日内可以退货,15日内可以换货,在商品吊牌、标签、包装完整,不影响二次销售的情况下,YOHO!有货将为您办理退换货服务。',
'good' => true,
'bad' => false),
1 => array(
'imgUrl' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/12/06/0115bdfeb4a7dca4b4bfdf0e850f82f2a1.jpg?imageView/2/w/640/h/240',
'title' => '为什么手机不能退换货?',
'content' => 'YOHO!有货的退换货承诺:自您签收商品7日内可以退货,15日内可以换货,在商品吊牌、标签、包装完整,不影响二次销售的情况下,YOHO!有货将为您办理退换货服务。',
'good' => false,
'bad' => true),
2 => array(
'imgUrl' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/12/06/0115bdfeb4a7dca4b4bfdf0e850f82f2a1.jpg?imageView/2/w/640/h/240',
'title' => '为什么手机不能退换货?',
'content' => 'YOHO!有货的退换货承诺:自您签收商品7日内可以退货,15日内可以换货,在商品吊牌、标签、包装完整,不影响二次销售的情况下,YOHO!有货将为您办理退换货服务。',
'good' => false,
'bad' => false)
)
));
}
/**
... ... @@ -300,8 +343,9 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this -> getUid();
$uid = '10267443';//临时测试用
$uid = '7566245';//临时测试用
$data = GradeModel::getGrade($gender,$channel,$uid);
$data['pageFooter'] = true;
$this -> _view -> display('vip-grade',$data);
}
/*
... ... @@ -316,6 +360,7 @@ class HomeController extends AbstractAction
$channel = Helpers::getChannelByCookie();
$uid = $this -> getUid();
$data = GradeModel::getPreferential($channel,$uid);
$data['pageFooter'] = true;
$this -> _view -> display('privilege',$data);
}
... ...
... ... @@ -259,7 +259,7 @@ class UserModel
// 调用接口获取地址数据
$suggest = UserData::suggestData($udid, $page, $limit);
print_r($suggest);
//print_r($suggest);
// 处理意见反馈数据
if (isset($suggest['data']) && !empty($suggest['data'])) {
... ...
... ... @@ -27,6 +27,7 @@ class GradeModel
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
switch (intval($data['data']['current_vip_level'])) {
case 0://普通会员
... ... @@ -42,19 +43,25 @@ class GradeModel
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['data']['current_year_cost'];
//升级下一等级会员的进度;
$result['vipGrade']['percent'] = 100*(round(round($data['data']['current_total_cost'], 2) / round($data['data']['next_need_cost'], 2), 2));
$result['vipGrade']['percent'] = 100*(round($data['data']['current_total_cost'] / $data['data']['next_need_cost'], 2));
//距离升级所需消费金额
if ($data['data']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['data']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['data']['current_total_cost'];
//username 接口问题取不到,暂时写uid
$result['vipGrade']['name'] = $uid;
//username 调用获取用户基本信息数据,获得username;
$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = $userProfile['data']['username'];
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential',null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['data']['enjoy_preferential'];
}
if (USE_CACHE) {
... ...
... ... @@ -119,7 +119,7 @@ class NewsaleController extends AbstractAction
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('product', $result);
$this->_view->display('hotList', $result);
}
}
... ...