no message

This commit is contained in:
2024-01-16 22:53:42 +08:00
commit 40e5198c79
479 changed files with 52166 additions and 0 deletions

View File

@@ -0,0 +1,156 @@
var e = require("../../../../common/vendor.js"),
t = {
name: "uniCollapseItem",
props: {
title: { type: String, default: "" },
name: { type: [Number, String], default: "" },
disabled: { type: Boolean, default: !1 },
showAnimation: { type: Boolean, default: !0 },
open: { type: Boolean, default: !1 },
thumb: { type: String, default: "" },
titleBorder: { type: String, default: "auto" },
border: { type: Boolean, default: !0 },
showArrow: { type: Boolean, default: !0 },
},
data: function () {
return {
isOpen: !1,
isheight: null,
height: 0,
elId: "Uni_".concat(Math.ceil(1e6 * Math.random()).toString(36)),
nameSync: 0,
};
},
watch: {
open: function (e) {
(this.isOpen = e), this.onClick(e, "init");
},
},
updated: function (e) {
var t = this;
this.$nextTick(function () {
t.init(!0);
});
},
created: function () {
(this.collapse = this.getCollapse()),
(this.oldHeight = 0),
this.onClick(this.open, "init");
},
unmounted: function () {
(this.__isUnmounted = !0), this.uninstall();
},
mounted: function () {
this.collapse &&
("" !== this.name
? (this.nameSync = this.name)
: (this.nameSync = this.collapse.childrens.length + ""),
-1 === this.collapse.names.indexOf(this.nameSync)
? this.collapse.names.push(this.nameSync)
: console.warn("name 值 ".concat(this.nameSync, " 重复")),
-1 === this.collapse.childrens.indexOf(this) &&
this.collapse.childrens.push(this),
this.init());
},
methods: {
init: function (e) {
this.getCollapseHeight(e);
},
uninstall: function () {
var e = this;
this.collapse &&
(this.collapse.childrens.forEach(function (t, i) {
t === e && e.collapse.childrens.splice(i, 1);
}),
this.collapse.names.forEach(function (t, i) {
t === e.nameSync && e.collapse.names.splice(i, 1);
}));
},
onClick: function (e, t) {
this.disabled ||
((this.isOpen = e),
this.isOpen && this.collapse && this.collapse.setAccordion(this),
"init" !== t && this.collapse.onChange(e, this));
},
getCollapseHeight: function (t) {
var i = this,
n =
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
e.index
.createSelectorQuery()
.in(this)
.select("#".concat(this.elId))
.fields({ size: !0 }, function (e) {
if (!(n >= 10)) {
if (!e) return n++, void i.getCollapseHeight(!1, n);
(i.height = e.height),
(i.isheight = !0),
t || i.onClick(i.isOpen, "init");
}
})
.exec();
},
getNvueHwight: function (e) {
var t = this;
dom.getComponentRect(this.$refs["collapse--hook"], function (i) {
if (i && i.result && i.size) {
if (((t.height = i.size.height), (t.isheight = !0), e)) return;
t.onClick(t.open, "init");
}
});
},
getCollapse: function () {
for (
var e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: "uniCollapse",
t = this.$parent,
i = t.$options.name;
i !== e;
) {
if (!(t = t.$parent)) return !1;
i = t.$options.name;
}
return t;
},
},
};
Array || e.resolveComponent("uni-icons")(), Math;
var i = e._export_sfc(t, [
[
"render",
function (t, i, n, o, s, l) {
return e.e(
{ a: n.thumb },
n.thumb ? { b: n.thumb } : {},
{ c: e.t(n.title), d: n.disabled ? 1 : "", e: n.showArrow },
n.showArrow
? {
f: e.p({
color: n.disabled ? "#ddd" : "#bbb",
size: "14",
type: "bottom",
}),
g: s.isOpen ? 1 : "",
h: !0 === n.showAnimation ? 1 : "",
}
: {},
{
i: e.o(function (e) {
return l.onClick(!s.isOpen);
}),
j: s.isOpen && "auto" === n.titleBorder ? 1 : "",
k: "none" !== n.titleBorder ? 1 : "",
l: s.elId,
m: s.isheight ? 1 : "",
n: n.border && s.isOpen ? 1 : "",
o: n.showAnimation ? 1 : "",
p: (s.isOpen ? s.height : 0) + "px",
}
);
},
],
]);
wx.createComponent(i);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
}
}

View File

@@ -0,0 +1,44 @@
<view class="uni-collapse-item">
<view
bindtap="{{i}}"
class="{{['uni-collapse-item__title',j&&'is-open',k&&'uni-collapse-item-border']}}"
>
<view class="uni-collapse-item__title-wrap">
<slot name="title" wx:if="{{$slots.title}}"></slot>
<view
class="{{['uni-collapse-item__title-box',d&&'is-disabled']}}"
wx:else
>
<image
class="uni-collapse-item__title-img"
src="{{b}}"
wx:if="{{a}}"
></image>
<text class="uni-collapse-item__title-text">{{c}}</text>
</view>
</view>
<view
class="{{[g&&'uni-collapse-item__title-arrow-active',h&&'uni-collapse-item--animation','uni-collapse-item__title-arrow']}}"
wx:if="{{e}}"
>
<uni-icons
bind:__l="__l"
uI="600bad8f-0"
uP="{{f}}"
wx:if="{{f}}"
></uni-icons>
</view>
</view>
<view
class="{{['uni-collapse-item__wrap',o&&'is--transition']}}"
style="{{'height:'+p}}"
>
<view
class="{{['uni-collapse-item__wrap-content',m&&'open',n&&'uni-collapse-item--border']}}"
id="{{l}}"
ref="collapse--hook"
>
<slot></slot>
</view>
</view>
</view>

View File

