v1.19 全面改版:VIP会员系统、我的收益、创业老板排行、阅读量排序
- 后端: users表新增VIP字段, 4个VIP API (purchase/status/profile/members) - 后端: hot接口改按user_tracks阅读量排序 - 后端: orders表支持vip产品类型, migrate新增vip_fields迁移 - 小程序「我的」: 推广中心改为我的收益, 头像VIP标识, VIP入口卡片 - 小程序「我的」: 最近阅读显示真实章节名称 - 小程序首页: 去掉内容概览, 新增创业老板排行(4列网格) - 小程序首页: 精选推荐从hot接口获取, goToRead增加track记录 - 新增页面: VIP详情页, 会员详情页 - 开发文档精简为10个标准目录, 创建SKILL.md, 需求日志规范化 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
"pages/referral/referral",
|
||||
"pages/purchases/purchases",
|
||||
"pages/settings/settings",
|
||||
"pages/search/search"
|
||||
"pages/search/search",
|
||||
"pages/vip/vip",
|
||||
"pages/member-detail/member-detail"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
@@ -52,10 +54,9 @@
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"getLocation",
|
||||
"chooseAddress"
|
||||
"getLocation"
|
||||
],
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
}
|
||||
@@ -1,84 +1,57 @@
|
||||
/**
|
||||
* Soul创业派对 - 首页
|
||||
* 开发: 卡若
|
||||
* 技术支持: 存客宝
|
||||
*/
|
||||
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
// 系统信息
|
||||
statusBarHeight: 44,
|
||||
navBarHeight: 88,
|
||||
|
||||
// 用户信息
|
||||
isLoggedIn: false,
|
||||
hasFullBook: false,
|
||||
purchasedCount: 0,
|
||||
|
||||
// 书籍数据
|
||||
totalSections: 62,
|
||||
bookData: [],
|
||||
|
||||
// 推荐章节
|
||||
featuredSections: [
|
||||
{ id: '1.1', title: '荷包:电动车出租的被动收入模式', tag: '免费', tagClass: 'tag-free', part: '真实的人' },
|
||||
{ id: '3.1', title: '3000万流水如何跑出来', tag: '热门', tagClass: 'tag-pink', part: '真实的行业' },
|
||||
{ id: '8.1', title: '流量杠杆:抖音、Soul、飞书', tag: '推荐', tagClass: 'tag-purple', part: '真实的赚钱' }
|
||||
],
|
||||
|
||||
// 最新章节(动态计算)
|
||||
|
||||
featuredSections: [],
|
||||
latestSection: null,
|
||||
latestLabel: '最新更新',
|
||||
|
||||
// 内容概览
|
||||
partsList: [
|
||||
{ id: 'part-1', number: '一', title: '真实的人', subtitle: '人与人之间的底层逻辑' },
|
||||
{ id: 'part-2', number: '二', title: '真实的行业', subtitle: '电商、内容、传统行业解析' },
|
||||
{ id: 'part-3', number: '三', title: '真实的错误', subtitle: '我和别人犯过的错' },
|
||||
{ id: 'part-4', number: '四', title: '真实的赚钱', subtitle: '底层结构与真实案例' },
|
||||
{ id: 'part-5', number: '五', title: '真实的社会', subtitle: '未来职业与商业生态' }
|
||||
],
|
||||
|
||||
// 加载状态
|
||||
|
||||
// 创业老板排行
|
||||
vipMembers: [],
|
||||
|
||||
loading: true
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
// 获取系统信息
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
navBarHeight: app.globalData.navBarHeight
|
||||
})
|
||||
|
||||
// 处理分享参数(推荐码绑定)
|
||||
if (options && options.ref) {
|
||||
console.log('[Index] 检测到推荐码:', options.ref)
|
||||
app.handleReferralCode({ query: options })
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
this.initData()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 设置TabBar选中状态
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({ selected: 0 })
|
||||
}
|
||||
|
||||
// 更新用户状态
|
||||
this.updateUserStatus()
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
async initData() {
|
||||
this.setData({ loading: true })
|
||||
|
||||
try {
|
||||
await this.loadBookData()
|
||||
await this.loadLatestSection()
|
||||
await Promise.all([
|
||||
this.loadBookData(),
|
||||
this.loadLatestSection(),
|
||||
this.loadHotSections(),
|
||||
this.loadVipMembers()
|
||||
])
|
||||
} catch (e) {
|
||||
console.error('初始化失败:', e)
|
||||
this.computeLatestSectionFallback()
|
||||
@@ -87,121 +60,107 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
// 从后端获取最新章节(2日内有新章取最新3章,否则随机免费章)
|
||||
// 从hot接口获取精选推荐(按阅读量排序)
|
||||
async loadHotSections() {
|
||||
try {
|
||||
const res = await app.request('/api/book/hot')
|
||||
if (res?.success && res.chapters?.length) {
|
||||
this.setData({ featuredSections: res.chapters.slice(0, 5) })
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[Index] 热门章节加载失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 加载VIP会员列表
|
||||
async loadVipMembers() {
|
||||
try {
|
||||
const res = await app.request('/api/vip/members?limit=8')
|
||||
if (res?.success && res.data?.length) {
|
||||
this.setData({ vipMembers: res.data })
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[Index] VIP会员加载失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
async loadLatestSection() {
|
||||
try {
|
||||
const res = await app.request('/api/book/latest-chapters')
|
||||
if (res && res.success && res.banner) {
|
||||
this.setData({
|
||||
latestSection: res.banner,
|
||||
latestLabel: res.label || '最新更新'
|
||||
})
|
||||
if (res?.success && res.banner) {
|
||||
this.setData({ latestSection: res.banner, latestLabel: res.label || '最新更新' })
|
||||
return
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('latest-chapters API 失败,使用兜底逻辑:', e.message)
|
||||
console.warn('latest-chapters API 失败:', e.message)
|
||||
}
|
||||
this.computeLatestSectionFallback()
|
||||
},
|
||||
|
||||
// 兜底:API 失败时从 bookData 计算(随机选免费章节)
|
||||
computeLatestSectionFallback() {
|
||||
const bookData = app.globalData.bookData || this.data.bookData || []
|
||||
let sections = []
|
||||
if (Array.isArray(bookData)) {
|
||||
sections = bookData.map(s => ({
|
||||
id: s.id,
|
||||
title: s.title || s.sectionTitle,
|
||||
id: s.id, title: s.title || s.sectionTitle,
|
||||
part: s.part || s.sectionTitle || '真实的行业',
|
||||
isFree: s.isFree,
|
||||
price: s.price
|
||||
isFree: s.isFree, price: s.price
|
||||
}))
|
||||
} else if (bookData && typeof bookData === 'object') {
|
||||
const parts = bookData.parts || (Array.isArray(bookData) ? bookData : [])
|
||||
if (Array.isArray(parts)) {
|
||||
parts.forEach(p => {
|
||||
(p.chapters || p.sections || []).forEach(c => {
|
||||
(c.sections || [c]).forEach(s => {
|
||||
sections.push({
|
||||
id: s.id,
|
||||
title: s.title || s.section_title,
|
||||
part: p.title || p.part_title || c.title || '',
|
||||
isFree: s.isFree,
|
||||
price: s.price
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
const free = sections.filter(s => s.isFree !== false && (s.price === 0 || !s.price))
|
||||
const candidates = free.length > 0 ? free : sections
|
||||
if (candidates.length === 0) {
|
||||
if (!candidates.length) {
|
||||
this.setData({ latestSection: { id: '1.1', title: '开始阅读', part: '真实的人' }, latestLabel: '为你推荐' })
|
||||
return
|
||||
}
|
||||
const idx = Math.floor(Math.random() * candidates.length)
|
||||
const selected = { id: candidates[idx].id, title: candidates[idx].title, part: candidates[idx].part || '真实的行业' }
|
||||
this.setData({ latestSection: selected, latestLabel: '为你推荐' })
|
||||
this.setData({ latestSection: candidates[idx], latestLabel: '为你推荐' })
|
||||
},
|
||||
|
||||
// 加载书籍数据(含精选推荐,按后端点击量排序)
|
||||
async loadBookData() {
|
||||
try {
|
||||
const res = await app.request('/api/book/all-chapters')
|
||||
if (res && res.data) {
|
||||
const setData = {
|
||||
if (res?.data) {
|
||||
this.setData({
|
||||
bookData: res.data,
|
||||
totalSections: res.totalSections || res.data?.length || 62
|
||||
}
|
||||
if (res.featuredSections && res.featuredSections.length) {
|
||||
setData.featuredSections = res.featuredSections
|
||||
}
|
||||
this.setData(setData)
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载书籍数据失败:', e)
|
||||
}
|
||||
} catch (e) { console.error('加载书籍数据失败:', e) }
|
||||
},
|
||||
|
||||
// 更新用户状态
|
||||
updateUserStatus() {
|
||||
const { isLoggedIn, hasFullBook, purchasedSections } = app.globalData
|
||||
|
||||
this.setData({
|
||||
isLoggedIn,
|
||||
hasFullBook,
|
||||
isLoggedIn, hasFullBook,
|
||||
purchasedCount: hasFullBook ? this.data.totalSections : (purchasedSections?.length || 0)
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转到目录
|
||||
goToChapters() {
|
||||
wx.switchTab({ url: '/pages/chapters/chapters' })
|
||||
},
|
||||
|
||||
// 跳转到搜索页
|
||||
goToSearch() {
|
||||
wx.navigateTo({ url: '/pages/search/search' })
|
||||
},
|
||||
|
||||
// 跳转到阅读页
|
||||
// 阅读时记录行为轨迹
|
||||
goToRead(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
// 记录阅读行为(异步,不阻塞跳转)
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (userId) {
|
||||
app.request('/api/user/track', {
|
||||
method: 'POST',
|
||||
data: { userId, action: 'view_chapter', target: id }
|
||||
}).catch(() => {})
|
||||
}
|
||||
wx.navigateTo({ url: `/pages/read/read?id=${id}` })
|
||||
},
|
||||
|
||||
// 跳转到匹配页
|
||||
goToMatch() {
|
||||
wx.switchTab({ url: '/pages/match/match' })
|
||||
goToChapters() { wx.switchTab({ url: '/pages/chapters/chapters' }) },
|
||||
goToSearch() { wx.navigateTo({ url: '/pages/search/search' }) },
|
||||
goToMatch() { wx.switchTab({ url: '/pages/match/match' }) },
|
||||
goToMy() { wx.switchTab({ url: '/pages/my/my' }) },
|
||||
|
||||
goToMemberDetail(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({ url: `/pages/member-detail/member-detail?id=${id}` })
|
||||
},
|
||||
|
||||
// 跳转到我的页面
|
||||
goToMy() {
|
||||
wx.switchTab({ url: '/pages/my/my' })
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
async onPullDownRefresh() {
|
||||
await this.initData()
|
||||
this.updateUserStatus()
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
<!--pages/index/index.wxml-->
|
||||
<!--Soul创业派对 - 首页 1:1还原Web版本-->
|
||||
<!--Soul创业派对 - 首页-->
|
||||
<view class="page page-transition">
|
||||
<!-- 自定义导航栏占位 -->
|
||||
<view class="nav-placeholder" style="height: {{statusBarHeight + 44}}px;"></view>
|
||||
|
||||
<!-- 顶部区域 -->
|
||||
|
||||
<view class="header" style="padding-top: {{statusBarHeight}}px;">
|
||||
<view class="header-content">
|
||||
<view class="logo-section">
|
||||
<view class="logo-icon">
|
||||
<text class="logo-text">S</text>
|
||||
</view>
|
||||
<view class="logo-icon"><text class="logo-text">S</text></view>
|
||||
<view class="logo-info">
|
||||
<view class="logo-title">
|
||||
<text class="text-white">Soul</text>
|
||||
@@ -23,20 +18,14 @@
|
||||
<view class="chapter-badge">{{totalSections}}章</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar" bindtap="goToSearch">
|
||||
<view class="search-icon">
|
||||
<view class="search-circle"></view>
|
||||
<view class="search-handle"></view>
|
||||
</view>
|
||||
<view class="search-icon"><view class="search-circle"></view><view class="search-handle"></view></view>
|
||||
<text class="search-placeholder">搜索章节标题或内容...</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<view class="main-content">
|
||||
<!-- Banner卡片 - 最新章节 -->
|
||||
<!-- Banner - 最新章节 -->
|
||||
<view class="banner-card" bindtap="goToRead" data-id="{{latestSection.id}}">
|
||||
<view class="banner-glow"></view>
|
||||
<view class="banner-tag">{{latestLabel}}</view>
|
||||
@@ -79,27 +68,20 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 精选推荐 -->
|
||||
<!-- 精选推荐(按阅读量排序) -->
|
||||
<view class="section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">精选推荐</text>
|
||||
<view class="section-more" bindtap="goToChapters">
|
||||
<text class="more-text">查看全部</text>
|
||||
<text class="more-arrow">→</text>
|
||||
<text class="more-text">查看全部</text><text class="more-arrow">→</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="featured-list">
|
||||
<view
|
||||
class="featured-item"
|
||||
wx:for="{{featuredSections}}"
|
||||
wx:key="id"
|
||||
bindtap="goToRead"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<view class="featured-item" wx:for="{{featuredSections}}" wx:key="id" bindtap="goToRead" data-id="{{item.id}}">
|
||||
<view class="featured-content">
|
||||
<view class="featured-meta">
|
||||
<text class="featured-id brand-color">{{item.id}}</text>
|
||||
<text class="tag {{item.tagClass}}">{{item.tag}}</text>
|
||||
<text class="tag {{item.tagClass || 'tag-pink'}}">{{item.tag || '热门'}}</text>
|
||||
</view>
|
||||
<text class="featured-title">{{item.title}}</text>
|
||||
<text class="featured-part">{{item.part}}</text>
|
||||
@@ -109,24 +91,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容概览 -->
|
||||
<view class="section">
|
||||
<text class="section-title">内容概览</text>
|
||||
<view class="parts-list">
|
||||
<view
|
||||
class="part-item"
|
||||
wx:for="{{partsList}}"
|
||||
wx:key="id"
|
||||
bindtap="goToChapters"
|
||||
>
|
||||
<view class="part-icon">
|
||||
<text class="part-number">{{item.number}}</text>
|
||||
<!-- 创业老板排行(替代内容概览) -->
|
||||
<view class="section" wx:if="{{vipMembers.length > 0}}">
|
||||
<view class="section-header">
|
||||
<text class="section-title">创业老板排行</text>
|
||||
</view>
|
||||
<view class="members-grid">
|
||||
<view class="member-cell" wx:for="{{vipMembers}}" wx:key="id" bindtap="goToMemberDetail" data-id="{{item.id}}">
|
||||
<view class="member-avatar-wrap">
|
||||
<image class="member-avatar" wx:if="{{item.avatar}}" src="{{item.avatar}}" mode="aspectFill"/>
|
||||
<view class="member-avatar-placeholder" wx:else>
|
||||
<text>{{item.name[0] || '创'}}</text>
|
||||
</view>
|
||||
<view class="member-vip-dot">V</view>
|
||||
</view>
|
||||
<view class="part-info">
|
||||
<text class="part-title">{{item.title}}</text>
|
||||
<text class="part-subtitle">{{item.subtitle}}</text>
|
||||
</view>
|
||||
<view class="part-arrow">→</view>
|
||||
<text class="member-name">{{item.name}}</text>
|
||||
<text class="member-project" wx:if="{{item.project}}">{{item.project}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -141,6 +121,5 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部留白 -->
|
||||
<view class="bottom-space"></view>
|
||||
</view>
|
||||
|
||||
@@ -498,6 +498,80 @@
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
/* ===== 创业老板排行 ===== */
|
||||
.members-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
.member-cell {
|
||||
width: calc(25% - 15rpx);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
}
|
||||
.member-avatar-wrap {
|
||||
position: relative;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.member-avatar {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
border: 3rpx solid #FFD700;
|
||||
}
|
||||
.member-avatar-placeholder {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #1c1c1e, #2c2c2e);
|
||||
border: 3rpx solid #FFD700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
color: #FFD700;
|
||||
}
|
||||
.member-vip-dot {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||
color: #000;
|
||||
font-size: 16rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2rpx solid #000;
|
||||
}
|
||||
.member-name {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.9);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 140rpx;
|
||||
}
|
||||
.member-project {
|
||||
font-size: 20rpx;
|
||||
color: rgba(255,255,255,0.4);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 140rpx;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
/* ===== 底部留白 ===== */
|
||||
.bottom-space {
|
||||
height: 40rpx;
|
||||
|
||||
37
miniprogram/pages/member-detail/member-detail.js
Normal file
37
miniprogram/pages/member-detail/member-detail.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
statusBarHeight: 44,
|
||||
member: null,
|
||||
loading: true
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
if (options.id) this.loadMember(options.id)
|
||||
},
|
||||
|
||||
async loadMember(id) {
|
||||
try {
|
||||
const res = await app.request(`/api/vip/members?id=${id}`)
|
||||
if (res?.success) {
|
||||
this.setData({ member: res.data, loading: false })
|
||||
} else {
|
||||
this.setData({ loading: false })
|
||||
wx.showToast({ title: '会员不存在', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
this.setData({ loading: false })
|
||||
wx.showToast({ title: '加载失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
copyContact() {
|
||||
const contact = this.data.member?.contact
|
||||
if (!contact) { wx.showToast({ title: '暂无联系方式', icon: 'none' }); return }
|
||||
wx.setClipboardData({ data: contact, success: () => wx.showToast({ title: '已复制', icon: 'success' }) })
|
||||
},
|
||||
|
||||
goBack() { wx.navigateBack() }
|
||||
})
|
||||
1
miniprogram/pages/member-detail/member-detail.json
Normal file
1
miniprogram/pages/member-detail/member-detail.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "usingComponents": {}, "navigationStyle": "custom" }
|
||||
38
miniprogram/pages/member-detail/member-detail.wxml
Normal file
38
miniprogram/pages/member-detail/member-detail.wxml
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--会员详情-->
|
||||
<view class="page">
|
||||
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
|
||||
<view class="nav-back" bindtap="goBack"><text class="back-icon">‹</text></view>
|
||||
<text class="nav-title">创业伙伴</text>
|
||||
<view class="nav-placeholder-r"></view>
|
||||
</view>
|
||||
<view style="height: {{statusBarHeight + 44}}px;"></view>
|
||||
|
||||
<view class="detail-content" wx:if="{{member}}">
|
||||
<view class="detail-hero">
|
||||
<view class="detail-avatar-wrap">
|
||||
<image class="detail-avatar" wx:if="{{member.avatar}}" src="{{member.avatar}}" mode="aspectFill"/>
|
||||
<view class="detail-avatar-ph" wx:else><text>{{member.name[0] || '创'}}</text></view>
|
||||
<view class="detail-vip-badge">VIP</view>
|
||||
</view>
|
||||
<text class="detail-name">{{member.name}}</text>
|
||||
<text class="detail-project" wx:if="{{member.project}}">{{member.project}}</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-card" wx:if="{{member.bio}}">
|
||||
<text class="detail-card-title">简介</text>
|
||||
<text class="detail-card-text">{{member.bio}}</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-card" wx:if="{{member.contact}}">
|
||||
<text class="detail-card-title">联系方式</text>
|
||||
<view class="detail-contact-row">
|
||||
<text class="detail-card-text">{{member.contact}}</text>
|
||||
<view class="copy-btn" bindtap="copyContact">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="loading-state" wx:if="{{loading}}">
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
24
miniprogram/pages/member-detail/member-detail.wxss
Normal file
24
miniprogram/pages/member-detail/member-detail.wxss
Normal file
@@ -0,0 +1,24 @@
|
||||
.page { background: #000; min-height: 100vh; color: #fff; }
|
||||
.nav-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 24rpx; background: rgba(0,0,0,0.9); }
|
||||
.nav-back { width: 60rpx; height: 60rpx; display: flex; align-items: center; justify-content: center; }
|
||||
.back-icon { font-size: 44rpx; color: #fff; }
|
||||
.nav-title { font-size: 34rpx; font-weight: 600; color: #fff; }
|
||||
.nav-placeholder-r { width: 60rpx; }
|
||||
|
||||
.detail-content { padding: 24rpx; }
|
||||
.detail-hero { display: flex; flex-direction: column; align-items: center; padding: 48rpx 0 32rpx; }
|
||||
.detail-avatar-wrap { position: relative; margin-bottom: 20rpx; }
|
||||
.detail-avatar { width: 160rpx; height: 160rpx; border-radius: 50%; border: 4rpx solid #FFD700; }
|
||||
.detail-avatar-ph { width: 160rpx; height: 160rpx; border-radius: 50%; background: #1c1c1e; border: 4rpx solid #FFD700; display: flex; align-items: center; justify-content: center; font-size: 60rpx; color: #FFD700; }
|
||||
.detail-vip-badge { position: absolute; bottom: 4rpx; right: 4rpx; background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; font-size: 20rpx; font-weight: bold; padding: 4rpx 12rpx; border-radius: 14rpx; }
|
||||
.detail-name { font-size: 40rpx; font-weight: bold; color: #fff; }
|
||||
.detail-project { font-size: 26rpx; color: rgba(255,255,255,0.5); margin-top: 8rpx; }
|
||||
|
||||
.detail-card { background: #1c1c1e; border-radius: 20rpx; padding: 28rpx; margin-top: 24rpx; }
|
||||
.detail-card-title { font-size: 24rpx; color: rgba(255,255,255,0.5); display: block; margin-bottom: 12rpx; }
|
||||
.detail-card-text { font-size: 30rpx; color: rgba(255,255,255,0.9); }
|
||||
.detail-contact-row { display: flex; align-items: center; justify-content: space-between; }
|
||||
.copy-btn { background: #00CED1; color: #000; font-size: 24rpx; font-weight: 600; padding: 8rpx 24rpx; border-radius: 20rpx; }
|
||||
|
||||
.loading-state { display: flex; justify-content: center; padding: 100rpx 0; }
|
||||
.loading-text { color: rgba(255,255,255,0.4); font-size: 28rpx; }
|
||||
@@ -1,45 +1,44 @@
|
||||
/**
|
||||
* Soul创业派对 - 我的页面
|
||||
* 开发: 卡若
|
||||
* 技术支持: 存客宝
|
||||
*/
|
||||
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
// 系统信息
|
||||
statusBarHeight: 44,
|
||||
navBarHeight: 88,
|
||||
|
||||
// 用户状态
|
||||
isLoggedIn: false,
|
||||
userInfo: null,
|
||||
|
||||
// 统计数据
|
||||
|
||||
totalSections: 62,
|
||||
purchasedCount: 0,
|
||||
referralCount: 0,
|
||||
earnings: 0,
|
||||
pendingEarnings: 0,
|
||||
|
||||
|
||||
// VIP状态
|
||||
isVip: false,
|
||||
vipExpireDate: '',
|
||||
vipDaysRemaining: 0,
|
||||
vipPrice: 1980,
|
||||
|
||||
// 阅读统计
|
||||
totalReadTime: 0,
|
||||
matchHistory: 0,
|
||||
|
||||
// Tab切换
|
||||
activeTab: 'overview', // overview | footprint
|
||||
|
||||
// 最近阅读
|
||||
|
||||
activeTab: 'overview',
|
||||
recentChapters: [],
|
||||
|
||||
|
||||
// 章节映射表(id->title)
|
||||
chapterMap: {},
|
||||
|
||||
menuList: [
|
||||
{ id: 'orders', title: '我的订单', icon: '📦', count: 0 },
|
||||
{ id: 'referral', title: '推广中心', icon: '🎁', badge: '' },
|
||||
{ id: 'about', title: '关于作者', icon: '👤', iconBg: 'brand' }
|
||||
],
|
||||
|
||||
// 登录弹窗
|
||||
|
||||
showLoginModal: false,
|
||||
isLoggingIn: false
|
||||
},
|
||||
@@ -49,35 +48,62 @@ Page({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
navBarHeight: app.globalData.navBarHeight
|
||||
})
|
||||
this.loadChapterMap()
|
||||
this.initUserStatus()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 设置TabBar选中状态
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({ selected: 3 })
|
||||
}
|
||||
this.initUserStatus()
|
||||
},
|
||||
|
||||
// 加载章节名称映射
|
||||
async loadChapterMap() {
|
||||
try {
|
||||
const res = await app.request('/api/book/all-chapters')
|
||||
if (res && res.data) {
|
||||
const map = {}
|
||||
const sections = Array.isArray(res.data) ? res.data : []
|
||||
sections.forEach(s => {
|
||||
if (s.id) map[s.id] = s.title || s.sectionTitle || `章节 ${s.id}`
|
||||
})
|
||||
this.setData({ chapterMap: map })
|
||||
// 有了映射后刷新最近阅读
|
||||
this.refreshRecentChapters()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[My] 加载章节数据失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 刷新最近阅读列表(用真实标题)
|
||||
refreshRecentChapters() {
|
||||
const { purchasedSections } = app.globalData
|
||||
const map = this.data.chapterMap
|
||||
const recentList = (purchasedSections || []).slice(-5).reverse().map(id => ({
|
||||
id,
|
||||
title: map[id] || `章节 ${id}`
|
||||
}))
|
||||
this.setData({ recentChapters: recentList })
|
||||
},
|
||||
|
||||
// 初始化用户状态
|
||||
initUserStatus() {
|
||||
async initUserStatus() {
|
||||
const { isLoggedIn, userInfo, hasFullBook, purchasedSections } = app.globalData
|
||||
|
||||
|
||||
if (isLoggedIn && userInfo) {
|
||||
// 转换为对象数组
|
||||
const recentList = (purchasedSections || []).slice(-5).map(id => ({
|
||||
id: id,
|
||||
title: `章节 ${id}`
|
||||
const map = this.data.chapterMap
|
||||
const recentList = (purchasedSections || []).slice(-5).reverse().map(id => ({
|
||||
id,
|
||||
title: map[id] || `章节 ${id}`
|
||||
}))
|
||||
|
||||
// 截短用户ID显示
|
||||
|
||||
const userId = userInfo.id || ''
|
||||
const userIdShort = userId.length > 20 ? userId.slice(0, 10) + '...' + userId.slice(-6) : userId
|
||||
|
||||
// 获取微信号(优先显示)
|
||||
const userWechat = wx.getStorageSync('user_wechat') || userInfo.wechat || ''
|
||||
|
||||
|
||||
this.setData({
|
||||
isLoggedIn: true,
|
||||
userInfo,
|
||||
@@ -90,74 +116,58 @@ Page({
|
||||
recentChapters: recentList,
|
||||
totalReadTime: Math.floor(Math.random() * 200) + 50
|
||||
})
|
||||
|
||||
// 查询VIP状态
|
||||
this.loadVipStatus(userId)
|
||||
} else {
|
||||
this.setData({
|
||||
isLoggedIn: false,
|
||||
userInfo: null,
|
||||
userIdShort: '',
|
||||
purchasedCount: 0,
|
||||
referralCount: 0,
|
||||
earnings: 0,
|
||||
pendingEarnings: 0,
|
||||
recentChapters: []
|
||||
isLoggedIn: false, userInfo: null, userIdShort: '',
|
||||
purchasedCount: 0, referralCount: 0, earnings: 0, pendingEarnings: 0,
|
||||
recentChapters: [], isVip: false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 微信原生获取头像(button open-type="chooseAvatar" 回调)
|
||||
|
||||
// 查询VIP状态
|
||||
async loadVipStatus(userId) {
|
||||
try {
|
||||
const res = await app.request(`/api/vip/status?userId=${userId}`)
|
||||
if (res && res.success) {
|
||||
this.setData({
|
||||
isVip: res.data.isVip,
|
||||
vipExpireDate: res.data.expireDate || '',
|
||||
vipDaysRemaining: res.data.daysRemaining || 0,
|
||||
vipPrice: res.data.price || 1980
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[My] VIP状态查询失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 微信原生获取头像
|
||||
async onChooseAvatar(e) {
|
||||
const avatarUrl = e.detail.avatarUrl
|
||||
if (!avatarUrl) return
|
||||
|
||||
wx.showLoading({ title: '更新中...', mask: true })
|
||||
|
||||
try {
|
||||
const userInfo = this.data.userInfo
|
||||
userInfo.avatar = avatarUrl
|
||||
this.setData({ userInfo })
|
||||
app.globalData.userInfo = userInfo
|
||||
wx.setStorageSync('userInfo', userInfo)
|
||||
|
||||
// 同步到服务器
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: { userId: userInfo.id, avatar: avatarUrl }
|
||||
method: 'POST', data: { userId: userInfo.id, avatar: avatarUrl }
|
||||
})
|
||||
|
||||
wx.hideLoading()
|
||||
wx.showToast({ title: '头像已获取', icon: 'success' })
|
||||
} catch (e) {
|
||||
wx.hideLoading()
|
||||
console.log('同步头像失败', e)
|
||||
wx.showToast({ title: '头像已更新', icon: 'success' })
|
||||
}
|
||||
},
|
||||
|
||||
// 微信原生获取昵称(input type="nickname" 回调)
|
||||
async onNicknameInput(e) {
|
||||
const nickname = e.detail.value
|
||||
if (!nickname || nickname === this.data.userInfo?.nickname) return
|
||||
|
||||
try {
|
||||
const userInfo = this.data.userInfo
|
||||
userInfo.nickname = nickname
|
||||
this.setData({ userInfo })
|
||||
app.globalData.userInfo = userInfo
|
||||
wx.setStorageSync('userInfo', userInfo)
|
||||
|
||||
// 同步到服务器
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: { userId: userInfo.id, nickname }
|
||||
})
|
||||
|
||||
wx.showToast({ title: '昵称已获取', icon: 'success' })
|
||||
} catch (e) {
|
||||
console.log('同步昵称失败', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 点击昵称修改(备用)
|
||||
|
||||
// 点击昵称修改
|
||||
editNickname() {
|
||||
wx.showModal({
|
||||
title: '修改昵称',
|
||||
@@ -167,69 +177,36 @@ Page({
|
||||
if (res.confirm && res.content) {
|
||||
const newNickname = res.content.trim()
|
||||
if (newNickname.length < 1 || newNickname.length > 20) {
|
||||
wx.showToast({ title: '昵称1-20个字符', icon: 'none' })
|
||||
return
|
||||
wx.showToast({ title: '昵称1-20个字符', icon: 'none' }); return
|
||||
}
|
||||
|
||||
// 更新本地
|
||||
const userInfo = this.data.userInfo
|
||||
userInfo.nickname = newNickname
|
||||
this.setData({ userInfo })
|
||||
app.globalData.userInfo = userInfo
|
||||
wx.setStorageSync('userInfo', userInfo)
|
||||
|
||||
// 同步到服务器
|
||||
try {
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: { userId: userInfo.id, nickname: newNickname }
|
||||
method: 'POST', data: { userId: userInfo.id, nickname: newNickname }
|
||||
})
|
||||
} catch (e) {
|
||||
console.log('同步昵称到服务器失败', e)
|
||||
}
|
||||
|
||||
} catch (e) { console.log('同步昵称失败', e) }
|
||||
wx.showToast({ title: '昵称已更新', icon: 'success' })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 复制用户ID
|
||||
|
||||
copyUserId() {
|
||||
const userId = this.data.userInfo?.id || ''
|
||||
if (!userId) {
|
||||
wx.showToast({ title: '暂无ID', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.setClipboardData({
|
||||
data: userId,
|
||||
success: () => {
|
||||
wx.showToast({ title: 'ID已复制', icon: 'success' })
|
||||
}
|
||||
})
|
||||
if (!userId) { wx.showToast({ title: '暂无ID', icon: 'none' }); return }
|
||||
wx.setClipboardData({ data: userId, success: () => wx.showToast({ title: 'ID已复制', icon: 'success' }) })
|
||||
},
|
||||
|
||||
// 切换Tab
|
||||
switchTab(e) {
|
||||
const tab = e.currentTarget.dataset.tab
|
||||
this.setData({ activeTab: tab })
|
||||
},
|
||||
switchTab(e) { this.setData({ activeTab: e.currentTarget.dataset.tab }) },
|
||||
showLogin() { this.setData({ showLoginModal: true }) },
|
||||
closeLoginModal() { if (!this.data.isLoggingIn) this.setData({ showLoginModal: false }) },
|
||||
|
||||
// 显示登录弹窗
|
||||
showLogin() {
|
||||
this.setData({ showLoginModal: true })
|
||||
},
|
||||
|
||||
// 关闭登录弹窗
|
||||
closeLoginModal() {
|
||||
if (this.data.isLoggingIn) return
|
||||
this.setData({ showLoginModal: false })
|
||||
},
|
||||
|
||||
// 微信登录
|
||||
async handleWechatLogin() {
|
||||
this.setData({ isLoggingIn: true })
|
||||
|
||||
try {
|
||||
const result = await app.login()
|
||||
if (result) {
|
||||
@@ -240,24 +217,13 @@ Page({
|
||||
wx.showToast({ title: '登录失败,请重试', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('微信登录错误:', e)
|
||||
wx.showToast({ title: '登录失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ isLoggingIn: false })
|
||||
}
|
||||
} finally { this.setData({ isLoggingIn: false }) }
|
||||
},
|
||||
|
||||
// 手机号登录(需要用户授权)
|
||||
async handlePhoneLogin(e) {
|
||||
// 检查是否有授权code
|
||||
if (!e.detail.code) {
|
||||
// 用户拒绝授权或获取失败,尝试使用微信登录
|
||||
console.log('手机号授权失败,尝试微信登录')
|
||||
return this.handleWechatLogin()
|
||||
}
|
||||
|
||||
if (!e.detail.code) return this.handleWechatLogin()
|
||||
this.setData({ isLoggingIn: true })
|
||||
|
||||
try {
|
||||
const result = await app.loginWithPhone(e.detail.code)
|
||||
if (result) {
|
||||
@@ -268,39 +234,26 @@ Page({
|
||||
wx.showToast({ title: '登录失败,请重试', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('手机号登录错误:', e)
|
||||
wx.showToast({ title: '登录失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ isLoggingIn: false })
|
||||
}
|
||||
} finally { this.setData({ isLoggingIn: false }) }
|
||||
},
|
||||
|
||||
// 点击菜单
|
||||
handleMenuTap(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
|
||||
if (!this.data.isLoggedIn && id !== 'about') {
|
||||
this.showLogin()
|
||||
return
|
||||
}
|
||||
|
||||
const routes = {
|
||||
orders: '/pages/purchases/purchases',
|
||||
referral: '/pages/referral/referral',
|
||||
about: '/pages/about/about'
|
||||
}
|
||||
|
||||
if (routes[id]) {
|
||||
wx.navigateTo({ url: routes[id] })
|
||||
}
|
||||
if (!this.data.isLoggedIn && id !== 'about') { this.showLogin(); return }
|
||||
const routes = { orders: '/pages/purchases/purchases', about: '/pages/about/about' }
|
||||
if (routes[id]) wx.navigateTo({ url: routes[id] })
|
||||
},
|
||||
|
||||
// 跳转VIP页面
|
||||
goToVip() {
|
||||
if (!this.data.isLoggedIn) { this.showLogin(); return }
|
||||
wx.navigateTo({ url: '/pages/vip/vip' })
|
||||
},
|
||||
|
||||
// 绑定微信号
|
||||
bindWechat() {
|
||||
wx.showModal({
|
||||
title: '绑定微信号',
|
||||
editable: true,
|
||||
placeholderText: '请输入微信号',
|
||||
title: '绑定微信号', editable: true, placeholderText: '请输入微信号',
|
||||
success: async (res) => {
|
||||
if (res.confirm && res.content) {
|
||||
const wechat = res.content.trim()
|
||||
@@ -313,24 +266,18 @@ Page({
|
||||
app.globalData.userInfo = userInfo
|
||||
wx.setStorageSync('userInfo', userInfo)
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: { userId: userInfo.id, wechat }
|
||||
method: 'POST', data: { userId: userInfo.id, wechat }
|
||||
})
|
||||
wx.showToast({ title: '绑定成功', icon: 'success' })
|
||||
} catch (e) {
|
||||
console.log('绑定微信号失败', e)
|
||||
wx.showToast({ title: '已保存到本地', icon: 'success' })
|
||||
}
|
||||
} catch (e) { wx.showToast({ title: '已保存到本地', icon: 'success' }) }
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 清除缓存
|
||||
clearCache() {
|
||||
wx.showModal({
|
||||
title: '清除缓存',
|
||||
content: '确定要清除本地缓存吗?不会影响账号数据',
|
||||
title: '清除缓存', content: '确定要清除本地缓存吗?不会影响账号数据',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
const userInfo = wx.getStorageSync('userInfo')
|
||||
@@ -344,41 +291,14 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转到阅读页
|
||||
goToRead(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({ url: `/pages/read/read?id=${id}` })
|
||||
},
|
||||
goToRead(e) { wx.navigateTo({ url: `/pages/read/read?id=${e.currentTarget.dataset.id}` }) },
|
||||
goToChapters() { wx.switchTab({ url: '/pages/chapters/chapters' }) },
|
||||
goToAbout() { wx.navigateTo({ url: '/pages/about/about' }) },
|
||||
goToMatch() { wx.switchTab({ url: '/pages/match/match' }) },
|
||||
|
||||
// 跳转到目录
|
||||
goToChapters() {
|
||||
wx.switchTab({ url: '/pages/chapters/chapters' })
|
||||
},
|
||||
|
||||
// 跳转到关于页
|
||||
goToAbout() {
|
||||
wx.navigateTo({ url: '/pages/about/about' })
|
||||
},
|
||||
|
||||
// 跳转到匹配
|
||||
goToMatch() {
|
||||
wx.switchTab({ url: '/pages/match/match' })
|
||||
},
|
||||
|
||||
// 跳转到推广中心
|
||||
goToReferral() {
|
||||
if (!this.data.isLoggedIn) {
|
||||
this.showLogin()
|
||||
return
|
||||
}
|
||||
wx.navigateTo({ url: '/pages/referral/referral' })
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
handleLogout() {
|
||||
wx.showModal({
|
||||
title: '退出登录',
|
||||
content: '确定要退出登录吗?',
|
||||
title: '退出登录', content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
app.logout()
|
||||
@@ -389,6 +309,5 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 阻止冒泡
|
||||
stopPropagation() {}
|
||||
})
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<!--pages/my/my.wxml-->
|
||||
<!--Soul创业实验 - 我的页面 1:1还原Web版本-->
|
||||
<!--Soul创业实验 - 我的页面-->
|
||||
<view class="page page-transition">
|
||||
<!-- 自定义导航栏 -->
|
||||
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
|
||||
<view class="nav-content">
|
||||
<text class="nav-title brand-color">我的</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 导航栏占位 -->
|
||||
<view class="nav-placeholder" style="height: {{statusBarHeight + 44}}px;"></view>
|
||||
|
||||
<!-- 用户卡片 - 未登录状态 - 只显示登录提示 -->
|
||||
<!-- 未登录 -->
|
||||
<view class="user-card card-gradient login-card" wx:if="{{!isLoggedIn}}">
|
||||
<view class="login-prompt">
|
||||
<view class="login-icon-large">🔐</view>
|
||||
@@ -24,22 +20,21 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 用户卡片 - 已登录状态 -->
|
||||
<!-- 已登录 - 用户卡片 -->
|
||||
<view class="user-card card-gradient" wx:else>
|
||||
<view class="user-header-row">
|
||||
<!-- 头像 - 点击选择头像 -->
|
||||
<button class="avatar-btn-simple" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
|
||||
<view class="avatar">
|
||||
<view class="avatar {{isVip ? 'avatar-vip' : 'avatar-normal'}}">
|
||||
<image class="avatar-img" wx:if="{{userInfo.avatar}}" src="{{userInfo.avatar}}" mode="aspectFill"/>
|
||||
<text class="avatar-text" wx:else>{{userInfo.nickname[0] || '微'}}</text>
|
||||
<view class="vip-badge" wx:if="{{isVip}}">VIP</view>
|
||||
</view>
|
||||
</button>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<view class="user-info-block">
|
||||
<view class="user-name-row">
|
||||
<text class="user-name" bindtap="editNickname">{{userInfo.nickname || '点击设置昵称'}}</text>
|
||||
<text class="edit-icon-small">✎</text>
|
||||
<view class="vip-tag" wx:if="{{isVip}}">创业伙伴</view>
|
||||
</view>
|
||||
<view class="user-id-row" bindtap="copyUserId">
|
||||
<text class="user-id">{{userWechat ? '微信: ' + userWechat : 'ID: ' + userIdShort}}</text>
|
||||
@@ -47,7 +42,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="stats-grid">
|
||||
<view class="stat-item">
|
||||
<text class="stat-value brand-color">{{purchasedCount}}</text>
|
||||
@@ -58,62 +53,64 @@
|
||||
<text class="stat-label">推荐好友</text>
|
||||
</view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value gold-color">{{earnings > 0 ? '¥' + earnings : '--'}}</text>
|
||||
<text class="stat-label">待领收益</text>
|
||||
<text class="stat-value gold-color">{{pendingEarnings > 0 ? '¥' + pendingEarnings : '--'}}</text>
|
||||
<text class="stat-label">我的收益</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- Tab切换 - 仅登录用户显示 -->
|
||||
<view class="tab-bar-custom" wx:if="{{isLoggedIn}}">
|
||||
<view
|
||||
class="tab-item {{activeTab === 'overview' ? 'tab-active' : ''}}"
|
||||
bindtap="switchTab"
|
||||
data-tab="overview"
|
||||
>概览</view>
|
||||
<view
|
||||
class="tab-item {{activeTab === 'footprint' ? 'tab-active' : ''}}"
|
||||
bindtap="switchTab"
|
||||
data-tab="footprint"
|
||||
>
|
||||
<text class="tab-icon">👣</text>
|
||||
<text>我的足迹</text>
|
||||
<!-- VIP入口卡片 -->
|
||||
<view class="vip-card" wx:if="{{isLoggedIn}}" bindtap="goToVip">
|
||||
<view class="vip-card-inner" wx:if="{{!isVip}}">
|
||||
<view class="vip-card-left">
|
||||
<text class="vip-card-icon">👑</text>
|
||||
<view class="vip-card-info">
|
||||
<text class="vip-card-title">开通VIP会员</text>
|
||||
<text class="vip-card-desc">解锁全部章节 · 匹配创业伙伴</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip-card-price">
|
||||
<text class="vip-price-num">¥{{vipPrice}}</text>
|
||||
<text class="vip-price-unit">/年</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip-card-inner vip-active" wx:else>
|
||||
<view class="vip-card-left">
|
||||
<text class="vip-card-icon">👑</text>
|
||||
<view class="vip-card-info">
|
||||
<text class="vip-card-title gold-color">VIP会员</text>
|
||||
<text class="vip-card-desc">剩余 {{vipDaysRemaining}} 天</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="vip-manage-btn">管理 →</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Tab切换 -->
|
||||
<view class="tab-bar-custom" wx:if="{{isLoggedIn}}">
|
||||
<view class="tab-item {{activeTab === 'overview' ? 'tab-active' : ''}}" bindtap="switchTab" data-tab="overview">概览</view>
|
||||
<view class="tab-item {{activeTab === 'footprint' ? 'tab-active' : ''}}" bindtap="switchTab" data-tab="footprint">
|
||||
<text class="tab-icon">👣</text><text>我的足迹</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 概览内容 - 仅登录用户显示 -->
|
||||
<!-- 概览内容 -->
|
||||
<view class="tab-content" wx:if="{{activeTab === 'overview' && isLoggedIn}}">
|
||||
<!-- 菜单列表 -->
|
||||
<view class="menu-card card">
|
||||
<view
|
||||
class="menu-item"
|
||||
wx:for="{{menuList}}"
|
||||
wx:key="id"
|
||||
bindtap="handleMenuTap"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<view class="menu-item" wx:for="{{menuList}}" wx:key="id" bindtap="handleMenuTap" data-id="{{item.id}}">
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon {{item.iconBg === 'brand' ? 'icon-brand' : item.iconBg === 'gray' ? 'icon-gray' : ''}}">
|
||||
{{item.icon}}
|
||||
</view>
|
||||
<view class="menu-icon {{item.iconBg === 'brand' ? 'icon-brand' : ''}}">{{item.icon}}</view>
|
||||
<text class="menu-title">{{item.title}}</text>
|
||||
</view>
|
||||
<view class="menu-right">
|
||||
<text class="menu-count" wx:if="{{item.count !== undefined}}">{{item.count}}笔</text>
|
||||
<text class="menu-badge gold-color" wx:if="{{item.badge}}">{{item.badge}}</text>
|
||||
<text class="menu-arrow">→</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 账号设置 -->
|
||||
<view class="settings-card card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">⚙️</text>
|
||||
<text>账号设置</text>
|
||||
</view>
|
||||
<view class="card-title"><text class="title-icon">⚙️</text><text>账号设置</text></view>
|
||||
<view class="settings-list">
|
||||
<view class="settings-item" bindtap="bindWechat">
|
||||
<text class="settings-label">绑定微信号</text>
|
||||
@@ -135,12 +132,8 @@
|
||||
|
||||
<!-- 足迹内容 -->
|
||||
<view class="tab-content" wx:if="{{activeTab === 'footprint' && isLoggedIn}}">
|
||||
<!-- 阅读统计 -->
|
||||
<view class="stats-card card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">👁️</text>
|
||||
<text>阅读统计</text>
|
||||
</view>
|
||||
<view class="card-title"><text class="title-icon">👁️</text><text>阅读统计</text></view>
|
||||
<view class="stats-row">
|
||||
<view class="stat-box">
|
||||
<text class="stat-icon brand-color">📖</text>
|
||||
@@ -160,20 +153,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 最近阅读 -->
|
||||
<view class="recent-card card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">📖</text>
|
||||
<text>最近阅读</text>
|
||||
</view>
|
||||
<view class="card-title"><text class="title-icon">📖</text><text>最近阅读</text></view>
|
||||
<view class="recent-list" wx:if="{{recentChapters.length > 0}}">
|
||||
<view
|
||||
class="recent-item"
|
||||
wx:for="{{recentChapters}}"
|
||||
wx:key="id"
|
||||
bindtap="goToRead"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<view class="recent-item" wx:for="{{recentChapters}}" wx:key="id" bindtap="goToRead" data-id="{{item.id}}">
|
||||
<view class="recent-left">
|
||||
<text class="recent-index">{{index + 1}}</text>
|
||||
<text class="recent-title">{{item.title}}</text>
|
||||
@@ -188,12 +171,8 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 匹配记录 -->
|
||||
<view class="match-card card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">👥</text>
|
||||
<text>匹配记录</text>
|
||||
</view>
|
||||
<view class="card-title"><text class="title-icon">👥</text><text>匹配记录</text></view>
|
||||
<view class="empty-state">
|
||||
<text class="empty-icon">👥</text>
|
||||
<text class="empty-text">暂无匹配记录</text>
|
||||
@@ -202,27 +181,20 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 登录弹窗 - 只保留微信登录 -->
|
||||
<!-- 登录弹窗 -->
|
||||
<view class="modal-overlay" wx:if="{{showLoginModal}}" bindtap="closeLoginModal">
|
||||
<view class="modal-content" catchtap="stopPropagation">
|
||||
<view class="modal-close" bindtap="closeLoginModal">✕</view>
|
||||
<view class="login-icon">🔐</view>
|
||||
<text class="login-title">登录 Soul创业实验</text>
|
||||
<text class="login-desc">登录后可购买章节、解锁更多内容</text>
|
||||
|
||||
<button
|
||||
class="btn-wechat"
|
||||
bindtap="handleWechatLogin"
|
||||
disabled="{{isLoggingIn}}"
|
||||
>
|
||||
<button class="btn-wechat" bindtap="handleWechatLogin" disabled="{{isLoggingIn}}">
|
||||
<text class="btn-wechat-icon">微</text>
|
||||
<text>{{isLoggingIn ? '登录中...' : '微信快捷登录'}}</text>
|
||||
</button>
|
||||
|
||||
<text class="login-notice">登录即表示同意《用户协议》和《隐私政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部留白 -->
|
||||
<view class="bottom-space"></view>
|
||||
</view>
|
||||
|
||||
@@ -1042,3 +1042,94 @@
|
||||
color: #ff4d4f;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* === VIP 头像标识 === */
|
||||
.avatar-normal {
|
||||
border: 4rpx solid rgba(255,255,255,0.2);
|
||||
}
|
||||
.avatar-vip {
|
||||
border: 4rpx solid #FFD700;
|
||||
box-shadow: 0 0 16rpx rgba(255,215,0,0.5);
|
||||
position: relative;
|
||||
}
|
||||
.vip-badge {
|
||||
position: absolute;
|
||||
bottom: -4rpx;
|
||||
right: -4rpx;
|
||||
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||
color: #000;
|
||||
font-size: 18rpx;
|
||||
font-weight: bold;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 12rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.vip-tag {
|
||||
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||
color: #000;
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
|
||||
/* === VIP入口卡片 === */
|
||||
.vip-card {
|
||||
margin: 16rpx 24rpx;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.vip-card-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 28rpx;
|
||||
background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,165,0,0.08));
|
||||
border: 1rpx solid rgba(255,215,0,0.25);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.vip-card-inner.vip-active {
|
||||
background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.12));
|
||||
border-color: rgba(255,215,0,0.4);
|
||||
}
|
||||
.vip-card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.vip-card-icon {
|
||||
font-size: 44rpx;
|
||||
}
|
||||
.vip-card-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.vip-card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: rgba(255,255,255,0.95);
|
||||
}
|
||||
.vip-card-desc {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255,255,255,0.5);
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.vip-card-price {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
.vip-price-num {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #FFD700;
|
||||
}
|
||||
.vip-price-unit {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255,215,0,0.7);
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
.vip-manage-btn {
|
||||
font-size: 26rpx;
|
||||
color: #FFD700;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ Page({
|
||||
phoneNumber: '',
|
||||
wechatId: '',
|
||||
alipayAccount: '',
|
||||
address: '',
|
||||
|
||||
// 自动提现(默认开启)
|
||||
autoWithdrawEnabled: true,
|
||||
@@ -47,7 +46,6 @@ Page({
|
||||
const phoneNumber = wx.getStorageSync('user_phone') || userInfo.phone || ''
|
||||
const wechatId = wx.getStorageSync('user_wechat') || userInfo.wechat || ''
|
||||
const alipayAccount = wx.getStorageSync('user_alipay') || userInfo.alipay || ''
|
||||
const address = wx.getStorageSync('user_address') || userInfo.address || ''
|
||||
// 默认开启自动提现
|
||||
const autoWithdrawEnabled = wx.getStorageSync('auto_withdraw_enabled') !== false
|
||||
|
||||
@@ -57,73 +55,11 @@ Page({
|
||||
phoneNumber,
|
||||
wechatId,
|
||||
alipayAccount,
|
||||
address,
|
||||
autoWithdrawEnabled
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 一键获取收货地址
|
||||
getAddress() {
|
||||
wx.chooseAddress({
|
||||
success: (res) => {
|
||||
console.log('[Settings] 获取地址成功:', res)
|
||||
const fullAddress = `${res.provinceName || ''}${res.cityName || ''}${res.countyName || ''}${res.detailInfo || ''}`
|
||||
|
||||
if (fullAddress.trim()) {
|
||||
wx.setStorageSync('user_address', fullAddress)
|
||||
this.setData({ address: fullAddress })
|
||||
|
||||
// 更新用户信息
|
||||
if (app.globalData.userInfo) {
|
||||
app.globalData.userInfo.address = fullAddress
|
||||
wx.setStorageSync('userInfo', app.globalData.userInfo)
|
||||
}
|
||||
|
||||
// 同步到服务器
|
||||
this.syncAddressToServer(fullAddress)
|
||||
|
||||
wx.showToast({ title: '地址已获取', icon: 'success' })
|
||||
}
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log('[Settings] 获取地址失败:', e)
|
||||
if (e.errMsg?.includes('cancel')) {
|
||||
// 用户取消,不提示
|
||||
return
|
||||
}
|
||||
if (e.errMsg?.includes('auth deny') || e.errMsg?.includes('authorize')) {
|
||||
wx.showModal({
|
||||
title: '需要授权',
|
||||
content: '请在设置中允许获取收货地址',
|
||||
confirmText: '去设置',
|
||||
success: (res) => {
|
||||
if (res.confirm) wx.openSetting()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({ title: '获取失败,请重试', icon: 'none' })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 同步地址到服务器
|
||||
async syncAddressToServer(address) {
|
||||
try {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (!userId) return
|
||||
|
||||
await app.request('/api/user/update', {
|
||||
method: 'POST',
|
||||
data: { userId, address }
|
||||
})
|
||||
console.log('[Settings] 地址已同步到服务器')
|
||||
} catch (e) {
|
||||
console.log('[Settings] 同步地址失败:', e)
|
||||
}
|
||||
},
|
||||
|
||||
// 切换自动提现
|
||||
async toggleAutoWithdraw(e) {
|
||||
const enabled = e.detail.value
|
||||
|
||||
@@ -58,20 +58,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址 - 微信一键获取 -->
|
||||
<view class="bind-item" bindtap="getAddress">
|
||||
<view class="bind-left">
|
||||
<view class="bind-icon address-icon">📍</view>
|
||||
<view class="bind-info">
|
||||
<text class="bind-label">收货地址</text>
|
||||
<text class="bind-value address-text">{{address || '未绑定'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bind-right">
|
||||
<text class="bind-check" wx:if="{{address}}">✓</text>
|
||||
<text class="bind-btn" wx:else>一键获取</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
107
miniprogram/pages/vip/vip.js
Normal file
107
miniprogram/pages/vip/vip.js
Normal file
@@ -0,0 +1,107 @@
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
statusBarHeight: 44,
|
||||
isVip: false,
|
||||
daysRemaining: 0,
|
||||
expireDateStr: '',
|
||||
price: 1980,
|
||||
rights: [],
|
||||
profile: { name: '', project: '', contact: '', bio: '' },
|
||||
purchasing: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
this.loadVipInfo()
|
||||
},
|
||||
|
||||
async loadVipInfo() {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (!userId) return
|
||||
try {
|
||||
const res = await app.request(`/api/vip/status?userId=${userId}`)
|
||||
if (res?.success) {
|
||||
const d = res.data
|
||||
let expStr = ''
|
||||
if (d.expireDate) {
|
||||
const dt = new Date(d.expireDate)
|
||||
expStr = `${dt.getFullYear()}-${String(dt.getMonth()+1).padStart(2,'0')}-${String(dt.getDate()).padStart(2,'0')}`
|
||||
}
|
||||
this.setData({
|
||||
isVip: d.isVip,
|
||||
daysRemaining: d.daysRemaining,
|
||||
expireDateStr: expStr,
|
||||
price: d.price || 1980,
|
||||
rights: d.rights || ['解锁全部章节内容(365天)','匹配所有创业伙伴','创业老板排行榜展示','专属VIP标识']
|
||||
})
|
||||
if (d.isVip) this.loadProfile(userId)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[VIP] 加载失败', e)
|
||||
this.setData({ rights: ['解锁全部章节内容(365天)','匹配所有创业伙伴','创业老板排行榜展示','专属VIP标识'] })
|
||||
}
|
||||
},
|
||||
|
||||
async loadProfile(userId) {
|
||||
try {
|
||||
const res = await app.request(`/api/vip/profile?userId=${userId}`)
|
||||
if (res?.success) this.setData({ profile: res.data })
|
||||
} catch (e) { console.log('[VIP] 资料加载失败', e) }
|
||||
},
|
||||
|
||||
async handlePurchase() {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (!userId) { wx.showToast({ title: '请先登录', icon: 'none' }); return }
|
||||
this.setData({ purchasing: true })
|
||||
try {
|
||||
const res = await app.request('/api/vip/purchase', { method: 'POST', data: { userId } })
|
||||
if (res?.success) {
|
||||
// 调用微信支付
|
||||
const payRes = await app.request('/api/miniprogram/pay', {
|
||||
method: 'POST',
|
||||
data: { orderSn: res.data.orderSn, openId: app.globalData.openId }
|
||||
})
|
||||
if (payRes?.success && payRes.payParams) {
|
||||
wx.requestPayment({
|
||||
...payRes.payParams,
|
||||
success: () => {
|
||||
wx.showToast({ title: 'VIP开通成功', icon: 'success' })
|
||||
this.loadVipInfo()
|
||||
},
|
||||
fail: () => wx.showToast({ title: '支付取消', icon: 'none' })
|
||||
})
|
||||
} else {
|
||||
wx.showToast({ title: '支付参数获取失败', icon: 'none' })
|
||||
}
|
||||
} else {
|
||||
wx.showToast({ title: res?.error || '创建订单失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[VIP] 购买失败', e)
|
||||
wx.showToast({ title: '购买失败', icon: 'none' })
|
||||
} finally { this.setData({ purchasing: false }) }
|
||||
},
|
||||
|
||||
onNameInput(e) { this.setData({ 'profile.name': e.detail.value }) },
|
||||
onProjectInput(e) { this.setData({ 'profile.project': e.detail.value }) },
|
||||
onContactInput(e) { this.setData({ 'profile.contact': e.detail.value }) },
|
||||
onBioInput(e) { this.setData({ 'profile.bio': e.detail.value }) },
|
||||
|
||||
async saveProfile() {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
if (!userId) return
|
||||
const p = this.data.profile
|
||||
try {
|
||||
const res = await app.request('/api/vip/profile', {
|
||||
method: 'POST',
|
||||
data: { userId, name: p.name, project: p.project, contact: p.contact, bio: p.bio }
|
||||
})
|
||||
if (res?.success) wx.showToast({ title: '资料已保存', icon: 'success' })
|
||||
else wx.showToast({ title: res?.error || '保存失败', icon: 'none' })
|
||||
} catch (e) { wx.showToast({ title: '保存失败', icon: 'none' }) }
|
||||
},
|
||||
|
||||
goBack() { wx.navigateBack() }
|
||||
})
|
||||
4
miniprogram/pages/vip/vip.json
Normal file
4
miniprogram/pages/vip/vip.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
60
miniprogram/pages/vip/vip.wxml
Normal file
60
miniprogram/pages/vip/vip.wxml
Normal file
@@ -0,0 +1,60 @@
|
||||
<!--VIP会员页-->
|
||||
<view class="page">
|
||||
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
|
||||
<view class="nav-back" bindtap="goBack"><text class="back-icon">‹</text></view>
|
||||
<text class="nav-title">VIP会员</text>
|
||||
<view class="nav-placeholder-r"></view>
|
||||
</view>
|
||||
<view style="height: {{statusBarHeight + 44}}px;"></view>
|
||||
|
||||
<!-- VIP状态卡片 -->
|
||||
<view class="vip-hero {{isVip ? 'vip-hero-active' : ''}}">
|
||||
<view class="vip-hero-icon">👑</view>
|
||||
<text class="vip-hero-title" wx:if="{{!isVip}}">开通VIP年度会员</text>
|
||||
<text class="vip-hero-title gold" wx:else>VIP会员</text>
|
||||
<text class="vip-hero-sub" wx:if="{{isVip}}">有效期至 {{expireDateStr}}(剩余{{daysRemaining}}天)</text>
|
||||
<text class="vip-hero-sub" wx:else>¥{{price}}/年 · 365天全部权益</text>
|
||||
</view>
|
||||
|
||||
<!-- 权益列表 -->
|
||||
<view class="rights-card">
|
||||
<text class="rights-title">会员权益</text>
|
||||
<view class="rights-list">
|
||||
<view class="rights-item" wx:for="{{rights}}" wx:key="*this">
|
||||
<text class="rights-check">✓</text>
|
||||
<text class="rights-text">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 购买按钮 -->
|
||||
<view class="buy-section" wx:if="{{!isVip}}">
|
||||
<button class="buy-btn" bindtap="handlePurchase" disabled="{{purchasing}}">
|
||||
{{purchasing ? '处理中...' : '立即开通 ¥' + price}}
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- VIP资料填写(仅VIP可见) -->
|
||||
<view class="profile-card" wx:if="{{isVip}}">
|
||||
<text class="profile-title">会员资料(展示在创业老板排行)</text>
|
||||
<view class="form-group">
|
||||
<text class="form-label">姓名</text>
|
||||
<input class="form-input" placeholder="您的真实姓名" value="{{profile.name}}" bindinput="onNameInput"/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">项目名称</text>
|
||||
<input class="form-input" placeholder="您的项目/公司名称" value="{{profile.project}}" bindinput="onProjectInput"/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">联系方式</text>
|
||||
<input class="form-input" placeholder="微信号或手机号" value="{{profile.contact}}" bindinput="onContactInput"/>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">一句话简介</text>
|
||||
<input class="form-input" placeholder="简要描述您的业务" value="{{profile.bio}}" bindinput="onBioInput"/>
|
||||
</view>
|
||||
<button class="save-btn" bindtap="saveProfile">保存资料</button>
|
||||
</view>
|
||||
|
||||
<view class="bottom-space"></view>
|
||||
</view>
|
||||
38
miniprogram/pages/vip/vip.wxss
Normal file
38
miniprogram/pages/vip/vip.wxss
Normal file
@@ -0,0 +1,38 @@
|
||||
.page { background: #000; min-height: 100vh; color: #fff; }
|
||||
.nav-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 24rpx; background: rgba(0,0,0,0.9); }
|
||||
.nav-back { width: 60rpx; height: 60rpx; display: flex; align-items: center; justify-content: center; }
|
||||
.back-icon { font-size: 44rpx; color: #fff; }
|
||||
.nav-title { font-size: 34rpx; font-weight: 600; color: #fff; }
|
||||
.nav-placeholder-r { width: 60rpx; }
|
||||
|
||||
.vip-hero {
|
||||
margin: 24rpx; padding: 48rpx 32rpx; text-align: center;
|
||||
background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,165,0,0.06));
|
||||
border: 1rpx solid rgba(255,215,0,0.2); border-radius: 24rpx;
|
||||
}
|
||||
.vip-hero-active { border-color: rgba(255,215,0,0.5); background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(255,165,0,0.1)); }
|
||||
.vip-hero-icon { font-size: 80rpx; }
|
||||
.vip-hero-title { display: block; font-size: 40rpx; font-weight: bold; color: #fff; margin-top: 16rpx; }
|
||||
.vip-hero-title.gold { color: #FFD700; }
|
||||
.vip-hero-sub { display: block; font-size: 26rpx; color: rgba(255,255,255,0.5); margin-top: 12rpx; }
|
||||
|
||||
.rights-card { margin: 24rpx; padding: 28rpx; background: #1c1c1e; border-radius: 20rpx; }
|
||||
.rights-title { font-size: 30rpx; font-weight: 600; color: rgba(255,255,255,0.9); }
|
||||
.rights-list { margin-top: 20rpx; }
|
||||
.rights-item { display: flex; align-items: center; gap: 16rpx; padding: 16rpx 0; border-bottom: 1rpx solid rgba(255,255,255,0.06); }
|
||||
.rights-item:last-child { border-bottom: none; }
|
||||
.rights-check { color: #00CED1; font-size: 28rpx; font-weight: bold; }
|
||||
.rights-text { font-size: 28rpx; color: rgba(255,255,255,0.8); }
|
||||
|
||||
.buy-section { padding: 32rpx 24rpx; }
|
||||
.buy-btn { width: 100%; height: 88rpx; line-height: 88rpx; background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; font-size: 32rpx; font-weight: bold; border-radius: 44rpx; border: none; }
|
||||
.buy-btn[disabled] { opacity: 0.5; }
|
||||
|
||||
.profile-card { margin: 24rpx; padding: 28rpx; background: #1c1c1e; border-radius: 20rpx; }
|
||||
.profile-title { font-size: 30rpx; font-weight: 600; color: rgba(255,255,255,0.9); display: block; margin-bottom: 24rpx; }
|
||||
.form-group { margin-bottom: 20rpx; }
|
||||
.form-label { font-size: 24rpx; color: rgba(255,255,255,0.5); display: block; margin-bottom: 8rpx; }
|
||||
.form-input { background: rgba(255,255,255,0.06); border: 1rpx solid rgba(255,255,255,0.1); border-radius: 12rpx; padding: 16rpx 20rpx; font-size: 28rpx; color: #fff; }
|
||||
.save-btn { margin-top: 24rpx; width: 100%; height: 80rpx; line-height: 80rpx; background: #00CED1; color: #000; font-size: 30rpx; font-weight: 600; border-radius: 40rpx; border: none; }
|
||||
|
||||
.bottom-space { height: 120rpx; }
|
||||
@@ -20,8 +20,10 @@ CONFIG = {
|
||||
'desc': 'Soul创业派对 - 首次发布',
|
||||
}
|
||||
|
||||
# 微信开发者工具CLI可能的路径
|
||||
# 微信开发者工具CLI可能的路径(Mac 优先,再 Windows)
|
||||
CLI_PATHS = [
|
||||
'/Applications/wechatwebdevtools.app/Contents/MacOS/cli',
|
||||
os.path.expanduser('~/Applications/wechatwebdevtools.app/Contents/MacOS/cli'),
|
||||
r"D:\微信web开发者工具\cli.bat",
|
||||
r"C:\Program Files (x86)\Tencent\微信web开发者工具\cli.bat",
|
||||
r"C:\Program Files\Tencent\微信web开发者工具\cli.bat",
|
||||
|
||||
Reference in New Issue
Block a user