feat:初始提交uni-app项目

This commit is contained in:
2026-01-14 18:19:33 +08:00
commit 0dcbd340e6
515 changed files with 38560 additions and 0 deletions

View File

@@ -0,0 +1,269 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_mpHtml_components_mpHtml_parser = require("./parser.js");
const node = () => "./node/node.js";
const plugins = [];
const _sfc_main = {
name: "mp-html",
data() {
return {
nodes: []
};
},
props: {
containerStyle: {
type: String,
default: ""
},
content: {
type: String,
default: ""
},
copyLink: {
type: [Boolean, String],
default: true
},
domain: String,
errorImg: {
type: String,
default: ""
},
lazyLoad: {
type: [Boolean, String],
default: false
},
loadingImg: {
type: String,
default: ""
},
pauseVideo: {
type: [Boolean, String],
default: true
},
previewImg: {
type: [Boolean, String],
default: true
},
scrollTable: [Boolean, String],
selectable: [Boolean, String],
setTitle: {
type: [Boolean, String],
default: true
},
showImgMenu: {
type: [Boolean, String],
default: true
},
tagStyle: Object,
useAnchor: [Boolean, Number]
},
emits: ["load", "ready", "imgtap", "linktap", "play", "error"],
components: {
node
},
watch: {
content(content) {
this.setContent(content);
}
},
created() {
this.plugins = [];
for (let i = plugins.length; i--; ) {
this.plugins.push(new plugins[i](this));
}
},
mounted() {
if (this.content && !this.nodes.length) {
this.setContent(this.content);
}
},
beforeDestroy() {
this._hook("onDetached");
},
methods: {
/**
* @description 将锚点跳转的范围限定在一个 scroll-view 内
* @param {Object} page scroll-view 所在页面的示例
* @param {String} selector scroll-view 的选择器
* @param {String} scrollTop scroll-view scroll-top 属性绑定的变量名
*/
in(page, selector, scrollTop) {
if (page && selector && scrollTop) {
this._in = {
page,
selector,
scrollTop
};
}
},
/**
* @description 锚点跳转
* @param {String} id 要跳转的锚点 id
* @param {Number} offset 跳转位置的偏移量
* @returns {Promise}
*/
navigateTo(id, offset) {
return new Promise((resolve, reject) => {
if (!this.useAnchor) {
reject(Error("Anchor is disabled"));
return;
}
offset = offset || parseInt(this.useAnchor) || 0;
let deep = " ";
deep = ">>>";
const selector = common_vendor.index.createSelectorQuery().in(this._in ? this._in.page : this).select((this._in ? this._in.selector : "._root") + (id ? `${deep}#${id}` : "")).boundingClientRect();
if (this._in) {
selector.select(this._in.selector).scrollOffset().select(this._in.selector).boundingClientRect();
} else {
selector.selectViewport().scrollOffset();
}
selector.exec((res) => {
if (!res[0]) {
reject(Error("Label not found"));
return;
}
const scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset;
if (this._in) {
this._in.page[this._in.scrollTop] = scrollTop;
} else {
common_vendor.index.pageScrollTo({
scrollTop,
duration: 300
});
}
resolve();
});
});
},
/**
* @description 获取文本内容
* @return {String}
*/
getText(nodes) {
let text = "";
(function traversal(nodes2) {
for (let i = 0; i < nodes2.length; i++) {
const node2 = nodes2[i];
if (node2.type === "text") {
text += node2.text.replace(/&amp;/g, "&");
} else if (node2.name === "br") {
text += "\n";
} else {
const isBlock = node2.name === "p" || node2.name === "div" || node2.name === "tr" || node2.name === "li" || node2.name[0] === "h" && node2.name[1] > "0" && node2.name[1] < "7";
if (isBlock && text && text[text.length - 1] !== "\n") {
text += "\n";
}
if (node2.children) {
traversal(node2.children);
}
if (isBlock && text[text.length - 1] !== "\n") {
text += "\n";
} else if (node2.name === "td" || node2.name === "th") {
text += " ";
}
}
}
})(nodes || this.nodes);
return text;
},
/**
* @description 获取内容大小和位置
* @return {Promise}
*/
getRect() {
return new Promise((resolve, reject) => {
common_vendor.index.createSelectorQuery().in(this).select("#_root").boundingClientRect().exec((res) => res[0] ? resolve(res[0]) : reject(Error("Root label not found")));
});
},
/**
* @description 暂停播放媒体
*/
pauseMedia() {
for (let i = (this._videos || []).length; i--; ) {
this._videos[i].pause();
}
},
/**
* @description 设置媒体播放速率
* @param {Number} rate 播放速率
*/
setPlaybackRate(rate) {
this.playbackRate = rate;
for (let i = (this._videos || []).length; i--; ) {
this._videos[i].playbackRate(rate);
}
},
/**
* @description 设置内容
* @param {String} content html 内容
* @param {Boolean} append 是否在尾部追加
*/
setContent(content, append) {
if (!append || !this.imgList) {
this.imgList = [];
}
const nodes = new uni_modules_mpHtml_components_mpHtml_parser.Parser(this).parse(content);
this.$set(this, "nodes", append ? (this.nodes || []).concat(nodes) : nodes);
this._videos = [];
this.$nextTick(() => {
this._hook("onLoad");
this.$emit("load");
});
if (this.lazyLoad || this.imgList._unloadimgs < this.imgList.length / 2) {
let height = 0;
const callback = (rect) => {
if (!rect || !rect.height)
rect = {};
if (rect.height === height) {
this.$emit("ready", rect);
} else {
height = rect.height;
setTimeout(() => {
this.getRect().then(callback).catch(callback);
}, 350);
}
};
this.getRect().then(callback).catch(callback);
} else {
if (!this.imgList._unloadimgs) {
this.getRect().then((rect) => {
this.$emit("ready", rect);
}).catch(() => {
this.$emit("ready", {});
});
}
}
},
/**
* @description 调用插件钩子函数
*/
_hook(name) {
for (let i = plugins.length; i--; ) {
if (this.plugins[i][name]) {
this.plugins[i][name]();
}
}
}
}
};
if (!Array) {
const _component_node = common_vendor.resolveComponent("node");
_component_node();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: !$data.nodes[0]
}, !$data.nodes[0] ? {} : {
b: common_vendor.p({
childs: $data.nodes,
opts: [$props.lazyLoad, $props.loadingImg, $props.errorImg, $props.showImgMenu, $props.selectable],
name: "span"
})
}, {
c: common_vendor.n(($props.selectable ? "_select " : "") + "_root"),
d: common_vendor.s($props.containerStyle)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/mp-html/components/mp-html/mp-html.js.map

View File

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

View File

@@ -0,0 +1 @@
<view id="_root" class="{{c}}" style="{{d}}"><slot wx:if="{{a}}"/><node wx:else u-i="305b9be7-0" bind:__l="__l" u-p="{{b||''}}"/></view>

View File

@@ -0,0 +1,16 @@
/* 根节点样式 */
._root {
padding: 1px 0;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}
/* 长按复制 */
._select {
-webkit-user-select: text;
user-select: text;
}

View File

@@ -0,0 +1,404 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const block0 = {};
const node = () => Promise.resolve().then(() => RDovY29kaW5nIHNvZnR3YXJlL0hCdWlsZGVyWC91bmlhcHBfdnVlM19jb2RlL3dhbGxwYXBlci1rdC91bmlfbW9kdWxlcy9tcC1odG1sL2NvbXBvbmVudHMvbXAtaHRtbC9ub2RlL25vZGUudnVl);
const _sfc_main = {
name: "node",
options: {
virtualHost: true
},
data() {
return {
ctrl: {},
isiOS: common_vendor.index.getSystemInfoSync().system.includes("iOS")
};
},
props: {
name: String,
attrs: {
type: Object,
default() {
return {};
}
},
childs: Array,
opts: Array
},
components: {
node
},
mounted() {
this.$nextTick(() => {
for (this.root = this.$parent; this.root.$options.name !== "mp-html"; this.root = this.root.$parent)
;
});
},
beforeDestroy() {
},
methods: {
toJSON() {
return this;
},
/**
* @description 播放视频事件
* @param {Event} e
*/
play(e) {
const i = e.currentTarget.dataset.i;
const node2 = this.childs[i];
this.root.$emit("play", {
source: node2.name,
attrs: {
...node2.attrs,
src: node2.src[this.ctrl[i] || 0]
}
});
if (this.root.pauseVideo) {
let flag = false;
const id = e.target.id;
for (let i2 = this.root._videos.length; i2--; ) {
if (this.root._videos[i2].id === id) {
flag = true;
} else {
this.root._videos[i2].pause();
}
}
if (!flag) {
const ctx = common_vendor.index.createVideoContext(
id,
this
);
ctx.id = id;
if (this.root.playbackRate) {
ctx.playbackRate(this.root.playbackRate);
}
this.root._videos.push(ctx);
}
}
},
/**
* @description 图片点击事件
* @param {Event} e
*/
imgTap(e) {
const node2 = this.childs[e.currentTarget.dataset.i];
if (node2.a) {
this.linkTap(node2.a);
return;
}
if (node2.attrs.ignore)
return;
this.root.$emit("imgtap", node2.attrs);
if (this.root.previewImg) {
common_vendor.index.previewImage({
showmenu: this.root.showImgMenu,
current: parseInt(node2.attrs.i),
urls: this.root.imgList
});
}
},
/**
* @description 图片长按
*/
imgLongTap(e) {
},
/**
* @description 图片加载完成事件
* @param {Event} e
*/
imgLoad(e) {
const i = e.currentTarget.dataset.i;
if (!this.childs[i].w) {
this.$set(this.ctrl, i, e.detail.width);
} else if (this.opts[1] && !this.ctrl[i] || this.ctrl[i] === -1) {
this.$set(this.ctrl, i, 1);
}
this.checkReady();
},
/**
* @description 检查是否所有图片加载完毕
*/
checkReady() {
if (this.root && !this.root.lazyLoad) {
this.root._unloadimgs -= 1;
if (!this.root._unloadimgs) {
setTimeout(() => {
this.root.getRect().then((rect) => {
this.root.$emit("ready", rect);
}).catch(() => {
this.root.$emit("ready", {});
});
}, 350);
}
}
},
/**
* @description 链接点击事件
* @param {Event} e
*/
linkTap(e) {
const node2 = e.currentTarget ? this.childs[e.currentTarget.dataset.i] : {};
const attrs = node2.attrs || e;
const href = attrs.href;
this.root.$emit("linktap", Object.assign({
innerText: this.root.getText(node2.children || [])
// 链接内的文本内容
}, attrs));
if (href) {
if (href[0] === "#") {
this.root.navigateTo(href.substring(1)).catch(() => {
});
} else if (href.split("?")[0].includes("://")) {
if (this.root.copyLink) {
common_vendor.index.setClipboardData({
data: href,
success: () => common_vendor.index.showToast({
title: "链接已复制"
})
});
}
} else {
common_vendor.index.navigateTo({
url: href,
fail() {
common_vendor.index.switchTab({
url: href,
fail() {
}
});
}
});
}
}
},
/**
* @description 错误事件
* @param {Event} e
*/
mediaError(e) {
const i = e.currentTarget.dataset.i;
const node2 = this.childs[i];
if (node2.name === "video" || node2.name === "audio") {
let index = (this.ctrl[i] || 0) + 1;
if (index > node2.src.length) {
index = 0;
}
if (index < node2.src.length) {
this.$set(this.ctrl, i, index);
return;
}
} else if (node2.name === "img") {
if (this.opts[2]) {
this.$set(this.ctrl, i, -1);
}
this.checkReady();
}
if (this.root) {
this.root.$emit("error", {
source: node2.name,
attrs: node2.attrs,
errMsg: e.detail.errMsg
});
}
}
}
};
if (!Array) {
const _component_node = common_vendor.resolveComponent("node");
_component_node();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($props.childs, (n, i, i0) => {
return common_vendor.e({
a: n.name === "img" && !n.t && ($props.opts[1] && !$data.ctrl[i] || $data.ctrl[i] < 0)
}, n.name === "img" && !n.t && ($props.opts[1] && !$data.ctrl[i] || $data.ctrl[i] < 0) ? {
b: common_vendor.s(n.attrs.style),
c: $data.ctrl[i] < 0 ? $props.opts[2] : $props.opts[1]
} : {}, {
d: n.name === "img" && n.t
}, n.name === "img" && n.t ? {
e: common_vendor.s("display:" + n.t),
f: [{
attrs: {
style: n.attrs.style || "",
src: n.attrs.src
},
name: "img"
}],
g: i,
h: common_vendor.o((...args) => $options.imgTap && $options.imgTap(...args), i)
} : n.name === "img" ? {
j: n.attrs.id,
k: common_vendor.n("_img " + n.attrs.class),
l: common_vendor.s(($data.ctrl[i] === -1 ? "display:none;" : "") + "width:" + ($data.ctrl[i] || 1) + "px;height:1px;" + n.attrs.style),
m: n.attrs.src,
n: !n.h ? "widthFix" : !n.w ? "heightFix" : n.m || "scaleToFill",
o: $props.opts[0],
p: n.webp,
q: $props.opts[3] && !n.attrs.ignore,
r: !$props.opts[3] || n.attrs.ignore,
s: i,
t: common_vendor.o((...args) => $options.imgLoad && $options.imgLoad(...args), i),
v: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args), i),
w: common_vendor.o((...args) => $options.imgTap && $options.imgTap(...args), i),
x: common_vendor.o((...args) => $options.imgLongTap && $options.imgLongTap(...args), i)
} : n.text ? {
z: common_vendor.t(n.text),
A: $props.opts[4] == "force" && $data.isiOS
} : n.name === "br" ? {} : n.name === "a" ? {
D: "0b985e7e-0-" + i0,
E: common_vendor.p({
name: "span",
childs: n.children,
opts: $props.opts
}),
F: n.attrs.id,
G: common_vendor.n((n.attrs.href ? "_a " : "") + n.attrs.class),
H: common_vendor.s("display:inline;" + n.attrs.style),
I: i,
J: common_vendor.o((...args) => $options.linkTap && $options.linkTap(...args), i)
} : n.name === "video" ? {
L: n.attrs.id,
M: common_vendor.n(n.attrs.class),
N: common_vendor.s(n.attrs.style),
O: n.attrs.autoplay,
P: n.attrs.controls,
Q: n.attrs.loop,
R: n.attrs.muted,
S: n.attrs["object-fit"],
T: n.attrs.poster,
U: n.src[$data.ctrl[i] || 0],
V: i,
W: common_vendor.o((...args) => $options.play && $options.play(...args), i),
X: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args), i)
} : n.name === "audio" ? {
Z: n.attrs.id,
aa: common_vendor.n(n.attrs.class),
ab: common_vendor.s(n.attrs.style),
ac: n.attrs.author,
ad: n.attrs.controls,
ae: n.attrs.loop,
af: n.attrs.name,
ag: n.attrs.poster,
ah: n.src[$data.ctrl[i] || 0],
ai: i,
aj: common_vendor.o((...args) => $options.play && $options.play(...args), i),
ak: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args), i)
} : n.name === "table" && n.c || n.name === "li" ? common_vendor.e({
am: n.name === "li"
}, n.name === "li" ? {
an: "0b985e7e-1-" + i0,
ao: common_vendor.p({
childs: n.children,
opts: $props.opts
})
} : {
ap: common_vendor.f(n.children, (tbody, x, i1) => {
return common_vendor.e({
a: tbody.name === "td" || tbody.name === "th"
}, tbody.name === "td" || tbody.name === "th" ? {
b: "0b985e7e-2-" + i0 + "-" + i1,
c: common_vendor.p({
childs: tbody.children,
opts: $props.opts
})
} : {
d: common_vendor.f(tbody.children, (tr, y, i2) => {
return common_vendor.e({
a: tr.name === "td" || tr.name === "th"
}, tr.name === "td" || tr.name === "th" ? {
b: "0b985e7e-3-" + i0 + "-" + i1 + "-" + i2,
c: common_vendor.p({
childs: tr.children,
opts: $props.opts
}),
d: common_vendor.n("_" + tr.name + " " + tr.attrs.class),
e: common_vendor.s(tr.attrs.style)
} : {
f: common_vendor.f(tr.children, (td, z, i3) => {
return {
a: "0b985e7e-4-" + i0 + "-" + i1 + "-" + i2 + "-" + i3,
b: common_vendor.p({
childs: td.children,
opts: $props.opts
}),
c: z,
d: common_vendor.n("_" + td.name + " " + td.attrs.class),
e: common_vendor.s(td.attrs.style)
};
}),
g: common_vendor.n("_" + tr.name + " " + tr.attrs.class),
h: common_vendor.s(tr.attrs.style)
}, {
i: y
});
})
}, {
e: x,
f: common_vendor.n("_" + tbody.name + " " + tbody.attrs.class),
g: common_vendor.s(tbody.attrs.style)
});
})
}, {
aq: n.attrs.id,
ar: common_vendor.n("_" + n.name + " " + n.attrs.class),
as: common_vendor.s(n.attrs.style)
}) : !n.c ? {
av: n.attrs.id,
aw: common_vendor.s("display:inline;" + n.f),
ax: $props.opts[4],
ay: $props.opts[4],
az: [n]
} : n.c === 2 ? {
aB: common_vendor.f(n.children, (n2, j, i1) => {
return {
a: j,
b: common_vendor.s(n2.f),
c: "0b985e7e-5-" + i0 + "-" + i1,
d: common_vendor.p({
name: n2.name,
attrs: n2.attrs,
childs: n2.children,
opts: $props.opts
})
};
}),
aC: n.attrs.id,
aD: common_vendor.n("_block _" + n.name + " " + n.attrs.class),
aE: common_vendor.s(n.f + ";" + n.attrs.style)
} : {
aF: common_vendor.s(n.f),
aG: "0b985e7e-6-" + i0,
aH: common_vendor.p({
name: n.name,
attrs: n.attrs,
childs: n.children,
opts: $props.opts
})
}, {
i: n.name === "img",
y: n.text,
B: n.name === "br",
C: n.name === "a",
K: n.name === "video",
Y: n.name === "audio",
al: n.name === "table" && n.c || n.name === "li",
at: !n.c,
aA: n.c === 2,
aI: i
});
}),
b: $props.attrs.id,
c: common_vendor.n("_block _" + $props.name + " " + $props.attrs.class),
d: common_vendor.s($props.attrs.style)
};
}
if (typeof block0 === "function")
block0(_sfc_main);
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
const RDovY29kaW5nIHNvZnR3YXJlL0hCdWlsZGVyWC91bmlhcHBfdnVlM19jb2RlL3dhbGxwYXBlci1rdC91bmlfbW9kdWxlcy9tcC1odG1sL2NvbXBvbmVudHMvbXAtaHRtbC9ub2RlL25vZGUudnVl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null
}, Symbol.toStringTag, { value: "Module" }));
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/mp-html/components/mp-html/node/node.js.map