@@ -0,0 +1,101 @@
.uni-collapse-item {
box-sizing: border-box;
}
.uni-collapse-item__title {
align-items: center;
box-sizing: border-box;
display: -webkit-flex;
display: flex;
flex-direction: row;
transition: border-bottom-color 0.3s;
width: 100%;
}
.uni-collapse-item__title-wrap {
flex: 1;
width: 100%;
}
.uni-collapse-item__title-box {
align-items: center;
background-color: #fff;
box-sizing: border-box;
color: #303133;
display: -webkit-flex;
display: flex;
flex-direction: row;
font-size: 13px;
font-weight: 500;
height: 48px;
justify-content: space-between;
line-height: 48px;
padding: 0 15px;
width: 100%;
}
.uni-collapse-item__title-box.is-disabled .uni-collapse-item__title-text {
color: #999;
}
.uni-collapse-item__title.uni-collapse-item-border {
border-bottom: 1px solid #ebeef5;
}
.uni-collapse-item__title.is-open {
border-bottom-color: transparent;
}
.uni-collapse-item__title-img {
height: 22px;
margin-right: 10px;
width: 22px;
}
.uni-collapse-item__title-text {
color: inherit;
flex: 1;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.uni-collapse-item__title-arrow {
align-items: center;
box-sizing: border-box;
display: -webkit-flex;
display: flex;
height: 20px;
justify-content: center;
margin-right: 10px;
transform: rotate(0);
width: 20px;
}
.uni-collapse-item__title-arrow-active {
transform: rotate(-180deg);
}
.uni-collapse-item__wrap {
background-color: #fff;
box-sizing: border-box;
height: 0;
overflow: hidden;
position: relative;
will-change: height;
}
.uni-collapse-item__wrap.is--transition {
transition-duration: 0.3s;
transition-property: height, border-bottom-width;
will-change: height;
}
.uni-collapse-item__wrap-content {
border-bottom: 0 solid transparent;
color: #303133;
font-size: 13px;
position: absolute;
}
.uni-collapse-item__wrap-content.uni-collapse-item--border {
border-bottom-color: #ebeef5;
border-bottom-width: 1px;
}
.uni-collapse-item__wrap-content.open {
position: relative;
}
.uni-collapse-item--animation {
transition-duration: 0.3s;
transition-property: -webkit-transform;
transition-property: transform;
transition-property: transform, -webkit-transform;
transition-timing-function: ease;
}

View File

@@ -0,0 +1,99 @@
var e = require("../../../../common/vendor.js"),
t = {
name: "uniCollapse",
emits: ["change", "activeItem", "input", "update:modelValue"],
props: {
value: { type: [String, Array], default: "" },
modelValue: { type: [String, Array], default: "" },
accordion: { type: [Boolean, String], default: !1 },
},
data: function () {
return {};
},
computed: {
dataValue: function () {
var e =
("string" == typeof this.value && "" === this.value) ||
(Array.isArray(this.value) && 0 === this.value.length);
return (
("string" == typeof this.modelValue && "" === this.modelValue) ||
(Array.isArray(this.modelValue) && this.modelValue.length),
e ? this.modelValue : this.value
);
},
},
watch: {
dataValue: function (e) {
this.setOpen(e);
},
},
created: function () {
(this.childrens = []), (this.names = []);
},
mounted: function () {
var e = this;
this.$nextTick(function () {
e.setOpen(e.dataValue);
});
},
methods: {
setOpen: function (e) {
var t = this,
n = "string" == typeof e,
i = Array.isArray(e);
this.childrens.forEach(function (a, o) {
if (n && e === a.nameSync) {
if (!t.accordion)
return void console.warn(
"accordion 属性为 false ,v-model 类型应该为 array"
);
a.isOpen = !0;
}
i &&
e.forEach(function (e) {
if (e === a.nameSync) {
if (t.accordion)
return void console.warn(
"accordion 属性为 true ,v-model 类型应该为 string"
);
a.isOpen = !0;
}
});
}),
this.emit(e);
},
setAccordion: function (e) {
this.accordion &&
this.childrens.forEach(function (t, n) {
e !== t && (t.isOpen = !1);
});
},
resize: function () {
this.childrens.forEach(function (e, t) {
e.getCollapseHeight();
});
},
onChange: function (e, t) {
var n = [];
this.accordion
? (n = e ? t.nameSync : "")
: this.childrens.forEach(function (e, t) {
e.isOpen && n.push(e.nameSync);
}),
this.$emit("change", n),
this.emit(n);
},
emit: function (e) {
this.$emit("input", e), this.$emit("update:modelValue", e);
},
},
},
n = e._export_sfc(t, [
[
"render",
function (e, t, n, i, a, o) {
return {};
},
],
]);
wx.createComponent(n);

View File

@@ -0,0 +1 @@
{ "component": true, "usingComponents": {} }

View File

@@ -0,0 +1,3 @@
<view class="uni-collapse">
<slot></slot>
</view>

View File

@@ -0,0 +1,7 @@
.uni-collapse {
background-color: #fff;
display: -webkit-flex;
display: flex;
flex-direction: column;
width: 100%;
}

View File

@@ -0,0 +1,20 @@
exports.messages = {
en: {
"uni-countdown.day": "day",
"uni-countdown.h": "h",
"uni-countdown.m": "m",
"uni-countdown.s": "s",
},
"zh-Hans": {
"uni-countdown.day": "天",
"uni-countdown.h": "时",
"uni-countdown.m": "分",
"uni-countdown.s": "秒",
},
"zh-Hant": {
"uni-countdown.day": "天",
"uni-countdown.h": "時",
"uni-countdown.m": "分",
"uni-countdown.s": "秒",
},
};

View File

@@ -0,0 +1,203 @@
var t = require("../../../../common/vendor.js"),
i = require("./i18n/index.js"),
e = t.initVueI18n(i.messages).t,
n = {
name: "UniCountdown",
emits: ["timeup"],
props: {
showDay: { type: Boolean, default: !0 },
showColon: { type: Boolean, default: !0 },
start: { type: Boolean, default: !0 },
backgroundColor: { type: String, default: "" },
color: { type: String, default: "#333" },
fontSize: { type: Number, default: 14 },
splitorColor: { type: String, default: "#333" },
day: { type: Number, default: 0 },
hour: { type: Number, default: 0 },
minute: { type: Number, default: 0 },
second: { type: Number, default: 0 },
milliSecond: { type: Number, default: 0 },
timestamp: { type: Number, default: 0 },
},
data: function () {
return {
timer: null,
syncFlag: !1,
d: "00",
h: "00",
i: "00",
s: "00",
ms: "00",
milliSeconds: 0,
};
},
computed: {
dayText: function () {
return e("uni-countdown.day");
},
hourText: function (t) {
return e("uni-countdown.h");
},
minuteText: function (t) {
return e("uni-countdown.m");
},
secondText: function (t) {
return e("uni-countdown.s");
},
timeStyle: function () {
var t = this.color,
i = this.backgroundColor,
e = this.fontSize;
return {
color: t,
backgroundColor: i,
fontSize: "".concat(e, "rpx"),
width: (22 * e) / 14 + "rpx",
lineHeight: (20 * e) / 14 + "rpx",
borderRadius: (3 * e) / 14 + "rpx",
};
},
splitorStyle: function () {
var t = this.splitorColor,
i = this.fontSize;
this.backgroundColor;
return { color: t, fontSize: "".concat(i, "rpx") };
},
},
watch: {
day: function (t) {
this.changeFlag();
},
hour: function (t) {
this.changeFlag();
},
minute: function (t) {
this.changeFlag();
},
second: function (t) {
this.changeFlag();
},
milliSecond: function (t) {
this.changeFlag();
},
start: {
immediate: !0,
handler: function (t, i) {
if (t) this.startData();
else {
if (!i) return;
clearInterval(this.timer);
}
},
},
},
created: function (t) {
(this.milliSeconds = this.toMilliSeconds(
this.day,
this.hour,
this.minute,
this.second,
this.milliSecond
)),
this.countDown();
},
unmounted: function () {
clearInterval(this.timer);
},
methods: {
toMilliSeconds: function (t, i, e, n, o) {
return (
24 * t * 60 * 60 * 1e3 +
60 * i * 60 * 1e3 +
60 * e * 1e3 +
1e3 * n +
o
);
},
timeUp: function () {
clearInterval(this.timer), this.$emit("timeup");
},
countDown: function () {
var t = this.milliSeconds,
i = 0,
e = 0,
n = 0,
o = 0,
s = 0;
t > 0
? ((i = Math.floor(t / 864e5)),
(e = Math.floor(t / 36e5) - 24 * i),
(n = Math.floor(t / 6e4) - 24 * i * 60 - 60 * e),
(o = Math.floor(t / 1e3) - 24 * i * 60 * 60 - 60 * e * 60 - 60 * n),
(s = Math.floor(t) - 24 * i * 60 * 60 - 60 * e * 60 - 60 * n - o))
: this.timeUp(),
i < 10 && (i = "0" + i),
e < 10 && (e = "0" + e),
n < 10 && (n = "0" + n),
o < 10 && (o = "0" + o),
(s = s < 10 ? "0" + s : ((s % 1e3) / 10).toFixed(0)),
(this.d = i),
(this.h = e),
(this.i = n),
(this.s = o),
(this.ms = s);
},
startData: function () {
var t = this;
if (
((this.milliSeconds = this.toMilliSeconds(
this.day,
this.hour,
this.minute,
this.second,
this.milliSecond
)),
this.milliSeconds <= 0)
)
return (
(this.milliSeconds = this.toMilliSeconds(0, 0, 0, 0, 0)),
void this.countDown()
);
clearInterval(this.timer),
this.countDown(),
(this.timer = setInterval(function () {
(t.milliSeconds = t.milliSeconds - 10),
t.milliSeconds < 0 ? t.timeUp() : t.countDown();
}, 10));
},
update: function () {
this.startData();
},
changeFlag: function () {
this.syncFlag ||
((this.milliSeconds = this.toSeconds(
this.day,
this.hour,
this.minute,
this.second,
this.milliSecond
)),
this.startData(),
(this.syncFlag = !0));
},
},
},
o = t._export_sfc(n, [
[
"render",
function (i, e, n, o, s, r) {
return {
a: t.t(s.i),
b: t.s(r.timeStyle),
c: t.s(r.splitorStyle),
d: t.t(s.s),
e: t.s(r.timeStyle),
f: t.s(r.splitorStyle),
g: t.t(s.ms),
h: t.s(r.timeStyle),
};
},
],
["__scopeId", "data-v-edf646b4"],
]);
wx.createComponent(o);

View File

@@ -0,0 +1 @@
{ "component": true, "usingComponents": {} }

View File

@@ -0,0 +1,7 @@
<view class="uni-countdown data-v-edf646b4">
<text class="uni-countdown__number data-v-edf646b4" style="{{b}}">{{a}}</text>
<text class="uni-countdown__splitor data-v-edf646b4" style="{{c}}">分</text>
<text class="uni-countdown__number data-v-edf646b4" style="{{e}}">{{d}}</text>
<text class="uni-countdown__splitor data-v-edf646b4" style="{{f}}">秒</text>
<text class="uni-countdown__number data-v-edf646b4" style="{{h}}">{{g}}</text>
</view>

View File

@@ -0,0 +1,17 @@
.uni-countdown.data-v-edf646b4 {
align-items: center;
display: -webkit-flex;
display: flex;
flex-direction: row;
justify-content: flex-start;
}
.uni-countdown__splitor.data-v-edf646b4 {
color: #333;
font-size: 14px;
margin: 0 2px;
}
.uni-countdown__number.data-v-edf646b4 {
border-radius: 3px;
font-size: 14px;
text-align: center;
}

View File

@@ -0,0 +1,253 @@
var e = require("../../../../common/vendor.js"),
t = {
name: "uni-data-select",
mixins: [e.Ws.mixinDatacom || {}],
props: {
localdata: {
type: Array,
default: function () {
return [];
},
},
value: { type: [String, Number], default: "" },
modelValue: { type: [String, Number], default: "" },
label: { type: String, default: "" },
placeholder: { type: String, default: "请选择" },
emptyTips: { type: String, default: "无选项" },
clear: { type: Boolean, default: !0 },
defItem: { type: Number, default: 0 },
disabled: { type: Boolean, default: !1 },
format: { type: String, default: "" },
},
data: function () {
return {
showSelector: !1,
current: "",
mixinDatacomResData: [],
apps: [],
channels: [],
cacheKey: "uni-data-select-lastSelectedValue",
};
},
created: function () {
var e = this;
(this.debounceGet = this.debounce(function () {
e.query();
}, 300)),
this.collection && !this.localdata.length && this.debounceGet();
},
computed: {
typePlaceholder: function () {
var e = this.placeholder,
t = {
"opendb-stat-app-versions": "版本",
"opendb-app-channels": "渠道",
"opendb-app-list": "应用",
}[this.collection];
return t ? e + t : e;
},
valueCom: function () {
return this.modelValue;
},
},
watch: {
localdata: {
immediate: !0,
handler: function (e, t) {
Array.isArray(e) && t !== e && (this.mixinDatacomResData = e);
},
},
valueCom: function (e, t) {
this.initDefVal();
},
mixinDatacomResData: {
immediate: !0,
handler: function (e) {
e.length && this.initDefVal();
},
},
},
methods: {
debounce: function (e) {
var t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: 100,
a = null;
return function () {
for (
var i = this, n = arguments.length, o = new Array(n), c = 0;
c < n;
c++
)
o[c] = arguments[c];
a && clearTimeout(a),
(a = setTimeout(function () {
e.apply(i, o);
}, t));
};
},
query: function () {
this.mixinDatacomEasyGet();
},
onMixinDatacomPropsChange: function () {
this.collection && this.debounceGet();
},
initDefVal: function () {
var e = "";
if (
(!this.valueCom && 0 !== this.valueCom) ||
this.isDisabled(this.valueCom)
) {
var t;
if ((this.collection && (t = this.getCache()), t || 0 === t)) e = t;
else {
var a = "";
this.defItem > 0 &&
this.defItem <= this.mixinDatacomResData.length &&
(a = this.mixinDatacomResData[this.defItem - 1].value),
(e = a);
}
(e || 0 === e) && this.emit(e);
} else e = this.valueCom;
var i = this.mixinDatacomResData.find(function (t) {
return t.value === e;
});
this.current = i ? this.formatItemName(i) : "";
},
isDisabled: function (e) {
var t = !1;
return (
this.mixinDatacomResData.forEach(function (a) {
a.value === e && (t = a.disable);
}),
t
);
},
clearVal: function () {
this.emit(""), this.collection && this.removeCache();
},
change: function (e) {
e.disable ||
((this.showSelector = !1),
(this.current = this.formatItemName(e)),
this.emit(e.value));
},
emit: function (e) {
this.$emit("input", e),
this.$emit("update:modelValue", e),
this.$emit("change", e),
this.collection && this.setCache(e);
},
toggleSelector: function () {
this.disabled || (this.showSelector = !this.showSelector);
},
formatItemName: function (e) {
var t = e.text,
a = e.value,
i = e.channel_code;
if (((i = i ? "(".concat(i, ")") : ""), this.format)) {
var n = "";
for (var o in ((n = this.format), e))
n = n.replace(new RegExp("{".concat(o, "}"), "g"), e[o]);
return n;
}
return this.collection.indexOf("app-list") > 0
? "".concat(t, "(").concat(a, ")")
: t || "未命名".concat(i);
},
getLoadData: function () {
return this.mixinDatacomResData;
},
getCurrentCacheKey: function () {
return this.collection;
},
getCache: function () {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.getCurrentCacheKey();
return (e.index.getStorageSync(this.cacheKey) || {})[t];
},
setCache: function (t) {
var a =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: this.getCurrentCacheKey(),
i = e.index.getStorageSync(this.cacheKey) || {};
(i[a] = t), e.index.setStorageSync(this.cacheKey, i);
},
removeCache: function () {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.getCurrentCacheKey(),
a = e.index.getStorageSync(this.cacheKey) || {};
delete a[t], e.index.setStorageSync(this.cacheKey, a);
},
},
};
Array || e.resolveComponent("uni-icons")(), Math;
var a = e._export_sfc(t, [
[
"render",
function (t, a, i, n, o, c) {
return e.e(
{ a: i.label },
i.label ? { b: e.t(i.label + "") } : {},
{ c: o.current },
o.current ? { d: e.t(o.current) } : { e: e.t(c.typePlaceholder) },
{ f: o.current && i.clear && !i.disabled },
o.current && i.clear && !i.disabled
? {
g: e.p({ type: "clear", color: "#c0c4cc", size: "20" }),
h: e.o(function () {
return c.clearVal && c.clearVal.apply(c, arguments);
}),
}
: {
i: e.p({
type: o.showSelector ? "top" : "bottom",
size: "14",
color: "#999",
}),
},
{
j: e.o(function () {
return c.toggleSelector && c.toggleSelector.apply(c, arguments);
}),
k: o.showSelector,
},
o.showSelector
? {
l: e.o(function () {
return c.toggleSelector && c.toggleSelector.apply(c, arguments);
}),
}
: {},
{ m: o.showSelector },
o.showSelector
? e.e(
{ n: 0 === o.mixinDatacomResData.length },
0 === o.mixinDatacomResData.length
? { o: e.t(i.emptyTips) }
: {
p: e.f(o.mixinDatacomResData, function (t, a, i) {
return {
a: e.t(c.formatItemName(t)),
b: t.disable ? 1 : "",
c: a,
d: e.o(function (e) {
return c.change(t);
}, a),
};
}),
}
)
: {},
{ q: i.disabled ? 1 : "", r: o.current ? 1 : "" }
);
},
],
]);
wx.createComponent(a);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
}
}

