RecordsEvery.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="container">
  3. <view class="TotalRevenue">
  4. <view v-if="showType === 'income'" class="amountText">
  5. 总收益 &nbsp;(元) &nbsp;:&nbsp; {{ acountNumbers['总收益'] }}
  6. </view>
  7. <view v-else-if="showType === 'expenditure'" class="amountText">
  8. 总支出 &nbsp;(元) &nbsp;:&nbsp; {{ acountNumbers['总支出'] }}
  9. </view>
  10. </view>
  11. <view class="MakeMoneyRecordsList">
  12. <scroll-view scroll-y="true" class="scrollY" @scrolltolower="getMore">
  13. <view v-for="(item, index) in dataList" :key="index" class="listItem">
  14. <view
  15. class="itemIcon"
  16. :style="{ background: showType === 'income' ? '#FF380C' : showType === 'expenditure' ? '#3982F1' : '' }"
  17. >
  18. <image class="Iconimg" src="../../../../static/images/user/zengsong.png"></image>
  19. </view>
  20. <text class="txt2">{{ item.number }}</text>
  21. <view class="itemDetails">
  22. <text class="txt1">
  23. 代金卷
  24. <text v-if="item.type === 1">充值</text>
  25. <text v-else-if="item.type === 2">转赠</text>
  26. <text v-else-if="item.type === 3">签到</text>
  27. <text v-else-if="item.type === 4">抵扣</text>
  28. <text v-else-if="item.type === 5">核销</text>
  29. <text v-else-if="item.type === 6">抽奖</text>
  30. <text v-else-if="item.type === 7">退款</text>
  31. <text v-else-if="item.type === 8">充值赠送</text>
  32. <text v-else-if="item.type === 9">下单</text>
  33. <text v-else>--</text>
  34. </text>
  35. <text class="txt3">{{ item.typeStrName }} ID : {{ item.id }}</text>
  36. <text class="txt3">{{ item.createTime }}</text>
  37. </view>
  38. <view
  39. v-if="showType === 'income'"
  40. style="display: flex; flex-direction: column; margin-left: 50upx; align-items: center;"
  41. >
  42. <image
  43. style="width: 56upx; height: 56upx; border-radius: 50%; border: 1upx solid #f3f3f3;"
  44. :src="common.seamingImgUrl(item.imgOne)"
  45. ></image>
  46. <text style="font-size: 24upx;">{{ item.userNameOne }}</text>
  47. <text style="font-size: 24upx;">(ID:{{ item.holdId }})</text>
  48. </view>
  49. <view
  50. v-else-if="showType === 'expenditure'"
  51. style="display: flex; flex-direction: column; margin-left: 50upx; align-items: center;"
  52. >
  53. <image
  54. style="width: 56upx; height: 56upx; border-radius: 50%; border: 1upx solid #f3f3f3;"
  55. :src="common.seamingImgUrl(item.userLogs)"
  56. ></image>
  57. <text style="font-size: 24upx; color: rgb(26, 26, 26);">{{ item.username }}</text>
  58. <text style="font-size: 24upx; color: rgb(26, 26, 26);">(ID:{{ item.userId }})</text>
  59. </view>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import { getTransferLogsVoucherShopHoldApi } from '../../../../api/anotherTFInterface'
  67. export default {
  68. name: 'RecordsEvery',
  69. props: {
  70. showType: {
  71. type: String,
  72. required: true
  73. },
  74. condition: {
  75. type: [Number, String],
  76. default: 5
  77. },
  78. acountNumbers: {
  79. type: Object,
  80. default: {
  81. '总收益': 0,
  82. '总收入': 0
  83. }
  84. }
  85. },
  86. data() {
  87. return {
  88. queryList: {
  89. page: 1,
  90. pageSize: 20
  91. },
  92. dataList: []
  93. }
  94. },
  95. watch: {
  96. condition(newVlaue, oldVlaue) {
  97. this.dataList = []
  98. this.queryList.page = 1
  99. this.queryList.pageSize = 20
  100. this.getListData()
  101. }
  102. },
  103. created() {
  104. this.getListData()
  105. },
  106. methods: {
  107. getListData() {
  108. getTransferLogsVoucherShopHoldApi({
  109. ...this.queryList,
  110. type: this.showType === 'income' ? 3 : this.showType === 'expenditure' ? 2 : '',
  111. condition: this.condition
  112. }).then((res) => {
  113. if (res.data.records.length <= 0) {
  114. uni.showToast({
  115. title: '没有更多了',
  116. icon: 'none'
  117. })
  118. }
  119. for (let index = 0; index < res.data.records.length; index++) {
  120. this.dataList.push(res.data.records[index])
  121. }
  122. // this.dataList = res.data.records;
  123. // console.log(res);
  124. })
  125. .catch((err) => {
  126. console.log(err)
  127. })
  128. },
  129. getMore() {
  130. this.queryList.page++
  131. this.getListData()
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .TotalRevenue {
  138. width: 100%;
  139. box-sizing: border-box;
  140. padding-bottom: 10rpx;
  141. /* height: 38rpx; */
  142. .amountText {
  143. /* display: flex;
  144. align-items: center; */
  145. margin: 20rpx 0rpx;
  146. font-family: 思源黑体;
  147. font-size: 32rpx;
  148. font-weight: normal;
  149. line-height: 32rpx;
  150. font-feature-settings: "kern" on;
  151. color: #222229;
  152. }
  153. }
  154. .scrollY {
  155. height: 100%;
  156. }
  157. .container {
  158. box-sizing: border-box;
  159. padding-bottom: 216rpx;
  160. }
  161. .MakeMoneyRecordsList {
  162. height: 59vh;
  163. overflow: hidden auto;
  164. .listItem {
  165. margin-top: 50rpx;
  166. /* margin: 50rpx 0rpx; */
  167. width: 100%;
  168. height: 120rpx;
  169. display: flex;
  170. font-family: 思源黑体;
  171. position: relative;
  172. .itemIcon {
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. width: 68rpx;
  177. height: 68rpx;
  178. border-radius: 8rpx;
  179. background: #49CE8B;
  180. .Iconimg {
  181. width: 50rpx;
  182. height: 50rpx;
  183. }
  184. }
  185. .txt2 {
  186. position: absolute;
  187. right: 20rpx;
  188. top: 30rpx;
  189. font-family: 思源黑体;
  190. font-size: 42rpx;
  191. line-height: 5rpx;
  192. color: #222229;
  193. }
  194. .itemDetails {
  195. margin-left: 20rpx;
  196. display: flex;
  197. flex-direction: column;
  198. font-size: 24rpx;
  199. .txt1 {
  200. font-size: 28rpx;
  201. font-weight: normal;
  202. line-height: 32rpx;
  203. color: #222229;
  204. }
  205. .txt3 {
  206. margin-top: 10rpx;
  207. font-size: 24rpx;
  208. font-weight: normal;
  209. line-height: 32rpx;
  210. color: #888889;
  211. }
  212. }
  213. }
  214. }
  215. </style>