index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="income-main">
  3. <view class="income-header card-box">
  4. <text class="income-title" @click="onShow">
  5. 2025年4月
  6. </text>
  7. <view class="income-header-right">
  8. <text>收入:1212</text>
  9. <text>支出:233</text>
  10. </view>
  11. </view>
  12. <view class="card-box icome-item" v-for="item in list" :key="item.code">
  13. <view class="card-left">
  14. <img :src="baseUrl" alt="" class="income-img">
  15. <view class="card-left-text">
  16. <view class="card-left-name">{{ item.name }}</view>
  17. <view class="card-left-date">{{ item.date }}</view>
  18. </view>
  19. </view>
  20. <view class="card-rigth">
  21. {{ item.price }}
  22. </view>
  23. </view>
  24. <up-picker :show="show" ref="uPickerRef" :columns="columns" @confirm="confirm"
  25. @change="changeHandler"></up-picker>
  26. </view>
  27. </template>
  28. <script setup>
  29. import { ref, reactive } from 'vue';
  30. import config from '@/config'
  31. const baseUrl = config.baseUrl
  32. const list = ref([
  33. {
  34. name: '交易提现-到银行卡',
  35. date: '2022-03-20 20:00',
  36. code: '88888888888888888',
  37. price: '+1212'
  38. },
  39. {
  40. name: '交易提现-到银行卡',
  41. date: '2022-03-20 20:00',
  42. code: '343434343434',
  43. price: '-1212'
  44. }
  45. ])
  46. const show = ref(false);
  47. const columns = reactive([
  48. ['中国', '美国'],
  49. ['深圳', '厦门', '上海', '拉萨']
  50. ]);
  51. const columnData = reactive([
  52. ['深圳', '厦门', '上海', '拉萨'],
  53. ['得州', '华盛顿', '纽约', '阿拉斯加']
  54. ]);
  55. const uPickerRef = ref(null)
  56. const changeHandler = (e) => {
  57. const {
  58. columnIndex,
  59. value,
  60. values,
  61. index,
  62. } = e;
  63. if (columnIndex === 0) {
  64. uPickerRef.value.setColumnValues(1, columnData[index]);
  65. }
  66. };
  67. const onShow = () => {
  68. show.value = true;
  69. };
  70. const confirm = (e) => {
  71. console.log('confirm', e);
  72. show.value = false;
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .card-box {
  77. border-radius: 8px;
  78. background: rgba(255, 255, 255, 1);
  79. padding: 12px;
  80. margin-bottom: 12px;
  81. }
  82. .income-main {
  83. position: fixed;
  84. top: 0px;
  85. left: 0px;
  86. right: 0px;
  87. bottom: 0px;
  88. background: rgba(245, 245, 245, 1);
  89. padding: 12px;
  90. overflow: auto;
  91. .income-title {
  92. font-size: 16px;
  93. font-weight: 500;
  94. line-height: 23.17px;
  95. color: rgba(0, 0, 0, 1);
  96. }
  97. .income-header {
  98. display: flex;
  99. align-items: center;
  100. justify-content: space-between;
  101. .income-header-right {
  102. font-size: 14px;
  103. font-weight: 500;
  104. line-height: 20.27px;
  105. color: rgba(0, 0, 0, 1);
  106. display: flex;
  107. align-items: flex-start;
  108. flex-direction: column;
  109. justify-content: center;
  110. }
  111. }
  112. }
  113. .icome-item {
  114. display: flex;
  115. align-items: center;
  116. justify-content: space-between;
  117. .card-left {
  118. display: flex;
  119. align-items: center;
  120. .income-img {
  121. width: 40px;
  122. height: 40px;
  123. }
  124. .card-left-text {
  125. margin-left: 12px;
  126. .card-left-name {
  127. font-size: 16px;
  128. font-weight: 700;
  129. line-height: 23.17px;
  130. color: rgba(0, 0, 0, 1);
  131. margin-bottom: 6px;
  132. }
  133. .card-left-date {
  134. font-size: 14px;
  135. font-weight: 500;
  136. line-height: 16.41px;
  137. color: rgba(153, 153, 153, 1);
  138. }
  139. }
  140. .card-rigth {
  141. font-size: 20px;
  142. font-weight: 700;
  143. line-height: 23.44px;
  144. color: rgba(51, 51, 51, 1);
  145. }
  146. }
  147. }
  148. </style>