nanshan 2 lat temu
rodzic
commit
a00bb1e49b

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

@@ -0,0 +1,9 @@
+import request from "@/utils/request";
+
+// 藏品列表
+export function collectionList(params){
+    return request({
+      url:'/system/collections/list',
+      params
+    })
+  }

+ 151 - 3
src/views/sets/collectionList.vue

@@ -1,5 +1,153 @@
 <template>
-    <div>
-        藏品列表界面
+  <div>
+    <div class="header">
+      <el-row :style="{ margin: '12px' }">
+        <el-col :span="12">
+          <i class="el-icon-search"></i>
+          <span :style="{ padding: '4px' }">藏品列表</span>
+        </el-col>
+        
+      </el-row>
     </div>
-</template>
+    <div class="footer">
+      <el-table  border :data="tableData" style="width: 100%">
+        <el-table-column
+          label="id"
+          width="110"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.collectionId }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+        prop="collectionTitle"
+          label="藏品名称"
+          width="220"
+          align="center"
+        >
+        <template slot-scope="scope">
+            <span>{{ scope.row.collectionTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          prop="showStart"
+          label="售卖时间"
+          width="280"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.showStart }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          prop="colPrice"
+          label="藏品价格"
+          width="190"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.colPrice }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          prop="status"
+          label="藏品状态"
+          width="220"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.status }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="colCount"
+          label="数量"
+          width="180"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.colCount }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="edit" label="操作" width="280" align="center">
+          <el-row>
+            <el-button type="text" @click="coldetails">藏品详情</el-button>
+            <el-button type="text" @click="">兑换详情</el-button>
+          </el-row>
+        </el-table-column>
+      </el-table>
+
+      <el-pagination
+        @current-change="handleCurrentChange"
+        background
+        layout="total, prev, pager, next"
+        :total="total"
+        id="page"
+        :page-size="10"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+<script>
+import { collectionList } from "../../api/collection/collection";
+export default {
+  data() {
+    return {
+      pageInfo: {
+        // 分页信息
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 1,
+      tableData: [
+        {
+          collectionId: "1",
+          collectionTitle: "藏品1",
+          showStart: "2023-02-10:00:00-2023-02-16:00:00:00",
+          colPrice: 0.1,
+          colCount: 500,
+          status: "售卖中...",
+        },
+      ],
+    };
+  },
+  mounted() {
+    // this.getcollectionList();
+  },
+  methods: {
+    coldetails(){
+        this.$router.push("./collectionDetails");
+    },
+    getcollectionList() {
+      collectionList(this.pageInfo).then((res) => {
+        this.total = res.total;
+        this.tableData = res.rows;
+      });
+    },
+    handleCurrentChange(newPage) {
+      this.pageInfo.pageNum = newPage;
+    },
+  },
+};
+</script>
+<style scoped>
+.header {
+  height: 60px;
+  margin-top: 20px;
+  margin: 16px;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+}
+.footer {
+  width: 100%;
+  display: inline-block;
+  margin: 16px;
+}
+</style>

+ 0 - 17
src/views/sets/setList.vue

@@ -168,23 +168,6 @@ export default {
 
   mounted() {
     this.setsList();
-
-    var date = new Date();
-    var YY = date.getFullYear() + "-";
-    var MM =
-      (date.getMonth() + 1 < 10
-        ? "0" + (date.getMonth() + 1)
-        : date.getMonth() + 1) + "-";
-    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
-    var hh =
-      (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
-    var mm =
-      (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
-      ":";
-    var ss =
-      date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
-    this.thisTime = YY + MM + DD + " " + hh + mm + ss;
-    console.log(this.thisTime);
   },
   methods: {
     handleCurrentChange(newPage) {