<template>
  <div class="wrapper">
    <div class="header">
      <img src="../images/back.png" @click="goback()" />
    </div>
    <div class="content">
      <div class="left clearfix">
        <img src="../images/doctor.png" alt="" class="fl" />
        <div class="center fl">
          <p>明确就诊疾病？</p>
        </div>
      </div>
    </div>
    <div class="bottom">
      <div class="list">
        <span
          v-for="(item, index) in list"
          :key="index"
          :class="isChange == index ? 'realItem item' : 'item'"
          @click="chooseScale(index)"
          >{{item}}</span
        >
      </div>
      <button :class="isChange!=-1 ? 'realSure sure' : 'sure'" @click="submit">确认</button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      isChange: -1,
      list: ["哮喘"],
    };
  },

  created() {},
  mounted() {},
  methods: {
    goback() {
      this.$router.go(-1);
    },
    chooseScale(index) {
      if (index != this.isChange) {
        this.isChange = index;
      } else {
        this.isChange = -1;
      }
    },
    submit(){
      if(this.isChange == -1){
        return
      }
      this.$router.push({ path: "/scaleDetail",query: JSON.parse(localStorage.getItem('loginParam')) });
    }
  },
  components: {},
};
</script>
<style lang="less" scoped>
@import "../less/base.less";
.header {
  height: 0.8rem;
  border-bottom: 3px solid #6678ff;
  & img {
    width: 0.16rem;
    padding: 0.2rem 0.4rem 0.4rem 0.2rem;
    float: left;
  }
}
.content {
  .left {
    margin-bottom: 0.2rem;
    padding-top: 0.5rem;
    padding-left: 0.24rem;
    .center {
      max-width: 5rem;
      background-color: #colors[bgques];
      border-radius: 0 0.24rem 0.24rem 0.24rem;
      margin-top: 0.3rem;
      font-size: #font[dialog];
      padding: 0.24rem;
      display: inline-block;
    }
    img {
      width: 0.8rem;
      height: 0.8rem;
      margin-right: 0.24rem;
    }
  }
}
.bottom {
  width: 100%;
  position: fixed;
  bottom: 0;
  box-shadow: 0px -0.6rem 0.2rem 0px rgba(104, 124, 189, 0.08);
  .list {
    .item {
      padding: 0.14rem 0.2rem;
      border: 0.02rem solid #dfe0e4;
      font-size: 0.3rem;
      border-radius: 0.36rem;
      margin-left: 0.3rem;
    }
    .realItem {
      background: #6678ff;
    }
  }
  .sure {
    width: 100%;
    height: 0.88rem;
    background: #6678ff;
    opacity: 0.5;
    font-size: 0.32rem;
  }
  .realSure {
    opacity: 1;
  }
}
</style>
