首页
关于
留言
友链
电台
壁纸
我的足迹
推荐
知易而行MCP
Search
1
乐橙CMS影视管理系统最全版本
109,277 阅读
2
VIP视频解析破解电影解析模拟破解影视解析
77,795 阅读
3
乐橙CMS影视管理系统4.0.18版本
16,934 阅读
4
新浪图片链接修复教程集合
15,125 阅读
5
反调试代码调试死机代码禁止F12代码
12,093 阅读
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
知易而行
登录
Search
标签搜索
PHP
AI
LINUX
微信
MYSQL
OpenClaw
ESP32S3
小智AI
P2P
JS
破解
乐橙cms
支付
uniapp
人工智能
技术趋势
智能玩具
公众号
typecho
xshell
子沐~
累计撰写
121
篇文章
累计收到
372
条评论
首页
栏目
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
知易而行
页面
关于
留言
友链
电台
壁纸
我的足迹
推荐
知易而行MCP
搜索到
1
篇与
的结果
2024-06-25
uniapp中订单列表如何进行批量倒计时?
可以先创建一个插件<template> <text> {{ remainingTime }} </text> </template> <script> export default { props: { endTime: { type: String, required: true }, orderCode: { type: String, required: true } }, data() { return { remainingTime: '' } }, mounted() { this.startCountdown() }, methods: { startCountdown() { // 计算剩余支付时间 const endTime = new Date(this.endTime).getTime() const now = new Date().getTime() const diff = endTime - now if (diff <= 0) { // 付款时间已过 this.remainingTime = '已过期' this.$emit('finish',this.orderCode); return } // 更新显示倒计时 const seconds = Math.floor(diff / 1000) const minutes = Math.floor(seconds / 60) const hours = Math.floor(minutes / 60) const days = Math.floor(hours / 24); // this.remainingTime = `${days}天 ${hours % 24}小时 ${minutes % 60}分钟 ${seconds % 60}秒` this.remainingTime = `${minutes % 60<10?`0`+(minutes % 60):minutes % 60}:${seconds % 60<10?`0`+(seconds % 60):seconds % 60}` // 每秒更新一次倒计时 setTimeout(this.startCountdown, 1000) } } } </script> 引入插件到列表中的具体位置//view中 <view style="color:#F4292D;font-size: 24rpx;" class="tn-flex-4 order__item__head__title tn-text-right">剩余支付时间: <countdown :orderCode="item.orderCode" :endTime="item.timeOut" @finish="orderFinish"></countdown> </view> //在script中 import Countdown from '@/Order/Countdown/Countdown.vue'; components: { Countdown }, //剩下的可以根据自己的逻辑进行处理啦
2024年06月25日
1,142 阅读
0 评论
1 点赞