no message

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:00:29 +08:00
commit 4d06351f6a
2830 changed files with 166480 additions and 0 deletions

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 @@
<view id="_root" class="{{c}}" style="{{d}}"><slot a:if="{{a}}"/><node a:else u-i="77747352-0" onVI="__l" u-p="{{b||''}}"/></view>

View File

@@ -0,0 +1,267 @@
"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 = " ";
const selector = common_vendor.index.createSelectorQuery().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().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]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"node": "./node/node"
}
}

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;
}

View File

@@ -0,0 +1 @@
<view id="{{b}}" class="{{c}}" style="{{d}}"><block a:for="{{a}}" a:for-item="n" a:key="aF"><image a:if="{{n.a}}" class="_img" style="{{n.b}}" src="{{n.c}}" mode="widthFix"/><rich-text a:if="{{n.d}}" style="{{n.e}}" nodes="{{n.f}}" data-i="{{n.g}}" catchTap="{{n.h}}"/><image a: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}}" onLoad="{{n.t}}" onError="{{n.v}}" catchTap="{{n.w}}" onLongTap="{{n.x}}"/><text a:elif="{{n.y}}">\n</text><view a:elif="{{n.z}}" id="{{n.C}}" class="{{n.D}}" hover-class="_hover" style="{{n.E}}" data-i="{{n.F}}" catchTap="{{n.G}}"><node style="display:inherit" u-i="{{n.A}}" onVI="__l" u-p="{{n.B}}"/></view><video a:elif="{{n.H}}" id="{{n.I}}" class="{{n.J}}" style="{{n.K}}" autoplay="{{n.L}}" controls="{{n.M}}" loop="{{n.N}}" muted="{{n.O}}" object-fit="{{n.P}}" poster="{{n.Q}}" src="{{n.R}}" data-i="{{n.S}}" onPlay="{{n.T}}" onError="{{n.U}}"/><audio a:elif="{{n.V}}" id="{{n.W}}" class="{{n.X}}" style="{{n.Y}}" author="{{n.Z}}" controls="{{n.aa}}" loop="{{n.ab}}" name="{{n.ac}}" poster="{{n.ad}}" src="{{n.ae}}" data-i="{{n.af}}" onPlay="{{n.ag}}" onError="{{n.ah}}"/><view a:elif="{{n.ai}}" id="{{n.an}}" class="{{n.ao}}" style="{{n.ap}}"><node a:if="{{n.aj}}" u-i="{{n.ak}}" onVI="__l" u-p="{{n.al}}"/><block a:else><view a:for="{{n.am}}" a:for-item="tbody" a:key="e" class="{{tbody.f}}" style="{{tbody.g}}"><node a:if="{{tbody.a}}" u-i="{{tbody.b}}" onVI="__l" u-p="{{tbody.c}}"/><block a:else><block a:for="{{tbody.d}}" a:for-item="tr" a:key="i"><view a:if="{{tr.a}}" class="{{tr.d}}" style="{{tr.e}}"><node u-i="{{tr.b}}" onVI="__l" u-p="{{tr.c}}"/></view><view a:else class="{{tr.g}}" style="{{tr.h}}"><view a:for="{{tr.f}}" a:for-item="td" a:key="c" class="{{td.d}}" style="{{td.e}}"><node u-i="{{td.a}}" onVI="__l" u-p="{{td.b}}"/></view></view></block></block></view></block></view><rich-text a:elif="{{n.aq}}" id="{{n.ar}}" style="{{n.as}}" preview="{{false}}" selectable="{{n.at}}" user-select="{{n.av}}" nodes="{{n.aw}}"/><view a:elif="{{n.ax}}" id="{{n.az}}" class="{{n.aA}}" style="{{n.aB}}"><node a:for="{{n.ay}}" a:for-item="n2" a:key="a" style="{{n2.b}}" u-i="{{n2.c}}" onVI="__l" u-p="{{n2.d}}"/></view><node a:else style="{{n.aC}}" u-i="{{n.aD}}" onVI="__l" u-p="{{n.aE||''}}"/></block></view>

View File

@@ -0,0 +1,394 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const block0 = {};
const node = () => Promise.resolve().then(() => RDovcHJvamVjdC_kupHlhYXnlLUvdW5pX21vZHVsZXMvbXAtaHRtbC9jb21wb25lbnRzL21wLWh0bWwvbm9kZS9ub2RlLnZ1ZQ);
const _sfc_main = {
name: "node",
options: {},
data() {
return {
ctrl: {}
};
},
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: {
/**
* @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({
enablesavephoto: this.root.showImgMenu,
enableShowPhotoDownload: 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))
} : 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)),
v: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args)),
w: common_vendor.o((...args) => $options.imgTap && $options.imgTap(...args)),
x: common_vendor.o((...args) => $options.imgLongTap && $options.imgLongTap(...args))
} : n.name === "br" ? {} : n.name === "a" ? {
A: "43170d28-0-" + i0,
B: common_vendor.p({
name: "span",
childs: n.children,
opts: $props.opts
}),
C: n.attrs.id,
D: common_vendor.n((n.attrs.href ? "_a " : "") + n.attrs.class),
E: common_vendor.s("display:inline;" + n.attrs.style),
F: i,
G: common_vendor.o((...args) => $options.linkTap && $options.linkTap(...args))
} : n.name === "video" ? {
I: n.attrs.id,
J: common_vendor.n(n.attrs.class),
K: common_vendor.s(n.attrs.style),
L: n.attrs.autoplay,
M: n.attrs.controls,
N: n.attrs.loop,
O: n.attrs.muted,
P: n.attrs["object-fit"],
Q: n.attrs.poster,
R: n.src[$data.ctrl[i] || 0],
S: i,
T: common_vendor.o((...args) => $options.play && $options.play(...args)),
U: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args))
} : n.name === "audio" ? {
W: n.attrs.id,
X: common_vendor.n(n.attrs.class),
Y: common_vendor.s(n.attrs.style),
Z: n.attrs.author,
aa: n.attrs.controls,
ab: n.attrs.loop,
ac: n.attrs.name,
ad: n.attrs.poster,
ae: n.src[$data.ctrl[i] || 0],
af: i,
ag: common_vendor.o((...args) => $options.play && $options.play(...args)),
ah: common_vendor.o((...args) => $options.mediaError && $options.mediaError(...args))
} : n.name === "table" && n.c || n.name === "li" ? common_vendor.e({
aj: n.name === "li"
}, n.name === "li" ? {
ak: "43170d28-1-" + i0,
al: common_vendor.p({
childs: n.children,
opts: $props.opts
})
} : {
am: 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: "43170d28-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: "43170d28-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: "43170d28-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)
});
})
}, {
an: n.attrs.id,
ao: common_vendor.n("_" + n.name + " " + n.attrs.class),
ap: common_vendor.s(n.attrs.style)
}) : !n.c ? {
ar: n.attrs.id,
as: common_vendor.s("display:inline;" + n.f),
at: $props.opts[4],
av: $props.opts[4],
aw: [n]
} : n.c === 2 ? {
ay: common_vendor.f(n.children, (n2, j, i1) => {
return {
a: j,
b: common_vendor.s(n2.f),
c: "43170d28-5-" + i0 + "-" + i1,
d: common_vendor.p({
name: n2.name,
attrs: n2.attrs,
childs: n2.children,
opts: $props.opts
})
};
}),
az: n.attrs.id,
aA: common_vendor.n("_block _" + n.name + " " + n.attrs.class),
aB: common_vendor.s(n.f + ";" + n.attrs.style)
} : {
aC: common_vendor.s(n.f),
aD: "43170d28-6-" + i0,
aE: common_vendor.p({
name: n.name,
attrs: n.attrs,
childs: n.children,
opts: $props.opts
})
}, {
i: n.name === "img",
y: n.name === "br",
z: n.name === "a",
H: n.name === "video",
V: n.name === "audio",
ai: n.name === "table" && n.c || n.name === "li",
aq: !n.c,
ax: n.c === 2,
aF: 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]]);
my.createComponent(Component);
const RDovcHJvamVjdC_kupHlhYXnlLUvdW5pX21vZHVsZXMvbXAtaHRtbC9jb21wb25lbnRzL21wLWh0bWwvbm9kZS9ub2RlLnZ1ZQ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null
}, Symbol.toStringTag, { value: "Module" }));

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"node": "./node"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
.uni-popup-dialog {
width: 300px;
border-radius: 11px;
background-color: #fff;
}
.uni-dialog-title {
display: flex;
flex-direction: row;
justify-content: center;
padding-top: 25px;
}
.uni-dialog-title-text {
font-size: 16px;
font-weight: 500;
}
.uni-dialog-content {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 20px;
}
.uni-dialog-content-text {
font-size: 14px;
color: #6C6C6C;
}
.uni-dialog-button-group {
display: flex;
flex-direction: row;
border-top-color: #f5f5f5;
border-top-style: solid;
border-top-width: 1px;
}
.uni-dialog-button {
display: flex;
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 45px;
}
.uni-border-left {
border-left-color: #f0f0f0;
border-left-style: solid;
border-left-width: 1px;
}
.uni-dialog-button-text {
font-size: 16px;
color: #333;
}
.uni-button-color {
color: #007aff;
}
.uni-dialog-input {
flex: 1;
font-size: 14px;
border: 1px #eee solid;
height: 40px;
padding: 0 10px;
border-radius: 5px;
color: #555;
}
.uni-popup__success {
color: #4cd964;
}
.uni-popup__warn {
color: #f0ad4e;
}
.uni-popup__error {
color: #dd524d;
}
.uni-popup__info {
color: #909399;
}

View File

@@ -0,0 +1 @@
<view class="uni-popup-dialog"><view class="uni-dialog-title"><text class="{{('uni-dialog-title-text') + ' ' + b}}">{{a}}</text></view><view a:if="{{c}}" class="uni-dialog-content"><slot><text class="uni-dialog-content-text">{{d}}</text></slot></view><view a:else class="uni-dialog-content"><slot><input class="uni-dialog-input" maxlength="{{e}}" type="{{f}}" placeholder="{{g}}" focus="{{h}}" value="{{i}}" onInput="{{j}}"></input></slot></view><view class="uni-dialog-button-group"><view a:if="{{k}}" class="uni-dialog-button" onTap="{{m}}"><text class="uni-dialog-button-text">{{l}}</text></view><view class="{{('uni-dialog-button') + ' ' + o}}" onTap="{{p}}"><text class="uni-dialog-button-text uni-button-color">{{n}}</text></view></view></view>

View File

@@ -0,0 +1,170 @@
"use strict";
const uni_modules_uniPopup_components_uniPopup_popup = require("../uni-popup/popup.js");
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uniPopup_components_uniPopup_i18n_index = require("../uni-popup/i18n/index.js");
const {
t
} = common_vendor.initVueI18n(uni_modules_uniPopup_components_uniPopup_i18n_index.messages);
const _sfc_main = {
name: "uniPopupDialog",
mixins: [uni_modules_uniPopup_components_uniPopup_popup.popup],
emits: ["confirm", "close", "update:modelValue", "input"],
props: {
inputType: {
type: String,
default: "text"
},
showClose: {
type: Boolean,
default: true
},
modelValue: {
type: [Number, String],
default: ""
},
placeholder: {
type: [String, Number],
default: ""
},
type: {
type: String,
default: "error"
},
mode: {
type: String,
default: "base"
},
title: {
type: String,
default: ""
},
content: {
type: String,
default: ""
},
beforeClose: {
type: Boolean,
default: false
},
cancelText: {
type: String,
default: ""
},
confirmText: {
type: String,
default: ""
},
maxlength: {
type: Number,
default: -1
},
focus: {
type: Boolean,
default: true
}
},
data() {
return {
dialogType: "error",
val: ""
};
},
computed: {
okText() {
return this.confirmText || t("uni-popup.ok");
},
closeText() {
return this.cancelText || t("uni-popup.cancel");
},
placeholderText() {
return this.placeholder || t("uni-popup.placeholder");
},
titleText() {
return this.title || t("uni-popup.title");
}
},
watch: {
type(val) {
this.dialogType = val;
},
mode(val) {
if (val === "input") {
this.dialogType = "info";
}
},
value(val) {
if (this.maxlength != -1 && this.mode === "input") {
this.val = val.slice(0, this.maxlength);
} else {
this.val = val;
}
},
val(val) {
this.$emit("update:modelValue", val);
}
},
created() {
this.popup.disableMask();
if (this.mode === "input") {
this.dialogType = "info";
this.val = this.value;
this.val = this.modelValue;
} else {
this.dialogType = this.type;
}
},
methods: {
/**
* 点击确认按钮
*/
onOk() {
if (this.mode === "input") {
this.$emit("confirm", this.val);
} else {
this.$emit("confirm");
}
if (this.beforeClose)
return;
this.popup.close();
},
/**
* 点击取消按钮
*/
closeDialog() {
this.$emit("close");
if (this.beforeClose)
return;
this.popup.close();
},
close() {
this.popup.close();
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($options.titleText),
b: common_vendor.n("uni-popup__" + $data.dialogType),
c: $props.mode === "base"
}, $props.mode === "base" ? {
d: common_vendor.t($props.content)
} : {
e: $props.maxlength,
f: $props.inputType,
g: $options.placeholderText,
h: $props.focus,
i: $data.val,
j: common_vendor.o(($event) => $data.val = $event.detail.value)
}, {
k: $props.showClose
}, $props.showClose ? {
l: common_vendor.t($options.closeText),
m: common_vendor.o((...args) => $options.closeDialog && $options.closeDialog(...args))
} : {}, {
n: common_vendor.t($options.okText),
o: common_vendor.n($props.showClose ? "uni-border-left" : ""),
p: common_vendor.o((...args) => $options.onOk && $options.onOk(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,28 @@
"use strict";
const en = {
"uni-popup.cancel": "cancel",
"uni-popup.ok": "ok",
"uni-popup.placeholder": "pleace enter",
"uni-popup.title": "Hint",
"uni-popup.shareTitle": "Share to"
};
const zhHans = {
"uni-popup.cancel": "取消",
"uni-popup.ok": "确定",
"uni-popup.placeholder": "请输入",
"uni-popup.title": "提示",
"uni-popup.shareTitle": "分享到"
};
const zhHant = {
"uni-popup.cancel": "取消",
"uni-popup.ok": "確定",
"uni-popup.placeholder": "請輸入",
"uni-popup.title": "提示",
"uni-popup.shareTitle": "分享到"
};
const messages = {
en,
"zh-Hans": zhHans,
"zh-Hant": zhHant
};
exports.messages = messages;

View File

@@ -0,0 +1,26 @@
"use strict";
const popup = {
data() {
return {};
},
created() {
this.popup = this.getParent();
},
methods: {
/**
* 获取父元素实例
*/
getParent(name = "uniPopup") {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent)
return false;
parentName = parent.$options.name;
}
return parent;
}
}
};
exports.popup = popup;

View File

@@ -0,0 +1,22 @@
.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 @@
<view a:if="{{a}}" class="{{('uni-popup') + ' ' + k + ' ' + l}}"><view onTouchStart="{{j}}"><uni-transition a:if="{{b}}" key="1" onClick="{{c}}" u-i="2be55be8-0" onVI="__l" u-p="{{d}}"/><uni-transition u-s="{{['d']}}" key="2" onClick="{{h}}" u-i="2be55be8-1" onVI="__l" u-p="{{i}}"><view style="{{e}}" class="{{('uni-popup__wrapper') + ' ' + f}}" onTap="{{g}}"><slot/></view></uni-transition></view></view>

View File

@@ -0,0 +1,393 @@
"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.getSystemInfoSync();
this.popupWidth = windowWidth;
this.popupHeight = windowHeight + (windowTop || 0);
if (safeArea && this.safeArea) {
this.safeAreaInsets = safeAreaInsets.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]) {
console.error("缺少类型:", 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(() => {
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.showPopup = true;
this.showTrans = true;
},
/**
* 中间弹出样式处理
*/
center(type) {
this.popupstyle = "center";
this.ani = ["zoom-out", "fade"];
this.transClass = {
position: "fixed",
display: "flex",
flexDirection: "column",
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: "center",
alignItems: "center",
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
},
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.showPopup = true;
this.showTrans = true;
},
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.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]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"uni-transition": "../../../uni-transition/components/uni-transition/uni-transition"
}
}

View File

@@ -0,0 +1,115 @@
"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;

View File

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

View File

@@ -0,0 +1,265 @@
"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: 1,
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;
for (let i in obj) {
try {
if (typeof obj[i] === "object") {
this.animation[i](...obj[i]);
} else {
this.animation[i](obj[i]);
}
} catch (e) {
console.error(`方法 ${i} 不存在`);
}
}
this.animation.step(config);
return this;
},
/**
* ref 触发 执行动画
*/
run(fn) {
if (!this.animation)
return;
this.animation.run(fn);
},
// 开始过度动画
open() {
clearTimeout(this.timer);
this.transform = "";
this.isShow = true;
let { opacity, transform } = this.styleInit(false);
if (typeof opacity !== "undefined") {
this.opacity = opacity;
}
this.transform = transform;
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.$emit("change", {
detail: this.isShow
});
}, 20);
});
},
// 关闭过度动画
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: ""
};
let buildStyle = (type2, mode) => {
if (mode === "fade") {
styles.opacity = this.animationType(type2)[mode];
} else {
styles.transform += this.animationType(type2)[mode] + " ";
}
};
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 ? 0 : 1,
"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]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,82 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const props = {
props: {
// 头像图片路径(不能为相对路径)
src: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.src
},
// 头像形状circle-圆形square-方形
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.shape
},
// 头像尺寸
size: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.size
},
// 裁剪模式
mode: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.mode
},
// 显示的文字
text: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.text
},
// 背景色
bgColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.bgColor
},
// 文字颜色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.color
},
// 文字大小
fontSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.fontSize
},
// 显示的图标
icon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.icon
},
// 显示小程序头像只对百度微信QQ小程序有效
mpAvatar: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.mpAvatar
},
// 是否使用随机背景色
randomBgColor: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.randomBgColor
},
// 加载失败的默认头像(组件有内置默认图片)
defaultUrl: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.defaultUrl
},
// 如果配置了randomBgColor为true且配置了此值则从默认的背景色数组中取出对应索引的颜色值取值0-19之间
colorIndex: {
type: [String, Number],
// 校验参数规则索引在0-19之间
validator(n) {
return uni_modules_uviewPlus_libs_function_test.test.range(n, [0, 19]) || n === "";
},
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.colorIndex
},
// 组件标识符
name: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.avatar.name
}
}
};
exports.props = props;

