xuqiang 4 лет назад
Родитель
Сommit
156c85b4b9

+ 1 - 0
src/main/pc-space/src/components/FansInfo.vue

@@ -75,6 +75,7 @@ export default {
         .box {
             .flex();
             justify-content: space-between;
+            margin-bottom: 20px;
             .text {
                 .flex();
                 justify-content: space-between;

+ 10 - 0
src/main/pc-space/src/mixins/list.js

@@ -35,6 +35,16 @@ export default {
                     this.page = this.page + 1;
                 }
             });
+        },
+        onSearch() {
+            this.$router.push({
+                query: {
+                    ...this.$route.query,
+                    search: this.search
+                }
+            });
+            this.page = 1;
+            this.getData();
         }
     }
 };

+ 1 - 0
src/main/pc-space/src/mixins/pageableTable.js

@@ -67,6 +67,7 @@ export default {
                     body: 'json'
                 })
                 .then(res => {
+                    console.log(res);
                     this.fetchingData = false;
                     if (this.setList) {
                         this.setList(res.content);

+ 1 - 1
src/main/pc-space/src/router/index.js

@@ -13,7 +13,7 @@ import eventBus from '../eventBus';
 const routes = [
     {
         path: '/',
-        redirect: 'home'
+        redirect: 'mylikes'
     },
     {
         path: '/',

+ 0 - 1
src/main/pc-space/src/views/user/Give.vue

@@ -79,7 +79,6 @@ export default {
             return [...this.list]
                 .map((item, index) => {
                     return {
-                        search: this.search,
                         ...item,
                         index
                     };

+ 50 - 19
src/main/pc-space/src/views/user/MyLikes.vue

@@ -51,26 +51,15 @@
 
 <script>
 import { mapState } from 'vuex';
-import pageableTable from '../../mixins/pageableTable';
+import list from '../../mixins/list';
 export default {
     data() {
         return {
-            tableData: [
-                {
-                    id: 1104,
-                    name: '1',
-                    phone: '1',
-                    region: '1',
-                    price: 1,
-                    time: '12:20',
-                    status: '交易中',
-                    address: '1 1518 弄'
-                }
-            ],
+            tableData: [],
             typeList: [
                 {
                     label: '全部',
-                    value: ''
+                    value: 'PROCESSING,FINISH'
                 },
                 {
                     label: '交易中',
@@ -81,19 +70,58 @@ export default {
                     value: 'FINISH'
                 }
             ],
-            list: [],
+            type: 'PROCESSING,FINISH',
+            url: '/order/all',
             search: '',
-            type: ''
+            list: []
         };
     },
-    mixins: [pageableTable],
+    mixins: [list],
 
     computed: {
         ...mapState(['userInfo'])
     },
-    mounted() {},
+    watch: {
+        type() {
+            this.$router
+                .replace({
+                    search: this.search,
+                    query: {
+                        userId: this.userInfo.id,
+                        type: this.type
+                    }
+                })
+                .catch(() => {});
+            this.getData();
+            this.tableData = this.list;
+        }
+    },
+    mounted() {
+        this.getData();
+        this.tableData = this.list;
+    },
     methods: {
-        handleClick() {}
+        beforeData() {
+            return {
+                search: this.search,
+                query: {
+                    userId: this.userInfo.id,
+                    status: this.type
+                }
+            };
+        },
+        handleClick(row) {
+            this.$confirm('确定删除该订单吗?', '警告', {
+                confirmButtonText: '确定',
+                cancelButtonText: '退出',
+                type: 'warning'
+            }).then(() => {
+                this.$http.get('/order/del' + row.id).then(() => {
+                    this.getData();
+                    console.log('删除成功');
+                });
+            });
+        }
     }
 };
 </script>
@@ -108,6 +136,9 @@ export default {
         color: #ffffff;
     }
 }
+/deep/ .el-table__empty-block {
+    background: #1c1e26 !important;
+}
 .search {
     background: #1a1a1a;
     width: 280px;