提交 1e9c0c4a authored 作者: pengxiaohui's avatar pengxiaohui

bug修复

上级 e9fe17cf
...@@ -92,16 +92,6 @@ export default { ...@@ -92,16 +92,6 @@ export default {
} }
}, },
methods: { methods: {
initFetchList() {
this.goodsList = []
this.loading = false
this.finished = false
this.refreshing = false
this.page_size = '10'
this.page = '0'
this.total = 0
this.fetchGoodsList()
},
handleClick(val) { handleClick(val) {
this.$router.push({ path: 'buy', query: { spu_id: val.spu_id, shop_id: val.shop_id } }) this.$router.push({ path: 'buy', query: { spu_id: val.spu_id, shop_id: val.shop_id } })
}, },
...@@ -123,17 +113,14 @@ export default { ...@@ -123,17 +113,14 @@ export default {
return '' return ''
} }
}, },
onRefresh() { initFetchList() {
this.finished = false;
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this.loading = true;
this.page = '0'
this.goodsList = [] this.goodsList = []
this.goodsListLoad(); this.loading = false
console.log(1243) this.finished = false
}, this.refreshing = false
goodsListLoad() { this.page_size = '10'
this.page = '0'
this.total = 0
this.fetchGoodsList() this.fetchGoodsList()
}, },
fetchGoodsList() { fetchGoodsList() {
...@@ -147,7 +134,6 @@ export default { ...@@ -147,7 +134,6 @@ export default {
} }
getGoodsList(params).then(res => { getGoodsList(params).then(res => {
if (res.code === 0 && res.msg === '成功') { if (res.code === 0 && res.msg === '成功') {
console.log(this.goodsList)
this.goodsList = this.goodsList.concat(res.data) this.goodsList = this.goodsList.concat(res.data)
} else { } else {
this.goodsList = [] this.goodsList = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论