View File

@@ -0,0 +1,35 @@
.u-empty.data-v-34d954f9,
.u-empty__wrap.data-v-34d954f9,
.u-tabs.data-v-34d954f9,
.u-tabs__wrapper.data-v-34d954f9,
.u-tabs__wrapper__scroll-view-wrapper.data-v-34d954f9,
.u-tabs__wrapper__scroll-view.data-v-34d954f9,
.u-tabs__wrapper__nav.data-v-34d954f9,
.u-tabs__wrapper__nav__line.data-v-34d954f9 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-avatar.data-v-34d954f9 {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.u-avatar--circle.data-v-34d954f9 {
border-radius: 100px;
}
.u-avatar--square.data-v-34d954f9 {
border-radius: 4px;
}
.u-avatar__image--circle.data-v-34d954f9 {
border-radius: 100px;
overflow: hidden;
}
.u-avatar__image--square.data-v-34d954f9 {
border-radius: 4px;
}

View File

@@ -0,0 +1 @@
<view class="{{('u-avatar') + ' ' + 'data-v-34d954f9' + ' ' + k}}" style="{{l + ';' + m}}" onTap="{{n}}"><slot><block a:if="{{a}}"></block><u-icon a:elif="{{b}}" class="data-v-34d954f9" u-i="34d954f9-0" onVI="__l" u-p="{{c}}"></u-icon><up-text a:elif="{{d}}" class="data-v-34d954f9" u-i="34d954f9-1" onVI="__l" u-p="{{e}}"></up-text><image a:else class="{{('u-avatar__image') + ' ' + 'data-v-34d954f9' + ' ' + f}}" src="{{g}}" mode="{{h}}" onError="{{i}}" style="{{j}}"></image></slot></view>

View File

@@ -0,0 +1,132 @@
"use strict";
const uni_modules_uviewPlus_components_uAvatar_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const base64Avatar = "data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzYgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjREMEQwRkY0RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjREMEQwRkY1RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEQwRDBGRjJGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEQwRDBGRjNGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAGBAQEBQQGBQUGCQYFBgkLCAYGCAsMCgoLCgoMEAwMDAwMDBAMDg8QDw4MExMUFBMTHBsbGxwfHx8fHx8fHx8fAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCADIAMgDAREAAhEBAxEB/8QAcQABAQEAAwEBAAAAAAAAAAAAAAUEAQMGAgcBAQAAAAAAAAAAAAAAAAAAAAAQAAIBAwICBgkDBQAAAAAAAAABAhEDBCEFMVFBYXGREiKBscHRMkJSEyOh4XLxYjNDFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A/fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHbHFyZ/Dam+yLA+Z2L0Pjtyj2poD4AAAAAAAAAAAAAAAAAAAAAAAAKWFs9y6lcvvwQeqj8z9wFaziY1n/HbUX9XF97A7QAGXI23EvJ1goyfzR0YEfN269jeZ+a03pNe0DIAAAAAAAAAAAAAAAAAAAACvtO3RcVkXlWutuL9YFYAAAAAOJRjKLjJVi9GmB5/csH/mu1h/in8PU+QGMAAAAAAAAAAAAAAAAAAaMDG/6MmMH8C80+xAelSSVFolwQAAAAAAAHVlWI37ErUulaPk+hgeYnCUJuElSUXRrrQHAAAAAAAAAAAAAAAAABa2Oz4bM7r4zdF2ICmAAAAAAAAAg7zZ8GX41wuJP0rRgYAAAAAAAAAAAAAAAAAD0m2R8ODaXU33tsDSAAAAAAAAAlb9HyWZcnJd9PcBHAAAAAAAAAAAAAAAAAPS7e64Vn+KA0AAAAAAAAAJm+v8Ftf3ewCKAAAAAAAAAAAAAAAAAX9muqeGo9NttP06+0DcAAAAAAAAAjb7dTu2ra+VOT9P8AQCWAAAAAAAAAAAAAAAAAUNmyPt5Ltv4bui/kuAF0AAAAAAADiUlGLlJ0SVW+oDzOXfd/Ind6JPRdS0QHSAAAAAAAAAAAAAAAAAE2nVaNcGB6Lbs6OTao9LsF51z60BrAAAAAABJ3jOVHjW3r/sa9QEgAAAAAAAAAAAAAAAAAAAPu1duWriuW34ZR4MC9hbnZyEoy8l36XwfYBsAAADaSq9EuLAlZ+7xSdrGdW9Hc5dgEdtt1erfFgAAAAAAAAAAAAAAAAADVjbblX6NR8MH80tEBRs7HYivyzlN8lovaBPzduvY0m6eK10TXtAyAarO55lpJK54orolr+4GqO/Xaea1FvqbXvA+Z77kNeW3GPbV+4DJfzcm/pcm3H6Vou5AdAFLC2ed2Pjv1txa8sV8T6wOL+yZEKu1JXFy4MDBOE4ScZxcZLinoB8gAAAAAAAAAAAB242LeyJ+C3GvN9C7QLmJtePYpKS+5c+p8F2IDYAANJqj1T4oCfk7Nj3G5Wn9qXJax7gJ93Z82D8sVNc4v30A6Xg5i42Z+iLfqARwcyT0sz9MWvWBps7LlTf5Grce9/oBTxdtxseklHxT+uWr9AGoAB138ezfj4bsFJdD6V2MCPm7RdtJzs1uW1xXzL3gTgAAAAAAAAADRhYc8q74I6RWs5ckB6GxYtWLat21SK731sDsAAAAAAAAAAAAAAAASt021NO/YjrxuQXT1oCOAAAAAAABzGLlJRSq26JAelwsWONYjbXxcZvmwO8AAAAAAAAAAAAAAAAAAef3TEWPkVivx3NY9T6UBiAAAAAABo2+VmGXblddIJ8eivRUD0oAAAAAAAAAAAAAAAAAAAYt4tKeFKVNYNSXfRgefAAAAAAAAr7VuSSWPedKaW5v1MCsAAAAAAAAAAAAAAAAAAIe6bj96Ts2n+JPzSXzP3ATgAAAAAAAAFbbt1UUrOQ9FpC4/UwK6aaqtU+DAAAAAAAAAAAAAAA4lKMIuUmoxWrb4ARNx3R3q2rLpa4Sl0y/YCcAAAAAAAAAAANmFud7G8r89r6X0dgFvGzLGRGtuWvTF6NAdwAAAAAAAAAAAy5W442PVN+K59EePp5ARMvOv5MvO6QXCC4AZwAAAAAAAAAAAAAcxlKLUotprg1owN+PvORborq+7Hnwl3gUbO74VzRydt8pKn68ANcJwmqwkpLmnUDkAAAAfNy9atqtyagut0AxXt5xIV8Fbj6lRd7Am5G65V6qUvtwfyx94GMAAAAAAAAAAAAAAAAAAAOU2nVOj5gdsc3LiqRvTpyqwOxbnnrhdfpSfrQB7pnv/AGvuS9gHXPMy5/Fem1yq0v0A6W29XqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//Z";
const _sfc_main = {
name: "u-avatar",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uAvatar_props.props],
data() {
return {
// 如果配置randomBgColor参数为true在图标或者文字的模式下会随机从中取出一个颜色值当做背景色
colors: [
"#ffb34b",
"#f2bba9",
"#f7a196",
"#f18080",
"#88a867",
"#bfbf39",
"#89c152",
"#94d554",
"#f19ec2",
"#afaae4",
"#e1b0df",
"#c38cc1",
"#72dcdc",
"#9acdcb",
"#77b1cc",
"#448aca",
"#86cefa",
"#98d1ee",
"#73d1f1",
"#80a7dc"
],
avatarUrl: this.src,
allowMp: false
};
},
watch: {
// 监听头像src的变化赋值给内部的avatarUrl变量因为图片加载失败时需要修改图片的src为默认值
// 而组件内部不能直接修改props的值所以需要一个中间变量
src: {
immediate: true,
handler(newVal) {
this.avatarUrl = newVal;
if (!newVal) {
this.errorHandler();
}
}
}
},
computed: {
imageStyle() {
const style = {};
return style;
}
},
created() {
this.init();
},
emits: ["click"],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
random: uni_modules_uviewPlus_libs_function_index.random,
init() {
},
// 判断传入的name属性是否图片路径只要带有"/"均认为是图片形式
isImg() {
return this.src.indexOf("/") !== -1;
},
// 图片加载时失败时触发
errorHandler() {
this.avatarUrl = this.defaultUrl || base64Avatar;
},
clickHandler() {
this.$emit("click", this.name);
}
}
};
if (!Array) {
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
const _easycom_up_text2 = common_vendor.resolveComponent("up-text");
(_easycom_u_icon2 + _easycom_up_text2)();
}
const _easycom_u_icon = () => "../u-icon/u-icon.js";
const _easycom_up_text = () => "../u-text/u-text.js";
if (!Math) {
(_easycom_u_icon + _easycom_up_text)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.mpAvatar && $data.allowMp
}, _ctx.mpAvatar && $data.allowMp ? {} : _ctx.icon ? {
c: common_vendor.p({
name: _ctx.icon,
size: _ctx.fontSize,
color: _ctx.color
})
} : _ctx.text ? {
e: common_vendor.p({
text: _ctx.text,
size: _ctx.fontSize,
color: _ctx.color,
align: "center",
customStyle: "justify-content: center"
})
} : {
f: common_vendor.n(`u-avatar__image--${_ctx.shape}`),
g: $data.avatarUrl || _ctx.defaultUrl,
h: _ctx.mode,
i: common_vendor.o((...args) => $options.errorHandler && $options.errorHandler(...args)),
j: common_vendor.s({
width: $options.addUnit(_ctx.size),
height: $options.addUnit(_ctx.size)
})
}, {
b: _ctx.icon,
d: _ctx.text,
k: common_vendor.n(`u-avatar--${_ctx.shape}`),
l: common_vendor.s({
backgroundColor: _ctx.text || _ctx.icon ? _ctx.randomBgColor ? $data.colors[_ctx.colorIndex !== "" ? _ctx.colorIndex : $options.random(0, 19)] : _ctx.bgColor : "transparent",
width: $options.addUnit(_ctx.size),
height: $options.addUnit(_ctx.size)
}),
m: common_vendor.s($options.addStyle(_ctx.customStyle)),
n: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-34d954f9"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,8 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-icon": "../u-icon/u-icon",
"up-text": "../u-text/u-text"
}
}

View File

@@ -0,0 +1,155 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 是否细边框
hairline: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.hairline
},
// 按钮的预置样式infoprimaryerrorwarningsuccess
type: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.type
},
// 按钮尺寸largenormalsmallmini
size: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.size
},
// 按钮形状circle两边为半圆square带圆角
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.shape
},
// 按钮是否镂空
plain: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.plain
},
// 是否禁止状态
disabled: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.disabled
},
// 是否加载中
loading: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.loading
},
// 加载中提示文字
loadingText: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.loadingText
},
// 加载状态图标类型
loadingMode: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.loadingMode
},
// 加载图标大小
loadingSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.loadingSize
},
// 开放能力具体请看uniapp稳定关于button组件部分说明
// https://uniapp.dcloud.io/component/button
openType: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.openType
},
// 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
// 取值为submit提交表单reset重置表单
formType: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.formType
},
// 打开 APP 时,向 APP 传递的参数open-type=launchApp时有效
// 只微信小程序、QQ小程序有效
appParameter: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.appParameter
},
// 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
hoverStopPropagation: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.hoverStopPropagation
},
// 指定返回用户信息的语言zh_CN 简体中文zh_TW 繁体中文en 英文。只微信小程序有效
lang: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.lang
},
// 会话来源open-type="contact"时有效。只微信小程序有效
sessionFrom: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.sessionFrom
},
// 会话内消息卡片标题open-type="contact"时有效
// 默认当前标题,只微信小程序有效
sendMessageTitle: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.sendMessageTitle
},
// 会话内消息卡片点击跳转小程序路径open-type="contact"时有效
// 默认当前分享路径,只微信小程序有效
sendMessagePath: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.sendMessagePath
},
// 会话内消息卡片图片open-type="contact"时有效
// 默认当前页面截图,只微信小程序有效
sendMessageImg: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.sendMessageImg
},
// 是否显示会话内消息卡片,设置此参数为 true用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
// 用户点击后可以快速发送小程序消息open-type="contact"时有效
showMessageCard: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.showMessageCard
},
// 额外传参参数用于小程序的data-xxx属性通过target.dataset.name获取
dataName: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.dataName
},
// 节流,一定时间内只能触发一次
throttleTime: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.throttleTime
},
// 按住后多久出现点击态,单位毫秒
hoverStartTime: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.hoverStartTime
},
// 手指松开后点击态保留时间,单位毫秒
hoverStayTime: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.hoverStayTime
},
// 按钮文字之所以通过props传入是因为slot传入的话
// nvue中无法控制文字的样式
text: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.text
},
// 按钮图标
icon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.icon
},
// 按钮图标
iconColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.icon
},
// 按钮颜色支持传入linear-gradient渐变色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.button.color
}
}
};
exports.props = props;

View File