View File

@@ -0,0 +1,52 @@
<view class="uni-stat__select">
<label class="uni-label-text hide-on-phone" wx:if="{{a}}">{{b}}</label>
<view class="{{['uni-stat-box',r&&'uni-stat__actived']}}">
<view class="{{['uni-select',q&&'uni-select--disabled']}}">
<view bindtap="{{j}}" class="uni-select__input-box">
<view class="uni-select__input-text" wx:if="{{c}}">{{d}}</view>
<view
class="uni-select__input-text uni-select__input-placeholder"
wx:else
>{{e}}</view
>
<view catchtap="{{h}}" wx:if="{{f}}">
<uni-icons
bind:__l="__l"
uI="2211b7d3-0"
uP="{{g}}"
wx:if="{{g}}"
></uni-icons>
</view>
<view wx:else>
<uni-icons
bind:__l="__l"
uI="2211b7d3-1"
uP="{{i}}"
wx:if="{{i}}"
></uni-icons>
</view>
</view>
<view bindtap="{{l}}" class="uni-select--mask" wx:if="{{k}}"></view>
<view class="uni-select__selector" wx:if="{{m}}">
<view class="uni-popper__arrow"></view>
<scroll-view class="uni-select__selector-scroll" scrollY="true">
<view class="uni-select__selector-empty" wx:if="{{n}}">
<text>{{o}}</text>
</view>
<block wx:else>
<view
bindtap="{{item.d}}"
class="uni-select__selector-item"
wx:for="{{p}}"
wx:key="c"
>
<text class="{{[item.b&&'uni-select__selector__disabled']}}"
>{{item.a}}</text
>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,146 @@
@media screen and (max-width: 500px) {
.hide-on-phone {
display: none;
}
}
.uni-stat__select {
align-items: center;
box-sizing: border-box;
display: -webkit-flex;
display: flex;
}
.uni-stat-box,
.uni-stat__actived,
.uni-stat__select {
flex: 1;
width: 100%;
}
.uni-label-text {
color: #6a6a6a;
font-size: 14px;
font-weight: 700;
margin: auto 5px auto 0;
}
.uni-select {
align-items: center;
border: 1px solid #1f68e9;
border-radius: 8rpx;
box-sizing: border-box;
display: -webkit-flex;
display: flex;
flex: 1;
flex-direction: row;
font-size: 30rpx;
padding: 20rpx 30rpx;
position: relative;
user-select: none;
width: 100%;
}
.uni-select--disabled {
background-color: #f5f7fa;
cursor: not-allowed;
}
.uni-select__label {
color: #909399;
font-size: 16px;
padding-right: 10px;
}
.uni-select__input-box {
align-items: center;
display: -webkit-flex;
display: flex;
flex: 1;
flex-direction: row;
font-size: 30rpx;
position: relative;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
color: #909399;
font-size: 14px;
}
.uni-select__selector {
background-color: #fff;
border: 1px solid #ebeef5;
border-radius: 6px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
left: 0;
padding: 4px 0;
position: absolute;
top: calc(100% + 12px);
width: 100%;
z-index: 3;
}
.uni-select__selector-scroll {
box-sizing: border-box;
max-height: 200px;
}
.uni-select__selector-empty,
.uni-select__selector-item {
cursor: pointer;
display: -webkit-flex;
display: flex;
font-size: 30rpx;
padding: 20rpx 30rpx;
text-align: center;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
border-bottom: none;
}
.uni-select__selector__disabled {
cursor: default;
opacity: 0.4;
}
.uni-popper__arrow,
.uni-popper__arrow:after {
border: 6px solid transparent;
display: block;
height: 0;
position: absolute;
width: 0;
}
.uni-popper__arrow {
border-bottom-color: #ebeef5;
border-top-width: 0;
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
left: 10%;
margin-right: 3px;
top: -6px;
}
.uni-popper__arrow:after {
border-bottom-color: #fff;
border-top-width: 0;
content: " ";
margin-left: -6px;
top: 1px;
}
.uni-select__input-text {
color: #333;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.uni-select__input-placeholder {
color: #6a6a6a;
font-size: 30rpx;
}
.uni-select--mask {
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 2;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
var n = require("./icons.js"),
e = require("../../../../common/vendor.js"),
t = {
name: "UniIcons",
emits: ["click"],
props: {
type: { type: String, default: "" },
color: { type: String, default: "#333333" },
size: { type: [Number, String], default: 16 },
customPrefix: { type: String, default: "" },
},
data: function () {
return { icons: n.icons.glyphs };
},
computed: {
unicode: function () {
var n = this,
e = this.icons.find(function (e) {
return e.font_class === n.type;
});
return e ? unescape("%u".concat(e.unicode)) : "";
},
iconSize: function () {
return "number" == typeof (n = this.size) || /^[0-9]*$/g.test(n)
? n + "px"
: n;
var n;
},
},
methods: {
_onClick: function () {
this.$emit("click");
},
},
},
i = e._export_sfc(t, [
[
"render",
function (n, t, i, o, c, r) {
return {
a: i.color,
b: r.iconSize,
c: e.n("uniui-" + i.type),
d: e.n(i.customPrefix),
e: e.n(i.customPrefix ? i.type : ""),
f: e.o(function () {
return r._onClick && r._onClick.apply(r, arguments);
}),
};
},
],
]);
wx.createComponent(i);

View File

@@ -0,0 +1 @@
{ "component": true, "usingComponents": {} }

View File

@@ -0,0 +1,5 @@
<text
bindtap="{{f}}"
class="{{['uni-icons',c,d,e]}}"
style="{{'color:'+a+';'+'font-size:'+b}}"
></text>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
exports.messages = {
en: {
"uni-load-more.contentdown": "Pull up to show more",
"uni-load-more.contentrefresh": "loading...",
"uni-load-more.contentnomore": "No more data",
},
"zh-Hans": {
"uni-load-more.contentdown": "上拉显示更多",
"uni-load-more.contentrefresh": "正在加载...",
"uni-load-more.contentnomore": "没有更多数据了",
},
"zh-Hant": {
"uni-load-more.contentdown": "上拉顯示更多",
"uni-load-more.contentrefresh": "正在加載...",
"uni-load-more.contentnomore": "沒有更多數據了",
},
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{ "component": true, "usingComponents": {} }

View File

@@ -0,0 +1,30 @@
<view bindtap="{{q}}" class="uni-load-more">
<view
class="uni-load-more__img uni-load-more__img--android-MP"
style="{{'width:'+h+';'+'height:'+i}}"
wx:if="{{a}}"
>
<view
class="uni-load-more__img-icon"
style="{{'border-top-color:'+b+';'+'border-top-width:'+c}}"
></view>
<view
class="uni-load-more__img-icon"
style="{{'border-top-color:'+d+';'+'border-top-width:'+e}}"
></view>
<view
class="uni-load-more__img-icon"
style="{{'border-top-color:'+f+';'+'border-top-width:'+g}}"
></view>
</view>
<view
class="uni-load-more__img uni-load-more__img--ios-H5"
style="{{'width:'+l+';'+'height:'+m}}"
wx:elif="{{j}}"
>
<image mode="widthFix" src="{{k}}"></image>
</view>
<text class="uni-load-more__text" style="{{'color:'+p}}" wx:if="{{n}}"
>{{o}}</text
>
</view>

View File

@@ -0,0 +1,228 @@
.uni-load-more {
align-items: center;
display: -webkit-flex;
display: flex;
flex-direction: row;
justify-content: center;
}
.uni-load-more__text {
font-size: 14px;
margin-left: 8px;
}
.uni-load-more__img {
height: 24px;
width: 24px;
}
.uni-load-more__img--nvue {
color: #666;
}
.uni-load-more__img--android,
.uni-load-more__img--ios {
height: 24px;
transform: rotate(0);
width: 24px;
}
.uni-load-more__img--android {
animation: loading-ios 1s linear 0s infinite;
}
.uni-load-more__img--ios-H5 {
animation: loading-ios-H5 1s step-end 0s infinite;
position: relative;
}
.uni-load-more__img--ios-H5 image {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
@-webkit-keyframes loading-ios-H5 {
0% {
transform: rotate(0);
}
8% {
transform: rotate(30deg);
}
16% {
transform: rotate(60deg);
}
24% {
transform: rotate(90deg);
}
32% {
transform: rotate(120deg);
}
40% {
transform: rotate(150deg);
}
48% {
transform: rotate(180deg);
}
56% {
transform: rotate(210deg);
}
64% {
transform: rotate(240deg);
}
73% {
transform: rotate(270deg);
}
82% {
transform: rotate(300deg);
}
91% {
transform: rotate(330deg);
}
to {
transform: rotate(1turn);
}
}
@keyframes loading-ios-H5 {
0% {
transform: rotate(0);
}
8% {
transform: rotate(30deg);
}
16% {
transform: rotate(60deg);
}
24% {
transform: rotate(90deg);
}
32% {
transform: rotate(120deg);
}
40% {
transform: rotate(150deg);
}
48% {
transform: rotate(180deg);
}
56% {
transform: rotate(210deg);
}
64% {
transform: rotate(240deg);
}
73% {
transform: rotate(270deg);
}
82% {
transform: rotate(300deg);
}
91% {
transform: rotate(330deg);
}
to {
transform: rotate(1turn);
}
}
.uni-load-more__img--android-MP {
animation: loading-ios 1s ease 0s infinite;
height: 24px;
position: relative;
transform: rotate(0);
width: 24px;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon {
border: 2px solid transparent;
border-radius: 50%;
border-top-color: #777;
box-sizing: border-box;
height: 100%;
position: absolute;
transform-origin: center;
width: 100%;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(1) {
animation: loading-android-MP-1 1s linear 0s infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(2) {
animation: loading-android-MP-2 1s linear 0s infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(3) {
animation: loading-android-MP-3 1s linear 0s infinite;
}
@-webkit-keyframes loading-android {
0% {
transform: rotate(0);
}
to {
transform: rotate(1turn);
}
}
@keyframes loading-android {
0% {
transform: rotate(0);
}
to {
transform: rotate(1turn);
}
}
@-webkit-keyframes loading-android-MP-1 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(90deg);
}
to {
transform: rotate(1turn);
}
}
@keyframes loading-android-MP-1 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(90deg);
}
to {
transform: rotate(1turn);
}
}
@-webkit-keyframes loading-android-MP-2 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(1turn);
}
}
@keyframes loading-android-MP-2 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(1turn);
}
}
@-webkit-keyframes loading-android-MP-3 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(270deg);
}
to {
transform: rotate(1turn);
}
}
@keyframes loading-android-MP-3 {
0% {
transform: rotate(0);
}
50% {
transform: rotate(270deg);
}
to {
transform: rotate(1turn);
}
}

