xuqiang 4 лет назад
Родитель
Сommit
771b22d9a3

+ 34 - 3
src/main/nine-space/src/components/order/OrderInfo.vue

@@ -31,7 +31,7 @@
         </div>
 
         <div class="btns">
-            <van-button color="#939599" @click.prevent="" plain size="mini" round> 删除订单 </van-button>
+            <van-button color="#939599" @click.prevent="del" plain size="mini" round> 删除订单 </van-button>
         </div>
     </router-link>
 </template>
@@ -39,6 +39,7 @@
 <script>
 import order from '../../mixins/order';
 import product from '../../mixins/product';
+import list from '../../mixins/list';
 export default {
     props: {
         info: {
@@ -50,13 +51,43 @@ export default {
     },
     setup() {
         const click = function () {
-            console.log('wyt6w');
+            // console.log('wyt6w');
         };
 
         return { click };
     },
-    mixins: [order, product],
+    data() {
+        return {
+            url: '/order/all'
+        };
+    },
+    mixins: [order, product, list],
     methods: {
+        beforeData() {
+            return {
+                search: this.search,
+                query: {
+                    userId: this.userInfo.id,
+                    status: this.type,
+                    hide: false,
+                    del: false
+                }
+            };
+        },
+        del() {
+            this.$http
+                .post('/order/hide/', {
+                    id: this.info.id
+                })
+                .then(() => {
+                    this.getData();
+                    //hide:false
+                    // this.$message.success('删除成功');
+                    // setTimeout(() => {
+                    //     this.getData();
+                    // }, 1000);
+                });
+        },
         likeProduct() {
             if (!this.info.liked) {
                 this.$http.get(`/collection/${this.info.id}/like`).then(() => {

+ 14 - 8
src/main/pc-space/src/views/user/CollectionOrder.vue

@@ -142,7 +142,9 @@ export default {
                 search: this.search,
                 query: {
                     userId: this.userInfo.id,
-                    status: this.type
+                    status: this.type,
+                    hide: false,
+                    del: false
                 }
             };
         },
@@ -156,13 +158,17 @@ export default {
                 customClass: 'myClass',
                 type: 'warning'
             }).then(() => {
-                this.$http.post('/order/hide/' + row.id).then(() => {
-                    //hide:false
-                    this.$message.success('删除成功');
-                    setTimeout(() => {
-                        this.getData();
-                    }, 1000);
-                });
+                this.$http
+                    .post('/order/hide/', {
+                        id: row.id
+                    })
+                    .then(() => {
+                        //hide:false
+                        this.$message.success('删除成功');
+                        setTimeout(() => {
+                            this.getData();
+                        }, 1000);
+                    });
             });
         }
     }

+ 3 - 1
src/main/pc-space/src/views/user/OrderValue.vue

@@ -84,7 +84,9 @@ export default {
             return {
                 search: this.search,
                 query: {
-                    userId: this.userInfo.id
+                    userId: this.userInfo.id,
+                    hide: false,
+                    del: false
                 }
             };
         },

+ 14 - 7
src/main/pc-space/src/views/user/PayRecord.vue

@@ -91,7 +91,9 @@ export default {
             return {
                 search: this.search,
                 query: {
-                    userId: this.userInfo.id
+                    userId: this.userInfo.id,
+                    hide: false,
+                    del: false
                 }
             };
         },
@@ -106,12 +108,17 @@ export default {
                 customClass: 'myClass',
                 type: 'warning'
             }).then(() => {
-                this.$http.post('/order/del/' + row.id).then(() => {
-                    this.$message.success('删除成功');
-                    setTimeout(() => {
-                        this.getData();
-                    }, 1000);
-                });
+                this.$http
+                    .post('/order/hide/', {
+                        id: row.id
+                    })
+                    .then(() => {
+                        //hide:false
+                        this.$message.success('删除成功');
+                        setTimeout(() => {
+                            this.getData();
+                        }, 1000);
+                    });
             });
         }
     }

+ 14 - 7
src/main/pc-space/src/views/user/TransactionOrdes.vue

@@ -90,7 +90,9 @@ export default {
             return {
                 search: this.search,
                 query: {
-                    userId: this.userInfo.id
+                    userId: this.userInfo.id,
+                    hide: false,
+                    del: false
                 }
             };
         },
@@ -104,12 +106,17 @@ export default {
                 customClass: 'myClass',
                 type: 'warning'
             }).then(() => {
-                this.$http.post('/order/del/' + row.id).then(() => {
-                    this.$message.success('删除成功');
-                    setTimeout(() => {
-                        this.getData();
-                    }, 1000);
-                });
+                this.$http
+                    .post('/order/hide/', {
+                        id: row.id
+                    })
+                    .then(() => {
+                        //hide:false
+                        this.$message.success('删除成功');
+                        setTimeout(() => {
+                            this.getData();
+                        }, 1000);
+                    });
             });
         }
     }