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