index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="income-main">
  3. <view class="income-header card-box">
  4. <text class="income-title" @click="onShows">
  5. 2025年4月
  6. </text>
  7. <view class="income-header-right">
  8. <text>收入:{{ data.totalEarning }}</text>
  9. <text>支出:{{ data.totalExpend }}</text>
  10. </view>
  11. </view>
  12. <view class="card-box icome-item" v-for="item in data.clientAccountChangeVOlist" :key="item.code">
  13. <view class="card-left">
  14. <!-- <img :src="baseUrl" alt="" class="income-img"> -->
  15. <!-- <view class="plus-box"><up-icon name="plus" color="rgba(244, 67, 54, 1)" size="25" ></up-icon></view>
  16. <view class="minus-box"> <up-icon name="minus" color="rgba(76, 175, 80, 1)" size="25" ></up-icon>></view> -->
  17. <view class="card-left-text">
  18. <view class="card-left-name">
  19. <text> {{ item.businessTierName }}</text>
  20. (<dict-tag :options="jlzj_money_change_type"
  21. :value="item.sourceType" />)
  22. </view>
  23. <view class="card-left-date" :style="`color: ${item.color};`">{{ item.createTime }}</view>
  24. </view>
  25. </view>
  26. <view class="card-rigth">
  27. {{ item.changeMoney }}
  28. </view>
  29. </view>
  30. <up-picker :show="show" ref="uPickerRef" :columns="columns" @confirm="confirm"
  31. @change="changeHandler"></up-picker>
  32. </view>
  33. </template>
  34. <script setup>
  35. import { ref, reactive } from 'vue';
  36. import { getAccountChangeList } from "@/api/mine";
  37. import {
  38. onShow
  39. } from '@dcloudio/uni-app';
  40. import config from '@/config'
  41. import DictTag from '@/components/DictTag/index.vue'
  42. import {
  43. useDict
  44. } from '@/utils/dict.js';
  45. const {
  46. jlzj_money_change_type
  47. } = useDict('jlzj_money_change_type');
  48. const baseUrl = config.baseUrl
  49. const userType = uni.getStorageSync('userType') //读取本地存储
  50. const data = ref({})
  51. const show = ref(false);
  52. const columns = reactive([
  53. ['中国', '美国'],
  54. ['深圳', '厦门', '上海', '拉萨']
  55. ]);
  56. const columnData = reactive([
  57. ['深圳', '厦门', '上海', '拉萨'],
  58. ['得州', '华盛顿', '纽约', '阿拉斯加']
  59. ]);
  60. const uPickerRef = ref(null)
  61. const changeHandler = (e) => {
  62. const {
  63. columnIndex,
  64. value,
  65. values,
  66. index,
  67. } = e;
  68. if (columnIndex === 0) {
  69. uPickerRef.value.setColumnValues(1, columnData[index]);
  70. }
  71. };
  72. const onShows = () => {
  73. show.value = true;
  74. };
  75. const confirm = (e) => {
  76. console.log('confirm', e);
  77. show.value = false;
  78. };
  79. const init = async() => {
  80. try {
  81. uni.showLoading({
  82. title: '数据加载中...'
  83. });
  84. if(userType === 2){
  85. // const res = await getVolunteerAccountInfo();
  86. // data.value =res.data;
  87. }
  88. if(userType === 1){
  89. const res = await getAccountChangeList();
  90. console.log(1,res);
  91. data.value = res.data;
  92. }
  93. } catch (error) {
  94. console.log('error', error);
  95. uni.showToast({
  96. title: error.msg,
  97. icon: 'error',
  98. });
  99. } finally {
  100. uni.hideLoading();
  101. }
  102. }
  103. onShow(()=>{
  104. init();
  105. })
  106. </script>
  107. <style lang="scss" scoped>
  108. .card-box {
  109. border-radius: 8px;
  110. background: rgba(255, 255, 255, 1);
  111. padding: 12px;
  112. margin-bottom: 12px;
  113. }
  114. .income-main {
  115. position: fixed;
  116. top: 0px;
  117. left: 0px;
  118. right: 0px;
  119. bottom: 0px;
  120. background: rgba(245, 245, 245, 1);
  121. padding: 12px;
  122. overflow: auto;
  123. .income-title {
  124. font-size: 16px;
  125. font-weight: 500;
  126. line-height: 23.17px;
  127. color: rgba(0, 0, 0, 1);
  128. }
  129. .income-header {
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-between;
  133. .income-header-right {
  134. font-size: 14px;
  135. font-weight: 500;
  136. line-height: 20.27px;
  137. color: rgba(0, 0, 0, 1);
  138. display: flex;
  139. align-items: flex-start;
  140. flex-direction: column;
  141. justify-content: center;
  142. }
  143. }
  144. }
  145. .icome-item {
  146. display: flex;
  147. align-items: center;
  148. justify-content: space-between;
  149. .card-left {
  150. display: flex;
  151. align-items: center;
  152. .income-img {
  153. width: 40px;
  154. height: 40px;
  155. }
  156. .card-left-text {
  157. margin-left: 12px;
  158. .card-left-name {
  159. font-size: 16px;
  160. font-weight: 700;
  161. line-height: 23.17px;
  162. color: rgba(0, 0, 0, 1);
  163. margin-bottom: 6px;
  164. display: flex;
  165. align-items: center;
  166. }
  167. .card-left-date {
  168. font-size: 14px;
  169. font-weight: 500;
  170. line-height: 16.41px;
  171. color: rgba(153, 153, 153, 1);
  172. }
  173. }
  174. .card-rigth {
  175. font-size: 20px;
  176. font-weight: 700;
  177. line-height: 23.44px;
  178. color: rgba(51, 51, 51, 1);
  179. }
  180. }
  181. }
  182. </style>