fix: tab icon

This commit is contained in:
zzc
2026-01-22 23:54:56 +08:00
parent 3ecc525d2c
commit 1519c4f486
2 changed files with 156 additions and 2 deletions

View File

@@ -37,6 +37,29 @@
</view>
</view>
<!-- 今日灵感 -->
<view class="daily-section">
<view class="daily-header">
<text class="daily-title">今日灵感</text>
<text class="daily-date">{{ todayDate }}</text>
</view>
<view class="daily-card">
<view class="daily-content">
<text class="quote-mark"></text>
<text class="daily-text">{{ dailyGreeting }}</text>
<text class="quote-mark right"></text>
</view>
<view class="daily-actions">
<view class="action-btn copy" @tap="copyGreeting">
<text class="icon"></text> 复制
</view>
<view class="action-btn use" @tap="useGreeting">
<text class="icon"></text> 去制作
</view>
</view>
</view>
</view>
<!-- 大家都在用竖向列表左图右文 -->
<view class="section">
<view class="section-header">
@@ -115,8 +138,31 @@ const updateCountdown = () => {
}
};
const todayDate = ref("");
const dailyGreeting = ref(
"岁岁常欢愉,年年皆胜意。愿你新的一年,多喜乐,长安宁。",
);
const copyGreeting = () => {
uni.setClipboardData({
data: dailyGreeting.value,
success: () => {
uni.showToast({ title: "复制成功", icon: "none" });
},
});
};
const useGreeting = () => {
uni.setStorageSync("TEMP_BLESSING_TEXT", dailyGreeting.value);
uni.switchTab({
url: "/pages/make/index",
});
};
onMounted(() => {
updateCountdown();
const date = new Date();
todayDate.value = `${date.getMonth() + 1}${date.getDate()}`;
});
const features = ref([
@@ -347,6 +393,99 @@ onShareAppMessage(() => {
}
}
/* 今日灵感 */
.daily-section {
margin: 24rpx 24rpx 0;
.daily-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.daily-title {
font-size: 32rpx;
font-weight: 700;
color: #333;
}
.daily-date {
font-size: 24rpx;
color: #999;
font-family: monospace;
}
}
.daily-card {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-shadow: 0 8rpx 24rpx rgba(255, 59, 48, 0.08);
position: relative;
overflow: hidden;
}
.daily-card::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 8rpx;
height: 100%;
background: #ff3b30;
}
.daily-content {
position: relative;
padding: 10rpx 20rpx;
.quote-mark {
font-size: 60rpx;
color: #ff3b30;
opacity: 0.2;
position: absolute;
line-height: 1;
font-family: serif;
}
.quote-mark:first-child {
top: -10rpx;
left: -10rpx;
}
.quote-mark.right {
bottom: -20rpx;
right: 0;
}
.daily-text {
font-size: 30rpx;
color: #444;
line-height: 1.8;
font-style: italic;
display: block;
text-align: justify;
}
}
.daily-actions {
display: flex;
justify-content: flex-end;
margin-top: 30rpx;
gap: 20rpx;
.action-btn {
display: flex;
align-items: center;
padding: 12rpx 24rpx;
border-radius: 999rpx;
font-size: 24rpx;
transition: all 0.2s;
.icon {
margin-right: 6rpx;
font-size: 26rpx;
}
}
.action-btn.copy {
background: #f5f5f5;
color: #666;
}
.action-btn.use {
background: #ff3b30;
color: #fff;
box-shadow: 0 4rpx 12rpx rgba(255, 59, 48, 0.3);
}
}
}
/* 通用区块标题 */
.section {
margin-top: 28rpx;