Authored by Lynnic

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

... ... @@ -107,7 +107,7 @@
}
## 首页
{
headerDownload: {
img: '',
... ... @@ -249,7 +249,7 @@
## 逛
### 资讯(公用)
{
id: 1,
showTags: true/false, //是否显示标签
... ... @@ -305,9 +305,9 @@
}
### 逛列表页
{
infos:
infos:
[
{...}, //标签
...
... ... @@ -724,7 +724,7 @@
},
...
]
}
## 商品列表页
... ... @@ -987,14 +987,14 @@
canceled: true, //已取消
unpaid: true, //or 未支付
unreceived: '', //or 待收货(未发货/未收货),查看物流URL
//待收货时传递物流参数
logisticsUrl: ''
}
### 订单详情页
{
orderDetail: {
orderNum: '', //订单号
... ... @@ -1006,7 +1006,7 @@
orderStatus: '订单成功', //订单取消...等订单状态
orderNum: '',
orderTime: '',
//订单状态
canceled: true, //是否是取消的订单
completed: true, //是否是已完成订单
... ... @@ -1060,7 +1060,7 @@
'navHome': 'sss ',
'navTitle': '商品详情'
},
'bannerTop': {
'list': [
{
... ... @@ -1090,7 +1090,7 @@
is_soon_sold_out: true //即将售罄
}
],
'goodsName' : 'Stussy No. 4 BOX TEE ',
'goodsSubtitle' : '【全民拼抢购】经典印花T恤,满4件免一件!',
... ... @@ -1166,25 +1166,25 @@
'detail' : {
'list' : [
{
{
'params' : [
{
{
'param' : '尺寸'
},
...
...
]
},
...
]
}
},
'measurementMethod' : {
'title': '测量方式',
'enTitle': 'MEASUREMENT METHOD',
'img' : '',
},
'reference' : {
'title' : '模特试穿',
'enTitle' : '',
... ... @@ -1243,6 +1243,32 @@
'cartInfo' : {
'numInCart' : 3,
'goodsInstore' : 0,
'isCollect':true//
'isCollect':true//
}
}
### 支付中心
{
'payAppInfo' : {
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/'
'app' : '微信支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
}
}
### 物流详情
{
'logisticImg' : 'http://static.yohobuy.com/images/icon.png',
'logisticUrl' : 'http://www.shunfeng.com',
'logisticCompany' : '顺丰',
'logisticNumber' : '1231231231',
'logisticDetail' : {
'status' : '南京市 派送中',
'date' : '2015-12-03'
}
}
... ...
... ... @@ -13,7 +13,6 @@ var $addressForm = $('.edit-address'),
$submit = $('.submit'),
$editAddressPage = $('.my-edit-address-page'),
$addressListPage = $('.my-address-list-page'),
$footer = $('#yoho-footer'),
$backBtn = $('.nav-back'),
$navTitle = $('.nav-title'),
$input = $('input, textarea'),
... ... @@ -111,12 +110,6 @@ $submit.on('touchend', function() {
$(this).removeClass('highlight');
});
$input.on('focus', function() {
$footer.hide();
}).on('blur', function() {
$footer.show();
});
// 省市区列表异步加载
$.get('/home/locationList').then(function(html) {
$addressListPage.html(html);
... ... @@ -124,9 +117,7 @@ $.get('/home/locationList').then(function(html) {
// 省市区
$area.on('touchend', function() {
$editAddressPage.hide();
$addressListPage.show(1, function() {
$footer.hide();
});
$addressListPage.show();
currentPage = 'list';
$navTitle.html('地区选择');
});
... ... @@ -165,7 +156,6 @@ $.get('/home/locationList').then(function(html) {
$editAddressPage.show();
currentPage = 'edit';
$navTitle.html(navTitle);
$footer.show();
// 恢复默认的三级选择
$addressListPage.hide();
... ...
... ... @@ -25,7 +25,6 @@ var end = false,
var winH = $(window).height();
load.init();
function moreRecord(cb) {
var count = $page.children('.browse-record-good').length;
... ... @@ -61,7 +60,7 @@ function moreRecord(cb) {
lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy'));
}
window.rePosFooter();
page++;
if (cb) {
... ... @@ -99,6 +98,7 @@ $page.on('touchstart', '.del-icon', function() {
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'GET',
url: '/home/delRecord',
... ... @@ -107,7 +107,12 @@ $page.on('touchstart', '.del-icon', function() {
},
success: function(data) {
if (data.code === 200) {
window.history.go(0);
dialog.showDialog({
dialogText: '删除浏览记录成功',
autoHide: true,
fast: true
});
setTimeout(function(){window.history.go(0);},1000);
}
},
complete: function() {
... ...
... ... @@ -81,4 +81,4 @@ exports.showDialog = function(data, callback) {
exports.hideDialog = function() {
$dialogWrapper.fadeOut();
};
\ No newline at end of file
};
... ...
... ... @@ -15,3 +15,5 @@ require('./address');
require('./suggest');
require('./browse-record');
require('./address-act');
require('./logistic');
require('./pay');
... ...
... ... @@ -127,10 +127,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '删除订单成功',
autoHide: true,
fast: true
});
//删除订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '删除订单失败',
autoHide: true,
fast: true
});
}
});
});
... ... @@ -152,10 +164,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '取消订单成功',
autoHide: true,
fast: true
});
//取消订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '取消订单失败',
autoHide: true,
fast: true
});
}
});
});
... ... @@ -184,4 +208,4 @@ $(window).scroll(function() {
});
//初始化请求第一页数据
getOrders();
\ No newline at end of file
getOrders();
... ...
... ... @@ -3,12 +3,11 @@
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/03
*/
var loading = require('../plugin/loading');
function isWXOpen() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
return true;
} else {
... ... @@ -19,7 +18,6 @@ function isWXOpen() {
function hideWeChatPay() {
var payApps = document.getElementsByClassName('app');
[].forEach.call(payApps, function(app, index) {
if (app.innerHTML.indexOf('微信') !== -1) {
app.parentNode.style.display = 'none';
... ... @@ -29,9 +27,61 @@ function hideWeChatPay() {
}
function handleForWX() {
if (isWXOpen()) {
if (!isWXOpen()) {
hideWeChatPay();
}
}
window.onload = handleForWX;
function setIcon(div, appName) {
if (appName.indexOf('百度') !== -1) {
div.style.backgroundPositionY = '-2.7rem';
return false;
}
if (appName.indexOf('微信') !== -1) {
div.style.backgroundPositionY = '-1.2rem';
return false;
}
if (appName.indexOf('银联') !== -1) {
div.style.backgroundPositionY = '-4rem';
return false;
}
if (appName.indexOf('QQ') !== -1) {
div.style.backgroundPositionY = '-5.4rem';
return false;
}
}
function loadIcon() {
var boxs = document.getElementsByClassName('box');
var div = null;
var appName = null;
[].forEach.call(boxs, function(box, index) {
div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0];
if (div) {
appName = box.getElementsByClassName('app')[0].innerHTML;
setIcon(div, appName);
}
});
}
function showPage() {
var pageList = document.getElementsByClassName('payapp-list')[0];
pageList.style.visibility = 'visible';
}
function main() {
handleForWX();
loading.hideLoadingMask();
showPage();
loadIcon();
}
loading.showLoadingMask();
window.onload = main;
... ...
... ... @@ -82,6 +82,9 @@ headerNavHammer.on('tap', function(e) {
autoHide: true,
dialogText: '提交成功'
});
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
}
}).fail(function() {
... ... @@ -116,7 +119,8 @@ $likeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 1
}
}).then(function(data) {
if (data.code === 200) {
... ... @@ -143,7 +147,8 @@ $disLikeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 2
}
}).then(function(data) {
if (data.code === 200) {
... ...
... ... @@ -5,9 +5,8 @@
* @date: 2015/10/19
*/
var $ = require('jquery');
// Hammer = require('yoho.hammer');
var $ = require('jquery'),
Hammer = require('yoho.hammer');
var $filter;
... ... @@ -113,8 +112,7 @@ function subClassifyTapEvt($this) {
//初始化筛选
function initFilter(opt) {
// var filterHammer;
var filterHammer;
//注册回调
fCbFn = opt.fCbFn;
... ... @@ -127,8 +125,8 @@ function initFilter(opt) {
$filter = $('.filter-mask');
// filterHammer = new Hammer($filter[0]);
$filter.on('touchend', function(e) {
filterHammer = new Hammer($filter[0]);
filterHammer.on('tap', function(e) {
var $this = $(e.target),
$cur;
... ... @@ -147,7 +145,7 @@ function initFilter(opt) {
//tap classify
$cur = $this.closest('.classify-item');
e.stopPropagation();
e.srcEvent.stopPropagation();
classifyTapEvt($cur);
}
... ... @@ -183,4 +181,4 @@ exports.showFilter = showFilter;
exports.hideFilter = hideFilter;
exports.resetFilter = resetFilter;
\ No newline at end of file
exports.resetFilter = resetFilter;
... ...
... ... @@ -97,8 +97,7 @@ a {
left: 50%;
margin-left: -35%;
margin-top: -45px;
background-color: #000;
opacity: 0.7;
background-color: rgba(0,0,0,.7);
color: #fff;
font-size: 18px;
border: none;
... ...
... ... @@ -55,7 +55,7 @@
position: absolute;
right: 0.75rem;
bottom: 0.25rem;
color: #ccc;
color: #999;
}
}
... ...
... ... @@ -181,7 +181,11 @@
top: 50%;
margin-top: -0.75rem;
right: 0;
color: #666;
color: #999;
padding-right: 0.75rem;
text-align: right;
}
}
}
... ... @@ -343,5 +347,10 @@
height: 2rem;
background: image_url('loading.gif') center center no-repeat;
@include background-size(auto 40%);
position: absolute;
top: 50%;
left: 0;
margin-top: -1rem;
}
}
\ No newline at end of file
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay";
... ...
.pay-page {
padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
.payapp-list {
visibility: hidden;
}
.box {
border: 1px solid #eee;
border-radius: 10rem / $pxConvertRem;
... ... @@ -16,31 +20,37 @@
}
.icon {
flex-grow: 0.3;
width: 15%;
img {
width: 60rem / $pxConvertRem;
margin: 0;
}
> div {
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
background-image: url(http://localhost:8000/img/layout/pay-icon.png);
background-size: 90%;
background-position-y: 8rem / $pxConvertRem;
background-position-x: center;
background-repeat: no-repeat;
}
}
.app {
flex-grow: 3;
width: 40%;
font-size: 32rem / $pxConvertRem;
color: #414141;
//padding-left: 20rem/$pxConvertRem
}
.hint {
flex-grow: 4;
width: 40%;
font-size: 24rem / $pxConvertRem;
color: #4b4b4b;
}
.iconfont {
flex-grow: 1;
width: 5%;
justify-content: flex-end;
color: #e0e0e0;
font-size: 28rem / $pxConvertRem;
... ...
... ... @@ -135,7 +135,7 @@ $basicBtnC:#eb0313;
// overflow: hidden;
}
.banner-top-single{
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
... ... @@ -181,8 +181,8 @@ $basicBtnC:#eb0313;
min-height: pxToRem(83px);
font-size: pxToRem(28px);
color: #fff;
padding-left: pxToRem(25px);
padding-right: pxToRem(25px);
padding-left: pxToRem(28px);
padding-right: pxToRem(28px);
line-height: pxToRem(36px);
background-color: #515150;
}
... ...
... ... @@ -11,6 +11,6 @@
<div class="null">
<i></i>
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
<a href="/product/new">随便逛逛</a>
</div>
{{/ noRecord}}
... ...
{{> layout/header}}
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<div class="icon" style='background-image:url("{{logisticImg}}")'> </div>
</div>
<div class="right">
<div>
<span class='info'>物流公司:</span>
<span >{{logisticCompany}}</span>
</div>
<div>
<span class='info'>快递单号:</span>
<span>{{logisticNumber}}</span>
</div>
</div>
</div>
<div class="title">
<span>物流详情</span>
</div>
<div class="detail">
{{# logisticDetail}}
<div class="timeline-box ">
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{ city}}&nbsp;&nbsp;&nbsp;{{ status}}
</div>
<div class="timeline-info-row">
{{date}}
</div>
</div>
</div>
{{/ logisticDetail}}
</div>
</div>
{{> layout/footer}}
{{> layout/header}}
<div class="pay-page yoho-page">
{{# payAppInfo}}
<div class="box">
<div class="icon">
<img src="{{appIcon}}" alt="app图标">
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
<div class="payapp-list">
{{# payAppInfo}}
<a href="{{payLink}}">
<div class="box">
<div class="icon">
{{#if appIcon}}
<img src="{{appIcon}}" alt="app图标">
{{else}}
<div></div>
{{/if}}
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
</div>
</a>
{{/ payAppInfo}}
</div>
{{/ payAppInfo}}
</div>
{{> layout/footer}}
... ...
... ... @@ -22,7 +22,7 @@
{{/comments}}
{{#if loadmore}}
<input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
<input id="loadMoreUrl" type="hidden" value="{{loadMoreUrl}}">
{{/if}}
</div>
... ...
... ... @@ -28,7 +28,7 @@
{{/ consults}}
{{#if loadmore}}
<input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
<input id="loadMoreUrl" type="hidden" value="{{loadMoreUrl}}">
{{/if}}
</div>
{{> layout/footer}}
... ...
... ... @@ -131,10 +131,10 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value='{{introUrl}}'>
<input id="introUrl" type="hidden" value="{{introUrl}}">
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value='{{id}}'>
<input id="productId" type="hidden" value="{{id}}">
{{/if}}
</div>
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<div id="hotRank"></div>
{{#if brand}}
... ...
... ... @@ -292,3 +292,8 @@
seajs.use('js/me/logistic');
</script>
{{/if}}
{{#if payCenterPage}}
<script>
seajs.use('js/me/pay');
</script>
{{/if}}
... ...
... ... @@ -22,7 +22,7 @@ class HomeController extends AbstractAction
/**
* 通过当前用户审判是否跳到登录
*
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
... ... @@ -181,7 +181,8 @@ class HomeController extends AbstractAction
$this->setNavHeader('浏览记录', true, SITE_MAIN);
$this->_view->display('browse-record', array(
'browseRecordPage' => true
'browseRecordPage' => true,
'pageFooter' => true
));
}
... ... @@ -351,7 +352,6 @@ class HomeController extends AbstractAction
$id = $this->get('id', null);
$data = array(
'addressActionPage' => true,
'pageFooter' => true,
'addressList' => UserModel::getAddressListData($uid)
);
... ... @@ -627,7 +627,7 @@ class HomeController extends AbstractAction
/*
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*
*
*/
public function orderAction()
... ... @@ -763,7 +763,7 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public function payAction()
public function payAction()
{
$this->_view->display('pay', array(
'payAppInfo' => array(
... ... @@ -774,7 +774,7 @@ class HomeController extends AbstractAction
'hint' => '需下载微信客户端',
'subHint' => '推荐使用',
),
),
));
}
... ...
... ... @@ -84,6 +84,18 @@ class BrandModel
$result['bannerTop']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop']['list'][0]['data'])) {
$build = array();
foreach ($brand['brandTop']['list'][0]['data'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['title'] = $value['title'];
$result['bannerTop']['list'][] = $build;
}
}
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if (!empty($brand['brandTop'][1]['data']['list'])) {
... ...
... ... @@ -98,8 +98,8 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart(self::CODE_BG);
if (isset($banner['data'][0]['data']['list'][0]['src'])) {
$result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2);
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
$result = Helpers::getImageUrl($banner['data']['list'][0]['data']['list'][0]['src'], 640, 800, 2);
}
if (USE_CACHE) {
... ...
... ... @@ -104,7 +104,7 @@ class SideModel
'textCn' => '查看全部',
'textEn' => '',
'back' => false,
'isSelect' => ($guangChoosed === 'all') ? true : false,
'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
),
2 => array(
... ...
... ... @@ -239,8 +239,8 @@ class UserModel
$product = array();
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0;
$brand['productList'][] = $product;
}
... ... @@ -302,7 +302,7 @@ class UserModel
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) {
if(count($newsale['data']['list'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
foreach ($newsale['data']['list'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
}
}
}
... ...