View File

@@ -0,0 +1,288 @@
var t = require("../../../../common/vendor.js"),
o = {
name: "uniPopup",
components: {},
emits: ["change", "maskClick"],
props: {
animation: { type: Boolean, default: !0 },
type: { type: String, default: "center" },
isMaskClick: { type: Boolean, default: null },
maskClick: { type: Boolean, default: null },
backgroundColor: { type: String, default: "none" },
safeArea: { type: Boolean, default: !0 },
maskBackgroundColor: { type: String, default: "rgba(0, 0, 0, 0.4)" },
},
watch: {
type: {
handler: function (t) {
this.config[t] && this[this.config[t]](!0);
},
immediate: !0,
},
isDesktop: {
handler: function (t) {
this.config[t] && this[this.config[this.type]](!0);
},
immediate: !0,
},
maskClick: {
handler: function (t) {
this.mkclick = t;
},
immediate: !0,
},
isMaskClick: {
handler: function (t) {
this.mkclick = t;
},
immediate: !0,
},
showPopup: function (t) {},
},
data: function () {
return {
duration: 300,
ani: [],
showPopup: !1,
showTrans: !1,
popupWidth: 0,
popupHeight: 0,
config: {
top: "top",
bottom: "bottom",
center: "center",
left: "left",
right: "right",
message: "top",
dialog: "center",
share: "bottom",
},
maskClass: {
position: "fixed",
bottom: 0,
top: 0,
left: 0,
right: 0,
backgroundColor: "rgba(0, 0, 0, 0.4)",
},
transClass: { position: "fixed", left: 0, right: 0 },
maskShow: !0,
mkclick: !0,
popupstyle: this.isDesktop ? "fixforpc-top" : "top",
};
},
computed: {
isDesktop: function () {
return this.popupWidth >= 500 && this.popupHeight >= 500;
},
bg: function () {
return "" === this.backgroundColor || "none" === this.backgroundColor
? "transparent"
: this.backgroundColor;
},
},
mounted: function () {
var o = this;
!(function () {
var i = t.index.getSystemInfoSync(),
s = i.windowWidth,
e = i.windowHeight,
n = i.windowTop,
a = i.safeArea,
h = i.screenHeight;
i.safeAreaInsets;
(o.popupWidth = s),
(o.popupHeight = e + (n || 0)),
a && o.safeArea
? (o.safeAreaInsets = h - a.bottom)
: (o.safeAreaInsets = 0);
})();
},
unmounted: function () {
this.setH5Visible();
},
created: function () {
null === this.isMaskClick && null === this.maskClick
? (this.mkclick = !0)
: (this.mkclick =
null !== this.isMaskClick ? this.isMaskClick : this.maskClick),
this.animation ? (this.duration = 300) : (this.duration = 0),
(this.messageChild = null),
(this.clearPropagation = !1),
(this.maskClass.backgroundColor = this.maskBackgroundColor);
},
methods: {
setH5Visible: function () {},
closeMask: function () {
this.maskShow = !1;
},
disableMask: function () {
this.mkclick = !1;
},
clear: function (t) {
t.stopPropagation(), (this.clearPropagation = !0);
},
open: function (t) {
this.showPopup ||
((t &&
-1 !==
[
"top",
"center",
"bottom",
"left",
"right",
"message",
"dialog",
"share",
].indexOf(t)) ||
(t = this.type),
this.config[t]
? (this[this.config[t]](),
this.$emit("change", { show: !0, type: t }))
: console.error("缺少类型:", t));
},
close: function (t) {
var o = this;
(this.showTrans = !1),
this.$emit("change", { show: !1, type: this.type }),
clearTimeout(this.timer),
(this.timer = setTimeout(function () {
o.showPopup = !1;
}, 300));
},
touchstart: function () {
this.clearPropagation = !1;
},
onTap: function () {
this.clearPropagation
? (this.clearPropagation = !1)
: (this.$emit("maskClick"), this.mkclick && this.close());
},
top: function (t) {
var o = this;
(this.popupstyle = this.isDesktop ? "fixforpc-top" : "top"),
(this.ani = ["slide-top"]),
(this.transClass = {
position: "fixed",
left: 0,
right: 0,
backgroundColor: this.bg,
}),
t ||
((this.showPopup = !0),
(this.showTrans = !0),
this.$nextTick(function () {
o.messageChild &&
"message" === o.type &&
o.messageChild.timerClose();
}));
},
bottom: function (t) {
(this.popupstyle = "bottom"),
(this.ani = ["slide-bottom"]),
(this.transClass = {
position: "fixed",
left: 0,
right: 0,
bottom: 0,
paddingBottom: this.safeAreaInsets + "px",
backgroundColor: this.bg,
}),
t || ((this.showPopup = !0), (this.showTrans = !0));
},
center: function (t) {
(this.popupstyle = "center"),
(this.ani = ["zoom-out", "fade"]),
(this.transClass = {
position: "fixed",
display: "flex",
flexDirection: "column",
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: "center",
alignItems: "center",
}),
t || ((this.showPopup = !0), (this.showTrans = !0));
},
left: function (t) {
(this.popupstyle = "left"),
(this.ani = ["slide-left"]),
(this.transClass = {
position: "fixed",
left: 0,
bottom: 0,
top: 0,
backgroundColor: this.bg,
display: "flex",
flexDirection: "column",
}),
t || ((this.showPopup = !0), (this.showTrans = !0));
},
right: function (t) {
(this.popupstyle = "right"),
(this.ani = ["slide-right"]),
(this.transClass = {
position: "fixed",
bottom: 0,
right: 0,
top: 0,
backgroundColor: this.bg,
display: "flex",
flexDirection: "column",
}),
t || ((this.showPopup = !0), (this.showTrans = !0));
},
},
};
Array || t.resolveComponent("uni-transition")(), Math;
var i = t._export_sfc(o, [
[
"render",
function (o, i, s, e, n, a) {
return t.e(
{ a: n.showPopup },
n.showPopup
? t.e(
{ b: n.maskShow },
n.maskShow
? {
c: t.o(a.onTap),
d: t.p({
name: "mask",
"mode-class": "fade",
styles: n.maskClass,
duration: n.duration,
show: n.showTrans,
}),
}
: {},
{
e: a.bg,
f: t.n(n.popupstyle),
g: t.o(function () {
return a.clear && a.clear.apply(a, arguments);
}),
h: t.o(a.onTap),
i: t.p({
"mode-class": n.ani,
name: "content",
styles: n.transClass,
duration: n.duration,
show: n.showTrans,
}),
j: t.o(function () {
return a.touchstart && a.touchstart.apply(a, arguments);
}),
k: t.n(n.popupstyle),
l: t.n(a.isDesktop ? "fixforpc-z-index" : ""),
}
)
: {}
);
},
],
]);
wx.createComponent(i);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uni-transition": "../../../uni-transition/components/uni-transition/uni-transition"
}
}

