Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

<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 {
... ...
<template>
<div class="blk-header-wrap" :class="class">
<div class="blk-header">
<div class="blk-header-left">
<div class="header-wrap" :class="class">
<div class="header">
<div class="header-left">
<slot name="left">
<i class="icon icon-left" @click="goBack"></i>
</slot>
</div>
<div class="blk-header-right">
<div class="header-right">
<slot name="right"></slot>
</div>
<div class="blk-header-main">
<span class="blk-header-title">{{title}}</span>
<div class="header-main">
<span class="header-title">{{title}}</span>
</div>
</div>
<div class="blk-header-gap"></div>
<div class="header-gap"></div>
</div>
</template>
<script>
... ... @@ -29,7 +29,7 @@
};
</script>
<style>
.blk-header {
.header {
box-sizing: content-box;
position: fixed;
top: 0;
... ... @@ -47,12 +47,12 @@
color: #000;
.icon,
.blk-header-title {
.header-title {
vertical-align: middle;
}
}
.blk-header-main {
.header-main {
display: block;
text-align: center;
margin-left: auto;
... ... @@ -62,11 +62,11 @@
text-overflow: ellipsis;
}
.blk-header-left {
.header-left {
float: left;
}
.blk-header-right {
.header-right {
float: right;
.icon {
... ... @@ -74,17 +74,17 @@
}
}
.blk-header-gap {
.header-gap {
height: 100px;
background-color: transparent;
}
.app.ios {
.blk-header {
.header {
padding-top: 60px;
}
.blk-header-gap {
.header-gap {
height: calc(70 + 60 + 10)px;
}
}
... ...
... ... @@ -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;
});
},
... ...
... ... @@ -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>
... ...
... ... @@ -5,11 +5,11 @@
</template>
<style>
.top-nav {
.blk-header {
.header {
background-color: transparent;
}
.blk-header-gap {
.header-gap {
display: none;
}
}
... ...
... ... @@ -25,7 +25,6 @@
.brand-intro {
margin: 30px;
min-height: 400px;
}
.tip {
... ... @@ -45,7 +44,6 @@
width: 100%;
height: 365px;
}
}
</style>
<script>
... ...
... ... @@ -11,23 +11,23 @@
<style>
.top-box {
.blk-header {
.header {
background-color: transparent;
color: #fff;
}
.blk-header-gap {
.header-gap {
display: none;
}
}
.top-change {
.blk-header {
.header {
background-color: #fff;
color: #000;
}
.blk-header-gap {
.header-gap {
display: block;
}
}
... ...