Juria 2 months ago
parent 44803fa164
commit 71a19a2e99

@ -25,7 +25,7 @@ Page({
], ],
rolling: false, // 控制是否滚动 rolling: false, // 控制是否滚动
currentStudentIndex: 0, // 当前选中学生索引 currentStudentIndex: 0, // 当前选中学生索引
currentStudentName: "", // 当前显示的学生名称 currentStudentName: "开始点名", // 当前显示的学生名称
rollInterval: null, // 随机点名的定时器 rollInterval: null, // 随机点名的定时器
point: 1, // 设置的积分 point: 1, // 设置的积分
}, },
@ -132,9 +132,13 @@ Page({
confirmPoint: function() { confirmPoint: function() {
const Point = parseInt(this.data.point); const Point = parseInt(this.data.point);
const id = this.data.students[this.data.currentStudentIndex].id; const id = this.data.students[this.data.currentStudentIndex].id;
const finalPoint = this.data.students[this.data.currentStudentIndex].point + Point; let finalPoint = this.data.students[this.data.currentStudentIndex].point + Point;
if(finalPoint % 13 === 0){ if(finalPoint % 13 === 0){
finalPoint += 1; //积分等于13的整数倍加一分 finalPoint += 1; //积分等于13的整数倍加一分
wx.showToast({
title: '恭喜您触发彩蛋,积分额外+1',
icon: '/pages/images/eggs.png'
});
} }
// this.data.students[this.data.currentStudentIndex].point += point; 不会重新渲染视图 // this.data.students[this.data.currentStudentIndex].point += point; 不会重新渲染视图
this.setData({ this.setData({

@ -33,6 +33,8 @@
} }
.student-list button{ .student-list button{
position: absolute;
top: 100rpx;
background-color: rgba(234, 0, 255, 0.171); background-color: rgba(234, 0, 255, 0.171);
} }
@ -49,7 +51,7 @@
.student-name { .student-name {
position: absolute; position: absolute;
top: 100rpx; top: 100rpx;
left: 280rpx; left: 220rpx;
font-size: 80rpx; font-size: 80rpx;
text-align: center; text-align: center;
margin: 20rpx 0; margin: 20rpx 0;

@ -28,11 +28,11 @@
} }
.stu_list .id { .stu_list .id {
position: relative; position: relative;
left: 80rpx; left: 50rpx;
} }
.stu_list .name { .stu_list .name {
position: relative; position: relative;
left: 300rpx; left: 150rpx;
} }

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 248 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 349 KiB

After

Width:  |  Height:  |  Size: 349 KiB

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

@ -30,7 +30,7 @@
} }
.stu_list { .stu_list {
font-size: 50rpx; font-size: 40rpx;
} }
.stu_list .id { .stu_list .id {
position: relative; position: relative;
@ -44,6 +44,6 @@
.stu_list .point { .stu_list .point {
position: absolute; position: absolute;
left: 450rpx; left: 500rpx;
} }
Loading…
Cancel
Save