@@ -0,0 +1,163 @@
.u-empty.data-v-5ce41ee6,
.u-empty__wrap.data-v-5ce41ee6,
.u-tabs.data-v-5ce41ee6,
.u-tabs__wrapper.data-v-5ce41ee6,
.u-tabs__wrapper__scroll-view-wrapper.data-v-5ce41ee6,
.u-tabs__wrapper__scroll-view.data-v-5ce41ee6,
.u-tabs__wrapper__nav.data-v-5ce41ee6,
.u-tabs__wrapper__nav__line.data-v-5ce41ee6 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-button.data-v-5ce41ee6 {
width: 100%;
white-space: nowrap;
}
.u-button__text.data-v-5ce41ee6 {
white-space: nowrap;
line-height: 1;
}
.u-button.data-v-5ce41ee6:before {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
border: inherit;
border-radius: inherit;
transform: translate(-50%, -50%);
opacity: 0;
content: " ";
background-color: #000;
border-color: #000;
}
.u-button--active.data-v-5ce41ee6:before {
opacity: 0.15;
}
.u-button__icon + .u-button__text.data-v-5ce41ee6:not(:empty), .u-button__loading-text.data-v-5ce41ee6 {
margin-left: 4px;
}
.u-button--plain.u-button--primary.data-v-5ce41ee6 {
color: #3c9cff;
}
.u-button--plain.u-button--info.data-v-5ce41ee6 {
color: #909399;
}
.u-button--plain.u-button--success.data-v-5ce41ee6 {
color: #5ac725;
}
.u-button--plain.u-button--error.data-v-5ce41ee6 {
color: #f56c6c;
}
.u-button--plain.u-button--warning.data-v-5ce41ee6 {
color: #f56c6c;
}
.u-button.data-v-5ce41ee6 {
height: 38px;
position: relative;
align-items: center;
justify-content: center;
display: flex;
flex-direction: row;
box-sizing: border-box;
flex-direction: row;
}
.u-button__text.data-v-5ce41ee6 {
font-size: 15px;
}
.u-button__loading-text.data-v-5ce41ee6 {
font-size: 15px;
margin-left: 4px;
}
.u-button--large.data-v-5ce41ee6 {
width: 100%;
height: 50px;
padding: 0 15px;
}
.u-button--normal.data-v-5ce41ee6 {
padding: 0 12px;
font-size: 14px;
}
.u-button--small.data-v-5ce41ee6 {
min-width: 60px;
height: 30px;
padding: 0px 8px;
font-size: 12px;
}
.u-button--mini.data-v-5ce41ee6 {
height: 22px;
font-size: 10px;
min-width: 50px;
padding: 0px 8px;
}
.u-button--disabled.data-v-5ce41ee6 {
opacity: 0.5;
}
.u-button--info.data-v-5ce41ee6 {
color: #323233;
background-color: #fff;
border-color: #ebedf0;
border-width: 1px;
border-style: solid;
}
.u-button--success.data-v-5ce41ee6 {
color: #fff;
background-color: #5ac725;
border-color: #5ac725;
border-width: 1px;
border-style: solid;
}
.u-button--primary.data-v-5ce41ee6 {
color: #fff;
background-color: #3c9cff;
border-color: #3c9cff;
border-width: 1px;
border-style: solid;
}
.u-button--error.data-v-5ce41ee6 {
color: #fff;
background-color: #f56c6c;
border-color: #f56c6c;
border-width: 1px;
border-style: solid;
}
.u-button--warning.data-v-5ce41ee6 {
color: #fff;
background-color: #f9ae3d;
border-color: #f9ae3d;
border-width: 1px;
border-style: solid;
}
.u-button--block.data-v-5ce41ee6 {
display: flex;
flex-direction: row;
width: 100%;
}
.u-button--circle.data-v-5ce41ee6 {
border-top-right-radius: 100px;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
}
.u-button--square.data-v-5ce41ee6 {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.u-button__icon.data-v-5ce41ee6 {
min-width: 1em;
line-height: inherit !important;
vertical-align: top;
}
.u-button--plain.data-v-5ce41ee6 {
background-color: #fff;
}
.u-button--hairline.data-v-5ce41ee6 {
border-width: 0.5px !important;
}

View File

@@ -0,0 +1 @@
<button hover-start-time="{{i}}" hover-stay-time="{{j}}" form-type="{{k}}" open-type="{{l}}" app-parameter="{{m}}" hover-stop-propagation="{{n}}" send-message-title="{{o}}" send-message-path="{{p}}" lang="{{q}}" data-name="{{r}}" session-from="{{s}}" send-message-img="{{t}}" show-message-card="{{v}}" onGetphonenumber="{{w}}" onGetuserinfo="{{x}}" onError="{{y}}" onOpensetting="{{z}}" onLaunchapp="{{A}}" onAgreeprivacyauthorization="{{B}}" hover-class="{{C}}" style="{{D + ';' + E}}" onTap="{{F}}" class="{{('u-button') + ' ' + 'u-reset-button' + ' ' + 'data-v-5ce41ee6' + ' ' + G}}"><block a:if="{{a}}"><u-loading-icon class="data-v-5ce41ee6" u-i="5ce41ee6-0" onVI="__l" u-p="{{b}}"></u-loading-icon><text class="u-button__loading-text data-v-5ce41ee6" style="{{d}}">{{c}}</text></block><block a:else><u-icon a:if="{{e}}" class="data-v-5ce41ee6" u-i="5ce41ee6-1" onVI="__l" u-p="{{f}}"></u-icon><slot><text class="u-button__text data-v-5ce41ee6" style="{{h}}">{{g}}</text></slot></block></button>

View File

@@ -0,0 +1,207 @@
"use strict";
const uni_modules_uviewPlus_libs_mixin_button = require("../../libs/mixin/button.js");
const uni_modules_uviewPlus_libs_mixin_openType = require("../../libs/mixin/openType.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_components_uButton_props = require("./props.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_throttle = require("../../libs/function/throttle.js");
const uni_modules_uviewPlus_libs_config_color = require("../../libs/config/color.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-button",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_libs_mixin_button.button, uni_modules_uviewPlus_libs_mixin_openType.openType, uni_modules_uviewPlus_components_uButton_props.props],
data() {
return {};
},
computed: {
// 生成bem风格的类名
bemClass() {
if (!this.color) {
return this.bem(
"button",
["type", "shape", "size"],
["disabled", "plain", "hairline"]
);
} else {
return this.bem(
"button",
["shape", "size"],
["disabled", "plain", "hairline"]
);
}
},
loadingColor() {
if (this.plain) {
return this.color ? this.color : uni_modules_uviewPlus_libs_config_color.color[`u-${this.type}`];
}
if (this.type === "info") {
return "#c9c9c9";
}
return "rgb(200, 200, 200)";
},
iconColorCom() {
if (this.iconColor)
return this.iconColor;
if (this.plain) {
return this.color ? this.color : this.type;
} else {
return this.type === "info" ? "#000000" : "#ffffff";
}
},
baseColor() {
let style = {};
if (this.color) {
style.color = this.plain ? this.color : "white";
if (!this.plain) {
style["background-color"] = this.color;
}
if (this.color.indexOf("gradient") !== -1) {
style.borderTopWidth = 0;
style.borderRightWidth = 0;
style.borderBottomWidth = 0;
style.borderLeftWidth = 0;
if (!this.plain) {
style.backgroundImage = this.color;
}
} else {
style.borderColor = this.color;
style.borderWidth = "1px";
style.borderStyle = "solid";
}
}
return style;
},
// nvue版本按钮的字体不会继承父组件的颜色需要对每一个text组件进行单独的设置
nvueTextStyle() {
let style = {};
if (this.type === "info") {
style.color = "#323233";
}
if (this.color) {
style.color = this.plain ? this.color : "white";
}
style.fontSize = this.textSize + "px";
return style;
},
// 字体大小
textSize() {
let fontSize = 14, { size } = this;
if (size === "large")
fontSize = 16;
if (size === "normal")
fontSize = 14;
if (size === "small")
fontSize = 12;
if (size === "mini")
fontSize = 10;
return fontSize;
}
},
emits: [
"click",
"getphonenumber",
"getuserinfo",
"error",
"opensetting",
"launchapp",
"agreeprivacyauthorization"
],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
clickHandler() {
if (!this.disabled && !this.loading) {
uni_modules_uviewPlus_libs_function_throttle.throttle(() => {
this.$emit("click");
}, this.throttleTime);
}
},
// 下面为对接uniapp官方按钮开放能力事件回调的对接
getphonenumber(res) {
this.$emit("getphonenumber", res);
},
getuserinfo(res) {
this.$emit("getuserinfo", res);
},
error(res) {
this.$emit("error", res);
},
opensetting(res) {
this.$emit("opensetting", res);
},
launchapp(res) {
this.$emit("launchapp", res);
},
agreeprivacyauthorization(res) {
this.$emit("agreeprivacyauthorization", res);
}
}
};
if (!Array) {
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
(_easycom_u_loading_icon2 + _easycom_u_icon2)();
}
const _easycom_u_loading_icon = () => "../u-loading-icon/u-loading-icon.js";
const _easycom_u_icon = () => "../u-icon/u-icon.js";
if (!Math) {
(_easycom_u_loading_icon + _easycom_u_icon)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.loading
}, _ctx.loading ? {
b: common_vendor.p({
mode: _ctx.loadingMode,
size: _ctx.loadingSize * 1.15,
color: $options.loadingColor
}),
c: common_vendor.t(_ctx.loadingText || _ctx.text),
d: common_vendor.s({
fontSize: $options.textSize + "px"
})
} : common_vendor.e({
e: _ctx.icon
}, _ctx.icon ? {
f: common_vendor.p({
name: _ctx.icon,
color: $options.iconColorCom,
size: $options.textSize * 1.35,
customStyle: {
marginRight: "2px"
}
})
} : {}, {
g: common_vendor.t(_ctx.text),
h: common_vendor.s({
fontSize: $options.textSize + "px"
})
}), {
i: Number(_ctx.hoverStartTime),
j: Number(_ctx.hoverStayTime),
k: _ctx.formType,
l: _ctx.openType,
m: _ctx.appParameter,
n: _ctx.hoverStopPropagation,
o: _ctx.sendMessageTitle,
p: _ctx.sendMessagePath,
q: _ctx.lang,
r: _ctx.dataName,
s: _ctx.sessionFrom,
t: _ctx.sendMessageImg,
v: _ctx.showMessageCard,
w: common_vendor.o((...args) => $options.getphonenumber && $options.getphonenumber(...args)),
x: common_vendor.o((...args) => $options.getuserinfo && $options.getuserinfo(...args)),
y: common_vendor.o((...args) => $options.error && $options.error(...args)),
z: common_vendor.o((...args) => $options.opensetting && $options.opensetting(...args)),
A: common_vendor.o((...args) => $options.launchapp && $options.launchapp(...args)),
B: common_vendor.o((...args) => $options.agreeprivacyauthorization && $options.agreeprivacyauthorization(...args)),
C: !_ctx.disabled && !_ctx.loading ? "u-button--active" : "",
D: common_vendor.s($options.baseColor),
E: common_vendor.s($options.addStyle(_ctx.customStyle)),
F: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
G: common_vendor.n($options.bemClass)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5ce41ee6"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,8 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-loading-icon": "../u-loading-icon/u-loading-icon",
"u-icon": "../u-icon/u-icon"
}
}

View File

@@ -0,0 +1,17 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 分组标题
title: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cellGroup.title
},
// 是否显示外边框
border: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cellGroup.border
}
}
};
exports.props = props;

View File

@@ -0,0 +1,30 @@
.u-empty.data-v-014d39dc,
.u-empty__wrap.data-v-014d39dc,
.u-tabs.data-v-014d39dc,
.u-tabs__wrapper.data-v-014d39dc,
.u-tabs__wrapper__scroll-view-wrapper.data-v-014d39dc,
.u-tabs__wrapper__scroll-view.data-v-014d39dc,
.u-tabs__wrapper__nav.data-v-014d39dc,
.u-tabs__wrapper__nav__line.data-v-014d39dc {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-cell-group.data-v-014d39dc {
flex: 1;
}
.u-cell-group__title.data-v-014d39dc {
padding: 16px 16px 8px;
}
.u-cell-group__title__text.data-v-014d39dc {
font-size: 15px;
line-height: 16px;
color: #303133;
}
.u-cell-group__wrapper.data-v-014d39dc {
position: relative;
}

View File

@@ -0,0 +1 @@
<view style="{{d}}" class="{{(e) + ' ' + 'u-cell-group' + ' ' + 'data-v-014d39dc'}}"><view a:if="{{a}}" class="u-cell-group__title data-v-014d39dc"><slot name="title"><text class="u-cell-group__title__text data-v-014d39dc">{{b}}</text></slot></view><view class="u-cell-group__wrapper data-v-014d39dc"><u-line a:if="{{c}}" class="data-v-014d39dc" u-i="014d39dc-0" onVI="__l"></u-line><slot/></view></view>

View File

@@ -0,0 +1,35 @@
"use strict";
const uni_modules_uviewPlus_components_uCellGroup_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-cell-group",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCellGroup_props.props],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle
}
};
if (!Array) {
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
_easycom_u_line2();
}
const _easycom_u_line = () => "../u-line/u-line.js";
if (!Math) {
_easycom_u_line();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.title
}, _ctx.title ? {
b: common_vendor.t(_ctx.title)
} : {}, {
c: _ctx.border
}, _ctx.border ? {} : {}, {
d: common_vendor.s($options.addStyle(_ctx.customStyle)),
e: common_vendor.n(_ctx.customClass)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-014d39dc"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-line": "../u-line/u-line"
}
}

View File

@@ -0,0 +1,113 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 标题
title: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.title
},
// 标题下方的描述信息
label: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.label
},
// 右侧的内容
value: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.value
},
// 左侧图标名称,或者图片链接(本地文件建议使用绝对地址)
icon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.icon
},
// 是否禁用cell
disabled: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.disabled
},
// 是否显示下边框
border: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.border
},
// 内容是否垂直居中(主要是针对右侧的value部分)
center: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.center
},
// 点击后跳转的URL地址
url: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.url
},
// 链接跳转的方式内部使用的是uView封装的route方法可能会进行拦截操作
linkType: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.linkType
},
// 是否开启点击反馈(表现为点击时加上灰色背景)
clickable: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.clickable
},
// 是否展示右侧箭头并开启点击反馈
isLink: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.isLink
},
// 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件)
required: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.required
},
// 右侧的图标箭头
rightIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.rightIcon
},
// 右侧箭头的方向可选值为leftupdown
arrowDirection: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.arrowDirection
},
// 左侧图标样式
iconStyle: {
type: [Object, String],
default: () => {
return uni_modules_uviewPlus_libs_config_props.defProps.cell.iconStyle;
}
},
// 右侧箭头图标的样式
rightIconStyle: {
type: [Object, String],
default: () => {
return uni_modules_uviewPlus_libs_config_props.defProps.cell.rightIconStyle;
}
},
// 标题的样式
titleStyle: {
type: [Object, String],
default: () => {
return uni_modules_uviewPlus_libs_config_props.defProps.cell.titleStyle;
}
},
// 单位元的大小可选值为large
size: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.size
},
// 点击cell是否阻止事件传播
stop: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.stop
},
// 标识符cell被点击时返回
name: {
type: [Number, String],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.cell.name
}
}
};
exports.props = props;

View File