View File

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

View File

@@ -0,0 +1,31 @@
<wxs module="handler">
// 行内标签列表
var inlineTags = {
abbr: true,
b: true,
big: true,
code: true,
del: true,
em: true,
i: true,
ins: true,
label: true,
q: true,
small: true,
span: true,
strong: true,
sub: true,
sup: true
}
/**
* @description 判断是否为行内标签
*/
module.exports = {
isInline: function (tagName, style) {
return inlineTags[tagName] || (style || '').indexOf('display:inline') !== -1
}
}
</wxs>
<view id="{{b}}" class="{{c}}" style="{{d}}"><block wx:for="{{a}}" wx:for-item="n" wx:key="aI"><image wx:if="{{n.a}}" class="_img" style="{{n.b}}" src="{{n.c}}" mode="widthFix"/><rich-text wx:if="{{n.d}}" style="{{n.e}}" nodes="{{n.f}}" data-i="{{n.g}}" catchtap="{{n.h}}"/><image wx:elif="{{n.i}}" id="{{n.j}}" class="{{n.k}}" style="{{n.l}}" src="{{n.m}}" mode="{{n.n}}" lazy-load="{{n.o}}" webp="{{n.p}}" show-menu-by-longpress="{{n.q}}" image-menu-prevent="{{n.r}}" data-i="{{n.s}}" bindload="{{n.t}}" binderror="{{n.v}}" catchtap="{{n.w}}" bindlongpress="{{n.x}}"/><text wx:elif="{{n.y}}" user-select="{{n.A}}" decode>{{n.z}}</text><text wx:elif="{{n.B}}">\n</text><view wx:elif="{{n.C}}" id="{{n.F}}" class="{{n.G}}" hover-class="_hover" style="{{n.H}}" data-i="{{n.I}}" catchtap="{{n.J}}"><node wx:if="{{n.E}}" style="display:inherit" u-i="{{n.D}}" bind:__l="__l" u-p="{{n.E}}"/></view><video wx:elif="{{n.K}}" id="{{n.L}}" class="{{n.M}}" style="{{n.N}}" autoplay="{{n.O}}" controls="{{n.P}}" loop="{{n.Q}}" muted="{{n.R}}" object-fit="{{n.S}}" poster="{{n.T}}" src="{{n.U}}" data-i="{{n.V}}" bindplay="{{n.W}}" binderror="{{n.X}}"/><audio wx:elif="{{n.Y}}" id="{{n.Z}}" class="{{n.aa}}" style="{{n.ab}}" author="{{n.ac}}" controls="{{n.ad}}" loop="{{n.ae}}" name="{{n.af}}" poster="{{n.ag}}" src="{{n.ah}}" data-i="{{n.ai}}" bindplay="{{n.aj}}" binderror="{{n.ak}}"/><view wx:elif="{{n.al}}" id="{{n.aq}}" class="{{n.ar}}" style="{{n.as}}"><node wx:if="{{n.am}}" u-i="{{n.an}}" bind:__l="__l" u-p="{{n.ao}}"/><block wx:else><view wx:for="{{n.ap}}" wx:for-item="tbody" wx:key="e" class="{{tbody.f}}" style="{{tbody.g}}"><node wx:if="{{tbody.a}}" u-i="{{tbody.b}}" bind:__l="__l" u-p="{{tbody.c}}"/><block wx:else><block wx:for="{{tbody.d}}" wx:for-item="tr" wx:key="i"><view wx:if="{{tr.a}}" class="{{tr.d}}" style="{{tr.e}}"><node wx:if="{{tr.c}}" u-i="{{tr.b}}" bind:__l="__l" u-p="{{tr.c}}"/></view><view wx:else class="{{tr.g}}" style="{{tr.h}}"><view wx:for="{{tr.f}}" wx:for-item="td" wx:key="c" class="{{td.d}}" style="{{td.e}}"><node wx:if="{{td.b}}" u-i="{{td.a}}" bind:__l="__l" u-p="{{td.b}}"/></view></view></block></block></view></block></view><rich-text wx:elif="{{n.at}}" id="{{n.av}}" style="{{n.aw}}" preview="{{false}}" selectable="{{n.ax}}" user-select="{{n.ay}}" nodes="{{n.az}}"/><view wx:elif="{{n.aA}}" id="{{n.aC}}" class="{{n.aD}}" style="{{n.aE}}"><node wx:for="{{n.aB}}" wx:for-item="n2" wx:key="a" style="{{n2.b}}" u-i="{{n2.c}}" bind:__l="__l" u-p="{{n2.d}}"/></view><node wx:else style="{{n.aF}}" u-i="{{n.aG}}" bind:__l="__l" u-p="{{n.aH||''}}"/></block></view>

View File

