UNPKG

flamingo-ui

Version:

火烈鸟UI组件库

1,622 lines 131 kB
import Matter from "matter-js"; import { ref, onMounted, openBlock, createElementBlock, watch, withModifiers, createElementVNode, normalizeClass, Fragment, createTextVNode, createCommentVNode, renderSlot, resolveComponent, createBlock, mergeProps, createApp, withDirectives, vShow, createVNode, toDisplayString, computed, reactive, toRefs, normalizeStyle, renderList, withCtx, vModelText, nextTick, onBeforeUnmount, inject, resolveDirective, Transition } from "vue"; import { Dialog as Dialog$2, Slider, Loading, Popup, CountDown } from "vant"; const __default__$8 = { name: "AngryBird" }; const __vue_sfc__$j = /* @__PURE__ */ Object.assign(__default__$8, { props: { ejectDistance: { type: Number, default: 3 }, WIDTH: { type: Number, default: 1022 } }, setup(__props, { expose }) { expose(); const props2 = __props; const HEIGHT = ref(props2.WIDTH / 2.2914); const dom = ref(null); const slingshot = () => { var Engine = Matter.Engine, Render = Matter.Render, Runner = Matter.Runner, Events = Matter.Events, Constraint = Matter.Constraint, MouseConstraint = Matter.MouseConstraint, Mouse = Matter.Mouse, World = Matter.World, Bodies = Matter.Bodies; var engine = Engine.create(), world = engine.world; var render = Render.create({ element: dom.value, engine, options: { width: props2.WIDTH, height: HEIGHT.value, background: "#fff", wireframeBackground: "#fff", wireframes: false, showVelocity: true, showCollitions: true } }); Render.run(render); var runner = Runner.create(); Runner.run(runner, engine); var ground = Bodies.rectangle(511, 446, 1022, 10, { isStatic: true }), birdOptions = { mass: 20, restitution: 0.6 }, bird = Bodies.circle(200, 350, 16, birdOptions), anchor = { x: 200, y: 350 }, elastic = Constraint.create({ pointA: anchor, bodyB: bird, length: 0.01, stiffness: 0.25, render: { strokeStyle: "black" } }); var woodOptions = { mass: 2, isStatic: false, restitution: 0, friction: 0.4 }; var rockOptions = { mass: 4, isStatic: false, restitution: 0, friction: 0.5 }; var ironOptions = { mass: 6, isStatic: false, restitution: 0, friction: 0.2 }; var stacks = []; stacks[0] = Bodies.rectangle(450, 404, 30, 70, rockOptions); stacks[1] = Bodies.rectangle(485, 358, 80, 20, rockOptions); stacks[2] = Bodies.rectangle(520, 404, 30, 70, rockOptions); stacks[3] = Bodies.rectangle(620, 388, 28, 100, rockOptions); stacks[4] = Bodies.rectangle(650, 327, 80, 20, rockOptions); stacks[5] = Bodies.rectangle(680, 388, 28, 100, rockOptions); stacks[6] = Bodies.rectangle(780, 364, 20, 150, rockOptions); stacks[7] = Bodies.rectangle(800, 364, 20, 150, rockOptions); stacks[8] = Bodies.rectangle(850, 278, 150, 20, rockOptions); stacks[9] = Bodies.rectangle(900, 364, 20, 150, rockOptions); stacks[10] = Bodies.rectangle(920, 364, 20, 150, rockOptions); stacks[11] = Bodies.rectangle(570, 418, 20, 40, woodOptions); stacks[12] = Bodies.rectangle(570, 388, 60, 20, woodOptions); stacks[13] = Bodies.rectangle(730, 418, 20, 40, woodOptions); stacks[14] = Bodies.rectangle(730, 388, 60, 20, woodOptions); stacks[15] = Bodies.rectangle(900, 252, 30, 30, woodOptions); stacks[16] = Bodies.rectangle(840, 226, 120, 10, woodOptions); stacks[17] = Bodies.rectangle(485, 308, 30, 80, ironOptions); stacks[18] = Bodies.rectangle(485, 252, 30, 30, ironOptions); stacks[19] = Bodies.rectangle(650, 276, 30, 80, ironOptions); stacks[20] = Bodies.rectangle(570, 226, 220, 20, ironOptions); stacks[21] = Bodies.circle(570, 358, 20, ironOptions); stacks[22] = Bodies.circle(730, 362, 16, ironOptions); stacks[23] = Bodies.circle(570, 196, 20, ironOptions); World.add(engine.world, [ground, bird, ...stacks, elastic]); Events.on(engine, "afterUpdate", function() { if (mouseConstraint.mouse.button === -1 && (bird.position.x > 200 + props2.ejectDistance || bird.position.y < 350 - props2.ejectDistance)) { bird = Bodies.circle(200, 350, 16, birdOptions); World.add(engine.world, bird); elastic.bodyB = bird; } }); var mouse = Mouse.create(render.canvas), mouseConstraint = MouseConstraint.create(engine, { mouse, constraint: { stiffness: 0.2, render: { visible: false } } }); World.add(world, mouseConstraint); render.mouse = mouse; Render.lookAt(render, { min: { x: 0, y: 0 }, max: { x: 1022, y: 446 } }); return { engine, runner, render, canvas: render.canvas, stop: function() { Matter.Render.stop(render); Matter.Runner.stop(runner); } }; }; onMounted(() => { slingshot(); }); const __returned__ = { props: props2, HEIGHT, dom, slingshot, get Matter() { return Matter; }, ref, onMounted }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); const _hoisted_1$h = { ref: "dom" }; function __vue_render__$j(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock( "div", _hoisted_1$h, null, 512 /* NEED_PATCH */ ); } __vue_sfc__$j.render = __vue_render__$j; var stdin_default$v = __vue_sfc__$j; const indexSfc$9 = ""; const __default__$7 = { name: "BottrustDialog" }; const __vue_sfc__$i = /* @__PURE__ */ Object.assign(__default__$7, { props: { BootTrustClose: { type: String, default: "https://gres.guopan.cn/png/20230313/boottrust-close.png" }, product: { type: String, default: "66" }, toKfSystem: { type: Function, default: () => { } }, // 回调函数 callback: { type: Function }, remove: Function }, setup(__props, { expose }) { expose(); const props2 = __props; const show = ref(true); watch( () => show.value, () => { if (show.value == false) { props2.remove; } } ); const fnCallback = (callback) => { callback ? callback(close) : callback(location.href = "//vip.66sy.cn/embedded.mobileprovision"); }; const close = (e) => { show.value = false; }; const __returned__ = { show, props: props2, fnCallback, close, watch, ref }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); const _hoisted_1$g = { class: "fmg-boottrust" }; const _hoisted_2$e = ["src"]; const _hoisted_3$b = /* @__PURE__ */ createElementVNode( "div", { class: "top" }, [ /* @__PURE__ */ createElementVNode("p", null, "“为收信人的企业级开发者账号”"), /* @__PURE__ */ createElementVNode("p", null, "怎么解决"), /* @__PURE__ */ createElementVNode("p", null, "信任此证书") ], -1 /* HOISTED */ ); const _hoisted_4$9 = { class: "bottom" }; const _hoisted_5$8 = { class: "trust" }; const _hoisted_6$6 = /* @__PURE__ */ createElementVNode( "p", null, "无法信任怎么办?", -1 /* HOISTED */ ); const _hoisted_7$2 = /* @__PURE__ */ createElementVNode( "p", null, "点击设置-->通用-->描述文件与设备管理,完成信任", -1 /* HOISTED */ ); function __vue_render__$i(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("div", _hoisted_1$g, [ $setup.show ? (openBlock(), createElementBlock( "div", { key: 0, class: "mask", onTouchmove: _cache[3] || (_cache[3] = withModifiers(() => { }, ["prevent"])) }, [ createElementVNode( "div", { class: normalizeClass($props.product == "guopan" ? "container-gp" : "container-66") }, [ createElementVNode("img", { onClick: $setup.close, class: "close", src: $props.BootTrustClose, alt: "close" }, null, 8, _hoisted_2$e), _hoisted_3$b, createElementVNode("div", _hoisted_4$9, [ createElementVNode("div", _hoisted_5$8, [ createElementVNode("button", { class: "trust-content", onClick: _cache[0] || (_cache[0] = ($event) => $setup.fnCallback($props.callback)) }, " 点击前去信任 ") ]), _hoisted_6$6, _hoisted_7$2, createElementVNode("p", null, [ $props.product == "guopan" ? (openBlock(), createElementBlock( Fragment, { key: 0 }, [ createTextVNode(" 如有疑问,请联系客服QQ : "), createElementVNode("a", { onClick: _cache[1] || (_cache[1] = ($event) => $props.toKfSystem($props.product)), style: { "color": "#01a8ff" } }, "800183983") ], 64 /* STABLE_FRAGMENT */ )) : (openBlock(), createElementBlock( Fragment, { key: 1 }, [ createTextVNode(" 请"), createElementVNode("a", { style: { "color": "#01a8ff" }, onClick: _cache[2] || (_cache[2] = ($event) => $props.toKfSystem($props.product)) }, "联系客服") ], 64 /* STABLE_FRAGMENT */ )) ]) ]) ], 2 /* CLASS */ ) ], 32 /* HYDRATE_EVENTS */ )) : createCommentVNode("v-if", true) ]); } __vue_sfc__$i.render = __vue_render__$i; __vue_sfc__$i._scopeId = "data-v-9cea930c"; var stdin_default$u = __vue_sfc__$i; const indexSfc$8 = ""; const indexSfc2$1 = ""; const __vue_sfc__$h = { props: {} }; const _hoisted_1$f = { class: "fmg-button" }; function __vue_render__$h(_ctx, _cache) { return openBlock(), createElementBlock("button", _hoisted_1$f, [ renderSlot(_ctx.$slots, "default") ]); } __vue_sfc__$h.render = __vue_render__$h; __vue_sfc__$h._scopeId = "data-v-4f7cfd16"; var stdin_default$t = __vue_sfc__$h; const CustomVideoSfc = ""; const CustomVideoSfc2 = ""; const base$1 = ""; const DialogSfc$1 = ""; const DialogSfc2$1 = ""; const index$j = ""; const index$i = ""; const index$h = ""; const index$g = ""; const index$f = ""; const index$e = ""; const index$d = ""; const index$c = ""; const index$b = ""; const __default__$6 = { components: { [Dialog$2.Component.name]: Dialog$2.Component }, inheritAttrs: false }; const __vue_sfc__$g = /* @__PURE__ */ Object.assign(__default__$6, { __name: "Dialog", props: { // 移除弹窗方法 remove: Function, resolve: Function, reject: Function }, emits: ["confirm"], setup(__props, { expose, emit }) { expose(); const props2 = __props; const show = ref(true); const confirm = () => { props2.resolve(); }; const cancel = () => { props2.reject(); }; watch( () => show.value, () => { if (show.value === false) { props2.remove(); } } ); const __returned__ = { emit, props: props2, show, confirm, cancel, get Dialog() { return Dialog$2; }, ref, watch }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function __vue_render__$g(_ctx, _cache, $props, $setup, $data, $options) { const _component_van_dialog = resolveComponent("van-dialog"); return openBlock(), createBlock(_component_van_dialog, mergeProps({ class: "fmg-dialog", onCancel: $setup.cancel, onConfirm: $setup.confirm }, _ctx.$attrs, { show: $setup.show, "onUpdate:show": _cache[0] || (_cache[0] = ($event) => $setup.show = $event) }), null, 16, ["show"]); } __vue_sfc__$g.render = __vue_render__$g; __vue_sfc__$g._scopeId = "data-v-dd4734e6"; var stdin_default$s = __vue_sfc__$g; var __defProp$9 = Object.defineProperty; var __defProps$9 = Object.defineProperties; var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols; var __hasOwnProp$9 = Object.prototype.hasOwnProperty; var __propIsEnum$9 = Object.prototype.propertyIsEnumerable; var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues$9 = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp$9.call(b, prop)) __defNormalProp$9(a, prop, b[prop]); if (__getOwnPropSymbols$9) for (var prop of __getOwnPropSymbols$9(b)) { if (__propIsEnum$9.call(b, prop)) __defNormalProp$9(a, prop, b[prop]); } return a; }; var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b)); const createMount$4 = (opts) => { const mountNode = document.createElement("div"); document.body.appendChild(mountNode); const app = createApp(stdin_default$s, __spreadValues$9({ // 参数 show: true, remove() { app.unmount(mountNode); document.body.removeChild(mountNode); } }, opts)); app.mount(mountNode); return app; }; function Dialog$1(options = {}) { return new Promise((resolve, reject) => { createMount$4(__spreadProps$9(__spreadValues$9({}, options), { resolve, reject })); }); } Dialog$1.confirm = (options) => { return new Promise((resolve, reject) => { createMount$4(__spreadProps$9(__spreadValues$9({}, options), { "show-cancel-button": true, resolve, reject })); }); }; Dialog$1.alert = (options) => { return new Promise((resolve, reject) => { createMount$4(__spreadProps$9(__spreadValues$9({}, options), { resolve, reject })); }); }; Dialog$1.install = (app) => { app.component("Dialog", stdin_default$s); }; var stdin_default$r = Dialog$1; const base = ""; const index$a = ""; var __async$1 = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; const __default__$5 = { components: { [Slider.name]: Slider, [Loading.name]: Loading }, inheritAttrs: false }; const __vue_sfc__$f = /* @__PURE__ */ Object.assign(__default__$5, { __name: "CustomVideo", props: { // 移除弹窗方法 videoUrl: { type: String, default: "" }, videoPoster: { type: String, default: "" }, needTips: { type: Boolean, default: false }, autoplay: { type: Boolean, default: false } }, setup(__props, { expose }) { const props2 = __props; const isTips = ref(true); const muted = ref(true); const timeout = ref(null); const video_play = ref(true); const video_value = ref(0); const currentTime = ref("00:00"); const duration = ref("00:00"); const pvideo = ref(null); const timer = ref(null); const showControls = ref(true); const firstPlay = ref(true); const dragStart = ref(false); const video = ref(null); const objectFit = ref("cover"); watch( () => video_play.value, () => { if (video_play.value == false) { showControls.value = false; } else { clearTimeout(timeout.value); } } ); watch( () => showControls.value, () => { if (showControls.value == true && video_play.value == false) { timeout.value = setTimeout(() => { showControls.value = false; }, 2e3); } else if (showControls.value == false && timeout.value != null) { clearTimeout(timeout.value); } } ); onMounted(() => __async$1(this, null, function* () { yield init(); if (video.value.videoWidth / video.value.videoHeight < 1) { objectFit.value = "contain"; } })); const canplay = () => { setProgress(); if (props2.autoplay) playVideo(); }; const init = () => { pvideo.value = video.value; }; const fullscreen = () => { if (pvideo.value.RequestFullScreen) { pvideo.value.RequestFullScreen(); } else if (pvideo.value.mozRequestFullScreen) { pvideo.value.mozRequestFullScreen(); } else if (pvideo.value.webkitRequestFullScreen) { pvideo.value.webkitRequestFullScreen(); } else if (pvideo.value.msRequestFullscreen) { pvideo.value.msRequestFullscreen(); } }; const playVideo = () => { if (firstPlay.value) firstPlay.value = false; if (pvideo.value.paused || pvideo.value.ended) { pvideo.value.play(); video_play.value = false; timer.value = setInterval(setProgress, 60); } else { pvideo.value.pause(); video_play.value = true; clearInterval(timer.value); timer.value = null; } }; const isPlay = () => { if (navigator.connection && navigator.connection.type != "wifi" && isTips.value && props2.needTips) { stdin_default$r.confirm({ message: "您当前处于移动网络,是否继续观看", confirmButtonText: "继续观看" }).then(() => { playVideo(); isTips.value = false; }).catch(() => { }); } else { playVideo(); } }; const setProgress = () => { currentTime.value = timeFomat(pvideo.value.currentTime); duration.value = timeFomat(pvideo.value.duration); if (!dragStart.value) video_value.value = pvideo.value.currentTime / (pvideo.value.duration / 100); if (currentTime.value == duration.value) { clearInterval(timer.value); timer.value = null; video_play.value = true; } }; expose({ setProgress, currentTime, duration }); const dragStartMedthod = () => { dragStart.value = true; clearInterval(timeout.value); }; const hanleChange = () => { pvideo.value.currentTime = pvideo.value.duration / 100 * video_value.value; dragStart.value = true; setProgress(); dragStart.value = false; }; const timeFomat = (time) => { if (isNaN(time)) { return "00:00"; } let h = Math.floor(time / 3600); let m = Math.floor(time % 3600 / 60); let s = Math.floor(time % 60); m = m >= 10 ? m : "0" + m; s = s >= 10 ? s : "0" + s; if (h === 0) { return m + ":" + s; } return h + ":" + m + ":" + s; }; const handleControls = () => { if (!firstPlay.value) { if (!showControls.value) { showControls.value = true; } else { showControls.value = false; } } }; const __returned__ = { props: props2, isTips, muted, timeout, video_play, video_value, currentTime, duration, pvideo, timer, showControls, firstPlay, dragStart, video, objectFit, canplay, init, fullscreen, playVideo, isPlay, setProgress, dragStartMedthod, hanleChange, timeFomat, handleControls, get Slider() { return Slider; }, get Loading() { return Loading; }, ref, watch, onMounted, computed, get Dialog() { return stdin_default$r; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); const _hoisted_1$e = ["onClick"]; const _hoisted_2$d = ["poster", "muted"]; const _hoisted_3$a = ["src"]; const _hoisted_4$8 = ["onClick"]; const _hoisted_5$7 = ["onClick"]; const _hoisted_6$5 = { class: "fmg-custom-video__footer" }; const _hoisted_7$1 = ["onClick"]; const _hoisted_8$1 = ["onClick"]; const _hoisted_9$1 = { class: "fmg-custom-video__footer_time" }; const _hoisted_10$1 = ["onClick"]; function __vue_render__$f(_ctx, _cache, $props, $setup, $data, $options) { const _component_van_slider = resolveComponent("van-slider"); return openBlock(), createElementBlock("div", { id: "myVideo", class: "fmg-custom-video", onClick: withModifiers($setup.handleControls, ["stop"]) }, [ createElementVNode("video", mergeProps({ onCanplay: $setup.canplay, ref: "video", poster: $props.videoPoster && $props.videoPoster.replace("http:", "https:"), width: "100%", "webkit-playsinline": "true", playsinline: "true", "x5-playsinline": "true", "x5-video-player-type": "h5", "x5-video-player-fullscreen": "false", muted: $setup.muted, style: `object-fit:${$setup.objectFit}` }, _ctx.$attrs), [ createElementVNode("source", { src: $props.videoUrl && $props.videoUrl.replace("http:", "https:") }, null, 8, _hoisted_3$a), createTextVNode(" 您的浏览器暂不支持 ") ], 16, _hoisted_2$d), withDirectives(createElementVNode( "div", null, [ withDirectives(createElementVNode( "img", { class: "volume", onClick: _cache[0] || (_cache[0] = withModifiers(($event) => $setup.muted = true, ["stop"])), src: "https://gres.guopan.cn/png/20230315/volume.png", alt: "volume" }, null, 512 /* NEED_PATCH */ ), [ [vShow, !$setup.muted] ]), withDirectives(createElementVNode( "img", { class: "volume", onClick: _cache[1] || (_cache[1] = withModifiers(($event) => $setup.muted = false, ["stop"])), src: "https://gres.guopan.cn/png/20230315/muted.png", alt: "muted" }, null, 512 /* NEED_PATCH */ ), [ [vShow, $setup.muted] ]) ], 512 /* NEED_PATCH */ ), [ [vShow, !$setup.showControls] ]), withDirectives(createElementVNode( "div", null, [ withDirectives(createElementVNode("img", { onClick: withModifiers($setup.isPlay, ["stop"]), class: "fmg-custom-video__btn", src: "https://gres.guopan.cn/png/20230315/video_play.png", alt: "" }, null, 8, _hoisted_4$8), [ [vShow, $setup.video_play] ]), withDirectives(createElementVNode("img", { onClick: withModifiers($setup.isPlay, ["stop"]), class: "fmg-custom-video__btn", src: "https://gres.guopan.cn/png/20230315/video_stop.png", alt: "" }, null, 8, _hoisted_5$7), [ [vShow, !$setup.video_play] ]), withDirectives(createElementVNode( "div", _hoisted_6$5, [ withDirectives(createElementVNode("img", { onClick: withModifiers($setup.isPlay, ["stop"]), class: "fmg-custom-video__footer_btn", src: "https://gres.guopan.cn/png/20230315/video_play_s.png", alt: "" }, null, 8, _hoisted_7$1), [ [vShow, $setup.video_play] ]), withDirectives(createElementVNode("img", { onClick: withModifiers($setup.isPlay, ["stop"]), class: "fmg-custom-video__footer_btn", src: "https://gres.guopan.cn/png/20230315/video_stop_s.png", alt: "" }, null, 8, _hoisted_8$1), [ [vShow, !$setup.video_play] ]), createVNode(_component_van_slider, { "button-size": "1px", "inactive-color": "#000000", class: "fmg-custom-video__footer_progress", modelValue: $setup.video_value, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.video_value = $event), onDragStart: $setup.dragStartMedthod, onChange: $setup.hanleChange }, null, 8, ["modelValue"]), createElementVNode( "p", _hoisted_9$1, toDisplayString($setup.currentTime) + "/" + toDisplayString($setup.duration), 1 /* TEXT */ ), createElementVNode("img", { class: "fmg-custom-video__footer_full", onClick: withModifiers($setup.fullscreen, ["stop"]), src: "https://gres.guopan.cn/png/20230315/full.png", alt: "full" }, null, 8, _hoisted_10$1) ], 512 /* NEED_PATCH */ ), [ [vShow, !$setup.firstPlay] ]) ], 512 /* NEED_PATCH */ ), [ [vShow, $setup.showControls] ]) ], 8, _hoisted_1$e); } __vue_sfc__$f.render = __vue_render__$f; __vue_sfc__$f._scopeId = "data-v-0210e5a5"; var stdin_default$q = __vue_sfc__$f; stdin_default$q.install = (app) => { app.component("CustomVideo", stdin_default$q); }; var stdin_default$p = stdin_default$q; const DialogSfc = ""; const DialogSfc2 = ""; const index$9 = ""; const index$8 = ""; const index$7 = ""; const index$6 = ""; const index$5 = ""; const index$4 = ""; const index$3 = ""; const index$2 = ""; const index$1 = ""; const __default__$4 = { components: { [Dialog$2.name]: Dialog$2 }, inheritAttrs: false }; const __vue_sfc__$e = /* @__PURE__ */ Object.assign(__default__$4, { __name: "Dialog", props: { // 移除弹窗方法 remove: Function, resolve: Function, reject: Function }, emits: ["confirm"], setup(__props, { expose, emit }) { expose(); const props2 = __props; const show = ref(true); const confirm = () => { props2.resolve(); }; const cancel = () => { props2.reject(); }; watch( () => show.value, () => { if (show.value === false) { props2.remove(); } } ); const __returned__ = { emit, props: props2, show, confirm, cancel, get Dialog() { return Dialog$2; }, ref, watch }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function __vue_render__$e(_ctx, _cache, $props, $setup, $data, $options) { const _component_van_dialog = resolveComponent("van-dialog"); return openBlock(), createBlock(_component_van_dialog, mergeProps({ class: "fmg-dialog", onCancel: $setup.cancel, onConfirm: $setup.confirm }, _ctx.$attrs, { show: $setup.show, "onUpdate:show": _cache[0] || (_cache[0] = ($event) => $setup.show = $event) }), null, 16, ["show"]); } __vue_sfc__$e.render = __vue_render__$e; __vue_sfc__$e._scopeId = "data-v-754aa72b"; var stdin_default$o = __vue_sfc__$e; var __defProp$8 = Object.defineProperty; var __defProps$8 = Object.defineProperties; var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols; var __hasOwnProp$8 = Object.prototype.hasOwnProperty; var __propIsEnum$8 = Object.prototype.propertyIsEnumerable; var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues$8 = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp$8.call(b, prop)) __defNormalProp$8(a, prop, b[prop]); if (__getOwnPropSymbols$8) for (var prop of __getOwnPropSymbols$8(b)) { if (__propIsEnum$8.call(b, prop)) __defNormalProp$8(a, prop, b[prop]); } return a; }; var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b)); const createMount$3 = (opts) => { const mountNode = document.createElement("div"); document.body.appendChild(mountNode); const app = createApp(stdin_default$o, __spreadValues$8({ // 参数 show: true, remove() { app.unmount(mountNode); document.body.removeChild(mountNode); } }, opts)); app.mount(mountNode); return app; }; function Dialog(options = {}) { return new Promise((resolve, reject) => { createMount$3(__spreadProps$8(__spreadValues$8({}, options), { resolve, reject })); }); } Dialog.confirm = (options) => { return new Promise((resolve, reject) => { createMount$3(__spreadProps$8(__spreadValues$8({}, options), { "show-cancel-button": true, resolve, reject })); }); }; Dialog.alert = (options) => { return new Promise((resolve, reject) => { createMount$3(__spreadProps$8(__spreadValues$8({}, options), { resolve, reject })); }); }; Dialog.install = (app) => { app.component("Dialog", stdin_default$o); }; var stdin_default$n = Dialog; const EllipsisSfc = ""; var __defProp$7 = Object.defineProperty; var __defProps$7 = Object.defineProperties; var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols; var __hasOwnProp$7 = Object.prototype.hasOwnProperty; var __propIsEnum$7 = Object.prototype.propertyIsEnumerable; var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues$7 = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp$7.call(b, prop)) __defNormalProp$7(a, prop, b[prop]); if (__getOwnPropSymbols$7) for (var prop of __getOwnPropSymbols$7(b)) { if (__propIsEnum$7.call(b, prop)) __defNormalProp$7(a, prop, b[prop]); } return a; }; var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b)); const __vue_sfc__$d = { name: "Ellipsis", props: { content: { type: String, default: "" }, direction: { type: String, default: "end" }, rows: { type: [Number, String], default: 1 }, expandText: { type: String, default: "" }, expandTextColor: { type: String, default: "#3460fa" }, collapseText: { type: String, default: "" }, collapseTextColor: { type: String, default: "#3460fa" }, symbol: { type: String, default: "..." }, lineHeight: { type: [Number, String], default: "20" } }, emits: ["click", "change"], setup(props2, { emit }) { const root = ref(null); let container = null; let maxHeight = 0; const ellipsis = ref(); const state = reactive({ exceeded: false, //是否超出 expanded: false //是否折叠 }); watch( () => props2.content, (newV, oldVal) => { if (newV != oldVal) { createContainer(); } } ); onMounted(() => { createContainer(); }); const createContainer = () => { if (!root.value) return; const originStyle = window.getComputedStyle(root.value); container = document.createElement("div"); const styleNames = Array.prototype.slice.apply(originStyle); styleNames.forEach((name) => { container.style.setProperty(name, originStyle.getPropertyValue(name)); }); container.style.position = "fixed"; container.style.left = "999999px"; container.style.top = "999999px"; container.style.zIndex = "-1000"; container.style.height = "auto"; container.style.minHeight = "auto"; container.style.maxHeight = "auto"; container.style.textOverflow = "clip"; container.style.whiteSpace = "normal"; container.style.webkitLineClamp = "unset"; container.style.display = "block"; const lineHeight = pxToNumber(originStyle.lineHeight === "normal" ? props2.lineHeight : originStyle.lineHeight); maxHeight = Math.floor( lineHeight * (Number(props2.rows) + 0.5) + pxToNumber(originStyle.paddingTop) + pxToNumber(originStyle.paddingBottom) ); container.innerText = props2.content; document.body.appendChild(container); calcEllipse(); }; const calcEllipse = () => { if (container.offsetHeight <= maxHeight) { state.exceeded = false; document.body.removeChild(container); } else { state.exceeded = true; const end = props2.content.length; const middle = Math.floor((0 + end) / 2); const ellipsised = props2.direction === "middle" ? tailorMiddle([0, middle], [middle, end]) : tailor(0, end); ellipsis.value = ellipsised; document.body.removeChild(container); } }; const tailor = (left, right) => { const actionText = state.expanded ? props2.collapseText : props2.expandText; const end = props2.content.length; if (right - left <= 1) { if (props2.direction === "end") { return { leading: props2.content.slice(0, left) + props2.symbol }; } else { return { tailing: props2.symbol + props2.content.slice(right, end) }; } } const middle = Math.round((left + right) / 2); if (props2.direction === "end") { container.innerText = props2.content.slice(0, middle) + props2.symbol + actionText; } else { container.innerText = actionText + props2.symbol + props2.content.slice(middle, end); } if (container.offsetHeight <= maxHeight) { if (props2.direction === "end") { return tailor(middle, right); } else { return tailor(left, middle); } } else { if (props2.direction === "end") { return tailor(left, middle); } else { return tailor(middle, right); } } }; const tailorMiddle = (leftPart, rightPart) => { const actionText = state.expanded ? props2.collapseText : props2.expandText; const end = props2.content.length; if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) { return { leading: props2.content.slice(0, leftPart[0]) + props2.symbol, tailing: props2.symbol + props2.content.slice(rightPart[1], end) }; } const leftPartMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2); const rightPartMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2); container.innerText = props2.content.slice(0, leftPartMiddle) + props2.symbol + actionText + props2.symbol + props2.content.slice(rightPartMiddle, end); if (container.offsetHeight <= maxHeight) { return tailorMiddle([leftPartMiddle, leftPart[1]], [rightPart[0], rightPartMiddle]); } else { return tailorMiddle([leftPart[0], leftPartMiddle], [rightPartMiddle, rightPart[1]]); } }; const pxToNumber = (value) => { if (!value) return 0; const match = value.match(/^\d*(\.\d*)?/); return match ? Number(match[0]) : 0; }; const clickHandle = (type) => { if (type == 1) { state.expanded = true; emit("change", "expand"); } else { state.expanded = false; emit("change", "collapse"); } }; const handleClick = () => { emit("click"); }; return __spreadProps$7(__spreadValues$7({}, toRefs(state)), { root, ellipsis, clickHandle, handleClick }); } }; const _hoisted_1$d = { key: 0 }; const _hoisted_2$c = { key: 1 }; const _hoisted_3$9 = { key: 2 }; function __vue_render__$d(_ctx, _cache) { return openBlock(), createElementBlock( "view", { class: "fmg-ellipsis", onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleClick && _ctx.handleClick(...args)), ref: "root" }, [ !_ctx.exceeded ? (openBlock(), createElementBlock( "view", _hoisted_1$d, toDisplayString(_ctx.content), 1 /* TEXT */ )) : createCommentVNode("v-if", true), _ctx.exceeded && !_ctx.expanded ? (openBlock(), createElementBlock("view", _hoisted_2$c, [ createTextVNode( toDisplayString(_ctx.ellipsis && _ctx.ellipsis.leading), 1 /* TEXT */ ), _ctx.expandText ? (openBlock(), createElementBlock( "span", { key: 0, class: "ellipsis__text", style: normalizeStyle({ color: _ctx.expandTextColor }), onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.clickHandle(1), ["stop"])) }, toDisplayString(_ctx.expandText), 5 /* TEXT, STYLE */ )) : createCommentVNode("v-if", true), createTextVNode( toDisplayString(_ctx.ellipsis && _ctx.ellipsis.tailing), 1 /* TEXT */ ) ])) : createCommentVNode("v-if", true), _ctx.exceeded && _ctx.expanded ? (openBlock(), createElementBlock("view", _hoisted_3$9, [ createTextVNode( toDisplayString(_ctx.content) + " ", 1 /* TEXT */ ), _ctx.expandText ? (openBlock(), createElementBlock( "span", { key: 0, class: "ellipsis__text", style: normalizeStyle({ color: _ctx.collapseTextColor }), onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.clickHandle(2), ["stop"])) }, toDisplayString(_ctx.collapseText), 5 /* TEXT, STYLE */ )) : createCommentVNode("v-if", true) ])) : createCommentVNode("v-if", true) ], 512 /* NEED_PATCH */ ); } __vue_sfc__$d.render = __vue_render__$d; var stdin_default$m = __vue_sfc__$d; stdin_default$m.install = (app) => { app.component("Ellipsis", stdin_default$m); }; var stdin_default$l = stdin_default$m; const indexSfc$7 = ""; const __vue_sfc__$c = { name: "GuessGift", props: { turnNumber: { type: Number, default: 20 }, turnsFrequency: { type: Number, default: 500 }, raiseHeight: { type: Number, default: 50 } }, emits: ["start-turns", "end-turns"], setup(props2, { emit }) { const bowlList = reactive([1, 2, 3]); const num = ref(0); const lock = ref(false); const bowlLock = ref(true); const showBean = ref(false); let bowlEle = reactive([]); const bowlBox = ref(null); watch( () => showBean.value, (n, o) => { bowlEle = []; } ); const classes = computed(() => ({ "fmg-guess-gift": true, disabledClick: bowlLock.value })); const shuffle = (ary) => { const array = JSON.parse(JSON.stringify(ary)); for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; }; const setBowlEle = (ele) => { bowlEle.push(ele); }; const bowlLocation = reactive([]); onMounted(() => { bowlEle.forEach((element) => { bowlLocation.push(element.getBoundingClientRect()); }); }); const goldBeanDom = ref(null); let orginBowlCopy = reactive([]); const changePosition = () => { const orginBowl = bowlLocation; orginBowlCopy = shuffle(bowlLocation); bowlEle.forEach((element, index2) => { const originDom = orginBowl[index2].x; const newDom = orginBowlCopy[index2].x; element.style.left = (originDom - newDom) * -1 + "px"; }); }; const timer = ref(null); const init = () => { showBean.value = false; clearTimeout(timer); timer.value = setTimeout(() => { changePosition(); if (num.value < props2.turnNumber) { init(); num.value++; } else { clearTimeout(timer); num.value = 0; setTimeout(() => { lock.value = false; bowlLock.value = false; }, 500); } }, props2.turnsFrequency); }; const start = () => { if (lock.value) { return false; } const _index = 1; bowlList.forEach((item2, index2) => { bowlEle[index2].style.top = 0; }); const idx = _index; const item = bowlEle[idx]; lock.value = true; showBean.value = true; setTimeout(() => { { const _item = item.getBoundingClientRect(); const _itemParentLeft = bowlBox.value.getBoundingClientRect().left || 0; goldBeanDom.value.style.left = _item.left + _item.width / 2 - _itemParentLeft - goldBeanDom.value.offsetWidth / 2 + "px"; } setTimeout(() => { item.style.top = `-${props2.raiseHeight}px`; setTimeout(() => { item.style.top = 0; }, 800); setTimeout(() => { init(); }, 1300); }, 400); }, 100); }; const raise = (index2) => { if (lock.value) { return false; } if (index2 === 1) { showBean.value = true; const _item = orginBowlCopy[index2]; const _itemParentLeft = bowlBox.value.getBoundingClientRect().left || 0; setTimeout(() => { goldBeanDom.value.style.left = _item.x + _item.width / 2 - _itemParentLeft - goldBeanDom.value.offsetWidth / 2 + "px"; }, 100); } else { showBean.value = false; } bowlEle[index2].style.top = `-${props2.raiseHeight}px`; setTimeout(() => { emit("end-turns", index2 === 1); bowlLock.value = true; }, 300); }; return { bowlList, classes, goldBeanDom, init, bowlBox, setBowlEle, raise, showBean, start }; } }; const _hoisted_1$c = ["onClick"]; const _hoisted_2$b = { ref: "goldBeanDom", class: "gold-bean" }; function __vue_render__$c(_ctx, _cache) { return openBlock(), createElementBlock( "div", { class: normalizeClass(_ctx.classes), ref: "bowlBox" }, [ (openBlock(true), createElementBlock( Fragment, null, renderList(_ctx.bowlList, (item, idx) => { return openBlock(), createElementBlock("div", { class: "bowl-item", key: "bowl" + item, ref_for: true, ref: _ctx.setBowlEle, onClick: ($event) => _ctx.raise(idx) }, null, 8, _hoisted_1$c); }), 128 /* KEYED_FRAGMENT */ )), withDirectives(createElementVNode( "div", _hoisted_2$b, null, 512 /* NEED_PATCH */ ), [ [vShow, _ctx.showBean] ]) ], 2 /* CLASS */ ); } __vue_sfc__$c.render = __vue_render__$c; var stdin_default$k = __vue_sfc__$c; const indexSfc$6 = ""; const indexSfc2 = ""; const __default__$3 = { name: "Loading" }; const __vue_sfc__$b = /* @__PURE__ */ Object.assign(__default__$3, { props: { iconUrl: { type: String, required: false }, loadingText: { type: String, required: false, default: "加载中..." } }, setup(__props, { expose }) { expose(); const props2 = __props; const __returned__ = { props: props2 }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); const _hoisted_1$b = { class: "fmg-loading" }; const _hoisted_2$a = { class: "content" }; const _hoisted_3$8 = ["src"]; const _hoisted_4$7 = { key: 1, class: "loading" }; const _hoisted_5$6 = { key: 2, class: "text" }; function __vue_render__$b(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("div", _hoisted_1$b, [ createElementVNode("div", _hoisted_2$a, [ $props.iconUrl ? (openBlock(), createElementBlock("img", { key: 0, src: $props.iconUrl, class: "icon", alt: "loading" }, null, 8, _hoisted_3$8)) : (openBlock(), createElementBlock("div", _hoisted_4$7)), $props.loadingText ? (openBlock(), createElementBlock( "p", _hoisted_5$6, toDisplayString($props.loadingText), 1 /* TEXT */ )) : createCommentVNode("v-if", true) ]) ]); } __vue_sfc__$b.render = __vue_render__$b; __vue_sfc__$b._scopeId = "data-v-e4c51d9c"; var stdin_default$j = __vue_sfc__$b; const indexSfc$5 = ""; const __vue_sfc__$a = { name: "Marquee", props: { prizeList: { type: Array, default: () => [] }, nums: { type: [Number, String], default: 0 } }, data() { return { last_index: 0, //上一回滚动的位置 max_number: 8, //轮盘全部数量 speed: 300, //初始速度值, 速度值越大则越慢 max_speed: 40, // 滚动的最大速度 timer: "", //定时器 minturns: 4, //最小圈数为2 runs_now: 0, // 当前已跑步数 amplification_index: -1, //轮盘的当前滚动位置 finalIndex: null, rolled: false, // defaultIcon:require('@/assets/img/lottery_thanks.png'), key: { 0: 0, 1: 1, 2: 2, 3: 5, 4: 8, 5: 7, 6: 6, 7: 3 } }; }, computed: { handlePrize() { let arr = [...this.prizeList]; arr.splice(4, 0, { id: new Date().getTime() }); return arr; } }, methods: { starRoll(isBtn) { if (isBtn) { this.$emit("start", this.rolledStart); } }, handleFinalIndex() { return parseInt( Object.keys(this.key).find((i) => { return this.key[i] == this.finalIndex; }) ); }, rolledStart(finalIndex) { if (finalIndex == 4) return; if (finalIndex == null) { console.log("网络出错"); return; } this.finalIndex = parseInt(finalIndex); this.rolled = true; this.runs_now = 0; this.amplification_index = -1; this.last_index = -1; this.rolling(); }, rolling() { this.timer = setTimeout(() => { this.rolling(); }, this.speed); this.runs_now++; this.amplification_index++; var count_num = this.minturns * this.max_number + (1 + this.handleFinalIndex()); if (this.runs_now <= count_num / 3 * 2) { this.speed -= 20; if (this.speed <= this.max_speed) { this.speed = this.max_speed; } } else if (this.runs_now >= count_num) { clearInterval(this.timer); this.last_index = this.amplification_index; setTimeout(() => { this.$emit("end"); }, 500); } else if (count_num - this.runs_now <= 10) { this.speed += 20; } else { this.speed += 10; if (this.speed >= 100) { this.speed = 100; } } if (this.amplification_index >= this.max_number) { this.amplification_index = 0; } } } }; const _hoisted_1$a = { class: "fmg-marquee" }; const _hoisted_2$9 = ["onClick"]; const _hoisted_3$7 = /* @__PURE__ */ createElementVNode( "img", { class: "lottery_text", alt: "" }, null, -1 /* HOISTED */ ); const _hoisted_4$6 = { class: "times" }; const _hoisted_5$5 = { class: "prize_img" }; const _hoisted_6$4 = ["src"]; function __vue_render__$a(_ctx, _cache) { return openBlock(), createElementBlock("div", _hoisted_1$a, [ (openBlock(true), createElementBlock( Fragment, null, renderList(_ctx.handlePrize, (item, index2) => { return openBlock(), createElementBlock("div", { key: index2, class: "prize-item" }, [ _ctx.$slots.prizeItem ? renderSlot(_ctx.$slots, "prizeItem", { key: 0 }) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(["block", { "block--btn": index2 == 4, "block--active": index2 == _ctx.key[_ctx.amplification_index] }]), onClick: ($event) => _ctx.starRoll(index2 == 4) }, [ index2 == 4 ? (openBlock(), createElementBlock( Fragment, { key: 0 }, [ _hoisted_3$7, createElementVNode( "div", _hoisted_4$6, "抽奖次数:" + toDisplayString(_ctx.nums), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) : (openBlock(), createElementBlock( Fragment, { key: 1 }, [ createElementVNode("div", _hoisted_5$5, [ createElementVNode("img", { src: item.pic_url, alt: "" }, null, 8, _hoisted_6$4) ]), createElementVNode( "p", null, toDisplayString(item.name), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) ], 10, _hoisted_2$9)) ]); }), 128 /* KEYED_FRAGMENT */ )) ]); } __vue_sfc__$a.render = __vue_render__$a; __vue_sfc__$a._scopeId = "data-v-ab18a5d0"; var stdin_default$i = __vue_sfc__$a; const indexSfc$4 = ""; const __default__$2 = { components: { [Popup.name]: Popup }, name: "NoSupport" }; const __vue_sfc__$9 = /* @__PURE__ */ Object.assign(__default__$2, { props: { showPopUpStare: { type: Boolean, default: false }, limitGameList: { type: String, default: "" }, emptyIcon: { type: String, default: "https://gres.guopan.cn/png/20230419/no_support-66.png" } }, emits: ["clos