|
@@ -409,6 +409,7 @@ |
|
@@ -409,6 +409,7 @@ |
409
|
const tip = require('common/tip');
|
409
|
const tip = require('common/tip');
|
410
|
const yoho = require('yoho');
|
410
|
const yoho = require('yoho');
|
411
|
const share = require('common/share');
|
411
|
const share = require('common/share');
|
|
|
412
|
+ const bus = require('common/vue-bus');
|
412
|
|
413
|
|
413
|
require('vue-swipe/dist/vue-swipe.css');
|
414
|
require('vue-swipe/dist/vue-swipe.css');
|
414
|
|
415
|
|
|
@@ -498,6 +499,17 @@ |
|
@@ -498,6 +499,17 @@ |
498
|
});
|
499
|
});
|
499
|
}
|
500
|
}
|
500
|
});
|
501
|
});
|
|
|
502
|
+ },
|
|
|
503
|
+
|
|
|
504
|
+ /*
|
|
|
505
|
+ 刷新购物车
|
|
|
506
|
+ */
|
|
|
507
|
+ refreshCart: function() {
|
|
|
508
|
+ $.get('/product/cart-count.json').then(result=> {
|
|
|
509
|
+ if (result.code === 200) {
|
|
|
510
|
+ this.cartCount = result.data.cart_goods_count;
|
|
|
511
|
+ }
|
|
|
512
|
+ });
|
501
|
}
|
513
|
}
|
502
|
},
|
514
|
},
|
503
|
created() {
|
515
|
created() {
|
|
@@ -555,11 +567,8 @@ |
|
@@ -555,11 +567,8 @@ |
555
|
|
567
|
|
556
|
// 读取购物车数量
|
568
|
// 读取购物车数量
|
557
|
if (this.isApp) {
|
569
|
if (this.isApp) {
|
558
|
- $.get('/product/cart-count.json').then(result=> {
|
|
|
559
|
- if (result.code === 200) {
|
|
|
560
|
- this.cartCount = result.data.cart_goods_count;
|
|
|
561
|
- }
|
|
|
562
|
- });
|
570
|
+ this.refreshCart();
|
|
|
571
|
+ bus.on('app.shoppingcart,refresh', () => this.refreshCart);
|
563
|
}
|
572
|
}
|
564
|
}
|
573
|
}
|
565
|
};
|
574
|
};
|