withdraw-list.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <cwg-page-wrapper>
  3. <view class="bank-transaction-page">
  4. <view class="filters-container" :style="{ top: statusBarHeight + 53 + 'px' }">
  5. <view class="filter-item">
  6. <text class="filter-label">{{ t('card.Form.f45') }}</text>
  7. <cwg-picker v-model="statusFilterIndex" :options="statusOptions" />
  8. </view>
  9. <view class="filter-item">
  10. <text class="filter-label">{{ t('card.Form.f43') }}</text>
  11. <view class="filter-picker" @click="open">
  12. <view class="picker-value">
  13. <text class="picker-text">{{ dateFilter || t('card.Form.f57') }}</text>
  14. <uni-icons type="calendar" size="14" color="#6b7280" class="picker-icon" />
  15. </view>
  16. </view>
  17. <cwg-date-picker v-model:show="show" v-model="dateFilter" mode="date" @confirm="onDateConfirm"
  18. :minDate="minDate" :maxDate="maxDate" />
  19. </view>
  20. <view class="reset-btn" @click="resetFilters">
  21. <uni-icons type="loop" size="16" color="#2563eb" />
  22. </view>
  23. </view>
  24. <view class="content">
  25. <WithdrawList ref="globalListRef" :cardNo="cardNo" :payoutCurrency="payoutCurrency"
  26. :statusIndex="statusFilterIndex" :dateFilter="dateFilter" />
  27. </view>
  28. </view>
  29. </cwg-page-wrapper>
  30. </template>
  31. <script setup lang="ts">
  32. import { ref, computed, watch } from 'vue';
  33. import { onLoad } from '@dcloudio/uni-app';
  34. import { useI18n } from 'vue-i18n';
  35. import useGlobalStore from '@/stores/use-global-store';
  36. import WithdrawList from './components/WithdrawList.vue';
  37. import { withdrawStatus } from '@/utils/dataMap';
  38. import useCardStore from "@/stores/use-card-store";
  39. const cardStore = useCardStore();
  40. const globalStore = useGlobalStore()
  41. const statusBarHeight = computed(() => globalStore.statusBarHeight);
  42. const { t } = useI18n();
  43. const minDate = ref(new Date(2000, 0, 1).getTime());
  44. const maxDate = ref(new Date().getTime());
  45. const cardNo = ref('');
  46. onLoad((options) => {
  47. cardNo.value = options.cardNo || '';
  48. });
  49. const statusOptions = computed(() => {
  50. return withdrawStatus
  51. });
  52. const payoutCurrency = ref();
  53. const statusFilterIndex = ref(0);
  54. const dateFilter = ref('');
  55. const show = ref(false)
  56. const onDateConfirm = (e: any) => {
  57. dateFilter.value = e.formatted;
  58. };
  59. function open() {
  60. show.value = true
  61. }
  62. const resetFilters = () => {
  63. payoutCurrency.value = '';
  64. statusFilterIndex.value = 0;
  65. dateFilter.value = '';
  66. };
  67. </script>
  68. <style scoped lang="scss">
  69. @import "@/uni.scss";
  70. .page-wrapper {
  71. padding: 0;
  72. border: 0;
  73. }
  74. .bank-transaction-page {
  75. // background-color: #f9fafb;
  76. }
  77. .wallet-header {
  78. background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  79. }
  80. /* Header */
  81. .header {
  82. background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  83. padding: px2rpx(16);
  84. padding-bottom: px2rpx(20);
  85. }
  86. .header-content {
  87. display: flex;
  88. flex-direction: column;
  89. gap: px2rpx(16);
  90. }
  91. .header-title {
  92. display: flex;
  93. align-items: center;
  94. gap: px2rpx(8);
  95. }
  96. .title-text {
  97. color: #ffffff;
  98. font-size: px2rpx(20);
  99. }
  100. .stats-container {
  101. display: flex;
  102. gap: px2rpx(12);
  103. }
  104. .stat-card {
  105. flex: 1;
  106. background-color: rgba(255, 255, 255, 0.15);
  107. backdrop-filter: blur(px2rpx(10));
  108. border-radius: px2rpx(12);
  109. padding: px2rpx(12);
  110. }
  111. .stat-header {
  112. display: flex;
  113. align-items: center;
  114. gap: px2rpx(6);
  115. margin-bottom: px2rpx(8);
  116. }
  117. .icons {
  118. width: px2rpx(20);
  119. height: px2rpx(20);
  120. }
  121. .stat-label {
  122. font-size: px2rpx(12);
  123. color: rgba(255, 255, 255, 0.9);
  124. }
  125. .stat-value {
  126. font-size: px2rpx(20);
  127. color: #ffffff;
  128. display: block;
  129. margin-bottom: px2rpx(4);
  130. }
  131. .stat-count {
  132. font-size: px2rpx(11);
  133. color: rgba(255, 255, 255, 0.8);
  134. }
  135. /* Tabs */
  136. .tabs-container {
  137. background-color: #ffffff;
  138. display: flex;
  139. border-bottom: 1px solid #e5e7eb;
  140. position: sticky;
  141. top: 0;
  142. z-index: 10;
  143. }
  144. .tab-item {
  145. flex: 1;
  146. display: flex;
  147. align-items: center;
  148. justify-content: center;
  149. gap: px2rpx(6);
  150. padding: px2rpx(16);
  151. position: relative;
  152. transition: all 0.3s;
  153. }
  154. .tab-text {
  155. font-size: px2rpx(15);
  156. color: #9ca3af;
  157. transition: color 0.3s;
  158. }
  159. .tab-text-active {
  160. color: #2563eb;
  161. }
  162. .tab-indicator {
  163. position: absolute;
  164. bottom: 0;
  165. left: 0;
  166. right: 0;
  167. height: px2rpx(3);
  168. background-color: #2563eb;
  169. border-radius: px2rpx(3) px2rpx(3) 0 0;
  170. }
  171. /* Content */
  172. .content {
  173. padding: 0;
  174. }
  175. .filters-container {
  176. display: flex;
  177. align-items: center;
  178. gap: px2rpx(8);
  179. padding: px2rpx(12) px2rpx(16);
  180. background-color: #ffffff;
  181. position: sticky;
  182. top: 0;
  183. z-index: 10;
  184. overflow-x: auto;
  185. -webkit-overflow-scrolling: touch;
  186. }
  187. .filter-item {
  188. display: flex;
  189. align-items: center;
  190. gap: px2rpx(4);
  191. flex-shrink: 0;
  192. min-width: 0;
  193. }
  194. .filter-label {
  195. font-size: px2rpx(12);
  196. color: #6b7280;
  197. white-space: nowrap;
  198. flex-shrink: 0;
  199. }
  200. .filter-picker {
  201. background-color: #ffffff;
  202. border: 1px solid #e5e7eb;
  203. border-radius: px2rpx(8);
  204. padding: px2rpx(6) px2rpx(8);
  205. display: flex;
  206. align-items: center;
  207. min-width: px2rpx(60);
  208. max-width: px2rpx(120);
  209. flex-shrink: 1;
  210. }
  211. .picker-value {
  212. display: flex;
  213. align-items: center;
  214. gap: px2rpx(4);
  215. width: 100%;
  216. min-width: 0;
  217. }
  218. .picker-text {
  219. flex: 1;
  220. min-width: 0;
  221. font-size: px2rpx(12);
  222. color: #111827;
  223. overflow: hidden;
  224. text-overflow: ellipsis;
  225. white-space: nowrap;
  226. }
  227. .picker-icon {
  228. flex-shrink: 0;
  229. width: px2rpx(14);
  230. height: px2rpx(14);
  231. }
  232. .reset-btn {
  233. background-color: #ffffff;
  234. border: 1px solid #e5e7eb;
  235. border-radius: px2rpx(8);
  236. padding: px2rpx(6) px2rpx(10);
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. flex-shrink: 0;
  241. min-width: px2rpx(36);
  242. }
  243. </style>