JS实现计时器(prototype)+表格排序

有关prototype的解释,请看http://www.uw3c.com/jsviews/js12.html最近做playmenu餐饮平台项目,厨师端需要计时器来显示菜品从点单到现在已用时间,并且进行降序排序。因为项目需要,才接触了js。查了下资料,自己用js中function的prototype属性,面向对象实现了一个计时器。//计时器function TimeCoun
摘要由CSDN通过智能技术生成

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">有关prototype的解释,请看</span><a target=_blank target="_blank" href="http://www.uw3c.com/jsviews/js12.html" style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">http://www.uw3c.com/jsviews/js12.html</a>

最近做playmenu餐饮平台项目,厨师端需要计时器来显示菜品从点单到现在已用时间,并且进行降序排序。


因为项目需要,才接触了js。查了下资料,自己用js中function的prototype属性,面向对象实现了一个计时器。

//计时器
function TimeCount() {
	
};

TimeCount.prototype={
	init: function(date, curDate) {
		var _this = this;
		/* _this._hour = date.getHours();
		_this._minute = date.getMinutes();
		_this._sec = date.getSeconds();
		_this._curHour = curDate.getHours();
		_this._curMin = curDate.getMinutes();
		_this._curSec = curDate.getSeconds(); */
		_this._showHour = 00;
		_this._showMin = 00;
		_this._showSec = 00;
		_this._totalSec = (curDate.getTime() - date.getTime())/1000;
		//_this._totalSec=(_this._curHour-this._hour)*3600+(_this._curMin-this._minute)*60+(_this._curSec-this._sec);			
	},

	//订单更新时间,当前时间,匿名回调函数——时间 毫秒
	begin: function(date, curDate, callback) {
		
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值