score.vue 9.7 KB

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