var e = require("../../common/vendor.js"),
  a = require("../../hooks/onMounted.js"),
  l = require("../../hooks/onShareAppMessage.js"),
  u = require("../../service/index.js"),
  n = require("../../constant/index.js"),
  t = require("../../utils/util.js");
require("../../hooks/useState.js"),
  require("../../store/app/index.js"),
  require("../../enums/index.js"),
  require("../../data/index.js"),
  require("../../config/index.js"),
  require("../../utils/request.js"),
  Array ||
    (
      e.resolveComponent("uni-collapse-item") +
      e.resolveComponent("uni-collapse")
    )(),
  Math ||
    (
      function () {
        return "../../uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js";
      } +
      function () {
        return "../../uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js";
      } +
      e.unref(v) +
      e.unref(i) +
      e.unref(r)
    )();
var i = function () {
    return "../../components/float-back-to-top/index.js";
  },
  v = function () {
    return "../../components/divider/index.js";
  },
  r = function () {
    return "../../components/float-share/index.js";
  },
  c = {
    __name: "index",
    setup: function (i) {
      var v = e.ref(!0),
        r = e.ref({}),
        c = e.ref(!1),
        o = e.ref([
          { name: "品牌类型", value: "", key: "brandName" },
          { name: "上牌日期", value: "", key: "regDate" },
          { name: "发动机号", value: "", key: "engine" },
          { name: "车身颜色", value: "", key: "bodyColor" },
          { name: "指导价", value: "", key: "guidePrice" },
          { name: "排放标准", value: "", key: "emisSandard" },
          { name: "过户次数", value: "", key: "changeTimes" },
          { name: "使用性质", value: "", key: "properties" },
          { name: "使用性质是否红色警示", value: "", key: "warning" },
          { name: "车主任数", value: "", key: "ownerNumber" },
          { name: "车主类型", value: "", key: "ownerType" },
        ]),
        d = e.ref([
          { name: "骨架", value: "", key: "type1" },
          { name: "外观", value: "", key: "type2" },
          { name: "发动机", value: "", key: "type3" },
          { name: "变速箱", value: "", key: "type3" },
          { name: "火烧", value: "", key: "type4" },
          { name: "水淹", value: "", key: "type5" },
          { name: "气囊", value: "", key: "type6" },
          { name: "加强件", value: "", key: "type7" },
        ]),
        s = e.ref([
          { name: "外观", value: [], key: "wg" },
          { name: "底盘悬挂", value: [], key: "dp" },
          { name: "发动机", value: [], key: "fdj" },
          { name: "加强件", value: [], key: "jqj" },
          { name: "气囊", value: [], key: "qn" },
          { name: "附属配件", value: [], key: "fspj" },
          { name: "骨架", value: [], key: "gj" },
          { name: "火烧", value: [], key: "hs" },
          { name: "水淹", value: [], key: "sy" },
        ]),
        f = e.ref([
          { name: "非火烧车", value: "", key: "isFire" },
          { name: "非泡水车", value: "", key: "isFlood" },
          { name: "非盗抢车", value: "", key: "isTheft" },
          { name: "覆盖件未损伤", value: "", key: "isPanel" },
          { name: "无大额赔偿", value: "", key: "isLargeCost" },
          { name: "无结案记录", value: "", key: "recordIcpending" },
          { name: "无注销记录", value: "", key: "recordIwriteoff" },
          { name: "无拒赔记录", value: "", key: "refusalRecord" },
          { name: "交强险有效", value: "", key: "effectiveCpi" },
          { name: "商业险有效", value: "", key: "effectiveCmi" },
          { name: "交强险连续投保", value: "", key: "seriesCoverCpi" },
          { name: "无营业记录", value: "", key: "isBusiness" },
        ]),
        m = e.ref([
          { name: "事故次数", value: "", key: "claimCount" },
          { name: "理赔总金额", value: "", key: "totalAmount" },
          { name: "最大理赔金额", value: "", key: "largestAmount" },
          { name: "已结案次数", value: "", key: "claimCacCount" },
          { name: "拒赔次数", value: "", key: "claimRejectedCount" },
        ]);
      return (
        a.onMounted(function (a) {
          var l = a.order_no,
            n = a.product_id;
          t.showLoading("努力查询中"),
            u
              .getReportDetail({ order_no: l, product_id: n })
              .then(function (a) {
                (a.detail.pzlsmx.records = e._.orderBy(
                  a.detail.pzlsmx.records,
                  ["date"],
                  ["desc"]
                )),
                  (r.value = a);
                var l = a.detail,
                  u = l.clxx,
                  n = l.ckdlpc,
                  i = l.ckpclb,
                  c = l.ckxx,
                  y = l.tjxx;
                e._.each(o.value, function (e) {
                  if (((e.value = u[e.key]), "warning" === e.key)) {
                    var a = u[e.key];
                    1 === a
                      ? (e.value = "是")
                      : 0 === a
                      ? (e.value = "否")
                      : 2 === a && (e.value = "无法判断");
                  }
                }),
                  e._.each(d.value, function (e, a) {
                    e.value = n[e.key];
                    var l = "";
                    0 === e.value
                      ? (l = "normal")
                      : 1 === e.value
                      ? (l = "unidentified")
                      : 2 === e.value
                      ? (l = "doubt")
                      : (3 !== e.value && 4 !== e.value) || (l = "error"),
                      (e.icon = "/static/svgs/pic_ckpc_"
                        .concat(l, "_")
                        .concat(a + 1, ".svg"));
                  }),
                  e._.each(s.value, function (e) {
                    e.value = i[e.key];
                  }),
                  e._.each(f.value, function (e, a) {
                    if (
                      ((e.value = c[e.key]),
                      null === c[e.key] && (e.value = 2),
                      "recordIcpending" === e.key ||
                        "recordIwriteoff" === e.key ||
                        "refusalRecord" === e.key)
                    ) {
                      var l = c[e.key];
                      "是" === l ? (e.value = 1) : "否" === l && (e.value = 0);
                    }
                    if ("effectiveCpi" === e.key || "effectiveCmi" === e.key) {
                      var u = c[e.key];
                      0 === u ? (e.value = 1) : 1 === u && (e.value = 0);
                    }
                    if ("seriesCoverCpi" === e.key) {
                      var n = c[e.key];
                      1 === n || 2 === n
                        ? (e.value = 0)
                        : 3 === n
                        ? (e.value = 1)
                        : (0 !== n && 4 !== n) || (e.value = 2);
                    }
                    var t = "";
                    0 === e.value
                      ? (t = "normal")
                      : 1 === e.value
                      ? (t = "warning")
                      : 2 === e.value && (t = "unknown"),
                      (e.icon = "/static/svgs/icon_ckxx_"
                        .concat(t, "_")
                        .concat(a + 1, ".svg"));
                  }),
                  e._.each(m.value, function (e) {
                    e.value = y[e.key];
                  }),
                  (v.value = !1),
                  t.hideLoading();
              });
        }, !1),
        e.onPageScroll(function (a) {
          var l = a.scrollTop;
          c.value = l >= e.index.getSystemInfoSync().windowHeight / 3;
        }),
        l.onShareAppMessage(),
        function (a, l) {
          return e.e(
            { a: !v.value },
            v.value
              ? {}
              : e.e(
                  {
                    b: e.t(
                      (r.value.vin || "")
                        .toString()
                        .replace(/^(.{5}).{6}/, "$1******")
                    ),
                    c: e.t(r.value.order_no),
                    d: e.t(r.value.create_time),
                    e: e.f(o.value, function (a, l, u) {
                      return { a: e.t(a.name), b: e.t(a.value || "-"), c: l };
                    }),
                    f: e.f(d.value, function (a, l, u) {
                      return e.e(
                        { a: a.icon, b: e.t(a.name), c: 0 === a.value },
                        (a.value, {}),
                        { d: 1 === a.value },
                        (a.value, {}),
                        { e: 2 === a.value },
                        (a.value, {}),
                        { f: 3 === a.value || 4 === a.value },
                        (3 === a.value || a.value, {}),
                        { g: l }
                      );
                    }),
                    g: 1 === r.value.detail.clpj,
                  },
                  (r.value.detail.clpj, {}),
                  { h: 2 === r.value.detail.clpj },
                  (r.value.detail.clpj, {}),
                  { i: 3 === r.value.detail.clpj },
                  (r.value.detail.clpj, {}),
                  { j: 4 === r.value.detail.clpj },
                  (r.value.detail.clpj, {}),
                  {
                    k: e.f(s.value, function (a, l, u) {
                      return {
                        a: e.t(a.name),
                        b: e.t(a.value.length),
                        c: a.value.length > 0 ? 1 : "",
                        d: e.f(a.value, function (a, l, u) {
                          return { a: e.t(a.name), b: e.t(a.type), c: l };
                        }),
                        e: l,
                        f: "a4079225-1-" + u + ",a4079225-0",
                        g: e.p({ name: a.name, open: a.value.length > 0 }),
                      };
                    }),
                    l: e.f(r.value.detail.clfwzj, function (a, l, u) {
                      return e.e(
                        { a: !a },
                        {},
                        { b: !!a },
                        {},
                        { c: e.t(l), d: l }
                      );
                    }),
                    m: !!r.value.detail.clfwzj.前方左侧,
                  },
                  (r.value.detail.clfwzj.前方左侧, {}),
                  { n: !!r.value.detail.clfwzj.中间左侧 },
                  (r.value.detail.clfwzj.中间左侧, {}),
                  { o: !!r.value.detail.clfwzj.后方左侧 },
                  (r.value.detail.clfwzj.后方左侧, {}),
                  { p: !!r.value.detail.clfwzj.前方右侧 },
                  (r.value.detail.clfwzj.前方右侧, {}),
                  { q: !!r.value.detail.clfwzj.中间右侧 },
                  (r.value.detail.clfwzj.中间右侧, {}),
                  { r: !!r.value.detail.clfwzj.底部 },
                  (r.value.detail.clfwzj.底部, {}),
                  { s: !!r.value.detail.clfwzj.后方右侧 },
                  (r.value.detail.clfwzj.后方右侧, {}),
                  { t: !!r.value.detail.clfwzj.顶部 },
                  (r.value.detail.clfwzj.顶部, {}),
                  { v: !!r.value.detail.clfwzj.正前方 },
                  (r.value.detail.clfwzj.正前方, {}),
                  { w: !!r.value.detail.clfwzj.内部 },
                  (r.value.detail.clfwzj.内部, {}),
                  { x: !!r.value.detail.clfwzj.正后方 },
                  (r.value.detail.clfwzj.正后方, {}),
                  { y: !!r.value.detail.clfwzj.其他 },
                  (r.value.detail.clfwzj.其他, {}),
                  {
                    z: e.f(f.value, function (a, l, u) {
                      return e.e(
                        { a: a.icon, b: e.t(a.name), c: 0 === a.value },
                        (a.value, {}),
                        { d: 1 === a.value },
                        (a.value, {}),
                        { e: 2 === a.value },
                        (a.value, {}),
                        { f: l }
                      );
                    }),
                    A: e.f(m.value, function (a, l, u) {
                      return { a: e.t(a.name), b: e.t(a.value || "-"), c: l };
                    }),
                    B: e.t(r.value.detail.pzlsmx.serviceSumCount),
                    C: e.t(
                      (
                        Number(r.value.detail.pzlsmx.serviceSumMoney) / 100
                      ).toFixed(0)
                    ),
                    D: e.f(r.value.detail.pzlsmx.records, function (a, l, u) {
                      return {
                        a: e.t(a.date),
                        b: e.t(a.claimStatus),
                        c: e.t((Number(a.serviceMoney) / 100).toFixed(0)),
                        d: e.f(a.result, function (a, l, u) {
                          return e.e(
                            {
                              a: e.t(a.dangerSingleName || "-"),
                              b: 1 == a.dangerSingleType,
                            },
                            (1 == a.dangerSingleType ||
                              2 == a.dangerSingleType ||
                              a.dangerSingleType,
                            {}),
                            {
                              c: 2 == a.dangerSingleType,
                              d: 3 == a.dangerSingleType,
                              e: e.t(a.dangerSingleNum),
                              f: l,
                            }
                          );
                        }),
                        e: l,
                      };
                    }),
                    E: e.t(e.unref(n.disclaimer)),
                    F: e.p({ visible: c.value }),
                  }
                )
          );
        }
      );
    },
  },
  o = e._export_sfc(c, [["__scopeId", "data-v-a4079225"]]);
(c.__runtimeHooks = 3), wx.createPage(o);
