fix: rank

This commit is contained in:
zzc
2026-02-25 23:42:38 +08:00
parent 1bfcfd2dec
commit d5353f4437

View File

@@ -211,9 +211,10 @@
<text class="usage-count">{{ item.usageCount }} 人在用</text>
</view>
</view>
<view class="rank-likes" v-if="item.scene === 'card'">
<uni-icons type="heart-filled" size="16" color="#a85a5a" />
<text class="likes-num">{{ item.likes }}</text>
<view class="rank-action" v-if="item.scene === 'card'">
<view class="create-btn" @tap.stop="handleCreate(item)">
<text>去制作</text>
</view>
</view>
<view class="rank-action" v-else>
<view class="download-btn" @tap.stop="handleDownload(item)">
@@ -230,7 +231,7 @@
<text>分享今日运势</text>
</button> -->
<view class="bottom-spacer"></view>
<!-- <view class="bottom-spacer"></view> -->
<!-- 登录弹窗 -->
<LoginPopup />
@@ -450,6 +451,28 @@ const navTo = (url) => {
uni.navigateTo({ url });
};
const handleCreate = (item) => {
uni.setStorageSync("RECOMMEND_CARD_DATA", {
recommendId: item.targetId,
imageUrl: item?.resourceInfo?.url,
});
uni.navigateTo({ url: "/pages/make/index" });
// uni.navigateTo({
// url: "/pages/make/index",
// success: () => {
// // Pass the template ID to the make page via global event or storage since switchTab doesn't support query params directly
// // However, for better UX, we can use a global state or event bus.
// // Or simply navigate if it's just switching tabs.
// // Since the user wants to use the selected template, we should try to pass it.
// // Uni-app's switchTab doesn't support params. We can use a global variable or store.
// // Here we will use uni.$emit to notify the make page after switching.
// setTimeout(() => {
// uni.$emit("select-template", item.id);
// }, 100);
// },
// });
};
const handleDownload = async (item) => {
if (!isLoggedIn.value) {
uni.$emit("show-login-popup");
@@ -1098,6 +1121,21 @@ onShareTimeline(() => {
transform: scale(0.95);
}
}
.create-btn {
padding: 8rpx 20rpx;
background: linear-gradient(135deg, #ff3b30, #ff1744);
color: #fff;
border-radius: 24rpx;
font-size: 22rpx;
font-weight: bold;
box-shadow: 0 4rpx 12rpx rgba(255, 23, 68, 0.2);
&:active {
opacity: 0.9;
transform: scale(0.95);
}
}
}
}
}
@@ -1130,8 +1168,4 @@ onShareTimeline(() => {
margin-left: 12rpx;
}
}
.bottom-spacer {
height: 120rpx;
}
</style>