@@ -0,0 +1,143 @@
/* a 标签默认效果 */
._a {
padding: 1.5px 0 1.5px 0;
color: #366092;
word-break: break-all;
}
/* a 标签点击态效果 */
._hover {
text-decoration: underline;
opacity: 0.7;
}
/* 图片默认效果 */
._img {
max-width: 100%;
-webkit-touch-callout: none;
}
/* 内部样式 */
._block {
display: block;
}
._b,
._strong {
font-weight: bold;
}
._code {
font-family: monospace;
}
._del {
text-decoration: line-through;
}
._em,
._i {
font-style: italic;
}
._h1 {
font-size: 2em;
}
._h2 {
font-size: 1.5em;
}
._h3 {
font-size: 1.17em;
}
._h5 {
font-size: 0.83em;
}
._h6 {
font-size: 0.67em;
}
._h1,
._h2,
._h3,
._h4,
._h5,
._h6 {
display: block;
font-weight: bold;
}
._image {
height: 1px;
}
._ins {
text-decoration: underline;
}
._li {
display: list-item;
}
._ol {
list-style-type: decimal;
}
._ol,
._ul {
display: block;
padding-left: 40px;
margin: 1em 0;
}
._q::before {
content: '"';
}
._q::after {
content: '"';
}
._sub {
font-size: smaller;
vertical-align: sub;
}
._sup {
font-size: smaller;
vertical-align: super;
}
._thead,
._tbody,
._tfoot {
display: table-row-group;
}
._tr {
display: table-row;
}
._td,
._th {
display: table-cell;
vertical-align: middle;
}
._th {
font-weight: bold;
text-align: center;
}
._ul {
list-style-type: disc;
}
._ul ._ul {
margin: 0;
list-style-type: circle;
}
._ul ._ul ._ul {
list-style-type: square;
}
._abbr,
._b,
._code,
._del,
._em,
._i,
._ins,
._label,
._q,
._span,
._strong,
._sub,
._sup {
display: inline;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,195 @@
"use strict";
function pad(str, length = 2) {
str += "";
while (str.length < length) {
str = "0" + str;
}
return str.slice(-length);
}
const parser = {
yyyy: (dateObj) => {
return pad(dateObj.year, 4);
},
yy: (dateObj) => {
return pad(dateObj.year);
},
MM: (dateObj) => {
return pad(dateObj.month);
},
M: (dateObj) => {
return dateObj.month;
},
dd: (dateObj) => {
return pad(dateObj.day);
},
d: (dateObj) => {
return dateObj.day;
},
hh: (dateObj) => {
return pad(dateObj.hour);
},
h: (dateObj) => {
return dateObj.hour;
},
mm: (dateObj) => {
return pad(dateObj.minute);
},
m: (dateObj) => {
return dateObj.minute;
},
ss: (dateObj) => {
return pad(dateObj.second);
},
s: (dateObj) => {
return dateObj.second;
},
SSS: (dateObj) => {
return pad(dateObj.millisecond, 3);
},
S: (dateObj) => {
return dateObj.millisecond;
}
};
function getDate(time) {
if (time instanceof Date) {
return time;
}
switch (typeof time) {
case "string": {
if (time.indexOf("T") > -1) {
return new Date(time);
}
return new Date(time.replace(/-/g, "/"));
}
default:
return new Date(time);
}
}
function formatDate(date, format = "yyyy/MM/dd hh:mm:ss") {
if (!date && date !== 0) {
return "";
}
date = getDate(date);
const dateObj = {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds(),
millisecond: date.getMilliseconds()
};
const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;
let flag = true;
let result = format;
while (flag) {
flag = false;
result = result.replace(tokenRegExp, function(matched) {
flag = true;
return parser[matched](dateObj);
});
}
return result;
}
function friendlyDate(time, {
locale = "zh",
threshold = [6e4, 36e5],
format = "yyyy/MM/dd hh:mm:ss"
}) {
if (time === "-") {
return time;
}
if (!time && time !== 0) {
return "";
}
const localeText = {
zh: {
year: "年",
month: "月",
day: "天",
hour: "小时",
minute: "分钟",
second: "秒",
ago: "前",
later: "后",
justNow: "刚刚",
soon: "马上",
template: "{num}{unit}{suffix}"
},
en: {
year: "year",
month: "month",
day: "day",
hour: "hour",
minute: "minute",
second: "second",
ago: "ago",
later: "later",
justNow: "just now",
soon: "soon",
template: "{num} {unit} {suffix}"
}
};
const text = localeText[locale] || localeText.zh;
let date = getDate(time);
let ms = date.getTime() - Date.now();
let absMs = Math.abs(ms);
if (absMs < threshold[0]) {
return ms < 0 ? text.justNow : text.soon;
}
if (absMs >= threshold[1]) {
return formatDate(date, format);
}
let num;
let unit;
let suffix = text.later;
if (ms < 0) {
suffix = text.ago;
ms = -ms;
}
const seconds = Math.floor(ms / 1e3);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
const months = Math.floor(days / 30);
const years = Math.floor(months / 12);
switch (true) {
case years > 0:
num = years;
unit = text.year;
break;
case months > 0:
num = months;
unit = text.month;
break;
case days > 0:
num = days;
unit = text.day;
break;
case hours > 0:
num = hours;
unit = text.hour;
break;
case minutes > 0:
num = minutes;
unit = text.minute;
break;
default:
num = seconds;
unit = text.second;
break;
}
if (locale === "en") {
if (num === 1) {
num = "a";
} else {
unit += "s";
}
}
return text.template.replace(/{\s*num\s*}/g, num + "").replace(/{\s*unit\s*}/g, unit).replace(
/{\s*suffix\s*}/g,
suffix
);
}
exports.friendlyDate = friendlyDate;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js.map

View File

@@ -0,0 +1,77 @@
"use strict";
const uni_modules_uniDateformat_components_uniDateformat_dateFormat = require("./date-format.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "uniDateformat",
props: {
date: {
type: [Object, String, Number],
default() {
return "-";
}
},
locale: {
type: String,
default: "zh"
},
threshold: {
type: Array,
default() {
return [0, 0];
}
},
format: {
type: String,
default: "yyyy/MM/dd hh:mm:ss"
},
// refreshRate使用不当可能导致性能问题谨慎使用
refreshRate: {
type: [Number, String],
default: 0
}
},
data() {
return {
refreshMark: 0
};
},
computed: {
dateShow() {
this.refreshMark;
return uni_modules_uniDateformat_components_uniDateformat_dateFormat.friendlyDate(this.date, {
locale: this.locale,
threshold: this.threshold,
format: this.format
});
}
},
watch: {
refreshRate: {
handler() {
this.setAutoRefresh();
},
immediate: true
}
},
methods: {
refresh() {
this.refreshMark++;
},
setAutoRefresh() {
clearInterval(this.refreshInterval);
if (this.refreshRate) {
this.refreshInterval = setInterval(() => {
this.refresh();
}, parseInt(this.refreshRate));
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t($options.dateShow)
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.js.map

View File

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

View File

@@ -0,0 +1 @@
<text>{{a}}</text>

View File

@@ -0,0 +1,73 @@
"use strict";
const uni_modules_uniIcons_components_uniIcons_uniicons_file_vue = require("./uniicons_file_vue.js");
const common_vendor = require("../../../../common/vendor.js");
const getVal = (val) => {
const reg = /^[0-9]*$/g;
return typeof val === "number" || reg.test(val) ? val + "px" : val;
};
const _sfc_main = {
name: "UniIcons",
emits: ["click"],
props: {
type: {
type: String,
default: ""
},
color: {
type: String,
default: "#333333"
},
size: {
type: [Number, String],
default: 16
},
customPrefix: {
type: String,
default: ""
},
fontFamily: {
type: String,
default: ""
}
},
data() {
return {
icons: uni_modules_uniIcons_components_uniIcons_uniicons_file_vue.fontData
};
},
computed: {
unicode() {
let code = this.icons.find((v) => v.font_class === this.type);
if (code) {
return code.unicode;
}
return "";
},
iconSize() {
return getVal(this.size);
},
styleObj() {
if (this.fontFamily !== "") {
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
}
return `color: ${this.color}; font-size: ${this.iconSize};`;
}
},
methods: {
_onClick() {
this.$emit("click");
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.s($options.styleObj),
b: common_vendor.n("uniui-" + $props.type),
c: common_vendor.n($props.customPrefix),
d: common_vendor.n($props.customPrefix ? $props.type : ""),
e: common_vendor.o((...args) => $options._onClick && $options._onClick(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map

View File

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

View File

@@ -0,0 +1 @@
<text style="{{a}}" class="{{['uni-icons', b, c, d]}}" bindtap="{{e}}"><slot></slot></text>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,649 @@
"use strict";
const fontData = [
{
"font_class": "arrow-down",
"unicode": ""
},
{
"font_class": "arrow-left",
"unicode": ""
},
{
"font_class": "arrow-right",
"unicode": ""
},
{
"font_class": "arrow-up",
"unicode": ""
},
{
"font_class": "auth",
"unicode": ""
},
{
"font_class": "auth-filled",
"unicode": ""
},
{
"font_class": "back",
"unicode": ""
},
{
"font_class": "bars",
"unicode": ""
},
{
"font_class": "calendar",
"unicode": ""
},
{
"font_class": "calendar-filled",
"unicode": ""
},
{
"font_class": "camera",
"unicode": ""
},
{
"font_class": "camera-filled",
"unicode": ""
},
{
"font_class": "cart",
"unicode": ""
},
{
"font_class": "cart-filled",
"unicode": ""
},
{
"font_class": "chat",
"unicode": ""
},
{
"font_class": "chat-filled",
"unicode": ""
},
{
"font_class": "chatboxes",
"unicode": ""
},
{
"font_class": "chatboxes-filled",
"unicode": ""
},
{
"font_class": "chatbubble",
"unicode": ""
},
{
"font_class": "chatbubble-filled",
"unicode": ""
},
{
"font_class": "checkbox",
"unicode": ""
},
{
"font_class": "checkbox-filled",
"unicode": ""
},
{
"font_class": "checkmarkempty",
"unicode": ""
},
{
"font_class": "circle",
"unicode": ""
},
{
"font_class": "circle-filled",
"unicode": ""
},
{
"font_class": "clear",
"unicode": ""
},
{
"font_class": "close",
"unicode": ""
},
{
"font_class": "closeempty",
"unicode": ""
},
{
"font_class": "cloud-download",
"unicode": ""
},
{
"font_class": "cloud-download-filled",
"unicode": ""
},
{
"font_class": "cloud-upload",
"unicode": ""
},
{
"font_class": "cloud-upload-filled",
"unicode": ""
},
{
"font_class": "color",
"unicode": ""
},
{
"font_class": "color-filled",
"unicode": ""
},
{
"font_class": "compose",
"unicode": ""
},
{
"font_class": "contact",
"unicode": ""
},
{
"font_class": "contact-filled",
"unicode": ""
},
{
"font_class": "down",
"unicode": ""
},
{
"font_class": "bottom",
"unicode": ""
},
{
"font_class": "download",
"unicode": ""
},
{
"font_class": "download-filled",
"unicode": ""
},
{
"font_class": "email",
"unicode": ""
},
{
"font_class": "email-filled",
"unicode": ""
},
{
"font_class": "eye",
"unicode": ""
},
{
"font_class": "eye-filled",
"unicode": ""
},
{
"font_class": "eye-slash",
"unicode": ""
},
{
"font_class": "eye-slash-filled",
"unicode": ""
},
{
"font_class": "fire",
"unicode": ""
},
{
"font_class": "fire-filled",
"unicode": ""
},
{
"font_class": "flag",
"unicode": ""
},
{
"font_class": "flag-filled",
"unicode": ""
},
{
"font_class": "folder-add",
"unicode": ""
},
{
"font_class": "folder-add-filled",
"unicode": ""
},
{
"font_class": "font",
"unicode": ""
},
{
"font_class": "forward",
"unicode": ""
},
{
"font_class": "gear",
"unicode": ""
},
{
"font_class": "gear-filled",
"unicode": ""
},
{
"font_class": "gift",
"unicode": ""
},
{
"font_class": "gift-filled",
"unicode": ""
},
{
"font_class": "hand-down",
"unicode": ""
},
{
"font_class": "hand-down-filled",
"unicode": ""
},
{
"font_class": "hand-up",
"unicode": ""
},
{
"font_class": "hand-up-filled",
"unicode": ""
},
{
"font_class": "headphones",
"unicode": ""
},
{
"font_class": "heart",
"unicode": ""
},
{
"font_class": "heart-filled",
"unicode": ""
},
{
"font_class": "help",
"unicode": ""
},
{
"font_class": "help-filled",
"unicode": ""
},
{
"font_class": "home",
"unicode": ""
},
{
"font_class": "home-filled",
"unicode": ""
},
{
"font_class": "image",
"unicode": ""
},
{
"font_class": "image-filled",
"unicode": ""
},
{
"font_class": "images",
"unicode": ""
},
{
"font_class": "images-filled",
"unicode": ""
},
{
"font_class": "info",
"unicode": ""
},
{
"font_class": "info-filled",
"unicode": ""
},
{
"font_class": "left",
"unicode": ""
},
{
"font_class": "link",
"unicode": ""
},
{
"font_class": "list",
"unicode": ""
},
{
"font_class": "location",
"unicode": ""
},
{
"font_class": "location-filled",
"unicode": ""
},
{
"font_class": "locked",
"unicode": ""
},
{
"font_class": "locked-filled",
"unicode": ""
},
{
"font_class": "loop",
"unicode": ""
},
{
"font_class": "mail-open",
"unicode": ""
},
{
"font_class": "mail-open-filled",
"unicode": ""
},
{
"font_class": "map",
"unicode": ""
},
{
"font_class": "map-filled",
"unicode": ""
},
{
"font_class": "map-pin",
"unicode": ""
},
{
"font_class": "map-pin-ellipse",
"unicode": ""
},
{
"font_class": "medal",
"unicode": ""
},
{
"font_class": "medal-filled",
"unicode": ""
},
{
"font_class": "mic",
"unicode": ""
},
{
"font_class": "mic-filled",
"unicode": ""
},
{
"font_class": "micoff",
"unicode": ""
},
{
"font_class": "micoff-filled",
"unicode": ""
},
{
"font_class": "minus",
"unicode": ""
},
{
"font_class": "minus-filled",
"unicode": ""
},
{
"font_class": "more",
"unicode": ""
},
{
"font_class": "more-filled",
"unicode": ""
},
{
"font_class": "navigate",
"unicode": ""
},
{
"font_class": "navigate-filled",
"unicode": ""
},
{
"font_class": "notification",
"unicode": ""
},
{
"font_class": "notification-filled",
"unicode": ""
},
{
"font_class": "paperclip",
"unicode": ""
},
{
"font_class": "paperplane",
"unicode": ""
},
{
"font_class": "paperplane-filled",
"unicode": ""
},
{
"font_class": "person",
"unicode": ""
},
{
"font_class": "person-filled",
"unicode": ""
},
{
"font_class": "personadd",
"unicode": ""
},
{
"font_class": "personadd-filled",
"unicode": ""
},
{
"font_class": "personadd-filled-copy",
"unicode": ""
},
{
"font_class": "phone",
"unicode": ""
},
{
"font_class": "phone-filled",
"unicode": ""
},
{
"font_class": "plus",
"unicode": ""
},
{
"font_class": "plus-filled",
"unicode": ""
},
{
"font_class": "plusempty",
"unicode": ""
},
{
"font_class": "pulldown",
"unicode": ""
},
{
"font_class": "pyq",
"unicode": ""
},
{
"font_class": "qq",
"unicode": ""
},
{
"font_class": "redo",
"unicode": ""
},
{
"font_class": "redo-filled",
"unicode": ""
},
{
"font_class": "refresh",
"unicode": ""
},
{
"font_class": "refresh-filled",
"unicode": ""
},
{
"font_class": "refreshempty",
"unicode": ""
},
{
"font_class": "reload",
"unicode": ""
},
{
"font_class": "right",
"unicode": ""
},
{
"font_class": "scan",
"unicode": ""
},
{
"font_class": "search",
"unicode": ""
},
{
"font_class": "settings",
"unicode": ""
},
{
"font_class": "settings-filled",
"unicode": ""
},
{
"font_class": "shop",
"unicode": ""
},
{
"font_class": "shop-filled",
"unicode": ""
},
{
"font_class": "smallcircle",
"unicode": ""
},
{
"font_class": "smallcircle-filled",
"unicode": ""
},
{
"font_class": "sound",
"unicode": ""
},
{
"font_class": "sound-filled",
"unicode": ""
},
{
"font_class": "spinner-cycle",
"unicode": ""
},
{
"font_class": "staff",
"unicode": ""
},
{
"font_class": "staff-filled",
"unicode": ""
},
{
"font_class": "star",
"unicode": ""
},
{
"font_class": "star-filled",
"unicode": ""
},
{
"font_class": "starhalf",
"unicode": ""
},
{
"font_class": "trash",
"unicode": ""
},
{
"font_class": "trash-filled",
"unicode": ""
},
{
"font_class": "tune",
"unicode": ""
},
{
"font_class": "tune-filled",
"unicode": ""
},
{
"font_class": "undo",
"unicode": ""
},
{
"font_class": "undo-filled",
"unicode": ""
},
{
"font_class": "up",
"unicode": ""
},
{
"font_class": "top",
"unicode": ""
},
{
"font_class": "upload",
"unicode": ""
},
{
"font_class": "upload-filled",
"unicode": ""
},
{
"font_class": "videocam",
"unicode": ""
},
{
"font_class": "videocam-filled",
"unicode": ""
},
{
"font_class": "vip",
"unicode": ""
},
{
"font_class": "vip-filled",
"unicode": ""
},
{
"font_class": "wallet",
"unicode": ""
},
{
"font_class": "wallet-filled",
"unicode": ""
},
{
"font_class": "weibo",
"unicode": ""
},
{
"font_class": "weixin",
"unicode": ""
}
];
exports.fontData = fontData;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js.map

View File

@@ -0,0 +1,23 @@
"use strict";
const en = {
"uni-load-more.contentdown": "Pull up to show more",
"uni-load-more.contentrefresh": "loading...",
"uni-load-more.contentnomore": "No more data"
};
const zhHans = {
"uni-load-more.contentdown": "上拉显示更多",
"uni-load-more.contentrefresh": "正在加载...",
"uni-load-more.contentnomore": "没有更多数据了"
};
const zhHant = {
"uni-load-more.contentdown": "上拉顯示更多",
"uni-load-more.contentrefresh": "正在加載...",
"uni-load-more.contentnomore": "沒有更多數據了"
};
const messages = {
en,
"zh-Hans": zhHans,
"zh-Hant": zhHant
};
exports.messages = messages;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js.map

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -0,0 +1 @@
<view class="uni-load-more" bindtap="{{q}}"><view wx:if="{{a}}" style="{{'width:' + h + ';' + ('height:' + i)}}" class="uni-load-more__img uni-load-more__img--android-MP"><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 wx:elif="{{j}}" style="{{'width:' + l + ';' + ('height:' + m)}}" class="uni-load-more__img uni-load-more__img--ios-H5"><image src="{{k}}" mode="widthFix"></image></view><text wx:if="{{n}}" class="uni-load-more__text" style="{{'color:' + p}}">{{o}}</text></view>

View File

@@ -0,0 +1,179 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-load-more {
display: flex;
flex-direction: row;
height: 40px;
align-items: center;
justify-content: center;
}
.uni-load-more__text {
font-size: 14px;
margin-left: 8px;
}
.uni-load-more__img {
width: 24px;
height: 24px;
}
.uni-load-more__img--nvue {
color: #666666;
}
.uni-load-more__img--android,
.uni-load-more__img--ios {
width: 24px;
height: 24px;
transform: rotate(0deg);
}
.uni-load-more__img--android {
animation: loading-ios 1s 0s linear infinite;
}
@keyframes loading-android {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.uni-load-more__img--ios-H5 {
position: relative;
animation: loading-ios-H5 1s 0s step-end infinite;
}
.uni-load-more__img--ios-H5 image {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
@keyframes loading-ios-H5 {
0% {
transform: rotate(0deg);
}
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);
}
100% {
transform: rotate(360deg);
}
}
.uni-load-more__img--android-MP {
position: relative;
width: 24px;
height: 24px;
transform: rotate(0deg);
animation: loading-ios 1s 0s ease infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon {
position: absolute;
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: 50%;
border: solid 2px transparent;
border-top: solid 2px #777777;
transform-origin: center;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(1) {
animation: loading-android-MP-1 1s 0s linear infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(2) {
animation: loading-android-MP-2 1s 0s linear infinite;
}
.uni-load-more__img--android-MP .uni-load-more__img-icon:nth-child(3) {
animation: loading-android-MP-3 1s 0s linear infinite;
}
@keyframes loading-android {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-1 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(90deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-2 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-android-MP-3 {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@@ -0,0 +1,397 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "uniPopup",
components: {},
emits: ["change", "maskClick"],
props: {
// 开启动画
animation: {
type: Boolean,
default: true
},
// 弹出层类型可选值top: 顶部弹出层bottom底部弹出层center全屏弹出层
// message: 消息提示 ; dialog : 对话框
type: {
type: String,
default: "center"
},
// maskClick
isMaskClick: {
type: Boolean,
default: null
},
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
maskClick: {
type: Boolean,
default: null
},
backgroundColor: {
type: String,
default: "none"
},
safeArea: {
type: Boolean,
default: true
},
maskBackgroundColor: {
type: String,
default: "rgba(0, 0, 0, 0.4)"
},
borderRadius: {
type: String
}
},
watch: {
/**
* 监听type类型
*/
type: {
handler: function(type) {
if (!this.config[type])
return;
this[this.config[type]](true);
},
immediate: true
},
isDesktop: {
handler: function(newVal) {
if (!this.config[newVal])
return;
this[this.config[this.type]](true);
},
immediate: true
},
/**
* 监听遮罩是否可点击
* @param {Object} val
*/
maskClick: {
handler: function(val) {
this.mkclick = val;
},
immediate: true
},
isMaskClick: {
handler: function(val) {
this.mkclick = val;
},
immediate: true
},
// H5 下禁止底部滚动
showPopup(show) {
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
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: {
backgroundColor: "transparent",
borderRadius: this.borderRadius || "0",
position: "fixed",
left: 0,
right: 0
},
maskShow: true,
mkclick: true,
popupstyle: "top"
};
},
computed: {
getStyles() {
let res = { backgroundColor: this.bg };
if (this.borderRadius || "0") {
res = Object.assign(res, { borderRadius: this.borderRadius });
}
return res;
},
isDesktop() {
return this.popupWidth >= 500 && this.popupHeight >= 500;
},
bg() {
if (this.backgroundColor === "" || this.backgroundColor === "none") {
return "transparent";
}
return this.backgroundColor;
}
},
mounted() {
const fixSize = () => {
const {
windowWidth,
windowHeight,
windowTop,
safeArea,
screenHeight,
safeAreaInsets
} = common_vendor.index.getWindowInfo();
this.popupWidth = windowWidth;
this.popupHeight = windowHeight + (windowTop || 0);
if (safeArea && this.safeArea) {
this.safeAreaInsets = screenHeight - safeArea.bottom;
} else {
this.safeAreaInsets = 0;
}
};
fixSize();
},
// TODO vue3
unmounted() {
this.setH5Visible();
},
activated() {
this.setH5Visible(!this.showPopup);
},
deactivated() {
this.setH5Visible(true);
},
created() {
if (this.isMaskClick === null && this.maskClick === null) {
this.mkclick = true;
} else {
this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
}
if (this.animation) {
this.duration = 300;
} else {
this.duration = 0;
}
this.messageChild = null;
this.clearPropagation = false;
this.maskClass.backgroundColor = this.maskBackgroundColor;
},
methods: {
setH5Visible(visible = true) {
},
/**
* 公用方法,不显示遮罩层
*/
closeMask() {
this.maskShow = false;
},
/**
* 公用方法,遮罩层禁止点击
*/
disableMask() {
this.mkclick = false;
},
// TODO nvue 取消冒泡
clear(e) {
e.stopPropagation();
this.clearPropagation = true;
},
open(direction) {
if (this.showPopup) {
return;
}
let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
if (!(direction && innerType.indexOf(direction) !== -1)) {
direction = this.type;
}
if (!this.config[direction]) {
common_vendor.index.__f__("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:310", "缺少类型:", direction);
return;
}
this[this.config[direction]]();
this.$emit("change", {
show: true,
type: direction
});
},
close(type) {
this.showTrans = false;
this.$emit("change", {
show: false,
type: this.type
});
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.showPopup = false;
}, 300);
},
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
touchstart() {
this.clearPropagation = false;
},
onTap() {
if (this.clearPropagation) {
this.clearPropagation = false;
return;
}
this.$emit("maskClick");
if (!this.mkclick)
return;
this.close();
},
/**
* 顶部弹出样式处理
*/
top(type) {
this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
this.ani = ["slide-top"];
this.transClass = {
position: "fixed",
left: 0,
right: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
this.$nextTick(() => {
this.showPoptrans();
if (this.messageChild && this.type === "message") {
this.messageChild.timerClose();
}
});
},
/**
* 底部弹出样式处理
*/
bottom(type) {
this.popupstyle = "bottom";
this.ani = ["slide-bottom"];
this.transClass = {
position: "fixed",
left: 0,
right: 0,
bottom: 0,
// paddingBottom: this.safeAreaInsets + 'px',
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPoptrans();
},
/**
* 中间弹出样式处理
*/
center(type) {
this.popupstyle = "center";
this.ani = ["fade"];
this.transClass = {
position: "fixed",
display: "flex",
flexDirection: "column",
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: "center",
alignItems: "center",
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPoptrans();
},
left(type) {
this.popupstyle = "left";
this.ani = ["slide-left"];
this.transClass = {
position: "fixed",
left: 0,
bottom: 0,
top: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0",
display: "flex",
flexDirection: "column"
};
if (type)
return;
this.showPoptrans();
},
right(type) {
this.popupstyle = "right";
this.ani = ["slide-right"];
this.transClass = {
position: "fixed",
bottom: 0,
right: 0,
top: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0",
display: "flex",
flexDirection: "column"
};
if (type)
return;
this.showPoptrans();
},
showPoptrans() {
this.$nextTick(() => {
this.showPopup = true;
this.showTrans = true;
});
}
}
};
if (!Array) {
const _easycom_uni_transition2 = common_vendor.resolveComponent("uni-transition");
_easycom_uni_transition2();
}
const _easycom_uni_transition = () => "../../../uni-transition/components/uni-transition/uni-transition.js";
if (!Math) {
_easycom_uni_transition();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.showPopup
}, $data.showPopup ? common_vendor.e({
b: $data.maskShow
}, $data.maskShow ? {
c: common_vendor.o($options.onTap),
d: common_vendor.p({
name: "mask",
["mode-class"]: "fade",
styles: $data.maskClass,
duration: $data.duration,
show: $data.showTrans
})
} : {}, {
e: common_vendor.s($options.getStyles),
f: common_vendor.n($data.popupstyle),
g: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
h: common_vendor.o($options.onTap),
i: common_vendor.p({
["mode-class"]: $data.ani,
name: "content",
styles: $data.transClass,
duration: $data.duration,
show: $data.showTrans
}),
j: common_vendor.o((...args) => $options.touchstart && $options.touchstart(...args)),
k: common_vendor.n($data.popupstyle),
l: common_vendor.n($options.isDesktop ? "fixforpc-z-index" : "")
}) : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-popup {
position: fixed;
z-index: 99;
}
.uni-popup.top, .uni-popup.left, .uni-popup.right {
top: 0;
}
.uni-popup .uni-popup__wrapper {
display: block;
position: relative;
/* iphonex 等安全区设置,底部安全区适配 */
}
.uni-popup .uni-popup__wrapper.left, .uni-popup .uni-popup__wrapper.right {
padding-top: 0;
flex: 1;
}
.fixforpc-z-index {
z-index: 999;
}
.fixforpc-top {
top: 0;
}

View File

@@ -0,0 +1,245 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "UniRate",
props: {
isFill: {
// 星星的类型,是否镂空
type: [Boolean, String],
default: true
},
color: {
// 星星未选中的颜色
type: String,
default: "#ececec"
},
activeColor: {
// 星星选中状态颜色
type: String,
default: "#ffca3e"
},
disabledColor: {
// 星星禁用状态颜色
type: String,
default: "#c0c0c0"
},
size: {
// 星星的大小
type: [Number, String],
default: 24
},
value: {
// 当前评分
type: [Number, String],
default: 0
},
modelValue: {
// 当前评分
type: [Number, String],
default: 0
},
max: {
// 最大评分
type: [Number, String],
default: 5
},
margin: {
// 星星的间距
type: [Number, String],
default: 0
},
disabled: {
// 是否可点击
type: [Boolean, String],
default: false
},
readonly: {
// 是否只读
type: [Boolean, String],
default: false
},
allowHalf: {
// 是否显示半星
type: [Boolean, String],
default: false
},
touchable: {
// 是否支持滑动手势
type: [Boolean, String],
default: true
}
},
data() {
return {
valueSync: "",
userMouseFristMove: true,
userRated: false,
userLastRate: 1
};
},
watch: {
value(newVal) {
this.valueSync = Number(newVal);
},
modelValue(newVal) {
this.valueSync = Number(newVal);
}
},
computed: {
stars() {
const value = this.valueSync ? this.valueSync : 0;
const starList = [];
const floorValue = Math.floor(value);
const ceilValue = Math.ceil(value);
for (let i = 0; i < this.max; i++) {
if (floorValue > i) {
starList.push({
activeWitch: "100%"
});
} else if (ceilValue - 1 === i) {
starList.push({
activeWitch: (value - floorValue) * 100 + "%"
});
} else {
starList.push({
activeWitch: "0"
});
}
}
return starList;
},
marginNumber() {
return Number(this.margin);
}
},
created() {
this.valueSync = Number(this.value || this.modelValue);
this._rateBoxLeft = 0;
this._oldValue = null;
},
mounted() {
setTimeout(() => {
this._getSize();
}, 100);
},
methods: {
touchstart(e) {
if (this.readonly || this.disabled)
return;
const {
clientX,
screenX
} = e.changedTouches[0];
this._getRateCount(clientX || screenX);
},
touchmove(e) {
if (this.readonly || this.disabled || !this.touchable)
return;
const {
clientX,
screenX
} = e.changedTouches[0];
this._getRateCount(clientX || screenX);
},
/**
* 兼容 PC @tian
*/
mousedown(e) {
},
mousemove(e) {
},
mouseleave(e) {
},
/**
* 获取星星个数
*/
_getRateCount(clientX) {
this._getSize();
const size = Number(this.size);
if (isNaN(size)) {
return new Error("size 属性只能设置为数字");
}
const rateMoveRange = clientX - this._rateBoxLeft;
let index = parseInt(rateMoveRange / (size + this.marginNumber));
index = index < 0 ? 0 : index;
index = index > this.max ? this.max : index;
const range = parseInt(rateMoveRange - (size + this.marginNumber) * index);
let value = 0;
if (this._oldValue === index && !this.PC)
return;
this._oldValue = index;
if (this.allowHalf) {
if (range > size / 2) {
value = index + 1;
} else {
value = index + 0.5;
}
} else {
value = index + 1;
}
value = Math.max(0.5, Math.min(value, this.max));
this.valueSync = value;
this._onChange();
},
/**
* 触发动态修改
*/
_onChange() {
this.$emit("input", this.valueSync);
this.$emit("update:modelValue", this.valueSync);
this.$emit("change", {
value: this.valueSync
});
},
/**
* 获取星星距离屏幕左侧距离
*/
_getSize() {
common_vendor.index.createSelectorQuery().in(this).select(".uni-rate").boundingClientRect().exec((ret) => {
if (ret) {
this._rateBoxLeft = ret[0].left;
}
});
}
}
};
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($options.stars, (star, index, i0) => {
return {
a: "fccbd4e6-0-" + i0,
b: "fccbd4e6-1-" + i0,
c: star.activeWitch,
d: index,
e: common_vendor.o((...args) => $options.touchstart && $options.touchstart(...args), index),
f: common_vendor.o((...args) => $options.touchmove && $options.touchmove(...args), index),
g: common_vendor.o((...args) => $options.mousedown && $options.mousedown(...args), index),
h: common_vendor.o((...args) => $options.mousemove && $options.mousemove(...args), index),
i: common_vendor.o((...args) => $options.mouseleave && $options.mouseleave(...args), index)
};
}),
b: common_vendor.p({
color: $props.color,
size: $props.size,
type: $props.isFill ? "star-filled" : "star"
}),
c: common_vendor.p({
color: $props.disabled ? $props.disabledColor : $props.activeColor,
size: $props.size,
type: "star-filled"
}),
d: $props.disabled ? 1 : "",
e: $options.marginNumber + "px"
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-rate/components/uni-rate/uni-rate.js.map

View File

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

View File

@@ -0,0 +1 @@
<view><view ref="uni-rate" class="uni-rate"><view wx:for="{{a}}" wx:for-item="star" wx:key="d" class="{{['uni-rate__icon', d && 'uni-cursor-not-allowed']}}" style="{{'margin-right:' + e}}" catchtouchstart="{{star.e}}" catchtouchmove="{{star.f}}" catchmousedown="{{star.g}}" catchmousemove="{{star.h}}" bindmouseleave="{{star.i}}"><uni-icons wx:if="{{b}}" u-i="{{star.a}}" bind:__l="__l" u-p="{{b}}"/><view style="{{'width:' + star.c}}" class="uni-rate__icon-on"><uni-icons wx:if="{{c}}" u-i="{{star.b}}" bind:__l="__l" u-p="{{c}}"/></view></view></view></view>

View File

@@ -0,0 +1,44 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-rate {
display: flex;
line-height: 1;
font-size: 0;
flex-direction: row;
}
.uni-rate__icon {
position: relative;
line-height: 1;
font-size: 0;
}
.uni-rate__icon-on {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
line-height: 1;
text-align: left;
}

View File

@@ -0,0 +1,20 @@
"use strict";
const en = {
"uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "Search enter content"
};
const zhHans = {
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "请输入搜索内容"
};
const zhHant = {
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "請輸入搜索內容"
};
const messages = {
en,
"zh-Hans": zhHans,
"zh-Hant": zhHant
};
exports.messages = messages;
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js.map

View File

@@ -0,0 +1,199 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uniSearchBar_components_uniSearchBar_i18n_index = require("./i18n/index.js");
const {
t
} = common_vendor.initVueI18n(uni_modules_uniSearchBar_components_uniSearchBar_i18n_index.messages);
const _sfc_main = {
name: "UniSearchBar",
emits: ["input", "update:modelValue", "clear", "cancel", "confirm", "blur", "focus"],
props: {
placeholder: {
type: String,
default: ""
},
radius: {
type: [Number, String],
default: 5
},
clearButton: {
type: String,
default: "auto"
},
cancelButton: {
type: String,
default: "auto"
},
cancelText: {
type: String,
default: ""
},
bgColor: {
type: String,
default: "#F8F8F8"
},
textColor: {
type: String,
default: "#000000"
},
maxlength: {
type: [Number, String],
default: 100
},
value: {
type: [Number, String],
default: ""
},
modelValue: {
type: [Number, String],
default: ""
},
focus: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
}
},
data() {
return {
show: false,
showSync: false,
searchVal: ""
};
},
computed: {
cancelTextI18n() {
return this.cancelText || t("uni-search-bar.cancel");
},
placeholderText() {
return this.placeholder || t("uni-search-bar.placeholder");
}
},
watch: {
modelValue: {
immediate: true,
handler(newVal) {
this.searchVal = newVal;
if (newVal) {
this.show = true;
}
}
},
focus: {
immediate: true,
handler(newVal) {
if (newVal) {
if (this.readonly)
return;
this.show = true;
this.$nextTick(() => {
this.showSync = true;
});
}
}
},
searchVal(newVal, oldVal) {
this.$emit("input", newVal);
this.$emit("update:modelValue", newVal);
}
},
methods: {
searchClick() {
if (this.readonly)
return;
if (this.show) {
return;
}
this.show = true;
this.$nextTick(() => {
this.showSync = true;
});
},
clear() {
this.searchVal = "";
this.$nextTick(() => {
this.$emit("clear", { value: "" });
});
},
cancel() {
if (this.readonly)
return;
this.$emit("cancel", {
value: this.searchVal
});
this.searchVal = "";
this.show = false;
this.showSync = false;
common_vendor.index.hideKeyboard();
},
confirm() {
common_vendor.index.hideKeyboard();
this.$emit("confirm", {
value: this.searchVal
});
},
blur() {
common_vendor.index.hideKeyboard();
this.$emit("blur", {
value: this.searchVal
});
},
emitFocus(e) {
this.$emit("focus", e.detail);
}
}
};
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
color: "#c0c4cc",
size: "18",
type: "search"
}),
b: $data.show || $data.searchVal
}, $data.show || $data.searchVal ? {
c: $data.showSync,
d: $props.readonly,
e: $options.placeholderText,
f: $props.maxlength,
g: $props.textColor,
h: common_vendor.o((...args) => $options.confirm && $options.confirm(...args)),
i: common_vendor.o((...args) => $options.blur && $options.blur(...args)),
j: common_vendor.o((...args) => $options.emitFocus && $options.emitFocus(...args)),
k: $data.searchVal,
l: common_vendor.o(($event) => $data.searchVal = $event.detail.value)
} : {
m: common_vendor.t($props.placeholder)
}, {
n: $data.show && ($props.clearButton === "always" || $props.clearButton === "auto" && $data.searchVal !== "") && !$props.readonly
}, $data.show && ($props.clearButton === "always" || $props.clearButton === "auto" && $data.searchVal !== "") && !$props.readonly ? {
o: common_vendor.p({
color: "#c0c4cc",
size: "20",
type: "clear"
}),
p: common_vendor.o((...args) => $options.clear && $options.clear(...args))
} : {}, {
q: $props.radius + "px",
r: $props.bgColor,
s: common_vendor.o((...args) => $options.searchClick && $options.searchClick(...args)),
t: $props.cancelButton === "always" || $data.show && $props.cancelButton === "auto"
}, $props.cancelButton === "always" || $data.show && $props.cancelButton === "auto" ? {
v: common_vendor.t($options.cancelTextI18n),
w: common_vendor.o((...args) => $options.cancel && $options.cancel(...args))
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js.map

View File

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

View File

@@ -0,0 +1 @@
<view class="uni-searchbar"><view style="{{'border-radius:' + q + ';' + ('background-color:' + r)}}" class="uni-searchbar__box" bindtap="{{s}}"><view class="uni-searchbar__box-icon-search"><block wx:if="{{$slots.searchIcon}}"><slot name="searchIcon"></slot></block><block wx:else><uni-icons wx:if="{{a}}" u-i="9d781302-0" bind:__l="__l" u-p="{{a}}"/></block></view><input wx:if="{{b}}" focus="{{c}}" disabled="{{d}}" placeholder="{{e}}" maxlength="{{f}}" class="uni-searchbar__box-search-input" confirm-type="search" type="text" style="{{'color:' + g}}" bindconfirm="{{h}}" bindblur="{{i}}" bindfocus="{{j}}" value="{{k}}" bindinput="{{l}}"/><text wx:else class="uni-searchbar__text-placeholder">{{m}}</text><view wx:if="{{n}}" class="uni-searchbar__box-icon-clear" bindtap="{{p}}"><block wx:if="{{$slots.clearIcon}}"><slot name="clearIcon"></slot></block><block wx:else><uni-icons wx:if="{{o}}" u-i="9d781302-1" bind:__l="__l" u-p="{{o}}"/></block></view></view><text wx:if="{{t}}" bindtap="{{w}}" class="uni-searchbar__cancel">{{v}}</text></view>

View File

@@ -0,0 +1,76 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-searchbar {
display: flex;
flex-direction: row;
position: relative;
padding: 10px;
}
.uni-searchbar__box {
display: flex;
box-sizing: border-box;
justify-content: left;
overflow: hidden;
position: relative;
flex: 1;
flex-direction: row;
align-items: center;
height: 36px;
padding: 5px 8px 5px 0px;
}
.uni-searchbar__box-icon-search {
display: flex;
flex-direction: row;
padding: 0 8px;
justify-content: center;
align-items: center;
color: #B3B3B3;
}
.uni-searchbar__box-search-input {
flex: 1;
font-size: 14px;
color: #333;
margin-left: 5px;
margin-top: 1px;
background-color: inherit;
}
.uni-searchbar__box-icon-clear {
align-items: center;
line-height: 24px;
padding-left: 8px;
}
.uni-searchbar__text-placeholder {
font-size: 14px;
color: #B3B3B3;
margin-left: 5px;
text-align: left;
}
.uni-searchbar__cancel {
padding-left: 10px;
line-height: 36px;
font-size: 14px;
color: #333333;
}

View File

@@ -0,0 +1,95 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "UniTag",
emits: ["click"],
props: {
type: {
// 标签类型default、primary、success、warning、error、royal
type: String,
default: "default"
},
size: {
// 标签大小 normal, small
type: String,
default: "normal"
},
// 标签内容
text: {
type: String,
default: ""
},
disabled: {
// 是否为禁用状态
type: [Boolean, String],
default: false
},
inverted: {
// 是否为空心
type: [Boolean, String],
default: false
},
circle: {
// 是否为圆角样式
type: [Boolean, String],
default: false
},
mark: {
// 是否为标记样式
type: [Boolean, String],
default: false
},
customStyle: {
type: String,
default: ""
}
},
computed: {
classes() {
const {
type,
disabled,
inverted,
circle,
mark,
size,
isTrue
} = this;
const classArr = [
"uni-tag--" + type,
"uni-tag--" + size,
isTrue(disabled) ? "uni-tag--disabled" : "",
isTrue(inverted) ? "uni-tag--" + type + "--inverted" : "",
isTrue(circle) ? "uni-tag--circle" : "",
isTrue(mark) ? "uni-tag--mark" : "",
// type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
isTrue(inverted) ? "uni-tag--inverted uni-tag-text--" + type : "",
size === "small" ? "uni-tag-text--small" : ""
];
return classArr.join(" ");
}
},
methods: {
isTrue(value) {
return value === true || value === "true";
},
onClick() {
if (this.isTrue(this.disabled))
return;
this.$emit("click");
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $props.text
}, $props.text ? {
b: common_vendor.t($props.text),
c: common_vendor.n($options.classes),
d: common_vendor.s($props.customStyle),
e: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1f94d070"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-tag/components/uni-tag/uni-tag.js.map

View File

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

View File

@@ -0,0 +1 @@
<text wx:if="{{a}}" class="{{['uni-tag', 'data-v-1f94d070', c]}}" style="{{d}}" bindtap="{{e}}">{{b}}</text>

View File

@@ -0,0 +1,124 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uni-tag.data-v-1f94d070 {
line-height: 14px;
font-size: 12px;
font-weight: 200;
padding: 4px 7px;
color: #fff;
border-radius: 3px;
background-color: #8f939c;
border-width: 1px;
border-style: solid;
border-color: #8f939c;
}
.uni-tag--default.data-v-1f94d070 {
font-size: 12px;
}
.uni-tag--default--inverted.data-v-1f94d070 {
color: #8f939c;
border-color: #8f939c;
}
.uni-tag--small.data-v-1f94d070 {
padding: 2px 5px;
font-size: 12px;
border-radius: 2px;
}
.uni-tag--mini.data-v-1f94d070 {
padding: 1px 3px;
font-size: 12px;
border-radius: 2px;
}
.uni-tag--primary.data-v-1f94d070 {
background-color: #2979ff;
border-color: #2979ff;
color: #fff;
}
.uni-tag--success.data-v-1f94d070 {
color: #fff;
background-color: #18bc37;
border-color: #18bc37;
}
.uni-tag--warning.data-v-1f94d070 {
color: #fff;
background-color: #f3a73f;
border-color: #f3a73f;
}
.uni-tag--error.data-v-1f94d070 {
color: #fff;
background-color: #e43d33;
border-color: #e43d33;
}
.uni-tag--primary--inverted.data-v-1f94d070 {
color: #2979ff;
border-color: #2979ff;
}
.uni-tag--success--inverted.data-v-1f94d070 {
color: #18bc37;
border-color: #18bc37;
}
.uni-tag--warning--inverted.data-v-1f94d070 {
color: #f3a73f;
border-color: #f3a73f;
}
.uni-tag--error--inverted.data-v-1f94d070 {
color: #e43d33;
border-color: #e43d33;
}
.uni-tag--inverted.data-v-1f94d070 {
background-color: #fff;
}
.uni-tag--circle.data-v-1f94d070 {
border-radius: 15px;
}
.uni-tag--mark.data-v-1f94d070 {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.uni-tag--disabled.data-v-1f94d070 {
opacity: 0.5;
}
.uni-tag-text.data-v-1f94d070 {
color: #fff;
font-size: 14px;
}
.uni-tag-text--primary.data-v-1f94d070 {
color: #2979ff;
}
.uni-tag-text--success.data-v-1f94d070 {
color: #18bc37;
}
.uni-tag-text--warning.data-v-1f94d070 {
color: #f3a73f;
}
.uni-tag-text--error.data-v-1f94d070 {
color: #e43d33;
}
.uni-tag-text--small.data-v-1f94d070 {
font-size: 12px;
}

View File

@@ -0,0 +1,116 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
class MPAnimation {
constructor(options, _this) {
this.options = options;
this.animation = common_vendor.index.createAnimation({
...options
});
this.currentStepAnimates = {};
this.next = 0;
this.$ = _this;
}
_nvuePushAnimates(type, args) {
let aniObj = this.currentStepAnimates[this.next];
let styles = {};
if (!aniObj) {
styles = {
styles: {},
config: {}
};
} else {
styles = aniObj;
}
if (animateTypes1.includes(type)) {
if (!styles.styles.transform) {
styles.styles.transform = "";
}
let unit = "";
if (type === "rotate") {
unit = "deg";
}
styles.styles.transform += `${type}(${args + unit}) `;
} else {
styles.styles[type] = `${args}`;
}
this.currentStepAnimates[this.next] = styles;
}
_animateRun(styles = {}, config = {}) {
let ref = this.$.$refs["ani"].ref;
if (!ref)
return;
return new Promise((resolve, reject) => {
nvueAnimation.transition(ref, {
styles,
...config
}, (res) => {
resolve();
});
});
}
_nvueNextAnimate(animates, step = 0, fn) {
let obj = animates[step];
if (obj) {
let {
styles,
config
} = obj;
this._animateRun(styles, config).then(() => {
step += 1;
this._nvueNextAnimate(animates, step, fn);
});
} else {
this.currentStepAnimates = {};
typeof fn === "function" && fn();
this.isEnd = true;
}
}
step(config = {}) {
this.animation.step(config);
return this;
}
run(fn) {
this.$.animationData = this.animation.export();
this.$.timer = setTimeout(() => {
typeof fn === "function" && fn();
}, this.$.durationTime);
}
}
const animateTypes1 = [
"matrix",
"matrix3d",
"rotate",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"scale",
"scale3d",
"scaleX",
"scaleY",
"scaleZ",
"skew",
"skewX",
"skewY",
"translate",
"translate3d",
"translateX",
"translateY",
"translateZ"
];
const animateTypes2 = ["opacity", "backgroundColor"];
const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
MPAnimation.prototype[type] = function(...args) {
this.animation[type](...args);
return this;
};
});
function createAnimation(option, _this) {
if (!_this)
return;
clearTimeout(_this.timer);
return new MPAnimation(option, _this);
}
exports.createAnimation = createAnimation;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-transition/components/uni-transition/createAnimation.js.map

View File

@@ -0,0 +1,257 @@
"use strict";
const uni_modules_uniTransition_components_uniTransition_createAnimation = require("./createAnimation.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "uniTransition",
emits: ["click", "change"],
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: [Array, String],
default() {
return "fade";
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default() {
return {};
}
},
customClass: {
type: String,
default: ""
},
onceRender: {
type: Boolean,
default: false
}
},
data() {
return {
isShow: false,
transform: "",
opacity: 0,
animationData: {},
durationTime: 300,
config: {}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open();
} else {
if (this.isShow) {
this.close();
}
}
},
immediate: true
}
},
computed: {
// 生成样式数据
stylesObject() {
let styles = {
...this.styles,
"transition-duration": this.duration / 1e3 + "s"
};
let transform = "";
for (let i in styles) {
let line = this.toLine(i);
transform += line + ":" + styles[i] + ";";
}
return transform;
},
// 初始化动画条件
transformStyles() {
return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
}
},
created() {
this.config = {
duration: this.duration,
timingFunction: "ease",
transformOrigin: "50% 50%",
delay: 0
};
this.durationTime = this.duration;
},
methods: {
/**
* ref 触发 初始化动画
*/
init(obj = {}) {
if (obj.duration) {
this.durationTime = obj.duration;
}
this.animation = uni_modules_uniTransition_components_uniTransition_createAnimation.createAnimation(Object.assign(this.config, obj), this);
},
/**
* 点击组件触发回调
*/
onClick() {
this.$emit("click", {
detail: this.isShow
});
},
/**
* ref 触发 动画分组
* @param {Object} obj
*/
step(obj, config = {}) {
if (!this.animation)
return this;
Object.keys(obj).forEach((key) => {
const value = obj[key];
if (typeof this.animation[key] === "function") {
Array.isArray(value) ? this.animation[key](...value) : this.animation[key](value);
}
});
this.animation.step(config);
return this;
},
/**
* ref 触发 执行动画
*/
run(fn) {
if (!this.animation)
return;
this.animation.run(fn);
},
// 开始过度动画
open() {
clearTimeout(this.timer);
this.isShow = true;
this.transform = this.styleInit(false).transform || "";
this.opacity = this.styleInit(false).opacity || 0;
this.$nextTick(() => {
this.timer = setTimeout(() => {
this.animation = uni_modules_uniTransition_components_uniTransition_createAnimation.createAnimation(this.config, this);
this.tranfromInit(false).step();
this.animation.run(() => {
this.transform = "";
this.opacity = this.styleInit(false).opacity || 1;
this.$emit("change", {
detail: this.isShow
});
});
}, 80);
});
},
// 关闭过度动画
close(type) {
if (!this.animation)
return;
this.tranfromInit(true).step().run(() => {
this.isShow = false;
this.animationData = null;
this.animation = null;
let { opacity, transform } = this.styleInit(false);
this.opacity = opacity || 1;
this.transform = transform;
this.$emit("change", {
detail: this.isShow
});
});
},
// 处理动画开始前的默认样式
styleInit(type) {
let styles = { transform: "", opacity: 1 };
const buildStyle = (type2, mode) => {
const value = this.animationType(type2)[mode];
if (mode.startsWith("fade")) {
styles.opacity = value;
} else {
styles.transform += value + " ";
}
};
if (typeof this.modeClass === "string") {
buildStyle(type, this.modeClass);
} else {
this.modeClass.forEach((mode) => buildStyle(type, mode));
}
return styles;
},
// 处理内置组合动画
tranfromInit(type) {
let buildTranfrom = (type2, mode) => {
let aniNum = null;
if (mode === "fade") {
aniNum = type2 ? 0 : 1;
} else {
aniNum = type2 ? "-100%" : "0";
if (mode === "zoom-in") {
aniNum = type2 ? 0.8 : 1;
}
if (mode === "zoom-out") {
aniNum = type2 ? 1.2 : 1;
}
if (mode === "slide-right") {
aniNum = type2 ? "100%" : "0";
}
if (mode === "slide-bottom") {
aniNum = type2 ? "100%" : "0";
}
}
this.animation[this.animationMode()[mode]](aniNum);
};
if (typeof this.modeClass === "string") {
buildTranfrom(type, this.modeClass);
} else {
this.modeClass.forEach((mode) => {
buildTranfrom(type, mode);
});
}
return this.animation;
},
animationType(type) {
return {
fade: type ? 1 : 0,
"slide-top": `translateY(${type ? "0" : "-100%"})`,
"slide-right": `translateX(${type ? "0" : "100%"})`,
"slide-bottom": `translateY(${type ? "0" : "100%"})`,
"slide-left": `translateX(${type ? "0" : "-100%"})`,
"zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
"zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
};
},
// 内置动画类型与实际动画对应字典
animationMode() {
return {
fade: "opacity",
"slide-top": "translateY",
"slide-right": "translateX",
"slide-bottom": "translateY",
"slide-left": "translateX",
"zoom-in": "scale",
"zoom-out": "scale"
};
},
// 驼峰转中横线
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.isShow,
b: $data.animationData,
c: common_vendor.n($props.customClass),
d: common_vendor.s($options.transformStyles),
e: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-transition/components/uni-transition/uni-transition.js.map

View File

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

View File

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

View File

@@ -0,0 +1,65 @@
"use strict";
var _a, _b;
const common_vendor = require("../../../../common/vendor.js");
const props = {
props: {
// 内置图标名称,或图片路径,建议绝对路径
icon: {
type: String,
default: ""
},
// 提示文字
text: {
type: String,
default: ""
},
// 文字颜色
textColor: {
type: String,
default: "#c0c4cc"
},
// 文字大小
textSize: {
type: [String, Number],
default: 14
},
// 图标的颜色
iconColor: {
type: String,
default: "#c0c4cc"
},
// 图标的大小
iconSize: {
type: [String, Number],
default: 90
},
// 选择预置的图标类型
mode: {
type: String,
default: "data"
},
// 图标宽度单位px
width: {
type: [String, Number],
default: 160
},
// 图标高度单位px
height: {
type: [String, Number],
default: 160
},
// 是否显示组件
show: {
type: Boolean,
default: true
},
// 组件距离上一个元素之间的距离默认px单位
marginTop: {
type: [String, Number],
default: 0
},
...(_b = (_a = common_vendor.index.$uv) == null ? void 0 : _a.props) == null ? void 0 : _b.empty
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-empty/components/uv-empty/props.js.map

View File

@@ -0,0 +1,83 @@
"use strict";
const uni_modules_uvUiTools_libs_mixin_mpMixin = require("../../../uv-ui-tools/libs/mixin/mpMixin.js");
const uni_modules_uvUiTools_libs_mixin_mixin = require("../../../uv-ui-tools/libs/mixin/mixin.js");
const uni_modules_uvEmpty_components_uvEmpty_props = require("./props.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "uv-empty",
mixins: [uni_modules_uvUiTools_libs_mixin_mpMixin.mpMixin, uni_modules_uvUiTools_libs_mixin_mixin.mixin, uni_modules_uvEmpty_components_uvEmpty_props.props],
data() {
return {
icons: {
car: "购物车为空",
page: "页面不存在",
search: "没有搜索结果",
address: "没有收货地址",
"wifi-off": "没有WiFi",
order: "订单为空",
coupon: "没有优惠券",
favor: "暂无收藏",
permission: "无权限",
history: "无历史记录",
news: "无新闻列表",
message: "消息列表为空",
list: "列表为空",
data: "数据为空",
comment: "暂无评论"
}
};
},
computed: {
// 组件样式
emptyStyle() {
const style = {};
style.marginTop = this.$uv.addUnit(this.marginTop);
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
},
// 文本样式
textStyle() {
const style = {};
style.color = this.textColor;
style.fontSize = this.$uv.addUnit(this.textSize);
return style;
},
// 判断icon是否图片路径
isImg() {
const isBase64 = this.icon.indexOf("data:") > -1 && this.icon.indexOf("base64") > -1;
return this.icon.indexOf("/") !== -1 || isBase64;
}
}
};
if (!Array) {
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
_easycom_uv_icon2();
}
const _easycom_uv_icon = () => "../../../uv-icon/components/uv-icon/uv-icon.js";
if (!Math) {
_easycom_uv_icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.show
}, _ctx.show ? common_vendor.e({
b: !$options.isImg
}, !$options.isImg ? {
c: common_vendor.p({
name: _ctx.mode === "message" ? "chat" : `empty-${_ctx.mode}`,
size: _ctx.iconSize,
color: _ctx.iconColor,
["margin-top"]: "14"
})
} : {
d: _ctx.$uv.addUnit(_ctx.width),
e: _ctx.$uv.addUnit(_ctx.height),
f: _ctx.icon
}, {
g: common_vendor.t(_ctx.text ? _ctx.text : $data.icons[_ctx.mode]),
h: common_vendor.s($options.textStyle),
i: common_vendor.s($options.emptyStyle)
}) : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6efcec67"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-empty/components/uv-empty/uv-empty.js.map

View File

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

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="uv-empty data-v-6efcec67" style="{{i}}"><uv-icon wx:if="{{b}}" class="data-v-6efcec67" u-i="6efcec67-0" bind:__l="__l" u-p="{{c}}"></uv-icon><image wx:else class="data-v-6efcec67" style="{{'width:' + d + ';' + ('height:' + e)}}" src="{{f}}" mode="widthFix"></image><text class="uv-empty__text data-v-6efcec67" style="{{h}}">{{g}}</text><view class="uv-empty__wrap data-v-6efcec67"><slot/></view></view>

View File

@@ -0,0 +1,55 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
view.data-v-6efcec67, scroll-view.data-v-6efcec67, swiper-item.data-v-6efcec67 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.uv-empty.data-v-6efcec67 {
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: center;
align-items: center;
}
.uv-empty__text.data-v-6efcec67 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 20rpx;
}
.uv-slot-wrap.data-v-6efcec67 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 20rpx;
}

View File

@@ -0,0 +1,163 @@
"use strict";
const icons = {
"uvicon-level": "e68f",
"uvicon-checkbox-mark": "e659",
"uvicon-folder": "e694",
"uvicon-movie": "e67c",
"uvicon-star-fill": "e61e",
"uvicon-star": "e618",
"uvicon-phone-fill": "e6ac",
"uvicon-phone": "e6ba",
"uvicon-apple-fill": "e635",
"uvicon-backspace": "e64d",
"uvicon-attach": "e640",
"uvicon-empty-data": "e671",
"uvicon-empty-address": "e68a",
"uvicon-empty-favor": "e662",
"uvicon-empty-car": "e657",
"uvicon-empty-order": "e66b",
"uvicon-empty-list": "e672",
"uvicon-empty-search": "e677",
"uvicon-empty-permission": "e67d",
"uvicon-empty-news": "e67e",
"uvicon-empty-history": "e685",
"uvicon-empty-coupon": "e69b",
"uvicon-empty-page": "e60e",
"uvicon-empty-wifi-off": "e6cc",
"uvicon-reload": "e627",
"uvicon-order": "e695",
"uvicon-server-man": "e601",
"uvicon-search": "e632",
"uvicon-more-dot-fill": "e66f",
"uvicon-scan": "e631",
"uvicon-map": "e665",
"uvicon-map-fill": "e6a8",
"uvicon-tags": "e621",
"uvicon-tags-fill": "e613",
"uvicon-eye": "e664",
"uvicon-eye-fill": "e697",
"uvicon-eye-off": "e69c",
"uvicon-eye-off-outline": "e688",
"uvicon-mic": "e66d",
"uvicon-mic-off": "e691",
"uvicon-calendar": "e65c",
"uvicon-trash": "e623",
"uvicon-trash-fill": "e6ce",
"uvicon-play-left": "e6bf",
"uvicon-play-right": "e6b3",
"uvicon-minus": "e614",
"uvicon-plus": "e625",
"uvicon-info-circle": "e69f",
"uvicon-info-circle-fill": "e6a7",
"uvicon-question-circle": "e622",
"uvicon-question-circle-fill": "e6bc",
"uvicon-close": "e65a",
"uvicon-checkmark": "e64a",
"uvicon-checkmark-circle": "e643",
"uvicon-checkmark-circle-fill": "e668",
"uvicon-setting": "e602",
"uvicon-setting-fill": "e6d0",
"uvicon-heart": "e6a2",
"uvicon-heart-fill": "e68b",
"uvicon-camera": "e642",
"uvicon-camera-fill": "e650",
"uvicon-more-circle": "e69e",
"uvicon-more-circle-fill": "e684",
"uvicon-chat": "e656",
"uvicon-chat-fill": "e63f",
"uvicon-bag": "e647",
"uvicon-error-circle": "e66e",
"uvicon-error-circle-fill": "e655",
"uvicon-close-circle": "e64e",
"uvicon-close-circle-fill": "e666",
"uvicon-share": "e629",
"uvicon-share-fill": "e6bb",
"uvicon-share-square": "e6c4",
"uvicon-shopping-cart": "e6cb",
"uvicon-shopping-cart-fill": "e630",
"uvicon-bell": "e651",
"uvicon-bell-fill": "e604",
"uvicon-list": "e690",
"uvicon-list-dot": "e6a9",
"uvicon-zhifubao-circle-fill": "e617",
"uvicon-weixin-circle-fill": "e6cd",
"uvicon-weixin-fill": "e620",
"uvicon-qq-fill": "e608",
"uvicon-qq-circle-fill": "e6b9",
"uvicon-moments-circel-fill": "e6c2",
"uvicon-moments": "e6a0",
"uvicon-car": "e64f",
"uvicon-car-fill": "e648",
"uvicon-warning-fill": "e6c7",
"uvicon-warning": "e6c1",
"uvicon-clock-fill": "e64b",
"uvicon-clock": "e66c",
"uvicon-edit-pen": "e65d",
"uvicon-edit-pen-fill": "e679",
"uvicon-email": "e673",
"uvicon-email-fill": "e683",
"uvicon-minus-circle": "e6a5",
"uvicon-plus-circle": "e603",
"uvicon-plus-circle-fill": "e611",
"uvicon-file-text": "e687",
"uvicon-file-text-fill": "e67f",
"uvicon-pushpin": "e6d1",
"uvicon-pushpin-fill": "e6b6",
"uvicon-grid": "e68c",
"uvicon-grid-fill": "e698",
"uvicon-play-circle": "e6af",
"uvicon-play-circle-fill": "e62a",
"uvicon-pause-circle-fill": "e60c",
"uvicon-pause": "e61c",
"uvicon-pause-circle": "e696",
"uvicon-gift-fill": "e6b0",
"uvicon-gift": "e680",
"uvicon-kefu-ermai": "e660",
"uvicon-server-fill": "e610",
"uvicon-coupon-fill": "e64c",
"uvicon-coupon": "e65f",
"uvicon-integral": "e693",
"uvicon-integral-fill": "e6b1",
"uvicon-home-fill": "e68e",
"uvicon-home": "e67b",
"uvicon-account": "e63a",
"uvicon-account-fill": "e653",
"uvicon-thumb-down-fill": "e628",
"uvicon-thumb-down": "e60a",
"uvicon-thumb-up": "e612",
"uvicon-thumb-up-fill": "e62c",
"uvicon-lock-fill": "e6a6",
"uvicon-lock-open": "e68d",
"uvicon-lock-opened-fill": "e6a1",
"uvicon-lock": "e69d",
"uvicon-red-packet": "e6c3",
"uvicon-photo-fill": "e6b4",
"uvicon-photo": "e60d",
"uvicon-volume-off-fill": "e6c8",
"uvicon-volume-off": "e6bd",
"uvicon-volume-fill": "e624",
"uvicon-volume": "e605",
"uvicon-download": "e670",
"uvicon-arrow-up-fill": "e636",
"uvicon-arrow-down-fill": "e638",
"uvicon-play-left-fill": "e6ae",
"uvicon-play-right-fill": "e6ad",
"uvicon-arrow-downward": "e634",
"uvicon-arrow-leftward": "e63b",
"uvicon-arrow-rightward": "e644",
"uvicon-arrow-upward": "e641",
"uvicon-arrow-down": "e63e",
"uvicon-arrow-right": "e63c",
"uvicon-arrow-left": "e646",
"uvicon-arrow-up": "e633",
"uvicon-skip-back-left": "e6c5",
"uvicon-skip-forward-right": "e61f",
"uvicon-arrow-left-double": "e637",
"uvicon-man": "e675",
"uvicon-woman": "e626",
"uvicon-en": "e6b8",
"uvicon-twitte": "e607",
"uvicon-twitter-circle-fill": "e6cf"
};
exports.icons = icons;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-icon/components/uv-icon/icons.js.map

View File

@@ -0,0 +1,95 @@
"use strict";
var _a, _b;
const common_vendor = require("../../../../common/vendor.js");
const props = {
props: {
// 图标类名
name: {
type: String,
default: ""
},
// 图标颜色,可接受主题色
color: {
type: String,
default: "#606266"
},
// 字体大小单位px
size: {
type: [String, Number],
default: "16px"
},
// 是否显示粗体
bold: {
type: Boolean,
default: false
},
// 点击图标的时候传递事件出去的index用于区分点击了哪一个
index: {
type: [String, Number],
default: null
},
// 触摸图标时的类名
hoverClass: {
type: String,
default: ""
},
// 自定义扩展前缀,方便用户扩展自己的图标库
customPrefix: {
type: String,
default: "uvicon"
},
// 图标右边或者下面的文字
label: {
type: [String, Number],
default: ""
},
// label的位置只能右边或者下边
labelPos: {
type: String,
default: "right"
},
// label的大小
labelSize: {
type: [String, Number],
default: "15px"
},
// label的颜色
labelColor: {
type: String,
default: "#606266"
},
// label与图标的距离
space: {
type: [String, Number],
default: "3px"
},
// 图片的mode
imgMode: {
type: String,
default: "aspectFit"
},
// 用于显示图片小图标时,图片的宽度
width: {
type: [String, Number],
default: ""
},
// 用于显示图片小图标时,图片的高度
height: {
type: [String, Number],
default: ""
},
// 用于解决某些情况下,让图标垂直居中的用途
top: {
type: [String, Number],
default: 0
},
// 是否阻止事件传播
stop: {
type: Boolean,
default: false
},
...(_b = (_a = common_vendor.index.$uv) == null ? void 0 : _a.props) == null ? void 0 : _b.icon
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-icon/components/uv-icon/props.js.map

View File

@@ -0,0 +1,99 @@
"use strict";
const uni_modules_uvUiTools_libs_mixin_mpMixin = require("../../../uv-ui-tools/libs/mixin/mpMixin.js");
const uni_modules_uvUiTools_libs_mixin_mixin = require("../../../uv-ui-tools/libs/mixin/mixin.js");
const uni_modules_uvIcon_components_uvIcon_icons = require("./icons.js");
const uni_modules_uvIcon_components_uvIcon_props = require("./props.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "uv-icon",
emits: ["click"],
mixins: [uni_modules_uvUiTools_libs_mixin_mpMixin.mpMixin, uni_modules_uvUiTools_libs_mixin_mixin.mixin, uni_modules_uvIcon_components_uvIcon_props.props],
data() {
return {
colorType: [
"primary",
"success",
"info",
"error",
"warning"
]
};
},
computed: {
uClasses() {
let classes = [];
classes.push(this.customPrefix);
classes.push(this.customPrefix + "-" + this.name);
if (this.color && this.colorType.includes(this.color))
classes.push("uv-icon__icon--" + this.color);
return classes;
},
iconStyle() {
let style = {};
style = {
fontSize: this.$uv.addUnit(this.size),
lineHeight: this.$uv.addUnit(this.size),
fontWeight: this.bold ? "bold" : "normal",
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top: this.$uv.addUnit(this.top)
};
if (this.color && !this.colorType.includes(this.color))
style.color = this.color;
return style;
},
// 判断传入的name属性是否图片路径只要带有"/"均认为是图片形式
isImg() {
const isBase64 = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
return this.name.indexOf("/") !== -1 || isBase64;
},
imgStyle() {
let style = {};
style.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size);
style.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size);
return style;
},
// 通过图标名,查找对应的图标
icon() {
const code = uni_modules_uvIcon_components_uvIcon_icons.icons["uvicon-" + this.name];
return code ? unescape(`%u${code}`) : ["uvicon"].indexOf(this.customPrefix) > -1 ? this.name : "";
}
},
methods: {
clickHandler(e) {
this.$emit("click", this.index);
this.stop && this.preventEvent(e);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $options.isImg
}, $options.isImg ? {
b: _ctx.name,
c: _ctx.imgMode,
d: common_vendor.s($options.imgStyle),
e: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle))
} : {
f: common_vendor.t($options.icon),
g: common_vendor.n($options.uClasses),
h: common_vendor.s($options.iconStyle),
i: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle)),
j: _ctx.hoverClass
}, {
k: _ctx.label !== ""
}, _ctx.label !== "" ? {
l: common_vendor.t(_ctx.label),
m: _ctx.labelColor,
n: _ctx.$uv.addUnit(_ctx.labelSize),
o: _ctx.labelPos == "right" ? _ctx.$uv.addUnit(_ctx.space) : 0,
p: _ctx.labelPos == "bottom" ? _ctx.$uv.addUnit(_ctx.space) : 0,
q: _ctx.labelPos == "left" ? _ctx.$uv.addUnit(_ctx.space) : 0,
r: _ctx.labelPos == "top" ? _ctx.$uv.addUnit(_ctx.space) : 0
} : {}, {
s: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
t: common_vendor.n("uv-icon--" + _ctx.labelPos)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b7a6dd5d"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-icon/components/uv-icon/uv-icon.js.map

View File

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

View File

@@ -0,0 +1 @@
<view bindtap="{{s}}" class="{{['uv-icon', 'data-v-b7a6dd5d', t]}}"><image wx:if="{{a}}" class="uv-icon__img data-v-b7a6dd5d" src="{{b}}" mode="{{c}}" style="{{d + ';' + e}}"></image><text wx:else class="{{['uv-icon__icon', 'data-v-b7a6dd5d', g]}}" style="{{h + ';' + i}}" hover-class="{{j}}">{{f}}</text><text wx:if="{{k}}" class="uv-icon__label data-v-b7a6dd5d" style="{{'color:' + m + ';' + ('font-size:' + n) + ';' + ('margin-left:' + o) + ';' + ('margin-top:' + p) + ';' + ('margin-right:' + q) + ';' + ('margin-bottom:' + r)}}">{{l}}</text></view>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
"use strict";
let timeout = null;
function debounce(func, wait = 500, immediate = false) {
if (timeout !== null)
clearTimeout(timeout);
if (immediate) {
const callNow = !timeout;
timeout = setTimeout(() => {
timeout = null;
}, wait);
if (callNow)
typeof func === "function" && func();
} else {
timeout = setTimeout(() => {
typeof func === "function" && func();
}, wait);
}
}
exports.debounce = debounce;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/function/debounce.js.map

View File

@@ -0,0 +1,65 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
function strip(num, precision = 15) {
return +parseFloat(Number(num).toPrecision(precision));
}
function digitLength(num) {
const eSplit = num.toString().split(/[eE]/);
const len = (eSplit[0].split(".")[1] || "").length - +(eSplit[1] || 0);
return len > 0 ? len : 0;
}
function float2Fixed(num) {
if (num.toString().indexOf("e") === -1) {
return Number(num.toString().replace(".", ""));
}
const dLen = digitLength(num);
return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
}
function checkBoundary(num) {
{
if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
common_vendor.index.__f__("warn", "at uni_modules/uv-ui-tools/libs/function/digit.js:45", `${num} 超出了精度限制,结果可能不正确`);
}
}
}
function iteratorOperation(arr, operation) {
const [num1, num2, ...others] = arr;
let res = operation(num1, num2);
others.forEach((num) => {
res = operation(res, num);
});
return res;
}
function times(...nums) {
if (nums.length > 2) {
return iteratorOperation(nums, times);
}
const [num1, num2] = nums;
const num1Changed = float2Fixed(num1);
const num2Changed = float2Fixed(num2);
const baseNum = digitLength(num1) + digitLength(num2);
const leftValue = num1Changed * num2Changed;
checkBoundary(leftValue);
return leftValue / Math.pow(10, baseNum);
}
function divide(...nums) {
if (nums.length > 2) {
return iteratorOperation(nums, divide);
}
const [num1, num2] = nums;
const num1Changed = float2Fixed(num1);
const num2Changed = float2Fixed(num2);
checkBoundary(num1Changed);
checkBoundary(num2Changed);
return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
}
function round(num, ratio) {
const base = Math.pow(10, ratio);
let result = divide(Math.round(Math.abs(times(num, base))), base);
if (num < 0 && result !== 0) {
result = times(result, -1);
}
return result;
}
exports.round = round;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/function/digit.js.map

View File

@@ -0,0 +1,503 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uvUiTools_libs_function_test = require("./test.js");
const uni_modules_uvUiTools_libs_function_digit = require("./digit.js");
function range(min = 0, max = 0, value = 0) {
return Math.max(min, Math.min(max, Number(value)));
}
function getPx(value, unit = false) {
if (uni_modules_uvUiTools_libs_function_test.number(value)) {
return unit ? `${value}px` : Number(value);
}
if (/(rpx|upx)$/.test(value)) {
return unit ? `${common_vendor.index.upx2px(parseInt(value))}px` : Number(common_vendor.index.upx2px(parseInt(value)));
}
return unit ? `${parseInt(value)}px` : parseInt(value);
}
function sleep(value = 30) {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, value);
});
}
function os() {
return common_vendor.index.getSystemInfoSync().platform.toLowerCase();
}
function sys() {
return common_vendor.index.getSystemInfoSync();
}
function random(min, max) {
if (min >= 0 && max > 0 && max >= min) {
const gab = max - min + 1;
return Math.floor(Math.random() * gab + min);
}
return 0;
}
function guid(len = 32, firstU = true, radix = null) {
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
const uuid = [];
radix = radix || chars.length;
if (len) {
for (let i = 0; i < len; i++)
uuid[i] = chars[0 | Math.random() * radix];
} else {
let r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
uuid[14] = "4";
for (let i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
}
}
}
if (firstU) {
uuid.shift();
return `u${uuid.join("")}`;
}
return uuid.join("");
}
function $parent(name = void 0) {
let parent = this.$parent;
while (parent) {
if (parent.$options && parent.$options.name !== name) {
parent = parent.$parent;
} else {
return parent;
}
}
return false;
}
function addStyle(customStyle, target = "object") {
if (uni_modules_uvUiTools_libs_function_test.empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
return customStyle;
}
if (target === "object") {
customStyle = trim(customStyle);
const styleArray = customStyle.split(";");
const style = {};
for (let i = 0; i < styleArray.length; i++) {
if (styleArray[i]) {
const item = styleArray[i].split(":");
style[trim(item[0])] = trim(item[1]);
}
}
return style;
}
let string = "";
for (const i in customStyle) {
const key = i.replace(/([A-Z])/g, "-$1").toLowerCase();
string += `${key}:${customStyle[i]};`;
}
return trim(string);
}
function addUnit(value = "auto", unit = ((_c) => (_c = ((_b) => (_b = ((_a) => (_a = common_vendor.index) == null ? void 0 : _a.$uv)()) == null ? void 0 : _b.config)()) == null ? void 0 : _c.unit)() ? ((_f) => (_f = ((_e) => (_e = ((_d) => (_d = common_vendor.index) == null ? void 0 : _d.$uv)()) == null ? void 0 : _e.config)()) == null ? void 0 : _f.unit)() : "px") {
value = String(value);
return uni_modules_uvUiTools_libs_function_test.number(value) ? `${value}${unit}` : value;
}
function deepClone(obj, cache = /* @__PURE__ */ new WeakMap()) {
if (obj === null || typeof obj !== "object")
return obj;
if (cache.has(obj))
return cache.get(obj);
let clone;
if (obj instanceof Date) {
clone = new Date(obj.getTime());
} else if (obj instanceof RegExp) {
clone = new RegExp(obj);
} else if (obj instanceof Map) {
clone = new Map(Array.from(obj, ([key, value]) => [key, deepClone(value, cache)]));
} else if (obj instanceof Set) {
clone = new Set(Array.from(obj, (value) => deepClone(value, cache)));
} else if (Array.isArray(obj)) {
clone = obj.map((value) => deepClone(value, cache));
} else if (Object.prototype.toString.call(obj) === "[object Object]") {
clone = Object.create(Object.getPrototypeOf(obj));
cache.set(obj, clone);
for (const [key, value] of Object.entries(obj)) {
clone[key] = deepClone(value, cache);
}
} else {
clone = Object.assign({}, obj);
}
cache.set(obj, clone);
return clone;
}
function deepMerge(target = {}, source = {}) {
target = deepClone(target);
if (typeof target !== "object" || target === null || typeof source !== "object" || source === null)
return target;
const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
for (const prop in source) {
if (!source.hasOwnProperty(prop))
continue;
const sourceValue = source[prop];
const targetValue = merged[prop];
if (sourceValue instanceof Date) {
merged[prop] = new Date(sourceValue);
} else if (sourceValue instanceof RegExp) {
merged[prop] = new RegExp(sourceValue);
} else if (sourceValue instanceof Map) {
merged[prop] = new Map(sourceValue);
} else if (sourceValue instanceof Set) {
merged[prop] = new Set(sourceValue);
} else if (typeof sourceValue === "object" && sourceValue !== null) {
merged[prop] = deepMerge(targetValue, sourceValue);
} else {
merged[prop] = sourceValue;
}
}
return merged;
}
function error(err) {
{
common_vendor.index.__f__("error", "at uni_modules/uv-ui-tools/libs/function/index.js:250", `uvui提示${err}`);
}
}
function randomArray(array = []) {
return array.sort(() => Math.random() - 0.5);
}
if (!String.prototype.padStart) {
String.prototype.padStart = function(maxLength, fillString = " ") {
if (Object.prototype.toString.call(fillString) !== "[object String]") {
throw new TypeError(
"fillString must be String"
);
}
const str = this;
if (str.length >= maxLength)
return String(str);
const fillLength = maxLength - str.length;
let times = Math.ceil(fillLength / fillString.length);
while (times >>= 1) {
fillString += fillString;
if (times === 1) {
fillString += fillString;
}
}
return fillString.slice(0, fillLength) + str;
};
}
function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
let date;
if (!dateTime) {
date = /* @__PURE__ */ new Date();
} else if (/^\d{10}$/.test(dateTime == null ? void 0 : dateTime.toString().trim())) {
date = new Date(dateTime * 1e3);
} else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
date = new Date(Number(dateTime));
} else if (typeof dateTime === "string" && dateTime.includes("-") && !dateTime.includes("T")) {
date = new Date(dateTime.replace(/-/g, "/"));
} else {
date = new Date(dateTime);
}
const timeSource = {
"y": date.getFullYear().toString(),
// 年
"m": (date.getMonth() + 1).toString().padStart(2, "0"),
// 月
"d": date.getDate().toString().padStart(2, "0"),
// 日
"h": date.getHours().toString().padStart(2, "0"),
// 时
"M": date.getMinutes().toString().padStart(2, "0"),
// 分
"s": date.getSeconds().toString().padStart(2, "0")
// 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (const key in timeSource) {
const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
if (ret) {
const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
}
}
return formatStr;
}
function timeFrom(timestamp = null, format = "yyyy-mm-dd") {
if (timestamp == null)
timestamp = Number(/* @__PURE__ */ new Date());
timestamp = parseInt(timestamp);
if (timestamp.toString().length == 10)
timestamp *= 1e3;
let timer = (/* @__PURE__ */ new Date()).getTime() - timestamp;
timer = parseInt(timer / 1e3);
let tips = "";
switch (true) {
case timer < 300:
tips = "刚刚";
break;
case (timer >= 300 && timer < 3600):
tips = `${parseInt(timer / 60)}分钟前`;
break;
case (timer >= 3600 && timer < 86400):
tips = `${parseInt(timer / 3600)}小时前`;
break;
case (timer >= 86400 && timer < 2592e3):
tips = `${parseInt(timer / 86400)}天前`;
break;
default:
if (format === false) {
if (timer >= 2592e3 && timer < 365 * 86400) {
tips = `${parseInt(timer / (86400 * 30))}个月前`;
} else {
tips = `${parseInt(timer / (86400 * 365))}年前`;
}
} else {
tips = timeFormat(timestamp, format);
}
}
return tips;
}
function trim(str, pos = "both") {
str = String(str);
if (pos == "both") {
return str.replace(/^\s+|\s+$/g, "");
}
if (pos == "left") {
return str.replace(/^\s*/, "");
}
if (pos == "right") {
return str.replace(/(\s*$)/g, "");
}
if (pos == "all") {
return str.replace(/\s+/g, "");
}
return str;
}
function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
const prefix = isPrefix ? "?" : "";
const _result = [];
if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
arrayFormat = "brackets";
for (const key in data) {
const value = data[key];
if (["", void 0, null].indexOf(value) >= 0) {
continue;
}
if (value.constructor === Array) {
switch (arrayFormat) {
case "indices":
for (let i = 0; i < value.length; i++) {
_result.push(`${key}[${i}]=${value[i]}`);
}
break;
case "brackets":
value.forEach((_value) => {
_result.push(`${key}[]=${_value}`);
});
break;
case "repeat":
value.forEach((_value) => {
_result.push(`${key}=${_value}`);
});
break;
case "comma":
let commaStr = "";
value.forEach((_value) => {
commaStr += (commaStr ? "," : "") + _value;
});
_result.push(`${key}=${commaStr}`);
break;
default:
value.forEach((_value) => {
_result.push(`${key}[]=${_value}`);
});
}
} else {
_result.push(`${key}=${value}`);
}
}
return _result.length ? prefix + _result.join("&") : "";
}
function toast(title, duration = 2e3) {
common_vendor.index.showToast({
title: String(title),
icon: "none",
duration
});
}
function type2icon(type = "success", fill = false) {
if (["primary", "info", "error", "warning", "success"].indexOf(type) == -1)
type = "success";
let iconName = "";
switch (type) {
case "primary":
iconName = "info-circle";
break;
case "info":
iconName = "info-circle";
break;
case "error":
iconName = "close-circle";
break;
case "warning":
iconName = "error-circle";
break;
case "success":
iconName = "checkmark-circle";
break;
default:
iconName = "checkmark-circle";
}
if (fill)
iconName += "-fill";
return iconName;
}
function priceFormat(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
const n = !isFinite(+number2) ? 0 : +number2;
const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
let s = "";
s = (prec ? uni_modules_uvUiTools_libs_function_digit.round(n, prec) + "" : `${Math.round(n)}`).split(".");
const re = /(-?\d+)(\d{3})/;
while (re.test(s[0])) {
s[0] = s[0].replace(re, `$1${sep}$2`);
}
if ((s[1] || "").length < prec) {
s[1] = s[1] || "";
s[1] += new Array(prec - s[1].length + 1).join("0");
}
return s.join(dec);
}
function getDuration(value, unit = true) {
const valueNum = parseInt(value);
if (unit) {
if (/s$/.test(value))
return value;
return value > 30 ? `${value}ms` : `${value}s`;
}
if (/ms$/.test(value))
return valueNum;
if (/s$/.test(value))
return valueNum > 30 ? valueNum : valueNum * 1e3;
return valueNum;
}
function padZero(value) {
return `00${value}`.slice(-2);
}
function formValidate(instance, event) {
const formItem = $parent.call(instance, "uv-form-item");
const form = $parent.call(instance, "uv-form");
if (formItem && form) {
form.validateField(formItem.prop, () => {
}, event);
}
}
function getProperty(obj, key) {
if (!obj) {
return;
}
if (typeof key !== "string" || key === "") {
return "";
}
if (key.indexOf(".") !== -1) {
const keys = key.split(".");
let firstObj = obj[keys[0]] || {};
for (let i = 1; i < keys.length; i++) {
if (firstObj) {
firstObj = firstObj[keys[i]];
}
}
return firstObj;
}
return obj[key];
}
function setProperty(obj, key, value) {
if (!obj) {
return;
}
const inFn = function(_obj, keys, v) {
if (keys.length === 1) {
_obj[keys[0]] = v;
return;
}
while (keys.length > 1) {
const k = keys[0];
if (!_obj[k] || typeof _obj[k] !== "object") {
_obj[k] = {};
}
keys.shift();
inFn(_obj[k], keys, v);
}
};
if (typeof key !== "string" || key === "")
;
else if (key.indexOf(".") !== -1) {
const keys = key.split(".");
inFn(obj, keys, value);
} else {
obj[key] = value;
}
}
function page() {
var _a;
const pages2 = getCurrentPages();
const route = (_a = pages2[pages2.length - 1]) == null ? void 0 : _a.route;
return `/${route ? route : ""}`;
}
function pages() {
const pages2 = getCurrentPages();
return pages2;
}
function getHistoryPage(back = 0) {
const pages2 = getCurrentPages();
const len = pages2.length;
return pages2[len - 1 + back];
}
function setConfig({
props = {},
config = {},
color = {},
zIndex = {}
}) {
const {
deepMerge: deepMerge2
} = common_vendor.index.$uv;
common_vendor.index.$uv.config = deepMerge2(common_vendor.index.$uv.config, config);
common_vendor.index.$uv.props = deepMerge2(common_vendor.index.$uv.props, props);
common_vendor.index.$uv.color = deepMerge2(common_vendor.index.$uv.color, color);
common_vendor.index.$uv.zIndex = deepMerge2(common_vendor.index.$uv.zIndex, zIndex);
}
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
$parent,
addStyle,
addUnit,
deepClone,
deepMerge,
error,
formValidate,
getDuration,
getHistoryPage,
getProperty,
getPx,
guid,
os,
padZero,
page,
pages,
priceFormat,
queryParams,
random,
randomArray,
range,
setConfig,
setProperty,
sleep,
sys,
timeFormat,
timeFrom,
toast,
trim,
type2icon
}, Symbol.toStringTag, { value: "Module" }));
exports.deepMerge = deepMerge;
exports.index = index;
exports.page = page;
exports.queryParams = queryParams;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/function/index.js.map

