UNPKG

flamingo-ui

Version:

火烈鸟UI组件库

185 lines (184 loc) 5.61 kB
var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); import "./Payment-sfc.css"; import { reactive, toRefs, watch } from "vue"; import { debounce } from "../utils/index"; const __vue_sfc__ = { name: "Payment", props: { // 文案 message: { type: String, default: "" }, // 价格 price: { type: [String, Number], default: "" }, originprice: { type: [String, Number], default: "" }, // 插槽 slot: { type: String, default: "" }, // 按钮 wx: { type: Function, default: null }, // 按钮 zfb: { type: Function, default: null }, // 点击关闭按钮 beforeClose: { type: Function, default: () => { } }, // 允许触碰遮罩层关闭 closeOnClickOverlay: { type: Boolean, default: false }, // 移除弹窗方法 remove: Function }, setup(props, ctx) { const data = reactive({ // 组件显示 show: true }); const fncallback = debounce((callback) => { callback ? callback(data) : data.show = false; }); watch(() => data.show, () => { if (data.show == false) { props.remove(); } }); const close = () => { props.closeOnClickOverlay ? data.show = false : ""; }; const confirm = () => { props.beforeClose(); data.show = false; }; return __spreadProps(__spreadValues({}, toRefs(data)), { fncallback, close, confirm }); } }; import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass } from "vue"; const _hoisted_1 = /* @__PURE__ */ _createElementVNode( "p", { class: "fmg-payment-title" }, "\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F", -1 /* HOISTED */ ); const _hoisted_2 = { class: "fmg-payment-message" }; const _hoisted_3 = ["innerHTML"]; const _hoisted_4 = { key: 0, class: "origin" }; const _hoisted_5 = { class: "fmg-payment-btn" }; function __vue_render__(_ctx, _cache) { return _openBlock(), _createElementBlock( "div", { class: _normalizeClass(["fmg-payment", { "fmg-payment-hide": !_ctx.show }]), onClick: _cache[4] || (_cache[4] = (...args) => _ctx.close && _ctx.close(...args)), onTouchmove: _cache[5] || (_cache[5] = _withModifiers(() => { }, ["prevent"])) }, [ _createElementVNode("div", { class: "fmg-payment-wrapper", onClick: _cache[3] || (_cache[3] = _withModifiers(() => { }, ["stop"])) }, [ _hoisted_1, _createElementVNode("img", { onClick: _cache[0] || (_cache[0] = (...args) => _ctx.confirm && _ctx.confirm(...args)), class: "fmg-payment-icon", src: "https://gres.guopan.cn/png/20230313/payment-close.png", alt: "" }), _createElementVNode("div", _hoisted_2, [ _createElementVNode( "p", null, _toDisplayString(_ctx.message), 1 /* TEXT */ ), _ctx.slot ? (_openBlock(), _createElementBlock("p", { key: 0, innerHTML: _ctx.slot }, null, 8, _hoisted_3)) : _createCommentVNode("v-if", true), _createElementVNode("p", null, [ _createTextVNode("\u652F\u4ED8\u91D1\u989D\uFF1A"), _createElementVNode( "span", null, _toDisplayString(_ctx.price) + "\u5143", 1 /* TEXT */ ), _ctx.originprice ? (_openBlock(), _createElementBlock( "span", _hoisted_4, _toDisplayString(_ctx.originprice), 1 /* TEXT */ )) : _createCommentVNode("v-if", true) ]) ]), _createElementVNode("div", _hoisted_5, [ _ctx.wx ? (_openBlock(), _createElementBlock("div", { key: 0, onClick: _cache[1] || (_cache[1] = ($event) => _ctx.fncallback(_ctx.wx)) }, "\u5FAE\u4FE1\u652F\u4ED8")) : _createCommentVNode("v-if", true), _ctx.zfb ? (_openBlock(), _createElementBlock("div", { key: 1, onClick: _cache[2] || (_cache[2] = ($event) => _ctx.fncallback(_ctx.zfb)) }, "\u652F\u4ED8\u5B9D\u652F\u4ED8")) : _createCommentVNode("v-if", true) ]) ]) ], 34 /* CLASS, HYDRATE_EVENTS */ ); } __vue_sfc__.render = __vue_render__; __vue_sfc__._scopeId = "data-v-2f4aed1c"; var stdin_default = __vue_sfc__; export { stdin_default as default };