|
|
@@ -18,6 +18,7 @@
|
|
|
<script>
|
|
|
import AppTabs from "@/components/plugin/tabs";
|
|
|
import OrderItem from "./orderItem";
|
|
|
+import { list } from "@/mixins";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import { ghsList, purchaseList } from "@/api/purchase/index";
|
|
|
export default {
|
|
|
@@ -26,6 +27,7 @@ export default {
|
|
|
OrderItem,
|
|
|
AppTabs
|
|
|
},
|
|
|
+ mixins: [list],
|
|
|
data () {
|
|
|
return {
|
|
|
tabs: [
|
|
|
@@ -63,7 +65,15 @@ export default {
|
|
|
status: '0'
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ onReachBottom () {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getpurchaseList().then(res => {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ }
|
|
|
+ },
|
|
|
onPullDownRefresh() {
|
|
|
this.getpurchaseList().then(res => {
|
|
|
uni.stopPullDownRefresh()
|
|
|
@@ -86,14 +96,14 @@ export default {
|
|
|
},
|
|
|
// 获取采购记录列表
|
|
|
getpurchaseList () {
|
|
|
- return purchaseList({ status: this.status }).then(res => {
|
|
|
- this.list.data = res.data.list
|
|
|
+ return purchaseList({ status: this.status,page: this.list.page }).then(res => {
|
|
|
+ this.completes(res)
|
|
|
this.tabs[0].value = res.data.shop.totalPurchaseOrder // 全部
|
|
|
this.tabs[1].value = res.data.shop.cgUnPay // 待付款
|
|
|
this.tabs[2].value = res.data.shop.cgUnSend // 待配送
|
|
|
this.tabs[3].value = res.data.shop.cgSending // 配送中
|
|
|
this.tabs[4].value = res.data.shop.cgFinish // 已完成
|
|
|
- }).catch(err => { console.log(err) })
|
|
|
+ })
|
|
|
},
|
|
|
// 采购记录详情
|
|
|
gotoDetails (val) {
|