index.vue 1.32 KB
<!-- 权益订单 -->
<template>
  <div class="equity">
    <!-- <open v-if="status==1"></open>
    <not-open v-if="status==2"></not-open> -->
  </div>
</template>
<script>
// import equityList from './equityList.vue'
// import introduct from './introduct.vue'
export default {
  name: 'index',
  // components: {
  //   open: equityList,
  //   'not-open': introduct
  // },
  data() {
    return {
      activeName: 'equityList',
      status: 0
    }
  },
  created() {
    this.isOpenSettin()
  },
  mounted() {},
  methods: {
    // 判断是否开通
    isOpenSettin() {
      localStorage.removeItem('preSetStatus')
      const { merchantId } = this.$route.query || ''
      this.$apis.beforeSale.judgeSetting({ merchantId }).then(res => {
        // data != null 且data.openFlag == 1 为开通,其他的都是未开通
        const { code, data } = res
        if (code == 0 && data != null && data.openFlag == 1) {
          this.status = 1
        } else {
          this.status = 2
        }
        localStorage.setItem('preSetStatus', this.status)
        this.$router.push('/beforeSale/checkSet')
      })
    }
    // 页面跳转
    // handleEdit(path,title) {
    //   this.$router.push({
    //     path,
    //     query: {
    //       $title: encodeURI(title)
    //     }
    //   })
    // }
  }
}
</script>
<style>
</style>