Authored by Rock Zhang

Merge branch 'develop' into test

Conflicts:
	library/LibModels/Wap/Product/SearchData.php
Code Review By Rock Zhang
... ... @@ -30,8 +30,8 @@ class SearchData
switch (APPLICATION_ENV) {
case 'release':
return 'http://100.98.132.63/yohosearch/search.json';
case 'preview':
case 'test':
case 'preview':
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';
... ...
... ... @@ -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;
... ...
/**
* 我要咨询提交页面
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/12/01
*/
var $ = require('jquery'),
tip = require('../../plugin/tip'),
loading = require('../../plugin/loading');
var $consultForm = $('.consult-form'),
$submit = $('#submit'),
$content = $('#content'),
productId = $('#product_id').val(),
isSubmiting;
$submit.on('touchend', function() {
$content.blur();
$consultForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
$content.on('focus', function() {
if ($content.val() === '请输入咨询内容') {
$content.val('');
}
}).on('blur', function() {
if ($content.val() === '') {
$content.val('请输入咨询内容');
}
});
// 提交表单请求
$consultForm.on('submit', function() {
var content;
if (isSubmiting) {
return false;
}
// 简单的表单校验
content = $content.val();
if (!content || content === '请输入咨询内容') {
tip.show('咨询内容不能为空');
return false;
}
isSubmiting = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/product/detail/consultsubmit',
data: {
product_id: productId,
content: content
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.history.go(-1);
}
}).fail(function() {
tip.show('网络出了点问题~');
isSubmiting = false;
});
return false;
});
... ...
... ... @@ -9,10 +9,9 @@ var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer(document.getElementById('likeBtn'));
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
var productId = $('#productId').val();
var likeHammer = new Hammer(document.getElementById('likeBtn')),
addToCartHammer = new Hammer(document.getElementById('addtoCart')),
productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var opt,
... ...
... ... @@ -8,4 +8,5 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/desc');
\ No newline at end of file
require('./detail/loadmore');
require('./detail/consultform');
\ No newline at end of file
... ...
... ... @@ -157,6 +157,9 @@
margin-top: -$height / 2;
}
.del-fav {
text-indent: 0;
}
}
span {
... ...
... ... @@ -114,6 +114,10 @@ $basicBtnC:#eb0313;
background-color: #000;
color: #fff;
}
.yohood-tag {
background-color: #000;
color: #fff;
}
.limit-tag {
border: 1px solid #000;
background-color: #fff;
... ... @@ -131,7 +135,7 @@ $basicBtnC:#eb0313;
// overflow: hidden;
}
.banner-top-single{
height:pxToRem(600px);
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
... ...
... ... @@ -130,9 +130,10 @@
div {
text-align: center;
&.cell {
line-height: pxToRem(53px);
font-size: pxToRem(24px);
background-color: $tableCellC;
padding: pxToRem(15px) pxToRem(40px);
padding: 0 pxToRem(40px);
border: 1px solid #fff;
}
}
... ... @@ -143,14 +144,15 @@
#reference-swiper-container {
.first-group {
width: pxToRem(70px);
margin-top: pxToRem(66px);
.avatar {
// line-height: pxToRem(40px);
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
height: pxToRem(40px);
margin: pxToRem(12px) 0;
margin-top: pxToRem(55px);
div{
height: pxToRem(55px);
.avatar {
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
margin-top:pxToRem(7px);
}
}
}
}
... ...
... ... @@ -3,7 +3,7 @@
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
<a type="submit" id="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
<div class="good-tag yohood-tag"></div>
<div class="good-tag yohood-tag">新品节</div>
{{/ is_yohoood}}
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
... ... @@ -95,7 +95,7 @@
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ... @@ -113,6 +113,7 @@
{{/ enterStore}}
<div id="productDesc"> </div>
<!-- {{> product/product-description}} -->
{{> product/recommend-for-you}}
{{#cartInfo}}
... ... @@ -130,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="newarrival-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
<script>
seajs.use('js/common');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
seajs.use('js/guang/plus-star/list');
... ... @@ -175,6 +175,12 @@
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情我要咨询 --}}
{{#if consultformPage}}
<script>
seajs.use('js/product/detail/consultform');
</script>
{{/if}}
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
... ...
... ... @@ -59,7 +59,7 @@
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -72,7 +72,9 @@
{{#params}}
{{#if @first}}
{{else}}
<img class="avatar lazy" data-original="{{param}}" alt="">
<div>
<img class="avatar lazy" data-original="{{param}}" alt="">
</div>
{{/if}}
{{/params}}
</div>
... ...
... ... @@ -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;
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
if(count($newsale['data'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
}
}
}
... ...