yuanyuan 3 лет назад
Родитель
Сommit
a9e8a70ffc
1 измененных файлов с 10 добавлено и 5 удалено
  1. 10 5
      src/views/product/Detail.vue

+ 10 - 5
src/views/product/Detail.vue

@@ -935,11 +935,13 @@ export default {
                     }
                 });
         },
-        getProduct() {
-            this.$toast.loading({
-                message: '加载中...',
-                forbidClick: true
-            });
+        getProduct(load = false) {
+            if (!load) {
+                this.$toast.loading({
+                    message: '加载中...',
+                    forbidClick: true
+                });
+            }
             return this.$http
                 .get('/collection/get/' + this.collectionId)
                 .then(res => {
@@ -1120,6 +1122,9 @@ export default {
                         this.$toast.success('恭喜加入购物车');
                         this.getCartNum();
                         this.$refs.sale.getData(true);
+                        setTimeout(() => {
+                            this.getProduct(true);
+                        }, 1000);
                     })
                     .catch(e => {
                         this.$toast(e.error);