maxScoreLog.vue 6.8 KB

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