score.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <!-- 我的佣金 -->
  2. <template>
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" title="我的佣金" navbar="normal">
  4. <view class="score-box bg-white ss-flex-col ss-row-center ss-col-center">
  5. <view class="ss-flex ss-m-y-30 w-100">
  6. <view class="ss-flex" style="flex-direction: column;flex:1;border-right:1px solid #f6f6f6">
  7. <view class="ss-m-b-10 circle value-box ss-flex ss-row-center" :style="circleStyle">
  8. <view>佣金</view>
  9. </view>
  10. <view class="ss-m-b-30 ss-font-40" :style="{color:percentageColor}">
  11. <text class="all-title ss-m-r-8">{{ points2point(userWallet.integralDO.currentQuota) }}</text>
  12. </view>
  13. <view class="ss-flex">
  14. <view class="all-title ss-m-r-8">
  15. <button class="btn ss-reset-button" @tap="sheep.$router.go('/pages/user/wallet/withdraw')">
  16. 提现
  17. </button>
  18. </view>
  19. <view class="all-title ss-m-r-8">
  20. <button class="btn ss-reset-button" @tap="sheep.$router.go('/pages/user/wallet/scoreToConsumption')">
  21. 转消费分
  22. </button>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="ss-flex" style="flex-direction: column;flex:1;">
  27. <view class="ss-m-b-10 circle value-box ss-flex ss-row-center" :style="circleStyle">
  28. <view>消费分</view>
  29. </view>
  30. <view class="ss-m-b-30 ss-font-40" :style="{color:percentageColor}">
  31. <text class="all-title ss-m-r-8">{{ points2point(userWallet.integralDO.consumptionPoints) }}</text>
  32. </view>
  33. <view class="ss-flex">
  34. <view class="all-title ss-m-x-8">
  35. <button class="btn ss-reset-button" @tap="sheep.$router.go('/pages/user/wallet/consumptionTransfers')">
  36. 消费分转让
  37. </button>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 分割线 -->
  43. <view style="width: 100%;height: 20rpx;background-color: #ececec;"></view>
  44. <uni-list :border="false" class="ss-p-t-10 ss-w-100">
  45. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/maxScoreLog')" title="当前可获得峰值"
  46. showArrow :border="false">
  47. <template v-slot:body>
  48. <p style="width: 100%">
  49. 当前可获得峰值:{{ points2point(userWallet.integralDO.accumulatedQuota + userWallet.integralDO.ancestorQuota) }}/{{ points2point(userWallet.integralDO.highQuotaTotal) }}
  50. </p>
  51. </template>
  52. </uni-list-item>
  53. <!-- <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/ScoreLog', {isFreeze: true})"
  54. title="待确权" showArrow :border="false">
  55. <template v-slot:body>
  56. <p style="width: 100%">待确权:{{points2point(userWallet.integralDO.freezeQuota)}}</p>
  57. </template>
  58. </uni-list-item> -->
  59. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/ScoreLog',{isFreeze: false})"
  60. title="佣金来源记录" showArrow :border="false">
  61. <template v-slot:body>
  62. <p style="width: 100%">佣金来源</p>
  63. </template>
  64. </uni-list-item>
  65. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/consumptionLog')"
  66. title="消费分来源" showArrow :border="false">
  67. <template v-slot:body>
  68. <p style="width: 100%">消费分来源</p>
  69. </template>
  70. </uni-list-item>
  71. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/withdrawalLog')" title="提现记录"
  72. showArrow :border="false">
  73. <template v-slot:body>
  74. <p style="width: 100%">提现 (预计24小时左右到账)</p>
  75. </template>
  76. </uni-list-item>
  77. <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/consumptionTransfersLog')"
  78. title="消费分转账" showArrow :border="false">
  79. <template v-slot:body>
  80. <p style="width: 100%">消费分转账</p>
  81. </template>
  82. </uni-list-item>
  83. <uni-list-item clickable @tap="state.showModel = true" title="佣金计算规则" :border="false">
  84. <template v-slot:body>
  85. <p style="width: 100%">佣金计算规则</p>
  86. </template>
  87. </uni-list-item>
  88. </uni-list>
  89. </view>
  90. <!-- 佣金计算规则 -->
  91. <su-popup :show="state.showModel" type="center" round="10" :isMaskClick="false" showClose @close="close">
  92. <view class="head-nav">
  93. <view :class="state.navIndex==0?'activite':''" class="ss-m-l-20" @click="checkIndex(0)">
  94. 佣金计算规则
  95. </view>
  96. </view>
  97. <scroll-view class="scroll-view_H" scroll-y="true">
  98. <richtext title="佣金计算规则" type='tab' />
  99. </scroll-view>
  100. </su-popup>
  101. </s-layout>
  102. </template>
  103. <script setup>
  104. import sheep from '@/sheep';
  105. import {
  106. onLoad,
  107. onReachBottom
  108. } from '@dcloudio/uni-app';
  109. import {
  110. computed,
  111. reactive
  112. } from 'vue';
  113. import {
  114. points2point
  115. } from '@/sheep/hooks/useGoods';
  116. import _ from 'lodash';
  117. import dayjs from 'dayjs';
  118. import PointApi from '@/sheep/api/member/point';
  119. import {
  120. resetPagination
  121. } from '@/sheep/util';
  122. import ScoreApi from '@/sheep/api/distri/score';
  123. import ScoreLog from './ScoreLog'
  124. import richtext from '@/pages/public/richtext'
  125. const userWallet = computed(() => sheep.$store('user').userWallet);
  126. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  127. const userInfo = computed(() => sheep.$store('user').userInfo);
  128. const sys_navBar = sheep.$platform.navbar;
  129. const state = reactive({
  130. currentTab: 0,
  131. pagination: {
  132. list: [],
  133. total: 0,
  134. pageSize: 10,
  135. pageNo: 1,
  136. },
  137. loadStatus: '',
  138. showModel: false,
  139. });
  140. function close() {
  141. state.showModel = false;
  142. }
  143. const pointsPercentage = computed(() => {
  144. const currentQuota = parseFloat(points2point(userWallet.value.integralDO.accumulatedQuota + userWallet
  145. .value.integralDO.ancestorQuota));
  146. const highQuotaTotal = parseFloat(points2point(userWallet.value.integralDO.highQuotaTotal));
  147. const percentage = (currentQuota / highQuotaTotal) * 100;
  148. return Math.min(percentage, 100); // 确保百分比不会超过100
  149. });
  150. const percentageColor = computed(() => {
  151. if (pointsPercentage.value >= 90) {
  152. return '#fe0000';
  153. } else if (pointsPercentage.value >= 75) {
  154. return '#d8b800';
  155. } else {
  156. return '#0c912f';
  157. }
  158. });
  159. const circleStyle = computed(() => {
  160. return {
  161. // background: `conic-gradient(${percentageColor.value} ${pointsPercentage.value}%, #ddd ${pointsPercentage.value}%)`
  162. background: percentageColor.value
  163. };
  164. });
  165. onLoad((options) => {
  166. uni.$on('createWithDrawComplete', sheep.$store('user').getWallet);
  167. uni.$on('consumptionTransfersComplete', sheep.$store('user').getWallet);
  168. });
  169. </script>
  170. <style lang="scss" scoped>
  171. .circle {
  172. position: relative;
  173. width: 100px;
  174. height: 100px;
  175. border-radius: 50%;
  176. }
  177. .circle::before {
  178. content: '';
  179. position: absolute;
  180. top: 10px;
  181. left: 10px;
  182. right: 10px;
  183. bottom: 10px;
  184. border-radius: 50%;
  185. background-color: #fff;
  186. }
  187. .circle view {
  188. position: absolute;
  189. top: 50%;
  190. left: 50%;
  191. transform: translate(-50%, -50%);
  192. font-size: 14px;
  193. font-weight: bold;
  194. }
  195. .scroll-view_H {
  196. width: 600rpx;
  197. height: 700rpx;
  198. padding: 20rpx;
  199. }
  200. .head-nav {
  201. margin: 20rpx auto;
  202. display: flex;
  203. align-items: center;
  204. box-sizing: border-box;
  205. color: var(--ui-BG-Main);
  206. }
  207. .head-nav>view {
  208. padding-bottom: 10rpx;
  209. border-bottom: 4rpx solid var(--ui-BG-Main);
  210. }
  211. .uni-list-item {
  212. margin: 0 20rpx;
  213. padding: 10rpx 0;
  214. border-bottom: 1px solid #d8d8d9;
  215. }
  216. .color-red {
  217. color: red;
  218. }
  219. .color-green {
  220. color: green;
  221. }
  222. .score-box {
  223. border-radius: 20rpx;
  224. // padding-top: 100rpx;
  225. }
  226. .avatar-box {
  227. width: 100rpx;
  228. height: 100rpx;
  229. border-radius: 50%;
  230. overflow: hidden;
  231. .avatar-img {
  232. width: 100%;
  233. height: 100%;
  234. }
  235. }
  236. .value-box {
  237. width: 150rpx;
  238. height: 150rpx;
  239. text-align: center;
  240. border-radius: 50%;
  241. font-weight: bold;
  242. }
  243. .btn {
  244. padding:0 0.5rem;
  245. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  246. border-radius: 20rpx;
  247. font-size: 30rpx;
  248. font-weight: 500;
  249. // line-height: 80rpx;
  250. color: $white;
  251. position: relative;
  252. z-index: 1;
  253. }
  254. .header-box {
  255. width: 100%;
  256. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  257. background-size: 750rpx 100%;
  258. padding: 0 0 120rpx 0;
  259. box-sizing: border-box;
  260. .score-box {
  261. height: 100%;
  262. .all-num {
  263. font-size: 50rpx;
  264. font-weight: bold;
  265. color: #fff;
  266. font-family: OPPOSANS;
  267. }
  268. .all-title {
  269. font-size: 26rpx;
  270. font-weight: 500;
  271. color: #fff;
  272. }
  273. .cicon-help-o {
  274. color: #fff;
  275. font-size: 28rpx;
  276. }
  277. }
  278. }
  279. // 筛选
  280. .filter-box {
  281. height: 114rpx;
  282. background-color: $bg-page;
  283. .total-box {
  284. font-size: 24rpx;
  285. font-weight: 500;
  286. color: $dark-9;
  287. }
  288. .date-btn {
  289. background-color: $white;
  290. line-height: 54rpx;
  291. border-radius: 27rpx;
  292. padding: 0 20rpx;
  293. font-size: 24rpx;
  294. font-weight: 500;
  295. color: $dark-6;
  296. .ss-seldate-icon {
  297. font-size: 50rpx;
  298. color: $dark-9;
  299. }
  300. }
  301. }
  302. .model-box {
  303. height: 50vh;
  304. }
  305. .list-box {
  306. width: 500rpx;
  307. padding: 0 30rpx;
  308. overflow-y: auto;
  309. .list-item {
  310. background: #fff;
  311. // border-bottom: 1rpx solid #dfdfdf;
  312. padding: 30rpx;
  313. .name {
  314. font-size: 28rpx;
  315. font-weight: 500;
  316. color: rgba(102, 102, 102, 1);
  317. line-height: 28rpx;
  318. // margin-bottom: 20rpx;
  319. }
  320. .time {
  321. font-size: 24rpx;
  322. font-weight: 500;
  323. color: rgba(196, 196, 196, 1);
  324. line-height: 24px;
  325. }
  326. .add {
  327. font-size: 30rpx;
  328. font-weight: 500;
  329. color: #e6b873;
  330. }
  331. .minus {
  332. font-size: 30rpx;
  333. font-weight: 500;
  334. color: $dark-3;
  335. }
  336. }
  337. }
  338. </style>