fix: 优化分享按钮布局+去掉重复推广入口

1. 阅读页分享按钮:改为全宽纵向排列
2. 新增复制文案功能
3. 我的页面:去掉顶部推广入口卡片(保留菜单中的推广中心)
This commit is contained in:
卡若
2026-01-25 20:35:30 +08:00
parent 1d11490405
commit 8a13505381
4 changed files with 44 additions and 26 deletions

View File

@@ -77,21 +77,6 @@
<!-- 概览内容 - 仅登录用户显示 --> <!-- 概览内容 - 仅登录用户显示 -->
<view class="tab-content" wx:if="{{activeTab === 'overview' && isLoggedIn}}"> <view class="tab-content" wx:if="{{activeTab === 'overview' && isLoggedIn}}">
<!-- 推广入口卡片 -->
<view class="promo-entry-card" bindtap="goToReferral">
<view class="promo-entry-left">
<view class="promo-entry-icon">💰</view>
<view class="promo-entry-info">
<text class="promo-entry-title">推广中心</text>
<text class="promo-entry-desc">邀请好友购买享90%推广收益</text>
</view>
</view>
<view class="promo-entry-right">
<text class="promo-entry-earnings" wx:if="{{earnings > 0}}">¥{{earnings}}</text>
<text class="promo-entry-arrow">→</text>
</view>
</view>
<!-- 菜单列表 --> <!-- 菜单列表 -->
<view class="menu-card card"> <view class="menu-card card">
<view <view

View File

@@ -285,6 +285,22 @@ Page({
}) })
}, },
// 复制分享文案
copyShareText() {
const { section } = this.data
const userInfo = app.globalData.userInfo
const referralCode = userInfo?.referralCode || ''
const shareText = `📚《Soul创业派对》推荐阅读\n\n${section?.title || '精彩内容'}\n\n来自派对房的真实商业故事62个创业案例干货满满\n\n🎁 通过我的推荐购买立享5%优惠\n👉 邀请码:${referralCode || 'SOUL'}\n\n#创业派对 #私域运营 #商业案例`
wx.setClipboardData({
data: shareText,
success: () => {
wx.showToast({ title: '文案已复制', icon: 'success' })
}
})
},
// 分享到微信 - 自动带分享人ID // 分享到微信 - 自动带分享人ID
onShareAppMessage() { onShareAppMessage() {
const { section, sectionId } = this.data const { section, sectionId } = this.data

View File

@@ -85,16 +85,24 @@
<view class="action-header"> <view class="action-header">
<text class="action-title">分享这篇内容</text> <text class="action-title">分享这篇内容</text>
</view> </view>
<view class="action-buttons"> <view class="action-row">
<button class="action-btn btn-share" open-type="share"> <button class="action-btn-full btn-share-full" open-type="share">
<text class="action-icon">💬</text> <text class="action-icon">💬</text>
<text class="action-text">分享给好友</text> <text class="action-text">分享给好友</text>
</button> </button>
<view class="action-btn btn-poster" bindtap="generatePoster"> </view>
<view class="action-row">
<view class="action-btn-full btn-poster-full" bindtap="generatePoster">
<text class="action-icon">🖼️</text> <text class="action-icon">🖼️</text>
<text class="action-text">生成海报</text> <text class="action-text">生成海报</text>
</view> </view>
</view> </view>
<view class="action-row">
<view class="action-btn-full btn-copy-full" bindtap="copyShareText">
<text class="action-icon">📝</text>
<text class="action-text">复制文案</text>
</view>
</view>
</view> </view>
</view> </view>

View File

@@ -414,38 +414,47 @@
color: rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.6);
} }
.action-buttons { .action-row {
display: flex; margin-bottom: 16rpx;
gap: 24rpx;
} }
.action-btn { .action-row:last-child {
flex: 1; margin-bottom: 0;
}
.action-btn-full {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 12rpx; gap: 12rpx;
width: 100%;
padding: 28rpx 24rpx; padding: 28rpx 24rpx;
border-radius: 20rpx; border-radius: 20rpx;
border: none; border: none;
background: transparent; background: transparent;
line-height: normal; line-height: normal;
box-sizing: border-box;
} }
.action-btn::after { .action-btn-full::after {
border: none; border: none;
} }
.btn-share { .btn-share-full {
background: rgba(7, 193, 96, 0.15); background: rgba(7, 193, 96, 0.15);
border: 2rpx solid rgba(7, 193, 96, 0.3); border: 2rpx solid rgba(7, 193, 96, 0.3);
} }
.btn-poster { .btn-poster-full {
background: rgba(255, 215, 0, 0.15); background: rgba(255, 215, 0, 0.15);
border: 2rpx solid rgba(255, 215, 0, 0.3); border: 2rpx solid rgba(255, 215, 0, 0.3);
} }
.btn-copy-full {
background: rgba(0, 206, 209, 0.15);
border: 2rpx solid rgba(0, 206, 209, 0.3);
}
.action-icon { .action-icon {
font-size: 36rpx; font-size: 36rpx;
} }