|
|
@@ -30,9 +30,45 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
} else {
|
|
|
$scope.tab = 'waitOffer';
|
|
|
}
|
|
|
+ var _formatDate = function (date, fmt) {
|
|
|
+ if (!date) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (typeof date === 'string') {
|
|
|
+ date = new Date(Date.parse(date.replace(/-/g, '/')));
|
|
|
+ }
|
|
|
+ var o = {
|
|
|
+ 'M+': date.getMonth() + 1, // 月份
|
|
|
+ 'd+': date.getDate(), // 日
|
|
|
+ 'h+': date.getHours(), // 小时
|
|
|
+ 'm+': date.getMinutes(), // 分
|
|
|
+ 's+': date.getSeconds(), // 秒
|
|
|
+ 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
|
|
|
+ 'S': date.getMilliseconds() // 毫秒
|
|
|
+ }
|
|
|
+ if (/(y+)/.test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
|
+ }
|
|
|
+ for (var k in o) {
|
|
|
+ if (new RegExp('(' + k + ')').test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fmt;
|
|
|
+ }
|
|
|
|
|
|
- // 发布时间
|
|
|
- $scope.dateArea = 'sevenDay';
|
|
|
+ var _getClearDay = function (date) {
|
|
|
+ return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
|
|
|
+ }
|
|
|
+ var init = function () {
|
|
|
+
|
|
|
+ // 发布时间
|
|
|
+ $scope.dateArea = 'sevenDay';
|
|
|
+ var currentTime = _getClearDay(new Date());
|
|
|
+ $scope.startDate = new Date(currentTime - 6 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
|
|
|
+ }
|
|
|
+ init()
|
|
|
|
|
|
// 更换待报价状态
|
|
|
$scope.vendorType = 'self'
|
|
|
@@ -1164,36 +1200,6 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
}
|
|
|
});
|
|
|
// 筛选
|
|
|
- var _formatDate = function (date, fmt) {
|
|
|
- if (!date) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (typeof date === 'string') {
|
|
|
- date = new Date(Date.parse(date.replace(/-/g, '/')));
|
|
|
- }
|
|
|
- var o = {
|
|
|
- 'M+': date.getMonth() + 1, // 月份
|
|
|
- 'd+': date.getDate(), // 日
|
|
|
- 'h+': date.getHours(), // 小时
|
|
|
- 'm+': date.getMinutes(), // 分
|
|
|
- 's+': date.getSeconds(), // 秒
|
|
|
- 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
|
|
|
- 'S': date.getMilliseconds() // 毫秒
|
|
|
- }
|
|
|
- if (/(y+)/.test(fmt)) {
|
|
|
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
|
- }
|
|
|
- for (var k in o) {
|
|
|
- if (new RegExp('(' + k + ')').test(fmt)) {
|
|
|
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
|
- }
|
|
|
- }
|
|
|
- return fmt;
|
|
|
- }
|
|
|
-
|
|
|
- var _getClearDay = function (date) {
|
|
|
- return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
|
|
|
- }
|
|
|
|
|
|
$scope.setFilters = function (type, val) {
|
|
|
$scope[type] = val;
|
|
|
@@ -1205,13 +1211,13 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
$scope.startDate = null;
|
|
|
$scope.endDate = null;
|
|
|
} else if (val == 'oneDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 24 * 60 * 60 * 1000);
|
|
|
+ $scope.startDate = new Date(currentTime);
|
|
|
$scope.endDate = endDate;
|
|
|
} else if (val == 'threeDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 3 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.startDate = new Date(currentTime - 2 * 24 * 60 * 60 * 1000);
|
|
|
$scope.endDate = endDate;
|
|
|
} else if (val == 'sevenDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 7 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.startDate = new Date(currentTime - 6 * 24 * 60 * 60 * 1000);
|
|
|
$scope.endDate = endDate;
|
|
|
} else {
|
|
|
$scope.startDate = null;
|