Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -70,9 +70,9 @@ const component = {
};
if (!req.user.uid) {
res.json({
res.json([{
code: 403
});
}, '']);
return;
}
... ...
... ... @@ -102,7 +102,6 @@ const getBrandShopGoodsData = params => {
return shopApi.getBrandInfoByDomain({
domain: params.domain
}).then(result => {
if (result.data) {
return shopApi.getBrandShopGoodsOriginData(Object.assign(params, {
brand: result.data.id,
... ...
<template>
<div v-if="channel.length" class="channel-tab">
<div class="channel" v-for="(index, item) in channel" v-bind:class="{focus: index === current}" v-on:click="changeChannel(index)">
<div class="channel" v-for="(index, item) in channel" v-bind:class="{focus: index === current}" v-on:click="changeChannel(index)" v-bind:style="{width: (1 / channel.length) * 100 + '%'}">
<span class="name">{{item.name | uppercase}}</span>
</div>
</div>
... ... @@ -84,7 +84,6 @@
.channel {
display: inline-block;
line-height: 90px;
width: 33%;
color: #999;
&.focus {
... ...
... ... @@ -183,9 +183,9 @@
module.exports = {
components: {
'content-block': require('./content-block.vue'),
'product-list': require('component/product/list.vue'),
'top-nav': require('./top-nav.vue')
contentBlock: require('./content-block.vue'),
productList: require('component/product/list.vue'),
topNav: require('./top-nav.vue')
},
data() {
return {
... ...
<template>
<resources v-bind:content-code.sync="contentCode"></resources>
<div v-infinite-scroll="getNewsList()" infinite-scroll-disabled="scrollDisabled">
<div v-infinite-scroll="getNewsList()">
<div v-for="editorial in editorialList" class="editorial-box">
<div class="img">
<a href='{{"/editorial/" + editorial.id + ".html"}}'>
... ... @@ -93,25 +93,30 @@
/* 获取资讯列表数据 */
getNewsList() {
if (this.scrollDisabled) {
return;
}
this.scrollDisabled = true;
$.get({
url: '/editorial/list.json',
data: {
page: this.page++,
page: this.page,
channel: this.channel
}
}).done(result => {
if (result.code === 200) {
if (this.editorialList.length > 0 && result.data.list.length > 0) {
this.$set('editorialList', this.editorialList.concat(result.data.list));
} else {
} else if (result.data.list.length > 0) {
this.editorialList = result.data.list;
}
this.page++;
this.scrollDisabled = false;
} else {
this.scrollDisabled = true;
tip('没有了...');
}
}).fail(() => {
tip('服务器错误');
this.scrollDisabled = false;
});
},
... ...
... ... @@ -75,9 +75,6 @@
}, (results)=> {
const result = results[0], misc = results[1];
// if (result && result.code === 200) {
// // TODO:
// }
if (result && result.code === 403) {
// 未登录
yoho.goLogin('', () => {
... ... @@ -86,7 +83,6 @@
tip('登录失败');
});
}
tip(result.message);
if (misc && misc.code === 200) {
this.isFavorite = misc.data.isFavor === 'Y';
... ...
... ... @@ -40,7 +40,6 @@
const tip = require('common/tip');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const bus = require('common/vue-bus');
module.exports = {
data() {
... ... @@ -92,11 +91,6 @@
}
this.nullbox = this.brandData.length ? 'hide' : '';
if (this.page === 1) {
yoho.showLoading(false);
this.updateNavBar();
}
}).fail(() => {
tip('网络错误');
});
... ... @@ -149,7 +143,7 @@
return false;
} else {
this.pageX = event.targetTouches[0].pageX;
let delBtn = $('#del-' + id);
var delBtn = $('#del-' + id);
if (delBtn.hasClass('hide')) {
delBtn.removeClass('hide');
... ... @@ -228,9 +222,15 @@
this.updateNavBar();
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.updateNavBar();
}
});
},
ready() {
yoho.showLoading(false);
this.updateNavBar();
}
};
</script>
... ...
... ... @@ -45,7 +45,6 @@
const tip = require('common/tip');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const bus = require('common/vue-bus');
module.exports = {
data() {
... ... @@ -73,7 +72,12 @@
if ($.isEmptyObject(data) || data.pageTotal === 0) {
this.busy = true;
} else {
this.busy = this.page === data.pageTotal;
if (this.page === data.pageTotal) {
this.busy = true;
} else {
this.busy = false;
}
const list = data.productList || [];
list.forEach(o => {
... ... @@ -107,11 +111,6 @@
}
this.nullbox = this.productData.length ? 'hide' : '';
if (this.page === 1) {
yoho.showLoading(false);
this.updateNavBar();
}
}).fail(() => {
tip('网络错误');
});
... ... @@ -163,7 +162,7 @@
return false;
} else {
this.pageX = event.targetTouches[0].pageX;
let delBtn = $('#del-' + id);
var delBtn = $('#del-' + id);
if (delBtn.hasClass('hide')) {
delBtn.removeClass('hide');
... ... @@ -230,7 +229,6 @@
if (!this.productData.length) {
header.right.des = '';
}
yoho.updateNavigationBar({
header: header
});
... ... @@ -243,9 +241,15 @@
this.updateNavBar();
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.updateNavBar();
}
});
},
ready() {
yoho.showLoading(false);
this.updateNavBar();
}
};
</script>
... ...
... ... @@ -25,7 +25,6 @@
.brand-intro {
margin: 30px;
min-height: 400px;
}
.tip {
... ... @@ -45,7 +44,6 @@
width: 100%;
height: 365px;
}
}
</style>
<script>
... ...