<template>
|
<view class="page">
|
<view class="profile-section" :style="backgroundStyle">
|
|
<view class="top-bar">
|
<u-icon name="list" size="60" color="#D0E1E9" />
|
<view class="top-bar-right">
|
<!-- <u-icon name="edit-pen" size="60" color="#ffffff" class="icon-margin" /> -->
|
<u-sticky><u-icon name="share" size="60" color="#D0E1E9" /></u-sticky>
|
</view>
|
</view>
|
|
<view class="profile-content">
|
|
<view class="profile-header">
|
<view class="avatar-container">
|
<image class="avatar"
|
src="https://ai-public.mastergo.com/ai/img_res/e8ae645c666c247b895b488e60b048f5.jpg"
|
mode="aspectFill" />
|
<view class="add-icon">
|
<u-icon name="plus" size="20" color="#333" />
|
</view>
|
</view>
|
<view class="user-info">
|
<view class="username">小红薯 6786F040</view>
|
<view class="user-id">小红书号:95619601810</view>
|
<view class="location">IP 属地:江苏</view>
|
</view>
|
</view>
|
|
<view class="edit-profile">点击这里,填写简介</view>
|
|
<view class="stats">
|
<view class="stat-row">
|
<view class="stat-item">
|
<text class="number">0</text>
|
<text class="label">关注</text>
|
</view>
|
<view class="stat-item">
|
<text class="number">0</text>
|
<text class="label">粉丝</text>
|
</view>
|
<view class="stat-item">
|
<text class="number">1</text>
|
<text class="label">获赞与收藏</text>
|
</view>
|
</view>
|
<view class="action-buttons">
|
<u-button text="编辑资料" size="mini" type="info" plain hairline
|
:custom-style="{ backgroundColor: 'transparent', borderColor: '#B1ABA9' }"></u-button>
|
<u-icon name="setting" size="40"></u-icon>
|
</view>
|
</view>
|
</view>
|
<scroll-view class="function-cards" scroll-x="true" show-scrollbar="false">
|
<view class="card">
|
<view class="card-content">
|
<text class="card-title">购物车</text>
|
<text class="card-subtitle">查看推荐好物</text>
|
</view>
|
</view>
|
<view class="card">
|
<view class="card-content">
|
<text class="card-title">创作灵感</text>
|
<text class="card-subtitle">学创作找灵感</text>
|
</view>
|
</view>
|
<view class="card">
|
<view class="card-content">
|
<text class="card-title">浏览记录</text>
|
<text class="card-subtitle">看过的笔记</text>
|
</view>
|
</view>
|
<view class="card">
|
<view class="card-content">
|
<text class="card-title">浏览记录</text>
|
<text class="card-subtitle">看过的笔记</text>
|
</view>
|
</view>
|
</scroll-view>
|
</view>
|
|
|
<view class="tab-section">
|
<u-sticky>
|
<u-tabs :list="tabList" :current="current" @change="onTabChange" lineColor="#2979ff"
|
activeStyle="color: #2979ff"></u-tabs>
|
</u-sticky>
|
<swiper class="swiper-box" :current="current" @change="onSwiperChange" duration="300">
|
<swiper-item v-for="(item, index) in tabList" :key="index">
|
<view class="empty-state">
|
<image class="empty-icon"
|
src="https://ai-public.mastergo.com/ai/img_res/fc3cb775274ef0f5e58ac01687a9c121.jpg"
|
mode="aspectFit" />
|
<text class="empty-text">快去发布你的笔记吧</text>
|
<u-button class="publish-btn" size="mini" type="warning" shape="circle">去发布</u-button>
|
</view>
|
</swiper-item>
|
</swiper>
|
</view>
|
|
|
<common-footer flg="0"></common-footer>
|
</view>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
backgroundUrl2: 'https://ai-public.mastergo.com/ai/img_res/25f5105167f00aff148acc9bb83aed54.jpg', // 可能是动态获取的图片 URL
|
backgroundUrl: '',
|
current: 0,
|
tabList: [
|
{ name: '笔记' },
|
{ name: '收藏' },
|
{ name: '赞过' },
|
],
|
}
|
},
|
|
computed: {
|
backgroundStyle() {
|
return this.backgroundUrl
|
? `background: url(${this.backgroundUrl}) center center / cover no-repeat;`
|
: 'background-color: #1e1e1e;';
|
}
|
},
|
methods: {
|
getBackgroundStyle() {
|
if (this.backgroundUrl) {
|
return `background: url(${this.backgroundUrl}) center center / cover no-repeat;`;
|
} else {
|
return 'background-color: #f5f5f5;';
|
}
|
},
|
onTabChange(index) {
|
this.current = index; // 切换 swiper 面板
|
},
|
onSwiperChange(e) {
|
this.current = e.detail.current; // 同步 tabs
|
},
|
},
|
}
|
|
</script>
|
|
<style>
|
.page {
|
height: 100vh;
|
overflow-y: auto;
|
}
|
|
.top-bar {
|
position: relative;
|
z-index: 3;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
padding: 24rpx 32rpx;
|
}
|
|
.top-bar-right {
|
display: flex;
|
align-items: center;
|
}
|
|
.icon-margin {
|
margin-right: 32rpx;
|
}
|
|
.profile-section {
|
position: relative;
|
/* height: 680rpx; */
|
}
|
|
.bg-image {
|
position: absolute;
|
width: 100%;
|
height: 100%;
|
z-index: 1;
|
}
|
|
.profile-content {
|
position: relative;
|
z-index: 2;
|
padding: 30rpx;
|
}
|
|
.profile-header {
|
display: flex;
|
align-items: flex-start;
|
margin-bottom: 24rpx;
|
}
|
|
.avatar-container {
|
position: relative;
|
margin-right: 24rpx;
|
}
|
|
.avatar {
|
width: 120rpx;
|
height: 120rpx;
|
border-radius: 60rpx;
|
border: 2px solid #ffffff;
|
}
|
|
.add-icon {
|
position: absolute;
|
right: -8rpx;
|
bottom: -8rpx;
|
width: 40rpx;
|
height: 40rpx;
|
background-color: #FFE411;
|
border-radius: 20rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.user-info {
|
flex: 1;
|
}
|
|
.username {
|
font-size: 30rpx;
|
color: #FCFFFE;
|
font-weight: bold;
|
margin-bottom: 8rpx;
|
}
|
|
.user-id,
|
.location {
|
font-size: 26rpx;
|
color: #666666;
|
margin-bottom: 4rpx;
|
}
|
|
.edit-profile {
|
color: #999999;
|
font-size: 26rpx;
|
margin-bottom: 20rpx;
|
}
|
|
.stats {
|
display: flex;
|
/* margin-bottom: 20rpx; */
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.stat-row {
|
display: flex;
|
}
|
|
.stat-item {
|
margin-right: 48rpx;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
}
|
|
.stat-item:last-child {
|
margin-right: auto;
|
}
|
|
.number {
|
font-size: 30rpx;
|
color: #A19B99;
|
font-weight: bold;
|
margin-bottom: 4rpx;
|
}
|
|
.label {
|
font-size: 24rpx;
|
color: #B1ABA9;
|
}
|
|
.action-buttons {
|
display: flex;
|
gap: 16rpx;
|
}
|
|
.edit-btn {
|
padding: 0 24rpx !important;
|
background-color: #f5f5f5 !important;
|
color: #333333 !important;
|
border: none !important;
|
}
|
|
.settings-btn {
|
width: 80rpx !important;
|
background-color: #f5f5f5 !important;
|
color: #333333 !important;
|
border: none !important;
|
padding: 0 !important;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.function-cards {
|
/* padding: 32rpx 0; */
|
white-space: nowrap;
|
overflow: auto;
|
padding-bottom: 20rpx;
|
}
|
|
.card {
|
display: inline-block;
|
width: 180rpx;
|
height: 80rpx;
|
margin-left: 20rpx;
|
background-color: rgba(60, 60, 60, 0.4);
|
/* 灰色 + 20% 透明度 */
|
border-radius: 16rpx;
|
padding: 10rpx;
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
}
|
|
.card:last-child {
|
margin-right: 24rpx;
|
}
|
|
.card-content {
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
}
|
|
.card-title {
|
font-size: 30rpx;
|
color: #E7E1DF;
|
font-weight: bold;
|
}
|
|
.card-subtitle {
|
font-size: 20rpx;
|
color: #BEBBB8;
|
}
|
|
.tab-section {
|
padding: 0 32rpx;
|
}
|
|
.tab-header {
|
display: flex;
|
justify-content: space-between;
|
margin-bottom: 48rpx;
|
}
|
|
.tab {
|
position: relative;
|
padding: 16rpx 0;
|
display: flex;
|
align-items: center;
|
}
|
|
.tab.active::after {
|
content: '';
|
position: absolute;
|
bottom: 0;
|
left: 50%;
|
transform: translateX(-50%);
|
width: 48rpx;
|
height: 4rpx;
|
background-color: #333;
|
border-radius: 2rpx;
|
}
|
|
.tab-text {
|
font-size: 16px;
|
color: #333;
|
margin-right: 8rpx;
|
}
|
|
.tab-count {
|
font-size: 16px;
|
color: #999;
|
}
|
|
.empty-state {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
padding: 48rpx 0;
|
min-height: 600rpx;
|
}
|
|
.empty-icon {
|
width: 200rpx;
|
height: 200rpx;
|
margin-bottom: 24rpx;
|
}
|
|
.empty-text {
|
font-size: 14px;
|
color: #999;
|
/* margin-bottom: 24rpx; */
|
}
|
|
.publish-btn {
|
background-color: #ffe411 !important;
|
color: #333 !important;
|
border: none !important;
|
border-radius: 32rpx !important;
|
padding: 0 48rpx !important;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.swiper-box {
|
// min-height: 600rpx;
|
/* 或 100vh,或具体 px */
|
height: 800px;
|
}
|
</style>
|