View File

@@ -0,0 +1,178 @@
"use strict";
function email(value) {
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
}
function mobile(value) {
return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value);
}
function url(value) {
return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(value);
}
function date(value) {
if (!value)
return false;
if (number(value))
value = +value;
return !/Invalid|NaN/.test(new Date(value).toString());
}
function dateISO(value) {
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
}
function number(value) {
return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value);
}
function string(value) {
return typeof value === "string";
}
function digits(value) {
return /^\d+$/.test(value);
}
function idCard(value) {
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
value
);
}
function carNo(value) {
const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
if (value.length === 7) {
return creg.test(value);
}
if (value.length === 8) {
return xreg.test(value);
}
return false;
}
function amount(value) {
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
}
function chinese(value) {
const reg = /^[\u4e00-\u9fa5]+$/gi;
return reg.test(value);
}
function letter(value) {
return /^[a-zA-Z]*$/.test(value);
}
function enOrNum(value) {
const reg = /^[0-9a-zA-Z]*$/g;
return reg.test(value);
}
function contains(value, param) {
return value.indexOf(param) >= 0;
}
function range(value, param) {
return value >= param[0] && value <= param[1];
}
function rangeLength(value, param) {
return value.length >= param[0] && value.length <= param[1];
}
function landline(value) {
const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
return reg.test(value);
}
function empty(value) {
switch (typeof value) {
case "undefined":
return true;
case "string":
if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
return true;
break;
case "boolean":
if (!value)
return true;
break;
case "number":
if (value === 0 || isNaN(value))
return true;
break;
case "object":
if (value === null || value.length === 0)
return true;
for (const i in value) {
return false;
}
return true;
}
return false;
}
function jsonString(value) {
if (typeof value === "string") {
try {
const obj = JSON.parse(value);
if (typeof obj === "object" && obj) {
return true;
}
return false;
} catch (e) {
return false;
}
}
return false;
}
function array(value) {
if (typeof Array.isArray === "function") {
return Array.isArray(value);
}
return Object.prototype.toString.call(value) === "[object Array]";
}
function object(value) {
return Object.prototype.toString.call(value) === "[object Object]";
}
function code(value, len = 6) {
return new RegExp(`^\\d{${len}}$`).test(value);
}
function func(value) {
return typeof value === "function";
}
function promise(value) {
return object(value) && func(value.then) && func(value.catch);
}
function image(value) {
const newValue = value.split("?")[0];
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
return IMAGE_REGEXP.test(newValue);
}
function video(value) {
const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
return VIDEO_REGEXP.test(value);
}
function regExp(o) {
return o && Object.prototype.toString.call(o) === "[object RegExp]";
}
const test = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
amount,
array,
carNo,
chinese,
code,
contains,
date,
dateISO,
digits,
email,
empty,
enOrNum,
func,
idCard,
image,
jsonString,
landline,
letter,
mobile,
number,
object,
promise,
range,
rangeLength,
regExp,
string,
url,
video
}, Symbol.toStringTag, { value: "Module" }));
exports.array = array;
exports.empty = empty;
exports.number = number;
exports.test = test;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/function/test.js.map

