Browse Source

处理bug

wangcz 7 years ago
parent
commit
e3cd6d8656

+ 3 - 3
src/main/webapp/resources/js/usercenter/controllers/forstore/pay_center_ctrl.js

@@ -270,13 +270,13 @@ define(['app/app'], function(app) {
 					$scope.startDate = null;
 					$scope.endDate = null;
 				} else if (val == 'oneMonth') {
-					$scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000);
+					$scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
 					$scope.endDate = endDate;
 				} else if (val == 'threeMonth') {
-					$scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000);
+					$scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
 					$scope.endDate = endDate;
 				} else if (val == 'sixMonth') {
-					$scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000);
+					$scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
 					$scope.endDate = endDate;
 				} else {
 					$scope.startDate = null;

+ 41 - 35
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -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;

+ 3 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/pay_center_ctrl.js

@@ -204,13 +204,13 @@ define(['app/app'], function(app) {
                     $scope.startDate = null;
                     $scope.endDate = null;
                 } else if (val == 'oneMonth') {
-                    $scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000);
+                    $scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
                     $scope.endDate = endDate;
                 } else if (val == 'threeMonth') {
-                    $scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000);
+                    $scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
                     $scope.endDate = endDate;
                 } else if (val == 'sixMonth') {
-                    $scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000);
+                    $scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
                     $scope.endDate = endDate;
                 } else {
                     $scope.startDate = null;

+ 4 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -44,7 +44,7 @@ define(['app/app'], function (app) {
                 // 发布时间
                 $scope.dateArea = 'sevenDay';
                 var currentTime = _getClearDay(new Date());
-                $scope.startDate = new Date(currentTime - 7 * 24 * 60 * 60 * 1000);
+                $scope.startDate = new Date(currentTime - 6 * 24 * 60 * 60 * 1000);
                 $scope.endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
             }
 
@@ -325,13 +325,13 @@ define(['app/app'], function (app) {
                           $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;

+ 4 - 4
src/main/webapp/resources/view/usercenter/forstore/pay_center.html

@@ -479,12 +479,12 @@
 <div class="user_right fr" id="pay_center">
 	<!--支付中心-->
 	<div class="pay_record oder">
-		<!--<div class="oder01" style="margin-bottom: 16px;">
+		<div class="oder01" style="margin-bottom: 16px;">
 			<ul>
-				<li ng-class="{'active' : status=='pay-history'}" ng-click="toggleStatus('pay-history')"><a href="javascript:void(0)">交易记录</a></li>
-				<li ng-class="{'active' : status=='pay-info'}" ng-click="toggleStatus('pay-info')"><a href="javascript:void(0)">付款账户</a></li>
+				<!--<li ng-class="{'active' : status=='pay-history'}" ng-click="toggleStatus('pay-history')"><a href="javascript:void(0)">交易记录</a></li>-->
+				<li class="active"><a href="javascript:void(0)">应付对账</a></li>
 			</ul>
-		</div>-->
+		</div>
 		<!--支付中心列表-->
 		<div class="ticket_record_list">
 			<!-- 支付信息-->

+ 4 - 4
src/main/webapp/resources/view/vendor/forstore/pay_center.html

@@ -677,12 +677,12 @@
 <div class="user_right fr" id="pay_center">
     <!--支付中心-->
     <div class="pay_record oder">
-      <!--  <div class="oder01">
+      <div class="oder01">
             <ul>
-                <li ng-click="setTab('paymentRecord')" ng-class="{'active' : tab == 'paymentRecord'}"><a href="javascript:void(0)">交易记录</a></li>
-                <li ng-click="setTab('accountTab')" ng-class="{'active' : tab == 'accountTab'}"><a href="javascript:void(0)">收款帐户</a></li>
+                <!--<li ng-click="setTab('paymentRecord')" ng-class="{'active' : tab == 'paymentRecord'}"><a href="javascript:void(0)">交易记录</a></li>-->
+                <li ng-class="{'active' : tab == 'accountTab'}"><a href="javascript:void(0)">应收对账</a></li>
             </ul>
-        </div>-->
+        </div>
         <!--支付中心列表-->
         <div class="ticket_record_list">
             <!-- 交易记录-->