s-wallet-card.vue 7.0 KB

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