gengx
This commit is contained in:
+1
-85
@@ -1,86 +1,2 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Math) {
|
||||
TongjiIcon();
|
||||
}
|
||||
const TongjiIcon = () => "./TongjiIcon.js";
|
||||
const _sfc_main = {
|
||||
__name: "CelebrateBurst",
|
||||
props: {
|
||||
show: { type: Boolean, default: false },
|
||||
title: { type: String, default: "" },
|
||||
subtitle: { type: String, default: "" }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const particles = common_vendor.ref([]);
|
||||
const cardPop = common_vendor.ref(false);
|
||||
const COLORS = ["#204E2B", "#386641", "#AFE2B3", "#FBBF24", "#727970", "#DC2626"];
|
||||
function buildParticles() {
|
||||
const list = [];
|
||||
for (let i = 0; i < 18; i++) {
|
||||
const left = 8 + Math.random() * 84;
|
||||
const delay = Math.random() * 0.35;
|
||||
const hue = COLORS[i % COLORS.length];
|
||||
const size = 10 + Math.floor(Math.random() * 14);
|
||||
list.push({
|
||||
id: `${Date.now()}_${i}`,
|
||||
style: {
|
||||
left: `${left}%`,
|
||||
width: `${size}rpx`,
|
||||
height: `${size}rpx`,
|
||||
background: hue,
|
||||
animationDelay: `${delay}s`
|
||||
}
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => props.show,
|
||||
(v) => {
|
||||
if (v) {
|
||||
particles.value = buildParticles();
|
||||
cardPop.value = false;
|
||||
setTimeout(() => {
|
||||
cardPop.value = true;
|
||||
}, 30);
|
||||
} else {
|
||||
particles.value = [];
|
||||
cardPop.value = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: __props.show
|
||||
}, __props.show ? common_vendor.e({
|
||||
b: common_vendor.f(particles.value, (p, k0, i0) => {
|
||||
return {
|
||||
a: p.id,
|
||||
b: common_vendor.s(p.style)
|
||||
};
|
||||
}),
|
||||
c: __props.title
|
||||
}, __props.title ? common_vendor.e({
|
||||
d: common_vendor.p({
|
||||
name: "sparkles",
|
||||
size: "lg",
|
||||
color: "#204E2B"
|
||||
}),
|
||||
e: common_vendor.t(__props.title),
|
||||
f: __props.subtitle
|
||||
}, __props.subtitle ? {
|
||||
g: common_vendor.t(__props.subtitle)
|
||||
} : {}, {
|
||||
h: cardPop.value ? 1 : ""
|
||||
}) : {}, {
|
||||
i: common_vendor.o(() => {
|
||||
}, "49")
|
||||
}) : {});
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-313f45d6"]]);
|
||||
wx.createComponent(Component);
|
||||
"use strict";const t=require("../../common/vendor.js");Math||h();const h=()=>"./TongjiIcon.js",m={__name:"CelebrateBurst",props:{show:{type:Boolean,default:!1},title:{type:String,default:""},subtitle:{type:String,default:""}},setup(e){const f=e,s=t.ref([]),l=t.ref(!1),i=["#204E2B","#386641","#AFE2B3","#FBBF24","#727970","#DC2626"];function d(){const a=[];for(let n=0;n<18;n++){const o=8+Math.random()*84,c=Math.random()*.35,u=i[n%i.length],r=10+Math.floor(Math.random()*14);a.push({id:`${Date.now()}_${n}`,style:{left:`${o}%`,width:`${r}rpx`,height:`${r}rpx`,background:u,animationDelay:`${c}s`}})}return a}return t.watch(()=>f.show,a=>{a?(s.value=d(),l.value=!1,setTimeout(()=>{l.value=!0},30)):(s.value=[],l.value=!1)}),(a,n)=>t.e({a:e.show},e.show?t.e({b:t.f(s.value,(o,c,u)=>({a:o.id,b:t.s(o.style)})),c:e.title},e.title?t.e({d:t.p({name:"sparkles",size:"lg",color:"#204E2B"}),e:t.t(e.title),f:e.subtitle},e.subtitle?{g:t.t(e.subtitle)}:{},{h:l.value?1:""}):{},{i:t.o(()=>{},"49")}):{})}},b=t._export_sfc(m,[["__scopeId","data-v-313f45d6"]]);wx.createComponent(b);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/tongji/components/CelebrateBurst.js.map
|
||||
|
||||
Reference in New Issue
Block a user