View File

@@ -0,0 +1,21 @@
"use strict";
let flag;
function throttle(func, wait = 500, immediate = true) {
if (immediate) {
if (!flag) {
flag = true;
typeof func === "function" && func();
setTimeout(() => {
flag = false;
}, wait);
}
} else if (!flag) {
flag = true;
setTimeout(() => {
flag = false;
typeof func === "function" && func();
}, wait);
}
}
exports.throttle = throttle;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/function/throttle.js.map

View File

@@ -0,0 +1,152 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uvUiTools_libs_function_index = require("../function/index.js");
const uni_modules_uvUiTools_libs_function_test = require("../function/test.js");
const uni_modules_uvUiTools_libs_util_route = require("../util/route.js");
const uni_modules_uvUiTools_libs_function_debounce = require("../function/debounce.js");
const uni_modules_uvUiTools_libs_function_throttle = require("../function/throttle.js");
const mixin = {
// 定义每个组件都可能需要用到的外部样式以及类名
props: {
// 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
customStyle: {
type: [Object, String],
default: () => ({})
},
customClass: {
type: String,
default: ""
},
// 跳转的页面路径
url: {
type: String,
default: ""
},
// 页面跳转的类型
linkType: {
type: String,
default: "navigateTo"
}
},
data() {
return {};
},
onLoad() {
this.$uv.getRect = this.$uvGetRect;
},
created() {
this.$uv.getRect = this.$uvGetRect;
},
computed: {
$uv() {
var _a, _b, _c;
return {
...uni_modules_uvUiTools_libs_function_index.index,
test: uni_modules_uvUiTools_libs_function_test.test,
route: uni_modules_uvUiTools_libs_util_route.route,
debounce: uni_modules_uvUiTools_libs_function_debounce.debounce,
throttle: uni_modules_uvUiTools_libs_function_throttle.throttle,
unit: (_c = (_b = (_a = common_vendor.index) == null ? void 0 : _a.$uv) == null ? void 0 : _b.config) == null ? void 0 : _c.unit
};
},
/**
* 生成bem规则类名
* 由于微信小程序H5nvue之间绑定class的差异无法通过:class="[bem()]"的形式进行同用
* 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
* @param {String} name 组件名称
* @param {Array} fixed 一直会存在的类名
* @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
* @returns {Array|string}
*/
bem() {
return function(name, fixed, change) {
const prefix = `uv-${name}--`;
const classes = {};
if (fixed) {
fixed.map((item) => {
classes[prefix + this[item]] = true;
});
}
if (change) {
change.map((item) => {
this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
});
}
return Object.keys(classes);
};
}
},
methods: {
// 跳转某一个页面
openPage(urlKey = "url") {
const url = this[urlKey];
if (url) {
common_vendor.index[this.linkType]({
url
});
}
},
// 查询节点信息
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸为支付宝的bug(2020-07-21)
// 解决办法为在组件根部再套一个没有任何作用的view元素
$uvGetRect(selector, all) {
return new Promise((resolve) => {
common_vendor.index.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect);
}
if (!all && rect) {
resolve(rect);
}
}).exec();
});
},
getParentData(parentName = "") {
if (!this.parent)
this.parent = {};
this.parent = this.$uv.$parent.call(this, parentName);
if (this.parent.children) {
this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
}
if (this.parent && this.parentData) {
Object.keys(this.parentData).map((key) => {
this.parentData[key] = this.parent[key];
});
}
},
// 阻止事件冒泡
preventEvent(e) {
e && typeof e.stopPropagation === "function" && e.stopPropagation();
},
// 空操作
noop(e) {
this.preventEvent(e);
}
},
onReachBottom() {
common_vendor.index.$emit("uvOnReachBottom");
},
beforeDestroy() {
if (this.parent && uni_modules_uvUiTools_libs_function_test.array(this.parent.children)) {
const childrenList = this.parent.children;
childrenList.map((child, index) => {
if (child === this) {
childrenList.splice(index, 1);
}
});
}
},
// 兼容vue3
unmounted() {
if (this.parent && uni_modules_uvUiTools_libs_function_test.array(this.parent.children)) {
const childrenList = this.parent.children;
childrenList.map((child, index) => {
if (child === this) {
childrenList.splice(index, 1);
}
});
}
}
};
exports.mixin = mixin;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/mixin/mixin.js.map

