Browse Source

Merge branch 'HitSheep' of http://39.105.160.25:10880/post-project-ui/post-ui into HitSheep

zhouzenghui 2 years ago
parent
commit
33116b8a88
2 changed files with 36 additions and 58 deletions
  1. 7 0
      src/api/collection/collection.js
  2. 29 58
      src/views/collection/collectionList.vue

+ 7 - 0
src/api/collection/collection.js

@@ -7,4 +7,11 @@ export function addCollection(data) {
     method: 'post',
     data
   })
+}
+// 获取套系列表
+export function getCollection() {
+  return request({
+    url: '/post/collection/list' ,
+    method: 'get'
+  })
 }

+ 29 - 58
src/views/collection/collectionList.vue

@@ -8,71 +8,55 @@
 
     <!-- 数据栏 -->
     <div class="list-data">
-      <el-table border="true" :data="tableData" style="width: 100%">
+      <el-table border="true"  :data="tableData" style="width: 100%">
           <el-table-column
             align="center"
             label="ID"
             width="100"
-            prop="noticeId">
-            <template slot-scope="scope">
-              <span >{{ scope.row.id }}</span>
-            </template>
+            prop="collectionId">
+            
           </el-table-column>
 
           <el-table-column
             align="center"
             label="藏品名称"
+            prop= "collectionName"
             width="200">
-            <template slot-scope="scope">
-              <span >{{ scope.row.name }}</span>
-            </template>
+           
           </el-table-column>
-
-        
-
           <el-table-column
             align="center"
             label="售卖时间"
+            prop= "startTime"
+
             width="200">
-            <template slot-scope="scope">
-            
-              <span >{{ scope.row.time }}</span>
-            </template>
+           
           </el-table-column> 
 
           <el-table-column
             align="center"
             label="藏品价格(¥)"
+            prop= "collectionPrice"
+            
             width="200">
-            <template slot-scope="scope">
-              <span >{{ scope.row.price }}</span>
-            </template>
+           
           </el-table-column>
-
           <el-table-column
             align="center"
             label="藏品状态"
+            prop= "collectionStatus"
+
             width="200">
-            <template slot-scope="scope">
-                <div slot="reference" class="name-wrapper">
-                  <el-tag size="medium">{{ scope.row.state }}</el-tag>
-                </div>
             
-            </template>
           </el-table-column>
-
           <el-table-column
             align="center"
             label="数量(份)"
+            prop= "collectionCounts"
+            
             width="198">
-            <template slot-scope="scope">
-              <span >{{ scope.row.num }}</span>
-            </template>
+           
           </el-table-column>
-
-
-
-
           <el-table-column
             align="center"
             label="操作"
@@ -105,42 +89,28 @@
 </template>
 <script>
 import CollectionDetails from './collectionDetails.vue';
-
+import {getCollection}  from '../../api/collection/collection.js'
   export default{
     data(){
       return{
-        tableData: [
-        
-        {
-          id:62,
-          name: '返佣1',
-          date: '2016-05-02',
-          time:'2023-02-10:00:00-2023-02-16:00:00:00',
-          price:0.1,
-          state:'已售空',
-          num: 500,
-          
-        },
-        {
-          id:63,
-          name: '返佣2',
-          date: '2016-05-02',
-          time:'2023-02-10:00:00-2023-02-16:00:00:00',
-          price:2,
-          state:'正在售卖',
-          num: 2,
-          
-        },
-      ]
+        tableData:[]
       }
     },
+    mounted() {
+    this.getCollectionList();
+    },
     methods: {
       //藏品详情点击跳转 
-
       CollectionDetails(){
         this.$router.push("./collectionDetails")
+      },
+      getCollectionList() { 
+        getCollection().then((res)=>{
+          console.log(res);
+          this.tableData = res.rows; 
+          console.log(this.tableData);
+        })    
       }
-
     }
   }
 </script>
@@ -175,4 +145,5 @@ import CollectionDetails from './collectionDetails.vue';
 .bottom-page {
   float: right;
 }
+
 </style>