1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
-
-
- <mescroll-uni :ref="'mescrollRef'+i" @init="mescrollInit" height="100%" top="60" :down="downOption" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
-
- <good-list :list="goods"></good-list>
- </mescroll-uni>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
- import {apiSearch} from "@/api/mock.js"
-
- export default {
- mixins: [MescrollMixin,MescrollMoreItemMixin],
- data() {
- return {
- downOption:{
- auto:false
- },
- upOption:{
- auto:false,
-
-
-
-
- noMoreSize: 4,
- empty:{
- tip: '~ 空空如也 ~',
- btnText: '去看看'
- }
- },
- goods: []
- }
- },
- props:{
- i: Number,
- index: {
- type: Number,
- default(){
- return 0
- }
- },
- tabs: {
- type: Array,
- default(){
- return []
- }
- }
- },
- methods: {
-
- downCallback() {
-
-
-
- this.mescroll.resetUpScroll()
- },
-
- upCallback(page) {
-
- let keyword = this.tabs[this.i].name
- apiSearch(page.num, page.size, keyword).then(curPageData=>{
-
- this.mescroll.endSuccess(curPageData.length);
-
- if(page.num == 1) this.goods = [];
- this.goods=this.goods.concat(curPageData);
- }).catch(()=>{
-
- this.mescroll.endErr();
- })
- },
-
- emptyClick(){
- uni.showToast({
- title:'点击了按钮,具体逻辑自行实现'
- })
- }
- }
- }
- </script>
|