diff --git a/litemall-vue/src/mixin/item-card.js b/litemall-vue/src/mixin/item-card.js deleted file mode 100644 index d64910cd..00000000 --- a/litemall-vue/src/mixin/item-card.js +++ /dev/null @@ -1,22 +0,0 @@ -export default { - props: { - goods: { - type: Object, - default: () => ({}) - } - }, - - computed: { - goodsStatusToMe() { - const is_buy = this.goods.is_buy; - const is_collect = this.goods.is_collect; - return is_buy ? '我购买过' : is_collect ? '我收藏过' : ''; - } - }, - - methods: { - OnClick() { - this.$emit('click'); - } - } -}; diff --git a/litemall-vue/src/mixin/list-load-more.js b/litemall-vue/src/mixin/list-load-more.js deleted file mode 100644 index 29edd17f..00000000 --- a/litemall-vue/src/mixin/list-load-more.js +++ /dev/null @@ -1,70 +0,0 @@ -export default { - data() { - return { - pages: { - perPage: 8, - currPage: 1, - pageCount: 1 - }, - items: [], - loading: false, - finished: false, - isEmpty: false - }; - }, - - methods: { - async resetInit() { - this.resetData(); - // debugger; - const page = await this.initData(); - this.$nextTick(() => { - this.setPages(page); - }); - }, - isFinished() { - this.finished = true; - this.loading = false; - }, - async loadMore() { - console.log('loadmore'); - const vm = this; - if (vm.pages.pageCount < vm.pages.currPage) { - vm.$toast({ - message: '没有更多了~', - position: 'top' - }); - vm.isFinished(); - } else { - const page = await vm.initData(true); - vm.nextPage(page.pageCount); - } - vm.loading = false; - }, - nextPage(pageCount = 1) { - this.pages.currPage += 1; - this.pages.pageCount = pageCount; - }, - setPages(page = {}) { - this.isEmpty = page.totalCount === 0; - if (page.totalCount <= this.pages.perPage) { - // 不满一页 - this.isFinished(); - } else { - // 下一页 - this.nextPage(page.pageCount); - } - }, - resetData() { - this.items = []; - this.pages = { - perPage: 8, - currPage: 1, - pageCount: 1 - }; - this.loading = false; - this.finished = false; - this.isEmpty = false; - } - } -}; diff --git a/litemall-vue/src/mixin/load-more.js b/litemall-vue/src/mixin/load-more.js deleted file mode 100644 index 3b15f1cb..00000000 --- a/litemall-vue/src/mixin/load-more.js +++ /dev/null @@ -1,66 +0,0 @@ -export default { - data() { - return { - pages: { - perPage: 8, - currPage: 1, - pageCount: 1 - }, - loading: false, - finished: false, - isEmpty: false - }; - }, - - methods: { - async resetInit() { - this.resetData(); - const page = await this.initData(); - this.$nextTick(() => { - this.setPages(page); - }); - }, - isFinished() { - this.finished = true; - this.loading = false; - }, - async loadMore() { - console.log('loadmore'); - const { - pages: { pageCount, currPage } - } = this; - const finish = pageCount < currPage; - if (finish) { - this.isFinished(); - } else { - this.setPages(await this.initData(true)); - } - this.loading = false; - }, - nextPage(pageCount = 1) { - this.pages.currPage += 1; - this.pages.pageCount = pageCount; - this.loading = false; - }, - setPages(page = {}) { - this.isEmpty = page.totalCount === 0; - if (page.totalCount <= this.pages.perPage) { - // 不满一页 - this.isFinished(); - } else { - // 下一页 - this.nextPage(page.pageCount); - } - }, - resetData() { - this.pages = { - perPage: 8, - currPage: 1, - pageCount: 1 - }; - this.loading = true; - this.finished = false; - this.isEmpty = false; - } - } -}; diff --git a/litemall-vue/src/views/home/tabbar-home.vue b/litemall-vue/src/views/home/tabbar-home.vue index 67a5510e..20b0d7d7 100755 --- a/litemall-vue/src/views/home/tabbar-home.vue +++ b/litemall-vue/src/views/home/tabbar-home.vue @@ -113,7 +113,6 @@