ScoreLog.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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'">{{ t('wallet.balance') }}:{{ points2point(item.afterFreezeAmount)}}</text>
  28. <text style="float: right;" v-else>{{ t('wallet.balance') }}:{{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:t('common.click_to_load_more'),
  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. import { t } from '@/locale'
  63. const userWallet = computed(() => sheep.$store('user').userWallet);
  64. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  65. const userInfo = computed(() => sheep.$store('user').userInfo);
  66. const sys_navBar = sheep.$platform.navbar;
  67. const props = defineProps({
  68. isFreeze: {
  69. type: String,
  70. default: ''
  71. }
  72. })
  73. const state = reactive({
  74. currentTab: 0,
  75. pagination: {
  76. list: [],
  77. total: 0,
  78. pageSize: 10,
  79. pageNo: 1,
  80. },
  81. loadStatus: '',
  82. showModel: false,
  83. showQueModel: false
  84. });
  85. async function getLogList(isFreeze) {
  86. state.loadStatus = 'loading';
  87. // isFreeze为true是冻结佣金 isFreeze为false是已拿到的佣金
  88. let {
  89. code,
  90. data
  91. } = await ScoreApi.getScoreApi({
  92. pageNo: state.pagination.pageNo,
  93. pageSize: state.pagination.pageSize,
  94. isFreeze: isFreeze
  95. });
  96. if (code !== 0) {
  97. return;
  98. }
  99. let list = _.concat(state.pagination.list, data.list);
  100. state.pagination.list = list;
  101. state.pagination.total = data.total;
  102. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  103. }
  104. // 列表标题
  105. const title = (item) => {
  106. // {{ item.profitStatusName || '空' }}
  107. let title = item.profitStatusName + '';
  108. // 如果有返回username就显示
  109. if(item.username){
  110. title += '('+item.username+ ')'
  111. }
  112. // 如果profitStatus === 3 | 4 | 7 就会显示待确权 否则都是确权
  113. // if([3,4,7].includes(item.profitStatus) && props.isFreeze == 'true'){
  114. // title += "-转确权"
  115. // }
  116. if([3].includes(item.profitStatus) && props.isFreeze == 'false' && item.ancestorQuotaAmount){
  117. title += '('+t('wallet.exceed_limit')+':' + points2point(item.ancestorQuotaAmount) + ')'
  118. }
  119. if([22].includes(item.profitStatus) && props.isFreeze == 'false' && item.accumulatedQuotaAmount){
  120. title += '('+t('wallet.exceed_limit')+':' + points2point(item.accumulatedQuotaAmount) + ')'
  121. }
  122. // title += ")"
  123. return title;
  124. }
  125. function onLoadMore(isFreeze) {
  126. if (state.loadStatus === 'noMore') {
  127. return;
  128. }
  129. state.pagination.pageNo++;
  130. getLogList(props.isFreeze);
  131. }
  132. onReachBottom(() => {
  133. onLoadMore();
  134. });
  135. onLoad(() => {
  136. getLogList(props.isFreeze);
  137. });
  138. </script>
  139. <style lang="scss" scoped>
  140. .color-red {
  141. color: red;
  142. }
  143. .color-green {
  144. color: green;
  145. }
  146. .score-box {
  147. margin: 20rpx;
  148. border-radius: 20rpx;
  149. padding-top: 100rpx;
  150. }
  151. .avatar-box {
  152. width: 100rpx;
  153. height: 100rpx;
  154. border-radius: 50%;
  155. overflow: hidden;
  156. .avatar-img {
  157. width: 100%;
  158. height: 100%;
  159. }
  160. }
  161. .value-box {
  162. width: 100rpx;
  163. height: 100rpx;
  164. line-height: 100rpx;
  165. text-align: center;
  166. border-radius: 50%;
  167. border: 2px solid #f6f6f6;
  168. }
  169. .btn {
  170. width: 300rpx;
  171. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  172. border-radius: 20rpx;
  173. font-size: 30rpx;
  174. font-weight: 500;
  175. line-height: 80rpx;
  176. color: $white;
  177. position: relative;
  178. z-index: 1;
  179. }
  180. .header-box {
  181. width: 100%;
  182. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  183. background-size: 750rpx 100%;
  184. padding: 0 0 120rpx 0;
  185. box-sizing: border-box;
  186. .score-box {
  187. height: 100%;
  188. .all-num {
  189. font-size: 50rpx;
  190. font-weight: bold;
  191. color: #fff;
  192. font-family: OPPOSANS;
  193. }
  194. .all-title {
  195. font-size: 26rpx;
  196. font-weight: 500;
  197. color: #fff;
  198. }
  199. .cicon-help-o {
  200. color: #fff;
  201. font-size: 28rpx;
  202. }
  203. }
  204. }
  205. // 筛选
  206. .filter-box {
  207. height: 114rpx;
  208. background-color: $bg-page;
  209. .total-box {
  210. font-size: 24rpx;
  211. font-weight: 500;
  212. color: $dark-9;
  213. }
  214. .date-btn {
  215. background-color: $white;
  216. line-height: 54rpx;
  217. border-radius: 27rpx;
  218. padding: 0 20rpx;
  219. font-size: 24rpx;
  220. font-weight: 500;
  221. color: $dark-6;
  222. .ss-seldate-icon {
  223. font-size: 50rpx;
  224. color: $dark-9;
  225. }
  226. }
  227. }
  228. .list-box {
  229. // width: 600rpx;
  230. // padding: 0 30rpx;
  231. overflow-y: auto;
  232. height: 100vh;
  233. .list-item {
  234. background: #fff;
  235. // border-bottom: 1rpx solid #dfdfdf;
  236. padding: 30rpx;
  237. .name {
  238. font-size: 28rpx;
  239. font-weight: 500;
  240. color: rgba(102, 102, 102, 1);
  241. line-height: 28rpx;
  242. // margin-bottom: 20rpx;
  243. }
  244. .time {
  245. font-size: 24rpx;
  246. font-weight: 500;
  247. color: rgba(196, 196, 196, 1);
  248. line-height: 24px;
  249. }
  250. .add {
  251. font-size: 30rpx;
  252. font-weight: 500;
  253. color: #e6b873;
  254. }
  255. .minus {
  256. font-size: 30rpx;
  257. font-weight: 500;
  258. color: $dark-3;
  259. }
  260. }
  261. }
  262. </style>