fix: tab icon
This commit is contained in:
@@ -37,6 +37,29 @@
|
|||||||
</view>
|
</view>
|
||||||
</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">
|
||||||
<view class="section-header">
|
<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(() => {
|
onMounted(() => {
|
||||||
updateCountdown();
|
updateCountdown();
|
||||||
|
const date = new Date();
|
||||||
|
todayDate.value = `${date.getMonth() + 1}月${date.getDate()}日`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const features = ref([
|
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 {
|
.section {
|
||||||
margin-top: 28rpx;
|
margin-top: 28rpx;
|
||||||
|
|||||||
@@ -291,7 +291,12 @@ import {
|
|||||||
getCardTemplateContentList,
|
getCardTemplateContentList,
|
||||||
} from "@/api/make";
|
} from "@/api/make";
|
||||||
import { createShareToken } from "@/api/system";
|
import { createShareToken } from "@/api/system";
|
||||||
import { onShareAppMessage, onLoad, onReachBottom } from "@dcloudio/uni-app";
|
import {
|
||||||
|
onShareAppMessage,
|
||||||
|
onLoad,
|
||||||
|
onReachBottom,
|
||||||
|
onShow,
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
|
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
|
||||||
|
|
||||||
@@ -396,6 +401,14 @@ onLoad((options) => {
|
|||||||
getTemplateContentList();
|
getTemplateContentList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
const tempBlessing = uni.getStorageSync("TEMP_BLESSING_TEXT");
|
||||||
|
if (tempBlessing) {
|
||||||
|
blessingText.value = { content: tempBlessing, id: "" };
|
||||||
|
uni.removeStorageSync("TEMP_BLESSING_TEXT");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
if (activeTool.value === "template") {
|
if (activeTool.value === "template") {
|
||||||
loadMoreTemplates();
|
loadMoreTemplates();
|
||||||
@@ -457,7 +470,9 @@ const getTemplateContentList = async () => {
|
|||||||
if (res.length) {
|
if (res.length) {
|
||||||
greetingLib.value = res;
|
greetingLib.value = res;
|
||||||
displayedGreetings.value = greetingLib.value.slice(0, 2);
|
displayedGreetings.value = greetingLib.value.slice(0, 2);
|
||||||
blessingText.value = greetingLib.value[0] || {};
|
if (!blessingText.value.content) {
|
||||||
|
blessingText.value = greetingLib.value[0] || {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user