View File

@@ -0,0 +1,9 @@
"use strict";
const mpMixin = {
// 将自定义节点设置成虚拟的去掉自定义组件包裹层更加接近Vue组件的表现能更好的使用flex属性
options: {
virtualHost: true
}
};
exports.mpMixin = mpMixin;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js.map

View File

@@ -0,0 +1,107 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uvUiTools_libs_function_index = require("../function/index.js");
class Router {
constructor() {
this.config = {
type: "navigateTo",
url: "",
delta: 1,
// navigateBack页面后退时,回退的层数
params: {},
// 传递的参数
animationType: "pop-in",
// 窗口动画,只在APP有效
animationDuration: 300,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept: false,
// 是否需要拦截
events: {}
// 页面间通信接口用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
};
this.route = this.route.bind(this);
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath(url) {
return url[0] === "/" ? url : `/${url}`;
}
// 整合路由参数
mixinParam(url, params) {
url = url && this.addRootPath(url);
let query = "";
if (/.*\/.*\?.*=.*/.test(url)) {
query = uni_modules_uvUiTools_libs_function_index.queryParams(params, false);
return url += `&${query}`;
}
query = uni_modules_uvUiTools_libs_function_index.queryParams(params);
return url += query;
}
// 对外的方法名称
async route(options = {}, params = {}) {
let mergeConfig = {};
if (typeof options === "string") {
mergeConfig.url = this.mixinParam(options, params);
mergeConfig.type = "navigateTo";
} else {
mergeConfig = uni_modules_uvUiTools_libs_function_index.deepMerge(this.config, options);
mergeConfig.url = this.mixinParam(options.url, options.params);
}
if (mergeConfig.url === uni_modules_uvUiTools_libs_function_index.page())
return;
if (params.intercept) {
mergeConfig.intercept = params.intercept;
}
mergeConfig.params = params;
mergeConfig = uni_modules_uvUiTools_libs_function_index.deepMerge(this.config, mergeConfig);
if (typeof mergeConfig.intercept === "function") {
const isNext = await new Promise((resolve, reject) => {
mergeConfig.intercept(mergeConfig, resolve);
});
isNext && this.openPage(mergeConfig);
} else {
this.openPage(mergeConfig);
}
}
// 执行路由跳转
openPage(config) {
const {
url,
type,
delta,
animationType,
animationDuration,
events
} = config;
if (config.type == "navigateTo" || config.type == "to") {
common_vendor.index.navigateTo({
url,
animationType,
animationDuration,
events
});
}
if (config.type == "redirectTo" || config.type == "redirect") {
common_vendor.index.redirectTo({
url
});
}
if (config.type == "switchTab" || config.type == "tab") {
common_vendor.index.switchTab({
url
});
}
if (config.type == "reLaunch" || config.type == "launch") {
common_vendor.index.reLaunch({
url
});
}
if (config.type == "navigateBack" || config.type == "back") {
common_vendor.index.navigateBack({
delta
});
}
}
}
const route = new Router().route;
exports.route = route;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uv-ui-tools/libs/util/route.js.map