浏览代码

时间排序

yuanyuan 3 年之前
父节点
当前提交
6794222b2a
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14 6
      src/main/zhi-rong-web/src/views/Home.vue

+ 14 - 6
src/main/zhi-rong-web/src/views/Home.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="home">
         <banner></banner>
-        <div class="center-content" style="padding-top: 80px;">
+        <div class="center-content" style="padding-top: 80px">
             <div class="news">
                 <div class="carousel news-item" @mouseover="autoplay = false" @mouseout="autoplay = true">
                     <el-carousel ref="carousel" height="360px" arrow="never" trigger="hover" @change="changeCarousl">
@@ -9,7 +9,7 @@
                             <el-image
                                 :src="item.img"
                                 @click="all('/news')"
-                                style="width: 100%; height: 100%; cursor: pointer;"
+                                style="width: 100%; height: 100%; cursor: pointer"
                                 fit="cover"
                             ></el-image>
 
@@ -58,8 +58,8 @@
                         </router-link>
                     </div>
                     <div class="empty" v-else>
-                        <i class="el-icon-takeaway-box" style="margin-left: 24px;"></i>
-                        <div style="font-size: 20px;">暂无数据</div>
+                        <i class="el-icon-takeaway-box" style="margin-left: 24px"></i>
+                        <div style="font-size: 20px">暂无数据</div>
                     </div>
                 </div>
             </div>
@@ -322,7 +322,11 @@ export default {
     },
     created() {
         this.$http
-            .post('/policyLaw/all', { query: { category: 'NEWS', typeSettingId: 324 } }, { body: 'json' })
+            .post(
+                '/policyLaw/all',
+                { query: { category: 'NEWS', typeSettingId: 324 }, sort: 'issuedAt,desc' },
+                { body: 'json' }
+            )
             .then(res => {
                 this.newsList = res.content;
             });
@@ -340,7 +344,11 @@ export default {
             let name = item == '平台动态' ? 324 : 325;
             const typeSettingId = name;
             this.$http
-                .post('/policyLaw/all', { query: { category: 'NEWS', typeSettingId } }, { body: 'json' })
+                .post(
+                    '/policyLaw/all',
+                    { query: { category: 'NEWS', typeSettingId }, sort: 'issuedAt,desc' },
+                    { body: 'json' }
+                )
                 .then(res => {
                     this.newsList = res.content;
                 });