<template>
  <div class="KeepRepaireDetail">
    <m-header background="white" v-if="headerStatus"> </m-header>
    <h4 v-if="item && item.title">{{ item.title }}</h4>
    <div class="concat" v-if="item && item.content" v-html="item.content"></div>
    <van-image-preview
      v-model="show"
      :images="images"
      :showIndex="false"
    ></van-image-preview>
  </div>
</template>
<script>
import MHeader from "@/components/MHeader";
import { browser } from "@/common/common";
export default {
  components: { MHeader },
  data() {
    return {
      headerStatus: true,
      item: null,
      backUrl: {
        callBack: () => {
          if (browser().android) {
            // eslint-disable-next-line
            DAYA.postMessage(JSON.stringify({ api: "back" }));
          } else if (browser().iPhone) {
            window.webkit.messageHandlers.DAYA.postMessage(
              JSON.stringify({ api: "back" })
            );
          }
        },
      },
      images: [],
      show: false,
    };
  },

  mounted() {
    document.title = "帮助中心";
    if (browser().android || browser().iPhone) {
      this.headerStatus = true;
    }
    let params = this.$route.query;
    if (params.Authorization) {
      localStorage.setItem("Authorization", decodeURI(params.Authorization));
      localStorage.setItem("userInfo", decodeURI(params.Authorization));
    }
    this.item = JSON.parse(this.$route.query.item);
    window.showImg = (e) => {
      if (e.src) {
        this.images = [e.src];
        this.show = true;
      }
    };
  },
};
</script>
<style lang="less">
.KeepRepaireDetail {
  background-color: #fff;
  padding: 0.1rem;
  h4 {
    font-size: 0.18rem;
    margin-bottom: 0.1rem;
    font-weight: 500;
  }
  .concat {
    font-size: 0.14rem;
    color: #808080;
    p {
      margin-bottom: 0.1rem;
    }
    img {
      vertical-align: middle;
    }
  }
}
</style>