小程序提交

This commit is contained in:
2025-07-20 18:22:59 +08:00
parent a1d21c67b8
commit fa2a7b3499
61 changed files with 2505 additions and 944 deletions

View File

@ -1,38 +1,66 @@
// pages/course/waitPayOrder/waitPayOrder.js
Page({
data: {
// 初始倒计时字符串
countdown: '30分00秒'
},
onLoad(options) {
// 启动倒计时(总秒数 = 29*60 + 17
this.initCountdown(30 * 60 );
},
/**
* 初始化倒计时
* @param {number} totalSeconds 初始总秒数
* 页面的初始数据
*/
initCountdown(totalSeconds) {
this.countdownTimer = setInterval(() => {
if (totalSeconds <= 0) {
clearInterval(this.countdownTimer);
this.setData({ countdown: '00分00秒' });
return;
}
totalSeconds--;
const m = Math.floor(totalSeconds / 60);
const s = totalSeconds % 60;
const mm = m < 10 ? '0' + m : '' + m;
const ss = s < 10 ? '0' + s : '' + s;
this.setData({ countdown: `${mm}${ss}` });
}, 1000);
data: {
},
onUnload() {
// 页面卸载时清除定时器
clearInterval(this.countdownTimer);
}
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})