fix: 趋势详情页空内容修复+查看原文按钮
This commit is contained in:
@@ -55,6 +55,13 @@
|
|||||||
<rich-text :nodes="newsBody"></rich-text>
|
<rich-text :nodes="newsBody"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 查看原文 -->
|
||||||
|
<view class="source-link" v-if="news.sourceUrl" @click="openSource">
|
||||||
|
<text class="source-link-icon">🔗</text>
|
||||||
|
<text class="source-link-text">查看原文 · {{ news.source }}</text>
|
||||||
|
<text class="source-link-arrow">↗</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 相关话题 -->
|
<!-- 相关话题 -->
|
||||||
<view class="related-tags" v-if="relatedTags.length">
|
<view class="related-tags" v-if="relatedTags.length">
|
||||||
<text class="related-label">相关话题</text>
|
<text class="related-label">相关话题</text>
|
||||||
@@ -123,7 +130,7 @@ function formatDate(dateStr) {
|
|||||||
const newsBody = computed(() => {
|
const newsBody = computed(() => {
|
||||||
const content = news.value.body || ''
|
const content = news.value.body || ''
|
||||||
if (!content) {
|
if (!content) {
|
||||||
return `<p>${news.value.summary || ''}</p><p style="margin-top:16px;color:rgba(255,255,255,0.35)">完整内容暂未提供,将持续更新...</p>`
|
return `<p style="line-height:1.8;font-size:15px;color:var(--text-primary)">${news.value.summary || '暂无详细内容'}</p>`
|
||||||
}
|
}
|
||||||
return content
|
return content
|
||||||
})
|
})
|
||||||
@@ -173,6 +180,20 @@ function onShare() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openSource() {
|
||||||
|
if (!news.value.sourceUrl) return
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: news.value.sourceUrl,
|
||||||
|
success: () => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '打开原文',
|
||||||
|
content: `链接已复制: ${news.value.sourceUrl}\n请在浏览器中打开`,
|
||||||
|
showCancel: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadDetail()
|
loadDetail()
|
||||||
})
|
})
|
||||||
@@ -309,6 +330,21 @@ onMounted(() => {
|
|||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查看原文
|
||||||
|
.source-link {
|
||||||
|
margin: 0 20px 20px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
background: var(--glass-bg);
|
||||||
|
border: 1px solid var(--glass-border);
|
||||||
|
border-radius: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.source-link-icon { font-size: 14px; }
|
||||||
|
.source-link-text { flex: 1; font-size: 13px; color: var(--dim1-color); font-weight: 500; }
|
||||||
|
.source-link-arrow { font-size: 14px; color: var(--text-muted); }
|
||||||
|
|
||||||
// Related tags
|
// Related tags
|
||||||
.related-tags {
|
.related-tags {
|
||||||
margin: 0 20px 20px;
|
margin: 0 20px 20px;
|
||||||
|
|||||||
Reference in New Issue
Block a user