<template>
  <div class="scene-dailog">
    <div class="title">{{ secenaroStatus.localName }}</div>
    <div class="dailog-content">
      <img :src="parseImgUrl('ipdImages', 'taolun-big.svg')" />
      <span class="status-text1">
        切换至
        <i>{{ secenaroStatus.sceneName }}</i> 场景
      </span>
      <van-loading class="status-text2" v-if="secenaroStatus.loading"
        >切换中...</van-loading
      >
      <span class="status-text2" v-if="!secenaroStatus.loading">
        <span v-if="secenaroStatus.lodingText">
          已为您切换至适宜{{ secenaroStatus.sceneName }}的环境</span
        >
      </span>
      <!-- <span class="status-text2" v-else> 切换失败</span> -->
    </div>
    <buttons class="dailog-btn" @click="closeDailog">我知道了</buttons>
  </div>
</template>
  
  <script lang="ts">
import {
  defineComponent,
  reactive,
  toRefs,
  onBeforeMount,
  onMounted,
  ref,
  watch,
} from "vue";
import { Loading, Toast } from "vant";
import { parseImgUrl } from "@/utils";

export default defineComponent({
  props: {
    projectId: {
      type: String,
      default: () => "",
    },
    scenarioArr: {
      type: Array,
      default: () => [],
    },
    secenaroStatus: {
      type: Object,
      default: () => {},
    },
  },
  components: {
    VanLoading: Loading,
  },
  setup(props, contx) {
    const proxyData = reactive({
      parseImgUrl: parseImgUrl,
      secenaroStatus: props.secenaroStatus,
      closeDailog() {
        contx.emit("closeDailog");
      },
    });
    watch(
      props,
      (newProps: any) => {
        proxyData.secenaroStatus = newProps.secenaroStatus;
      },
      {
        deep: false,
        immediate: true,
      }
    );
    onMounted(() => {});
    return {
      ...toRefs(proxyData),
    };
  },
});
</script>
  <style lang="scss" scoped>
.scene-dailog {
  position: relative;
  width: 100%;
  height: 100%;
  .title {
    font-family: "PingFang SC";
    font-style: normal;
    font-weight: 500;
    font-size: 22px;
    line-height: 31px;
    color: #000000;
  }
  .dailog-content {
    position: absolute;
    // top: 50%;
    top: 19vh;
    left: 50%;
    transform: translate(-50%);
    width: 100%;
    text-align: center;
    img {
      width: 100px;
      height: 100px;
      margin: 0 auto;
    }
    span {
      display: block;
      text-align: center;
    }
    .status-text1 {
      padding-top: 28px;
      font-family: "PingFang SC";
      font-style: normal;
      font-weight: 500;
      font-size: 28px;
      line-height: 39px;
      color: #646c73;
      i {
        display: inline-block;
        font-style: normal;
        padding-left: 5px;
        padding-right: 5px;
        color: #000000;
      }
    }
    .status-text2 {
      padding-top: 10px;
      font-family: "PingFang SC";
      font-style: normal;
      font-weight: 400;
      font-size: 22px;
      line-height: 31px;
      color: #646c73;
    }
  }
  .dailog-btn {
    position: absolute;
    bottom: 38px;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #c3c7cb;
    border-radius: 25px;
  }
}
</style>
  <style lang="scss">
</style>
  