<template>
  <div>
    <x-header :left-options="{backText: '',showBack:true}">
      预约类型
    </x-header>

    <!-- 列表 -->
    <v-content
      has-header
      has-footer
    >
      <div class="list_content">
        <van-cell-group
          inset
          v-for="(item,index) in typeList"
          :key="index"
        >
          <van-cell
            center
            :title="item.name"
            :label="item.address"
            is-link
            @click="jumpTo(index)"
          >
            <template #icon>
              456
            </template>
          </van-cell>
        </van-cell-group>
      </div>
    </v-content>
  </div>
</template>
<script>
export default {
  data () {
    return {
      typeList: [
        {
          name: '门诊预约',
          address: '看病看医生',
        },
        {
          name: '医技预约',
          address: '检验检查、无需等待',
        }
      ]
    }
  },
  methods: {
    jumpTo (i) {
      if (i == 0) {
        this.$API.getEncryptedInfo(
          this.$route.query.id
        ).then(res => {
          if (res.code == 1) {
            let str = res.object
            // console.log(str);
            // let url
            // if (process.env.NODE_ENV === 'development') {
            // url = `https://ih.wzaijk.com/patient-wenzhou-h5/#/projects/wenzhou/pages/yygh/yyghHome?content=${str}&app=yygh`
            // } else {
            //   url = `https://ih.wzaijk.com.cn/patient-wenzhou-h5/#/projects/wenzhou/pages/yygh/yyghHome?content=${str}&app=yygh`
            // }
            // console.log(url);
            window.open(str, '_self');
          }
        })

      }
    }
  },
  beforeRouteEnter (to, from, next) {
    from.meta.keepAlive = true
    next()
  },
  mounted () { },
  watch: {}
}
</script>
<style lang="scss" scoped>
.list_content {
  padding: 10px;
}
::v-deep .van-cell-group {
  margin: 10px 0;
}
</style>