更新文档,新增输入框样式最佳实践,强调在小程序和管理端开发中使用容器包裹输入框以避免布局问题。调整经验库,记录相关最佳实践和开发进度,确保团队共享经验的一致性和可追溯性。优化小程序页面,增加分享功能,提升用户体验。
This commit is contained in:
@@ -40,6 +40,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight
|
||||
})
|
||||
@@ -85,5 +86,10 @@ Page({
|
||||
title: 'Soul创业派对 - 关于',
|
||||
path: ref ? `/pages/about/about?ref=${ref}` : '/pages/about/about'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 关于', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -14,6 +14,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -127,5 +128,10 @@ Page({
|
||||
title: 'Soul创业派对 - 地址管理',
|
||||
path: ref ? `/pages/addresses/addresses?ref=${ref}` : '/pages/addresses/addresses'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 地址管理', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -27,6 +27,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -205,5 +206,10 @@ Page({
|
||||
title: 'Soul创业派对 - 编辑地址',
|
||||
path: ref ? `/pages/addresses/edit?ref=${ref}` : '/pages/addresses/edit'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 编辑地址', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -25,5 +26,10 @@ Page({
|
||||
title: 'Soul创业派对 - 用户协议',
|
||||
path: ref ? `/pages/agreement/agreement?ref=${ref}` : '/pages/agreement/agreement'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 用户协议', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -206,6 +206,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
navBarHeight: app.globalData.navBarHeight
|
||||
@@ -302,5 +303,10 @@ Page({
|
||||
title: 'Soul创业派对 - 目录',
|
||||
path: ref ? `/pages/chapters/chapters?ref=${ref}` : '/pages/chapters/chapters'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 真实商业故事', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -45,6 +45,7 @@ Page({
|
||||
|
||||
// 超级个体(VIP会员)
|
||||
superMembers: [],
|
||||
superMembersLoading: true,
|
||||
|
||||
// 最新新增章节
|
||||
latestChapters: [],
|
||||
@@ -71,7 +72,7 @@ Page({
|
||||
app.handleReferralCode({ query: options })
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.initData()
|
||||
},
|
||||
|
||||
@@ -119,6 +120,7 @@ Page({
|
||||
},
|
||||
|
||||
async loadSuperMembers() {
|
||||
this.setData({ superMembersLoading: true })
|
||||
try {
|
||||
// 优先加载 VIP 会员(购买 1980 fullbook/vip 订单的用户)
|
||||
let members = []
|
||||
@@ -128,8 +130,8 @@ Page({
|
||||
// 不再过滤无头像用户,无头像时用首字母展示
|
||||
members = (Array.isArray(res.data) ? res.data : []).slice(0, 4).map(u => ({
|
||||
id: u.id,
|
||||
name: u.vip_name || u.nickname || '会员',
|
||||
avatar: u.vip_avatar || u.avatar || '',
|
||||
name: u.vipName || u.vip_name || u.nickname || '会员',
|
||||
avatar: u.vipAvatar || u.vip_avatar || u.avatar || '',
|
||||
isVip: true
|
||||
}))
|
||||
if (members.length > 0) {
|
||||
@@ -153,8 +155,11 @@ Page({
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
this.setData({ superMembers: members })
|
||||
} catch (e) { console.log('[Index] 加载超级个体失败:', e) }
|
||||
this.setData({ superMembers: members, superMembersLoading: false })
|
||||
} catch (e) {
|
||||
console.log('[Index] 加载超级个体失败:', e)
|
||||
this.setData({ superMembersLoading: false })
|
||||
}
|
||||
},
|
||||
|
||||
// 从服务端获取精选推荐(加权算法:阅读量50% + 时效30% + 付款率20%)和最新更新
|
||||
@@ -336,5 +341,10 @@ Page({
|
||||
title: 'Soul创业派对 - 真实商业故事',
|
||||
path: ref ? `/pages/index/index?ref=${ref}` : '/pages/index/index'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 真实商业故事', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -90,7 +90,17 @@
|
||||
<text class="more-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view wx:if="{{superMembers.length > 0}}" class="super-scroll" scroll-x>
|
||||
<!-- 加载中:骨架动画 -->
|
||||
<view wx:if="{{superMembersLoading}}" class="super-loading">
|
||||
<view class="super-loading-inner">
|
||||
<view class="super-loading-item" wx:for="{{[1,2,3,4]}}" wx:key="*this">
|
||||
<view class="super-loading-avatar"></view>
|
||||
<view class="super-loading-name"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 已加载有数据 -->
|
||||
<scroll-view wx:elif="{{superMembers.length > 0}}" class="super-scroll" scroll-x>
|
||||
<view class="super-scroll-inner">
|
||||
<view
|
||||
class="super-item-h"
|
||||
@@ -107,7 +117,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="super-empty" wx:else>
|
||||
<!-- 已加载无数据 -->
|
||||
<view wx:else class="super-empty">
|
||||
<text class="super-empty-text">成为会员,展示你的项目</text>
|
||||
<view class="super-empty-btn" bindtap="goToVip">加入创业派对 →</view>
|
||||
</view>
|
||||
|
||||
@@ -547,6 +547,45 @@
|
||||
}
|
||||
|
||||
/* ===== 超级个体(横向滚动) ===== */
|
||||
/* 加载骨架动画 */
|
||||
.super-loading {
|
||||
width: 100%;
|
||||
margin: 0 -32rpx;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
.super-loading-inner {
|
||||
display: flex;
|
||||
gap: 32rpx;
|
||||
padding-bottom: 16rpx;
|
||||
}
|
||||
.super-loading-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
min-width: 140rpx;
|
||||
}
|
||||
.super-loading-avatar {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: super-shimmer 1.2s ease-in-out infinite;
|
||||
}
|
||||
.super-loading-name {
|
||||
width: 80rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: super-shimmer 1.2s ease-in-out infinite 0.2s;
|
||||
}
|
||||
@keyframes super-shimmer {
|
||||
0% { background-position: 100% 0; }
|
||||
100% { background-position: -100% 0; }
|
||||
}
|
||||
|
||||
.super-scroll {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
|
||||
@@ -72,6 +72,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -667,5 +668,10 @@ Page({
|
||||
title: 'Soul创业派对 - 找伙伴',
|
||||
path: ref ? `/pages/match/match?ref=${ref}` : '/pages/match/match'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 找伙伴', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -11,6 +11,7 @@ Page({
|
||||
data: { statusBarHeight: 44, member: null, loading: true },
|
||||
|
||||
onLoad(options) {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
if (options.id) this.loadMember(options.id)
|
||||
},
|
||||
@@ -30,10 +31,10 @@ Page({
|
||||
const u = Array.isArray(dbRes.data) ? dbRes.data[0] : dbRes.data
|
||||
if (u) {
|
||||
this.setData({ member: this.enrichAndFormat({
|
||||
id: u.id, name: u.vip_name || u.nickname || '创业者',
|
||||
avatar: u.vip_avatar || u.avatar || '', isVip: u.is_vip === 1,
|
||||
contactRaw: u.vip_contact || u.phone || '', project: u.vip_project || '',
|
||||
bio: u.vip_bio || '', mbti: '', region: '', skills: '',
|
||||
id: u.id, name: u.vipName || u.vip_name || u.nickname || '创业者',
|
||||
avatar: u.vipAvatar || u.vip_avatar || u.avatar || '', isVip: u.is_vip === 1,
|
||||
contactRaw: u.vipContact || u.vip_contact || u.phone || '', project: u.vipProject || u.vip_project || '',
|
||||
bio: u.vipBio || u.vip_bio || '', mbti: '', region: '', skills: '',
|
||||
}), loading: false })
|
||||
return
|
||||
}
|
||||
@@ -48,19 +49,19 @@ Page({
|
||||
|
||||
const merged = {
|
||||
id: raw.id,
|
||||
name: raw.name || raw.vip_name || raw.nickname || '创业者',
|
||||
avatar: raw.avatar || raw.vip_avatar || '',
|
||||
name: raw.name || raw.vipName || raw.vip_name || raw.nickname || '创业者',
|
||||
avatar: raw.avatar || raw.vipAvatar || raw.vip_avatar || '',
|
||||
isVip: raw.isVip || raw.is_vip === 1,
|
||||
mbti: raw.mbti || mock.mbti,
|
||||
region: raw.region || mock.region,
|
||||
skills: raw.skills || mock.skills,
|
||||
contactRaw: raw.contactRaw || raw.vip_contact || mock.contactRaw,
|
||||
contactRaw: raw.contactRaw || raw.vipContact || raw.vip_contact || mock.contactRaw,
|
||||
bestMonth: raw.bestMonth || mock.bestMonth,
|
||||
achievement: raw.achievement || mock.achievement,
|
||||
turningPoint: raw.turningPoint || mock.turningPoint,
|
||||
canHelp: raw.canHelp || mock.canHelp,
|
||||
needHelp: raw.needHelp || mock.needHelp,
|
||||
project: raw.project || raw.vip_project || mock.project
|
||||
project: raw.project || raw.vipProject || raw.vip_project || mock.project
|
||||
}
|
||||
|
||||
const contact = merged.contactRaw || ''
|
||||
@@ -96,5 +97,12 @@ Page({
|
||||
title: 'Soul创业派对 - 创业者详情',
|
||||
path: id && ref ? `/pages/member-detail/member-detail?id=${id}&ref=${ref}` : id ? `/pages/member-detail/member-detail?id=${id}` : ref ? `/pages/member-detail/member-detail?ref=${ref}` : '/pages/member-detail/member-detail'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
const id = this.data.member?.id
|
||||
const q = id ? (ref ? `id=${id}&ref=${ref}` : `id=${id}`) : (ref ? `ref=${ref}` : '')
|
||||
return { title: 'Soul创业派对 - 创业者详情', query: q }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -60,6 +60,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
navBarHeight: app.globalData.navBarHeight
|
||||
@@ -719,5 +720,10 @@ Page({
|
||||
title: 'Soul创业派对 - 我的',
|
||||
path: ref ? `/pages/my/my?ref=${ref}` : '/pages/my/my'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 我的', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -25,5 +26,10 @@ Page({
|
||||
title: 'Soul创业派对 - 隐私政策',
|
||||
path: ref ? `/pages/privacy/privacy?ref=${ref}` : '/pages/privacy/privacy'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 隐私政策', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -11,6 +11,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
this.loadOrders()
|
||||
},
|
||||
@@ -71,5 +72,10 @@ Page({
|
||||
title: 'Soul创业派对 - 购买记录',
|
||||
path: ref ? `/pages/purchases/purchases?ref=${ref}` : '/pages/purchases/purchases'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 购买记录', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -74,6 +74,7 @@ Page({
|
||||
},
|
||||
|
||||
async onLoad(options) {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
// 支持 scene(扫码)、mid、id、ref
|
||||
const sceneStr = (options && options.scene) || ''
|
||||
const parsed = parseScene(sceneStr)
|
||||
@@ -505,10 +506,7 @@ Page({
|
||||
const { section, sectionId, sectionMid } = this.data
|
||||
const ref = app.getMyReferralCode()
|
||||
const q = sectionMid ? `mid=${sectionMid}` : `id=${sectionId}`
|
||||
return {
|
||||
title: `${section?.title || 'Soul创业派对'} - 来自派对房的真实故事`,
|
||||
query: ref ? `${q}&ref=${ref}` : q
|
||||
}
|
||||
return { title: section?.title ? `📚 ${section.title}` : 'Soul创业派对 - 真实商业故事', query: ref ? `${q}&ref=${ref}` : q }
|
||||
},
|
||||
|
||||
// 显示登录弹窗(每次打开协议未勾选,符合审核要求)
|
||||
|
||||
@@ -69,6 +69,8 @@ Page({
|
||||
onLoad() {
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
this.initData()
|
||||
// 启用分享到朋友圈(需同时有 onShareAppMessage 和 onShareTimeline;menus 在 Android 支持,iOS 为 Beta)
|
||||
wx.showShareMenu({ menus: ['shareAppMessage', 'shareTimeline'] })
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
</view>
|
||||
<view class="share-info">
|
||||
<text class="share-title">更多分享方式</text>
|
||||
<text class="share-desc">使用系统分享功能</text>
|
||||
<text class="share-desc">复制链接发给好友;点击右上角 ⋮ 可分享到朋友圈(带推荐码)</text>
|
||||
</view>
|
||||
<image class="share-arrow-icon" src="/assets/icons/arrow-right.svg" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
@@ -25,6 +25,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44
|
||||
})
|
||||
@@ -113,5 +114,10 @@ Page({
|
||||
title: 'Soul创业派对 - 搜索',
|
||||
path: ref ? `/pages/search/search?ref=${ref}` : '/pages/search/search'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 搜索', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -27,6 +27,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
isLoggedIn: app.globalData.isLoggedIn,
|
||||
@@ -501,5 +502,10 @@ Page({
|
||||
title: 'Soul创业派对 - 设置',
|
||||
path: ref ? `/pages/settings/settings?ref=${ref}` : '/pages/settings/settings'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 设置', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -20,11 +20,12 @@ Page({
|
||||
{ title: '链接资源', desc: '进群聊天、链接资源的权利' },
|
||||
{ title: '专属VIP标识', desc: '头像金色VIP光圈' }
|
||||
],
|
||||
profile: { name: '', project: '', contact: '', bio: '' },
|
||||
profile: { vipName: '', vipProject: '', vipContact: '', vipAvatar: '', vipBio: '' },
|
||||
purchasing: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
this.loadVipInfo()
|
||||
},
|
||||
@@ -55,10 +56,54 @@ Page({
|
||||
async loadProfile(userId) {
|
||||
try {
|
||||
const res = await app.request(`/api/miniprogram/vip/profile?userId=${userId}`)
|
||||
if (res?.success) this.setData({ profile: res.data })
|
||||
if (res?.success) {
|
||||
const p = res.data
|
||||
// 头像若为相对路径则补全
|
||||
if (p.vipAvatar && !p.vipAvatar.startsWith('http')) {
|
||||
p.vipAvatar = app.globalData.baseUrl.replace(/\/$/, '') + (p.vipAvatar.startsWith('/') ? p.vipAvatar : '/' + p.vipAvatar)
|
||||
}
|
||||
this.setData({ profile: p })
|
||||
}
|
||||
} catch (e) { console.log('[VIP] 资料加载失败', e) }
|
||||
},
|
||||
|
||||
async onChooseVipAvatar() {
|
||||
wx.chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ['image'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: async (res) => {
|
||||
const tempPath = res.tempFiles[0].tempFilePath
|
||||
wx.showLoading({ title: '上传中...', mask: true })
|
||||
try {
|
||||
const uploadRes = await new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: app.globalData.baseUrl + '/api/miniprogram/upload',
|
||||
filePath: tempPath,
|
||||
name: 'file',
|
||||
formData: { folder: 'avatars' },
|
||||
success: (r) => {
|
||||
try {
|
||||
const d = JSON.parse(r.data)
|
||||
d.success ? resolve(d) : reject(new Error(d.error || '上传失败'))
|
||||
} catch { reject(new Error('解析失败')) }
|
||||
},
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
const path = uploadRes.url || uploadRes.data?.url || ''
|
||||
const avatarUrl = path.startsWith('http') ? path : (app.globalData.baseUrl.replace(/\/$/, '') + (path.startsWith('/') ? path : '/' + path))
|
||||
this.setData({ 'profile.vipAvatar': avatarUrl })
|
||||
wx.hideLoading()
|
||||
wx.showToast({ title: '头像已更新', icon: 'success' })
|
||||
} catch (e) {
|
||||
wx.hideLoading()
|
||||
wx.showToast({ title: e.message || '上传失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async handlePurchase() {
|
||||
let userId = app.globalData.userInfo?.id
|
||||
let openId = app.globalData.openId || app.globalData.userInfo?.open_id
|
||||
@@ -110,10 +155,10 @@ Page({
|
||||
} 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 }) },
|
||||
onVipNameInput(e) { this.setData({ 'profile.vipName': e.detail.value }) },
|
||||
onVipProjectInput(e) { this.setData({ 'profile.vipProject': e.detail.value }) },
|
||||
onVipContactInput(e) { this.setData({ 'profile.vipContact': e.detail.value }) },
|
||||
onVipBioInput(e) { this.setData({ 'profile.vipBio': e.detail.value }) },
|
||||
|
||||
async saveProfile() {
|
||||
const userId = app.globalData.userInfo?.id
|
||||
@@ -121,7 +166,7 @@ Page({
|
||||
const p = this.data.profile
|
||||
try {
|
||||
const res = await app.request('/api/miniprogram/vip/profile', {
|
||||
method: 'POST', data: { userId, name: p.name, project: p.project, contact: p.contact, bio: p.bio }
|
||||
method: 'POST', data: { userId, vipName: p.vipName, vipProject: p.vipProject, vipContact: p.vipContact, vipAvatar: p.vipAvatar, vipBio: p.vipBio }
|
||||
})
|
||||
if (res?.success) wx.showToast({ title: '资料已保存', icon: 'success' })
|
||||
else wx.showToast({ title: res?.error || '保存失败', icon: 'none' })
|
||||
@@ -136,5 +181,10 @@ Page({
|
||||
title: 'Soul创业派对 - VIP会员',
|
||||
path: ref ? `/pages/vip/vip?ref=${ref}` : '/pages/vip/vip'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - VIP会员', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,44 +1,50 @@
|
||||
<!--VIP会员页-->
|
||||
<!-- 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>
|
||||
<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="vip-hero {{isVip ? 'vip-hero-active' : ''}}">
|
||||
<text class="vip-hero-tag">卡若创业派对</text>
|
||||
<text class="vip-hero-title">加入卡若的<text class="gold">创业派对</text>会员</text>
|
||||
<text class="vip-hero-title">
|
||||
加入卡若的
|
||||
<text class="gold">创业派对</text>
|
||||
会员
|
||||
</text>
|
||||
<text class="vip-hero-sub" wx:if="{{isVip}}">有效期至 {{expireDateStr}}(剩余{{daysRemaining}}天)</text>
|
||||
<text class="vip-hero-sub" wx:else>专属会员尊享权益</text>
|
||||
</view>
|
||||
|
||||
<!-- 内容权益 -->
|
||||
<view class="rights-card">
|
||||
<text class="rights-section-title">内容权益</text>
|
||||
<view class="rights-item" wx:for="{{contentRights}}" wx:key="title">
|
||||
<view class="rights-check-wrap"><text class="rights-check">✓</text></view>
|
||||
<view class="rights-check-wrap">
|
||||
<text class="rights-check">✓</text>
|
||||
</view>
|
||||
<view class="rights-info">
|
||||
<text class="rights-title">{{item.title}}</text>
|
||||
<text class="rights-desc">{{item.desc}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 社交权益 -->
|
||||
<view class="rights-card">
|
||||
<text class="rights-section-title">社交权益</text>
|
||||
<view class="rights-item" wx:for="{{socialRights}}" wx:key="title">
|
||||
<view class="rights-check-wrap"><text class="rights-check">✓</text></view>
|
||||
<view class="rights-check-wrap">
|
||||
<text class="rights-check">✓</text>
|
||||
</view>
|
||||
<view class="rights-info">
|
||||
<text class="rights-title">{{item.title}}</text>
|
||||
<text class="rights-desc">{{item.desc}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 价格区 + 购买按钮 -->
|
||||
<view class="buy-area" wx:if="{{!isVip}}">
|
||||
<view class="price-row">
|
||||
@@ -51,28 +57,46 @@
|
||||
</button>
|
||||
<text class="buy-sub">加入卡若创业派对,获取创业资讯与优质人脉资源</text>
|
||||
</view>
|
||||
|
||||
<!-- VIP资料填写(仅VIP可见) -->
|
||||
<view class="profile-card" wx:if="{{isVip}}">
|
||||
<text class="profile-title">会员资料(展示在创业老板排行)</text>
|
||||
<view class="avatar-row">
|
||||
<view class="avatar-label">头像</view>
|
||||
<view class="avatar-slot" bindtap="onChooseVipAvatar">
|
||||
<image wx:if="{{profile.vipAvatar}}" class="avatar-img" src="{{profile.vipAvatar}}" mode="aspectFill"/>
|
||||
<view wx:else class="avatar-placeholder">
|
||||
<text class="avatar-add">+</text>
|
||||
<text class="avatar-hint">上传头像</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">姓名</text>
|
||||
<input class="form-input" placeholder="您的真实姓名" value="{{profile.name}}" bindinput="onNameInput"/>
|
||||
<view class="form-input">
|
||||
<input type="nickname" placeholder="您的真实姓名" placeholder-class="form-placeholder" value="{{profile.vipName}}" bindinput="onVipNameInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">项目名称</text>
|
||||
<input class="form-input" placeholder="您的项目/公司名称" value="{{profile.project}}" bindinput="onProjectInput"/>
|
||||
<view class="form-input">
|
||||
<input placeholder="您的项目/公司名称" placeholder-class="form-placeholder" value="{{profile.vipProject}}" bindinput="onVipProjectInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">联系方式</text>
|
||||
<input class="form-input" placeholder="微信号或手机号" value="{{profile.contact}}" bindinput="onContactInput"/>
|
||||
<view class="form-input">
|
||||
<input placeholder="微信号或手机号" placeholder-class="form-placeholder" value="{{profile.vipContact}}" bindinput="onVipContactInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<text class="form-label">一句话简介</text>
|
||||
<input class="form-input" placeholder="简要描述您的业务" value="{{profile.bio}}" bindinput="onBioInput"/>
|
||||
<view class="form-input">
|
||||
<input placeholder="简要描述您的业务" placeholder-class="form-placeholder" value="{{profile.vipBio}}" bindinput="onVipBioInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="save-btn-wrap">
|
||||
<button class="save-btn" bindtap="saveProfile">保存资料</button>
|
||||
</view>
|
||||
<button class="save-btn" bindtap="saveProfile">保存资料</button>
|
||||
</view>
|
||||
|
||||
<view class="bottom-space"></view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -12,15 +12,16 @@
|
||||
.gold { color: #FFD700; }
|
||||
.vip-hero-sub { display: block; font-size: 24rpx; color: rgba(255,255,255,0.5); margin-top: 12rpx; }
|
||||
|
||||
.rights-card { margin: 24rpx; }
|
||||
.rights-item { display: flex; align-items: flex-start; gap: 20rpx; padding: 24rpx; margin-bottom: 16rpx; background: rgba(255,255,255,0.04); border: 1rpx solid rgba(255,255,255,0.06); border-radius: 16rpx; }
|
||||
.rights-card { margin: 24rpx; padding: 0 8rpx; }
|
||||
.rights-item { display: flex; align-items: flex-start; padding: 24rpx; margin-bottom: 16rpx; background: rgba(255,255,255,0.04); border: 1rpx solid rgba(255,255,255,0.06); border-radius: 16rpx; }
|
||||
.rights-item .rights-check-wrap { margin-right: 20rpx; }
|
||||
.rights-check-wrap { width: 44rpx; height: 44rpx; border-radius: 50%; background: rgba(0,206,209,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 4rpx; }
|
||||
.rights-check { color: #00CED1; font-size: 24rpx; font-weight: bold; }
|
||||
.rights-info { display: flex; flex-direction: column; }
|
||||
.rights-title { font-size: 30rpx; font-weight: 600; color: rgba(255,255,255,0.95); }
|
||||
.rights-desc { font-size: 24rpx; color: rgba(255,255,255,0.45); margin-top: 6rpx; }
|
||||
|
||||
.rights-section-title { display: block; font-size: 26rpx; color: #00CED1; font-weight: 600; margin-bottom: 16rpx; padding-bottom: 12rpx; border-bottom: 1rpx solid rgba(0,206,209,0.15); }
|
||||
.rights-section-title { display: block; font-size: 26rpx; color: #00CED1; font-weight: 600; margin-bottom: 16rpx; margin-left: 16rpx; padding-bottom: 12rpx; border-bottom: 1rpx solid rgba(0,206,209,0.15); }
|
||||
|
||||
.buy-area { margin: 24rpx; padding: 32rpx; text-align: center; background: rgba(255,255,255,0.03); border-radius: 20rpx; }
|
||||
.price-row { display: flex; align-items: baseline; justify-content: center; gap: 12rpx; margin-bottom: 24rpx; }
|
||||
@@ -32,12 +33,23 @@
|
||||
.buy-btn[disabled] { opacity: 0.5; }
|
||||
.buy-sub { display: block; font-size: 22rpx; color: rgba(255,255,255,0.4); margin-top: 16rpx; }
|
||||
|
||||
.profile-card { margin: 24rpx; padding: 28rpx; background: #1c1c1e; border-radius: 20rpx; }
|
||||
.profile-card { margin: 24rpx; padding: 32rpx; background: rgba(255,255,255,0.04); border: 1rpx solid rgba(255,255,255,0.08); 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; }
|
||||
.avatar-row { display: flex; align-items: center; margin-bottom: 24rpx; }
|
||||
.avatar-label { font-size: 26rpx; color: rgba(255,255,255,0.6); width: 140rpx; flex-shrink: 0; }
|
||||
.avatar-slot { width: 128rpx; height: 128rpx; border-radius: 50%; background: rgba(255,255,255,0.06); border: 2rpx dashed rgba(255,255,255,0.2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
|
||||
.avatar-slot .avatar-img { width: 100%; height: 100%; }
|
||||
.avatar-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,0.4); }
|
||||
.avatar-add { font-size: 48rpx; line-height: 1; }
|
||||
.avatar-hint { font-size: 20rpx; margin-top: 8rpx; }
|
||||
.form-group { margin-bottom: 24rpx; }
|
||||
.form-label { font-size: 26rpx; color: rgba(255,255,255,0.6); display: block; margin-bottom: 10rpx; }
|
||||
.form-input { box-sizing: border-box; width: 100%; min-height: 76rpx; background: rgba(255,255,255,0.06); border: 1rpx solid rgba(255,255,255,0.1); border-radius: 12rpx; padding: 16rpx 24rpx; }
|
||||
.form-input input { width: 100%; font-size: 28rpx; color: #fff; line-height: 1.5; background: transparent; }
|
||||
.form-placeholder { color: rgba(255,255,255,0.35); }
|
||||
.save-btn-wrap { margin-top: 32rpx; width: 100%; display: flex; justify-content: center; }
|
||||
.save-btn { display: block; margin: 0; padding: 0; width: 100%; height: 88rpx; line-height: 88rpx; text-align: center; background: linear-gradient(135deg, #00CED1, #20B2AA); color: #000; font-size: 32rpx; font-weight: 600; border-radius: 44rpx; border: none; box-sizing: border-box; }
|
||||
.save-btn::after { border: none; margin: 0; padding: 0; }
|
||||
|
||||
.author-section { margin: 32rpx 24rpx; padding: 24rpx; border-top: 1rpx solid rgba(255,255,255,0.08); }
|
||||
.author-row { display: flex; justify-content: space-between; padding: 8rpx 0; }
|
||||
|
||||
@@ -11,6 +11,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight || 44 })
|
||||
this.loadRecords()
|
||||
},
|
||||
@@ -127,5 +128,10 @@ Page({
|
||||
title: 'Soul创业派对 - 提现记录',
|
||||
path: ref ? `/pages/withdraw-records/withdraw-records?ref=${ref}` : '/pages/withdraw-records/withdraw-records'
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const ref = app.getMyReferralCode()
|
||||
return { title: 'Soul创业派对 - 提现记录', query: ref ? `ref=${ref}` : '' }
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user