Merge branch 'master' of https://gitea.hmily.club/haitu/aigc-h5
commit
ad8ae50056
|
|
@ -15,7 +15,7 @@
|
||||||
<span>{{ DateFormat(new Date(detail.published_at * 1000), 'yyyy.MM.dd') }}</span>
|
<span>{{ DateFormat(new Date(detail.published_at * 1000), 'yyyy.MM.dd') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div v-html="detail.content"></div>
|
<div v-html="detailContent"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="loadingBox" v-else>{{ placeholder }}</div>
|
<div class="loadingBox" v-else>{{ placeholder }}</div>
|
||||||
|
|
@ -64,6 +64,7 @@ const id = ref(props.id || route.params.id);
|
||||||
const detail = ref();
|
const detail = ref();
|
||||||
const recommend = ref([]);
|
const recommend = ref([]);
|
||||||
const placeholder = ref('数据加载中...');
|
const placeholder = ref('数据加载中...');
|
||||||
|
const detailContent = ref('');
|
||||||
|
|
||||||
const aiContent = computed(() => {
|
const aiContent = computed(() => {
|
||||||
return `标题${detail.value?.title}作者${detail.value?.author}责编${detail.value?.editor}发布时间${DateFormat(new Date(detail.value?.published_at * 1000), 'yyyy.MM.dd') }内容${detail.value?.content}`
|
return `标题${detail.value?.title}作者${detail.value?.author}责编${detail.value?.editor}发布时间${DateFormat(new Date(detail.value?.published_at * 1000), 'yyyy.MM.dd') }内容${detail.value?.content}`
|
||||||
|
|
@ -83,6 +84,9 @@ const getDetail = () => {
|
||||||
http(`/api/article/${id.value}`, {}, 'get').then(res => {
|
http(`/api/article/${id.value}`, {}, 'get').then(res => {
|
||||||
detail.value = res.data;
|
detail.value = res.data;
|
||||||
// website.setPageTitle(res.data.title);
|
// website.setPageTitle(res.data.title);
|
||||||
|
let _content = res.data.content;
|
||||||
|
let reg = /font-size:\s?\d+px;/gi;
|
||||||
|
detailContent.value = _content.replace(reg, '');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
showToast(err.message);
|
showToast(err.message);
|
||||||
if(err.status == 1001){
|
if(err.status == 1001){
|
||||||
|
|
@ -170,8 +174,8 @@ const goDetail = (id) => {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 26px;
|
font-size: 30px;
|
||||||
line-height: 30px;
|
line-height: 40px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -193,7 +197,7 @@ const goDetail = (id) => {
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 23px;
|
font-size: 24px;
|
||||||
|
|
||||||
:deep(p) {
|
:deep(p) {
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue