deploy: auto commit repo-root changes 2026-08-02 20:11:33
This commit is contained in:
@@ -85,19 +85,7 @@
|
||||
<u-icon :name="post.is_liked ? 'thumb-up-fill' : 'thumb-up'" size="31" :color="post.is_liked ? '#1468f5' : '#7a8494'" />
|
||||
<text>{{ formatCount(post.like_count) }}</text>
|
||||
</view>
|
||||
<view v-if="isLiuhePost" class="post-card__action" :class="{ 'post-card__action--loading': post._ai_loading }"
|
||||
@tap.stop="handleAiAnalysis">
|
||||
<text class="post-card__ai-icon">AI</text>
|
||||
<text>{{ post._ai_loading ? '分析中' : (aiAnalyzed ? '已分析' : 'AI 分析') }}</text>
|
||||
</view>
|
||||
<view class="post-card__action post-card__action--share" @tap.stop="handleShareTap">
|
||||
<u-icon name="share" size="31" color="#7a8494" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<share-popup v-if="showSharePopup" v-model:show="showSharePopup" page-type="post" :page-id="post.id"
|
||||
:path="`/packages_community/pages/post_detail?id=${post.id}`"
|
||||
:title="post.content?.substring(0, 50) || '来看看这篇帖子'" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -105,15 +93,12 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { translatePost } from '@/api/community'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import SharePopup from '@/components/share-popup/share-popup.vue'
|
||||
|
||||
const props = defineProps<{ post: any }>()
|
||||
const emit = defineEmits(['tap', 'unlock', 'like', 'avatar-tap', 'ai-analysis'])
|
||||
const showSharePopup = ref(false)
|
||||
defineEmits(['tap', 'unlock', 'like', 'avatar-tap'])
|
||||
const translatedText = ref('')
|
||||
const cachedContent = ref(props.post.translated_content || '')
|
||||
const autoTranslateStarted = ref(false)
|
||||
const LIUHE_TAGS = ['旧澳六合', '新澳六合']
|
||||
|
||||
const rawContent = computed(() => String(props.post?.content_short || props.post?.content || '').trim())
|
||||
const contentParts = computed(() => {
|
||||
@@ -127,7 +112,6 @@ const contentParts = computed(() => {
|
||||
const contentTitle = computed(() => contentParts.value.title)
|
||||
const contentSummary = computed(() => contentParts.value.summary)
|
||||
const isLotteryPost = computed(() => Array.isArray(props.post?.tags) && props.post.tags.includes('彩票'))
|
||||
const isLiuhePost = computed(() => LIUHE_TAGS.some((tag) => props.post?.tags?.includes(tag)))
|
||||
const isTrumpPost = computed(() => Array.isArray(props.post?.tags) && props.post.tags.includes('特朗普'))
|
||||
const trumpSourceUrl = computed(() => {
|
||||
if (props.post?.source_url) return props.post.source_url
|
||||
@@ -137,9 +121,7 @@ const trumpSourceUrl = computed(() => {
|
||||
return postId ? `https://truthsocial.com/@realDonaldTrump/${postId}` : ''
|
||||
})
|
||||
const displayTranslatedText = computed(() => translatedText.value || cachedContent.value || props.post?.translated_content || '')
|
||||
const aiAnalyzed = computed(() => !!displayTranslatedText.value)
|
||||
|
||||
const handleShareTap = () => { showSharePopup.value = true }
|
||||
const openSourceUrl = () => trumpSourceUrl.value && uni.navigateTo({ url: `/pages/webview/webview?url=${encodeURIComponent(trumpSourceUrl.value)}` })
|
||||
const previewImage = (index: number) => {
|
||||
const images = props.post?.images || []
|
||||
@@ -156,15 +138,6 @@ const requestTranslate = async () => {
|
||||
} catch (_error) { }
|
||||
}
|
||||
|
||||
const handleAiAnalysis = () => {
|
||||
if (props.post._ai_loading) return
|
||||
if (!getToken()) {
|
||||
uni.showToast({ title: '请先登录', icon: 'none' })
|
||||
return
|
||||
}
|
||||
emit('ai-analysis', props.post)
|
||||
}
|
||||
|
||||
watch(() => props.post?.translated_content, (value) => {
|
||||
if (value) {
|
||||
cachedContent.value = value
|
||||
@@ -500,36 +473,22 @@ const formatCount = (value: any) => {
|
||||
&__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 42rpx;
|
||||
margin-top: 22rpx;
|
||||
padding-top: 18rpx;
|
||||
border-top: 1rpx solid #edf0f4;
|
||||
}
|
||||
|
||||
&__action {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 7rpx;
|
||||
color: #7a8494;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
|
||||
&--active { color: #1468f5; }
|
||||
&--share { margin-left: auto; }
|
||||
&--loading { opacity: 0.6; }
|
||||
}
|
||||
|
||||
&__ai-icon {
|
||||
width: 29rpx;
|
||||
height: 29rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
font-size: 17rpx;
|
||||
font-weight: 800;
|
||||
background: #1468f5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -57,8 +57,7 @@
|
||||
</view>
|
||||
|
||||
<post-card v-for="post in postList" :key="post.id" :post="post" @tap="goDetail(post.id)"
|
||||
@unlock="handleUnlock(post)" @avatar-tap="goUserProfile" @like="handleLike(post)"
|
||||
@ai-analysis="handleAiAnalysis" />
|
||||
@unlock="handleUnlock(post)" @avatar-tap="goUserProfile" @like="handleLike(post)" />
|
||||
|
||||
<view v-if="!loading && postList.length === 0" class="community-empty">
|
||||
<u-empty :text="activeFeed === 'follow' ? '关注的作者暂未发布内容' : '暂时没有相关讨论'" mode="data" />
|
||||
@@ -344,13 +343,6 @@ const handleLike = async (post: any) => {
|
||||
} catch (_error) { }
|
||||
}
|
||||
|
||||
const handleAiAnalysis = (post: any) => {
|
||||
const tags = Array.isArray(post?.tags) ? post.tags : []
|
||||
if (!tags.includes('旧澳六合') && !tags.includes('新澳六合')) return
|
||||
const title = encodeURIComponent(String(post?.content || '帖子AI分析').split('\n')[0].trim().slice(0, 28) || '帖子AI分析')
|
||||
uni.navigateTo({ url: `/pages/ai_analysis/ai_analysis?type=post&id=${post.id}&title=${title}` })
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
// #ifdef APP-PLUS || MP
|
||||
|
||||
Reference in New Issue
Block a user