"use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const component_Initialization_api = require("./api.js"); const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "leida", props: { isShow: { type: Boolean, required: true } }, emits: ["nav"], setup(__props, { emit: __emit }) { const props = __props; const savevalue = common_vendor.ref(""); const renamenummber = common_vendor.ref(-1); const transition = common_vendor.ref(true); const progress = common_vendor.ref(1); const scrollTop = common_vendor.ref(0); common_vendor.ref(null); const rightbutton = common_vendor.ref([ { url: "/static/index/leida/00.png", targetUrl: "/static/index/leida/01.png", target: false }, { url: "/static/index/leida/10.png", targetUrl: "/static/index/leida/11.png", target: false }, { url: "/static/index/leida/20.png", targetUrl: "/static/index/leida/21.png", target: false }, { url: "/static/index/leida/30.png", targetUrl: "/static/index/leida/31.png", target: false } ]); const cardarray = common_vendor.ref([]); const relArray = common_vendor.ref([]); common_vendor.watch( () => props.isShow, (newVal, oldVal) => { if (!oldVal && newVal) { transition.value = false; setTimeout(() => transition.value = true, 50); component_Initialization_api.getCardList().then((res) => { res.result.records.forEach((element) => { element.menu = JSON.parse(JSON.stringify(rightbutton.value)); element.isNew = true; }); relArray.value = res.result.records; common_vendor.index.__f__("log", "at component/Initialization/leida.vue:123", "????", relArray.value); again(); }); } } ); function suiji() { const n = relArray.value.length; cardarray.value = []; const randomWeights = Array.from({ length: n }, () => Math.random()); const totalWeight = randomWeights.reduce((a, b) => a + b, 0); const intervals = randomWeights.map((w) => w / totalWeight * 5e3); let cumulative = 0; for (let i = 0; i < n; i++) { cumulative += intervals[i]; setTimeout(async () => { cardarray.value.push(relArray.value[i]); const len = cardarray.value.length; if (len >= 5 && len % 2 === 1) { scrollTop.value = 999; await common_vendor.nextTick$1(); scrollTop.value = 99999; } }, cumulative); } } function again() { if (progress.value == 1) { renamenummber.value = -1; suiji(); progress.value = 0; const timer = setInterval(() => { progress.value += 0.01; if (progress.value >= 1) { progress.value = 1; clearInterval(timer); } }, 50); } } function onAnimEnd(item) { item.isNew = false; } const changename = (name, index) => { if (name) { cardarray.value[index].nuName = name; } renamenummber.value = -1; }; common_vendor.onMounted(() => { }); return (_ctx, _cache) => { return { a: common_assets._imports_0$16, b: common_vendor.n(progress.value < 1 ? "spin-anim" : "no-anim"), c: common_assets._imports_1$14, d: common_vendor.n(progress.value < 1 ? "spin-anim-spec" : "no-anim-spec"), e: `scaleX(${progress.value})`, f: common_vendor.t(progress.value >= 1 ? "扫描完成。" : "正在使用雷达区域扫描护理机构,"), g: common_vendor.t(progress.value >= 1 ? "" : "请稍后..."), h: common_vendor.o(again), i: common_vendor.f(cardarray.value, (allitem, allindex, i0) => { return common_vendor.e({ a: common_vendor.t(allitem.nuId), b: common_vendor.o(($event) => renamenummber.value = -1, allindex), c: common_vendor.f(allitem.menu, (item, index, i1) => { return { a: item.target ? item.targetUrl : item.url, b: index, c: common_vendor.o(($event) => { item.target = !item.target; renamenummber.value = -1; }, index) }; }), d: common_vendor.t(allitem.nuName), e: common_vendor.o(($event) => { renamenummber.value = allindex; savevalue.value = allitem.nuName; }, allindex), f: renamenummber.value == allindex }, renamenummber.value == allindex ? { g: common_assets._imports_4$3, h: savevalue.value, i: common_vendor.o(($event) => savevalue.value = $event.detail.value, allindex), j: savevalue.value, k: common_assets._imports_5$2, l: common_vendor.o(($event) => savevalue.value = ``, allindex), m: common_vendor.o(($event) => changename(savevalue.value, allindex), allindex) } : {}, { n: allindex, o: allitem.isNew ? 1 : "", p: common_vendor.o(($event) => onAnimEnd(allitem), allindex) }); }), j: common_assets._imports_2$10, k: common_assets._imports_3$5, l: scrollTop.value, m: __props.isShow, n: common_vendor.s(transition.value ? { opacity: `1` } : { opacity: `0` }) }; }; } }); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-14770cca"]]); wx.createComponent(Component); //# sourceMappingURL=../../../.sourcemap/mp-weixin/component/Initialization/leida.js.map