Authored by 沈志敏

Merge branch 'develop' into release/1.0

... ... @@ -19,8 +19,8 @@ exports.notFound = () => {
module: 'common',
page: 'error',
title: '页面不存在 | YOHO!BLK | 潮流购物逛不停',
pageFooter: true,
isErr: true
noLocalJS: true,
noLocalCSS: true
});
};
};
... ... @@ -45,12 +45,11 @@ exports.serverError = () => {
}
return res.render('error/500', {
err: err,
module: 'common',
page: 'error',
title: '服务器错误 | YOHO!BLK | 潮流购物逛不停',
pageFooter: true,
isErr: true
noLocalJS: true,
noLocalCSS: true
});
}
next(err);
... ...
<div class="err-page yoho-page">
<h1>404</h1>
<div class="err-status">
<div class="err-404"></div>
</div>
<div class="tips">
<span class="tip">哎呀,您访问的页面走丢了...</span>
<span class="tips-english">404 File Not Found, Sorry</span>
<a class="home" href="/">回到首页</a>
</div>
</div>
\ No newline at end of file
... ...
<div class="err-page yoho-page">
<h1>500</h1>
<div class="err-status">
<div class="err-500"></div>
</div>
<div class="tips">
<span class="tip">哎呀,程序出错了...</span>
<span class="tips-english">500- Server Internal Error</span>
<a class="home" href="/">回到首页</a>
</div>
</div>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 243.422 102.159" enable-background="new 0 0 243.422 102.159" xml:space="preserve">
<g id="XMLID_16_">
<path id="XMLID_2_" fill="#3B95C8" d="M56.974,1.928v70.768h18.478V76H56.974v24.231h-3.359V76H0v-3.442l53.194-70.63H56.974z
M3.92,72.695h49.694V7.298h-0.42L3.92,72.695z"/>
<path id="XMLID_5_" fill="#040000" d="M148.238,17.485c3.919,8.536,6.019,19.688,6.019,33.595c0,13.768-2.1,25.058-6.019,33.594
c-5.459,11.564-14.278,17.485-26.597,17.485c-12.318,0-21.277-5.921-26.597-17.485c-3.92-8.536-5.879-19.688-5.879-33.594
c0-14.044,1.959-25.196,5.879-33.595C100.364,5.783,109.323,0,121.641,0C133.96,0,142.779,5.783,148.238,17.485z M98.124,19
c-3.78,7.985-5.6,18.587-5.6,32.08c0,13.354,1.82,24.094,5.6,32.079c4.899,10.464,12.738,15.695,23.517,15.695
c10.639,0,18.478-5.231,23.518-15.695c3.779-8.123,5.739-18.862,5.739-32.079c0-13.355-1.96-24.095-5.739-32.08
c-5.04-10.464-12.878-15.695-23.518-15.695C110.862,3.305,103.023,8.536,98.124,19z"/>
<path id="XMLID_8_" fill="#3B95C8" d="M224.944,1.928v70.768h18.478V76h-18.478v24.231h-3.359V76h-53.614v-3.442l53.194-70.63
H224.944z M171.891,72.695h49.694V7.298h-0.42L171.891,72.695z"/>
</g>
</svg>
... ...
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 232.923 102.159" enable-background="new 0 0 232.923 102.159" xml:space="preserve">
<g id="XMLID_27_">
<path id="XMLID_2_" fill="#3B95C8" d="M61.593,1.928v3.305H11.059L7,47.638h0.56c2.799-3.718,6.439-6.608,11.199-8.674
c4.339-1.928,8.959-2.892,13.718-2.892c9.519,0,17.218,2.754,23.097,8.398c6.16,5.921,9.239,14.181,9.239,24.783
c0,9.361-3.08,17.21-9.239,23.543c-6.159,6.195-13.998,9.362-23.657,9.362c-8.399,0-15.398-2.341-21.138-6.746
C4.34,90.456,0.7,83.572,0,74.898h3.5c0.56,7.572,3.779,13.63,9.519,18.036c5.18,3.992,11.479,6.058,18.898,6.058
c8.679,0,15.678-2.892,21.278-8.536c5.459-5.782,8.259-12.804,8.259-21.202c0-9.638-2.8-17.21-8.259-22.442
c-5.319-5.094-12.179-7.572-20.718-7.572c-5.459,0-10.499,1.377-15.258,4.13c-4.759,2.754-8.399,6.472-10.639,11.152h-3.5
L7.839,1.928H61.593z"/>
<path id="XMLID_4_" fill="#040000" d="M142.919,17.485c3.919,8.536,6.019,19.688,6.019,33.595c0,13.767-2.1,25.057-6.019,33.593
c-5.459,11.564-14.278,17.485-26.597,17.485c-12.318,0-21.277-5.921-26.597-17.485c-3.92-8.536-5.879-19.688-5.879-33.593
c0-14.044,1.959-25.196,5.879-33.595C95.044,5.783,104.003,0,116.322,0C128.641,0,137.459,5.783,142.919,17.485z M92.805,19
c-3.78,7.985-5.6,18.587-5.6,32.08c0,13.354,1.82,24.093,5.6,32.079c4.899,10.464,12.738,15.695,23.517,15.695
c10.639,0,18.478-5.231,23.518-15.695c3.779-8.123,5.739-18.862,5.739-32.079c0-13.355-1.96-24.095-5.739-32.08
C134.8,8.536,126.961,3.305,116.322,3.305C105.543,3.305,97.704,8.536,92.805,19z"/>
<path id="XMLID_7_" fill="#040000" d="M226.904,17.485c3.919,8.536,6.019,19.688,6.019,33.595c0,13.767-2.1,25.057-6.019,33.593
c-5.46,11.564-14.278,17.485-26.598,17.485c-12.318,0-21.277-5.921-26.597-17.485c-3.92-8.536-5.879-19.688-5.879-33.593
c0-14.044,1.959-25.196,5.879-33.595C179.029,5.783,187.988,0,200.307,0C212.626,0,221.444,5.783,226.904,17.485z M176.79,19
c-3.78,7.985-5.6,18.587-5.6,32.08c0,13.354,1.819,24.093,5.6,32.079c4.899,10.464,12.738,15.695,23.517,15.695
c10.639,0,18.479-5.231,23.518-15.695c3.779-8.123,5.739-18.862,5.739-32.079c0-13.355-1.96-24.095-5.739-32.08
c-5.039-10.464-12.879-15.695-23.518-15.695C189.528,3.305,181.689,8.536,176.79,19z"/>
</g>
</svg>
... ...
... ... @@ -33,7 +33,7 @@ const getImgUrl = function(src, width = 300, height = 300, mode = 2) {
};
return dict[$0];
}) : '';
}).replace('http:', '') : '';
};
// 退换货 申请 成功, 打开 modal
... ...
.err-page {
width: 100%;
height: 100%;
background: #fff;
.err-status {
position: fixed;
top: 401px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
.err-404 {
width: 300px;
height: 126px;
background: resolve("error/404.svg") no-repeat;
margin: 0 auto;
}
.err-500 {
width: 300px;
height: 126px;
background: resolve("error/500.svg") no-repeat;
margin: 0 auto;
}
}
.tips {
position: fixed;
top: 600px;
left: 0;
right: 0;
width: 100%;
margin: 0 auto;
text-align: center;
a,
span {
display: block;
}
.tip {
font-size: 38px;
color: #b0b0b0;
}
.tips-english {
font-size: 22px;
color: #b0b0b0;
margin-top: 20px;
}
.home {
width: 65%;
margin: 0 auto;
margin-top: 80px;
height: 100px;
color: #fff;
background: #000;
text-align: center;
font-size: 28px;
line-height: 100px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -12,3 +12,4 @@
@import "modal";
@import "loading";
@import "select";
@import "error";
... ...
... ... @@ -28,11 +28,13 @@
module.exports = {
data() {
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
return {
category: [],
categoryResult: {},
gender: '1,3',
detaultChannel: qs.channel || cookie.get('_Channel') || 'men'
detaultChannel: detaultChannel,
gender: channelTrans[detaultChannel].code,
};
},
components: {
... ...
... ... @@ -126,7 +126,9 @@
float: left;
box-sizing: border-box;
width: 50%;
height: 100%;
font-size: 34px;
background-color: #fff;
> li {
height: 108px;
... ...
... ... @@ -103,6 +103,16 @@
content: none;
}
}
&:hover,
&:active {
background: $black;
color: $white;
&:after {
border-bottom: 1px solid $black;
}
}
}
.sep {
... ...
... ... @@ -16,10 +16,10 @@
</div>
</li>
</ul>
<p class="cardlist--loading text-center" v-show="inLoading">正在加载...</p>
<p class="cardlist--end text-center" v-show="atEnd ">--End--</p>
<p class="cardlist--loading text-center" v-show="state === 1">正在加载...</p>
<p class="cardlist--end text-center" v-show="state === 0 ">--End--</p>
<div class="empty-tip" v-show="empty">
<div class="empty-tip" v-show="state === -1">
<i class="icon icon-search"></i>
<p class="empty-tip-cn">未找到相关商品</p>
<p class="empty-tip-en">Did not find the relevant goods</p>
... ... @@ -43,7 +43,7 @@
// 数据
data: Array,
empty: Boolean
state: [Number, Object] // -1: 无数据 0: 全部加载完 1: 正在加载
},
computed: {
// 空列表: data.length === 0
... ...
... ... @@ -84,7 +84,7 @@ module.exports = {
.icon-sort-down {
position: absolute;
left: 0;
top: 0;
top: 2px;
}
}
... ...
... ... @@ -34,26 +34,44 @@
cheader
},
methods: {
share: function() {
share() {
yoho.goShare({
title: this.title || '',
des: '我在BLK发现了一个不错的商品,快来看看吧!',
img: this.img,
url: location.href
});
},
toggle() {
let ghost = true;
let ghost2 = false;
let ghost3 = false;
if (window.scrollY > 100) {
ghost = false;
ghost2 = false;
ghost3 = false;
} else if (window.scrollY > 70) {
ghost = false;
ghost3 = true;
} else if (window.scrollY > 30) {
ghost = false;
ghost2 = true;
}
this.$refs.header.$el.classList.toggle('ghost', ghost);
this.$refs.header.$el.classList.toggle('ghost-2', ghost2);
this.$refs.header.$el.classList.toggle('ghost-3', ghost3);
}
},
created() {
window.onscroll = () => {
let transparent = true;
window.addEventListener('touchmove', () => {
this.toggle();
});
if (window.scrollY > 20) {
transparent = false;
}
this.$refs.header.$el.classList.toggle('ghost', transparent);
};
window.addEventListener('scroll', () => {
this.toggle();
});
}
};
</script>
... ...
<template>
<div>
<cheader :title="sortName" class="list-header">
<i class="icon icon-filter" slot="right" @click="openFilter"></i>
<i class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
</cheader>
<order :config="orderConfig" :val="order" v-if="enableOrder"></order>
<List :data="productList" :empty="empty"></List>
<List :data="productList" :state="listState"></List>
<Filter :config="filterConfig" v-ref:filter></Filter>
</div>
</template>
... ... @@ -53,6 +53,23 @@
computed: {
empty: function() {
return this.page !== 0 && !this.productList.length;
},
listState: function() {
let state; // 0: 全部加载完 1: 正在加载
if (!this.page) {
return;
}
if (!this.productList.length) {
return -1;
} else if (this.page === this.totalPage) {
return 0;
} else if (this.inSearching) {
return 1;
}
return state;
}
},
components: {
... ... @@ -91,7 +108,7 @@
}
}
})
.fail(error => {
.fail(error => { // eslint-disable-line
tip('网络出错~');
})
.always(() => {
... ...
<template>
<div>
<cheader title="新品抢先看">
<i class="icon icon-filter" slot="right" @click="openFilter"></i>
<i class="icon icon-filter" slot="right" @touchstart="openFilter"></i>
</cheader>
<List :data="productList" :empty="empty"></List>
<List :data="productList" :state="listState"></List>
<Filter :config="filterConfig" action="/product/list.json" v-ref:filter></Filter>
</div>
</template>
... ... @@ -46,8 +46,22 @@
};
},
computed: {
empty: function() {
return this.page !== 0 && !this.productList.length;
listState: function() {
let state; // 0: 全部加载完 1: 正在加载
if (!this.page) {
return;
}
if (!this.productList.length) {
return -1;
} else if (this.page === this.totalPage) {
return 0;
} else if (this.inSearching) {
return 1;
}
return state;
}
},
components: {
... ... @@ -84,7 +98,7 @@
}
}
})
.fail(error => {
.fail(error => { // eslint-disable-line
tip('网络出错~');
})
.always(() => {
... ...
... ... @@ -2,7 +2,7 @@
<div>
<Order :config="orderConfig" :val="order" v-if="enableOrder">
</Order>
<List :data="productList" :empty="empty"></List>
<List :data="productList" :state="listState"></List>
</div>
</template>
<script>
... ... @@ -45,9 +45,22 @@
};
},
computed: {
// 无数据
empty: function() {
return this.page !== 0 && !this.productList.length;
listState: function() {
let state; // 0: 全部加载完 1: 正在加载
if (!this.page) {
return;
}
if (!this.productList.length) {
return -1;
} else if (this.page === this.totalPage) {
return 0;
} else if (this.inSearching) {
return 1;
}
return state;
}
},
components: {
... ...
... ... @@ -3,7 +3,7 @@
<shop-top :shop-info="shopInfo"></shop-top>
<div :class='{"shop-goods-top": !shopInfo.isBlkShop}'>
<goods-list :data="productList" :empty="empty"></goods-list>
<goods-list :data="productList" :state="listState"></goods-list>
</div>
<filter :config="filterConfig" v-ref:filter></filter>
</template>
... ... @@ -57,6 +57,23 @@
computed: {
empty: function() {
return this.page !== 0 && !this.productList.length;
},
listState: function() {
let state; // 0: 全部加载完 1: 正在加载
if (!this.page) {
return;
}
if (!this.productList.length) {
return -1;
} else if (this.page === this.totalPage) {
return 0;
} else if (this.inSearching) {
return 1;
}
return state;
}
},
watch: {
... ...
... ... @@ -5,7 +5,7 @@
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</span>
<span class="icon" @click="showFilter()">&#xe60b;</span>
<span class="icon" @touchstart="showFilter()">&#xe60b;</span>
</template>
</cheader>
</div>
... ...