Commit 18a100d0 by weijiguang

切换店铺清空购物车

parent 83b3a187
...@@ -126,6 +126,12 @@ export default { ...@@ -126,6 +126,12 @@ export default {
getShopMenus(params) { getShopMenus(params) {
$EventBus.$off('getMenuList'); $EventBus.$off('getMenuList');
$EventBus.$on('getMenuList', (data) => { $EventBus.$on('getMenuList', (data) => {
console.log("shop:"+data.id);
if(this.shopInfo && this.shopInfo.id != data.id) {
// 切换店铺清空购物车
uni.removeStorageSync('shopCarInfo');
$EventBus.$emit('updateCar');
}
this.shopInfo = data; this.shopInfo = data;
this.getMenuList(data.id); this.getMenuList(data.id);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment