index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="inspage-content" :style="{'--status-bar-': statusBarHeight}">
  3. <view class="inspage-content-info">
  4. <!-- 头部主要内容 开始 -->
  5. <view class="inspage-content-header">
  6. <customNavbar
  7. title="统计分销"
  8. bgColor="#fff"
  9. :contentStyle="{color: '#000'}"
  10. ></customNavbar>
  11. </view>
  12. <!-- 头部主要内容 结束 -->
  13. <!-- userInfo内容 开始 -->
  14. <view class="inspage-content-userinfo">
  15. <view class="inspage-userinfo-info">
  16. <view class="inspage-userinfo-title"><text>我邀请的(人数)</text></view>
  17. <view class="inspage-userinfo-count">
  18. <view
  19. class="inspage-userinfo-item"
  20. v-for="(item,index) in tool"
  21. :key="index"
  22. >
  23. <text>
  24. <u-count-to :decimals="item.num<100000?item.decimals:2" :startVal="0" :endVal="numFormat(item.num)" color="#fff" />
  25. <text v-if="item.num>=100000" class="inspage-userinfo-util">万</text>
  26. </text>
  27. <text>{{ item.title }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- userInfo内容 结束 -->
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { navigateTo } from "@/utils/util.js"
  38. export default {
  39. data() {
  40. return {
  41. title: '这是我的',
  42. statusBarHeight: 0, // 状态栏安全距离
  43. tool: [ // 我的工具
  44. { title: "邀请总人数",num: 20000,decimals:0 },
  45. { title: "待核销",num: 56900.99,decimals:2 },
  46. { title: "已核销",num: 12566000.99,decimals:2 },
  47. ]
  48. }
  49. },
  50. onLoad() {
  51. },
  52. onShow() {
  53. this.statusBarHeight = getApp().globalData.statusBarHeight
  54. },
  55. methods: {
  56. /**
  57. * @author ygh
  58. * @data 2023-12-20
  59. */
  60. navigateToFun(item){
  61. navigateTo(item.url)
  62. },
  63. /**
  64. * 数字显示格式化
  65. *
  66. */
  67. numFormat(num=0) {
  68. if(num<100000) {
  69. return num
  70. }else if(num>100000){
  71. return (num/10000).toFixed(2)
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .inspage-content {
  79. display: flex;
  80. flex-direction: column;
  81. align-items: center;
  82. justify-content: center;
  83. --header-h: 90rpx;
  84. .inspage-content-info {
  85. width: 100%;
  86. box-sizing: border-box;
  87. }
  88. }
  89. /** 头部主要内容 开始 */
  90. .inspage-content-header {
  91. width: 100%;
  92. height: var(--header-h);
  93. box-sizing: border-box;
  94. ::v-deep .u-search {
  95. padding: 0 30rpx !important;
  96. }
  97. ::v-deep .u-search__action {
  98. color: #fff !important;
  99. }
  100. }
  101. /** 头部主要内容 结束 **/
  102. /** userInfo内容 开始 */
  103. .inspage-content-userinfo {
  104. width: 100%;
  105. padding: 24rpx 40rpx 0;
  106. box-sizing: border-box;
  107. .inspage-userinfo-info {
  108. width: 100%;
  109. height: 320rpx;
  110. box-sizing: border-box;
  111. background-image: url("#{$image-beas-url}invitationStatistics/bgm.png");
  112. background-size: 100% 100%;
  113. background-repeat: no-repeat;
  114. border-radius: 20rpx;
  115. box-shadow: 0rpx 0 20rpx 2rpx rgba(205, 205, 205, 0.50);
  116. display: flex;
  117. flex-direction: column;
  118. align-items: flex-start;
  119. justify-content: space-between;
  120. color: #fff;
  121. font-size: 28rpx;
  122. font-family: SourceHanSansCN, SourceHanSansCN;
  123. padding: 38rpx 0;
  124. .inspage-userinfo-title {
  125. display: flex;
  126. font-weight: 600;
  127. width: 100%;
  128. box-sizing: border-box;
  129. padding: 0 36rpx;
  130. }
  131. .inspage-userinfo-count {
  132. width: 100%;
  133. display: flex;
  134. box-sizing: border-box;
  135. .inspage-userinfo-item {
  136. flex: 1;
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. flex-direction: column;
  141. > text:nth-child(1) {
  142. .inspage-userinfo-util {
  143. font-size: 24rpx;
  144. margin-left: 5rpx;
  145. }
  146. ::v-deep .u-count-num {
  147. font-weight: bold !important;
  148. font-size: 32rpx !important;
  149. }
  150. }
  151. > text:nth-child(2) {
  152. margin-top: 20rpx;
  153. font-size: 24rpx;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. /** userInfo内容 结束 **/
  160. </style>