s-wallet-card.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <!-- 装修用户组件:用户资产 -->
  2. <template>
  3. <view>
  4. <view class="progress-box" @tap="state.showProtocol = true">
  5. <view class="progress-container">
  6. <view class="progress-bar" :style="{ width: progressWidth }">
  7. </view>
  8. <view class="progress-text">
  9. {{userWallet.socialStatusLevel || $t('common.no_level')}}
  10. </view>
  11. </view>
  12. </view>
  13. <!-- <view class="ss-wallet-menu-wrap ss-flex ss-col-center">
  14. <view class="menu-item ss-flex-1 ss-flex-col ss-col-center">
  15. <view class="value-box ">
  16. <view class="value-text ">看点</view>
  17. </view>
  18. <view class="menu-title ss-m-t-15">*888</view>
  19. <view class="menu-title ss-m-t-15">看广告做任务得收益</view>
  20. </view>
  21. <view class="menu-item ss-flex-1 ss-flex-col ss-col-center"
  22. @tap="sheep.$router.go('/pages/user/wallet/score')">
  23. <view class="value-box ">
  24. <view class="value-text">佣金</view>
  25. </view>
  26. <view class="menu-title ss-m-t-15">#{{ userInfo.point || 0 }}</view>
  27. <view class="menu-title ss-m-t-15">=数字人民币:7263</view>
  28. 注释 <view class="menu-title ss-m-t-15">=NFR(数字资产):87263</view>
  29. <view class="menu-mini-title ss-m-t-15">[按32小时市场均值实时换算]</view>
  30. </view>
  31. <view class="menu-item ss-flex-1 ss-flex-col ss-col-center"
  32. @tap="sheep.$router.go('/pages/user/wallet/team')">
  33. <view class="value-box ">
  34. <view class="value-text">团队</view>
  35. </view>
  36. <view class="menu-title ss-m-t-15">88人</view>
  37. <view class="menu-title ss-m-t-15">直推人今日贡献#92</view>
  38. <view class="menu-title ss-m-t-15">直推人总贡献值#7692</view>
  39. </view>
  40. <view class="menu-item ss-flex-col ss-col-center menu-wallet">
  41. <view class="value-box ">
  42. <view class="value-text">NFR</view>
  43. </view>
  44. <view class="menu-title ss-m-t-15">8734枚</view>
  45. <view class="menu-title ss-m-t-15">历史转换数量</view>
  46. <view class="menu-title ss-m-t-15">点击跳转查看行情</view>
  47. </view>
  48. </view> -->
  49. <view class="ss-wallet-menu-wrap ss-flex ss-col-center">
  50. <view class="menu-item ss-flex-1 ss-flex-col ss-col-center ss-row-center"
  51. @tap="sheep.$router.go('/pages/user/wallet/score')">
  52. <view class="value-box ">
  53. <view class="value-text">{{$t('wallet.wallet')}}</view>
  54. </view>
  55. <view class="menu-title ss-m-t-15 text-center">{{$t('wallet.commission')}}:{{ points2point(userWallet.integralDO.currentQuota) }}</view>
  56. <view class="menu-title ss-m-t-15 text-center">{{$t('wallet.consumption_points')}}:{{ points2point(userWallet.integralDO.consumptionPoints) }}</view>
  57. <!-- <view class="menu-title ss-m-t-15">待确权:{{ points2point(userWallet.integralDO.freezeQuota) }}</view> -->
  58. </view>
  59. <view class="menu-item ss-flex-1 ss-flex-col ss-col-center ss-row-center"
  60. @tap="sheep.$router.go('/pages/user/wallet/team')">
  61. <view class="value-box ">
  62. <view class="value-text">{{$t('wallet.team')}}</view>
  63. </view>
  64. <view class="menu-title ss-m-t-15">{{ userWallet.descNo +" "+ $t('wallet.people') }}</view>
  65. </view>
  66. </view>
  67. <!-- 佣金确权 -->
  68. <su-popup :show="state.showProtocol" type="center" round="10" :isMaskClick="false" showClose @close="close">
  69. <view class="head-nav">
  70. <view :class="state.navIndex==0?'activite':''" class="ss-m-l-20" @click="checkIndex(0)">
  71. {{$t('wallet.generation_rules')}}
  72. </view>
  73. <view :class="state.navIndex==1?'activite':''" class="ss-m-l-20" @click="checkIndex(1)">
  74. {{$t('wallet.benefits')}}
  75. </view>
  76. </view>
  77. <scroll-view class="scroll-view_H" scroll-y="true">
  78. <Richtext title="身价产生规则" v-if="state.navIndex==0" type='tab' />
  79. <Richtext title="身价权益" v-if="state.navIndex==1" type='tab' />
  80. </scroll-view>
  81. </su-popup>
  82. </view>
  83. </template>
  84. <script setup>
  85. /**
  86. * 装修组件 - 订单菜单组
  87. */
  88. import {
  89. computed,
  90. reactive
  91. } from 'vue';
  92. import sheep from '@/sheep';
  93. import {
  94. fen2yuan,
  95. points2point
  96. } from '../../hooks/useGoods';
  97. import Richtext from '@/pages/public/richtext.vue'
  98. const state = reactive({
  99. showProtocol: false,
  100. navIndex: 0
  101. })
  102. const userWallet = computed(() => sheep.$store('user').userWallet);
  103. const userInfo = computed(() => sheep.$store('user').userInfo);
  104. const numData = computed(() => sheep.$store('user').numData);
  105. const progressWidth = computed(() => {
  106. if (!userWallet.value.socialStatusPoint && !userWallet.value.socialStatusPoint){
  107. return "0%"
  108. }
  109. const progress = ((userWallet.value.socialStatusPoint / (userWallet.value.socialStatusPoint +
  110. userWallet.value.socialUpNeed)) * 100) + "%"
  111. // console.log(progress)
  112. return progress
  113. })
  114. // 查看协议
  115. function onProtocol(title) {
  116. sheep.$router.go('/pages/public/richtext', {
  117. title,
  118. });
  119. }
  120. const close = () => {
  121. state.showProtocol = false
  122. }
  123. function checkIndex(index) {
  124. state.navIndex = index;
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .head-nav {
  129. margin: 20rpx auto;
  130. display: flex;
  131. align-items: center;
  132. color: #CCCCCC;
  133. }
  134. .activite {
  135. box-sizing: border-box;
  136. color: var(--ui-BG-Main);
  137. border-bottom: 4rpx solid var(--ui-BG-Main);
  138. }
  139. .head-nav>view {
  140. padding-bottom: 10rpx;
  141. }
  142. .content {
  143. /* background: #008000; */
  144. height: 100%;
  145. }
  146. .scroll-view_H {
  147. width: 600rpx;
  148. height: 700rpx;
  149. padding: 20rpx;
  150. }
  151. .progress-box {
  152. padding: 40rpx 40rpx 0;
  153. }
  154. /* 进度条容器 */
  155. .progress-container {
  156. width: 100%;
  157. /* 全宽 */
  158. height: 40rpx;
  159. /* 高度 */
  160. background-color: #e0e0e0;
  161. /* 背景色 */
  162. border-radius: 20rpx;
  163. /* 圆角 */
  164. position: relative;
  165. /* 相对定位,用于文本定位 */
  166. }
  167. /* 进度条 */
  168. .progress-bar {
  169. height: 100%;
  170. background: var(--ui-BG-Main);
  171. /* 渐变色 */
  172. border-radius: 20rpx;
  173. /* 圆角 */
  174. position: relative;
  175. /* 相对定位,用于文本定位 */
  176. display: flex;
  177. /* 开启 Flex 布局 */
  178. align-items: center;
  179. /* 垂直居中 */
  180. justify-content: center;
  181. /* 水平居中 */
  182. }
  183. /* 进度文本 */
  184. .progress-text {
  185. color: white;
  186. font-size: 16px;
  187. position: absolute;
  188. left: 50%;
  189. top: 50%;
  190. transform: translate(-50%, -50%);
  191. }
  192. .ss-wallet-menu-wrap {
  193. flex-wrap: wrap;
  194. height: auto;
  195. padding: 40rpx;
  196. .menu-wallet {
  197. width: 144rpx;
  198. }
  199. // .menu-item:nth-child(1),
  200. // .menu-item:nth-child(2) {
  201. // border-bottom: 4rpx solid #f6f6f6;
  202. // }
  203. .menu-item:nth-child(odd) {
  204. border-right: 4rpx solid #f6f6f6;
  205. }
  206. .menu-item {
  207. height: 300rpx;
  208. flex: 0 0 50%;
  209. /* flex-grow: 0, flex-shrink: 0, flex-basis: 50% */
  210. box-sizing: border-box;
  211. padding: 20rpx;
  212. /* 确保 padding 和 border 不会使元素宽度超过 50% */
  213. /* 可选,为了视觉效果 */
  214. .menu-title {
  215. font-size: 32rpx;
  216. line-height: 32rpx;
  217. color: #333333;
  218. }
  219. /* 可选,为了视觉效果 */
  220. .menu-mini-title {
  221. font-size: 20rpx;
  222. line-height: 20rpx;
  223. color: #333333;
  224. }
  225. .item-icon {
  226. width: 44rpx;
  227. height: 44rpx;
  228. }
  229. .value-box {
  230. width: 120rpx;
  231. height: 120rpx;
  232. // line-height: 100rpx;
  233. text-align: center;
  234. border-radius: 50%;
  235. border: 2px solid #f6f6f6;
  236. display:flex;
  237. align-items: center;
  238. justify-content: center;
  239. .value-text {
  240. font-size: 28rpx;
  241. color: #000000;
  242. // line-height: 100rpx;
  243. vertical-align: text-bottom;
  244. font-family: OPPOSANS;
  245. }
  246. .unit-text {
  247. font-size: 24rpx;
  248. color: #343434;
  249. line-height: 24rpx;
  250. }
  251. }
  252. }
  253. }
  254. </style>