score.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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="background:#0c912f">
  28. <view>消费分</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. 充值
  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. 消费分转让
  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. 当前可获得峰值:{{ 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%">佣金记录</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%">消费分记录</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%">提现 (预计24小时左右到账)</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%">佣金计算规则</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. 佣金计算规则
  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. const userWallet = computed(() => sheep.$store('user').userWallet);
  131. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  132. const userInfo = computed(() => sheep.$store('user').userInfo);
  133. const sys_navBar = sheep.$platform.navbar;
  134. const state = reactive({
  135. currentTab: 0,
  136. pagination: {
  137. list: [],
  138. total: 0,
  139. pageSize: 10,
  140. pageNo: 1,
  141. },
  142. loadStatus: '',
  143. showModel: false,
  144. });
  145. function close() {
  146. state.showModel = false;
  147. }
  148. const pointsPercentage = computed(() => {
  149. const currentQuota = parseFloat(points2point(userWallet.value.integralDO.accumulatedQuota + userWallet
  150. .value.integralDO.ancestorQuota));
  151. const highQuotaTotal = parseFloat(points2point(userWallet.value.integralDO.highQuotaTotal));
  152. const percentage = (currentQuota / highQuotaTotal) * 100;
  153. return Math.min(percentage, 100); // 确保百分比不会超过100
  154. });
  155. const percentageColor = computed(() => {
  156. if (pointsPercentage.value >= 90) {
  157. return '#fe0000';
  158. } else if (pointsPercentage.value >= 75) {
  159. return '#d8b800';
  160. } else {
  161. return '#0c912f';
  162. }
  163. });
  164. const circleStyle = computed(() => {
  165. return {
  166. // background: `conic-gradient(${percentageColor.value} ${pointsPercentage.value}%, #ddd ${pointsPercentage.value}%)`
  167. background: percentageColor.value
  168. };
  169. });
  170. onLoad((options) => {
  171. uni.$on('createWithDrawComplete', sheep.$store('user').getWallet);
  172. uni.$on('consumptionTransfersComplete', sheep.$store('user').getWallet);
  173. });
  174. </script>
  175. <style lang="scss" scoped>
  176. .circle {
  177. position: relative;
  178. width: 100px;
  179. height: 100px;
  180. border-radius: 50%;
  181. }
  182. .circle::before {
  183. content: '';
  184. position: absolute;
  185. top: 5px;
  186. left: 5px;
  187. right: 5px;
  188. bottom: 5px;
  189. border-radius: 50%;
  190. background-color: #fff;
  191. }
  192. .circle view {
  193. position: absolute;
  194. top: 50%;
  195. left: 50%;
  196. transform: translate(-50%, -50%);
  197. font-size: 14px;
  198. font-weight: bold;
  199. }
  200. .scroll-view_H {
  201. width: 600rpx;
  202. height: 700rpx;
  203. padding: 20rpx;
  204. }
  205. .head-nav {
  206. margin: 20rpx auto;
  207. display: flex;
  208. align-items: center;
  209. box-sizing: border-box;
  210. color: var(--ui-BG-Main);
  211. }
  212. .head-nav>view {
  213. padding-bottom: 10rpx;
  214. border-bottom: 4rpx solid var(--ui-BG-Main);
  215. }
  216. .uni-list-item {
  217. margin: 0 20rpx;
  218. padding: 10rpx 0;
  219. border-bottom: 1px solid #d8d8d9;
  220. }
  221. .color-red {
  222. color: red;
  223. }
  224. .color-green {
  225. color: green;
  226. }
  227. .score-box {
  228. border-radius: 20rpx;
  229. // padding-top: 100rpx;
  230. }
  231. .avatar-box {
  232. width: 100rpx;
  233. height: 100rpx;
  234. border-radius: 50%;
  235. overflow: hidden;
  236. .avatar-img {
  237. width: 100%;
  238. height: 100%;
  239. }
  240. }
  241. .value-box {
  242. width: 150rpx;
  243. height: 150rpx;
  244. text-align: center;
  245. border-radius: 50%;
  246. font-weight: bold;
  247. }
  248. .btn {
  249. padding:0 1rem;
  250. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  251. border-radius: 20rpx;
  252. font-size: 28rpx;
  253. font-weight: 500;
  254. color: $white;
  255. position: relative;
  256. z-index: 1;
  257. }
  258. .header-box {
  259. width: 100%;
  260. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  261. background-size: 750rpx 100%;
  262. padding: 0 0 120rpx 0;
  263. box-sizing: border-box;
  264. .score-box {
  265. height: 100%;
  266. .all-num {
  267. font-size: 50rpx;
  268. font-weight: bold;
  269. color: #fff;
  270. font-family: OPPOSANS;
  271. }
  272. .all-title {
  273. font-size: 26rpx;
  274. font-weight: 500;
  275. color: #fff;
  276. }
  277. .cicon-help-o {
  278. color: #fff;
  279. font-size: 28rpx;
  280. }
  281. }
  282. }
  283. // 筛选
  284. .filter-box {
  285. height: 114rpx;
  286. background-color: $bg-page;
  287. .total-box {
  288. font-size: 24rpx;
  289. font-weight: 500;
  290. color: $dark-9;
  291. }
  292. .date-btn {
  293. background-color: $white;
  294. line-height: 54rpx;
  295. border-radius: 27rpx;
  296. padding: 0 20rpx;
  297. font-size: 24rpx;
  298. font-weight: 500;
  299. color: $dark-6;
  300. .ss-seldate-icon {
  301. font-size: 50rpx;
  302. color: $dark-9;
  303. }
  304. }
  305. }
  306. .model-box {
  307. height: 50vh;
  308. }
  309. .list-box {
  310. width: 500rpx;
  311. padding: 0 30rpx;
  312. overflow-y: auto;
  313. .list-item {
  314. background: #fff;
  315. // border-bottom: 1rpx solid #dfdfdf;
  316. padding: 30rpx;
  317. .name {
  318. font-size: 28rpx;
  319. font-weight: 500;
  320. color: rgba(102, 102, 102, 1);
  321. line-height: 28rpx;
  322. // margin-bottom: 20rpx;
  323. }
  324. .time {
  325. font-size: 24rpx;
  326. font-weight: 500;
  327. color: rgba(196, 196, 196, 1);
  328. line-height: 24px;
  329. }
  330. .add {
  331. font-size: 30rpx;
  332. font-weight: 500;
  333. color: #e6b873;
  334. }
  335. .minus {
  336. font-size: 30rpx;
  337. font-weight: 500;
  338. color: $dark-3;
  339. }
  340. }
  341. }
  342. </style>