View File

@@ -0,0 +1,29 @@
<view class="{{['uni-popup',k,l]}}" wx:if="{{a}}">
<view bindtouchstart="{{j}}">
<uni-transition
bind:__l="__l"
bindclick="{{c}}"
key="1"
uI="1d6c42a0-0"
uP="{{d}}"
wx:if="{{b}}"
></uni-transition>
<uni-transition
bind:__l="__l"
bindclick="{{h}}"
key="2"
uI="1d6c42a0-1"
uP="{{i}}"
uS="{{['d']}}"
wx:if="{{i}}"
>
<view
bindtap="{{g}}"
class="{{['uni-popup__wrapper',f]}}"
style="{{'background-color:'+e}}"
>
<slot></slot>
</view>
</uni-transition>
</view>
</view>

View File

@@ -0,0 +1,24 @@
.uni-popup {
position: fixed;
z-index: 99;
}
.uni-popup.left,
.uni-popup.right,
.uni-popup.top {
top: 0;
}
.uni-popup .uni-popup__wrapper {
display: block;
position: relative;
}
.uni-popup .uni-popup__wrapper.left,
.uni-popup .uni-popup__wrapper.right {
flex: 1;
padding-top: 0;
}
.fixforpc-z-index {
z-index: 999;
}
.fixforpc-top {
top: 0;
}

