feat: maidian

This commit is contained in:
zzc
2026-02-12 17:22:47 +08:00
parent 54e8581b81
commit 313435d13f
13 changed files with 142 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
<template>
<view class="wallpaper-page" >
<view class="wallpaper-page">
<NavBar title="我的壁纸" />
<!-- Header Stats -->
@@ -24,7 +24,12 @@
<!-- List Section -->
<view class="list-section">
<view class="list-container">
<view v-for="item in list" :key="item.id" class="grid-item" @tap="onPreview(item)">
<view
v-for="item in list"
:key="item.id"
class="grid-item"
@tap="onPreview(item)"
>
<image :src="item.imageUrl" mode="aspectFill" class="wallpaper-img" />
<view class="date-badge">
<text>{{ formatDate(item.createdAt) }}</text>
@@ -51,6 +56,7 @@ import { ref, onMounted } from "vue";
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { getMyWallpaper } from "@/api/mine.js";
import NavBar from "@/components/NavBar/NavBar.vue";
import { trackRecord } from "@/utils/common.js";
const list = ref([]);
const page = ref(1);
@@ -61,6 +67,10 @@ const totalCount = ref(0);
onMounted(() => {
fetchList(true);
trackRecord({
eventName: "wallpaper_record_page_visit",
eventType: `visit`,
});
});
onPullDownRefresh(() => {
@@ -125,7 +135,7 @@ const formatDate = (dateStr) => {
const onPreview = (item) => {
uni.previewImage({
urls: [item.imageUrl],
current: item.imageUrl
current: item.imageUrl,
});
};
</script>
@@ -166,7 +176,7 @@ const onPreview = (item) => {
.value-wrap {
display: flex;
align-items: baseline;
.prefix {
font-size: 16px;
color: #333;
@@ -198,7 +208,7 @@ const onPreview = (item) => {
display: flex;
align-items: center;
justify-content: center;
text {
font-size: 24px;
}
@@ -217,7 +227,7 @@ const onPreview = (item) => {
gap: 12px;
padding-bottom: 40px;
}
.grid-item {
position: relative;
border-radius: 16px;
@@ -225,13 +235,13 @@ const onPreview = (item) => {
background: #fff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
aspect-ratio: 9/16; // Standard wallpaper ratio
.wallpaper-img {
width: 100%;
height: 100%;
display: block;
}
.date-badge {
position: absolute;
bottom: 8px;
@@ -240,7 +250,7 @@ const onPreview = (item) => {
padding: 2px 6px;
border-radius: 4px;
backdrop-filter: blur(4px);
text {
color: #fff;
font-size: 10px;
@@ -258,4 +268,4 @@ const onPreview = (item) => {
color: #999;
font-size: 12px;
}
</style>
</style>