html
<text wx:for="{{countdown}}" wx:key="index">{{item}}text>
ts
this.data.intervalId = setInterval(function () {
const now = new Date().getTime();
const diff = that.data.targetTime - now;
clearInterval(that.data.intervalId);
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
countdown: [days, '天', hours, '时', minutes, '分', seconds, '秒'],
onLoad: function (options) {
targetTime: new Date('2024-04-28 16:53:10').getTime(),
