update:不显示bug&扫码查看赛事
This commit is contained in:
parent
3efeb5fa6b
commit
c8cf6469fa
@ -1,8 +1,5 @@
|
||||
<view class="apply-page">
|
||||
<mp-navigation-bar title="报名" background-color="#ffffff" color="#333" bind:click-left="onBack" left-arrow></mp-navigation-bar>
|
||||
<view class="openid-row">
|
||||
<button class="openid-mini-btn" size="mini" bindtap="onFetchOpenId">获取openid</button>
|
||||
</view>
|
||||
<!-- 未登录 -->
|
||||
<view wx:if="{{!loggedIn}}" class="not-login">
|
||||
<text class="not-login-tip">登录后才能提交报名信息</text>
|
||||
|
||||
@ -362,7 +362,26 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const id = Number(options.id);
|
||||
console.log('Detail onLoad options:', options);
|
||||
|
||||
let rawId = options.id;
|
||||
|
||||
// 处理扫描普通二维码进入:options.q 为 URL 编码后的链接
|
||||
// 格式:https://jitsi-web.yuedongsports.com/mini-app/event?id=xxx
|
||||
if (!rawId && options.q) {
|
||||
try {
|
||||
const decoded = decodeURIComponent(options.q);
|
||||
const match = decoded.match(/[?&]id=([^&]+)/);
|
||||
console.log('Detail onLoad options:', decoded);
|
||||
console.log('Detail onLoad options:', match);
|
||||
|
||||
if (match) rawId = match[1];
|
||||
} catch (e) {
|
||||
console.warn('Detail: 解析 options.q 失败', e);
|
||||
}
|
||||
}
|
||||
|
||||
const id = Number(rawId);
|
||||
this.setData({ id });
|
||||
if (!id) return;
|
||||
this.fetchDetail(id);
|
||||
@ -372,7 +391,7 @@ Page({
|
||||
request({
|
||||
path: API.eventDetail(id),
|
||||
method: 'GET',
|
||||
needAuth: false
|
||||
needAuth: true
|
||||
})
|
||||
.then((res) => {
|
||||
const detail = res || {};
|
||||
|
||||
@ -58,6 +58,7 @@ Page({
|
||||
banners: [],
|
||||
rows: [],
|
||||
loading: false,
|
||||
isFirstLoad: false,
|
||||
loadingText: '加载中...',
|
||||
|
||||
pageNo: 1,
|
||||
@ -278,7 +279,7 @@ Page({
|
||||
});
|
||||
}
|
||||
|
||||
this.setData({ loading: true });
|
||||
this.setData({ loading: true, isFirstLoad: !!reset });
|
||||
const pageNo = reset ? 1 : this.data.pageNo;
|
||||
const pageSize = this.data.pageSize;
|
||||
const status = this.data.status;
|
||||
@ -336,12 +337,14 @@ Page({
|
||||
rows: nextRows,
|
||||
hasMore,
|
||||
loading: false,
|
||||
isFirstLoad: false,
|
||||
loadingText: hasMore ? '加载中...' : '没有更多了'
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({
|
||||
loading: false,
|
||||
isFirstLoad: false,
|
||||
hasMore: false,
|
||||
rows: reset ? [] : this.data.rows,
|
||||
loadingText: err && err.message ? err.message : '加载失败'
|
||||
@ -365,7 +368,7 @@ Page({
|
||||
});
|
||||
}
|
||||
|
||||
this.setData({ loading: true });
|
||||
this.setData({ loading: true, isFirstLoad: !!reset });
|
||||
const pageNo = reset ? 1 : this.data.pageNo;
|
||||
const pageSize = this.data.pageSize;
|
||||
|
||||
@ -419,12 +422,14 @@ Page({
|
||||
rows: nextRows,
|
||||
hasMore,
|
||||
loading: false,
|
||||
isFirstLoad: false,
|
||||
loadingText: hasMore ? '加载中...' : '没有更多了'
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.setData({
|
||||
loading: false,
|
||||
isFirstLoad: false,
|
||||
hasMore: false,
|
||||
rows: reset ? [] : this.data.rows,
|
||||
loadingText: '加载失败'
|
||||
|
||||
@ -47,6 +47,19 @@
|
||||
<button class="login-hint-btn" type="primary" bindtap="goLogin">去登录</button>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 首屏加载骨架 -->
|
||||
<block wx:elif="{{isFirstLoad && rows.length === 0}}">
|
||||
<view class="skeleton-card" wx:for="{{[1,2,3]}}" wx:key="*this">
|
||||
<view class="skeleton-cover"></view>
|
||||
<view class="skeleton-body">
|
||||
<view class="skeleton-line skeleton-line--long"></view>
|
||||
<view class="skeleton-line skeleton-line--short"></view>
|
||||
<view class="skeleton-line skeleton-line--mid"></view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block wx:elif="{{rows.length === 0 && !loading}}">
|
||||
<view class="empty">暂无数据</view>
|
||||
</block>
|
||||
@ -98,7 +111,16 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="loading" wx:if="{{loading}}">{{loadingText}}</view>
|
||||
|
||||
<!-- 底部状态:加载更多 / 没有更多 -->
|
||||
<view wx:if="{{loading && rows.length > 0}}" class="loading">
|
||||
<view class="loading-dots">
|
||||
<view class="loading-dot"></view>
|
||||
<view class="loading-dot"></view>
|
||||
<view class="loading-dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{!hasMore && rows.length > 0}}" class="loading">没有更多了</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -368,8 +368,74 @@ page {
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #969799;
|
||||
font-size: 26rpx;
|
||||
padding: 32rpx 0 48rpx;
|
||||
}
|
||||
|
||||
/* ===== 三点加载动画 ===== */
|
||||
.loading-dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.loading-dot {
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 50%;
|
||||
background: #1a56db;
|
||||
animation: dot-bounce 2.8s infinite ease-in-out;
|
||||
}
|
||||
|
||||
.loading-dot:nth-child(1) { animation-delay: 0s; }
|
||||
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
|
||||
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
|
||||
|
||||
@keyframes dot-bounce {
|
||||
0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
|
||||
40% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
/* ===== 首屏骨架屏 ===== */
|
||||
.skeleton-card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.skeleton-cover {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-shimmer 1.4s infinite;
|
||||
}
|
||||
|
||||
.skeleton-body {
|
||||
padding: 24rpx 28rpx 28rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.skeleton-line {
|
||||
height: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-shimmer 1.4s infinite;
|
||||
}
|
||||
|
||||
.skeleton-line--long { width: 80%; }
|
||||
.skeleton-line--mid { width: 60%; }
|
||||
.skeleton-line--short { width: 40%; }
|
||||
|
||||
@keyframes skeleton-shimmer {
|
||||
0% { background-position: 200% 0; }
|
||||
100% { background-position: -200% 0; }
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"libVersion": "3.15.0",
|
||||
"libVersion": "3.15.1",
|
||||
"projectname": "YD_Event.miniApp",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
|
||||
@ -76,8 +76,8 @@ Page({
|
||||
return this.loadRecords();
|
||||
},
|
||||
|
||||
/** 触底加载更多 */
|
||||
onLoadMore() {
|
||||
/** 上拉加载更多 */
|
||||
onReachBottom() {
|
||||
if (this.data.loading || this.data.noMore) return;
|
||||
this.loadRecords();
|
||||
},
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view class="record-list" scroll-y enhanced show-scrollbar="{{false}}" bindscrolltolower="onLoadMore" refresher-enabled refresher-triggered="{{refresherTriggered}}" bindrefresherrefresh="onRefresh">
|
||||
<view class="record-list">
|
||||
<!-- 空状态 -->
|
||||
<view wx:if="{{records.length === 0 && !loading}}" class="empty">
|
||||
<view class="empty-icon">
|
||||
@ -63,6 +63,6 @@
|
||||
<view wx:if="{{noMore && records.length > 0}}" class="loading-tip">
|
||||
<text>没有更多了</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -120,8 +120,6 @@
|
||||
|
||||
/* ===== 列表容器 ===== */
|
||||
.record-list {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
margin: 0 20rpx;
|
||||
|
||||
@ -80,7 +80,7 @@ Page({
|
||||
wx.navigateTo({ url: `/subpackages/mine/order-detail/order-detail?id=${id}` });
|
||||
},
|
||||
|
||||
onLoadMore() {
|
||||
onReachBottom() {
|
||||
this.loadOrders(false);
|
||||
}
|
||||
});
|
||||
|
||||
@ -7,12 +7,7 @@
|
||||
left-arrow
|
||||
></mp-navigation-bar> -->
|
||||
|
||||
<scroll-view
|
||||
class="list"
|
||||
scroll-y
|
||||
lower-threshold="80"
|
||||
bindscrolltolower="onLoadMore"
|
||||
>
|
||||
<view class="list">
|
||||
<!-- 订单卡片列表 -->
|
||||
<view
|
||||
class="order-card"
|
||||
@ -39,6 +34,7 @@
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view wx:if="{{orders.length === 0 && !loading}}" class="empty">
|
||||
<image class="empty-icon" src="https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/event_miniapp/nothing.png" mode="aspectFit" />
|
||||
<text class="empty-text">暂无订单</text>
|
||||
</view>
|
||||
|
||||
@ -47,5 +43,5 @@
|
||||
<text wx:if="{{noMore}}" class="footer-text">没有更多了</text>
|
||||
<text wx:elif="{{loading}}" class="footer-text">加载中...</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
}
|
||||
|
||||
.list {
|
||||
height: calc(100vh - 88rpx);
|
||||
padding: 24rpx 32rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@ -90,9 +89,17 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 200rpx;
|
||||
justify-content: center;
|
||||
padding-top: 240rpx;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 60%;
|
||||
/* margin-bottom: 32rpx; */
|
||||
}
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
|
||||
@ -57,8 +57,8 @@ Page({
|
||||
return this.loadRecords(true);
|
||||
},
|
||||
|
||||
/** 加载更多 */
|
||||
onLoadMore() {
|
||||
/** 上拉加载更多 */
|
||||
onReachBottom() {
|
||||
if (this.data.loading || this.data.noMore) return;
|
||||
this.loadRecords(false);
|
||||
},
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<scroll-view class="record-list" scroll-y enhanced show-scrollbar="{{false}}" bindscrolltolower="onLoadMore">
|
||||
<view class="record-list">
|
||||
<!-- 空状态 -->
|
||||
<view wx:if="{{records.length === 0 && !loading}}" class="empty">
|
||||
<!-- <view class="empty-icon">
|
||||
@ -62,5 +62,5 @@
|
||||
<view wx:if="{{noMore && records.length > 0}}" class="loading-tip">
|
||||
<text>没有更多了</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@ -149,13 +149,11 @@
|
||||
|
||||
/* ===== 记录列表 ===== */
|
||||
.record-list {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
margin: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 40rpx);
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.record-row {
|
||||
|
||||
@ -78,7 +78,7 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
onScrollToLower() {
|
||||
onReachBottom() {
|
||||
if (this.data.registrationsLoading || !this.data.hasMore) return;
|
||||
const next = this.data.pageNo + 1;
|
||||
this.setData({ pageNo: next });
|
||||
|
||||
@ -4,12 +4,7 @@
|
||||
<button size="mini" type="default" bindtap="goToMine">返回</button>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="list"
|
||||
scroll-y="true"
|
||||
lower-threshold="60"
|
||||
bindscrolltolower="onScrollToLower"
|
||||
>
|
||||
<view class="list">
|
||||
<block wx:if="{{registrations.length === 0 && !registrationsLoading}}">
|
||||
<view class="empty">暂无记录</view>
|
||||
</block>
|
||||
@ -27,6 +22,6 @@
|
||||
<view class="loading" wx:if="{{registrationsLoading}}">
|
||||
{{registrationsLoadingText}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
.list {
|
||||
height: calc(100vh - 130rpx);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.empty {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user