ScoreLog.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <!-- 佣金确权 -->
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" title="" navbar="normal">
  4. <view class="model-box ss-flex-col">
  5. <scroll-view class="list-box" scroll-y="true" @touchmove.stop>
  6. <view v-if="state.pagination.total > 0" style="padding: 20rpx;">
  7. <view class="list-item ss-flex ss-col-center ss-row-between "
  8. v-for="(item,index) in state.pagination.list" :key="item.id"
  9. style="padding:0;padding: 20rpx 0;border-bottom: 1px solid #c4c4c4;">
  10. <view class="ss-flex ss-col-center" style="width: 100%;">
  11. <view class="ss-flex ss-m-t-10"
  12. style="flex-direction: column;align-items: flex-start;width: 100%;">
  13. <view class="name" style="width: 100%;"> {{ title(item) }}
  14. <text v-if="isFreeze == 'true'" style="float: right;" class="color-red"
  15. :class="{'color-green':item.freezeAmount < 0}" >
  16. {{item.freezeAmount > 0 ? '+'+points2point(item.freezeAmount):points2point(item.freezeAmount)}}
  17. </text>
  18. <text v-else style="float: right;" class="color-red"
  19. :class="{'color-green':item.amount < 0}" >
  20. {{item.amount > 0 ? '+'+points2point(item.amount): points2point(item.amount)}}
  21. </text>
  22. </view>
  23. <view class="time " style="width: 100%;">
  24. {{sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM')}}
  25. <!-- 冻结佣金 -->
  26. <text style="float: right;"
  27. v-if="isFreeze == 'true'">余额:{{ points2point(item.afterFreezeAmount)}}</text>
  28. <text style="float: right;" v-else>余额:{{points2point(item.afterAmount)}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <s-empty v-else text="暂无数据" paddingTop="200" icon="/static/data-empty.png" />
  35. <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
  36. contentdown: '点击加载更多',
  37. }" @tap="onLoadMore(true)" @scrolltolower="onLoadMore(true)" />
  38. </scroll-view>
  39. </view>
  40. </s-layout>
  41. </template>
  42. <script setup>
  43. import sheep from '@/sheep';
  44. import {
  45. onLoad,
  46. onReachBottom
  47. } from '@dcloudio/uni-app';
  48. import {
  49. computed,
  50. reactive
  51. } from 'vue';
  52. import {
  53. points2point
  54. } from '@/sheep/hooks/useGoods';
  55. import _ from 'lodash';
  56. import dayjs from 'dayjs';
  57. import PointApi from '@/sheep/api/member/point';
  58. import {
  59. resetPagination
  60. } from '@/sheep/util';
  61. import ScoreApi from '@/sheep/api/distri/score';
  62. const userWallet = computed(() => sheep.$store('user').userWallet);
  63. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  64. const userInfo = computed(() => sheep.$store('user').userInfo);
  65. const sys_navBar = sheep.$platform.navbar;
  66. const props = defineProps({
  67. isFreeze: {
  68. type: String,
  69. default: ''
  70. }
  71. })
  72. const state = reactive({
  73. currentTab: 0,
  74. pagination: {
  75. list: [],
  76. total: 0,
  77. pageSize: 10,
  78. pageNo: 1,
  79. },
  80. loadStatus: '',
  81. showModel: false,
  82. showQueModel: false
  83. });
  84. async function getLogList(isFreeze) {
  85. state.loadStatus = 'loading';
  86. // isFreeze为true是冻结佣金 isFreeze为false是已拿到的佣金
  87. let {
  88. code,
  89. data
  90. } = await ScoreApi.getScoreApi({
  91. pageNo: state.pagination.pageNo,
  92. pageSize: state.pagination.pageSize,
  93. isFreeze: isFreeze
  94. });
  95. if (code !== 0) {
  96. return;
  97. }
  98. let list = _.concat(state.pagination.list, data.list);
  99. state.pagination.list = list;
  100. state.pagination.total = data.total;
  101. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  102. }
  103. // 列表标题
  104. const title = (item) => {
  105. // {{ item.profitStatusName || '空' }}
  106. let title = item.profitStatusName + '';
  107. // 如果有返回username就显示
  108. if(item.username){
  109. title += '('+item.username+ ')'
  110. }
  111. // 如果profitStatus === 3 | 4 | 7 就会显示待确权 否则都是确权
  112. // if([3,4,7].includes(item.profitStatus) && props.isFreeze == 'true'){
  113. // title += "-转确权"
  114. // }
  115. if([3].includes(item.profitStatus) && props.isFreeze == 'false' && item.ancestorQuotaAmount){
  116. title += '(超出额度:' + points2point(item.ancestorQuotaAmount) + ')'
  117. }
  118. if([22].includes(item.profitStatus) && props.isFreeze == 'false' && item.accumulatedQuotaAmount){
  119. title += '(超出额度:' + points2point(item.accumulatedQuotaAmount) + ')'
  120. }
  121. // title += ")"
  122. return title;
  123. }
  124. function onLoadMore(isFreeze) {
  125. if (state.loadStatus === 'noMore') {
  126. return;
  127. }
  128. state.pagination.pageNo++;
  129. getLogList(props.isFreeze);
  130. }
  131. onReachBottom(() => {
  132. onLoadMore();
  133. });
  134. onLoad(() => {
  135. getLogList(props.isFreeze);
  136. });
  137. </script>
  138. <style lang="scss" scoped>
  139. .color-red {
  140. color: red;
  141. }
  142. .color-green {
  143. color: green;
  144. }
  145. .score-box {
  146. margin: 20rpx;
  147. border-radius: 20rpx;
  148. padding-top: 100rpx;
  149. }
  150. .avatar-box {
  151. width: 100rpx;
  152. height: 100rpx;
  153. border-radius: 50%;
  154. overflow: hidden;
  155. .avatar-img {
  156. width: 100%;
  157. height: 100%;
  158. }
  159. }
  160. .value-box {
  161. width: 100rpx;
  162. height: 100rpx;
  163. line-height: 100rpx;
  164. text-align: center;
  165. border-radius: 50%;
  166. border: 2px solid #f6f6f6;
  167. }
  168. .btn {
  169. width: 300rpx;
  170. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  171. border-radius: 20rpx;
  172. font-size: 30rpx;
  173. font-weight: 500;
  174. line-height: 80rpx;
  175. color: $white;
  176. position: relative;
  177. z-index: 1;
  178. }
  179. .header-box {
  180. width: 100%;
  181. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  182. background-size: 750rpx 100%;
  183. padding: 0 0 120rpx 0;
  184. box-sizing: border-box;
  185. .score-box {
  186. height: 100%;
  187. .all-num {
  188. font-size: 50rpx;
  189. font-weight: bold;
  190. color: #fff;
  191. font-family: OPPOSANS;
  192. }
  193. .all-title {
  194. font-size: 26rpx;
  195. font-weight: 500;
  196. color: #fff;
  197. }
  198. .cicon-help-o {
  199. color: #fff;
  200. font-size: 28rpx;
  201. }
  202. }
  203. }
  204. // 筛选
  205. .filter-box {
  206. height: 114rpx;
  207. background-color: $bg-page;
  208. .total-box {
  209. font-size: 24rpx;
  210. font-weight: 500;
  211. color: $dark-9;
  212. }
  213. .date-btn {
  214. background-color: $white;
  215. line-height: 54rpx;
  216. border-radius: 27rpx;
  217. padding: 0 20rpx;
  218. font-size: 24rpx;
  219. font-weight: 500;
  220. color: $dark-6;
  221. .ss-seldate-icon {
  222. font-size: 50rpx;
  223. color: $dark-9;
  224. }
  225. }
  226. }
  227. .list-box {
  228. // width: 600rpx;
  229. // padding: 0 30rpx;
  230. overflow-y: auto;
  231. height: 100vh;
  232. .list-item {
  233. background: #fff;
  234. // border-bottom: 1rpx solid #dfdfdf;
  235. padding: 30rpx;
  236. .name {
  237. font-size: 28rpx;
  238. font-weight: 500;
  239. color: rgba(102, 102, 102, 1);
  240. line-height: 28rpx;
  241. // margin-bottom: 20rpx;
  242. }
  243. .time {
  244. font-size: 24rpx;
  245. font-weight: 500;
  246. color: rgba(196, 196, 196, 1);
  247. line-height: 24px;
  248. }
  249. .add {
  250. font-size: 30rpx;
  251. font-weight: 500;
  252. color: #e6b873;
  253. }
  254. .minus {
  255. font-size: 30rpx;
  256. font-weight: 500;
  257. color: $dark-3;
  258. }
  259. }
  260. }
  261. </style>