feat: 新增未展览点赞提示

This commit is contained in:
zheng020 2026-05-12 16:45:38 +08:00
parent 11df4cd8e9
commit 023d708bf9

View File

@ -38,23 +38,16 @@
<!-- 藏品卡片区域 --> <!-- 藏品卡片区域 -->
<view class="card-section"> <view class="card-section">
<view class="card-wrapper"> <view class="card-wrapper">
<NftCard <NftCard :cover-image="coverUrl" :width="cardSize" :height="cardSize"
:cover-image="coverUrl" :custom-style="nftCardStyle" />
:width="cardSize"
:height="cardSize"
:custom-style="nftCardStyle"
/>
</view> </view>
<!-- 点赞 + 倒计时行 --> <!-- 点赞 + 倒计时行 -->
<view class="card-meta-row"> <view class="card-meta-row">
<!-- 点赞 --> <!-- 点赞 -->
<view class="like-area" @tap="handleLike"> <view class="like-area" @tap="handleLike">
<image <image :src="isLiked ? '/static/icon/like-after.png' : '/static/icon/like-before.png'"
:src="isLiked ? '/static/icon/like-after.png' : '/static/icon/like-before.png'" class="like-icon" mode="aspectFit" />
class="like-icon"
mode="aspectFit"
/>
<text class="like-num">{{ likeCount }}</text> <text class="like-num">{{ likeCount }}</text>
</view> </view>
@ -101,10 +94,7 @@
</view> </view>
<view class="chain-row"> <view class="chain-row">
<text class="chain-label">交易哈希</text> <text class="chain-label">交易哈希</text>
<text <text class="chain-value chain-hash" @longpress="copyHash">{{ displayTxHash }}</text>
class="chain-value chain-hash"
@longpress="copyHash"
>{{ displayTxHash }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -279,7 +269,13 @@ const handleLike = async () => {
is_liked: isLiked.value is_liked: isLiked.value
}); });
} catch (err) { } catch (err) {
uni.showToast({ title: err.message || '操作失败', icon: 'none', duration: 2000 }); const errMsg = err?.message || '';
const errCode = err?.code || err?.data?.code || '';
if (errMsg.includes('未在展示中')) {
uni.showToast({ title: '未展览无法点赞', icon: 'none', duration: 2000 });
} else {
uni.showToast({ title: '今日已点赞', icon: 'none', duration: 2000 });
}
} finally { } finally {
liking.value = false; liking.value = false;
} }
@ -407,8 +403,13 @@ onUnmounted(() => {
} }
@keyframes ring-spin { @keyframes ring-spin {
0% { transform: rotate(0deg); } 0% {
100% { transform: rotate(360deg); } transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
} }
/* 三颗脉冲粒子 */ /* 三颗脉冲粒子 */
@ -444,10 +445,13 @@ onUnmounted(() => {
} }
@keyframes dot-pulse { @keyframes dot-pulse {
0%, 100% {
0%,
100% {
transform: scale(0.6); transform: scale(0.6);
opacity: 0.4; opacity: 0.4;
} }
50% { 50% {
transform: scale(1.3); transform: scale(1.3);
opacity: 1; opacity: 1;
@ -464,8 +468,15 @@ onUnmounted(() => {
} }
@keyframes text-breathe { @keyframes text-breathe {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; } 0%,
100% {
opacity: 0.5;
}
50% {
opacity: 1;
}
} }
.error-text { .error-text {