|
|
@@ -3,8 +3,8 @@
|
|
|
<template #header>
|
|
|
<app-navbar title="我的推广" />
|
|
|
</template>
|
|
|
- <app-pull-refresh class="tradeData__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
|
|
|
- :updateList="dataList" @refresh="onRefresh" @updated="onRefreshUpdated">
|
|
|
+ <app-pull-refresh class="tradeData__container" :dataList="dataList" v-model:error="error"
|
|
|
+ v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
|
|
|
<template #header>
|
|
|
<div class="mine-generalize__header">
|
|
|
<div class="info">
|
|
|
@@ -30,7 +30,7 @@
|
|
|
<Empty />
|
|
|
</Tab>
|
|
|
</Tabs>
|
|
|
- <ul class="list list-row" v-if="showHeader">
|
|
|
+ <ul class="list list-row" v-if="dataList.length">
|
|
|
<li class="list-column">
|
|
|
<span>日期</span>
|
|
|
</li>
|
|
|
@@ -78,8 +78,9 @@ import AppQrcode from '@mobile/components/base/qrcode/index.vue'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
|
-const { dataList, pageIndex, pageCount, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
|
|
|
-const showHeader = shallowRef(false)
|
|
|
+const { pageIndex, pageCount, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
|
|
|
+const dataList = shallowRef<Model.THJTradeDataRsp[]>([])
|
|
|
+const error = shallowRef(false)
|
|
|
|
|
|
const { getUserId } = useLoginStore()
|
|
|
const showQRCode = shallowRef(false)
|
|
|
@@ -97,14 +98,18 @@ queryUserAccount({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const onRefresh = (callback: () => void) => {
|
|
|
- getQueryTHJTradeDataList(64201).finally(() => callback())
|
|
|
+const onRefresh = (finish: () => void) => {
|
|
|
+ getQueryTHJTradeDataList(64201).then((res) => {
|
|
|
+ if (pageIndex.value === 1) {
|
|
|
+ dataList.value = []
|
|
|
+ }
|
|
|
+ dataList.value.push(...res)
|
|
|
+ }).catch(() => {
|
|
|
+ error.value = true
|
|
|
+ }).finally(() => {
|
|
|
+ finish()
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
-const onRefreshUpdated = (data: Model.UserScoreLogRsp[]) => {
|
|
|
- showHeader.value = data.length > 0
|
|
|
-}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|