score.vue 9.6 KB

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