| | |
| | | parseInt(t[2], 10) || null |
| | | )).getTime() / 1000; |
| | | }, |
| | | minutesBetweenDates(date1, date2) { |
| | | let dateOne = new Date(date1) |
| | | const oneMinute = 60 * 1000; // 1分钟的毫秒数 |
| | | const difference = Math.abs(date2.getTime() - dateOne.getTime()); // 计算两个日期的毫秒差 |
| | | return Math.floor(difference / oneMinute); // 将差异转换为分钟并向下取整 |
| | | }, |
| | | formatDate(dat, type, addNum) { |
| | | if(!dat){ |
| | | if (!dat) { |
| | | return '-' |
| | | } |
| | | let date = new Date(dat) |
| | | if(addNum){ |
| | | if (addNum) { |
| | | date = new Date(date.setDate(date.getDate() + addNum)); |
| | | } |
| | | const year = date.getFullYear(); |
| | |
| | | } |
| | | typeof callback == 'function' && callback(theRequest); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 路径转base64 |
| | | * @param {Object} string |
| | |
| | | reject(error); |
| | | }; |
| | | // #endif |
| | | |
| | | |
| | | // #ifdef MP |
| | | if (uni.canIUse('getFileSystemManager')) { |
| | | uni.getFileSystemManager().readFile({ |
| | |
| | | }) |
| | | } |
| | | // #endif |
| | | |
| | | |
| | | // #ifdef APP-PLUS |
| | | plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { |
| | | entry.file((file) => { |
| | |
| | | // #endif |
| | | }) |
| | | }, |
| | | roundToTwo(num){ |
| | | if(isNaN(num)){ |
| | | roundToTwo(num) { |
| | | if (isNaN(num)) { |
| | | return 0 |
| | | } |
| | | return Math.round((num + Number.EPSILON) * 100) / 100; |
| | |
| | | } |
| | | }, |
| | | |
| | | } |
| | | } |