| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <mobile v-if="!isPC" :com="com" :dev="dev" :pre="pre" :vipDetail="vipDetail" :isCom="isCom"></mobile>
- </template>
- <script>
- import {mapState} from "vuex";
- import pc from "@/components/type/vip/pc";
- import mobile from "@/components/type/vip/mobile";
- import getDeviceType from "@/mixins/getDeviceType";
- import qs from "qs";
- export default {
- head() {
- return {
- title: "会员中心"
- }
- },
- components: {
- pc,
- mobile
- },
- mixins: [getDeviceType],
- data() {
- return {
- vipList: [],
- vipDetail: {}
- };
- },
- computed: {
- ...mapState(["isPC"]),
- com() {
- return this.vipList[0];
- },
- dev() {
- return this.vipList[1];
- },
- pre() {
- return this.vipList[2];
- },
- isCom() {
- if (this.$route.query.isCom) return true;
- return this.vipDetail.vip_type_id !== "2";
- }
- },
- async mounted() {
- await this.getList();
- this.getVipDetail();
- if (this.isPC) {
- location.href = "/#vip";
- }
- },
- methods: {
- async getList() {
- let extraHeaders = {};
- if (this.deviceType === "ios") {
- extraHeaders = this.getSign();
- }
- let res = await this.$axios.$post(`/api/vip/getList`, extraHeaders);
- if (Number(res.status) === 1) {
- this.vipList = res.data;
- }
- },
- async getVipDetail() {
- let res = await this.$axios.$post("/api/vip/getVipUserDetail");
- // if (!res || !res.data) return
- this.vipDetail = res && res.data ? res.data : {};
- if (this.isCom) this.currentCom = true;
- }
- }
- };
- </script>
- <style>
- </style>
|