View File

@@ -0,0 +1,136 @@
require("../../../../@babel/runtime/helpers/Arrayincludes");
var t = require("../../../../@babel/runtime/helpers/objectSpread2"),
e = require("../../../../@babel/runtime/helpers/classCallCheck"),
n = require("../../../../@babel/runtime/helpers/createClass"),
i = require("../../../../common/vendor.js"),
a = (function () {
function a(n, r) {
e(this, a),
(this.options = n),
(this.animation = i.index.createAnimation(t({}, n))),
(this.currentStepAnimates = {}),
(this.next = 0),
(this.$ = r);
}
return (
n(a, [
{
key: "_nvuePushAnimates",
value: function (t, e) {
var n = {};
if (
((n = this.currentStepAnimates[this.next] || {
styles: {},
config: {},
}),
r.includes(t))
) {
n.styles.transform || (n.styles.transform = "");
var i = "";
"rotate" === t && (i = "deg"),
(n.styles.transform += "".concat(t, "(").concat(e + i, ") "));
} else n.styles[t] = "".concat(e);
this.currentStepAnimates[this.next] = n;
},
},
{
key: "_animateRun",
value: function () {
var e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: {},
n =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: {},
i = this.$.$refs.ani.ref;
if (i)
return new Promise(function (a, r) {
nvueAnimation.transition(i, t({ styles: e }, n), function (t) {
a();
});
});
},
},
{
key: "_nvueNextAnimate",
value: function (t) {
var e = this,
n =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: 0,
i = arguments.length > 2 ? arguments[2] : void 0,
a = t[n];
if (a) {
var r = a.styles,
s = a.config;
this._animateRun(r, s).then(function () {
(n += 1), e._nvueNextAnimate(t, n, i);
});
} else
(this.currentStepAnimates = {}),
"function" == typeof i && i(),
(this.isEnd = !0);
},
},
{
key: "step",
value: function () {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: {};
return this.animation.step(t), this;
},
},
{
key: "run",
value: function (t) {
(this.$.animationData = this.animation.export()),
(this.$.timer = setTimeout(function () {
"function" == typeof t && t();
}, this.$.durationTime));
},
},
]),
a
);
})(),
r = [
"matrix",
"matrix3d",
"rotate",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"scale",
"scale3d",
"scaleX",
"scaleY",
"scaleZ",
"skew",
"skewX",
"skewY",
"translate",
"translate3d",
"translateX",
"translateY",
"translateZ",
];
r
.concat(
["opacity", "backgroundColor"],
["width", "height", "left", "right", "top", "bottom"]
)
.forEach(function (t) {
a.prototype[t] = function () {
var e;
return (e = this.animation)[t].apply(e, arguments), this;
};
}),
(exports.createAnimation = function (t, e) {
if (e) return clearTimeout(e.timer), new a(t, e);
});

