Authored by hf

do fixes bugs to product detail show tags

... ... @@ -22,12 +22,12 @@ class Yohobuy
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL
const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/';
/**
... ...
... ... @@ -59,7 +59,6 @@ class OrderData
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
public static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
... ... @@ -94,7 +93,7 @@ class OrderData
}
/*
* 支付url
* 支付页面的资源位
* To change this template file, choose Tools | Templates
*/
public static function paymentData($gender, $yh_channel, $code)
... ...
... ... @@ -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() {
... ...
... ... @@ -119,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) {
... ... @@ -146,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) {
... ...
... ... @@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('click', function() {
$('.goodsDiscount .dropdown').on('touchend', function(e) {
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('');
$discountFolder.slideDown();
... ... @@ -46,5 +46,7 @@ $('.goodsDiscount .dropdown').on('click', function() {
$discountArrow.removeClass('icon-up').addClass('icon-down').html('');
$discountFolder.slideUp();
}
return false;
});
require('./like');
... ...
... ... @@ -3,100 +3,101 @@
* @author: Lynnic
* @date: 2015/11/25
*/
var $ = require('jquery'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var loadMoreUrl = $('#loadMoreUrl').val(),
$commentsDiv = $('#goods-comments'),
$consultsDiv = $('#goods-consults'),
winH = $(window).height(),
searching = false,
end = false;
var jsonObj;
//插入评论列表底部
function insertCommentsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="comment-item">';
html += '<span class="user-name">' + json[i].userName + '</span>';
html += '<span class="goods-spec">' + json[i].desc + '</span>';
html += '<span class="goods-spec">' + json[i].content + '</span>';
html += '<span class="goods-spec">' + json[i].time + '</span>';
}
$commentsDiv.append(html);
}
//插入咨询列表底部
function insertConsultsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="consult-item"> ';
html += '<div class="question"> ';
html += '<span class="iconfont">&#xe639;</span> ';
html += '<p> ';
html += json[i].question + '<br> ';
html += '<span class="time">' + json[i].time + '</span> ';
html += '</p> ';
html += '</div> ';
html += '<div class="answer"> ';
html += '<span class="iconfont">&#xe63c;</span> ';
html += '<p>' + json[i].answer + '</p> ';
html += '</div> ';
html += '</div> ';
}
$consultsDiv.append(html);
}
function search() {
if (searching || end) {
return;
}
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: loadMoreUrl,
success: function(data) {
if (data.length > 0) {
jsonObj = JSON.parse(data);
if ($commentsDiv.length > 0) {
insertCommentsDiv(jsonObj);
} else if ($consultsDiv.length > 0) {
insertConsultsDiv(jsonObj);
}
}
searching = false;
end = true;
loading.hideLoadingMask();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
\ No newline at end of file
// var $ = require('jquery'),
// loading = require('../../plugin/loading'),
// tip = require('../../plugin/tip');
// var loadMoreUrl = $('#loadMoreUrl').val(),
// $commentsDiv = $('#goods-comments'),
// $consultsDiv = $('#goods-consults'),
// winH = $(window).height(),
// searching = false,
// end = false;
// var jsonObj;
// //插入评论列表底部
// function insertCommentsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="comment-item">';
// html += '<span class="user-name">' + json[i].userName + '</span>';
// html += '<span class="goods-spec">' + json[i].desc + '</span>';
// html += '<span class="goods-spec">' + json[i].content + '</span>';
// html += '<span class="goods-spec">' + json[i].time + '</span>';
// }
// $commentsDiv.append(html);
// }
// //插入咨询列表底部
// function insertConsultsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="consult-item"> ';
// html += '<div class="question"> ';
// html += '<span class="iconfont">&#xe639;</span> ';
// html += '<p> ';
// html += json[i].question + '<br> ';
// html += '<span class="time">' + json[i].time + '</span> ';
// html += '</p> ';
// html += '</div> ';
// html += '<div class="answer"> ';
// html += '<span class="iconfont">&#xe63c;</span> ';
// html += '<p>' + json[i].answer + '</p> ';
// html += '</div> ';
// html += '</div> ';
// }
// $consultsDiv.append(html);
// }
// function search() {
// if (searching || end) {
// return;
// }
// searching = true;
// loading.showLoadingMask();
// $.ajax({
// type: 'GET',
// url: loadMoreUrl,
// success: function(data) {
// if (data.length > 0) {
// jsonObj = JSON.parse(data);
// if ($commentsDiv.length > 0) {
// insertCommentsDiv(jsonObj);
// } else if ($consultsDiv.length > 0) {
// insertConsultsDiv(jsonObj);
// }
// }
// searching = false;
// end = true;
// loading.hideLoadingMask();
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
// }
// function scrollHandler() {
// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
// search();
// }
// }
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
\ No newline at end of file
... ...
... ... @@ -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", "pay";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay";
... ...
... ... @@ -44,6 +44,7 @@
padding: 0 pxToRem(28px);
height: pxToRem(120px);
background-color: #ffffff;
border-bottom: 1px solid $borderC;
i,
span,
a {
... ... @@ -64,6 +65,8 @@
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
.question {
font-size: pxToRem(24px);
color: $mainFontC;
... ...
... ... @@ -135,7 +135,7 @@ $basicBtnC:#eb0313;
// overflow: hidden;
}
.banner-top-single{
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
... ... @@ -169,7 +169,7 @@ $basicBtnC:#eb0313;
overflow: hidden;
ul {
position: relative;
height: 100%;
height: auto;
li {
float: left;
}
... ... @@ -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}}
... ...
... ... @@ -22,7 +22,7 @@
{{/comments}}
{{#if loadmore}}
<input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
<input id="loadMoreUrl" type="hidden" value="{{loadMoreUrl}}">
{{/if}}
</div>
... ...
... ... @@ -3,7 +3,7 @@
<div class="goto-consult">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<a href="{{consultUrl}}" class="iconfont enter-consult-page">&#xe604;</a>
<a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
... ... @@ -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}}
... ...
... ... @@ -288,7 +288,9 @@
</script>
{{/if}}
{{#if logisticInfoPage}}
<script>
seajs.use('js/me/logistic');
</script>
{{/if}}
{{#if payCenterPage}}
<script>
... ...
... ... @@ -26,9 +26,9 @@
<span class="iconfont">&#xe63c;</span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<!-- <div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
</div> -->
</div>
<div class="consult-content content hide ">
... ... @@ -50,7 +50,7 @@
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<a href="/product/detail/consults">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -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()
... ... @@ -683,6 +683,7 @@ class HomeController extends AbstractAction
$order['walkwayUrl'] = Helpers::url('/product/new');
} else {
echo ' ';
exit();
}
//渲染模板
... ... @@ -763,7 +764,7 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public function payAction()
public function payAction()
{
$this->_view->display('pay', array(
'payAppInfo' => array(
... ... @@ -774,7 +775,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'])) {
... ...
... ... @@ -23,7 +23,7 @@ class OrderModel
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 5772257); var_dump($data); exit;
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
... ...
... ... @@ -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) {
... ...
... ... @@ -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;
}
... ...
... ... @@ -183,12 +183,17 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
<<<<<<< HEAD
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) {
>>>>>>> 7ec3ab0fd7a1cecfedcedf1a5a67be76eff64a65
$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);
}
}
}
... ...
... ... @@ -143,7 +143,7 @@ class DetailController extends AbstractAction
// 渲染模板
$this->_view->display('consultform', array(
'consultform' => true,
'consultformPage' => true,
'productId' => $productId,
'formUrl' => Helpers::url('/product/detail/consultsubmit'),
));
... ...