flamingo-ui
Version:
火烈鸟UI组件库
202 lines (201 loc) • 6.66 kB
JavaScript
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
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));
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_Payment_sfc = require("./Payment-sfc.css");
var import_vue = require("vue");
var import_utils = require("../utils/index");
var import_vue2 = require("vue");
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 = (0, import_vue.reactive)({
// 组件显示
show: true
});
const fncallback = (0, import_utils.debounce)((callback) => {
callback ? callback(data) : data.show = false;
});
(0, import_vue.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({}, (0, import_vue.toRefs)(data)), {
fncallback,
close,
confirm
});
}
};
const _hoisted_1 = /* @__PURE__ */ (0, import_vue2.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 (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"div",
{
class: (0, import_vue2.normalizeClass)(["fmg-payment", { "fmg-payment-hide": !_ctx.show }]),
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.close && _ctx.close(...args)),
onTouchmove: _cache[5] || (_cache[5] = (0, import_vue2.withModifiers)(() => {
}, ["prevent"]))
},
[
(0, import_vue2.createElementVNode)("div", {
class: "fmg-payment-wrapper",
onClick: _cache[3] || (_cache[3] = (0, import_vue2.withModifiers)(() => {
}, ["stop"]))
}, [
_hoisted_1,
(0, import_vue2.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: ""
}),
(0, import_vue2.createElementVNode)("div", _hoisted_2, [
(0, import_vue2.createElementVNode)(
"p",
null,
(0, import_vue2.toDisplayString)(_ctx.message),
1
/* TEXT */
),
_ctx.slot ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("p", {
key: 0,
innerHTML: _ctx.slot
}, null, 8, _hoisted_3)) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createElementVNode)("p", null, [
(0, import_vue2.createTextVNode)("\u652F\u4ED8\u91D1\u989D\uFF1A"),
(0, import_vue2.createElementVNode)(
"span",
null,
(0, import_vue2.toDisplayString)(_ctx.price) + "\u5143",
1
/* TEXT */
),
_ctx.originprice ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"span",
_hoisted_4,
(0, import_vue2.toDisplayString)(_ctx.originprice),
1
/* TEXT */
)) : (0, import_vue2.createCommentVNode)("v-if", true)
])
]),
(0, import_vue2.createElementVNode)("div", _hoisted_5, [
_ctx.wx ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("div", {
key: 0,
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.fncallback(_ctx.wx))
}, "\u5FAE\u4FE1\u652F\u4ED8")) : (0, import_vue2.createCommentVNode)("v-if", true),
_ctx.zfb ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("div", {
key: 1,
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.fncallback(_ctx.zfb))
}, "\u652F\u4ED8\u5B9D\u652F\u4ED8")) : (0, import_vue2.createCommentVNode)("v-if", true)
])
])
],
34
/* CLASS, HYDRATE_EVENTS */
);
}
__vue_sfc__.render = __vue_render__;
__vue_sfc__._scopeId = "data-v-2f4aed1c";
var stdin_default = __vue_sfc__;