Authored by TaoHuang

Merge remote-tracking branch 'origin/master'

... ... @@ -48,7 +48,7 @@ export default {
if (!/interlace/.test(query)) {
src = `${src}/interlace/1`;
}
if (!/webp/.test(query)) {
if (!/webp/.test(query) && this.yoho.window.supportWebp) {
src = `${src}/format/webp`;
}
}
... ...
... ... @@ -45,7 +45,7 @@
v-if="!infinite"
class="cube-recycle-list-loading">
<slot name="spinner">
<div class="cube-recycle-list-loading-content" v-show="!noMore" :style="{visibility: loading ? 'visible' : 'hidden'}">
<div class="cube-recycle-list-loading-content" v-show="!noMore" :style="{visibility: loadings.length ? 'visible' : 'hidden'}">
<cube-loading class="spinner"></cube-loading>
</div>
</slot>
... ...
... ... @@ -131,6 +131,9 @@ export default {
if (this.share) {
return this.$links.toDownloadApp();
}
if (this.data.articleType === 5) {
return;
}
this.$router.push({
name: 'topic',
params: {
... ... @@ -143,7 +146,7 @@ export default {
this.$yoho.share({
title: '逛',
imgUrl: this.data.shareImage,
link: `http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/share/${this.data.articleId}`,
link: `${location.origin}/grass/article/share/${this.data.articleId}`,
desc: this.data.intro,
hideType: ['7', '8', '9']
});
... ...
... ... @@ -36,7 +36,7 @@
</template>
<script>
import {debounce} from 'lodash';
import {debounce, throttle} from 'lodash';
import ArticleItem from './article-item';
import ArticleActionSheet from '../detail/article-action-sheet';
import {createNamespacedHelpers} from 'vuex';
... ... @@ -61,6 +61,7 @@ export default {
},
mounted() {
this.scrollPreLazy = debounce(this.changeItem.bind(this), 200);
this.scrollEvent = throttle(this.onDounceScroll.bind(this), 50);
},
data() {
return {
... ... @@ -121,7 +122,10 @@ export default {
this.ASYNC_ARTICLE_COMMENT({articleId: this.articleId, type: this.type});
this.onResize(this.articleIndex);
},
onScroll({item, scrollTop}) {
onScroll(params) {
this.scrollEvent(params);
},
onDounceScroll({item, scrollTop}) {
this.scrollTop = scrollTop;
if (scrollTop === 0) {
this.currentAuthor.opacity = 1;
... ...
... ... @@ -51,7 +51,8 @@ export default store => {
Vue.$yoho.ready(() => {
Vue.$yoho.setWebview({
bounces: false
bounces: false,
clearCacheWhenDestroy: false
});
});
};
... ...
... ... @@ -2,16 +2,19 @@ module.exports = [
{
route: /grass\/article\/\d+$/,
cacheKey: '$url$params',
cacheTime: 900,
cache: true
},
{
route: /grass\/article\/\d+\/user/,
cacheKey: '$url$params',
cacheTime: 900,
cache: true
},
{
route: /grass\/author\/\d+\/\d+/,
cacheKey: '$url$params',
cacheTime: 900,
cache: true
}
];
... ...