View File

@@ -0,0 +1,226 @@
var t = require("../../../../@babel/runtime/helpers/toConsumableArray"),
i = require("../../../../@babel/runtime/helpers/typeof"),
n = require("../../../../@babel/runtime/helpers/objectSpread2"),
a = require("./createAnimation.js"),
o = require("../../../../common/vendor.js"),
e = {
name: "uniTransition",
emits: ["click", "change"],
props: {
show: { type: Boolean, default: !1 },
modeClass: {
type: [Array, String],
default: function () {
return "fade";
},
},
duration: { type: Number, default: 300 },
styles: {
type: Object,
default: function () {
return {};
},
},
customClass: { type: String, default: "" },
onceRender: { type: Boolean, default: !1 },
},
data: function () {
return {
isShow: !1,
transform: "",
opacity: 1,
animationData: {},
durationTime: 300,
config: {},
};
},
watch: {
show: {
handler: function (t) {
t ? this.open() : this.isShow && this.close();
},
immediate: !0,
},
},
computed: {
stylesObject: function () {
var t = n(
n({}, this.styles),
{},
{ "transition-duration": this.duration / 1e3 + "s" }
),
i = "";
for (var a in t) i += this.toLine(a) + ":" + t[a] + ";";
return i;
},
transformStyles: function () {
return (
"transform:" +
this.transform +
";opacity:" +
this.opacity +
";" +
this.stylesObject
);
},
},
created: function () {
(this.config = {
duration: this.duration,
timingFunction: "ease",
transformOrigin: "50% 50%",
delay: 0,
}),
(this.durationTime = this.duration);
},
methods: {
init: function () {
var t =
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
t.duration && (this.durationTime = t.duration),
(this.animation = a.createAnimation(
Object.assign(this.config, t),
this
));
},
onClick: function () {
this.$emit("click", { detail: this.isShow });
},
step: function (n) {
var a =
arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (this.animation) {
for (var o in n)
try {
var e;
"object" == i(n[o])
? (e = this.animation)[o].apply(e, t(n[o]))
: this.animation[o](n[o]);
} catch (t) {
console.error("方法 ".concat(o, " 不存在"));
}
return this.animation.step(a), this;
}
},
run: function (t) {
this.animation && this.animation.run(t);
},
open: function () {
var t = this;
clearTimeout(this.timer), (this.transform = ""), (this.isShow = !0);
var i = this.styleInit(!1),
n = i.opacity,
o = i.transform;
void 0 !== n && (this.opacity = n),
(this.transform = o),
this.$nextTick(function () {
t.timer = setTimeout(function () {
(t.animation = a.createAnimation(t.config, t)),
t.tranfromInit(!1).step(),
t.animation.run(),
t.$emit("change", { detail: t.isShow });
}, 20);
});
},
close: function (t) {
var i = this;
this.animation &&
this.tranfromInit(!0)
.step()
.run(function () {
(i.isShow = !1), (i.animationData = null), (i.animation = null);
var t = i.styleInit(!1),
n = t.opacity,
a = t.transform;
(i.opacity = n || 1),
(i.transform = a),
i.$emit("change", { detail: i.isShow });
});
},
styleInit: function (t) {
var i = this,
n = { transform: "" },
a = function (t, a) {
"fade" === a
? (n.opacity = i.animationType(t)[a])
: (n.transform += i.animationType(t)[a] + " ");
};
return (
"string" == typeof this.modeClass
? a(t, this.modeClass)
: this.modeClass.forEach(function (i) {
a(t, i);
}),
n
);
},
tranfromInit: function (t) {
var i = this,
n = function (t, n) {
var a = null;
"fade" === n
? (a = t ? 0 : 1)
: ((a = t ? "-100%" : "0"),
"zoom-in" === n && (a = t ? 0.8 : 1),
"zoom-out" === n && (a = t ? 1.2 : 1),
"slide-right" === n && (a = t ? "100%" : "0"),
"slide-bottom" === n && (a = t ? "100%" : "0")),
i.animation[i.animationMode()[n]](a);
};
return (
"string" == typeof this.modeClass
? n(t, this.modeClass)
: this.modeClass.forEach(function (i) {
n(t, i);
}),
this.animation
);
},
animationType: function (t) {
return {
fade: t ? 1 : 0,
"slide-top": "translateY(".concat(t ? "0" : "-100%", ")"),
"slide-right": "translateX(".concat(t ? "0" : "100%", ")"),
"slide-bottom": "translateY(".concat(t ? "0" : "100%", ")"),
"slide-left": "translateX(".concat(t ? "0" : "-100%", ")"),
"zoom-in": "scaleX("
.concat(t ? 1 : 0.8, ") scaleY(")
.concat(t ? 1 : 0.8, ")"),
"zoom-out": "scaleX("
.concat(t ? 1 : 1.2, ") scaleY(")
.concat(t ? 1 : 1.2, ")"),
};
},
animationMode: function () {
return {
fade: "opacity",
"slide-top": "translateY",
"slide-right": "translateX",
"slide-bottom": "translateY",
"slide-left": "translateX",
"zoom-in": "scale",
"zoom-out": "scale",
};
},
toLine: function (t) {
return t.replace(/([A-Z])/g, "-$1").toLowerCase();
},
},
},
s = o._export_sfc(e, [
[
"render",
function (t, i, n, a, e, s) {
return {
a: e.isShow,
b: e.animationData,
c: o.n(n.customClass),
d: o.s(s.transformStyles),
e: o.o(function () {
return s.onClick && s.onClick.apply(s, arguments);
}),
};
},
],
]);
wx.createComponent(s);

View File

@@ -0,0 +1 @@
{ "component": true, "usingComponents": {} }

View File

@@ -0,0 +1,10 @@
<view
animation="{{b}}"
bindtap="{{e}}"
class="{{c}}"
hidden="{{!a}}"
ref="ani"
style="{{d}}"
>
<slot></slot>
</view>