273c8980 by 任超

style:新闻

1 parent baf6d5b5
...@@ -21,9 +21,11 @@ function LoadNewsData(currentPage) { ...@@ -21,9 +21,11 @@ function LoadNewsData(currentPage) {
21 dataType: "json", 21 dataType: "json",
22 //数据,这里使用的是Json格式进行传输 22 //数据,这里使用的是Json格式进行传输
23 success: function (result) { 23 success: function (result) {
24 data.total = result.data.total;
25 if (result.code == 200 && result.data != null) { 24 if (result.code == 200 && result.data != null) {
25 data.total = result.data.total;
26 data.list = result.data.records; 26 data.list = result.data.records;
27 }else {
28 data.total = 0;
27 } 29 }
28 layui.use('laytpl', function () { 30 layui.use('laytpl', function () {
29 laytpl = layui.laytpl; 31 laytpl = layui.laytpl;
...@@ -103,8 +105,11 @@ layui.use('laypage', function () { ...@@ -103,8 +105,11 @@ layui.use('laypage', function () {
103 } 105 }
104 } 106 }
105 }); 107 });
108 if(data.total ==0) {
109 $('#page').hide();
110 }
106 }) 111 })
107 var data = { //数据 112 var data = { //数据
108 "list": [], 113 "list": [],
109 total: undefined 114 total: 0
110 }; 115 };
...\ No newline at end of file ...\ No newline at end of file
......