Pārlūkot izejas kodu

fix: 修复页码未重置问题

zhangyuhan 3 gadi atpakaļ
vecāks
revīzija
88856f7fbd

+ 0 - 4
src/web/staticres/dataExport/js/pageination.ie.js

@@ -32,10 +32,6 @@ function _createClass(Constructor, protoProps, staticProps) {
   return Constructor;
 }
 
-/**
- * @file pageination.js
- * @author zhangyuhan2016 <hi_zhangyuhan@163.com>
- */
 var Page =
     /*#__PURE__*/
     (function() {

+ 20 - 16
src/web/templates/pc/myOrder.html

@@ -605,22 +605,26 @@
     return Y + M + D;
   }
 
-  function showPageCount (data) {
-    if (!window.pageCountFn) {
-      window.pageCountFn = new Page({
-        show: 5,
-        total: data.count,
-        size: data.pageSize,
-        click: function (number, type) {
-          var $Index = $(".order_tab span.tab_item.active").index();
-          orderListForVue.changeAjaxParams({
-            tabIndex: $Index,
-            pageNum: number
-          })
-        }
-      })
-      pageCountFn.init()
+  function showPageCount (data, pageNum) {
+    if (!window.clonePageTemplate) {
+      window.clonePageTemplate = $('.pagination-box').clone().html()
     }
+    $('.pagination-box').html(window.clonePageTemplate)
+
+    window.pageCountFn = new Page({
+      show: 5,
+      now: pageNum || 1,
+      total: data.count,
+      size: data.pageSize,
+      click: function (number, type) {
+        var $Index = $(".order_tab span.tab_item.active").index();
+        orderListForVue.changeAjaxParams({
+          tabIndex: $Index,
+          pageNum: number
+        })
+      }
+    })
+    pageCountFn.init()
   }
 
   var orderListForVue = new Vue({
@@ -1318,7 +1322,7 @@
                 })
                 _this.$set(_this.$data, 'list', data.res)
                 $(".pagination-box").show()
-                showPageCount(data)
+                showPageCount(data, _this.pageNum)
                 if (data.count <= data.pageSize) {
                   $(".pagination-box").hide()
                 }