Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
8 years ago
Commit
db930c41ae7642bb085864d896cf8e43b8455432
1 parent
e131ce6c
fixed: 列表页添加购物车
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
public/vue/component/header.vue
public/vue/product/shop/shop-box.vue
public/vue/component/header.vue
View file @
db930c4
...
...
@@ -175,7 +175,7 @@
}
.right-btn {
font-size:
38px
;
font-size:
17PX
;
margin-right: 30px;
}
}
...
...
public/vue/product/shop/shop-box.vue
View file @
db930c4
...
...
@@ -5,6 +5,7 @@
<product-list :data="productList" :state="listState"></product-list>
</div>
<filter-box :val="order" :filter="filterConfig" v-if="enableOrder" ref="filter"></filter-box>
<shopping-bag :cart-count="cartCount" v-if="isApp"></shopping-bag>
</div>
</template>
<style>
...
...
@@ -35,6 +36,8 @@
import shopTop from 'product/shop/shop-top.vue'; // 店铺头部信息
import ProductList from 'component/product/list.vue';
import FilterBox from 'component/product/filter/index.vue';
import ShoppingBag from 'component/product/shopping-bag.vue';
const $shop = $('#shop');
...
...
@@ -44,6 +47,7 @@
export default {
data() {
return {
isApp: yoho.isApp,
noheader: false,
shareData: {}, // 分享相关数据
shopInfo: {}, // 店铺介绍相关数据
...
...
@@ -64,6 +68,7 @@
inSearching: false,
enableOrder: false,
order: '',
cartCount: 0
};
},
computed: {
...
...
@@ -178,13 +183,22 @@
this.page = 0;
this.productList = [];
this.search();
},
refreshCart: function() {
$.get('/product/cart-count.json').then(result=> {
if (result.code === 200) {
this.cartCount = result.data.cart_goods_count;
}
});
}
},
components: {
topBar,
shopTop,
ProductList,
FilterBox
FilterBox,
ShoppingBag
},
created() {
const self = this;
...
...
@@ -219,6 +233,12 @@
self.filter = val;
self.$refs.filter.isVisible = false;
});
// 读取购物车数量
if (this.isApp) {
this.refreshCart();
bus.$on('app.shoppingcart.refresh', this.refreshCart);
}
}
};
...
...
Please
register
or
login
to post a comment