current-commission.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <v-paging :ajax="getCurrentEntrust" ref="list" tag="div">
  3. <template #box="list">
  4. <van-empty v-if="!$list(list).length" description="" />
  5. <div v-for="item in $list(list)" class="item bg-panel-4 m-md rounded-sm box-shadow" :key="item.order_no">
  6. <div class="head d-flex align-center border-b p-x-md p-y-xs justify-between">
  7. <div class="d-flex">
  8. <div v-if="item.entrust_type==1" class="suatus color-buy fn-20 m-r-xs rounded">
  9. {{$t('exchange.b5')}}</div>
  10. <div v-if="item.entrust_type==2" class="suatus color-sell fn-20 m-r-xs rounded">
  11. {{$t('exchange.b6')}}</div>
  12. <div>
  13. <div class="color-light fn-20">{{item.symbol}}</div>
  14. <div class="fn-10">{{item.created_at}}</div>
  15. </div>
  16. </div>
  17. <div class="d-flex">
  18. <span>{{item.status_text}}</span>
  19. </div>
  20. </div>
  21. <div class="p-x-md p-y-xs">
  22. <div class="row d-flex m-y-xs justify-between">
  23. <div class="label fn-sm">{{$t('exchange.b7')}}</div>
  24. <div class="color-light">{{item.entrust_price}}</div>
  25. </div>
  26. <div class="row d-flex m-y-xs justify-between">
  27. <div class="label fn-sm">{{$t('exchange.b8')}}</div>
  28. <div class="color-light">
  29. <template v-if="item.type==1">{{$t('exchange.b9')}}</template>
  30. <template v-if="item.type==2">{{$t('exchange.c0')}}</template>
  31. </div>
  32. </div>
  33. <div class="row d-flex m-y-xs justify-between">
  34. <div class="label fn-sm">{{$t('exchange.c1')}}</div>
  35. <div class="color-buy">{{item.traded_amount}}</div>
  36. </div>
  37. <div class="row d-flex m-y-xs justify-between">
  38. <div class="label fn-sm">{{$t('exchange.c2')}}</div>
  39. <div class="color-light">{{item.amount}}</div>
  40. </div>
  41. <div class="row d-flex m-y-xs justify-between">
  42. <div class="label fn-sm">{{$t('exchange.g3')}}</div>
  43. <div class="color-light">
  44. <v-button type="red" class="rounded-xs" size="mini" @click="ifCancel(item)">
  45. {{$t('exchange.g4')}}</v-button>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. </v-paging>
  52. </template>
  53. <script>
  54. import Order from "@/api/order";
  55. export default {
  56. data() {
  57. return {
  58. getCurrentEntrust: Order.getCurrentEntrust,
  59. };
  60. },
  61. methods: {
  62. ifCancel(item) {
  63. this.$dialog
  64. .confirm({
  65. title: this.$t('common.tips'),
  66. message: this.$t('exchange.g5') + '?',
  67. cancelButtonText: this.$t('common.cancelButtonText'),
  68. confirmButtonText: this.$t('common.confirmButtonText')
  69. })
  70. .then(() => {
  71. this.cancelEntrust(item);
  72. })
  73. .catch(() => {});
  74. },
  75. // 撤销委托
  76. cancelEntrust(item) {
  77. let data = {
  78. entrust_id: item.id,
  79. entrust_type: item.entrust_type,
  80. symbol: item.symbol,
  81. };
  82. Order.cancelEntrust(data).then(() => {
  83. this.$toast.success(this.$t('exchange.g6'));
  84. this.$refs.list.list.forEach((ele, idx) => {
  85. if (item.id == ele.id) {
  86. this.$refs.list.list.splice(idx, 1);
  87. }
  88. });
  89. });
  90. },
  91. },
  92. };
  93. </script>