@@ -0,0 +1,94 @@
.u-empty.data-v-3fd6feca,
.u-empty__wrap.data-v-3fd6feca,
.u-tabs.data-v-3fd6feca,
.u-tabs__wrapper.data-v-3fd6feca,
.u-tabs__wrapper__scroll-view-wrapper.data-v-3fd6feca,
.u-tabs__wrapper__scroll-view.data-v-3fd6feca,
.u-tabs__wrapper__nav.data-v-3fd6feca,
.u-tabs__wrapper__nav__line.data-v-3fd6feca {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-cell__body.data-v-3fd6feca {
display: flex;
flex-direction: row;
box-sizing: border-box;
padding: 13px 15px;
font-size: 15px;
color: #303133;
align-items: center;
}
.u-cell__body__content.data-v-3fd6feca {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
}
.u-cell__body--large.data-v-3fd6feca {
padding-top: 13px;
padding-bottom: 13px;
}
.u-cell__left-icon-wrap.data-v-3fd6feca, .u-cell__right-icon-wrap.data-v-3fd6feca {
display: flex;
flex-direction: row;
align-items: center;
font-size: 16px;
}
.u-cell__left-icon-wrap.data-v-3fd6feca {
margin-right: 4px;
}
.u-cell__right-icon-wrap.data-v-3fd6feca {
margin-left: 4px;
transition: transform 0.3s;
}
.u-cell__right-icon-wrap--up.data-v-3fd6feca {
transform: rotate(-90deg);
}
.u-cell__right-icon-wrap--down.data-v-3fd6feca {
transform: rotate(90deg);
}
.u-cell__title.data-v-3fd6feca {
flex: 1;
}
.u-cell__title-text.data-v-3fd6feca {
font-size: 15px;
line-height: 22px;
color: #303133;
}
.u-cell__title-text--large.data-v-3fd6feca {
font-size: 16px;
}
.u-cell__label.data-v-3fd6feca {
margin-top: 5px;
font-size: 12px;
color: #909193;
line-height: 18px;
}
.u-cell__label--large.data-v-3fd6feca {
font-size: 14px;
}
.u-cell__value.data-v-3fd6feca {
text-align: right;
margin-left: auto;
font-size: 14px;
line-height: 24px;
color: #606266;
}
.u-cell__value--large.data-v-3fd6feca {
font-size: 15px;
}
.u-cell--clickable.data-v-3fd6feca {
background-color: #f3f4f6;
}
.u-cell--disabled.data-v-3fd6feca {
color: #c8c9cc;
cursor: not-allowed;
}
.u-cell--center.data-v-3fd6feca {
align-items: center;
}

View File

@@ -0,0 +1 @@
<view class="{{('u-cell') + ' ' + 'data-v-3fd6feca' + ' ' + A}}" style="{{B}}" hover-class="{{C}}" hover-stay-time="{{250}}" onTap="{{D}}"><view class="{{('u-cell__body') + ' ' + 'data-v-3fd6feca' + ' ' + x + ' ' + y}}"><view class="u-cell__body__content data-v-3fd6feca"><view a:if="{{a}}" class="u-cell__left-icon-wrap data-v-3fd6feca"><slot a:if="{{b}}" name="icon"></slot><u-icon a:else class="data-v-3fd6feca" u-i="3fd6feca-0" onVI="__l" u-p="{{c||''}}"></u-icon></view><view class="u-cell__title data-v-3fd6feca"><slot a:if="{{d}}" name="title"></slot><text a:else style="{{f}}" class="{{('u-cell__title-text') + ' ' + 'data-v-3fd6feca' + ' ' + g + ' ' + h}}">{{e}}</text><slot name="label"><text a:if="{{i}}" class="{{('u-cell__label') + ' ' + 'data-v-3fd6feca' + ' ' + k + ' ' + l}}">{{j}}</text></slot></view></view><slot name="value"><text a:if="{{m}}" class="{{('u-cell__value') + ' ' + 'data-v-3fd6feca' + ' ' + o + ' ' + p}}">{{n}}</text></slot><view a:if="{{q}}" class="{{('u-cell__right-icon-wrap') + ' ' + 'data-v-3fd6feca' + ' ' + t}}"><u-icon a:if="{{r}}" class="data-v-3fd6feca" u-i="3fd6feca-1" onVI="__l" u-p="{{s}}"></u-icon><slot a:else name="right-icon"></slot></view><view a:if="{{v}}" class="{{('u-cell__right-icon-wrap') + ' ' + 'data-v-3fd6feca' + ' ' + w}}"><slot name="righticon"></slot></view></view><u-line a:if="{{z}}" class="data-v-3fd6feca" u-i="3fd6feca-2" onVI="__l"></u-line></view>

View File

@@ -0,0 +1,104 @@
"use strict";
const uni_modules_uviewPlus_components_uCell_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-cell",
data() {
return {};
},
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCell_props.props],
computed: {
titleTextStyle() {
return uni_modules_uviewPlus_libs_function_index.addStyle(this.titleStyle);
}
},
emits: ["click"],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
testEmpty: uni_modules_uviewPlus_libs_function_test.test.empty,
// 点击cell
clickHandler(e) {
if (this.disabled)
return;
this.$emit("click", {
name: this.name
});
this.openPage();
this.stop && this.preventEvent(e);
}
}
};
if (!Array) {
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
(_easycom_u_icon2 + _easycom_u_line2)();
}
const _easycom_u_icon = () => "../u-icon/u-icon.js";
const _easycom_u_line = () => "../u-line/u-line.js";
if (!Math) {
(_easycom_u_icon + _easycom_u_line)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.$slots.icon || _ctx.icon
}, _ctx.$slots.icon || _ctx.icon ? common_vendor.e({
b: _ctx.$slots.icon
}, _ctx.$slots.icon ? {} : {
c: common_vendor.p({
name: _ctx.icon,
["custom-style"]: _ctx.iconStyle,
size: _ctx.size === "large" ? 22 : 18
})
}) : {}, {
d: _ctx.$slots.title || !_ctx.title
}, _ctx.$slots.title || !_ctx.title ? {} : {
e: common_vendor.t(_ctx.title),
f: common_vendor.s($options.titleTextStyle),
g: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
h: common_vendor.n(_ctx.size === "large" && "u-cell__title-text--large")
}, {
i: _ctx.label
}, _ctx.label ? {
j: common_vendor.t(_ctx.label),
k: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
l: common_vendor.n(_ctx.size === "large" && "u-cell__label--large")
} : {}, {
m: !$options.testEmpty(_ctx.value)
}, !$options.testEmpty(_ctx.value) ? {
n: common_vendor.t(_ctx.value),
o: common_vendor.n(_ctx.disabled && "u-cell--disabled"),
p: common_vendor.n(_ctx.size === "large" && "u-cell__value--large")
} : {}, {
q: _ctx.$slots["right-icon"] || _ctx.isLink
}, _ctx.$slots["right-icon"] || _ctx.isLink ? common_vendor.e({
r: _ctx.rightIcon && !_ctx.$slots["right-icon"]
}, _ctx.rightIcon && !_ctx.$slots["right-icon"] ? {
s: common_vendor.p({
name: _ctx.rightIcon,
["custom-style"]: _ctx.rightIconStyle,
color: _ctx.disabled ? "#c8c9cc" : "info",
size: _ctx.size === "large" ? 18 : 16
})
} : {}, {
t: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
}) : {}, {
v: _ctx.$slots["righticon"]
}, _ctx.$slots["righticon"] ? {
w: common_vendor.n(`u-cell__right-icon-wrap--${_ctx.arrowDirection}`)
} : {}, {
x: common_vendor.n(_ctx.center && "u-cell--center"),
y: common_vendor.n(_ctx.size === "large" && "u-cell__body--large"),
z: _ctx.border
}, _ctx.border ? {} : {}, {
A: common_vendor.n(_ctx.customClass),
B: common_vendor.s($options.addStyle(_ctx.customStyle)),
C: !_ctx.disabled && (_ctx.clickable || _ctx.isLink) ? "u-cell--clickable" : "",
D: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3fd6feca"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,8 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-icon": "../u-icon/u-icon",
"u-line": "../u-line/u-line"
}
}

View File

@@ -0,0 +1,82 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 标识符
name: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.name
},
// 绑定的值
modelValue: {
type: Array,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.value
},
// 形状circle-圆形square-方形
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.shape
},
// 是否禁用全部checkbox
disabled: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.disabled
},
// 选中状态下的颜色如设置此值将会覆盖parent的activeColor值
activeColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.activeColor
},
// 未选中的颜色
inactiveColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.inactiveColor
},
// 整个组件的尺寸默认px
size: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.size
},
// 布局方式row-横向column-纵向
placement: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.placement
},
// label的字体大小px单位
labelSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.labelSize
},
// label的字体颜色
labelColor: {
type: [String],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.labelColor
},
// 是否禁止点击文本操作
labelDisabled: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.labelDisabled
},
// 图标颜色
iconColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.iconColor
},
// 图标的大小单位px
iconSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.iconSize
},
// 勾选图标的对齐方式left-左边right-右边
iconPlacement: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.iconPlacement
},
// 竖向配列时,是否显示下划线
borderBottom: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkboxGroup.borderBottom
}
}
};
exports.props = props;

View File

@@ -0,0 +1,24 @@
.u-empty.data-v-ff0492f0,
.u-empty__wrap.data-v-ff0492f0,
.u-tabs.data-v-ff0492f0,
.u-tabs__wrapper.data-v-ff0492f0,
.u-tabs__wrapper__scroll-view-wrapper.data-v-ff0492f0,
.u-tabs__wrapper__scroll-view.data-v-ff0492f0,
.u-tabs__wrapper__nav.data-v-ff0492f0,
.u-tabs__wrapper__nav__line.data-v-ff0492f0 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-checkbox-group--row.data-v-ff0492f0 {
display: flex;
flex-flow: row wrap;
}
.u-checkbox-group--column.data-v-ff0492f0 {
display: flex;
flex-direction: column;
}

View File

@@ -0,0 +1 @@
<view class="{{('u-checkbox-group') + ' ' + 'data-v-ff0492f0' + ' ' + a}}"><slot></slot></view>

View File

@@ -0,0 +1,71 @@
"use strict";
const uni_modules_uviewPlus_components_uCheckboxGroup_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-checkbox-group",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCheckboxGroup_props.props],
computed: {
// 这里computed的变量都是子组件u-checkbox需要用到的由于头条小程序的兼容性差异子组件无法实时监听父组件参数的变化
// 所以需要手动通知子组件这里返回一个parentData变量供watch监听在其中去通知每一个子组件重新从父组件(u-checkbox-group)
// 拉取父组件新的变化后的参数
parentData() {
return [
this.modelValue,
this.disabled,
this.inactiveColor,
this.activeColor,
this.size,
this.labelDisabled,
this.shape,
this.iconSize,
this.borderBottom,
this.placement
];
},
bemClass() {
return this.bem("checkbox-group", ["placement"]);
}
},
watch: {
// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
parentData: {
handler() {
if (this.children.length) {
this.children.map((child) => {
typeof child.init === "function" && child.init();
});
}
},
deep: true
}
},
data() {
return {};
},
created() {
this.children = [];
},
emits: ["update:modelValue", "change"],
methods: {
// 将其他的checkbox设置为未选中的状态
unCheckedOther(childInstance) {
const values = [];
this.children.map((child) => {
if (child.isChecked) {
values.push(child.name);
}
});
this.$emit("change", values);
this.$emit("update:modelValue", values);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.n($options.bemClass)
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ff0492f0"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,77 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// checkbox的名称
name: {
type: [String, Number, Boolean],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.name
},
// 形状square为方形circle为圆型
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.shape
},
// 整体的大小
size: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.size
},
// 是否默认选中
checked: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.checked
},
// 是否禁用
disabled: {
type: [String, Boolean],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.disabled
},
// 选中状态下的颜色如设置此值将会覆盖parent的activeColor值
activeColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.activeColor
},
// 未选中的颜色
inactiveColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.inactiveColor
},
// 图标的大小单位px
iconSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.iconSize
},
// 图标颜色
iconColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.iconColor
},
// label提示文字因为nvue下直接slot进来的文字由于特殊的结构无法修改样式
label: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.label
},
// label的字体大小px单位
labelSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.labelSize
},
// label的颜色
labelColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.labelColor
},
// 是否禁止点击提示语选中复选框
labelDisabled: {
type: [String, Boolean],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.checkbox.labelDisabled
},
// 是否独立使用
usedAlone: {
type: [Boolean],
default: () => false
}
}
};
exports.props = props;

View File

@@ -0,0 +1,76 @@
.u-empty.data-v-41713600,
.u-empty__wrap.data-v-41713600,
.u-tabs.data-v-41713600,
.u-tabs__wrapper.data-v-41713600,
.u-tabs__wrapper__scroll-view-wrapper.data-v-41713600,
.u-tabs__wrapper__scroll-view.data-v-41713600,
.u-tabs__wrapper__nav.data-v-41713600,
.u-tabs__wrapper__nav__line.data-v-41713600 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-checkbox.data-v-41713600 {
display: flex;
flex-direction: row;
overflow: hidden;
flex-direction: row;
align-items: center;
margin-bottom: 5px;
margin-top: 5px;
}
.u-checkbox-label--left.data-v-41713600 {
flex-direction: row;
}
.u-checkbox-label--right.data-v-41713600 {
flex-direction: row-reverse;
justify-content: space-between;
}
.u-checkbox__icon-wrap.data-v-41713600 {
box-sizing: border-box;
transition-property: border-color, background-color, color;
transition-duration: 0.2s;
color: #606266;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: transparent;
text-align: center;
margin-right: 6px;
font-size: 6px;
border-width: 1px;
border-color: #c8c9cc;
border-style: solid;
}
.u-checkbox__icon-wrap--circle.data-v-41713600 {
border-radius: 100%;
}
.u-checkbox__icon-wrap--square.data-v-41713600 {
border-radius: 3px;
}
.u-checkbox__icon-wrap--checked.data-v-41713600 {
color: #fff;
background-color: red;
border-color: #2979ff;
}
.u-checkbox__icon-wrap--disabled.data-v-41713600 {
background-color: #ebedf0 !important;
}
.u-checkbox__icon-wrap--disabled--checked.data-v-41713600 {
color: #c8c9cc !important;
}
.u-checkbox__label.data-v-41713600 {
word-wrap: break-word;
margin-left: 5px;
margin-right: 12px;
color: #606266;
font-size: 15px;
}
.u-checkbox__label--disabled.data-v-41713600 {
color: #c8c9cc;
}

View File

@@ -0,0 +1 @@
<view style="{{j}}" catchTap="{{k}}" class="{{('u-checkbox') + ' ' + 'cursor-pointer' + ' ' + 'data-v-41713600' + ' ' + l + ' ' + m}}"><view catchTap="{{b}}" class="{{('u-checkbox__icon-wrap') + ' ' + 'cursor-pointer' + ' ' + 'data-v-41713600' + ' ' + c}}" style="{{d}}"><slot name="icon"><u-icon class="u-checkbox__icon-wrap__icon data-v-41713600" u-i="41713600-0" onVI="__l" u-p="{{a}}"/></slot></view><text class="data-v-41713600" catchTap="{{f}}" style="{{'color:' + g + ';' + ('font-size:' + h) + ';' + ('line-height:' + i)}}">{{e}}</text></view>

View File

