medium.vue 1.42 KB
<template>
  <div class="medium"></div>
</template>

<script>
export default {
  name: "Medium",
  data() {
    return {};
  },
  methods: {
    // navQuery() {
    //   this.$router.replace({
    //     path: "/medium",
    //     query: {
    //       bc_tag: 20,
    //       phone: btoa(13828152582),
    //     },
    //   });
    // },
  },
  async mounted() {
    // await this.navQuery();
    //手机号登录
    if (this.$route.query.phone) {
      let phoneparams = window.atob(
        decodeURIComponent(this.$route.query.phone)
      );
      await this.$store.dispatch("PayPhoneLogin", phoneparams);
      if (this.$route.query.bc_tag) {
        await this.$store.dispatch("gainReturnBc", {
          type: 3,
          bcTag: this.$route.query.bc_tag,
        });
      }
      //开始支付
      await this.$store.dispatch("payment", {
        boxId: 40,
        price: 39,
        total: 39,
        num: 1,
        bcTag: this.$route.query.bc_tag || 1,
      });

      // await this.$store.dispatch("payment", {
      //   boxId: 7,
      //   price: 0.01,
      //   total: 0.01,
      //   num: 1,
      //   bcTag: this.$route.query.bc_tag || 1,
      // });

      // 提交表单;
      const div = document.createElement("div");
      div.innerHTML = this.$store.state.pay.fromData;
      document.body.appendChild(div);
      document.forms[0].submit();
      this.replacePay = true;
    }
  },
};
</script>

<style>
</style>