Skip to content

Commit 2210516

Browse files
committed
chore: style
1 parent 24241b6 commit 2210516

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.codebuddy/memory/2026-08-10.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@
151151
- data 新增 `activeRecordIndex``is-top` 改为 `activeRecordIndex === index`,点击切换(`activeRecordIndex === index ? null : index`
152152
- 星级颜色同步:选中项 `star2.svg`(黄色),未选中 `star1.svg`(紫色)
153153
- 我的奖品整页 loading:`.m-page-prizes` 绑定 `v-loading="myPrizesLoading && !myPrizeList.length"`(首次进入无数据时整页 loading;翻页时有数据不遮整页,用底部「加载中...」)
154+
- 修复「全部刮开」报错 `Cannot read properties of null (reading 'img')`
155+
- 根因:`openBatchScratch``batchPrizes = new Array(times).fill(null)``fetchPrize` 异步返回前的空位或 `fill(null)` 补位项为 null;`revealBatch` 渲染 `u-result` 访问 `null.img` 报错
156+
- `revealBatch``batchPrizes = batchPrizes.map(item => item || this.thanksPrize())` 空位兜底「谢谢惠顾」
157+
- 模板 `u-result` 判空防御:`item ? item.img : miss.jpg` / `item ? item.name : "谢谢惠顾"`
158+
- 批量「拿下」不再叠加结果弹窗:`claimBatch` 移除 `resultPrizes` / `showResult = true`(与单卡 `claimSingle` 一致,点击拿下直接关闭连刮弹窗)
154159
- 我的奖品滚动容器从 `.m-prize-records` 移到 `.m-record-list`
155160
- 模板:`@scroll="onRecordsScroll"` 移到 `.m-record-list`;「加载中/没有更多了」提示移入 list 内末尾
156161
- less:`.m-prize-records` 改为 `flex` 容器(`overflow: hidden`),标题 `.m-section-title-2` `flex-shrink: 0` 固定;`.m-record-list` 承担 `flex: 1; overflow-y: auto` 滚动

src/views/vip/lottery/index-app.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@
199199
:style="{ backgroundImage: `url(${__appImgRoot}card-mini.jpg)` }"
200200
></div>
201201
<div class="u-result" v-else>
202-
<img :src="item.img" />
203-
<span>{{ item.name }}</span>
202+
<img :src="item ? item.img : `${__appImgRoot}miss.jpg`" />
203+
<span>{{ item ? item.name : "谢谢惠顾" }}</span>
204204
</div>
205205
</div>
206206
</div>
@@ -903,12 +903,12 @@ export default {
903903
},
904904
revealBatch() {
905905
if (this.batchRevealed) return;
906+
// 未中奖的空位兜底为「谢谢惠顾」,避免渲染 null.img 报错
907+
this.batchPrizes = this.batchPrizes.map((item) => item || this.thanksPrize());
906908
this.batchRevealed = true;
907909
},
908910
claimBatch() {
909911
this.showBatchScratch = false;
910-
this.resultPrizes = this.batchPrizes.filter(Boolean);
911-
this.showResult = true;
912912
this.remainingCount = Math.max(0, this.remainingCount - this.batchPrizes.length);
913913
this.isDrawing = false;
914914
this.refreshCards();

0 commit comments

Comments
 (0)