Merge branch 'feature/0330' into 'release/6.8.8'
img parise See merge request !28
Showing
10 changed files
with
68 additions
and
14 deletions
@@ -74,6 +74,13 @@ export default { | @@ -74,6 +74,13 @@ export default { | ||
74 | }); | 74 | }); |
75 | 75 | ||
76 | this.posting = false; | 76 | this.posting = false; |
77 | + | ||
78 | + let toastInfo = { | ||
79 | + txt: '评论成功', | ||
80 | + type: 'success', | ||
81 | + time: 1000 | ||
82 | + }; | ||
83 | + | ||
77 | if (result.code === 200) { | 84 | if (result.code === 200) { |
78 | const waitData = this.addType === 0 ? this.fetchArticleUpdate({articleId: this.destId}) : Promise.resolve(); | 85 | const waitData = this.addType === 0 ? this.fetchArticleUpdate({articleId: this.destId}) : Promise.resolve(); |
79 | 86 | ||
@@ -86,12 +93,13 @@ export default { | @@ -86,12 +93,13 @@ export default { | ||
86 | 93 | ||
87 | this.reportComment(this.destId); | 94 | this.reportComment(this.destId); |
88 | } else { | 95 | } else { |
89 | - this.$createToast({ | 96 | + Object.assign(toastInfo, { |
90 | txt: result.message || '服务器开小差了', | 97 | txt: result.message || '服务器开小差了', |
91 | type: 'warn', | 98 | type: 'warn', |
92 | - time: 1000 | ||
93 | - }).show(); | 99 | + }); |
94 | } | 100 | } |
101 | + | ||
102 | + this.$createToast(toastInfo).show(); | ||
95 | }, | 103 | }, |
96 | reportComment(comId) { | 104 | reportComment(comId) { |
97 | this.$store.dispatch('reportYas', { | 105 | this.$store.dispatch('reportYas', { |
@@ -242,6 +242,14 @@ export default { | @@ -242,6 +242,14 @@ export default { | ||
242 | throw new Error(message); | 242 | throw new Error(message); |
243 | } | 243 | } |
244 | 244 | ||
245 | + if (increHeight) { | ||
246 | + for (let i = index + 1; i < this.items.length; i++) { | ||
247 | + if (this.items[i].top) { | ||
248 | + this.items[i].top += increHeight; | ||
249 | + } | ||
250 | + } | ||
251 | + } | ||
252 | + | ||
245 | return increHeight; | 253 | return increHeight; |
246 | }, | 254 | }, |
247 | updateIndex(scrollTop) { | 255 | updateIndex(scrollTop) { |
@@ -26,8 +26,8 @@ export default { | @@ -26,8 +26,8 @@ export default { | ||
26 | data() { | 26 | data() { |
27 | return { | 27 | return { |
28 | imgSrc: this.src, | 28 | imgSrc: this.src, |
29 | - defaultSrc: '//img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png?imageView/2/w/{width}/h/{height}' | ||
30 | - }; | 29 | + defaultSrc: '//img12.static.yhbimg.com/article/2019/02/26/16/02456ade977d8dfdbc4ca548b196c1d62b.png?imageView/2/w/{width}/h/{height}' |
30 | + } | ||
31 | }, | 31 | }, |
32 | computed: { | 32 | computed: { |
33 | imageSrc() { | 33 | imageSrc() { |
@@ -209,7 +209,9 @@ export default { | @@ -209,7 +209,9 @@ export default { | ||
209 | }, | 209 | }, |
210 | onExpand() { | 210 | onExpand() { |
211 | this.animateing = true; | 211 | this.animateing = true; |
212 | - this.$emit('on-expand'); | 212 | + this.$nextTick(() => { |
213 | + this.$emit('on-expand'); | ||
214 | + }); | ||
213 | }, | 215 | }, |
214 | onShowComment() { | 216 | onShowComment() { |
215 | if (this.articleState.commentCount) { | 217 | if (this.articleState.commentCount) { |
1 | <template> | 1 | <template> |
2 | <div class="article-item-slide-wrap"> | 2 | <div class="article-item-slide-wrap"> |
3 | - <div class="article-item-slide" :style="slideItemStyle" @click="praiseArticle"> | 3 | + <div class="article-item-slide" :style="slideItemStyle" @touchend="praiseArticle"> |
4 | <ArticleItemSlideImage v-if="data.blockList.length === 1" :lazy="false" :data="data.blockList[0]" :thumb-size="firstBlockSize"></ArticleItemSlideImage> | 4 | <ArticleItemSlideImage v-if="data.blockList.length === 1" :lazy="false" :data="data.blockList[0]" :thumb-size="firstBlockSize"></ArticleItemSlideImage> |
5 | <Slide :key="`slide${data.articleId}`" v-else ref="slide" :data="data.blockList" :refresh-reset-current="false" :initial-index="slideIndex - 1" :threshold="0.2" :auto-play="false" :loop="false" :options="scrollOption" @change="onChange"> | 5 | <Slide :key="`slide${data.articleId}`" v-else ref="slide" :data="data.blockList" :refresh-reset-current="false" :initial-index="slideIndex - 1" :threshold="0.2" :auto-play="false" :loop="false" :options="scrollOption" @change="onChange"> |
6 | <SlideItem class="slide-item" :style="slideItemStyle" v-for="(item, inx) in data.blockList" :key="inx"> | 6 | <SlideItem class="slide-item" :style="slideItemStyle" v-for="(item, inx) in data.blockList" :key="inx"> |
@@ -32,7 +32,7 @@ import {mapState, createNamespacedHelpers} from 'vuex'; | @@ -32,7 +32,7 @@ import {mapState, createNamespacedHelpers} from 'vuex'; | ||
32 | import lottieJson from '../../../../statics/lottie/detail-heart.json'; | 32 | import lottieJson from '../../../../statics/lottie/detail-heart.json'; |
33 | const {mapMutations} = createNamespacedHelpers('article'); | 33 | const {mapMutations} = createNamespacedHelpers('article'); |
34 | 34 | ||
35 | -const dblclickDdelay = 500; | 35 | +const dblclickDdelay = 200; |
36 | 36 | ||
37 | export default { | 37 | export default { |
38 | name: 'ArticleItemSlide', | 38 | name: 'ArticleItemSlide', |
@@ -175,6 +175,10 @@ export default { | @@ -175,6 +175,10 @@ export default { | ||
175 | if (scrollTop <= 0) { | 175 | if (scrollTop <= 0) { |
176 | this.showHeader = false; | 176 | this.showHeader = false; |
177 | } else if (item) { | 177 | } else if (item) { |
178 | + if (item.data && item.data.dataType === 2) { | ||
179 | + return this.showHeader = false; | ||
180 | + } | ||
181 | + | ||
178 | if (this.currentId !== item.data.articleId) { | 182 | if (this.currentId !== item.data.articleId) { |
179 | this.currentId = item.data.articleId; | 183 | this.currentId = item.data.articleId; |
180 | } | 184 | } |
1 | <template> | 1 | <template> |
2 | <Layout class="author-fans-page"> | 2 | <Layout class="author-fans-page"> |
3 | - <LayoutHeader slot='header' theme="white" class="author-page-header">{{isMine ? '我的' : 'TA'}}粉丝</LayoutHeader> | ||
4 | - <UserList :follow-name="isMine ? '回粉' : '关注'" :on-fetch="onFetch"></UserList> | 3 | + <LayoutHeader slot='header' theme="white" class="author-page-header">{{isMine ? '我' : 'TA'}}的粉丝</LayoutHeader> |
4 | + <UserList ref="userList" :follow-name="isMine ? '回粉' : '关注'" :on-fetch="onFetch"></UserList> | ||
5 | </Layout> | 5 | </Layout> |
6 | </template> | 6 | </template> |
7 | 7 | ||
@@ -31,6 +31,13 @@ export default { | @@ -31,6 +31,13 @@ export default { | ||
31 | this._baseParams.authorUid = this.$route.params.id; | 31 | this._baseParams.authorUid = this.$route.params.id; |
32 | } | 32 | } |
33 | }, | 33 | }, |
34 | + activated() { | ||
35 | + this.$refs.userList.init(); | ||
36 | + }, | ||
37 | + beforeRouteUpdate(to, from, next) { | ||
38 | + this.$refs.userList.init(); | ||
39 | + next(); | ||
40 | + }, | ||
34 | methods: { | 41 | methods: { |
35 | ...mapActions(['authorFansList', 'authorMineFansList']), | 42 | ...mapActions(['authorFansList', 'authorMineFansList']), |
36 | onFetch({page, lastedTime}) { | 43 | onFetch({page, lastedTime}) { |
1 | <template> | 1 | <template> |
2 | <Layout class="author-follow-page"> | 2 | <Layout class="author-follow-page"> |
3 | - <LayoutHeader slot='header' theme="white" class="author-page-header">{{isMine ? '我的' : 'TA'}}关注</LayoutHeader> | ||
4 | - <UserList :on-fetch="onFetch"></UserList> | 3 | + <LayoutHeader slot='header' theme="white" class="author-page-header">{{isMine ? '我' : 'TA'}}的关注</LayoutHeader> |
4 | + <UserList ref="userList" :on-fetch="onFetch"></UserList> | ||
5 | </Layout> | 5 | </Layout> |
6 | </template> | 6 | </template> |
7 | 7 | ||
@@ -31,6 +31,13 @@ export default { | @@ -31,6 +31,13 @@ export default { | ||
31 | this._baseParams.authorUid = this.$route.params.id; | 31 | this._baseParams.authorUid = this.$route.params.id; |
32 | } | 32 | } |
33 | }, | 33 | }, |
34 | + activated() { | ||
35 | + this.$refs.userList.init(); | ||
36 | + }, | ||
37 | + beforeRouteUpdate(to, from, next) { | ||
38 | + this.$refs.userList.init(); | ||
39 | + next(); | ||
40 | + }, | ||
34 | methods: { | 41 | methods: { |
35 | ...mapActions(['authorAttentionList', 'authorMineAttentionList']), | 42 | ...mapActions(['authorAttentionList', 'authorMineAttentionList']), |
36 | onFetch({page, lastedTime}) { | 43 | onFetch({page, lastedTime}) { |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | @scroll-end="fetchList"> | 7 | @scroll-end="fetchList"> |
8 | <div class="user-list"> | 8 | <div class="user-list"> |
9 | <div v-for="(item, index) in list" :key="index" class="user-item"> | 9 | <div v-for="(item, index) in list" :key="index" class="user-item"> |
10 | - <WidgetAvatar class="head-ico" :src="item.headIcon" :width="100" :height="100" @click="toUserPage(item)"></WidgetAvatar> | 10 | + <WidgetAvatar class="head-ico" :src="item.headIcon" :width="100" :height="100" @click.native="toUserPage(item)"></WidgetAvatar> |
11 | <div class="user-info" @click="toUserPage(item)"> | 11 | <div class="user-info" @click="toUserPage(item)"> |
12 | <p class="name">{{item.nickName}}</p> | 12 | <p class="name">{{item.nickName}}</p> |
13 | <p v-if="item.articleCount || item.fansCount" class="extra"> | 13 | <p v-if="item.articleCount || item.fansCount" class="extra"> |
@@ -53,9 +53,15 @@ export default { | @@ -53,9 +53,15 @@ export default { | ||
53 | }; | 53 | }; |
54 | }, | 54 | }, |
55 | mounted() { | 55 | mounted() { |
56 | - this.fetchList(); | 56 | + this.init(); |
57 | }, | 57 | }, |
58 | methods: { | 58 | methods: { |
59 | + init() { | ||
60 | + this._page = 1; | ||
61 | + this.list = []; | ||
62 | + this.noMore = false; | ||
63 | + this.fetchList(); | ||
64 | + }, | ||
59 | fetchList() { | 65 | fetchList() { |
60 | let page = this._page || 1; | 66 | let page = this._page || 1; |
61 | 67 |
@@ -21,22 +21,34 @@ export default [{ | @@ -21,22 +21,34 @@ export default [{ | ||
21 | alias: '/author/follow/:type/:id', | 21 | alias: '/author/follow/:type/:id', |
22 | name: 'author.follow', | 22 | name: 'author.follow', |
23 | component: () => import(/* webpackChunkName: "authorFollow" */ './author-follow'), | 23 | component: () => import(/* webpackChunkName: "authorFollow" */ './author-follow'), |
24 | + meta: { | ||
25 | + keepAlive: true | ||
26 | + }, | ||
24 | }, | 27 | }, |
25 | { | 28 | { |
26 | path: '/author/fans/:type/:id', | 29 | path: '/author/fans/:type/:id', |
27 | alias: '/author/fans/:type/:id', | 30 | alias: '/author/fans/:type/:id', |
28 | name: 'author.fans', | 31 | name: 'author.fans', |
29 | component: () => import(/* webpackChunkName: "authorFans" */ './author-fans'), | 32 | component: () => import(/* webpackChunkName: "authorFans" */ './author-fans'), |
33 | + meta: { | ||
34 | + keepAlive: true | ||
35 | + }, | ||
30 | }, | 36 | }, |
31 | { | 37 | { |
32 | path: '/mine/follow', | 38 | path: '/mine/follow', |
33 | alias: '/mine/follow', | 39 | alias: '/mine/follow', |
34 | name: 'mine.follow', | 40 | name: 'mine.follow', |
35 | component: () => import(/* webpackChunkName: "authorFollow" */ './author-follow'), | 41 | component: () => import(/* webpackChunkName: "authorFollow" */ './author-follow'), |
42 | + meta: { | ||
43 | + keepAlive: true | ||
44 | + }, | ||
36 | }, | 45 | }, |
37 | { | 46 | { |
38 | path: '/mine/fans', | 47 | path: '/mine/fans', |
39 | alias: '/mine/fans', | 48 | alias: '/mine/fans', |
40 | name: 'mine.fans', | 49 | name: 'mine.fans', |
41 | component: () => import(/* webpackChunkName: "authorFans" */ './author-fans'), | 50 | component: () => import(/* webpackChunkName: "authorFans" */ './author-fans'), |
51 | + meta: { | ||
52 | + keepAlive: true | ||
53 | + }, | ||
42 | }]; | 54 | }]; |
-
Please register or login to post a comment