Browse Source

上拉加载更多

master
yangrz 2 years ago
parent
commit
281e325bea
  1. 89
      agentApp/pages/history/history.vue
  2. 30
      agentApp/pages/merchant-index/index.vue
  3. 27
      agentApp/pages/user-orders/user-orders.vue
  4. 30
      agentApp/pages/withdrawal-history/withdrawal-history.vue

89
agentApp/pages/history/history.vue

@ -36,13 +36,14 @@
审核时间{{item.reviewed_at}}
</view>
</view>
<!-- <view class="hit-right">
<!-- <view class="hit-right">
<view class="amount">提现金额{{item.amount}}</view>
<view class="fee">手续费{{item.fee}}</view>
<view class="receive-amount">实到账{{item.receive_amount}}</view>
</view> -->
</view>
</view>
<view class="load-more" @click="getWithdrawList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view>
</template>
@ -55,65 +56,83 @@
data() {
return {
withdrawList: [],
hasMore: true,
page: 0,
};
},
onLoad() {
this.getWithdrawList()
},
onReachBottom() {
this.getWithdrawList()
},
methods: {
getWithdrawList() {
if (!this.hasMore) {
return
}
this.page++
agentWithdrawList({
page: 1,
page: this.page,
page_size: 15,
}).then(data => this.withdrawList = data.list)
}).then(data => {
this.withdrawList = [...this.withdrawList, ...data.list]
this.hasMore = data.has_more
})
}
}
}
</script>
<style lang="scss">
.his-content {
padding: 0 30rpx;
.his-content {
padding: 0 30rpx;
.his-item {
display: flex;
justify-content: space-between;
padding: 30rpx 0 30rpx;
.his-item {
display: flex;
justify-content: space-between;
padding: 30rpx 0 30rpx;
.hit-left {
.hit-left {
.his-name {
color: #454545;
font-size: 12px;
line-height: 1.8;
font-weight: bold;
}
.his-name {
color: #454545;
font-size: 12px;
line-height: 1.8;
font-weight: bold;
}
.his-state {
color: #666;
font-size: 12px;
line-height: 1.8;
.his-state {
color: #666;
font-size: 12px;
line-height: 1.8;
}
.his-time {
color: #999;
font-size: 12px;
line-height: 1.8;
}
}
.his-time {
color: #999;
font-size: 12px;
line-height: 1.8;
.hit-right {
height: 130rpx;
line-height: 130rpx;
font-size: 14px;
color: #454545;
font-weight: bold;
}
}
.hit-right {
height: 130rpx;
line-height: 130rpx;
font-size: 14px;
color: #454545;
font-weight: bold;
.u-border-bottom,
.u-border-top {
border-color: #eee !important;
}
}
.u-border-bottom,
.u-border-top {
border-color: #eee !important;
.load-more {
text-align: center;
font-size: 14px;
}
}
</style>
</style>

30
agentApp/pages/merchant-index/index.vue

@ -73,12 +73,9 @@
<view class="divider-style"></view>
</view>
</view>
</view>
</view>
</view>
<view class="load-more" @click="getOrderList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view>
</view>
</template>
<script>
@ -92,22 +89,34 @@
data() {
return {
accountInfo: {},
orderList: []
orderList: [],
hasMore: true,
page: 0,
}
},
onLoad() {
this.getAccountInfo()
this.getOrderList()
},
onReachBottom() {
this.getOrderList()
},
methods: {
getAccountInfo() {
merchantAccountInfo().then(data => this.accountInfo = data)
},
getOrderList() {
if (!this.hasMore) {
return
}
this.page++
merchantOrderList({
page: 1,
page: this.page,
page_size: 15
}).then(data => this.orderList = data.list)
}).then(data => {
this.orderList = [...this.orderList, ...data.list]
this.hasMore = data.has_more
})
},
orderRefund(item) {
uni.showModal({
@ -392,4 +401,9 @@
}
}
.load-more {
text-align: center;
font-size: 14px;
}
</style>

27
agentApp/pages/user-orders/user-orders.vue

@ -73,6 +73,8 @@
</view>
</view>
</view>
<view class="load-more" @click="getOrderList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view>
</view>
@ -90,7 +92,9 @@
return {
accountInfo: {},
queueList: [],
orderList: []
orderList: [],
hasMore: true,
page: 0,
}
},
onLoad() {
@ -98,6 +102,9 @@
this.getQueueList();
this.getOrderList();
},
onReachBottom() {
this.getOrderList()
},
methods: {
getAccountInfo() {
userAccountInfo().then(data => this.accountInfo = data)
@ -111,10 +118,17 @@
}).then(data => this.queueList = data.list)
},
getOrderList() {
if (!this.hasMore) {
return
}
this.page++
userOrderList({
page: 1,
page_size: 5
}).then(data => this.orderList = data.list)
page: this.page,
page_size: 15
}).then(data => {
this.orderList = [...this.orderList, ...data.list]
this.hasMore = data.has_more
})
},
}
}
@ -391,4 +405,9 @@
border-bottom: 1rpx solid #eee;
padding-bottom: 30rpx;
}
.load-more {
text-align: center;
font-size: 14px;
}
</style>

30
agentApp/pages/withdrawal-history/withdrawal-history.vue

@ -36,13 +36,14 @@
审核时间{{item.reviewed_at}}
</view>
</view>
<!-- <view class="hit-right">
<!-- <view class="hit-right">
<view class="amount">提现金额{{item.amount}}</view>
<view class="fee">手续费{{item.fee}}</view>
<view class="receive-amount">实到账{{item.receive_amount}}</view>
</view> -->
</view>
</view>
<view class="load-more" @click="getWithdrawList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view>
</template>
@ -55,17 +56,29 @@
data() {
return {
withdrawList: [],
hasMore: true,
page: 0,
};
},
onLoad() {
this.getWithdrawList()
},
onReachBottom() {
this.getWithdrawList()
},
methods: {
getWithdrawList() {
if (!this.hasMore) {
return
}
this.page++
userWithdrawList({
page: 1,
page: this.page,
page_size: 15,
}).then(data => this.withdrawList = data.list)
}).then(data => {
this.withdrawList = [...this.withdrawList, ...data.list]
this.hasMore = data.has_more
})
}
}
}
@ -106,15 +119,15 @@
font-size: 14px;
color: #454545;
font-weight: bold;
.amount {
font-size: 14px;
}
.fee {
font-size: 14px;
}
.receive_amount {
font-size: 14px;
}
@ -126,4 +139,9 @@
border-color: #eee !important;
}
}
.load-more {
text-align: center;
font-size: 14px;
}
</style>
Loading…
Cancel
Save