s-wallet-card.vue 6.9 KB

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