ad.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <v-page>
  3. <v-header :title="$t('otc.a4')">
  4. <template #right>
  5. <v-picker :list="list" v-model="status" @input="changeStatus">
  6. <template #default="{ label }">
  7. <view class="color-light">
  8. {{ label || $t('otc.c1') }}
  9. <van-icon name="arrow-down" />
  10. </view>
  11. </template>
  12. </v-picker>
  13. </template>
  14. </v-header>
  15. <van-tabs
  16. :ellipsis="false"
  17. :border="false"
  18. class="border-b"
  19. :active="tab"
  20. @change="tabChange($event.detail.name)"
  21. >
  22. <van-tab :title="$t('otc.a5')" :name="1"></van-tab>
  23. <van-tab :title="$t('otc.a6')" :name="2"></van-tab>
  24. </van-tabs>
  25. <v-paging
  26. :ajax="myEntrusts"
  27. :data="{ side: tab, status }"
  28. ref="scroll"
  29. class="layout-main"
  30. >
  31. <template #box="list">
  32. <van-empty v-if="!$list(list).length" description="" />
  33. <view class="list">
  34. <view
  35. class="item bg-panel-3 box-shadow rounded-sm p-md m-md"
  36. v-for="item in $list(list)"
  37. :key="item.id"
  38. >
  39. <view class="row m-t-sm d-flex align-center">
  40. <view class="label"> {{$t('otc.c2')}} </view>
  41. <view class="flex-fill fn-right color-light">
  42. {{ item.order_sn }}
  43. </view>
  44. </view>
  45. <view class="row m-t-sm d-flex align-center">
  46. <view class="label"> {{$t('otc.c1')}} </view>
  47. <view class="flex-fill fn-right color-light">
  48. {{ item.status_text }}
  49. </view>
  50. </view>
  51. <view class="row m-t-sm d-flex align-center">
  52. <view class="label"> {{$t('otc.c3')}} </view>
  53. <view class="flex-fill fn-right color-light">
  54. {{ item.money }}
  55. </view>
  56. </view>
  57. <view class="row m-t-sm d-flex align-center">
  58. <view class="label"> {{$t('otc.b0')}} </view>
  59. <view class="flex-fill fn-right color-light">
  60. {{ item.price }}
  61. </view>
  62. </view>
  63. <view class="row m-t-sm d-flex align-center">
  64. <view class="label"> {{$t('otc.c4')}} </view>
  65. <view class="flex-fill fn-right color-light">
  66. {{ item.amount }}
  67. </view>
  68. </view>
  69. <view class="row m-t-sm d-flex align-center">
  70. <view class="label"> {{$t('otc.a8')}} </view>
  71. <view class="flex-fill fn-right color-light">
  72. {{ item.cur_amount }}
  73. </view>
  74. </view>
  75. <view class="row m-t-sm d-flex align-center">
  76. <view class="label"> {{$t('otc.b1')}} </view>
  77. <view class="flex-fill fn-right color-light">
  78. <template v-for="minItem in item.pay_type">
  79. {{ payTypeMap[minItem] }},
  80. </template>
  81. </view>
  82. </view>
  83. <view class="row m-t-sm d-flex align-center">
  84. <view class="label"> {{$t('otc.c5')}} </view>
  85. <view class="flex-fill fn-right color-light">
  86. {{ item.created_at }}
  87. </view>
  88. </view>
  89. <view class="row m-t-sm d-flex align-center">
  90. <view class="label"> {{$t('otc.b2')}} </view>
  91. <view class="flex-fill fn-right color-light">
  92. <v-button
  93. type="red"
  94. size="mini"
  95. class="rounded-xs"
  96. v-if="item.status == 1"
  97. @click="ifCancelEntrust(item)"
  98. >
  99. {{$t('otc.c6')}}
  100. </v-button>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. </v-paging>
  107. </v-page>
  108. </template>
  109. <script>
  110. import Otc from "@/api/otc";
  111. import vPaging from "../../layout/vPaging.vue";
  112. export default {
  113. components: { vPaging },
  114. name: "order",
  115. data() {
  116. return {
  117. tab: 1,
  118. status: 1,
  119. };
  120. },
  121. computed: {
  122. payTypeMap() {
  123. return {
  124. alipay: this.$t('otc.b7'),
  125. wechat: this.$t('otc.b8'),
  126. bank_card: this.$t('otc.b9'),
  127. };
  128. },
  129. list(){
  130. return [
  131. {
  132. label: this.$t('otc.c7'),
  133. value: 0,
  134. },
  135. {
  136. label: this.$t('otc.c8'),
  137. value: 1,
  138. },
  139. {
  140. label: this.$t('otc.c9'),
  141. value: 2,
  142. },
  143. ]
  144. }
  145. },
  146. methods: {
  147. myEntrusts: Otc.myEntrusts,
  148. tabChange(idx) {
  149. this.tab = idx;
  150. this.$nextTick(() => {
  151. this.$refs.scroll.ref();
  152. });
  153. },
  154. changeStatus() {
  155. this.$nextTick(() => {
  156. this.$refs.scroll.ref();
  157. });
  158. },
  159. // 下架
  160. ifCancelEntrust(item) {
  161. this.$dialog
  162. .confirm({
  163. title: this.$t('otc.d0'),
  164. message: this.$t('otc.d1')+"?",
  165. confirmButtonText: this.$t('common.confirm'),
  166. cancelButtonText: this.$t('common.cancel')
  167. })
  168. .then(() => {
  169. this.cancelEntrust(item);
  170. });
  171. },
  172. cancelEntrust(item) {
  173. let data = {
  174. entrust_id: item.id,
  175. };
  176. Otc.cancelEntrust(data).then((res) => {
  177. this.$toast.success(this.$t('otc.d4'));
  178. this.$nextTick(() => {
  179. this.$refs.scroll.ref();
  180. });
  181. });
  182. },
  183. },
  184. };
  185. </script>