- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡 - 药品百科: 搜索 + 分类筛选 + 20种药品静态数据 - 惠教中心: 4条药品使用指南课程 - 我的: 家庭成员信息管理 - 自定义TabBar + navigation-bar组件 - SVG药品分类插图
1 line
2.2 KiB
JavaScript
1 line
2.2 KiB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setTime=exports.resetFirstEntryTime=exports.isRecent=exports.getCurrentTimeSecond=exports.getCurrentServerTimeSecond=exports.getCountDownV3=exports.getCountDownV2=exports.getCountDown=exports.firstEntryTime=void 0;var firstEntryTime,systemTime=0,currentTime=0;exports.firstEntryTime=firstEntryTime;var setTime=function(t){isNaN(t)||(systemTime=t,currentTime=getCurrentTimeSecond(),firstEntryTime||(exports.firstEntryTime=firstEntryTime=t))};exports.setTime=setTime;var resetFirstEntryTime=function(){exports.firstEntryTime=firstEntryTime=void 0};exports.resetFirstEntryTime=resetFirstEntryTime;var getCountDown=function(t,e){var r=["00","00"];if(isNaN(t)||isNaN(e))return r;if(0===systemTime)return r;var n=60*e-(systemTime-t);if(n<0)return r;var o=currentTime+n-getCurrentTimeSecond();return o<0?r:["".concat(Math.floor(o/60)).padStart(2,"0"),"".concat(Math.floor(o%60)).padStart(2,"0")]};exports.getCountDown=getCountDown;var getCountDownV2=function(t,e,r){var n=["00","00"],o=r||0;if(isNaN(t)||isNaN(e))return n;if(0===systemTime)return n;var i=60*e-(systemTime-t)+o;if(i<0)return n;var s=currentTime+i-getCurrentTimeSecond();if(s<0)return n;var a=s/60;return a>=60?["".concat(Math.floor(a/60)).padStart(2,"0"),"".concat(Math.floor(a%60)).padStart(2,"0"),"".concat(Math.floor(s%60)).padStart(2,"0")]:["".concat(Math.floor(s/60)).padStart(2,"0"),"".concat(Math.floor(s%60)).padStart(2,"0")]};exports.getCountDownV2=getCountDownV2;var getCurrentTimeSecond=function(){return(new Date).getTime()/1e3};exports.getCurrentTimeSecond=getCurrentTimeSecond;var getCurrentServerTimeSecond=function(){return 0===systemTime?getCurrentTimeSecond():systemTime+getCurrentTimeSecond()-currentTime};exports.getCurrentServerTimeSecond=getCurrentServerTimeSecond;var getCountDownV3=function(t){var e=Math.floor(t/3600),r=t%3600,n=Math.floor(r/60),o=Math.round(r%60);return n<10&&(n="0"+n),o<10&&(o="0"+o),e>0?"".concat(e,":").concat(n,":").concat(o):"".concat(n,":").concat(o)};exports.getCountDownV3=getCountDownV3;var isRecent=function(t){return systemTime-t<(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)};exports.isRecent=isRecent; |