<template>
  <div class="info_logo">
    <div class="logo">
      <img :src="data.url" alt="" />
    </div>
    <div class="info">
      <p class="info_title">
        <span>{{ data.name }}</span>
        <span class="bs" v-if="data.aqdetail" @click="subevent(0)"
          >一键部署</span
        >
        <span class="info_fix" v-if="data.fxdetail" @click="subevent(1)"
          >我要编辑</span
        >
        <span class="info_fix" v-if="data.yydebugger" @click="subevent(5)"
          >应用调试</span
        >
        <span
          class="right gap"
          v-if="data.yydetail || data.xxdetail || data.yydev"
          >|</span
        >
        <span
          class="right underline"
          v-if="data.xxdetail"
          @click="subevent(2)"
          title="申请下线至开发者应用"
          >{{ data.xxdetail }}</span
        >
        <span
          class="right undersell"
          v-if="data.yydetail"
          @click="subevent(3)"
          >{{ data.yydetail }}</span
        >
        <span
          class="right undersell undermy"
          v-if="data.bsdetail"
          @click="subevent(4)"
          >申请密钥</span
        >
        <span
          class="info_fix"
          v-if="data.fixed"
          @click="goto_page(data.fixedurl)"
          >我要修改</span
        >
        <span class="info_fix" v-if="data.yydev" @click="subevent(6)"
          >应用开发</span
        >
      </p>
      <div class="info_detail">
        <p>
          <label v-for="(item, index) in data.first" :key="index + 2000"
            >{{ item.name }}:
            <span :style="item.color ? { color: item.color } : {}">{{
              item.text
            }}</span>
          </label>
        </p>
        <p>
          <label v-for="(item, index) in data.second" :key="index + 2500"
            >{{ item.name }}:
            <a
              v-if="item.name.indexOf('地址') !== -1"
              style="color:#515fe7;text-decoration: none;"
              target="_blank"
              :href="item.text"
              >{{ item.text }}</a
            >
            <span v-else :style="item.color ? { color: item.color } : {}">{{
              item.text
            }}</span>
          </label>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["data"],
  components: {},
  data() {
    return {};
  },
  watch: {},
  computed: {},
  created() {
    console.log(this.data.url);
  },
  mounted() {},
  methods: {
      subevent(val){     
          if(val == 0){
              // this.$emit('deploy',this.data)
              this.$router.push(`/yygl/${this.$route.params.level}/${this.$route.params.type}/deployment/${this.$route.params.id}?source=${this.$route.query.source}`)
              console.log(this.$route);
          }else if(val == 1){
              this.$emit('editapp')
          }else if(val == 2){
              this.$emit('unline',this.data)
          }else if(val == 3){
              this.$emit('unsell',this.data)
          }else if(val == 4){
              this.$emit('applymy')
          }else if(val == 5){
              // /yygl/:level/:type/appdebugger/:deploy_id
              this.$emit('debuggerfunc')
          }else if(val == 6){
              this.$emit('applymy')
          }
      },
      goto_page(url){
        this.$router.push(url)
      }
  },
};
</script>

<style scoped>
.info_logo {
  overflow: hidden;
  width: 100%;
  margin-bottom: 15px;
}
.logo {
  float: left;
  overflow: hidden;
  width: 144px;
  height: 144px;
  margin-right: 13px;
  background-size: cover;
  text-align: center;
}
.logo img {
  width: 100%;
}
.info {
  float: left;
  width: calc(100% - 157px);
}
.info_title {
  font-size: 18px;
  font-weight: bold;
  color: #0d1847;
  padding-left: 10px;
  margin-bottom: 26px;
}
.info_fix {
  display: inline-block;
  width: 76px;
  height: 32px;
  background-color: #515fe7;
  border-radius: 8px;
  font-size: 14px;
  font-weight: normal;
  color: #e6ebfe;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  float: right;
}
.bs {
  display: inline-block;
  width: 76px;
  height: 32px;
  box-sizing: border-box;
  line-height: 28px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  font-weight: 400;
  background-color: #d0d5e7;
  border-radius: 8px;
  border: solid 2px #a5afd6;
  color: #0f2683;
}
.gap {
  color: #b4c0f5;
  margin: 0 10px;
  line-height: 30px;
}
.underline {
  width: 76px;
  height: 32px;
  background-color: #f6f7fb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: normal;
  color: #0f2683;
  line-height: 32px;
  cursor: pointer;
  text-align: center;
  margin-left: 10px;
}
.undersell {
  width: 76px;
  height: 32px;
  background-color: #0f2683;
  border-radius: 8px;
  font-size: 14px;
  font-weight: normal;
  color: #f8f9fd;
  line-height: 32px;
  cursor: pointer;
  text-align: center;
}
.undermy {
  background-color: #515fe7;
  color: #e6ebfe;
}
.info_detail {
  width: 100%;
  height: 96px;
  background-color: #f6f7fb;
  border-radius: 8px;
  line-height: 40px;
  padding: 8px 20px;
}
.info_detail p {
  color: #8890a7;
}
.info_detail span {
  color: #242c43;
  font-weight: 600;
  margin-right: 48px;
}
.right {
  float: right;
}
</style>
