checkSet.vue 2.08 KB
<!-- 权益订单 -->
<template>
  <div class="equity">
    <div v-if="status == 1" class="introduct_wrap">
      <span class="el-icon-warning"></span>
      <div class="text">该业务场景的优势介绍可点击</div>
      <div @click="toIntroductPage" class="btn_text">去查看</div>
    </div>
    <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 './equityIntro.vue'
export default {
  name: 'index',
  components: {
    open: equityList,
    'not-open': introduct
  },
  data() {
    return {
      activeName: 'equityList',
      status: 0
    }
  },
  created() {
    this.isOpenSettin()
    // this.$router.push('/beforeSale/equityList')
  },
  mounted() {},
  methods: {
    // 判断是否开通
    isOpenSettin() {
      localStorage.removeItem('preSetStatus')
      const { merchantId } = this.$globalState.session
      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)
      })
    },
    toIntroductPage(){
       const title = '业务介绍'
      this.$router.push({ path: '/beforeSale/equityIntro', query: { $title: title } })
    }
  }
}
</script>
<style lang="scss">
.introduct_wrap {
  width: 100%;
  height: 40px;
  background: #e4e3ff;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding-left: 16px;
  .el-icon-warning {
    font-size: 16px;
    color: #5850ff;
    margin-right: 8px;
  }
  .text {
    font-family: PingFangSC-Regular;
    font-weight: 400;
    font-size: 14px;
    color: #000000a6;
  }
  .btn_text {
    font-family: PingFangSC-Regular;
    font-weight: 400;
    font-size: 14px;
    color: #5850ff;
    margin-left: 8px;
    cursor: pointer;
  }
}
</style>