update:bug修复
This commit is contained in:
parent
5526f78167
commit
f899de5195
@ -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: '提示',
|
||||
|
||||
@ -109,14 +109,14 @@
|
||||
<view class="table-head">
|
||||
<text class="th th-type">类型</text>
|
||||
<text class="th th-proj">项目</text>
|
||||
<text class="th th-group">组别</text>
|
||||
<text class="th th-group" wx:if="{{chargeMode !== 3}}">组别</text>
|
||||
<text class="th th-fee" wx:if="{{feeModeLabel == '单价(项目)'}}">费用(元)</text>
|
||||
</view>
|
||||
<view class="table-body">
|
||||
<view class="tr" wx:for="{{projectTableRows}}" wx:key="rowKey">
|
||||
<text class="td td-type">{{item.typeName}}</text>
|
||||
<text class="td td-proj">{{item.projectName}}</text>
|
||||
<text class="td td-group">{{item.groupName}}</text>
|
||||
<text class="td td-group" wx:if="{{chargeMode !== 3}}">{{item.groupName}}</text>
|
||||
<text class="td td-fee" wx:if="{{feeModeLabel == '单价(项目)'}}">{{item.fee}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -131,7 +131,7 @@
|
||||
<text class="section-title">赛事简介</text>
|
||||
</view>
|
||||
<view class="intro-block">
|
||||
<rich-text type="text" class="intro-text" wx:if="{{introductionText}}">{{introductionText}}</rich-text>
|
||||
<rich-text nodes="{{introductionText}}" class="intro-text" wx:if="{{introductionText}}" />
|
||||
<image wx:if="{{introImage}}" class="intro-image" src="{{introImage}}" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
上传付款凭证
|
||||
</view>
|
||||
</block>
|
||||
<view class="action-btn action-btn--ghost" catchtap>更改参赛人</view>
|
||||
<!-- <view class="action-btn action-btn--ghost" catchtap>更改参赛人</view> -->
|
||||
<view class="action-btn action-btn--danger" wx:if="{{item.canCancel}}" catchtap="onCancelRegistrationTap" data-registrationid="{{item.registrationId}}">
|
||||
取消报名
|
||||
</view>
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -72,5 +72,7 @@
|
||||
<text class="func-menu-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退出登录 -->
|
||||
<button class="logout-btn" bindtap="onLogout">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user