猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
2.2 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <!-- <div>交易明细</div> -->
  3. <view class="box">
  4. <view class="top flex" :style="{ borderRadius: '31.5rpx' }">
  5. <view @click="changeTab(0)" :class="{ active : type == 0 }" class="income flex element"
  6. :style="{ borderRadius: '31.5rpx' }">
  7. 收入明细
  8. </view>
  9. <view @click="changeTab(1)" :class="{ active : type == 1 }" class="income flex element"
  10. :style="{ borderRadius: '31.5rpx' }">
  11. 支出明细
  12. </view>
  13. </view>
  14. <view v-for="(item,index) in list" :key="index" class="Recharge flex">
  15. <view class="flex">
  16. <image style="width: 80rpx;height: 80rpx" src="https://img1.baidu.com/it/u=3034232350,1041791648&fm=253&fmt=auto&app=138&f=PNG?w=500&h=500"
  17. mode="aspectFill"></image>
  18. <view class="text1">
  19. <view class="text2">
  20. {{ item.title }}
  21. </view>
  22. <view>
  23. {{ item.createTime }}
  24. </view>
  25. </view>
  26. </view>
  27. <view class="text3">
  28. {{ item.amount }}
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import {
  35. ref
  36. } from "vue"
  37. import {
  38. amountLogList
  39. } from "@/api/amount/index.js"
  40. import {
  41. onShow
  42. } from "@dcloudio/uni-app"
  43. onShow(() => {
  44. getRunningWater()
  45. })
  46. const list = ref([]);
  47. const type = ref(0);
  48. // 获取流水
  49. const getRunningWater = async () => {
  50. let response = await amountLogList({
  51. type: type.value,
  52. moneyType:0
  53. });
  54. if (response.code == 200) {
  55. list.value = response.data
  56. }
  57. }
  58. const changeTab = (index) => {
  59. type.value = index;
  60. getRunningWater();
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .box {
  65. width: 750rpx;
  66. height: 1452rpx;
  67. background-color: #FFFFFF;
  68. padding: 2% 2% 0 2%;
  69. box-sizing: border-box;
  70. }
  71. .top {
  72. width: 722rpx;
  73. height: 63rpx;
  74. background-color: #F3F3F3;
  75. }
  76. .active {
  77. background-color: #FFBF60;
  78. color: white;
  79. }
  80. .income {
  81. width: 361rpx;
  82. height: 63rpx;
  83. line-height: 63rpx;
  84. font-size: 30rpx;
  85. justify-content: center;
  86. }
  87. .Recharge {
  88. padding: 3% 3% 0 2%;
  89. box-sizing: border-box;
  90. justify-content: space-between;
  91. }
  92. .flex {
  93. display: flex;
  94. }
  95. .text1 {
  96. font-size: 30rpx;
  97. color: #949494;
  98. }
  99. .Recharge image {
  100. width: 56rpx;
  101. height: 56rpx;
  102. margin-top: 0.5%;
  103. }
  104. .text2 {
  105. font-weight: 700;
  106. color: #333333;
  107. }
  108. .text3 {
  109. color: #FF2A2A;
  110. }
  111. </style>