Authored by yyq

edit refresh

... ... @@ -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') {
... ...
... ... @@ -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 || [];
... ...
... ... @@ -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',
... ...