@@ -0,0 +1,214 @@
"use strict";
const uni_modules_uviewPlus_components_uCheckbox_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-checkbox",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCheckbox_props.props],
data() {
return {
isChecked: false,
// 父组件的默认值因为头条小程序不支持在computed中使用this.parent.shape的形式
// 故只能使用如此方法
parentData: {
iconSize: 12,
labelDisabled: null,
disabled: null,
shape: "square",
activeColor: null,
inactiveColor: null,
size: 18,
modelValue: null,
iconColor: null,
placement: "row",
borderBottom: false,
iconPlacement: "left"
}
};
},
computed: {
// 是否禁用如果父组件u-raios-group禁用的话将会忽略子组件的配置
elDisabled() {
return this.disabled !== "" ? this.disabled : this.parentData.disabled !== null ? this.parentData.disabled : false;
},
// 是否禁用label点击
elLabelDisabled() {
return this.labelDisabled !== "" ? this.labelDisabled : this.parentData.labelDisabled !== null ? this.parentData.labelDisabled : false;
},
// 组件尺寸对应size的值默认值为21px
elSize() {
return this.size ? this.size : this.parentData.size ? this.parentData.size : 21;
},
// 组件的勾选图标的尺寸默认12px
elIconSize() {
return this.iconSize ? this.iconSize : this.parentData.iconSize ? this.parentData.iconSize : 12;
},
// 组件选中激活时的颜色
elActiveColor() {
return this.activeColor ? this.activeColor : this.parentData.activeColor ? this.parentData.activeColor : "#2979ff";
},
// 组件选未中激活时的颜色
elInactiveColor() {
return this.inactiveColor ? this.inactiveColor : this.parentData.inactiveColor ? this.parentData.inactiveColor : "#c8c9cc";
},
// label的颜色
elLabelColor() {
return this.labelColor ? this.labelColor : this.parentData.labelColor ? this.parentData.labelColor : "#606266";
},
// 组件的形状
elShape() {
return this.shape ? this.shape : this.parentData.shape ? this.parentData.shape : "circle";
},
// label大小
elLabelSize() {
return uni_modules_uviewPlus_libs_function_index.addUnit(this.labelSize ? this.labelSize : this.parentData.labelSize ? this.parentData.labelSize : "15");
},
elIconColor() {
const iconColor = this.iconColor ? this.iconColor : this.parentData.iconColor ? this.parentData.iconColor : "#ffffff";
if (this.elDisabled) {
return this.isChecked ? this.elInactiveColor : "transparent";
} else {
return this.isChecked ? iconColor : "transparent";
}
},
iconClasses() {
let classes = [];
classes.push("u-checkbox__icon-wrap--" + this.elShape);
if (this.elDisabled) {
classes.push("u-checkbox__icon-wrap--disabled");
}
if (this.isChecked && this.elDisabled) {
classes.push("u-checkbox__icon-wrap--disabled--checked");
}
classes = classes.join(" ");
return classes;
},
iconWrapStyle() {
const style = {};
style.backgroundColor = this.isChecked && !this.elDisabled ? this.elActiveColor : "#ffffff";
style.borderColor = this.isChecked && !this.elDisabled ? this.elActiveColor : this.elInactiveColor;
style.width = uni_modules_uviewPlus_libs_function_index.addUnit(this.elSize);
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.elSize);
if (!this.usedAlone) {
if (this.parentData.iconPlacement === "right") {
style.marginRight = 0;
}
}
return style;
},
checkboxStyle() {
const style = {};
if (!this.usedAlone) {
if (this.parentData.borderBottom && this.parentData.placement === "row") {
uni_modules_uviewPlus_libs_function_index.error("检测到您将borderBottom设置为true需要同时将u-checkbox-group的placement设置为column才有效");
}
if (this.parentData.borderBottom && this.parentData.placement === "column") {
style.paddingBottom = "8px";
}
}
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
}
},
mounted() {
this.init();
},
emits: ["change"],
methods: {
init() {
if (!this.usedAlone) {
this.updateParentData();
if (!this.parent) {
uni_modules_uviewPlus_libs_function_index.error("u-checkbox必须搭配u-checkbox-group组件使用");
}
}
const value = this.parentData.modelValue;
if (this.checked) {
this.isChecked = true;
} else if (!this.usedAlone && uni_modules_uviewPlus_libs_function_test.test.array(value)) {
this.isChecked = value.some((item) => {
return item === this.name;
});
}
},
updateParentData() {
this.getParentData("u-checkbox-group");
},
// 横向两端排列时,点击组件即可触发选中事件
wrapperClickHandler(e) {
if (!this.usedAlone) {
this.parentData.iconPlacement === "right" && this.iconClickHandler(e);
} else {
this.iconClickHandler(e);
}
},
// 点击图标
iconClickHandler(e) {
this.preventEvent(e);
if (!this.elDisabled) {
this.setRadioCheckedStatus();
}
},
// 点击label
labelClickHandler(e) {
this.preventEvent(e);
if (!this.elLabelDisabled && !this.elDisabled) {
this.setRadioCheckedStatus();
}
},
emitEvent() {
this.$emit("change", this.isChecked);
this.$nextTick(() => {
uni_modules_uviewPlus_libs_function_index.formValidate(this, "change");
});
},
// 改变组件选中状态
// 这里的改变的依据是更改本组件的checked值为true同时通过父组件遍历所有u-checkbox实例
// 将本组件外的其他u-checkbox的checked都设置为false(都被取消选中状态),因而只剩下一个为选中状态
setRadioCheckedStatus() {
this.isChecked = !this.isChecked;
this.emitEvent();
if (!this.usedAlone) {
typeof this.parent.unCheckedOther === "function" && this.parent.unCheckedOther(this);
}
}
},
watch: {
checked() {
this.isChecked = this.checked;
}
}
};
if (!Array) {
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
_easycom_u_icon2();
}
const _easycom_u_icon = () => "../u-icon/u-icon.js";
if (!Math) {
_easycom_u_icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
name: "checkbox-mark",
size: $options.elIconSize,
color: $options.elIconColor
}),
b: common_vendor.o((...args) => $options.iconClickHandler && $options.iconClickHandler(...args)),
c: common_vendor.n($options.iconClasses),
d: common_vendor.s($options.iconWrapStyle),
e: common_vendor.t(_ctx.label),
f: common_vendor.o((...args) => $options.labelClickHandler && $options.labelClickHandler(...args)),
g: $options.elDisabled ? $options.elInactiveColor : $options.elLabelColor,
h: $options.elLabelSize,
i: $options.elLabelSize,
j: common_vendor.s($options.checkboxStyle),
k: common_vendor.o((...args) => $options.wrapperClickHandler && $options.wrapperClickHandler(...args)),
l: common_vendor.n(`u-checkbox-label--${$data.parentData.iconPlacement}`),
m: common_vendor.n($data.parentData.borderBottom && $data.parentData.placement === "column" && "u-border-bottom")
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-41713600"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-icon": "../u-icon/u-icon"
}
}

View File

@@ -0,0 +1,216 @@
"use strict";
const icons = {
"uicon-level": "",
"uicon-column-line": "",
"uicon-checkbox-mark": "",
"uicon-folder": "",
"uicon-movie": "",
"uicon-star-fill": "",
"uicon-star": "",
"uicon-phone-fill": "",
"uicon-phone": "",
"uicon-apple-fill": "",
"uicon-chrome-circle-fill": "",
"uicon-backspace": "",
"uicon-attach": "",
"uicon-cut": "",
"uicon-empty-car": "",
"uicon-empty-coupon": "",
"uicon-empty-address": "",
"uicon-empty-favor": "",
"uicon-empty-permission": "",
"uicon-empty-news": "",
"uicon-empty-search": "",
"uicon-github-circle-fill": "",
"uicon-rmb": "",
"uicon-person-delete-fill": "",
"uicon-reload": "",
"uicon-order": "",
"uicon-server-man": "",
"uicon-search": "",
"uicon-fingerprint": "",
"uicon-more-dot-fill": "",
"uicon-scan": "",
"uicon-share-square": "",
"uicon-map": "",
"uicon-map-fill": "",
"uicon-tags": "",
"uicon-tags-fill": "",
"uicon-bookmark-fill": "",
"uicon-bookmark": "",
"uicon-eye": "",
"uicon-eye-fill": "",
"uicon-mic": "",
"uicon-mic-off": "",
"uicon-calendar": "",
"uicon-calendar-fill": "",
"uicon-trash": "",
"uicon-trash-fill": "",
"uicon-play-left": "",
"uicon-play-right": "",
"uicon-minus": "",
"uicon-plus": "",
"uicon-info": "",
"uicon-info-circle": "",
"uicon-info-circle-fill": "",
"uicon-question": "",
"uicon-error": "",
"uicon-close": "",
"uicon-checkmark": "",
"uicon-android-circle-fill": "",
"uicon-android-fill": "",
"uicon-ie": "",
"uicon-IE-circle-fill": "",
"uicon-google": "",
"uicon-google-circle-fill": "",
"uicon-setting-fill": "",
"uicon-setting": "",
"uicon-minus-square-fill": "",
"uicon-plus-square-fill": "",
"uicon-heart": "",
"uicon-heart-fill": "",
"uicon-camera": "",
"uicon-camera-fill": "",
"uicon-more-circle": "",
"uicon-more-circle-fill": "",
"uicon-chat": "",
"uicon-chat-fill": "",
"uicon-bag-fill": "",
"uicon-bag": "",
"uicon-error-circle-fill": "",
"uicon-error-circle": "",
"uicon-close-circle": "",
"uicon-close-circle-fill": "",
"uicon-checkmark-circle": "",
"uicon-checkmark-circle-fill": "",
"uicon-question-circle-fill": "",
"uicon-question-circle": "",
"uicon-share": "",
"uicon-share-fill": "",
"uicon-shopping-cart": "",
"uicon-shopping-cart-fill": "",
"uicon-bell": "",
"uicon-bell-fill": "",
"uicon-list": "",
"uicon-list-dot": "",
"uicon-zhihu": "",
"uicon-zhihu-circle-fill": "",
"uicon-zhifubao": "",
"uicon-zhifubao-circle-fill": "",
"uicon-weixin-circle-fill": "",
"uicon-weixin-fill": "",
"uicon-twitter-circle-fill": "",
"uicon-twitter": "",
"uicon-taobao-circle-fill": "",
"uicon-taobao": "",
"uicon-weibo-circle-fill": "",
"uicon-weibo": "",
"uicon-qq-fill": "",
"uicon-qq-circle-fill": "",
"uicon-moments-circel-fill": "",
"uicon-moments": "",
"uicon-qzone": "",
"uicon-qzone-circle-fill": "",
"uicon-baidu-circle-fill": "",
"uicon-baidu": "",
"uicon-facebook-circle-fill": "",
"uicon-facebook": "",
"uicon-car": "",
"uicon-car-fill": "",
"uicon-warning-fill": "",
"uicon-warning": "",
"uicon-clock-fill": "",
"uicon-clock": "",
"uicon-edit-pen": "",
"uicon-edit-pen-fill": "",
"uicon-email": "",
"uicon-email-fill": "",
"uicon-minus-circle": "",
"uicon-minus-circle-fill": "",
"uicon-plus-circle": "",
"uicon-plus-circle-fill": "",
"uicon-file-text": "",
"uicon-file-text-fill": "",
"uicon-pushpin": "",
"uicon-pushpin-fill": "",
"uicon-grid": "",
"uicon-grid-fill": "",
"uicon-play-circle": "",
"uicon-play-circle-fill": "",
"uicon-pause-circle-fill": "",
"uicon-pause": "",
"uicon-pause-circle": "",
"uicon-eye-off": "",
"uicon-eye-off-outline": "",
"uicon-gift-fill": "",
"uicon-gift": "",
"uicon-rmb-circle-fill": "",
"uicon-rmb-circle": "",
"uicon-kefu-ermai": "",
"uicon-server-fill": "",
"uicon-coupon-fill": "",
"uicon-coupon": "",
"uicon-integral": "",
"uicon-integral-fill": "",
"uicon-home-fill": "",
"uicon-home": "",
"uicon-hourglass-half-fill": "",
"uicon-hourglass": "",
"uicon-account": "",
"uicon-plus-people-fill": "",
"uicon-minus-people-fill": "",
"uicon-account-fill": "",
"uicon-thumb-down-fill": "",
"uicon-thumb-down": "",
"uicon-thumb-up": "",
"uicon-thumb-up-fill": "",
"uicon-lock-fill": "",
"uicon-lock-open": "",
"uicon-lock-opened-fill": "",
"uicon-lock": "",
"uicon-red-packet-fill": "",
"uicon-photo-fill": "",
"uicon-photo": "",
"uicon-volume-off-fill": "",
"uicon-volume-off": "",
"uicon-volume-fill": "",
"uicon-volume": "",
"uicon-red-packet": "",
"uicon-download": "",
"uicon-arrow-up-fill": "",
"uicon-arrow-down-fill": "",
"uicon-play-left-fill": "",
"uicon-play-right-fill": "",
"uicon-rewind-left-fill": "",
"uicon-rewind-right-fill": "",
"uicon-arrow-downward": "",
"uicon-arrow-leftward": "",
"uicon-arrow-rightward": "",
"uicon-arrow-upward": "",
"uicon-arrow-down": "",
"uicon-arrow-right": "",
"uicon-arrow-left": "",
"uicon-arrow-up": "",
"uicon-skip-back-left": "",
"uicon-skip-forward-right": "",
"uicon-rewind-right": "",
"uicon-rewind-left": "",
"uicon-arrow-right-double": "",
"uicon-arrow-left-double": "",
"uicon-wifi-off": "",
"uicon-wifi": "",
"uicon-empty-data": "",
"uicon-empty-history": "",
"uicon-empty-list": "",
"uicon-empty-page": "",
"uicon-empty-order": "",
"uicon-man": "",
"uicon-woman": "",
"uicon-man-add": "",
"uicon-man-add-fill": "",
"uicon-man-delete": "",
"uicon-man-delete-fill": "",
"uicon-zh": "",
"uicon-en": ""
};
exports.icons = icons;

View File

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

View File

