recharge-log.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <ax-body>
  3. <view class="body app-hide-scrollbar">
  4. <view v-if="logs.data.length" class="list">
  5. <view v-for="(item,index) in logs.data" :key="index" class="item">
  6. <view class="title">
  7. <view class="name">{{item.params.levelName}}</view>
  8. <view class="state" :style="{backgroundColor:item.orderStatus==2?'':'#FF5D50'}">{{getStatusTips(item.orderStatus)}}</view>
  9. </view>
  10. <view class="cell">
  11. <view>订单编号:{{item.outTradeNo}}</view>
  12. <view>购券时间:{{item.payTime}}</view>
  13. <view>实付金额:{{item.orderMoney}}元</view>
  14. <view v-if="item.orderStatus!=2">退款时间:{{item.refundTime}}</view>
  15. <view v-if="item.orderStatus!=2">退款金额:{{item.refundMoney}}元</view>
  16. </view>
  17. </view>
  18. <view v-if="logs.total>logs.data.length" @click="loadData(true)" class="loadmore"><text>点击加载更多数据</text></view>
  19. </view>
  20. <view v-else class="nothing">
  21. <image src="@/static/img/empty.svg" mode="widthFix" class="icon"></image>
  22. <view>暂无可展示数据</view>
  23. </view>
  24. </view>
  25. </ax-body>
  26. </template>
  27. <script>
  28. export default {
  29. onLoad() {
  30. this.loadData();
  31. },
  32. data() {
  33. return {
  34. logs:{
  35. total: 0,
  36. data:[],
  37. },
  38. search_data:{
  39. pageNum:1,
  40. pageSize:10,
  41. orderByColumn:'payTime',
  42. isAsc:'desc'
  43. }
  44. }
  45. },
  46. methods: {
  47. getStatusTips(status){
  48. if(status==2){
  49. return "已到账"
  50. }else if(status==4){
  51. return "已退款"
  52. }else if(status==5){
  53. return "退款中"
  54. }
  55. },
  56. loadData(append){
  57. if(append){
  58. this.search_data.pageNum++
  59. // 追加模式,由loadmore触发
  60. this.$api.base("post","/orderApi/getOrderList",this.search_data,{}).then(res=>{
  61. this.logs.data = this.logs.data.concat(res.orderLsit.rows);
  62. })
  63. }else{
  64. this.search_data.pageNum = 1
  65. // 初始化模式,一般由onLoad触发
  66. this.$api.base("post","/orderApi/getOrderList",this.search_data,{}).then(res=>{
  67. this.logs.total = res.orderLsit.total
  68. this.logs.data = res.orderLsit.rows
  69. })
  70. }
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. @import url("recharge-log.css");
  77. </style>