Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-community-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
6 years ago
Commit
3bea4afd53a202bf5be5447a273d6280f90fec7a
1 parent
2f18a047
edit refresh
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
apps/app.vue
apps/pages/article/article-detail.vue
apps/pages/article/components/detail/more-action-sheet.vue
apps/app.vue
View file @
3bea4af
...
...
@@ -11,7 +11,7 @@
</template>
<script>
import {get} from 'lodash';
import {get
, last
} from 'lodash';
import {mapState, mapMutations} from 'vuex';
export default {
...
...
@@ -48,12 +48,22 @@ export default {
}
document.addEventListener('visibilitychange', () => {
const {isApp, isiOS} = this.yoho.context.env || {};
const {statusBarColor} = this.yoho.window || {};
if (!document.hidden) {
const child = last(this.$children);
if (isApp && isiOS && !document.hidden && statusBarColor) {
this.$yoho.setStatusBar({statusBarColor});
if (child && child.pageVisibileEvent) {
child.pageVisibileEvent();
}
const {isApp, isiOS} = this.yoho.context.env || {};
const {statusBarColor} = this.yoho.window || {};
if (isApp && isiOS && statusBarColor) {
this.$yoho.setStatusBar({statusBarColor});
}
}
});
if (process.env.NODE_ENV === 'development') {
...
...
apps/pages/article/article-detail.vue
View file @
3bea4af
...
...
@@ -43,7 +43,7 @@
</template>
</RecycleScrollReveal>
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollowAuthor" @on-delete="onDelete"></MoreActionSheet>
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollowAuthor" @on-delete="onDelete"
@on-edit="onEdit"
></MoreActionSheet>
</Layout>
</template>
...
...
@@ -118,6 +118,12 @@ export default {
this.fetching = true;
this.syncServiceArticleDetail();
},
pageVisibileEvent() {
if (this.articleOnEdit) {
this.articleOnEdit = false;
this.syncServiceArticleDetail();
}
},
loadPreData(articleId) {
if (!this.$isServer && this.$yoho.isLocal) {
this.fetchArticleList({
...
...
@@ -143,7 +149,7 @@ export default {
return this.fetchArticleList({
articleId,
singleDetail: 'Y'
}).then(() => {
}).then((
res
) => {
if (this.$refs.scroll) {
this.listTitle = '';
...
...
@@ -153,10 +159,11 @@ export default {
}, 500);
}
this.reportProductShow(get(res, 'data.detailList[0]')
);
const article = get(res, 'data.detailList[0]', this.articleInfo
);
this.reportProductShow(article);
if (this.share && this.setShareData) {
this.setShareData(
get(res, 'data.detailList[0]', this.articleInfo)
);
this.setShareData(
article
);
}
});
},
...
...
@@ -216,6 +223,9 @@ export default {
$detail.$refs.header && $detail.$refs.header.onBack();
},
onEdit() {
this.articleOnEdit = true;
},
reportProductShow(article) {
const productList = article.productList || [];
...
...
apps/pages/article/components/detail/more-action-sheet.vue
View file @
3bea4af
...
...
@@ -42,7 +42,8 @@ export default {
},
{
icon: 'icon-edit',
name: '编辑'
name: '编辑',
fnName: 'actionEdit'
},
{
icon: 'icon-delete',
...
...
@@ -84,6 +85,7 @@ export default {
time: 1000
}).show();
this.reportArticle(this._article);
this.$emit('on-report', this._article);
},
actionCancelFav() {
let {authorUid, authorType} = this._article;
...
...
@@ -98,6 +100,9 @@ export default {
}
});
},
actionEdit() {
this.$emit('on-edit', this._article);
},
actionDelete() {
this.$createDialog({
type: 'confirm',
...
...
Please
register
or
login
to post a comment