@@ -0,0 +1,69 @@
.u-empty.data-v-ac70166d,
.u-empty__wrap.data-v-ac70166d,
.u-tabs.data-v-ac70166d,
.u-tabs__wrapper.data-v-ac70166d,
.u-tabs__wrapper__scroll-view-wrapper.data-v-ac70166d,
.u-tabs__wrapper__scroll-view.data-v-ac70166d,
.u-tabs__wrapper__nav.data-v-ac70166d,
.u-tabs__wrapper__nav__line.data-v-ac70166d {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
@font-face {
font-family: "uicon-iconfont";
src: url("https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf") format("truetype");
}
.u-icon.data-v-ac70166d {
display: flex;
align-items: center;
}
.u-icon--left.data-v-ac70166d {
flex-direction: row-reverse;
align-items: center;
}
.u-icon--right.data-v-ac70166d {
flex-direction: row;
align-items: center;
}
.u-icon--top.data-v-ac70166d {
flex-direction: column-reverse;
justify-content: center;
}
.u-icon--bottom.data-v-ac70166d {
flex-direction: column;
justify-content: center;
}
.u-icon__icon.data-v-ac70166d {
font-family: uicon-iconfont;
position: relative;
display: flex;
flex-direction: row;
align-items: center;
}
.u-icon__icon--primary.data-v-ac70166d {
color: #3c9cff;
}
.u-icon__icon--success.data-v-ac70166d {
color: #5ac725;
}
.u-icon__icon--error.data-v-ac70166d {
color: #f56c6c;
}
.u-icon__icon--warning.data-v-ac70166d {
color: #f9ae3d;
}
.u-icon__icon--info.data-v-ac70166d {
color: #909399;
}
.u-icon__img.data-v-ac70166d {
height: auto;
will-change: transform;
}
.u-icon__label.data-v-ac70166d {
line-height: 1;
}

View File

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

View File

@@ -0,0 +1,99 @@
"use strict";
const uni_modules_uviewPlus_components_uIcon_icons = require("./icons.js");
const uni_modules_uviewPlus_components_uIcon_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_config_config = require("../../libs/config/config.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-icon",
data() {
return {};
},
emits: ["click"],
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uIcon_props.props],
computed: {
uClasses() {
let classes = [];
classes.push(this.customPrefix + "-" + this.name);
if (this.customPrefix == "uicon") {
classes.push("u-iconfont");
} else {
classes.push(this.customPrefix);
}
if (this.color && uni_modules_uviewPlus_libs_config_config.config.type.includes(this.color))
classes.push("u-icon__icon--" + this.color);
classes = classes.join(" ");
return classes;
},
iconStyle() {
let style = {};
style = {
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.size),
lineHeight: uni_modules_uviewPlus_libs_function_index.addUnit(this.size),
fontWeight: this.bold ? "bold" : "normal",
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top: uni_modules_uviewPlus_libs_function_index.addUnit(this.top)
};
if (this.color && !uni_modules_uviewPlus_libs_config_config.config.type.includes(this.color))
style.color = this.color;
return style;
},
// 判断传入的name属性是否图片路径只要带有"/"均认为是图片形式
isImg() {
return this.name.indexOf("/") !== -1;
},
imgStyle() {
let style = {};
style.width = this.width ? uni_modules_uviewPlus_libs_function_index.addUnit(this.width) : uni_modules_uviewPlus_libs_function_index.addUnit(this.size);
style.height = this.height ? uni_modules_uviewPlus_libs_function_index.addUnit(this.height) : uni_modules_uviewPlus_libs_function_index.addUnit(this.size);
return style;
},
// 通过图标名,查找对应的图标
icon() {
if (this.customPrefix !== "uicon")
return "";
return uni_modules_uviewPlus_components_uIcon_icons.icons["uicon-" + this.name] || this.name;
}
},
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
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($options.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($options.addStyle(_ctx.customStyle)),
j: _ctx.hoverClass
}, {
k: _ctx.label !== ""
}, _ctx.label !== "" ? {
l: common_vendor.t(_ctx.label),
m: _ctx.labelColor,
n: $options.addUnit(_ctx.labelSize),
o: _ctx.labelPos == "right" ? $options.addUnit(_ctx.space) : 0,
p: _ctx.labelPos == "bottom" ? $options.addUnit(_ctx.space) : 0,
q: _ctx.labelPos == "left" ? $options.addUnit(_ctx.space) : 0,
r: _ctx.labelPos == "top" ? $options.addUnit(_ctx.space) : 0
} : {}, {
s: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
t: common_vendor.n("u-icon--" + _ctx.labelPos)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ac70166d"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,189 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 绑定的值
modelValue: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.value
},
// number-数字输入键盘app-vue下可以输入浮点数app-nvue和小程序平台下只能输入整数
// idcard-身份证输入键盘微信、支付宝、百度、QQ小程序
// digit-带小数点的数字键盘App的nvue页面、微信、支付宝、百度、头条、QQ小程序
// text-文本输入键盘
type: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.type
},
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true
// 兼容性微信小程序、百度小程序、字节跳动小程序、QQ小程序
fixed: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.fixed
},
// 是否禁用输入框
disabled: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.disabled
},
// 禁用状态时的背景色
disabledColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.disabledColor
},
// 是否显示清除控件
clearable: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.clearable
},
// 是否密码类型
password: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.password
},
// 最大输入长度,设置为 -1 的时候不限制最大长度
maxlength: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.maxlength
},
// 输入框为空时的占位符
placeholder: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.placeholder
},
// 指定placeholder的样式类注意页面或组件的style中写了scoped时需要在类名前写/deep/
placeholderClass: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.placeholderClass
},
// 指定placeholder的样式
placeholderStyle: {
type: [String, Object],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.placeholderStyle
},
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
showWordLimit: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.showWordLimit
},
// 设置右下角按钮的文字有效值send|search|next|go|done兼容性详见uni-app文档
// https://uniapp.dcloud.io/component/input
// https://uniapp.dcloud.io/component/textarea
confirmType: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.confirmType
},
// 点击键盘右下角按钮时是否保持键盘不收起H5无效
confirmHold: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.confirmHold
},
// focus时点击页面的时候不收起键盘微信小程序有效
holdKeyboard: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.holdKeyboard
},
// 自动获取焦点
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
focus: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.focus
},
// 键盘收起时是否自动失去焦点目前仅App3.0.0+有效
autoBlur: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.autoBlur
},
// 是否去掉 iOS 下的默认内边距仅微信小程序且type=textarea时有效
disableDefaultPadding: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.disableDefaultPadding
},
// 指定focus时光标的位置
cursor: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.cursor
},
// 输入框聚焦时底部与键盘的距离
cursorSpacing: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.cursorSpacing
},
// 光标起始位置自动聚集时有效需与selection-end搭配使用
selectionStart: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.selectionStart
},
// 光标结束位置自动聚集时有效需与selection-start搭配使用
selectionEnd: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.selectionEnd
},
// 键盘弹起时,是否自动上推页面
adjustPosition: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.adjustPosition
},
// 输入框内容对齐方式可选值为left|center|right
inputAlign: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.inputAlign
},
// 输入框字体的大小
fontSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.fontSize
},
// 输入框字体颜色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.color
},
// 输入框前置图标
prefixIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.prefixIcon
},
// 前置图标样式,对象或字符串
prefixIconStyle: {
type: [String, Object],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.prefixIconStyle
},
// 输入框后置图标
suffixIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.suffixIcon
},
// 后置图标样式,对象或字符串
suffixIconStyle: {
type: [String, Object],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.suffixIconStyle
},
// 边框类型surround-四周边框bottom-底部边框none-无边框
border: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.border
},
// 是否只读与disabled不同之处在于disabled会置灰组件而readonly则不会
readonly: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.readonly
},
// 输入框形状circle-圆形square-方形
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.shape
},
// 用于处理或者过滤输入框内容的方法
formatter: {
type: [Function, null],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.input.formatter
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}
};
exports.props = props;

View File

@@ -0,0 +1,72 @@
.u-empty.data-v-df79975b,
.u-empty__wrap.data-v-df79975b,
.u-tabs.data-v-df79975b,
.u-tabs__wrapper.data-v-df79975b,
.u-tabs__wrapper__scroll-view-wrapper.data-v-df79975b,
.u-tabs__wrapper__scroll-view.data-v-df79975b,
.u-tabs__wrapper__nav.data-v-df79975b,
.u-tabs__wrapper__nav__line.data-v-df79975b {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-input.data-v-df79975b {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex: 1;
}
.u-input--radius.data-v-df79975b, .u-input--square.data-v-df79975b {
border-radius: 4px;
}
.u-input--no-radius.data-v-df79975b {
border-radius: 0;
}
.u-input--circle.data-v-df79975b {
border-radius: 100px;
}
.u-input__content.data-v-df79975b {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.u-input__content__field-wrapper.data-v-df79975b {
position: relative;
display: flex;
flex-direction: row;
margin: 0;
flex: 1;
}
.u-input__content__field-wrapper__field.data-v-df79975b {
line-height: 26px;
text-align: left;
color: #303133;
height: 24px;
font-size: 15px;
flex: 1;
}
.u-input__content__clear.data-v-df79975b {
width: 20px;
height: 20px;
border-radius: 100px;
background-color: #c6c7cb;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
transform: scale(0.82);
margin-left: 4px;
}
.u-input__content__subfix-icon.data-v-df79975b {
margin-left: 4px;
}
.u-input__content__prefix-icon.data-v-df79975b {
margin-right: 4px;
}

View File

@@ -0,0 +1 @@
<view class="{{('u-input') + ' ' + 'data-v-df79975b' + ' ' + I}}" style="{{J}}"><view class="u-input__content data-v-df79975b"><view a:if="{{a}}" class="u-input__content__prefix-icon data-v-df79975b"><slot name="prefix"><u-icon class="data-v-df79975b" u-i="df79975b-0" onVI="__l" u-p="{{b}}"></u-icon></slot></view><view class="u-input__content__field-wrapper data-v-df79975b" onTap="{{C}}"><input class="u-input__content__field-wrapper__field data-v-df79975b" style="{{c}}" type="{{d}}" focus="{{e}}" cursor="{{f}}" value="{{g}}" auto-blur="{{h}}" disabled="{{i}}" maxlength="{{j}}" placeholder="{{k}}" placeholder-style="{{l}}" placeholder-class="{{m}}" confirm-type="{{n}}" confirm-hold="{{o}}" hold-keyboard="{{p}}" cursor-spacing="{{q}}" adjust-position="{{r}}" selection-end="{{s}}" selection-start="{{t}}" password="{{v}}" ignoreCompositionEvent="{{w}}" onInput="{{x}}" onBlur="{{y}}" onFocus="{{z}}" onConfirm="{{A}}" onKeyboardheightchange="{{B}}"/></view><view a:if="{{D}}" class="u-input__content__clear data-v-df79975b" onTap="{{F}}"><u-icon class="data-v-df79975b" u-i="df79975b-1" onVI="__l" u-p="{{E}}"></u-icon></view><view a:if="{{G}}" class="u-input__content__subfix-icon data-v-df79975b"><slot name="suffix"><u-icon class="data-v-df79975b" u-i="df79975b-2" onVI="__l" u-p="{{H}}"></u-icon></slot></view></view></view>

View File

@@ -0,0 +1,218 @@
"use strict";
const uni_modules_uviewPlus_components_uInput_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-input",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uInput_props.props],
data() {
return {
// 清除操作
clearInput: false,
// 输入框的值
innerValue: "",
// 是否处于获得焦点状态
focused: false,
// value是否第一次变化在watch中由于加入immediate属性会在第一次触发此时不应该认为value发生了变化
firstChange: true,
// value绑定值的变化是由内部还是外部引起的
changeFromInner: false,
// 过滤处理方法
innerFormatter: (value) => value
};
},
watch: {
modelValue: {
immediate: true,
handler(newVal, oldVal) {
this.innerValue = newVal;
this.firstChange = false;
this.changeFromInner = false;
}
}
},
computed: {
// 是否显示清除控件
isShowClear() {
const { clearable, readonly, focused, innerValue } = this;
return !!clearable && !readonly && !!focused && innerValue !== "";
},
// 组件的类名
inputClass() {
let classes = [], { border, disabled, shape } = this;
border === "surround" && (classes = classes.concat(["u-border", "u-input--radius"]));
classes.push(`u-input--${shape}`);
border === "bottom" && (classes = classes.concat([
"u-border-bottom",
"u-input--no-radius"
]));
return classes.join(" ");
},
// 组件的样式
wrapperStyle() {
const style = {};
if (this.disabled) {
style.backgroundColor = this.disabledColor;
}
if (this.border === "none") {
style.padding = "0";
} else {
style.paddingTop = "6px";
style.paddingBottom = "6px";
style.paddingLeft = "9px";
style.paddingRight = "9px";
}
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
},
// 输入框的样式
inputStyle() {
const style = {
color: this.color,
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
textAlign: this.inputAlign
};
return style;
}
},
emits: ["update:modelValue", "focus", "blur", "change", "confirm", "clear", "keyboardheightchange"],
methods: {
// 在微信小程序中不支持将函数当做props参数故只能通过ref形式调用
setFormatter(e) {
this.innerFormatter = e;
},
// 当键盘输入时触发input事件
onInput(e) {
let { value = "" } = e.detail || {};
const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value);
this.innerValue = value;
this.$nextTick(() => {
this.innerValue = formatValue;
this.valueChange();
});
},
// 输入框失去焦点时触发
onBlur(event) {
this.$emit("blur", event.detail.value);
uni_modules_uviewPlus_libs_function_index.sleep(150).then(() => {
this.focused = false;
});
uni_modules_uviewPlus_libs_function_index.formValidate(this, "blur");
},
// 输入框聚焦时触发
onFocus(event) {
this.focused = true;
this.$emit("focus");
},
// 点击完成按钮时触发
onConfirm(event) {
this.$emit("confirm", this.innerValue);
},
// 键盘高度发生变化的时候触发此事件
// 兼容性微信小程序2.7.0+、App 3.1.0+
onkeyboardheightchange(event) {
this.$emit("keyboardheightchange", event);
},
// 内容发生变化,进行处理
valueChange() {
if (this.clearInput) {
this.innerValue = "";
this.clearInput = false;
}
const value = this.innerValue;
this.$nextTick(() => {
this.$emit("update:modelValue", value);
this.changeFromInner = true;
this.$emit("change", value);
uni_modules_uviewPlus_libs_function_index.formValidate(this, "change");
});
},
// 点击清除控件
onClear() {
this.clearInput = true;
this.innerValue = "";
this.$nextTick(() => {
this.valueChange();
this.$emit("clear");
});
},
/**
* 在安卓nvue上事件无法冒泡
* 在某些时间我们希望监听u-from-item的点击事件此时会导致点击u-form-item内的u-input后
* 无法触发u-form-item的点击事件这里通过手动调用u-form-item的方法进行触发
*/
clickHandler() {
}
}
};
if (!Array) {
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
_easycom_u_icon2();
}
const _easycom_u_icon = () => "../u-icon/u-icon.js";
if (!Math) {
_easycom_u_icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.prefixIcon || _ctx.$slots.prefix
}, _ctx.prefixIcon || _ctx.$slots.prefix ? {
b: common_vendor.p({
name: _ctx.prefixIcon,
size: "18",
customStyle: _ctx.prefixIconStyle
})
} : {}, {
c: common_vendor.s($options.inputStyle),
d: _ctx.type,
e: _ctx.focus,
f: _ctx.cursor,
g: $data.innerValue,
h: _ctx.autoBlur,
i: _ctx.disabled || _ctx.readonly,
j: _ctx.maxlength,
k: _ctx.placeholder,
l: _ctx.placeholderStyle,
m: _ctx.placeholderClass,
n: _ctx.confirmType,
o: _ctx.confirmHold,
p: _ctx.holdKeyboard,
q: _ctx.cursorSpacing,
r: _ctx.adjustPosition,
s: _ctx.selectionEnd,
t: _ctx.selectionStart,
v: _ctx.password || _ctx.type === "password" || false,
w: _ctx.ignoreCompositionEvent,
x: common_vendor.o((...args) => $options.onInput && $options.onInput(...args)),
y: common_vendor.o((...args) => $options.onBlur && $options.onBlur(...args)),
z: common_vendor.o((...args) => $options.onFocus && $options.onFocus(...args)),
A: common_vendor.o((...args) => $options.onConfirm && $options.onConfirm(...args)),
B: common_vendor.o((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args)),
C: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
D: $options.isShowClear
}, $options.isShowClear ? {
E: common_vendor.p({
name: "close",
size: "11",
color: "#ffffff",
customStyle: "line-height: 12px"
}),
F: common_vendor.o((...args) => $options.onClear && $options.onClear(...args))
} : {}, {
G: _ctx.suffixIcon || _ctx.$slots.suffix
}, _ctx.suffixIcon || _ctx.$slots.suffix ? {
H: common_vendor.p({
name: _ctx.suffixIcon,
size: "18",
customStyle: _ctx.suffixIconStyle,
imgMode: "widthFix"
})
} : {}, {
I: common_vendor.n($options.inputClass),
J: common_vendor.s($options.wrapperStyle)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-df79975b"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-icon": "../u-icon/u-icon"
}
}

View File

@@ -0,0 +1,36 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.color
},
// 长度竖向时表现为高度横向时表现为长度可以为百分比带px单位的值等
length: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.length
},
// 线条方向col-竖向row-横向
direction: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.direction
},
// 是否显示细边框
hairline: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.hairline
},
// 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
margin: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.margin
},
// 是否虚线true-虚线false-实线
dashed: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.line.dashed
}
}
};
exports.props = props;

View File

@@ -0,0 +1,19 @@
.u-empty.data-v-72791e59,
.u-empty__wrap.data-v-72791e59,
.u-tabs.data-v-72791e59,
.u-tabs__wrapper.data-v-72791e59,
.u-tabs__wrapper__scroll-view-wrapper.data-v-72791e59,
.u-tabs__wrapper__scroll-view.data-v-72791e59,
.u-tabs__wrapper__nav.data-v-72791e59,
.u-tabs__wrapper__nav__line.data-v-72791e59 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-line.data-v-72791e59 {
vertical-align: middle;
}

View File

@@ -0,0 +1 @@
<view class="u-line data-v-72791e59" style="{{a}}"></view>

View File

@@ -0,0 +1,38 @@
"use strict";
const uni_modules_uviewPlus_components_uLine_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-line",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLine_props.props],
computed: {
lineStyle() {
const style = {};
style.margin = this.margin;
if (this.direction === "row") {
style.borderBottomWidth = "1px";
style.borderBottomStyle = this.dashed ? "dashed" : "solid";
style.width = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
if (this.hairline)
style.transform = "scaleY(0.5)";
} else {
style.borderLeftWidth = "1px";
style.borderLeftStyle = this.dashed ? "dashed" : "solid";
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
if (this.hairline)
style.transform = "scaleX(0.5)";
}
style.borderColor = this.color;
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.s($options.lineStyle)
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-72791e59"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,42 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 文字颜色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.color
},
// 字体大小单位px
fontSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.fontSize
},
// 是否显示下划线
underLine: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.underLine
},
// 要跳转的链接
href: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.href
},
// 小程序中复制到粘贴板的提示语
mpTips: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.mpTips
},
// 下划线颜色
lineColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.lineColor
},
// 超链接的问题不使用slot形式传入是因为nvue下无法修改颜色
text: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.link.text
}
}
};
exports.props = props;

