style: 修改样式
This commit is contained in:
parent
670ef5e019
commit
c93dd13dc3
@ -3,9 +3,9 @@
|
||||
<!-- 背景图片 - 固定在容器上 -->
|
||||
<image class="background-image" src="/static/square/squearbj.png" mode="aspectFill"></image>
|
||||
<!-- 可替换背景装饰层 -->
|
||||
<view class="replaceable-bg-layer">
|
||||
<!-- <view class="replaceable-bg-layer">
|
||||
<image class="replaceable-bg-overlay-image" :src="replaceableBgOverlay" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- Header组件 -->
|
||||
<view class="nav-back" @tap="goBack">
|
||||
<text class="nav-back-icon">←</text>
|
||||
@ -31,41 +31,53 @@
|
||||
<view class="user-text-info">
|
||||
<!-- 昵称 -->
|
||||
<view class="info-row">
|
||||
<text style="font-size: 48rpx;text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);"
|
||||
<text
|
||||
style="font-size: 30rpx;text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);color: #FFF9E7;min-width: 128rpx;"
|
||||
class="info-value">{{ nickname }}</text>
|
||||
</view>
|
||||
<!-- DID -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">DID</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value uid-value">{{ uid }}</text>
|
||||
<!-- <image class="toggle-icon"
|
||||
:src="showBlockNumber ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit" @tap="copyUid"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 链上地址 -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">链上地址</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value address-value" @longpress="copyAddress">{{ displayAddress
|
||||
}}</text>
|
||||
<view class="toggle-btn" @tap="showBlockNumber = !showBlockNumber">
|
||||
<image class="toggle-icon"
|
||||
:src="showBlockNumber ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit"></image>
|
||||
<view class="edit-btn" @tap="handleViewNickname">
|
||||
<image class="edit-nickname-btn" src="/static/icon/edit-nickname.png"
|
||||
mode="aspectFit"></image>
|
||||
<view class="edit-nickname-text">
|
||||
<text class="edit-nickname-placeholder">修改昵称
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 手机号 -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">注册手机</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value" v-if="mobile">{{ displayMobile }}</text>
|
||||
<view class="toggle-btn" @tap="toggleMobileDisplay">
|
||||
<image class="toggle-icon"
|
||||
:src="showMobile ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit"></image>
|
||||
<view class="info-row-wrapper">
|
||||
<!-- DID -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">DID</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value uid-value">{{ uid }}</text>
|
||||
<!-- <image class="toggle-icon"
|
||||
:src="showBlockNumber ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit" @tap="copyUid"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 链上地址 -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">链上地址</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value address-value" @longpress="copyAddress">{{
|
||||
displayAddress
|
||||
}}</text>
|
||||
<view class="toggle-btn" @tap="showBlockNumber = !showBlockNumber">
|
||||
<image class="toggle-icon"
|
||||
:src="showBlockNumber ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 手机号 -->
|
||||
<view class="info-row">
|
||||
<text class="info-label">注册手机</text>
|
||||
<view class="address-row">
|
||||
<text class="info-value" v-if="mobile">{{ displayMobile }}</text>
|
||||
<view class="toggle-btn" @tap="toggleMobileDisplay">
|
||||
<image class="toggle-icon"
|
||||
:src="showMobile ? '/static/icon/show.png' : '/static/icon/hide.png'"
|
||||
mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -78,7 +90,7 @@
|
||||
<view class="bottom-section">
|
||||
<view class="content-area">
|
||||
<!-- 我的资产 -->
|
||||
<view class="section-bg" style="padding-top: 0;">
|
||||
<view class="section-bg">
|
||||
<view class="section-title">我的资产</view>
|
||||
<view class="assets-grid">
|
||||
<view class="asset-card" @tap="handleAssetClick('myWorks')">
|
||||
@ -115,6 +127,11 @@
|
||||
</image>
|
||||
<text class="service-text">修改密码</text>
|
||||
</view>
|
||||
<view class="service-button" @tap="handleChangePassword">
|
||||
<image class="service-icon" src="/static/icon/edit-password.png" mode="aspectFit">
|
||||
</image>
|
||||
<text class="service-text">APP介绍</text>
|
||||
</view>
|
||||
<!-- <view class="service-button" @tap="handleSwitchRole">
|
||||
<image class="service-icon" src="/static/icon/switch-account.png" mode="aspectFit"></image>
|
||||
<text class="service-text">添加身份</text>
|
||||
@ -272,10 +289,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-section">
|
||||
<button class="logout-button" @tap="handleLogout">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-section" @tap="handleLogout">
|
||||
<text class="logout-button">退出登录</text>
|
||||
</view>
|
||||
|
||||
<!-- 新手引导弹窗 -->
|
||||
@ -1286,9 +1303,10 @@ onShow(() => {
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 2;
|
||||
border-radius: 86rpx;
|
||||
background: linear-gradient(133.78deg, rgba(154, 146, 255, 0.19) 9.69%, rgba(255, 202, 229, 0.19) 43.91%, rgba(255, 250, 253, 0.1881) 76.13%, rgba(63, 63, 76, 0.19) 91.61%);
|
||||
backdrop-filter: blur(35.70000076293945px);
|
||||
box-shadow: 2px 4px 1.8px 0px #D629291F;
|
||||
|
||||
background: linear-gradient(133.78deg, rgba(154, 146, 255) 9.69%, rgba(255, 202, 229) 43.91%, rgba(255, 250, 253, 0.99) 90.13%, rgba(63, 63, 76, 0.19) 99.9%);
|
||||
box-shadow: 2px 4px 1.8px 0px rgba(214, 41, 41, 0.12);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1344,6 +1362,7 @@ onShow(() => {
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
margin-bottom: 64rpx;
|
||||
|
||||
}
|
||||
|
||||
.background-image {
|
||||
@ -1408,11 +1427,8 @@ onShow(() => {
|
||||
.user-info-card {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 90%;
|
||||
max-width: 600rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 64rpx;
|
||||
padding: 40rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
@ -1427,7 +1443,7 @@ onShow(() => {
|
||||
|
||||
.avatar-container {
|
||||
position: absolute;
|
||||
left: -0;
|
||||
left: 30rpx;
|
||||
top: 32rpx;
|
||||
}
|
||||
|
||||
@ -1439,20 +1455,65 @@ onShow(() => {
|
||||
justify-content: flex-end;
|
||||
gap: 8rpx;
|
||||
margin-left: 8rpx;
|
||||
padding: 24rpx 24rpx 24rpx 240rpx;
|
||||
padding: 24rpx 24rpx 24rpx 224rpx;
|
||||
min-width: 356rpx;
|
||||
}
|
||||
|
||||
.info-row-wrapper {
|
||||
height: 140.8rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
opacity: 0.71;
|
||||
border-top-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
|
||||
background: linear-gradient(133.78deg, rgba(154, 146, 255, 0.46) 4.58%, rgba(255, 202, 229, 0.46) 43.91%, rgba(255, 250, 253, 0.4554) 76.13%, rgba(211, 209, 255, 0.46) 91.61%);
|
||||
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
padding: 0 12rpx;
|
||||
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
min-width: 144rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
.edit-nickname-btn {
|
||||
width: 46.4rpx;
|
||||
height: 46.4rpx;
|
||||
}
|
||||
|
||||
.edit-nickname-text {
|
||||
display: flex;
|
||||
border-radius: 18rpx;
|
||||
background: linear-gradient(100.7deg, rgba(103, 226, 222, 0.68) -3.17%, rgba(185, 78, 238, 0.68) 43.09%, rgba(225, 137, 139, 0.68) 99.19%);
|
||||
|
||||
}
|
||||
|
||||
.edit-nickname-placeholder {
|
||||
font-size: 15rpx;
|
||||
color: #FFF9E7;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 16rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 22rpx;
|
||||
color: #FFF9E7;
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.84);
|
||||
min-width: 112rpx;
|
||||
font-weight: 400;
|
||||
|
||||
}
|
||||
|
||||
.address-row {
|
||||
@ -1461,14 +1522,15 @@ onShow(() => {
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
font-size: 22rpx;
|
||||
color: #FFF9E7;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
min-width: 200rpx;
|
||||
|
||||
min-width: 192rpx;
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.84);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
@ -1572,7 +1634,6 @@ onShow(() => {
|
||||
.bottom-section {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 55vh;
|
||||
z-index: 3;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
@ -1586,15 +1647,16 @@ onShow(() => {
|
||||
|
||||
.section-bg {
|
||||
border-radius: 30rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 64rpx;
|
||||
padding: 8rpx 30rpx 16rpx;
|
||||
background: linear-gradient(133.78deg, rgba(154, 146, 255, 0.46) 4.58%, rgba(255, 202, 229, 0.46) 43.91%, rgba(255, 250, 253, 0.4554) 76.13%, rgba(211, 209, 255, 0.46) 91.61%);
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 40rpx;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.84);
|
||||
font-weight: 500;
|
||||
color: #FFF9E7;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
@ -1603,7 +1665,7 @@ onShow(() => {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 0;
|
||||
height: 176rpx;
|
||||
height: 128rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@ -1612,23 +1674,25 @@ onShow(() => {
|
||||
background-size: 100% 125%;
|
||||
background-position: center;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
height: 192rpx;
|
||||
height: 128rpx;
|
||||
width: 224rpx;
|
||||
box-shadow: 1px 3px 7px 0px #D833336E;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.asset-icon {
|
||||
width: 178rpx;
|
||||
height: 178rpx;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 60%;
|
||||
bottom: -20%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
opacity: 0.4;
|
||||
transform: translate(-50%, 0%);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.asset-text {
|
||||
@ -1663,8 +1727,8 @@ onShow(() => {
|
||||
background-size: 100% 100%;
|
||||
background-position: center;
|
||||
border-radius: 20rpx;
|
||||
width: 136rpx;
|
||||
height: 160rpx;
|
||||
width: 102rpx;
|
||||
height: 102rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@ -1676,19 +1740,19 @@ onShow(() => {
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.service-icon-emoji {
|
||||
font-size: 40rpx;
|
||||
font-size: 16rpx;
|
||||
margin-bottom: 6rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.service-text {
|
||||
font-size: 24rpx;
|
||||
font-size: 16rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
|
||||
@ -1706,17 +1770,21 @@ onShow(() => {
|
||||
}
|
||||
|
||||
.logout-section {
|
||||
padding: 10rpx 30rpx;
|
||||
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom));
|
||||
/* iOS 11.0 */
|
||||
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
|
||||
/* iOS 11.2+ */
|
||||
width: 6rem;
|
||||
height: 2rem;
|
||||
display: flex;
|
||||
position: relative;
|
||||
position: fixed;
|
||||
bottom: 160rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
border-radius: 40rpx;
|
||||
background: linear-gradient(115.98deg, #F6E9B4 -19.66%, #F08399 70.92%, rgba(213, 107, 109, 0.83521) 138.79%, rgba(105, 209, 230, 0.69) 198.61%);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 使用 ::after 伪元素绘制完美的圆角横线 */
|
||||
.logout-section::after {
|
||||
/* .logout-section::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -6rpx;
|
||||
@ -1731,23 +1799,12 @@ onShow(() => {
|
||||
width: calc(100% - 60rpx);
|
||||
transform: translateX(30rpx);
|
||||
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
} */
|
||||
|
||||
.logout-button {
|
||||
width: 60%;
|
||||
height: 112rpx;
|
||||
line-height: 112rpx;
|
||||
background: linear-gradient(to bottom right,
|
||||
#F0E4B1 0%,
|
||||
#F08399 50%,
|
||||
#B94E73 100%);
|
||||
border-radius: 40rpx;
|
||||
font-size: 56rpx;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
margin-top: 20rpx;
|
||||
flex-shrink: 0;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,88 +1,19 @@
|
||||
<template>
|
||||
<view class="creation-grid">
|
||||
<view class="recommend-tag">
|
||||
<text class="recommend-text">猜你喜欢</text>
|
||||
</view>
|
||||
|
||||
<view class="creation-list">
|
||||
<view class="col-left">
|
||||
<view
|
||||
v-for="item in col1"
|
||||
:key="item.id"
|
||||
class="creation-card"
|
||||
@click="handleCardClick(item)"
|
||||
>
|
||||
<image
|
||||
class="creation-image"
|
||||
:src="item.cover_image"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<view class="like-badge">
|
||||
<view class="like-icon-wrapper">
|
||||
<image
|
||||
class="like-icon"
|
||||
:src="item.is_liked ? '/static/icon/heart-icon.png' : '/static/icon/heart-icon-false.png'"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="like-count">{{ formatCount(item.like_count) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="wf-like-wave wf-like-wave-outer"
|
||||
:class="{ 'wf-like-wave-active': likingMap[item.id] }"
|
||||
/>
|
||||
<view
|
||||
class="wf-like-wave wf-like-wave-inner"
|
||||
:class="{ 'wf-like-wave-active': likingMap[item.id] }"
|
||||
/>
|
||||
<view class="creation-info">
|
||||
<view class="creation-meta">
|
||||
<view class="creator-info">
|
||||
<text class="creator-name">{{ item.creator_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in creationList" :key="item.id" class="creation-card" @click="handleCardClick(item)">
|
||||
<image class="creation-image" :src="item.cover_image" mode="aspectFill"></image>
|
||||
<view class="creation-info">
|
||||
<view class="creation-id">
|
||||
<text class="id-text">#{{ item.certificate_id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="col-right">
|
||||
<view
|
||||
v-for="item in col2"
|
||||
:key="item.id"
|
||||
class="creation-card"
|
||||
@click="handleCardClick(item)"
|
||||
>
|
||||
<image
|
||||
class="creation-image"
|
||||
:src="item.cover_image"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<view class="like-badge">
|
||||
<view class="like-icon-wrapper">
|
||||
<image
|
||||
class="like-icon"
|
||||
:src="item.is_liked ? '/static/icon/heart-icon.png' : '/static/icon/heart-icon-false.png'"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="like-count">{{ formatCount(item.like_count) }}</text>
|
||||
</view>
|
||||
<view class="creation-meta">
|
||||
<view class="creator-info">
|
||||
<image class="creator-avatar" :src="item.creator_avatar" mode="aspectFill"></image>
|
||||
<text class="creator-name">{{ item.creator_name }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="wf-like-wave wf-like-wave-outer"
|
||||
:class="{ 'wf-like-wave-active': likingMap[item.id] }"
|
||||
/>
|
||||
<view
|
||||
class="wf-like-wave wf-like-wave-inner"
|
||||
:class="{ 'wf-like-wave-active': likingMap[item.id] }"
|
||||
/>
|
||||
<view class="creation-info">
|
||||
<view class="creation-meta">
|
||||
<view class="creator-info">
|
||||
<text class="creator-name">
|
||||
{{ item.creator_name }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="like-info">
|
||||
<image class="like-icon" src="/static/icon/heart-icon.png" mode="aspectFit"></image>
|
||||
<text class="like-count">{{ formatCount(item.like_count) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -98,372 +29,171 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
import { getInspirationFlowApi } from "@/utils/api.js";
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue'
|
||||
import { getInspirationFlowApi } from '@/utils/api.js'
|
||||
|
||||
const props = defineProps({
|
||||
screenWidth: { type: Number, default: 375 },
|
||||
screenHeight: { type: Number, default: 812 },
|
||||
bannerBottom: { type: Number, default: 200 },
|
||||
useMockData: { type: Boolean, default: false },
|
||||
category: { type: String, default: "" },
|
||||
category: { type: String, default: '' },
|
||||
isActive: { type: Boolean, default: true },
|
||||
});
|
||||
})
|
||||
|
||||
const emit = defineEmits(["cardClick", "scroll"]);
|
||||
const emit = defineEmits(['cardClick', 'scroll'])
|
||||
|
||||
const creationList = ref([]);
|
||||
const col1 = ref([]);
|
||||
const col2 = ref([]);
|
||||
const cursor = ref("");
|
||||
const isLoading = ref(false);
|
||||
const noMore = ref(false);
|
||||
const likingMap = ref({});
|
||||
let isComponentMounted = false;
|
||||
const creationList = ref([])
|
||||
const cursor = ref('')
|
||||
const isLoading = ref(false)
|
||||
const noMore = ref(false)
|
||||
let isComponentMounted = false
|
||||
|
||||
const formatCount = (count) => {
|
||||
if (!count) return "0";
|
||||
if (count >= 10000) return (count / 10000).toFixed(1) + "w";
|
||||
if (count >= 1000) return (count / 1000).toFixed(1) + "k";
|
||||
return count.toString();
|
||||
};
|
||||
if (!count) return '0'
|
||||
if (count >= 10000) return (count / 10000).toFixed(1) + 'w'
|
||||
if (count >= 1000) return (count / 1000).toFixed(1) + 'k'
|
||||
return count.toString()
|
||||
}
|
||||
|
||||
const handleCardClick = (item) => {
|
||||
emit("cardClick", item);
|
||||
};
|
||||
emit('cardClick', item)
|
||||
}
|
||||
|
||||
const loadUsers = async () => {
|
||||
if (!isComponentMounted) return Promise.resolve();
|
||||
if (!isComponentMounted) return Promise.resolve()
|
||||
|
||||
cursor.value = "";
|
||||
isLoading.value = true;
|
||||
noMore.value = false;
|
||||
cursor.value = ''
|
||||
isLoading.value = true
|
||||
noMore.value = false
|
||||
|
||||
try {
|
||||
const res = await getInspirationFlowApi({
|
||||
limit: 20,
|
||||
type: props.category,
|
||||
cursor: "",
|
||||
});
|
||||
if (!isComponentMounted) return;
|
||||
const res = await getInspirationFlowApi({ limit: 20, type: props.category, cursor: '' })
|
||||
if (!isComponentMounted) return
|
||||
|
||||
if (res.code === 200 && res.data?.items && res.data.items.length > 0) {
|
||||
const items = res.data.items;
|
||||
cursor.value = res.data.cursor || "";
|
||||
const items = res.data.items
|
||||
cursor.value = res.data.cursor || ''
|
||||
|
||||
creationList.value = items.map((item) => {
|
||||
return {
|
||||
id: item.asset_id,
|
||||
certificate_id: item.asset_id,
|
||||
cover_image: item.cover_url || "",
|
||||
creator_avatar: item.owner_avatar || "",
|
||||
creator_name: item.owner_nickname || item.name || "",
|
||||
cover_image: item.cover_url || '',
|
||||
creator_avatar: item.owner_avatar || '',
|
||||
creator_name: item.owner_nickname || item.name || '',
|
||||
like_count: item.likes || item.like_count || 0,
|
||||
is_liked: item.is_liked || false,
|
||||
};
|
||||
});
|
||||
|
||||
// 分成两列:奇数放col1,偶数放col2
|
||||
col1.value = creationList.value.filter((_, i) => i % 2 === 0);
|
||||
col2.value = creationList.value.filter((_, i) => i % 2 === 1);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
noMore.value = true;
|
||||
noMore.value = true
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[CreationGrid] 加载数据失败", e?.message ?? e);
|
||||
console.error('[CreationGrid] 加载数据失败', e?.message ?? e)
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
isLoading.value = false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const loadMore = async () => {
|
||||
if (!isComponentMounted || isLoading.value || noMore.value) return;
|
||||
if (!isComponentMounted || isLoading.value || noMore.value) return
|
||||
|
||||
isLoading.value = true;
|
||||
isLoading.value = true
|
||||
try {
|
||||
const res = await getInspirationFlowApi({
|
||||
limit: 20,
|
||||
type: props.category,
|
||||
cursor: cursor.value,
|
||||
});
|
||||
if (!isComponentMounted) return;
|
||||
const res = await getInspirationFlowApi({ limit: 20, type: props.category, cursor: cursor.value })
|
||||
if (!isComponentMounted) return
|
||||
|
||||
if (res.code === 200 && res.data?.items && res.data.items.length > 0) {
|
||||
const items = res.data.items;
|
||||
cursor.value = res.data.cursor || "";
|
||||
const items = res.data.items
|
||||
cursor.value = res.data.cursor || ''
|
||||
|
||||
const newItems = items.map((item) => {
|
||||
return {
|
||||
id: item.asset_id,
|
||||
certificate_id: item.asset_id,
|
||||
cover_image: item.cover_url || "",
|
||||
creator_avatar: item.owner_avatar || "",
|
||||
creator_name: item.owner_nickname || item.name || "",
|
||||
cover_image: item.cover_url || '',
|
||||
creator_avatar: item.owner_avatar || '',
|
||||
creator_name: item.owner_nickname || item.name || '',
|
||||
like_count: item.likes || item.like_count || 0,
|
||||
is_liked: item.is_liked || false,
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
creationList.value = [...creationList.value, ...newItems];
|
||||
|
||||
// 重新分成两列
|
||||
col1.value = creationList.value.filter((_, i) => i % 2 === 0);
|
||||
col2.value = creationList.value.filter((_, i) => i % 2 === 1);
|
||||
creationList.value = [...creationList.value, ...newItems]
|
||||
} else {
|
||||
noMore.value = true;
|
||||
noMore.value = true
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[CreationGrid] 加载更多失败", e?.message ?? e);
|
||||
console.error('[CreationGrid] 加载更多失败', e?.message ?? e)
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
isLoading.value = false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.category,
|
||||
() => {
|
||||
loadUsers();
|
||||
},
|
||||
);
|
||||
watch(() => props.category, () => {
|
||||
loadUsers()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.isActive,
|
||||
(active) => {
|
||||
if (active && creationList.value.length === 0) {
|
||||
loadUsers();
|
||||
}
|
||||
},
|
||||
);
|
||||
watch(() => props.isActive, (active) => {
|
||||
if (active && creationList.value.length === 0) {
|
||||
loadUsers()
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
isComponentMounted = true;
|
||||
// 监听点赞事件,实时更新点赞数
|
||||
uni.$on("assetLiked", ({ asset_id, data }) => {
|
||||
// 触发动画
|
||||
likingMap.value = { ...likingMap.value, [asset_id]: true };
|
||||
setTimeout(() => {
|
||||
likingMap.value = { ...likingMap.value, [asset_id]: false };
|
||||
}, 600);
|
||||
const idx = creationList.value.findIndex((c) => c.id === asset_id);
|
||||
if (idx !== -1) {
|
||||
if (data && typeof data.new_like_count === "number") {
|
||||
creationList.value[idx].like_count = data.new_like_count;
|
||||
}
|
||||
if (data && typeof data.is_liked === "boolean") {
|
||||
creationList.value[idx].is_liked = data.is_liked;
|
||||
}
|
||||
creationList.value = [...creationList.value];
|
||||
}
|
||||
});
|
||||
loadUsers();
|
||||
});
|
||||
isComponentMounted = true
|
||||
loadUsers()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
isComponentMounted = false;
|
||||
uni.$off("assetLiked");
|
||||
});
|
||||
isComponentMounted = false
|
||||
})
|
||||
|
||||
defineExpose({ loadMore });
|
||||
defineExpose({ loadMore })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.creation-grid {
|
||||
padding: 0 24rpx;
|
||||
padding-top: 52rpx;
|
||||
padding-bottom: 88rpx;
|
||||
border-top-left-radius: 72rpx;
|
||||
border-top-right-radius: 24rpx;
|
||||
border-bottom-right-radius: 24rpx;
|
||||
border-bottom-left-radius: 24rpx;
|
||||
opacity: 0.78;
|
||||
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(148, 204, 153, 0.32) 0%,
|
||||
rgba(185, 176, 220, 0.32) 29.33%,
|
||||
rgba(207, 160, 227, 0.32) 56.25%,
|
||||
rgba(129, 227, 240, 0.32) 77.88%,
|
||||
rgba(220, 196, 155, 0.32) 100%
|
||||
);
|
||||
backdrop-filter: blur(11px);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.recommend-tag {
|
||||
position: absolute;
|
||||
top: -24rpx;
|
||||
left: 4rpx;
|
||||
width: 250rpx;
|
||||
height: 56rpx;
|
||||
border-top-left-radius: 44rpx;
|
||||
border-top-right-radius: 8rpx;
|
||||
border-bottom-right-radius: 44rpx;
|
||||
border-bottom-left-radius: 4rpx;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(96, 210, 236, 0.73) 0%,
|
||||
rgba(107, 60, 216, 0.4964) 51.44%,
|
||||
rgba(226, 137, 236, 0.73) 100%
|
||||
);
|
||||
box-shadow: 2px 2px 4px 0px #d9262640;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.recommend-text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-shadow: 0px 2px 8px #000000ba;
|
||||
font-weight: 600;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
}
|
||||
|
||||
.creation-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.col-left,
|
||||
.col-right {
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
.col-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.col-right {
|
||||
float: right;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
/* padding: 24rpx; */
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.creation-card {
|
||||
width: 100%;
|
||||
width: 48%;
|
||||
margin-bottom: 24rpx;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
backdrop-filter: blur(10rpx);
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.creation-image {
|
||||
width: 100%;
|
||||
display: block;
|
||||
box-shadow: 3px 3px 4.5px 2px #00000026;
|
||||
backdrop-filter: blur(0px);
|
||||
}
|
||||
|
||||
.like-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 122rpx;
|
||||
height: 140rpx;
|
||||
opacity: 1;
|
||||
border-top-left-radius: 7px;
|
||||
border-bottom-right-radius: 21.5px;
|
||||
background: linear-gradient(
|
||||
177.83deg,
|
||||
rgba(83, 244, 211, 0.2) 2.52%,
|
||||
rgba(15, 9, 0, 0) 69.07%
|
||||
);
|
||||
backdrop-filter: blur(0px);
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.like-icon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8rpx;
|
||||
}
|
||||
|
||||
.like-badge .like-icon {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.like-badge .like-count {
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
color: #fffabd;
|
||||
text-shadow:
|
||||
-1px 1px 4px #ce0909d6,
|
||||
0px 0px 10px #fffabd;
|
||||
}
|
||||
|
||||
.wf-like-wave {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wf-like-wave-outer {
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
rgba(255, 107, 107, 0.8) 0%,
|
||||
transparent 70%
|
||||
);
|
||||
}
|
||||
|
||||
.wf-like-wave-inner {
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
rgba(255, 184, 0, 0.6) 0%,
|
||||
transparent 70%
|
||||
);
|
||||
}
|
||||
|
||||
.wf-like-wave-active {
|
||||
animation: likeWave 0.6s ease-out forwards;
|
||||
}
|
||||
|
||||
@keyframes likeWave {
|
||||
0% {
|
||||
opacity: 0.9;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
height: 400rpx;
|
||||
}
|
||||
|
||||
.creation-info {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 148rpx;
|
||||
bottom: 0;
|
||||
border-top-left-radius: 7px;
|
||||
border-top-right-radius: 7px;
|
||||
opacity: 1;
|
||||
background: linear-gradient(
|
||||
177.83deg,
|
||||
rgba(235, 228, 219, 0) 20.38%,
|
||||
rgba(138, 135, 131, 0.228804) 45.67%,
|
||||
rgba(255, 231, 231, 0.446775) 62.04%,
|
||||
rgba(255, 255, 255, 0.710766) 83.52%,
|
||||
#ffffff 98.2%
|
||||
);
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
backdrop-filter: blur(0px);
|
||||
.creation-id {
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.id-text {
|
||||
font-size: 22rpx;
|
||||
color: #FFB800;
|
||||
font-weight: 600;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.creation-meta {
|
||||
position: absolute;
|
||||
bottom: 8rpx;
|
||||
left: 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.creator-info {
|
||||
@ -471,18 +201,16 @@ defineExpose({ loadMore });
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.creator-avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.creator-name {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
color: #554545;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.like-info {
|
||||
@ -490,6 +218,17 @@ defineExpose({ loadMore });
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.like-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.like-count {
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.loading-more,
|
||||
.no-more {
|
||||
width: 100%;
|
||||
@ -502,4 +241,4 @@ defineExpose({ loadMore });
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 295 KiB |
Loading…
Reference in New Issue
Block a user