1
0
mirror da https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 21:29:31 +08:00

新增:联系博主页面顶部返回按钮;

修复:修复 默认封面图、默认图片、默认头像在使用随机api时候无法显示的BUG;
修复:后台管理新增文章发布失败BUG;
删除:去除联系博主页面中的 联系博主 按钮;
优化:对友链页面进行重写;
优化:对部分页面和功能进行优化。
This commit is contained in:
小莫唐尼
2022-12-09 00:24:39 +08:00
parent 473655171b
commit 3702cb1618
15 ha cambiato i file con 200 aggiunte e 92 eliminazioni
+27 -16
Vedi File
@@ -151,7 +151,7 @@
<!-- 操作区域 -->
<view class="btn-bar flex flex-center bg-white">
<tm-button theme="blue" :shadow="0" block :height="70" @click="fnOnSave(false, false)">立即保存</tm-button>
<tm-button theme="light-blue" :shadow="0" block :height="70" @click="fnOnSave(false, true)">保存并返回</tm-button>
<tm-button v-if="isEdit" theme="light-blue" :shadow="0" block :height="70" @click="fnOnSave(false, true)">保存并返回</tm-button>
<!-- <block v-if="from == 'edit' && isEdit">
<tm-button
v-if="article.status == 'DRAFT' || article.status == 'INTIMATE' || article.status == 'RECYCLE'"
@@ -357,10 +357,21 @@ export default {
list: ['常规', '高级', 'SEO']
},
article: {
title: '',
slug: '',
status: '',
content: '',
keepRaw: true,
sourceContent: '',
type: 'PUBLIC'
topPriority: 0,
summary: '',
password: '',
originalContent: '',
metaDescription: '',
formatContent: '',
editorType: 'MARKDOWN',
createTime: '',
categoryIds: [],
tagIds: []
},
articleStatus: {
list: [{ name: '发布', value: 'PUBLISHED' }, { name: '私有', value: 'INTIMATE' }, { name: '草稿', value: 'DRAFT' }, { name: '回收站', value: 'RECYCLE' }],
@@ -397,6 +408,9 @@ export default {
this.from = from;
this.createTime = uni.$tm.dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
this.fnGetSettings();
console.log(uni.getStorageSync('posts-content'));
console.log(uni.getStorageSync('posts-content-source'));
},
onPullDownRefresh() {
if (this.isEdit == false) {
@@ -533,7 +547,7 @@ export default {
}
this.createTime = uni.$tm.dayjs(new Date(this.article.createTime).getTime()).format('YYYY-MM-DD HH:mm:ss');
if (this.postTitle) {
this.article.title = this.postTitle;
this.$set(this.article, 'title', this.postTitle);
}
}
const _cateRes = res[1];
@@ -577,6 +591,7 @@ export default {
})
.catch(err => {
this.$tm.toast('数据加载失败,请重试!');
console.log(err);
this.loading = 'error';
})
.finally(() => {
@@ -626,7 +641,8 @@ export default {
// 设置文章内容
if (this.from == 'edit') {
this.article.content = uni.getStorageSync('posts-content');
this.article.sourceContent = uni.getStorageSync('posts-content-source');
this.article.formatContent = uni.getStorageSync('posts-content');
this.article.originalContent = uni.getStorageSync('posts-content-source');
}
if (this.articleStatus.selectValue != 'INTIMATE') {
this.article.password = '';
@@ -651,8 +667,7 @@ export default {
delta: 1
});
}
uni.$emit('refresh-article-list');
// uni.$emit('refresh-article-list');
}, 1000);
} else {
uni.$tm.toast('保存失败,请重试!');
@@ -662,13 +677,12 @@ export default {
}
})
.catch(err => {
uni.$tm.toast('保存失败,请重试!');
uni.$tm.toast(`保存失败,${err.message}!`);
if (isChangeStatus) {
this.article.status = this.article.status == 'DRAFT' ? 'PUBLISHED' : 'DRAFT';
}
});
} else {
this.article.content = this.article.sourceContent = uni.getStorageInfoSync();
this.$httpApi.admin
.createPosts(this.article)
.then(res => {
@@ -678,12 +692,9 @@ export default {
uni.setStorageSync('posts-content', '');
uni.setStorageSync('posts-content-source', '');
setTimeout(() => {
if (isBack) {
uni.navigateBack({
delta: 1
});
}
uni.navigateBack({
delta: 2
});
uni.$emit('refresh-article-list');
}, 1000);
} else {
@@ -691,7 +702,7 @@ export default {
}
})
.catch(err => {
uni.$tm.toast('发布失败,请重试!');
uni.$tm.toast(`发布失败:${err.message}`);
});
}
},