View File

@@ -0,0 +1,23 @@
.u-empty.data-v-12f6646d,
.u-empty__wrap.data-v-12f6646d,
.u-tabs.data-v-12f6646d,
.u-tabs__wrapper.data-v-12f6646d,
.u-tabs__wrapper__scroll-view-wrapper.data-v-12f6646d,
.u-tabs__wrapper__scroll-view.data-v-12f6646d,
.u-tabs__wrapper__nav.data-v-12f6646d,
.u-tabs__wrapper__nav__line.data-v-12f6646d {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-link.data-v-12f6646d {
line-height: 1;
display: flex;
flex-direction: row;
flex-wrap: wrap;
flex: 1;
}

View File

@@ -0,0 +1 @@
<text class="u-link data-v-12f6646d" catchTap="{{b}}" style="{{c + ';' + d}}">{{a}}</text>

View File

@@ -0,0 +1,48 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const uni_modules_uviewPlus_components_uLink_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const _sfc_main = {
name: "u-link",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLink_props.props],
computed: {
linkStyle() {
const style = {
color: this.color,
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
// line-height设置为比字体大小多2px
lineHeight: uni_modules_uviewPlus_libs_function_index.addUnit(uni_modules_uviewPlus_libs_function_index.getPx(this.fontSize) + 2),
textDecoration: this.underLine ? "underline" : "none"
};
return style;
}
},
emits: ["click"],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
openLink() {
common_vendor.index.setClipboardData({
data: this.href,
success: () => {
common_vendor.index.hideToast();
this.$nextTick(() => {
uni_modules_uviewPlus_libs_function_index.toast(this.mpTips);
});
}
});
this.$emit("click");
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t(_ctx.text),
b: common_vendor.o((...args) => $options.openLink && $options.openLink(...args)),
c: common_vendor.s($options.linkStyle),
d: common_vendor.s($options.addStyle(_ctx.customStyle))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-12f6646d"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,62 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 是否显示组件
show: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.show
},
// 颜色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.color
},
// 提示文字颜色
textColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.textColor
},
// 文字和图标是否垂直排列
vertical: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.vertical
},
// 模式选择circle-圆形spinner-花朵形semicircle-半圆形
mode: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.mode
},
// 图标大小单位默认px
size: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.size
},
// 文字大小
textSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.textSize
},
// 文字内容
text: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.text
},
// 动画模式
timingFunction: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.timingFunction
},
// 动画执行周期时间
duration: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.duration
},
// mode=circle时的暗边颜色
inactiveColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.loadingIcon.inactiveColor
}
}
};
exports.props = props;

View File

@@ -0,0 +1,148 @@
.u-empty.data-v-2af81691,
.u-empty__wrap.data-v-2af81691,
.u-tabs.data-v-2af81691,
.u-tabs__wrapper.data-v-2af81691,
.u-tabs__wrapper__scroll-view-wrapper.data-v-2af81691,
.u-tabs__wrapper__scroll-view.data-v-2af81691,
.u-tabs__wrapper__nav.data-v-2af81691,
.u-tabs__wrapper__nav__line.data-v-2af81691 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-loading-icon.data-v-2af81691 {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: #c8c9cc;
}
.u-loading-icon__text.data-v-2af81691 {
margin-left: 4px;
color: #606266;
font-size: 14px;
line-height: 20px;
}
.u-loading-icon__spinner.data-v-2af81691 {
width: 30px;
height: 30px;
position: relative;
box-sizing: border-box;
max-width: 100%;
max-height: 100%;
animation: u-rotate-2af81691 1s linear infinite;
}
.u-loading-icon__spinner--semicircle.data-v-2af81691 {
border-width: 2px;
border-color: transparent;
border-top-right-radius: 100px;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
border-style: solid;
}
.u-loading-icon__spinner--circle.data-v-2af81691 {
border-top-right-radius: 100px;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
border-width: 2px;
border-top-color: #e5e5e5;
border-right-color: #e5e5e5;
border-bottom-color: #e5e5e5;
border-left-color: #e5e5e5;
border-style: solid;
}
.u-loading-icon--vertical.data-v-2af81691 {
flex-direction: column;
}
.data-v-2af81691:host {
font-size: 0px;
line-height: 1;
}
.u-loading-icon__spinner--spinner.data-v-2af81691 {
animation-timing-function: steps(12);
}
.u-loading-icon__text.data-v-2af81691:empty {
display: none;
}
.u-loading-icon--vertical .u-loading-icon__text.data-v-2af81691 {
margin: 6px 0 0;
color: #606266;
}
.u-loading-icon__dot.data-v-2af81691 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.u-loading-icon__dot.data-v-2af81691:before {
display: block;
width: 2px;
height: 25%;
margin: 0 auto;
background-color: currentColor;
border-radius: 40%;
content: " ";
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(1) {
transform: rotate(30deg);
opacity: 1;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(2) {
transform: rotate(60deg);
opacity: 0.9375;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(3) {
transform: rotate(90deg);
opacity: 0.875;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(4) {
transform: rotate(120deg);
opacity: 0.8125;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(5) {
transform: rotate(150deg);
opacity: 0.75;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(6) {
transform: rotate(180deg);
opacity: 0.6875;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(7) {
transform: rotate(210deg);
opacity: 0.625;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(8) {
transform: rotate(240deg);
opacity: 0.5625;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(9) {
transform: rotate(270deg);
opacity: 0.5;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(10) {
transform: rotate(300deg);
opacity: 0.4375;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(11) {
transform: rotate(330deg);
opacity: 0.375;
}
.u-loading-icon__dot.data-v-2af81691:nth-of-type(12) {
transform: rotate(360deg);
opacity: 0.3125;
}
@keyframes u-rotate-2af81691 {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(1turn);
}
}

View File

@@ -0,0 +1 @@
<view a:if="{{a}}" style="{{s}}" class="{{('u-loading-icon') + ' ' + 'data-v-2af81691' + ' ' + t}}"><view a:if="{{b}}" class="{{('u-loading-icon__spinner') + ' ' + 'data-v-2af81691' + ' ' + e}}" ref="ani" style="{{'color:' + f + ';' + ('width:' + g) + ';' + ('height:' + h) + ';' + ('border-top-color:' + i) + ';' + ('border-bottom-color:' + j) + ';' + ('border-left-color:' + k) + ';' + ('border-right-color:' + l) + ';' + ('animation-duration:' + m) + ';' + ('animation-timing-function:' + n)}}"><block a:if="{{c}}"><view a:for="{{d}}" a:for-item="item" a:key="a" class="u-loading-icon__dot data-v-2af81691"></view></block></view><text a:if="{{o}}" class="u-loading-icon__text data-v-2af81691" style="{{'font-size:' + q + ';' + ('color:' + r)}}">{{p}}</text></view>

View File

@@ -0,0 +1,105 @@
"use strict";
const uni_modules_uviewPlus_components_uLoadingIcon_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_colorGradient = require("../../libs/function/colorGradient.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-loading-icon",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLoadingIcon_props.props],
data() {
return {
// Array.form可以通过一个伪数组对象创建指定长度的数组
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
array12: Array.from({
length: 12
}),
// 这里需要设置默认值为360否则在安卓nvue上会延迟一个duration周期后才执行
// 在iOS nvue上则会一开始默认执行两个周期的动画
aniAngel: 360,
// 动画旋转角度
webviewHide: false,
// 监听webview的状态如果隐藏了页面则停止动画以免性能消耗
loading: false
// 是否运行中针对nvue使用
};
},
computed: {
// 当为circle类型时给其另外三边设置一个更轻一些的颜色
// 之所以需要这么做的原因是比如父组件传了color为红色那么需要另外的三个边为浅红色
// 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
otherBorderColor() {
const lightColor = uni_modules_uviewPlus_libs_function_colorGradient.colorGradient$1(this.color, "#ffffff", 100)[80];
if (this.mode === "circle") {
return this.inactiveColor ? this.inactiveColor : lightColor;
} else {
return "transparent";
}
}
},
watch: {
show(n) {
}
},
mounted() {
this.init();
},
methods: {
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
init() {
setTimeout(() => {
}, 20);
},
// 监听webview的显示与隐藏
addEventListenerToWebview() {
const pages = getCurrentPages();
const page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview();
currentWebview.addEventListener("hide", () => {
this.webviewHide = true;
});
currentWebview.addEventListener("show", () => {
this.webviewHide = false;
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.show
}, _ctx.show ? common_vendor.e({
b: !$data.webviewHide
}, !$data.webviewHide ? common_vendor.e({
c: _ctx.mode === "spinner"
}, _ctx.mode === "spinner" ? {
d: common_vendor.f($data.array12, (item, index, i0) => {
return {
a: index
};
})
} : {}, {
e: common_vendor.n(`u-loading-icon__spinner--${_ctx.mode}`),
f: _ctx.color,
g: $options.addUnit(_ctx.size),
h: $options.addUnit(_ctx.size),
i: _ctx.color,
j: $options.otherBorderColor,
k: $options.otherBorderColor,
l: $options.otherBorderColor,
m: `${_ctx.duration}ms`,
n: _ctx.mode === "semicircle" || _ctx.mode === "circle" ? _ctx.timingFunction : ""
}) : {}, {
o: _ctx.text
}, _ctx.text ? {
p: common_vendor.t(_ctx.text),
q: $options.addUnit(_ctx.textSize),
r: _ctx.textColor
} : {}, {
s: common_vendor.s($options.addStyle(_ctx.customStyle)),
t: common_vendor.n(_ctx.vertical && "u-loading-icon--vertical")
}) : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2af81691"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

View File

@@ -0,0 +1,27 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 是否显示遮罩
show: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.overlay.show
},
// 层级z-index
zIndex: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.overlay.zIndex
},
// 遮罩的过渡时间单位为ms
duration: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.overlay.duration
},
// 不透明度值当做rgba的第四个参数
opacity: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.overlay.opacity
}
}
};
exports.props = props;

View File

@@ -0,0 +1,24 @@
.u-empty.data-v-9112bed9,
.u-empty__wrap.data-v-9112bed9,
.u-tabs.data-v-9112bed9,
.u-tabs__wrapper.data-v-9112bed9,
.u-tabs__wrapper__scroll-view-wrapper.data-v-9112bed9,
.u-tabs__wrapper__scroll-view.data-v-9112bed9,
.u-tabs__wrapper__nav.data-v-9112bed9,
.u-tabs__wrapper__nav__line.data-v-9112bed9 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-overlay.data-v-9112bed9 {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
}

View File

@@ -0,0 +1 @@
<u-transition class="data-v-9112bed9" u-s="{{['d']}}" onClick="{{a}}" u-i="9112bed9-0" onVI="__l" u-p="{{b}}"><slot/></u-transition>

View File

@@ -0,0 +1,51 @@
"use strict";
const uni_modules_uviewPlus_components_uOverlay_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-overlay",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uOverlay_props.props],
computed: {
overlayStyle() {
const style = {
position: "fixed",
top: 0,
left: 0,
right: 0,
zIndex: this.zIndex,
bottom: 0,
"background-color": `rgba(0, 0, 0, ${this.opacity})`
};
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
}
},
emits: ["click"],
methods: {
clickHandler() {
this.$emit("click");
}
}
};
if (!Array) {
const _easycom_u_transition2 = common_vendor.resolveComponent("u-transition");
_easycom_u_transition2();
}
const _easycom_u_transition = () => "../u-transition/u-transition.js";
if (!Math) {
_easycom_u_transition();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o($options.clickHandler),
b: common_vendor.p({
show: _ctx.show,
["custom-class"]: "u-overlay",
duration: _ctx.duration,
["custom-style"]: $options.overlayStyle
})
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9112bed9"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-transition": "../u-transition/u-transition"
}
}

View File

@@ -0,0 +1,87 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 是否展示picker弹窗
show: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.show
},
// 弹出的方向,可选值为 top bottom right left center
popupMode: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.popupMode
},
// 是否展示顶部的操作栏
showToolbar: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.showToolbar
},
// 顶部标题
title: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.title
},
// 对象数组,设置每一列的数据
columns: {
type: Array,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.columns
},
// 是否显示加载中状态
loading: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.loading
},
// 各列中,单个选项的高度
itemHeight: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.itemHeight
},
// 取消按钮的文字
cancelText: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.cancelText
},
// 确认按钮的文字
confirmText: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.confirmText
},
// 取消按钮的颜色
cancelColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.cancelColor
},
// 确认按钮的颜色
confirmColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.confirmColor
},
// 每列中可见选项的数量
visibleItemCount: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.visibleItemCount
},
// 选项对象中,需要展示的属性键名
keyName: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.keyName
},
// 是否允许点击遮罩关闭选择器
closeOnClickOverlay: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.closeOnClickOverlay
},
// 各列的默认索引
defaultIndex: {
type: Array,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.defaultIndex
},
// 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件只在微信2.21.1及以上有效
immediateChange: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.picker.immediateChange
}
}
};
exports.props = props;

View File

@@ -0,0 +1,52 @@
.u-empty.data-v-91b05052,
.u-empty__wrap.data-v-91b05052,
.u-tabs.data-v-91b05052,
.u-tabs__wrapper.data-v-91b05052,
.u-tabs__wrapper__scroll-view-wrapper.data-v-91b05052,
.u-tabs__wrapper__scroll-view.data-v-91b05052,
.u-tabs__wrapper__nav.data-v-91b05052,
.u-tabs__wrapper__nav__line.data-v-91b05052 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-picker.data-v-91b05052 {
position: relative;
}
.u-picker__view__column.data-v-91b05052 {
display: flex;
flex-direction: row;
flex: 1;
justify-content: center;
}
.u-picker__view__column__item.data-v-91b05052 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 16px;
text-align: center;
display: block;
color: #303133;
}
.u-picker__view__column__item--disabled.data-v-91b05052 {
cursor: not-allowed;
opacity: 0.35;
}
.u-picker--loading.data-v-91b05052 {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: rgba(255, 255, 255, 0.87);
z-index: 1000;
}

View File

@@ -0,0 +1 @@
<u-popup class="data-v-91b05052" u-s="{{['d']}}" onClose="{{m}}" u-i="91b05052-0" onVI="__l" u-p="{{n}}"><view class="u-picker data-v-91b05052"><u-toolbar a:if="{{a}}" class="data-v-91b05052" onCancel="{{b}}" onConfirm="{{c}}" u-i="91b05052-1,91b05052-0" onVI="__l" u-p="{{d}}"></u-toolbar><picker-view class="u-picker__view data-v-91b05052" indicatorStyle="{{f}}" value="{{g}}" immediateChange="{{h}}" style="{{'height:' + i}}" onChange="{{j}}"><picker-view-column a:for="{{e}}" a:for-item="item" a:key="e" class="u-picker__view__column data-v-91b05052"><block a:if="{{item.a}}"><view a:for="{{item.b}}" a:for-item="item1" a:key="b" class="u-picker__view__column__item u-line-1 data-v-91b05052" style="{{'height:' + item.c + ';' + ('line-height:' + item.d) + ';' + ('font-weight:' + item1.c) + ';' + ('display:' + 'block')}}">{{item1.a}}</view></block></picker-view-column></picker-view><view a:if="{{k}}" class="u-picker--loading data-v-91b05052"><u-loading-icon class="data-v-91b05052" u-i="91b05052-2,91b05052-0" onVI="__l" u-p="{{l}}"></u-loading-icon></view></view></u-popup>

View File

