From f899de5195016e432c18b94c2acefaff663d3cec Mon Sep 17 00:00:00 2001 From: ltx <1006158920@qq.com> Date: Thu, 30 Apr 2026 17:16:30 +0800 Subject: [PATCH] =?UTF-8?q?update:bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/detail/detail.js | 40 +++++++- pages/detail/detail.wxml | 6 +- pages/home/home.wxml | 2 +- pages/mine/mine.js | 14 +++ pages/mine/mine.wxml | 2 + pages/mine/mine.wxss | 196 ++++++++++++++++++++++++--------------- 6 files changed, 178 insertions(+), 82 deletions(-) diff --git a/pages/detail/detail.js b/pages/detail/detail.js index 5d0b48b..b69471c 100644 --- a/pages/detail/detail.js +++ b/pages/detail/detail.js @@ -200,11 +200,23 @@ function buildRegistrationLimitLines(detail, projects, registrationType) { return lines; } -function flattenProjectTableRows(projects) { +function flattenProjectTableRows(projects, chargeMode) { if (!Array.isArray(projects)) return []; const rows = []; + // chargeMode=3 单价(项目):费用挂在项目层,按项目一行,不展开组别 + const byProject = chargeMode === 3; projects.forEach((p) => { const pid = p.id != null ? p.id : p.Id; + if (byProject) { + rows.push({ + rowKey: `p-${pid}`, + typeName: p.typeName || p.TypeName || '-', + projectName: p.name || p.Name || '-', + groupName: '', + fee: p.fee != null ? p.fee : p.Fee != null ? p.Fee : '-' + }); + return; + } const rawGroups = Array.isArray(p.groups) ? p.groups : Array.isArray(p.Groups) ? p.Groups : []; const groups = rawGroups.length ? rawGroups : [null]; groups.forEach((g, gi) => { @@ -364,7 +376,8 @@ function normalizeEventDetail(raw) { introImage, hasNoticeBlock: Boolean(refundRulesText || participationPointsLabel || rankingPointsLines.length), hasRegistrationLimit: registrationLimitLines.length > 0, - projectTableRows: flattenProjectTableRows(projects) + chargeMode, + projectTableRows: flattenProjectTableRows(projects, chargeMode) }; } @@ -410,7 +423,11 @@ Page({ applyDisabled: false, /** 是否被“需后台报名”规则拦截(按钮灰但可点,点后弹窗引导) */ applyBlockedByAdmin: false, - applyButtonText: '报名' + applyButtonText: '报名', + /** 当前用户是否已报名该赛事 */ + isRegistered: false, + /** 收费模式 0免费 1定价赛事 2单价赛事 3单价项目 */ + chargeMode: null }, onLoad(options) { @@ -520,6 +537,7 @@ Page({ var projectTableRows = n.projectTableRows && n.projectTableRows.length ? n.projectTableRows : DEMO_PROJECT_TABLE_ROWS; + var chargeMode = n.chargeMode != null ? n.chargeMode : null; var hasNoticeBlock = Boolean( refundRulesText || participationPointsLabel || rankingPointsLines.length @@ -587,6 +605,9 @@ Page({ } } + const isRegisteredRaw = pick(detail, ['isRegistered', 'IsRegistered']); + const isRegistered = isRegisteredRaw === true || isRegisteredRaw === 1 || isRegisteredRaw === 'true'; + this.setData({ eventDetail: detail, projects: normalizedProjects, @@ -617,10 +638,12 @@ Page({ eventStatus, registrationType, showMaterialRange, + chargeMode, applyGrey, applyDisabled, applyBlockedByAdmin, - applyButtonText: finalApplyButtonText + applyButtonText: finalApplyButtonText, + isRegistered }); }) .catch((err) => { @@ -638,6 +661,15 @@ Page({ onApplyTap() { const id = this.data.id; if (!id) return; + if (this.data.isRegistered) { + wx.showModal({ + title: '提示', + content: '您已报名该赛事,请先取消已报名的项目后再重新报名', + showCancel: false, + confirmText: '我知道了' + }); + return; + } if (this.data.applyBlockedByAdmin) { wx.showModal({ title: '提示', diff --git a/pages/detail/detail.wxml b/pages/detail/detail.wxml index ba91380..e7707bc 100644 --- a/pages/detail/detail.wxml +++ b/pages/detail/detail.wxml @@ -109,14 +109,14 @@ 类型 项目 - 组别 + 组别 费用(元) {{item.typeName}} {{item.projectName}} - {{item.groupName}} + {{item.groupName}} {{item.fee}} @@ -131,7 +131,7 @@ 赛事简介 - {{introductionText}} + diff --git a/pages/home/home.wxml b/pages/home/home.wxml index c13f70e..79a9cc5 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -104,7 +104,7 @@ 上传付款凭证 - 更改参赛人 + 取消报名 diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 39ed0d0..e347253 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -91,6 +91,20 @@ Page({ wx.navigateTo({ url: '/subpackages/mine/team/team' }); }, + onLogout() { + wx.showModal({ + title: '提示', + content: '确定要退出登录吗?', + confirmText: '退出', + confirmColor: '#e53935', + success: (res) => { + if (!res.confirm) return; + wx.clearStorageSync(); + this.setData({ loggedIn: false, profile: {}, maskedPhone: '', authStatus: 0, authStatusText: '未认证' }); + } + }); + }, + onChooseAvatar() { wx.chooseMedia({ count: 1, diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index ad81c5d..e598a93 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -72,5 +72,7 @@ › + + \ No newline at end of file diff --git a/pages/mine/mine.wxss b/pages/mine/mine.wxss index 8bb332c..6b88a67 100644 --- a/pages/mine/mine.wxss +++ b/pages/mine/mine.wxss @@ -4,32 +4,33 @@ display: flex; align-items: center; justify-content: center; - background: #f5f7fa; + background: linear-gradient(160deg, #e8eeff 0%, #f5f7fa 100%); } .not-logged-inner { display: flex; flex-direction: column; align-items: center; - gap: 32rpx; + gap: 36rpx; } .not-logged-tip { font-size: 28rpx; - color: #999; + color: #888; + letter-spacing: 1rpx; } .go-login-btn { - width: 400rpx !important; + width: 440rpx !important; height: 88rpx; line-height: 88rpx; - background: #1a57b2; + background: linear-gradient(135deg, #1a57b2 0%, #3a7bd5 100%); color: #fff; font-size: 30rpx; font-weight: 600; - border-radius: 12rpx; + border-radius: 44rpx; border: none; - border-radius: 32rpx; + box-shadow: 0 8rpx 24rpx rgba(26, 87, 178, 0.3); } .go-login-btn::after { @@ -39,17 +40,16 @@ /* ====== 已登录页面 ====== */ .mine-page { min-height: 100vh; - background: #fff; + background: #f0f2f8; } /* ====== 蓝色头部 ====== */ .header { position: relative; width: 100%; - height: 340rpx; + height: 360rpx; overflow: hidden; - border-radius: 0 0 100rpx 100rpx; - margin-bottom: 40rpx; + border-radius: 0 0 60rpx 60rpx; } .header-bg { @@ -66,7 +66,7 @@ left: 0; width: 100%; height: 100%; - background: rgba(26, 86, 219, 0.55); + background: linear-gradient(160deg, rgba(15, 60, 160, 0.7) 0%, rgba(26, 86, 219, 0.45) 100%); } /* ====== 头像区 ====== */ @@ -74,36 +74,42 @@ display: flex; flex-direction: column; align-items: center; - /* padding: 20rpx 0 40rpx; */ - margin-bottom: 80rpx; - margin-top: -70px; + margin-top: -88rpx; + margin-bottom: 32rpx; } .avatar-wrap { position: relative; - width: 160rpx; - height: 160rpx; + width: 168rpx; + height: 168rpx; } .avatar { - width: 160rpx; - height: 160rpx; + width: 168rpx; + height: 168rpx; border-radius: 50%; - border: 2rpx solid rgba(255, 255, 255, 0.4); + border: 6rpx solid #fff; + box-shadow: 0 8rpx 32rpx rgba(26, 87, 178, 0.2); } .camera-icon { position: absolute; - right: -4rpx; - bottom: -4rpx; - width: 44rpx; - height: 44rpx; - background: #1a57b2; - /* border: 4rpx solid #fff; */ + right: 0rpx; + bottom: 0rpx; + width: 48rpx; + height: 48rpx; + background: linear-gradient(135deg, #1a57b2 0%, #3a7bd5 100%); + border: 4rpx solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; + box-shadow: 0 2rpx 8rpx rgba(26, 87, 178, 0.3); +} + +.camera-icon image { + width: 26rpx; + height: 26rpx; } .camera-text { @@ -111,47 +117,48 @@ } .auth-badge-icon { - width: 40rpx; - height: 40rpx; + width: 36rpx; + height: 36rpx; + flex-shrink: 0; } + .phone-text { - margin-top: 16rpx; - font-size: 28rpx; - font-weight: 600; - color: #000; + margin-top: 20rpx; + font-size: 32rpx; + font-weight: 700; + color: #1a1a1a; + letter-spacing: 2rpx; } /* ====== 内容区 ====== */ .content { - position: relative; - margin-top: -20rpx; - padding: 0 28rpx; - padding-bottom: 40rpx; + padding: 0 28rpx 60rpx; } /* ====== 积分 & 证书双卡 ====== */ .stat-row { display: flex; gap: 20rpx; + margin-bottom: 20rpx; } .stat-card { flex: 1; - background: #ffffff; - border-radius: 16rpx; - padding: 6rpx 24rpx; + border-radius: 20rpx; + padding: 28rpx 24rpx 20rpx; display: flex; align-items: center; justify-content: space-between; - box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05); + overflow: hidden; + box-shadow: 0 6rpx 24rpx rgba(26, 87, 178, 0.1); } .stat-card:first-child { - background: linear-gradient(135deg, #A6ADEF 0%, #00000000 100%); + background: linear-gradient(135deg, #c5caff 0%, #eef0ff 100%); } .stat-card:last-child { - background: linear-gradient(135deg, #E5CD6790 0%, #00000000 100%); + background: linear-gradient(135deg, #ffe49a 0%, #fff8e0 100%); } .stat-left { @@ -160,35 +167,37 @@ } .stat-num { - font-size: 48rpx; + font-size: 52rpx; font-weight: 800; color: #1a1a1a; - line-height: 1.1; + line-height: 1; } .stat-label { font-size: 24rpx; - color: #313666; - margin-top: 8rpx; + color: #4a4e7a; + margin-top: 10rpx; + font-weight: 500; } .stat-icon { - width: 154rpx; - height: 154rpx; + width: 140rpx; + height: 140rpx; flex-shrink: 0; + opacity: 0.92; } /* ====== 身份认证条 ====== */ .auth-bar { - margin-top: 20rpx; - /* background: linear-gradient(135deg, #1a3a8a 0%, #1a57b2 100%); */ + margin-bottom: 20rpx; background: url('https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/event_miniapp/idcard-bg.png'); background-size: 100% 100%; - border-radius: 16rpx; - padding: 28rpx 30rpx; + border-radius: 20rpx; + padding: 32rpx 30rpx; display: flex; align-items: center; justify-content: space-between; + box-shadow: 0 6rpx 24rpx rgba(26, 87, 178, 0.18); } .auth-left { @@ -200,77 +209,116 @@ font-size: 32rpx; font-weight: 700; color: #ffffff; + letter-spacing: 1rpx; } .auth-desc { font-size: 22rpx; - color: rgba(255, 255, 255, 0.7); - margin-top: 6rpx; + color: rgba(255, 255, 255, 0.72); + margin-top: 8rpx; } .auth-badge { - display: flex; - align-items: center; - gap: 8rpx; - background: linear-gradient(135deg, #ECEBEB 0%, #AEAEAE 100%); + background: linear-gradient(135deg, #d0d0d0 0%, #a8a8a8 100%); border-radius: 34rpx; - width: 180rpx; + width: 176rpx; height: 64rpx; display: flex; align-items: center; justify-content: center; - /* padding: 10rpx 24rpx; */ + gap: 8rpx; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15); } .auth-badge-y { - background: linear-gradient(135deg, #E5A84D 0%, #CC8213 100%); + background: linear-gradient(135deg, #f0b94a 0%, #cc8213 100%); + box-shadow: 0 2rpx 12rpx rgba(204, 130, 19, 0.4); } - - .auth-badge-text { font-size: 24rpx; color: #ffffff; white-space: nowrap; + font-weight: 600; } /* ====== 功能入口:三个独立阴影卡片 ====== */ .func-list { - margin-top: 20rpx; display: flex; flex-direction: column; - gap: 20rpx; + gap: 0; + background: #fff; + border-radius: 20rpx; + overflow: hidden; + box-shadow: 0 6rpx 28rpx rgba(26, 87, 178, 0.08); + margin-bottom: 20rpx; } .func-menu-card { display: flex; flex-direction: row; align-items: center; - background: #ffffff; - border-radius: 16rpx; - padding: 28rpx 28rpx 28rpx 24rpx; - box-shadow: 0 8rpx 28rpx rgba(26, 87, 178, 0.08), 0 2rpx 8rpx rgba(0, 0, 0, 0.04); + background: #fff; + padding: 36rpx 28rpx 36rpx 28rpx; + border-bottom: 1rpx solid #f0f2f8; + position: relative; +} + +.func-menu-card:last-child { + border-bottom: none; +} + +.func-menu-icon-wrap { + width: 72rpx; + height: 72rpx; + border-radius: 18rpx; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + margin-right: 24rpx; } .func-menu-icon { - width: 48rpx; - height: 48rpx; + width: 44rpx; + height: 44rpx; flex-shrink: 0; } .func-menu-text { flex: 1; - margin-left: 24rpx; - font-size: 24rpx; + font-size: 30rpx; color: #1a1a1a; font-weight: 500; + letter-spacing: 0.5rpx; } .func-menu-arrow { flex-shrink: 0; font-size: 40rpx; line-height: 1; - color: #c8c8c8; + color: #c0c4d0; font-weight: 300; } +/* ====== 退出登录 ====== */ +.logout-btn { + display: block; + width: 100%; + margin: 0; + height: 96rpx; + line-height: 96rpx; + background: #fff; + color: #e53935; + font-size: 30rpx; + font-weight: 500; + border-radius: 20rpx; + border: none; + box-shadow: 0 6rpx 28rpx rgba(26, 87, 178, 0.08); + letter-spacing: 2rpx; +} + +.logout-btn::after { + border: none; +} +