2 Commits

Author SHA1 Message Date
yangrz 8aaedcdcef 排队列表 2 years ago
yangrz 281e325bea 上拉加载更多 2 years ago
  1. 23
      agentApp/pages/history/history.vue
  2. 28
      agentApp/pages/merchant-index/index.vue
  3. 96
      agentApp/pages/queuing-information/queuing-information.vue
  4. 27
      agentApp/pages/user-orders/user-orders.vue
  5. 22
      agentApp/pages/withdrawal-history/withdrawal-history.vue

23
agentApp/pages/history/history.vue

@ -43,6 +43,7 @@
</view> --> </view> -->
</view> </view>
</view> </view>
<view class="load-more" @click="getWithdrawList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view> </view>
</template> </template>
@ -55,17 +56,29 @@
data() { data() {
return { return {
withdrawList: [], withdrawList: [],
hasMore: true,
page: 0,
}; };
}, },
onLoad() { onLoad() {
this.getWithdrawList() this.getWithdrawList()
}, },
onReachBottom() {
this.getWithdrawList()
},
methods: { methods: {
getWithdrawList() { getWithdrawList() {
if (!this.hasMore) {
return
}
this.page++
agentWithdrawList({ agentWithdrawList({
page: 1,
page: this.page,
page_size: 15, page_size: 15,
}).then(data => this.withdrawList = data.list)
}).then(data => {
this.withdrawList = [...this.withdrawList, ...data.list]
this.hasMore = data.has_more
})
} }
} }
} }
@ -115,5 +128,11 @@
.u-border-top { .u-border-top {
border-color: #eee !important; border-color: #eee !important;
} }
}
.load-more {
text-align: center;
font-size: 14px;
} }
</style> </style>

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

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

96
agentApp/pages/queuing-information/queuing-information.vue

@ -1,80 +1,78 @@
<template> <template>
<view class="app-container"> <view class="app-container">
<u-tabs :list="list" lineColor="#F52F3E" @click="change" lineWidth="160rpx" @change="change"
itemStyle="padding-left: 0; padding-right: 0;width: 50%; height: 90rpx;font-size: 14px"
lineHeight="2"
<u-tabs :list="tabList" lineColor="#F52F3E" lineWidth="160rpx" @change="change"
itemStyle="padding-left: 0; padding-right: 0;width: 50%; height: 90rpx;font-size: 14px" lineHeight="2"
:activeStyle="{ :activeStyle="{
color: '#F52F3E' color: '#F52F3E'
}"
></u-tabs>
}"></u-tabs>
<u-gap height="10rpx" bgColor="#F7F7F7"></u-gap> <u-gap height="10rpx" bgColor="#F7F7F7"></u-gap>
<view class="his-content"> <view class="his-content">
<view class="his-item u-border-bottom">
<view class="his-item u-border-bottom" v-for="item in queueList" :key="item.id">
<view class="hit-left"> <view class="hit-left">
<view class="his-name"> <view class="his-name">
李姐烧烤普罗旺斯店
{{item.merchant.name}}
</view> </view>
</view> </view>
<view class="hit-right"> <view class="hit-right">
购买时排队<span class="text-style">10</span> 当前 2
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
李姐烧烤普罗旺斯店
</view>
</view>
<view class="hit-right">
购买时排队<span class="text-style">10</span> 当前 2
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
李姐烧烤普罗旺斯店
</view>
</view>
<view class="hit-right">
购买时排队<span class="text-style">10</span> 当前 2
</view>
</view>
<view class="his-item u-border-bottom">
<view class="hit-left">
<view class="his-name">
李姐烧烤普罗旺斯店
</view>
</view>
<view class="hit-right">
购买时排队<span class="text-style">10</span> 当前 2
购买时排队<span class="text-style">{{item.buy_queue_index}}</span> 当前<span class="text-style">{{item.now_queue_index}}</span>
</view> </view>
</view> </view>
<view class="load-more" @click="getQueueList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {
userQueueRebateList
} from '../../common/api.js'
export default { export default {
data() { data() {
return { return {
list: [{
tabList: [{
name: '按时间排序' name: '按时间排序'
}, { }, {
name: '待最快排序' name: '待最快排序'
}], }],
current: 0
currentTab: 0,
queueList: [],
hasMore: true,
page: 0,
}; };
}, },
onLoad() {
this.getQueueList();
},
onReachBottom() {
this.getQueueList()
},
methods: { methods: {
change(index) {
this.current = Number(index);
change(e) {
console.log(e.index)
this.currentTab = Number(e.index);
this.queueList = [];
this.hasMore = true;
this.page = 0;
this.getQueueList();
},
getQueueList() {
if (!this.hasMore) {
return
} }
this.page++
userQueueRebateList({
page: this.page,
page_size: 15,
status: 0,
sort_type: this.currentTab == 0 ? 1 : 2
}).then(data => {
this.queueList = [...this.queueList, ...data.list]
this.hasMore = data.has_more
})
},
} }
} }
</script> </script>
@ -101,6 +99,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
} }
span.text-style { span.text-style {
font-size: 24rpx; font-size: 24rpx;
color: #F52F3E; color: #F52F3E;
@ -114,4 +113,9 @@ export default {
border-color: #eee !important; border-color: #eee !important;
} }
} }
.load-more {
text-align: center;
font-size: 14px;
}
</style> </style>

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

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

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

@ -43,6 +43,7 @@
</view> --> </view> -->
</view> </view>
</view> </view>
<view class="load-more" @click="getWithdrawList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
</view> </view>
</template> </template>
@ -55,17 +56,29 @@
data() { data() {
return { return {
withdrawList: [], withdrawList: [],
hasMore: true,
page: 0,
}; };
}, },
onLoad() { onLoad() {
this.getWithdrawList() this.getWithdrawList()
}, },
onReachBottom() {
this.getWithdrawList()
},
methods: { methods: {
getWithdrawList() { getWithdrawList() {
if (!this.hasMore) {
return
}
this.page++
userWithdrawList({ userWithdrawList({
page: 1,
page: this.page,
page_size: 15, page_size: 15,
}).then(data => this.withdrawList = data.list)
}).then(data => {
this.withdrawList = [...this.withdrawList, ...data.list]
this.hasMore = data.has_more
})
} }
} }
} }
@ -126,4 +139,9 @@
border-color: #eee !important; border-color: #eee !important;
} }
} }
.load-more {
text-align: center;
font-size: 14px;
}
</style> </style>
Loading…
Cancel
Save