@@ -0,0 +1,211 @@
"use strict";
const uni_modules_uviewPlus_components_uPicker_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-picker",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uPicker_props.props],
data() {
return {
// 上一次选择的列索引
lastIndex: [],
// 索引值 对应picker-view的value
innerIndex: [],
// 各列的值
innerColumns: [],
// 上一次的变化列索引
columnIndex: 0
};
},
watch: {
// 监听默认索引的变化,重新设置对应的值
defaultIndex: {
immediate: true,
handler(n) {
this.setIndexs(n, true);
}
},
// 监听columns参数的变化
columns: {
immediate: true,
deep: true,
handler(n) {
this.setColumns(n);
}
}
},
emits: ["close", "cancel", "confirm", "change"],
methods: {
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
testArray: uni_modules_uviewPlus_libs_function_test.test.array,
// 获取item需要显示的文字判别为对象还是文本
getItemText(item) {
if (uni_modules_uviewPlus_libs_function_test.test.object(item)) {
return item[this.keyName];
} else {
return item;
}
},
// 关闭选择器
closeHandler() {
if (this.closeOnClickOverlay) {
this.$emit("close");
}
},
// 点击工具栏的取消按钮
cancel() {
this.$emit("cancel");
},
// 点击工具栏的确定按钮
confirm() {
this.$emit("confirm", {
indexs: this.innerIndex,
value: this.innerColumns.map((item, index) => item[this.innerIndex[index]]),
values: this.innerColumns
});
},
// 选择器某一列的数据发生变化时触发
changeHandler(e) {
const {
value
} = e.detail;
let index = 0, columnIndex = 0;
for (let i = 0; i < value.length; i++) {
let item = value[i];
if (item !== (this.lastIndex[i] || 0)) {
columnIndex = i;
index = item;
break;
}
}
this.columnIndex = columnIndex;
const values = this.innerColumns;
this.setLastIndex(value);
this.setIndexs(value);
this.$emit("change", {
// 微信小程序不能传递this会因为循环引用而报错
// picker: this,
value: this.innerColumns.map((item, index2) => item[value[index2]]),
index,
indexs: value,
// values为当前变化列的数组内容
values,
columnIndex
});
},
// 设置index索引此方法可被外部调用设置
setIndexs(index, setLastIndex) {
this.innerIndex = uni_modules_uviewPlus_libs_function_index.deepClone(index);
if (setLastIndex) {
this.setLastIndex(index);
}
},
// 记录上一次的各列索引位置
setLastIndex(index) {
this.lastIndex = uni_modules_uviewPlus_libs_function_index.deepClone(index);
},
// 设置对应列选项的所有值
setColumnValues(columnIndex, values) {
this.innerColumns.splice(columnIndex, 1, values);
this.setLastIndex(this.innerIndex.slice(0, columnIndex));
let tmpIndex = uni_modules_uviewPlus_libs_function_index.deepClone(this.innerIndex);
for (let i = 0; i < this.innerColumns.length; i++) {
if (i > this.columnIndex) {
tmpIndex[i] = 0;
}
}
this.setIndexs(tmpIndex);
},
// 获取对应列的所有选项
getColumnValues(columnIndex) {
(async () => {
await uni_modules_uviewPlus_libs_function_index.sleep();
})();
return this.innerColumns[columnIndex];
},
// 设置整体各列的columns的值
setColumns(columns) {
this.innerColumns = uni_modules_uviewPlus_libs_function_index.deepClone(columns);
if (this.innerIndex.length === 0) {
this.innerIndex = new Array(columns.length).fill(0);
}
},
// 获取各列选中值对应的索引
getIndexs() {
return this.innerIndex;
},
// 获取各列选中的值
getValues() {
(async () => {
await uni_modules_uviewPlus_libs_function_index.sleep();
})();
return this.innerColumns.map((item, index) => item[this.innerIndex[index]]);
}
}
};
if (!Array) {
const _easycom_u_toolbar2 = common_vendor.resolveComponent("u-toolbar");
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_u_toolbar2 + _easycom_u_loading_icon2 + _easycom_u_popup2)();
}
const _easycom_u_toolbar = () => "../u-toolbar/u-toolbar.js";
const _easycom_u_loading_icon = () => "../u-loading-icon/u-loading-icon.js";
const _easycom_u_popup = () => "../u-popup/u-popup.js";
if (!Math) {
(_easycom_u_toolbar + _easycom_u_loading_icon + _easycom_u_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.showToolbar
}, _ctx.showToolbar ? {
b: common_vendor.o($options.cancel),
c: common_vendor.o($options.confirm),
d: common_vendor.p({
cancelColor: _ctx.cancelColor,
confirmColor: _ctx.confirmColor,
cancelText: _ctx.cancelText,
confirmText: _ctx.confirmText,
title: _ctx.title
})
} : {}, {
e: common_vendor.f($data.innerColumns, (item, index, i0) => {
return common_vendor.e({
a: $options.testArray(item)
}, $options.testArray(item) ? {
b: common_vendor.f(item, (item1, index1, i1) => {
return {
a: common_vendor.t($options.getItemText(item1)),
b: index1,
c: index1 === $data.innerIndex[index] ? "bold" : "normal"
};
}),
c: $options.addUnit(_ctx.itemHeight),
d: $options.addUnit(_ctx.itemHeight)
} : {}, {
e: index
});
}),
f: `height: ${$options.addUnit(_ctx.itemHeight)}`,
g: $data.innerIndex,
h: _ctx.immediateChange,
i: `${$options.addUnit(_ctx.visibleItemCount * _ctx.itemHeight)}`,
j: common_vendor.o((...args) => $options.changeHandler && $options.changeHandler(...args)),
k: _ctx.loading
}, _ctx.loading ? {
l: common_vendor.p({
mode: "circle"
})
} : {}, {
m: common_vendor.o($options.closeHandler),
n: common_vendor.p({
show: _ctx.show,
mode: _ctx.popupMode
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-91b05052"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,9 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-toolbar": "../u-toolbar/u-toolbar",
"u-loading-icon": "../u-loading-icon/u-loading-icon",
"u-popup": "../u-popup/u-popup"
}
}

View File

@@ -0,0 +1,82 @@
"use strict";
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = {
props: {
// 是否展示弹窗
show: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.show
},
// 是否显示遮罩
overlay: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.overlay
},
// 弹出的方向,可选值为 top bottom right left center
mode: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.mode
},
// 动画时长单位ms
duration: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.duration
},
// 是否显示关闭图标
closeable: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.closeable
},
// 自定义遮罩的样式
overlayStyle: {
type: [Object, String],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.overlayStyle
},
// 点击遮罩是否关闭弹窗
closeOnClickOverlay: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.closeOnClickOverlay
},
// 层级
zIndex: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.zIndex
},
// 是否为iPhoneX留出底部安全距离
safeAreaInsetBottom: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.safeAreaInsetBottom
},
// 是否留出顶部安全距离(状态栏高度)
safeAreaInsetTop: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.safeAreaInsetTop
},
// 自定义关闭图标位置top-left为左上角top-right为右上角bottom-left为左下角bottom-right为右下角
closeIconPos: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.closeIconPos
},
// 是否显示圆角
round: {
type: [Boolean, String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.round
},
// mode=center也即中部弹出时是否使用缩放模式
zoom: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.zoom
},
// 弹窗背景色设置为transparent可去除白色背景
bgColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.bgColor
},
// 遮罩的透明度0-1之间
overlayOpacity: {
type: [Number, String],
default: () => uni_modules_uviewPlus_libs_config_props.defProps.popup.overlayOpacity
}
}
};
exports.props = props;

View File

@@ -0,0 +1,75 @@
.u-empty.data-v-05c24e9b,
.u-empty__wrap.data-v-05c24e9b,
.u-tabs.data-v-05c24e9b,
.u-tabs__wrapper.data-v-05c24e9b,
.u-tabs__wrapper__scroll-view-wrapper.data-v-05c24e9b,
.u-tabs__wrapper__scroll-view.data-v-05c24e9b,
.u-tabs__wrapper__nav.data-v-05c24e9b,
.u-tabs__wrapper__nav__line.data-v-05c24e9b {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.u-popup.data-v-05c24e9b {
flex: 1;
}
.u-popup__content.data-v-05c24e9b {
background-color: #fff;
position: relative;
}
.u-popup__content--round-top.data-v-05c24e9b {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.u-popup__content--round-left.data-v-05c24e9b {
border-top-left-radius: 0;
border-top-right-radius: 10px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 10px;
}
.u-popup__content--round-right.data-v-05c24e9b {
border-top-left-radius: 10px;
border-top-right-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 0;
}
.u-popup__content--round-bottom.data-v-05c24e9b {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.u-popup__content--round-center.data-v-05c24e9b {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.u-popup__content__close.data-v-05c24e9b {
position: absolute;
}
.u-popup__content__close--hover.data-v-05c24e9b {
opacity: 0.4;
}
.u-popup__content__close--top-left.data-v-05c24e9b {
top: 15px;
left: 15px;
}
.u-popup__content__close--top-right.data-v-05c24e9b {
top: 15px;
right: 15px;
}
.u-popup__content__close--bottom-left.data-v-05c24e9b {
bottom: 15px;
left: 15px;
}
.u-popup__content__close--bottom-right.data-v-05c24e9b {
right: 15px;
bottom: 15px;
}

View File

@@ -0,0 +1 @@
<view class="u-popup data-v-05c24e9b"><u-overlay a:if="{{a}}" class="data-v-05c24e9b" onClick="{{b}}" u-i="05c24e9b-0" onVI="__l" u-p="{{c}}"></u-overlay><u-transition class="data-v-05c24e9b" u-s="{{['d']}}" onAfterEnter="{{l}}" onClick="{{m}}" u-i="05c24e9b-1" onVI="__l" u-p="{{n}}"><view class="u-popup__content data-v-05c24e9b" style="{{j}}" catchTap="{{k}}"><u-status-bar a:if="{{d}}" class="data-v-05c24e9b" u-i="05c24e9b-2,05c24e9b-1" onVI="__l"></u-status-bar><slot></slot><view a:if="{{e}}" catchTap="{{g}}" class="{{('u-popup__content__close') + ' ' + 'data-v-05c24e9b' + ' ' + h}}" hover-class="u-popup__content__close--hover" hover-stay-time="150"><u-icon class="data-v-05c24e9b" u-i="05c24e9b-3,05c24e9b-1" onVI="__l" u-p="{{f}}"></u-icon></view><u-safe-bottom a:if="{{i}}" class="data-v-05c24e9b" u-i="05c24e9b-4,05c24e9b-1" onVI="__l"></u-safe-bottom></view></u-transition></view>

View File

@@ -0,0 +1,178 @@
"use strict";
const uni_modules_uviewPlus_components_uPopup_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-popup",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uPopup_props.props],
data() {
return {
overlayDuration: this.duration + 50
};
},
watch: {
show(newValue, oldValue) {
}
},
computed: {
transitionStyle() {
const style = {
zIndex: this.zIndex,
position: "fixed",
display: "flex"
};
style[this.mode] = 0;
if (this.mode === "left") {
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, {
bottom: 0,
top: 0
});
} else if (this.mode === "right") {
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, {
bottom: 0,
top: 0
});
} else if (this.mode === "top") {
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, {
left: 0,
right: 0
});
} else if (this.mode === "bottom") {
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, {
left: 0,
right: 0
});
} else if (this.mode === "center") {
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, {
alignItems: "center",
"justify-content": "center",
top: 0,
left: 0,
right: 0,
bottom: 0
});
}
},
contentStyle() {
const style = {};
uni_modules_uviewPlus_libs_function_index.sys();
if (this.mode !== "center") {
style.flex = 1;
}
if (this.bgColor) {
style.backgroundColor = this.bgColor;
}
if (this.round) {
const value = uni_modules_uviewPlus_libs_function_index.addUnit(this.round);
if (this.mode === "top") {
style.borderBottomLeftRadius = value;
style.borderBottomRightRadius = value;
} else if (this.mode === "bottom") {
style.borderTopLeftRadius = value;
style.borderTopRightRadius = value;
} else if (this.mode === "center") {
style.borderRadius = value;
}
}
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
},
position() {
if (this.mode === "center") {
return this.zoom ? "fade-zoom" : "fade";
}
if (this.mode === "left") {
return "slide-left";
}
if (this.mode === "right") {
return "slide-right";
}
if (this.mode === "bottom") {
return "slide-up";
}
if (this.mode === "top") {
return "slide-down";
}
}
},
emits: ["open", "close", "click"],
methods: {
// 点击遮罩
overlayClick() {
if (this.closeOnClickOverlay) {
this.$emit("close");
}
},
close(e) {
this.$emit("close");
},
afterEnter() {
this.$emit("open");
},
clickHandler() {
if (this.mode === "center") {
this.overlayClick();
}
this.$emit("click");
}
}
};
if (!Array) {
const _easycom_u_overlay2 = common_vendor.resolveComponent("u-overlay");
const _easycom_u_status_bar2 = common_vendor.resolveComponent("u-status-bar");
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
const _easycom_u_safe_bottom2 = common_vendor.resolveComponent("u-safe-bottom");
const _easycom_u_transition2 = common_vendor.resolveComponent("u-transition");
(_easycom_u_overlay2 + _easycom_u_status_bar2 + _easycom_u_icon2 + _easycom_u_safe_bottom2 + _easycom_u_transition2)();
}
const _easycom_u_overlay = () => "../u-overlay/u-overlay.js";
const _easycom_u_status_bar = () => "../u-status-bar/u-status-bar.js";
const _easycom_u_icon = () => "../u-icon/u-icon.js";
const _easycom_u_safe_bottom = () => "../u-safe-bottom/u-safe-bottom.js";
const _easycom_u_transition = () => "../u-transition/u-transition.js";
if (!Math) {
(_easycom_u_overlay + _easycom_u_status_bar + _easycom_u_icon + _easycom_u_safe_bottom + _easycom_u_transition)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.overlay
}, _ctx.overlay ? {
b: common_vendor.o($options.overlayClick),
c: common_vendor.p({
show: _ctx.show,
zIndex: _ctx.zIndex,
duration: $data.overlayDuration,
customStyle: _ctx.overlayStyle,
opacity: _ctx.overlayOpacity
})
} : {}, {
d: _ctx.safeAreaInsetTop
}, _ctx.safeAreaInsetTop ? {} : {}, {
e: _ctx.closeable
}, _ctx.closeable ? {
f: common_vendor.p({
name: "close",
color: "#909399",
size: "18",
bold: true
}),
g: common_vendor.o((...args) => $options.close && $options.close(...args)),
h: common_vendor.n("u-popup__content__close--" + _ctx.closeIconPos)
} : {}, {
i: _ctx.safeAreaInsetBottom
}, _ctx.safeAreaInsetBottom ? {} : {}, {
j: common_vendor.s($options.contentStyle),
k: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)),
l: common_vendor.o($options.afterEnter),
m: common_vendor.o($options.clickHandler),
n: common_vendor.p({
show: _ctx.show,
customStyle: $options.transitionStyle,
mode: $options.position,
duration: _ctx.duration
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-05c24e9b"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,11 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"u-overlay": "../u-overlay/u-overlay",
"u-status-bar": "../u-status-bar/u-status-bar",
"u-icon": "../u-icon/u-icon",
"u-safe-bottom": "../u-safe-bottom/u-safe-bottom",
"u-transition": "../u-transition/u-transition"
}
}

View File

@@ -0,0 +1,5 @@
"use strict";
const props = {
props: {}
};
exports.props = props;

View File

@@ -0,0 +1,3 @@
.u-safe-bottom.data-v-f3d22cfe {
width: 100%;
}

View File

@@ -0,0 +1 @@
<view style="{{a}}" class="{{('u-safe-bottom') + ' ' + 'data-v-f3d22cfe' + ' ' + b}}"></view>

View File

@@ -0,0 +1,32 @@
"use strict";
const uni_modules_uviewPlus_components_uSafeBottom_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-safe-bottom",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uSafeBottom_props.props],
data() {
return {
safeAreaBottomHeight: 0,
isNvue: false
};
},
computed: {
style() {
const style = {};
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
}
},
mounted() {
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.s($options.style),
b: common_vendor.n(!$data.isNvue && "u-safe-area-inset-bottom")
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f3d22cfe"]]);
my.createComponent(Component);

View File

@@ -0,0 +1,5 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {}
}

Some files were not shown because too many files have changed in this diff Show More