增加登录之前的一次传送

This commit is contained in:
魏啾
2024-10-24 15:07:59 +08:00
parent 4e5b31b2e6
commit 1fbf346aec
14 changed files with 5432 additions and 99 deletions

View File

@@ -28,8 +28,7 @@
</view>
</view>
<view class="empty-wrap">
<view class="empty" v-if="!list.length"><u-empty text="暂无数据"
:icon="require('@/static/icon_empty.png')"></u-empty></view>
<u-loadmore :status="form.status" fontSize="16" color="#999" iconSize="16" />
</view>
</view>
</template>
@@ -38,12 +37,28 @@
export default {
data() {
return {
list: []
list: [],
form: {
page: 1,
status: 'loadmore',
},
};
},
onShow() {
this.storeinvoicelist()
this.list = []
this.form = {
page: 1,
status: 'loadmore',
},
this.storeinvoicelist()
},
onReachBottom() {
if (this.form.status != 'nomore') {
this.form.page = ++this.form.page;
this.storeinvoicelist()
}
},
methods: {
clickoange(e) {
@@ -61,10 +76,25 @@
}
},
async storeinvoicelist() {
this.form.status = 'loading';
let res = await this.api.storeinvoicelist({
store_id: uni.getStorageSync('userId')
store_id: uni.getStorageSync('userId'),
page: this.form.page
})
this.list = res.data
if (this.form.page == 1 && res.data.list.length == 0) {
this.form.status = 'nomore'
return false;
} else {
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
if (res.data.list.length < 10) {
this.form.status = 'nomore';
} else {
this.form.status = 'loadmore';
}
}, 500)
}
},
}
}