|
|
@@ -13,7 +13,7 @@
|
|
|
<script>
|
|
|
import ShowMoney from "@/components/ShowMoney/ShowMoney";
|
|
|
import HomeLink from "@/views/Home/HomeLink/HomeLink";
|
|
|
-import { mapState } from "vuex";
|
|
|
+import { mapActions, mapState } from "vuex";
|
|
|
export default {
|
|
|
name: "Home",
|
|
|
components: {
|
|
|
@@ -44,9 +44,12 @@ export default {
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
- this.init();
|
|
|
+ this.onProfit();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions(["userProfitAction"]),
|
|
|
+
|
|
|
+ // 初始化
|
|
|
init() {
|
|
|
const {
|
|
|
game_user_amount,
|
|
|
@@ -69,6 +72,20 @@ export default {
|
|
|
((game_user_profit + promo_user_profit) / 100).toFixed(2),
|
|
|
];
|
|
|
},
|
|
|
+
|
|
|
+ // 获取已赚取佣金
|
|
|
+ onProfit() {
|
|
|
+ this.$api.profit().then((res) => {
|
|
|
+ this.checkCode(res);
|
|
|
+ const { code, data } = res.data;
|
|
|
+ if (code) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 成功 todo
|
|
|
+ this.userProfitAction(data);
|
|
|
+ this.init();
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|