Home.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <!-- 我的推广页 -->
  3. <div id="home">
  4. <!-- 团队 -->
  5. <ShowMoney :title="teamTitleArr" :content="teamContentArr" />
  6. <!-- 个人 -->
  7. <!-- <ShowMoney :title="myTitleArr" :content="myContentArr" /> -->
  8. <!-- 链接部分 -->
  9. <!-- <HomeLink /> -->
  10. </div>
  11. </template>
  12. <script>
  13. import ShowMoney from "@/components/ShowMoney/ShowMoney";
  14. import HomeLink from "@/views/Home/HomeLink/HomeLink";
  15. import { mapState } from "vuex";
  16. export default {
  17. name: "Home",
  18. components: {
  19. ShowMoney,
  20. HomeLink,
  21. },
  22. inject: ["checkCode"],
  23. data() {
  24. return {
  25. teamTitleArr: [
  26. "玩家人数",
  27. "推广员人数",
  28. "玩家总充值(总佣金)",
  29. "推广员总充值(总佣金)",
  30. "总充值",
  31. "当前已赚取佣金",
  32. ],
  33. teamContentArr: [0, 0, "0(0)", "0(0)", 0, 0],
  34. };
  35. },
  36. computed: {
  37. ...mapState(["userProfit"]),
  38. },
  39. watch: {
  40. userProfit() {
  41. this.init();
  42. },
  43. },
  44. created() {},
  45. mounted() {
  46. this.init();
  47. },
  48. methods: {
  49. init() {
  50. const {
  51. game_user_amount,
  52. game_user_profit,
  53. promo_user_amount,
  54. promo_user_profit,
  55. game_user_count,
  56. promo_user_count,
  57. } = this.userProfit;
  58. this.teamContentArr = [
  59. game_user_count,
  60. promo_user_count,
  61. `${(game_user_amount / 100).toFixed(2)}(${(
  62. game_user_profit / 100
  63. ).toFixed(2)})`,
  64. `${(promo_user_amount / 100).toFixed(2)}(${(
  65. promo_user_profit / 100
  66. ).toFixed(2)})`,
  67. ((game_user_amount + promo_user_amount) / 100).toFixed(2),
  68. ((game_user_profit + promo_user_profit) / 100).toFixed(2),
  69. ];
  70. },
  71. },
  72. };
  73. </script>
  74. <style scoped>
  75. #home {
  76. min-width: 1120px;
  77. width: 98%;
  78. margin: 0 auto;
  79. overflow: hidden;
  80. }
  81. </style>