profit.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="pos-r padding-lr-sm">
  3. <use-tabbar :tabbar="false" />
  4. <!-- 我的余额区域 -->
  5. <view class="gold-section" v-if="fetch && fetch.cash">
  6. <view class="item dflex dflex-flow-c">
  7. <text>总收益:{{fetch.cash}}</text>
  8. </view>
  9. </view>
  10. <!-- 记录列表 -->
  11. <view class="record-list margin-top-sm" v-if="fetch">
  12. <view class="record-title fs fwbd ft-black margin-bottom-sm">收益记录</view>
  13. <u-empty v-if="fetch['list'] && fetch['list'].length <= 0" marginTop="30" mode="data" text="暂无记录"></u-empty>
  14. <view v-else>
  15. <view class="record-item" v-for="(item, index) in fetch['list']" :key="index">
  16. <view class="record-left">
  17. <view class="record-name">{{ item.action_name }}</view>
  18. <view class="record-desc" v-if="item.desc">{{ item.desc }}</view>
  19. <view class="record-time">{{ item.cdate }}</view>
  20. </view>
  21. <view class="record-amount" :class="{ income: item.type == 1, expense: item.type == 2, lock: item.type == 3 }">
  22. <text v-if="item.type == 1">+</text>
  23. <text v-if="item.type == 3">待入账</text>
  24. <text>{{ item.money }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="safe-area-inset-bottom"></view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. fetch: {},
  37. type: 0,
  38. id: 0,
  39. }
  40. },
  41. onLoad(options) {
  42. this.type = options.type;
  43. this.id = options.id;
  44. if (!this.type || !this.id) {
  45. return Dever.goUser()
  46. }
  47. },
  48. onShow() {
  49. this.loadList(1);
  50. },
  51. //下拉刷新
  52. onPullDownRefresh() {
  53. this.loadList(1);
  54. },
  55. //加载更多
  56. onReachBottom() {
  57. this.loadList(2);
  58. },
  59. methods: {
  60. loadList(page) {
  61. this.DeverApi.page([page, 'list'], this, 'sales.getProfit', {sales_type:this.type, sales_id: this.id});
  62. },
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .gold-section {
  68. background: #ffffff;
  69. border-radius: 24rpx;
  70. padding: 32rpx;
  71. .dflex-b {
  72. display: flex;
  73. justify-content: space-between;
  74. align-items: center;
  75. }
  76. .title {
  77. font-size: 32rpx;
  78. font-weight: bold;
  79. color: #333;
  80. }
  81. .link {
  82. font-size: 24rpx;
  83. color: #ff9800;
  84. text-decoration: underline;
  85. }
  86. .balance-number {
  87. margin-top: 20rpx;
  88. .price {
  89. font-size: 48rpx;
  90. color: #ff9800;
  91. font-weight: bold;
  92. }
  93. }
  94. .amount-summary {
  95. display: flex;
  96. justify-content: space-between;
  97. margin-top: 32rpx;
  98. .summary-item {
  99. flex: 1;
  100. display: flex;
  101. flex-direction: column;
  102. .label {
  103. font-size: 24rpx;
  104. color: #888;
  105. }
  106. .value {
  107. margin-top: 10rpx;
  108. font-size: 30rpx;
  109. font-weight: 600;
  110. color: #333;
  111. }
  112. }
  113. }
  114. }
  115. .card-tile {
  116. border-radius: 24rpx;
  117. padding: 30rpx;
  118. background: #ffffff;
  119. display: flex;
  120. align-items: center;
  121. justify-content: center;
  122. transition: all 0.2s ease-in-out;
  123. .icon {
  124. font-size: 60rpx;
  125. margin-right: 24rpx;
  126. }
  127. .text-content {
  128. display: flex;
  129. flex-direction: column;
  130. .title {
  131. font-size: 30rpx;
  132. font-weight: 600;
  133. color: #333;
  134. }
  135. .desc {
  136. font-size: 24rpx;
  137. color: #999;
  138. margin-top: 6rpx;
  139. }
  140. }
  141. &:active {
  142. transform: scale(0.97);
  143. }
  144. &:first-child {
  145. margin-right: 10rpx;
  146. }
  147. }
  148. .wpre-50 .card-tile {
  149. &:first-child {
  150. margin-bottom: 12rpx;
  151. margin-right: 0rpx;
  152. }
  153. }
  154. .record-list {
  155. background: #ffffff;
  156. border-radius: 20rpx;
  157. padding: 30rpx;
  158. .record-title {
  159. font-size: 30rpx;
  160. font-weight: bold;
  161. color: #333;
  162. }
  163. .record-item {
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. padding: 20rpx 0;
  168. border-bottom: 1px solid #f0f0f0;
  169. &:last-child {
  170. border-bottom: none;
  171. }
  172. .record-left {
  173. display: flex;
  174. flex-direction: column;
  175. .record-name {
  176. font-size: 28rpx;
  177. color: #333;
  178. }
  179. .record-desc {
  180. font-size: 28rpx;
  181. color: #999;
  182. }
  183. .record-time {
  184. font-size: 24rpx;
  185. color: #999;
  186. margin-top: 6rpx;
  187. }
  188. }
  189. .record-amount {
  190. font-size: 28rpx;
  191. font-weight: bold;
  192. &.income {
  193. color: #4caf50;
  194. }
  195. &.expense {
  196. color: #f44336;
  197. }
  198. &.lock {
  199. color: #999;
  200. }
  201. }
  202. }
  203. }
  204. .empty-record {
  205. text-align: center;
  206. padding: 60rpx 0;
  207. .empty-icon {
  208. width: 160rpx;
  209. height: 160rpx;
  210. margin-bottom: 20rpx;
  211. opacity: 0.6;
  212. }
  213. .empty-text {
  214. font-size: 28rpx;
  215. color: #999;
  216. }
  217. }
  218. </style>