Browse Source

给历史记录添加分页

master
liaoxinyu 2 years ago
parent
commit
83b1865a06
  1. 4
      src/components/CommonFooter.vue
  2. 13
      src/views/exchange/index.vue
  3. 12
      src/views/exchange/order-list.vue

4
src/components/CommonFooter.vue

@ -257,10 +257,10 @@
<!-- </div> -->
</div>
<div class="footer-right">
<div style="font-size: 20px;">{{ $t("homeNewText.cc1") }}</div>
<div style="font-size: 20px;text-align: center;">{{ $t("homeNewText.cc1") }}</div>
<router-link class="jump_btn" to="/exchange">{{ $t("homeNewText.cc2") }}</router-link>
<img src="../assets/img/home/qrcode.png" alt="" style="width: 120px;height: 120px;">
<div style="font-size: 16px; color: #9c9c9c;margin-top: 12px;">{{ $t("homeNewText.cc3") }}</div>
<div style="font-size: 16px; color: #9c9c9c;margin-top: 12px;text-align: center;">{{ $t("homeNewText.cc3") }}</div>
</div>
</div>
</footer>

13
src/views/exchange/index.vue

@ -78,7 +78,7 @@
<!-- <market-news></market-news> -->
<!-- order list -->
<order-list ref="Order" :ordersOpen="ordersOpen" :conditionOrders="conditionOrders" :ordersHistory="ordersHistory" :priceDecimals="priceDecimals" :qtyDecimals="qtyDecimals" :isLogin="isLogin" :pair="pair" @change="currentTab = $event" @update="update"></order-list>
<order-list ref="Order" :ordersOpen="ordersOpen" :conditionOrders="conditionOrders" :ordersHistory="ordersHistory" :priceDecimals="priceDecimals" :qtyDecimals="qtyDecimals" :isLogin="isLogin" :pair="pair" @change="currentTab = $event" @update="update" @Pagination="page = $event"></order-list>
</div>
</div>
@ -180,7 +180,8 @@ export default {
currentTab: "opens", // orderstab
price_cny:0,
currentIcon: ''
currentIcon: '',
page: 1
}
},
@ -286,7 +287,12 @@ export default {
currentTab() {
// tab
this.getOrders();
}
},
page() {
if (this.currentTab == "histories") { //
this.getHistories();
}
}
},
methods: {
@ -460,6 +466,7 @@ export default {
if (this.isLogin) {
Order.getHistoryEntrust({
symbol: this.marketInfo.pair_name,
page:this.page
})
.then(data => {
this.ordersHistory = data;

12
src/views/exchange/order-list.vue

@ -182,6 +182,11 @@
<i class="icon ion-md-document"></i>
{{ $t("common.notData") }}
</span>
<div class="p-2">
<el-pagination layout="prev, pager, next" :page-size="ordersHistory.per_page"
@current-change="changePagination" :total="ordersHistory.total">
</el-pagination>
</div>
</div>
</div>
</div>
@ -254,8 +259,11 @@ export default {
})
.catch(err => {});
}
}
},
changePagination(idx) {
console.log(idx);
this.$emit("Pagination", idx);
}
},
created() {
console.log(this.ordersHistory);

Loading…
Cancel
Save