Authored by 姜枫

fix shop bugs

... ... @@ -51,7 +51,7 @@ const helpers = {
let other = false;
_.forEach(brands, (b) => {
let name = b.brandNameEn || b.brandName;
let name = b.brandAlif || b.brandNameEn || b.brandName;
let char = name.toLowerCase().charAt(0);
if ((char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z')) {
... ... @@ -240,6 +240,12 @@ const helpers = {
sorts[0].sub[0].checked = true;
}
if (q.misort) {
sorts[0].sub.forEach( s => {
s.checked = s.categoryId === q.misort;
});
}
sorts = sorts[0].sub;
}
... ...
... ... @@ -42,7 +42,7 @@
<div class="goods-wrap">
{{#each newProducts}}
<div class="goods-info" data-skn="{{productSkn}}">
<a href="" target="_blank">
<a href="/product/pro_{{productId}}_{{goodsId}}/{{cnAlphabet}}.html" target="_blank">
<img class="lazy thumb" data-original="{{src}}" style="display: block;">
</a>
<div class="desc">
... ... @@ -66,7 +66,7 @@
<div class="goods-wrap">
{{#each hotProducts}}
<div class="goods-info" data-skn="{{productSkn}}">
<a href="" target="_blank">
<a href="/product/pro_{{productId}}_{{goodsId}}/{{cnAlphabet}}.html" target="_blank">
<img class="lazy thumb" data-original="{{src}}" style="display: block;">
</a>
<div class="desc">
... ...
... ... @@ -22,8 +22,8 @@ module.exports = {
},
cookieDomain: 'yohoblk.com',
domains: {
api: 'http://devapi.yoho.cn:58078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://devservice.yoho.cn:58077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
api: 'http://dev-api.yohops.com:9999/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://dev-service.yohops.com:9999/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
search: 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: false,
... ...
var lazyload = require('yoho-jquery-lazyload');
var Dialog = require('../plugins/dialog').Dialog;
var tplFn = require('../../tpl/product/shop-goods.hbs');
require('../common/header');
... ... @@ -16,6 +17,11 @@ $(function() {
var total = parseInt($('.total-page', $order).text(), 10);
var page = 1;
var orderBy;
var infoDaialog = new Dialog({
className: 'brand-info-dialog',
content: $('.brand-info-wrapper').html(),
keep: true
});
function refreshProducts(data) {
$('.cur-page', $order).text(page);
... ... @@ -35,8 +41,9 @@ $(function() {
$($nextPage).click(function() {
if (!$(this).hasClass('disable') && page < total) {
page += 1;
$.get('/product/shop/query/all', {
page: page++,
page: page,
shopId: shopId
}, function(data) {
refreshProducts(data);
... ... @@ -46,8 +53,9 @@ $(function() {
$($prePage).click(function() {
if (!$(this).hasClass('disable') && page > 1) {
page -= 1;
$.get('/product/shop/query/all', {
page: page--,
page: page,
shopId: shopId
}, function(data) {
refreshProducts(data);
... ... @@ -88,5 +96,12 @@ $(function() {
refreshProducts(data);
});
});
$('#brand-info').click(function() {
infoDaialog.show();
$('.brand-info').addClass('nano');
$('.brand-info').nanoScroller();
});
});
... ...
... ... @@ -42,6 +42,9 @@
font-weight: 700;
margin-left: 10px;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 200px;
}
.input-radio label.round-color {
margin-left: 0;
... ... @@ -281,6 +284,9 @@
.goods-brand {
font-weight: 700;
padding: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.goods-img {
... ...
... ... @@ -113,7 +113,7 @@
margin: 25px 10px;
border-width: 1px;
.name {
.desc {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
... ...