From 206224b02f4df0d8ec2c7402daee730000464dbb Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Thu, 30 Oct 2025 17:19:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 19 + pages/index/index.vue | 58 +- unpackage/dist/dev/app-plus/app-service.js | 4658 ++++++++++++++++- .../dist/dev/app-plus/pages/index/index.css | 1115 ++++ 4 files changed, 5703 insertions(+), 147 deletions(-) diff --git a/main.js b/main.js index c85248d..285931f 100644 --- a/main.js +++ b/main.js @@ -4,6 +4,7 @@ import uvUI from '@climblee/uv-ui' import Vue from 'vue' import './uni.promisify.adaptor' + Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ @@ -18,6 +19,24 @@ import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) app.use(uvUI); + + // 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置 +// 需要在Vue.use(uvUI)之后执行 + uni.$uv.setConfig({ + // 修改$uv.config对象的属性 + + // 修改$uv.props对象的属性 + props: { + // 修改uv-text组件的size参数的默认值,注意:默认值都要用default声明 + text: { + color: { + default: 'red' + } + } + // 其他组件属性配置,具体的参数名称可以去每个组件的props.js中进行查看 + // ...... + } + }) return { app } diff --git a/pages/index/index.vue b/pages/index/index.vue index c5f5d8b..e743be1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,26 +1,72 @@ - @@ -51,4 +97,8 @@ font-size: 36rpx; color: $uni-color-primary; } + .icon { + width: 36rpx; + height: 36rpx; + } diff --git a/unpackage/dist/dev/app-plus/app-service.js b/unpackage/dist/dev/app-plus/app-service.js index 1fcfc39..1033f95 100644 --- a/unpackage/dist/dev/app-plus/app-service.js +++ b/unpackage/dist/dev/app-plus/app-service.js @@ -31,7 +31,7 @@ if (uni.restoreGlobal) { } (function(vue) { "use strict"; - var _e, _f; + var _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; function formatAppLog(type, filename, ...args) { if (uni.__log__) { uni.__log__(type, filename, ...args); @@ -1050,6 +1050,473 @@ if (uni.restoreGlobal) { } } }; + const uvBadgeProps = { + props: { + // 是否显示圆点 + isDot: { + type: Boolean, + default: false + }, + // 显示的内容 + value: { + type: [Number, String], + default: "" + }, + // 是否显示 + show: { + type: Boolean, + default: true + }, + // 最大值,超过最大值会显示 '{max}+' + max: { + type: [Number, String], + default: 999 + }, + // 主题类型,error|warning|success|primary + type: { + type: [String, void 0, null], + default: "error" + }, + // 当数值为 0 时,是否展示 Badge + showZero: { + type: Boolean, + default: false + }, + // 背景颜色,优先级比type高,如设置,type参数会失效 + bgColor: { + type: [String, null], + default: null + }, + // 字体颜色 + color: { + type: [String, null], + default: null + }, + // 徽标形状,circle-四角均为圆角,horn-左下角为直角 + shape: { + type: [String, void 0, null], + default: "circle" + }, + // 设置数字的显示方式,overflow|ellipsis|limit + // overflow会根据max字段判断,超出显示`${max}+` + // ellipsis会根据max判断,超出显示`${max}...` + // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数 + numberType: { + type: [String, void 0, null], + default: "overflow" + }, + // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效 + offset: { + type: Array, + default: () => [] + }, + // 是否反转背景和字体颜色 + inverted: { + type: Boolean, + default: false + }, + // 是否绝对定位 + absolute: { + type: Boolean, + default: false + }, + ...(_f = (_e = uni.$uv) == null ? void 0 : _e.props) == null ? void 0 : _f.badge + } + }; + const _export_sfc = (sfc, props2) => { + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props2) { + target[key] = val; + } + return target; + }; + const _sfc_main$g = { + name: "uv-badge", + mixins: [mpMixin, mixin, uvBadgeProps], + computed: { + // 是否将badge中心与父组件右上角重合 + boxStyle() { + let style = {}; + return style; + }, + // 整个组件的样式 + badgeStyle() { + const style = {}; + if (this.color) { + style.color = this.color; + } + if (this.bgColor && !this.inverted) { + style.backgroundColor = this.bgColor; + } + if (this.absolute) { + style.position = "absolute"; + if (this.offset.length) { + const top = this.offset[0]; + const right = this.offset[1] || top; + style.top = this.$uv.addUnit(top); + style.right = this.$uv.addUnit(right); + } + } + return style; + }, + showValue() { + switch (this.numberType) { + case "overflow": + return Number(this.value) > Number(this.max) ? this.max + "+" : this.value; + case "ellipsis": + return Number(this.value) > Number(this.max) ? "..." : this.value; + case "limit": + return Number(this.value) > 999 ? Number(this.value) >= 9999 ? Math.floor(this.value / 1e4 * 100) / 100 + "w" : Math.floor(this.value / 1e3 * 100) / 100 + "k" : this.value; + default: + return Number(this.value); + } + }, + propsType() { + return this.type || "error"; + } + } + }; + function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) { + return _ctx.show && ((Number(_ctx.value) === 0 ? _ctx.showZero : true) || _ctx.isDot) ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 0, + class: vue.normalizeClass([[_ctx.isDot ? "uv-badge--dot" : "uv-badge--not-dot", _ctx.inverted && "uv-badge--inverted", _ctx.shape === "horn" && "uv-badge--horn", `uv-badge--${$options.propsType}${_ctx.inverted ? "--inverted" : ""}`], "uv-badge"]), + style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), $options.badgeStyle]) + }, + vue.toDisplayString(_ctx.isDot ? "" : $options.showValue), + 7 + /* TEXT, CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true); + } + const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-747d4365"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-badge/uv-badge.vue"]]); + const props$8 = { + props: { + // 滑块的移动过渡时间,单位ms + duration: { + type: Number, + default: 300 + }, + // tabs标签数组 + list: { + type: Array, + default: () => [] + }, + // 滑块颜色 + lineColor: { + type: String, + default: "#3c9cff" + }, + // 菜单选择中时的样式 + activeStyle: { + type: [String, Object], + default: () => ({ + color: "#303133" + }) + }, + // 菜单非选中时的样式 + inactiveStyle: { + type: [String, Object], + default: () => ({ + color: "#606266" + }) + }, + // 滑块长度 + lineWidth: { + type: [String, Number], + default: 20 + }, + // 滑块高度 + lineHeight: { + type: [String, Number], + default: 3 + }, + // 滑块背景显示大小,当滑块背景设置为图片时使用 + lineBgSize: { + type: String, + default: "cover" + }, + // 菜单item的样式 + itemStyle: { + type: [String, Object], + default: () => ({ + height: "44px" + }) + }, + // 菜单是否可滚动 + scrollable: { + type: Boolean, + default: true + }, + // 当前选中标签的索引 + current: { + type: [Number, String], + default: 0 + }, + // 默认读取的键名 + keyName: { + type: String, + default: "name" + }, + ...(_h = (_g = uni.$uv) == null ? void 0 : _g.props) == null ? void 0 : _h.tabs + } + }; + const _sfc_main$f = { + name: "uv-tabs", + emits: ["click", "change"], + mixins: [mpMixin, mixin, props$8], + data() { + return { + firstTime: true, + scrollLeft: 0, + scrollViewWidth: 0, + lineOffsetLeft: 0, + tabsRect: { + left: 0 + }, + innerCurrent: 0, + moving: false + }; + }, + watch: { + current: { + immediate: true, + handler(newValue, oldValue) { + if (newValue !== this.innerCurrent) { + this.innerCurrent = newValue; + this.$nextTick(() => { + this.resize(); + }); + } + } + }, + // list变化时,重新渲染list各项信息 + list() { + this.$nextTick(() => { + this.resize(); + }); + } + }, + computed: { + textStyle() { + return (index2) => { + const style = {}; + const customeStyle = index2 == this.innerCurrent ? this.$uv.addStyle(this.activeStyle) : this.$uv.addStyle( + this.inactiveStyle + ); + if (this.list[index2].disabled) { + style.color = "#c8c9cc"; + } + return this.$uv.deepMerge(customeStyle, style); + }; + }, + propsBadge() { + return uvBadgeProps; + } + }, + async mounted() { + this.init(); + }, + methods: { + setLineLeft() { + const tabItem = this.list[this.innerCurrent]; + if (!tabItem) { + return; + } + let lineOffsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => total + curr.rect.width, 0); + let lineWidth = this.$uv.getPx(this.lineWidth); + if (this.$uv.test.number(this.lineWidth) && this.$uv.unit) { + lineWidth = this.$uv.getPx(`${this.lineWidth}${this.$uv.unit}`); + } + this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth) / 2; + if (this.firstTime) { + setTimeout(() => { + this.firstTime = false; + }, 20); + } + }, + // nvue下设置滑块的位置 + animation(x, duration = 0) { + }, + // 点击某一个标签 + clickHandler(item, index2) { + this.$emit("click", { + ...item, + index: index2 + }); + if (item.disabled) + return; + if (this.innerCurrent != index2) { + this.$emit("change", { + ...item, + index: index2 + }); + } + this.innerCurrent = index2; + this.$nextTick(() => { + this.resize(); + }); + }, + init() { + this.$uv.sleep().then(() => { + this.resize(); + }); + }, + setScrollLeft() { + const tabRect = this.list[this.innerCurrent]; + const offsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => { + return total + curr.rect.width; + }, 0); + const windowWidth = this.$uv.sys().windowWidth; + let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth - this.tabsRect.right) / 2 + this.tabsRect.left / 2; + scrollLeft = Math.min(scrollLeft, this.scrollViewWidth - this.tabsRect.width); + this.scrollLeft = Math.max(0, scrollLeft); + }, + // 获取所有标签的尺寸 + resize() { + if (this.list.length === 0) { + return; + } + Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => { + this.tabsRect = tabsRect; + this.scrollViewWidth = 0; + itemRect.map((item, index2) => { + this.scrollViewWidth += item.width; + this.list[index2].rect = item; + }); + this.setLineLeft(); + this.setScrollLeft(); + }); + }, + // 获取导航菜单的尺寸 + getTabsRect() { + return new Promise((resolve) => { + this.queryRect("uv-tabs__wrapper__scroll-view").then((size) => resolve(size)); + }); + }, + // 获取所有标签的尺寸 + getAllItemRect() { + return new Promise((resolve) => { + const promiseAllArr = this.list.map((item, index2) => this.queryRect( + `uv-tabs__wrapper__nav__item-${index2}`, + true + )); + Promise.all(promiseAllArr).then((sizes) => resolve(sizes)); + }); + }, + // 获取各个标签的尺寸 + queryRect(el, item) { + return new Promise((resolve) => { + this.$uvGetRect(`.${el}`).then((size) => { + resolve(size); + }); + }); + } + } + }; + function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_badge = resolveEasycom(vue.resolveDynamicComponent("uv-badge"), __easycom_1$3); + return vue.openBlock(), vue.createElementBlock( + "view", + { + class: "uv-tabs", + style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)]) + }, + [ + vue.createElementVNode("view", { class: "uv-tabs__wrapper" }, [ + vue.renderSlot(_ctx.$slots, "left", {}, void 0, true), + vue.createElementVNode("view", { class: "uv-tabs__wrapper__scroll-view-wrapper" }, [ + vue.createElementVNode("scroll-view", { + "scroll-x": _ctx.scrollable, + "scroll-left": $data.scrollLeft, + "scroll-with-animation": "", + class: "uv-tabs__wrapper__scroll-view", + "show-scrollbar": false, + ref: "uv-tabs__wrapper__scroll-view" + }, [ + vue.createElementVNode( + "view", + { + class: "uv-tabs__wrapper__nav", + ref: "uv-tabs__wrapper__nav", + style: vue.normalizeStyle({ + flex: _ctx.scrollable ? "" : 1 + }) + }, + [ + (vue.openBlock(true), vue.createElementBlock( + vue.Fragment, + null, + vue.renderList(_ctx.list, (item, index2) => { + return vue.openBlock(), vue.createElementBlock("view", { + class: vue.normalizeClass(["uv-tabs__wrapper__nav__item", [`uv-tabs__wrapper__nav__item-${index2}`, item.disabled && "uv-tabs__wrapper__nav__item--disabled"]]), + key: index2, + onClick: ($event) => $options.clickHandler(item, index2), + ref_for: true, + ref: `uv-tabs__wrapper__nav__item-${index2}`, + style: vue.normalizeStyle([{ flex: _ctx.scrollable ? "" : 1 }, _ctx.$uv.addStyle(_ctx.itemStyle)]) + }, [ + vue.createElementVNode( + "text", + { + class: vue.normalizeClass([[item.disabled && "uv-tabs__wrapper__nav__item__text--disabled"], "uv-tabs__wrapper__nav__item__text"]), + style: vue.normalizeStyle([$options.textStyle(index2)]) + }, + vue.toDisplayString(item[_ctx.keyName]), + 7 + /* TEXT, CLASS, STYLE */ + ), + vue.createVNode(_component_uv_badge, { + show: !!(item.badge && (item.badge.show || item.badge.isDot || item.badge.value)), + isDot: item.badge && item.badge.isDot || $options.propsBadge.isDot, + value: item.badge && item.badge.value || $options.propsBadge.value, + max: item.badge && item.badge.max || $options.propsBadge.max, + type: item.badge && item.badge.type || $options.propsBadge.type, + showZero: item.badge && item.badge.showZero || $options.propsBadge.showZero, + bgColor: item.badge && item.badge.bgColor || $options.propsBadge.bgColor, + color: item.badge && item.badge.color || $options.propsBadge.color, + shape: item.badge && item.badge.shape || $options.propsBadge.shape, + numberType: item.badge && item.badge.numberType || $options.propsBadge.numberType, + inverted: item.badge && item.badge.inverted || $options.propsBadge.inverted, + customStyle: "margin-left: 4px;" + }, null, 8, ["show", "isDot", "value", "max", "type", "showZero", "bgColor", "color", "shape", "numberType", "inverted"]) + ], 14, ["onClick"]); + }), + 128 + /* KEYED_FRAGMENT */ + )), + vue.createElementVNode( + "view", + { + class: "uv-tabs__wrapper__nav__line", + ref: "uv-tabs__wrapper__nav__line", + style: vue.normalizeStyle([{ + width: _ctx.$uv.addUnit(_ctx.lineWidth), + transform: `translate(${$data.lineOffsetLeft}px)`, + transitionDuration: `${$data.firstTime ? 0 : _ctx.duration}ms`, + height: $data.firstTime ? 0 : _ctx.$uv.addUnit(_ctx.lineHeight), + background: _ctx.lineColor, + backgroundSize: _ctx.lineBgSize + }]) + }, + null, + 4 + /* STYLE */ + ) + ], + 4 + /* STYLE */ + ) + ], 8, ["scroll-x", "scroll-left"]) + ]), + vue.renderSlot(_ctx.$slots, "right", {}, void 0, true) + ]) + ], + 4 + /* STYLE */ + ); + } + const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-0f3b9fa1"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-tabs/uv-tabs.vue"]]); const icons = { "uvicon-level": "e68f", "uvicon-checkbox-mark": "e659", @@ -1210,7 +1677,7 @@ if (uni.restoreGlobal) { "uvicon-twitte": "e607", "uvicon-twitter-circle-fill": "e6cf" }; - const props = { + const props$7 = { props: { // 图标类名 name: { @@ -1297,20 +1764,13 @@ if (uni.restoreGlobal) { type: Boolean, default: false }, - ...(_f = (_e = uni.$uv) == null ? void 0 : _e.props) == null ? void 0 : _f.icon + ...(_j = (_i = uni.$uv) == null ? void 0 : _i.props) == null ? void 0 : _j.icon } }; - const _export_sfc = (sfc, props2) => { - const target = sfc.__vccOpts || sfc; - for (const [key, val] of props2) { - target[key] = val; - } - return target; - }; - const _sfc_main$2 = { + const _sfc_main$e = { name: "uv-icon", emits: ["click"], - mixins: [mpMixin, mixin, props], + mixins: [mpMixin, mixin, props$7], data() { return { colorType: [ @@ -1368,7 +1828,7 @@ if (uni.restoreGlobal) { } } }; - function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock( "view", { @@ -1412,41 +1872,4043 @@ if (uni.restoreGlobal) { /* CLASS */ ); } - const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-7cc7ad3f"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-icon/uv-icon.vue"]]); - const _imports_0 = "/static/logo.png"; + const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-7cc7ad3f"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-icon/uv-icon.vue"]]); + function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) { + const startRGB = hexToRgb(startColor, false); + const startR = startRGB[0]; + const startG = startRGB[1]; + const startB = startRGB[2]; + const endRGB = hexToRgb(endColor, false); + const endR = endRGB[0]; + const endG = endRGB[1]; + const endB = endRGB[2]; + const sR = (endR - startR) / step; + const sG = (endG - startG) / step; + const sB = (endB - startB) / step; + const colorArr = []; + for (let i = 0; i < step; i++) { + let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`); + if (i === 0) + hex = rgbToHex(startColor); + if (i === step - 1) + hex = rgbToHex(endColor); + colorArr.push(hex); + } + return colorArr; + } + function hexToRgb(sColor, str = true) { + const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + sColor = String(sColor).toLowerCase(); + if (sColor && reg.test(sColor)) { + if (sColor.length === 4) { + let sColorNew = "#"; + for (let i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); + } + sColor = sColorNew; + } + const sColorChange = []; + for (let i = 1; i < 7; i += 2) { + sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`)); + } + if (!str) { + return sColorChange; + } + return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`; + } + if (/^(rgb|RGB)/.test(sColor)) { + const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); + return arr.map((val) => Number(val)); + } + return sColor; + } + function rgbToHex(rgb) { + const _this = rgb; + const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + if (/^(rgb|RGB)/.test(_this)) { + const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); + let strHex = "#"; + for (let i = 0; i < aColor.length; i++) { + let hex = Number(aColor[i]).toString(16); + hex = String(hex).length == 1 ? `${0}${hex}` : hex; + if (hex === "0") { + hex += hex; + } + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; + } + if (reg.test(_this)) { + const aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } + if (aNum.length === 3) { + let numHex = "#"; + for (let i = 0; i < aNum.length; i += 1) { + numHex += aNum[i] + aNum[i]; + } + return numHex; + } + } else { + return _this; + } + } + function colorToRgba(color, alpha) { + color = rgbToHex(color); + const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + let sColor = String(color).toLowerCase(); + if (sColor && reg.test(sColor)) { + if (sColor.length === 4) { + let sColorNew = "#"; + for (let i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); + } + sColor = sColorNew; + } + const sColorChange = []; + for (let i = 1; i < 7; i += 2) { + sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`)); + } + return `rgba(${sColorChange.join(",")},${alpha})`; + } + return sColor; + } + const props$6 = { + props: { + // 是否显示组件 + show: { + type: Boolean, + default: true + }, + // 颜色 + color: { + type: String, + default: "#909193" + }, + // 提示文字颜色 + textColor: { + type: String, + default: "#909193" + }, + // 文字和图标是否垂直排列 + vertical: { + type: Boolean, + default: false + }, + // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形 + mode: { + type: String, + default: "spinner" + }, + // 图标大小,单位默认px + size: { + type: [String, Number], + default: 24 + }, + // 文字大小 + textSize: { + type: [String, Number], + default: 15 + }, + // 文字样式 + textStyle: { + type: Object, + default() { + return {}; + } + }, + // 文字内容 + text: { + type: [String, Number], + default: "" + }, + // 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html + timingFunction: { + type: String, + default: "linear" + }, + // 动画执行周期时间 + duration: { + type: [String, Number], + default: 1200 + }, + // mode=circle时的暗边颜色 + inactiveColor: { + type: String, + default: "" + }, + ...(_l = (_k = uni.$uv) == null ? void 0 : _k.props) == null ? void 0 : _l.loadingIcon + } + }; + const _sfc_main$d = { + name: "uv-loading-icon", + mixins: [mpMixin, mixin, props$6], + 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 = colorGradient(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: { + init() { + setTimeout(() => { + this.show && this.addEventListenerToWebview(); + }, 20); + }, + // 监听webview的显示与隐藏 + addEventListenerToWebview() { + const pages2 = getCurrentPages(); + const page2 = pages2[pages2.length - 1]; + const currentWebview = page2.$getAppWebview(); + currentWebview.addEventListener("hide", () => { + this.webviewHide = true; + }); + currentWebview.addEventListener("show", () => { + this.webviewHide = false; + }); + } + } + }; + function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) { + return _ctx.show ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: vue.normalizeClass(["uv-loading-icon", [_ctx.vertical && "uv-loading-icon--vertical"]]), + style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)]) + }, + [ + !$data.webviewHide ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: vue.normalizeClass(["uv-loading-icon__spinner", [`uv-loading-icon__spinner--${_ctx.mode}`]]), + ref: "ani", + style: vue.normalizeStyle({ + color: _ctx.color, + width: _ctx.$uv.addUnit(_ctx.size), + height: _ctx.$uv.addUnit(_ctx.size), + borderTopColor: _ctx.color, + borderBottomColor: $options.otherBorderColor, + borderLeftColor: $options.otherBorderColor, + borderRightColor: $options.otherBorderColor, + "animation-duration": `${_ctx.duration}ms`, + "animation-timing-function": _ctx.mode === "semicircle" || _ctx.mode === "circle" ? _ctx.timingFunction : "" + }) + }, + [ + _ctx.mode === "spinner" ? (vue.openBlock(true), vue.createElementBlock( + vue.Fragment, + { key: 0 }, + vue.renderList($data.array12, (item, index2) => { + return vue.openBlock(), vue.createElementBlock("view", { + key: index2, + class: "uv-loading-icon__dot" + }); + }), + 128 + /* KEYED_FRAGMENT */ + )) : vue.createCommentVNode("v-if", true) + ], + 6 + /* CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true), + _ctx.text ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 1, + class: "uv-loading-icon__text", + style: vue.normalizeStyle([{ + fontSize: _ctx.$uv.addUnit(_ctx.textSize), + color: _ctx.textColor + }, _ctx.$uv.addStyle(_ctx.textStyle)]) + }, + vue.toDisplayString(_ctx.text), + 5 + /* TEXT, STYLE */ + )) : vue.createCommentVNode("v-if", true) + ], + 6 + /* CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true); + } + const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-daf2e960"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-loading-icon/uv-loading-icon.vue"]]); + const props$5 = { + props: { + // 是否细边框 + hairline: { + type: Boolean, + default: true + }, + // 按钮的预置样式,info,primary,error,warning,success + type: { + type: String, + default: "info" + }, + // 按钮尺寸,large,normal,small,mini + size: { + type: String, + default: "normal" + }, + // 按钮形状,circle(两边为半圆),square(带圆角) + shape: { + type: String, + default: "square" + }, + // 按钮是否镂空 + plain: { + type: Boolean, + default: false + }, + // 是否禁止状态 + disabled: { + type: Boolean, + default: false + }, + // 是否加载中 + loading: { + type: Boolean, + default: false + }, + // 加载中提示文字 + loadingText: { + type: [String, Number], + default: "" + }, + // 加载状态图标类型 + loadingMode: { + type: String, + default: "spinner" + }, + // 加载图标大小 + loadingSize: { + type: [String, Number], + default: 14 + }, + // 开放能力,具体请看uniapp稳定关于button组件部分说明 + // https://uniapp.dcloud.io/component/button + openType: { + type: String, + default: "" + }, + // 用于
组件,点击分别会触发 组件的 submit/reset 事件 + // 取值为submit(提交表单),reset(重置表单) + formType: { + type: String, + default: "" + }, + // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 + // 只微信小程序、QQ小程序有效 + appParameter: { + type: String, + default: "" + }, + // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 + hoverStopPropagation: { + type: Boolean, + default: true + }, + // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 + lang: { + type: String, + default: "en" + }, + // 会话来源,open-type="contact"时有效。只微信小程序有效 + sessionFrom: { + type: String, + default: "" + }, + // 会话内消息卡片标题,open-type="contact"时有效 + // 默认当前标题,只微信小程序有效 + sendMessageTitle: { + type: String, + default: "" + }, + // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 + // 默认当前分享路径,只微信小程序有效 + sendMessagePath: { + type: String, + default: "" + }, + // 会话内消息卡片图片,open-type="contact"时有效 + // 默认当前页面截图,只微信小程序有效 + sendMessageImg: { + type: String, + default: "" + }, + // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示, + // 用户点击后可以快速发送小程序消息,open-type="contact"时有效 + showMessageCard: { + type: Boolean, + default: true + }, + // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 + dataName: { + type: String, + default: "" + }, + // 节流,一定时间内只能触发一次 + throttleTime: { + type: [String, Number], + default: 0 + }, + // 按住后多久出现点击态,单位毫秒 + hoverStartTime: { + type: [String, Number], + default: 0 + }, + // 手指松开后点击态保留时间,单位毫秒 + hoverStayTime: { + type: [String, Number], + default: 200 + }, + // 按钮文字,之所以通过props传入,是因为slot传入的话 + // nvue中无法控制文字的样式 + text: { + type: [String, Number], + default: "" + }, + // 按钮图标 + icon: { + type: String, + default: "" + }, + // 按钮图标大小 + iconSize: { + type: [String, Number], + default: "" + }, + // 按钮图标颜色 + iconColor: { + type: String, + default: "#000000" + }, + // 按钮颜色,支持传入linear-gradient渐变色 + color: { + type: String, + default: "" + }, + // 自定义按钮文本样式 + customTextStyle: { + type: [Object, String], + default: "" + }, + ...(_n = (_m = uni.$uv) == null ? void 0 : _m.props) == null ? void 0 : _n.button + } + }; + const _sfc_main$c = { + name: "uv-button", + mixins: [mpMixin, mixin, props$5], + emits: ["click"], + 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 : "#3c9cff"; + } + 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; + }, + // 设置图标大小 + getIconSize() { + const size = this.iconSize ? this.iconSize : this.textSize * 1.35; + return this.$uv.addUnit(size); + }, + // 设置外层盒子的宽度,其他样式不需要 + btnWrapperStyle() { + const style = {}; + const customStyle = this.$uv.addStyle(this.customStyle); + if (customStyle.width) + style.width = customStyle.width; + return style; + } + }, + methods: { + clickHandler() { + if (!this.disabled && !this.loading) { + throttle(() => { + this.$emit("click"); + }, this.throttleTime); + } + } + } + }; + function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_0$3); + const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_1$2); + return vue.openBlock(), vue.createElementBlock( + "view", + { + class: "uv-button-wrapper", + style: vue.normalizeStyle([$options.btnWrapperStyle]) + }, + [ + vue.createElementVNode("button", { + "hover-start-time": Number(_ctx.hoverStartTime), + "hover-stay-time": Number(_ctx.hoverStayTime), + "form-type": _ctx.formType, + "open-type": _ctx.openType, + "app-parameter": _ctx.appParameter, + "hover-stop-propagation": _ctx.hoverStopPropagation, + "send-message-title": _ctx.sendMessageTitle, + "send-message-path": _ctx.sendMessagePath, + lang: _ctx.lang, + "data-name": _ctx.dataName, + "session-from": _ctx.sessionFrom, + "send-message-img": _ctx.sendMessageImg, + "show-message-card": _ctx.showMessageCard, + "hover-class": !_ctx.disabled && !_ctx.loading ? "uv-button--active" : "", + class: vue.normalizeClass(["uv-button uv-reset-button", $options.bemClass]), + style: vue.normalizeStyle([$options.baseColor, _ctx.$uv.addStyle(_ctx.customStyle)]), + onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)) + }, [ + _ctx.loading ? (vue.openBlock(), vue.createElementBlock( + vue.Fragment, + { key: 0 }, + [ + vue.createVNode(_component_uv_loading_icon, { + mode: _ctx.loadingMode, + size: _ctx.loadingSize * 1.15, + color: $options.loadingColor + }, null, 8, ["mode", "size", "color"]), + vue.createElementVNode( + "text", + { + class: "uv-button__loading-text", + style: vue.normalizeStyle([ + { fontSize: $options.textSize + "px" }, + _ctx.$uv.addStyle(_ctx.customTextStyle) + ]) + }, + vue.toDisplayString(_ctx.loadingText || _ctx.text), + 5 + /* TEXT, STYLE */ + ) + ], + 64 + /* STABLE_FRAGMENT */ + )) : (vue.openBlock(), vue.createElementBlock( + vue.Fragment, + { key: 1 }, + [ + _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, { + key: 0, + name: _ctx.icon, + color: $options.iconColorCom, + size: $options.getIconSize, + customStyle: { marginRight: "2px" } + }, null, 8, ["name", "color", "size"])) : vue.createCommentVNode("v-if", true), + vue.renderSlot(_ctx.$slots, "default", {}, () => [ + vue.createElementVNode( + "text", + { + class: "uv-button__text", + style: vue.normalizeStyle([ + { fontSize: $options.textSize + "px" }, + _ctx.$uv.addStyle(_ctx.customTextStyle) + ]) + }, + vue.toDisplayString(_ctx.text), + 5 + /* TEXT, STYLE */ + ) + ], true), + vue.renderSlot(_ctx.$slots, "suffix", {}, void 0, true) + ], + 64 + /* STABLE_FRAGMENT */ + )) + ], 14, ["hover-start-time", "hover-stay-time", "form-type", "open-type", "app-parameter", "hover-stop-propagation", "send-message-title", "send-message-path", "lang", "data-name", "session-from", "send-message-img", "show-message-card", "hover-class"]) + ], + 4 + /* STYLE */ + ); + } + const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-1ac9ef43"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-button/uv-button.vue"]]); + class MPAnimation { + constructor(options, _this) { + this.options = options; + this.animation = uni.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 = {}, config2 = {}) { + let ref = this.$.$refs["ani"].ref; + if (!ref) + return; + return new Promise((resolve, reject) => { + nvueAnimation.transition(ref, { + styles, + ...config2 + }, (res) => { + resolve(); + }); + }); + } + _nvueNextAnimate(animates, step = 0, fn) { + let obj = animates[step]; + if (obj) { + let { + styles, + config: config2 + } = obj; + this._animateRun(styles, config2).then(() => { + step += 1; + this._nvueNextAnimate(animates, step, fn); + }); + } else { + this.currentStepAnimates = {}; + typeof fn === "function" && fn(); + this.isEnd = true; + } + } + step(config2 = {}) { + this.animation.step(config2); + 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); + } + const _sfc_main$b = { + name: "uv-transition", + mixins: [mpMixin, mixin], + emits: ["click", "change"], + props: { + // 是否展示组件 + show: { + type: Boolean, + default: false + }, + // 使用的动画模式 + mode: { + type: [Array, String, null], + default() { + return "fade"; + } + }, + // 动画的执行时间,单位ms + duration: { + type: [String, Number], + default: 300 + }, + // 使用的动画过渡函数 + timingFunction: { + type: String, + default: "ease-out" + }, + customClass: { + type: String, + default: "" + }, + // nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置 + cellChild: { + 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: { + // 初始化动画条件 + transformStyles() { + const style = { + transform: this.transform, + opacity: this.opacity, + ...this.$uv.addStyle(this.customStyle), + "transition-duration": `${this.duration / 1e3}s` + }; + return this.$uv.addStyle(style, "string"); + } + }, + created() { + this.config = { + duration: this.duration, + timingFunction: this.timingFunction, + transformOrigin: "50% 50%", + delay: 0 + }; + this.durationTime = this.duration; + }, + methods: { + /** + * ref 触发 初始化动画 + */ + init(obj = {}) { + if (obj.duration) { + this.durationTime = obj.duration; + } + this.animation = createAnimation(Object.assign(this.config, obj), this); + }, + /** + * 点击组件触发回调 + */ + onClick() { + this.$emit("click", { + detail: this.isShow + }); + }, + /** + * ref 触发 动画分组 + * @param {Object} obj + */ + step(obj, config2 = {}) { + 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) { + formatAppLog("error", "at node_modules/@climblee/uv-ui/components/uv-transition/uv-transition.vue:166", `方法 ${i} 不存在`); + } + } + this.animation.step(config2); + 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 = 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.mode === "string") { + buildStyle(type, this.mode); + } else { + this.mode.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.mode === "string") { + buildTranfrom(type, this.mode); + } else { + this.mode.forEach((mode) => { + buildTranfrom(type, mode); + }); + } + return this.animation; + }, + animationType(type) { + return { + fade: type ? 1 : 0, + "slide-top": `translateY(${type ? "0" : "-100%"})`, + "slide-right": `translateX(${type ? "0" : "100%"})`, + "slide-bottom": `translateY(${type ? "0" : "100%"})`, + "slide-left": `translateX(${type ? "0" : "-100%"})`, + "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`, + "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})` + }; + }, + // 内置动画类型与实际动画对应字典 + animationMode() { + return { + fade: "opacity", + "slide-top": "translateY", + "slide-right": "translateX", + "slide-bottom": "translateY", + "slide-left": "translateX", + "zoom-in": "scale", + "zoom-out": "scale" + }; + }, + // 驼峰转中横线 + toLine(name) { + return name.replace(/([A-Z])/g, "-$1").toLowerCase(); + } + } + }; + function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) { + return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", { + key: 0, + ref: "ani", + animation: $data.animationData, + class: vue.normalizeClass($props.customClass), + style: vue.normalizeStyle($options.transformStyles), + onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args)) + }, [ + vue.renderSlot(_ctx.$slots, "default") + ], 14, ["animation"])) : vue.createCommentVNode("v-if", true); + } + const __easycom_4$1 = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-transition/uv-transition.vue"]]); + const props$4 = { + props: { + // 是否显示遮罩 + show: { + type: Boolean, + default: false + }, + // 层级z-index + zIndex: { + type: [String, Number], + default: 10070 + }, + // 遮罩的过渡时间,单位为ms + duration: { + type: [String, Number], + default: 300 + }, + // 不透明度值,当做rgba的第四个参数 + opacity: { + type: [String, Number], + default: 0.5 + }, + ...(_p = (_o = uni.$uv) == null ? void 0 : _o.props) == null ? void 0 : _p.overlay + } + }; + const _sfc_main$a = { + name: "uv-overlay", + emits: ["click"], + mixins: [mpMixin, mixin, props$4], + watch: { + show(newVal) { + } + }, + 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 this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle)); + } + }, + methods: { + clickHandler() { + this.$emit("click"); + }, + clear() { + } + } + }; + function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1); + return vue.openBlock(), vue.createBlock(_component_uv_transition, { + show: _ctx.show, + mode: "fade", + "custom-class": "uv-overlay", + duration: _ctx.duration, + "custom-style": $options.overlayStyle, + onClick: $options.clickHandler, + onTouchmove: vue.withModifiers($options.clear, ["stop", "prevent"]) + }, { + default: vue.withCtx(() => [ + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) + ]), + _: 3 + /* FORWARDED */ + }, 8, ["show", "duration", "custom-style", "onClick", "onTouchmove"]); + } + const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-b1e8b0c8"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-overlay/uv-overlay.vue"]]); + const props$3 = { + props: { + bgColor: { + type: String, + default: "transparent" + } + } + }; + const _sfc_main$9 = { + name: "uv-status-bar", + mixins: [mpMixin, mixin, props$3], + data() { + return {}; + }, + computed: { + style() { + const style = {}; + style.height = this.$uv.addUnit(this.$uv.sys().statusBarHeight, "px"); + if (this.bgColor) { + if (this.bgColor.indexOf("gradient") > -1) { + style.backgroundImage = this.bgColor; + } else { + style.background = this.bgColor; + } + } + return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle)); + } + } + }; + function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { + return vue.openBlock(), vue.createElementBlock( + "view", + { + style: vue.normalizeStyle([$options.style]), + class: "uv-status-bar" + }, + [ + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) + ], + 4 + /* STYLE */ + ); + } + const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-4ff5a0d7"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-status-bar/uv-status-bar.vue"]]); + const _sfc_main$8 = { + name: "uv-safe-bottom", + mixins: [mpMixin, mixin], + data() { + return { + safeAreaBottomHeight: 0, + isNvue: false + }; + }, + computed: { + style() { + const style = {}; + return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle)); + } + }, + mounted() { + } + }; + function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { + return vue.openBlock(), vue.createElementBlock( + "view", + { + class: vue.normalizeClass(["uv-safe-bottom", [!$data.isNvue && "uv-safe-area-inset-bottom"]]), + style: vue.normalizeStyle([$options.style]) + }, + null, + 6 + /* CLASS, STYLE */ + ); + } + const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-a55db101"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-safe-bottom/uv-safe-bottom.vue"]]); + const _sfc_main$7 = { + name: "uv-popup", + components: {}, + mixins: [mpMixin, mixin], + emits: ["change", "maskClick"], + props: { + // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层 + // message: 消息提示 ; dialog : 对话框 + mode: { + type: String, + default: "center" + }, + // 动画时长,单位ms + duration: { + type: [String, Number], + default: 300 + }, + // 层级 + zIndex: { + type: [String, Number], + default: 10075 + }, + bgColor: { + type: String, + default: "#ffffff" + }, + safeArea: { + type: Boolean, + default: true + }, + // 是否显示遮罩 + overlay: { + type: Boolean, + default: true + }, + // 点击遮罩是否关闭弹窗 + closeOnClickOverlay: { + type: Boolean, + default: true + }, + // 遮罩的透明度,0-1之间 + overlayOpacity: { + type: [Number, String], + default: 0.4 + }, + // 自定义遮罩的样式 + overlayStyle: { + type: [Object, String], + default: "" + }, + // 是否为iPhoneX留出底部安全距离 + safeAreaInsetBottom: { + type: Boolean, + default: true + }, + // 是否留出顶部安全距离(状态栏高度) + safeAreaInsetTop: { + type: Boolean, + default: false + }, + // 是否显示关闭图标 + closeable: { + type: Boolean, + default: false + }, + // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角 + closeIconPos: { + type: String, + default: "top-right" + }, + // mode=center,也即中部弹出时,是否使用缩放模式 + zoom: { + type: Boolean, + default: true + }, + round: { + type: [Number, String], + default: 0 + }, + ...(_r = (_q = uni.$uv) == null ? void 0 : _q.props) == null ? void 0 : _r.popup + }, + 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.mode]](true); + }, + immediate: true + }, + // H5 下禁止底部滚动 + showPopup(show) { + } + }, + data() { + return { + 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" + }, + transitionStyle: { + position: "fixed", + left: 0, + right: 0 + }, + maskShow: true, + mkclick: true, + popupClass: this.isDesktop ? "fixforpc-top" : "top", + direction: "" + }; + }, + computed: { + isDesktop() { + return this.popupWidth >= 500 && this.popupHeight >= 500; + }, + bg() { + if (this.bgColor === "" || this.bgColor === "none" || this.$uv.getPx(this.round) > 0) { + return "transparent"; + } + return this.bgColor; + }, + contentStyle() { + const style = {}; + if (this.bgColor) { + style.backgroundColor = this.bg; + } + if (this.round) { + const value = this.$uv.addUnit(this.round); + const mode = this.direction ? this.direction : this.mode; + style.backgroundColor = this.bgColor; + if (mode === "top") { + style.borderBottomLeftRadius = value; + style.borderBottomRightRadius = value; + } else if (mode === "bottom") { + style.borderTopLeftRadius = value; + style.borderTopRightRadius = value; + } else if (mode === "center") { + style.borderRadius = value; + } + } + return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle)); + } + }, + // TODO vue3 + unmounted() { + this.setH5Visible(); + }, + created() { + this.messageChild = null; + this.clearPropagation = false; + }, + methods: { + setH5Visible() { + }, + /** + * 公用方法,不显示遮罩层 + */ + closeMask() { + this.maskShow = 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.mode; + } else { + this.direction = direction; + } + if (!this.config[direction]) { + return this.$uv.error(`缺少类型:${direction}`); + } + this[this.config[direction]](); + this.$emit("change", { + show: true, + type: direction + }); + }, + close(type) { + this.showTrans = false; + this.$emit("change", { + show: false, + type: this.mode + }); + 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.closeOnClickOverlay) + return; + this.close(); + }, + /** + * 顶部弹出样式处理 + */ + top(type) { + this.popupClass = this.isDesktop ? "fixforpc-top" : "top"; + this.ani = ["slide-top"]; + this.transitionStyle = { + position: "fixed", + zIndex: this.zIndex, + left: 0, + right: 0, + backgroundColor: this.bg + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + this.$nextTick(() => { + if (this.messageChild && this.mode === "message") { + this.messageChild.timerClose(); + } + }); + }, + /** + * 底部弹出样式处理 + */ + bottom(type) { + this.popupClass = "bottom"; + this.ani = ["slide-bottom"]; + this.transitionStyle = { + position: "fixed", + zIndex: this.zIndex, + left: 0, + right: 0, + bottom: 0, + backgroundColor: this.bg + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + /** + * 中间弹出样式处理 + */ + center(type) { + this.popupClass = "center"; + this.ani = this.zoom ? ["zoom-in", "fade"] : ["fade"]; + this.transitionStyle = { + position: "fixed", + zIndex: this.zIndex, + display: "flex", + flexDirection: "column", + bottom: 0, + left: 0, + right: 0, + top: 0, + justifyContent: "center", + alignItems: "center" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + left(type) { + this.popupClass = "left"; + this.ani = ["slide-left"]; + this.transitionStyle = { + position: "fixed", + zIndex: this.zIndex, + left: 0, + bottom: 0, + top: 0, + backgroundColor: this.bg, + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + right(type) { + this.popupClass = "right"; + this.ani = ["slide-right"]; + this.transitionStyle = { + position: "fixed", + zIndex: this.zIndex, + bottom: 0, + right: 0, + top: 0, + backgroundColor: this.bg, + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + } + } + }; + function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$1); + const _component_uv_status_bar = resolveEasycom(vue.resolveDynamicComponent("uv-status-bar"), __easycom_1$1); + const _component_uv_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("uv-safe-bottom"), __easycom_0); + const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_1$2); + const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1); + return $data.showPopup ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: vue.normalizeClass(["uv-popup", [$data.popupClass, $options.isDesktop ? "fixforpc-z-index" : ""]]), + style: vue.normalizeStyle([{ zIndex: $props.zIndex }]) + }, + [ + vue.createElementVNode( + "view", + { + onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.touchstart && $options.touchstart(...args)) + }, + [ + vue.createCommentVNode(" 遮罩层 "), + $data.maskShow && $props.overlay ? (vue.openBlock(), vue.createBlock(_component_uv_overlay, { + key: "1", + show: $data.showTrans, + duration: $props.duration, + "custom-style": $props.overlayStyle, + opacity: $props.overlayOpacity, + zIndex: $props.zIndex, + onClick: $options.onTap + }, null, 8, ["show", "duration", "custom-style", "opacity", "zIndex", "onClick"])) : vue.createCommentVNode("v-if", true), + vue.createVNode(_component_uv_transition, { + key: "2", + mode: $data.ani, + name: "content", + "custom-style": $data.transitionStyle, + duration: $props.duration, + show: $data.showTrans, + onClick: $options.onTap + }, { + default: vue.withCtx(() => [ + vue.createElementVNode( + "view", + { + class: vue.normalizeClass(["uv-popup__content", [$data.popupClass]]), + style: vue.normalizeStyle([$options.contentStyle]), + onClick: _cache[1] || (_cache[1] = (...args) => $options.clear && $options.clear(...args)) + }, + [ + $props.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_uv_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true), + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true), + $props.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_uv_safe_bottom, { key: 1 })) : vue.createCommentVNode("v-if", true), + $props.closeable ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 2, + onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.close && $options.close(...args), ["stop"])), + class: vue.normalizeClass(["uv-popup__content__close", ["uv-popup__content__close--" + $props.closeIconPos]]), + "hover-class": "uv-popup__content__close--hover", + "hover-stay-time": "150" + }, + [ + vue.createVNode(_component_uv_icon, { + name: "close", + color: "#909399", + size: "18", + bold: "" + }) + ], + 2 + /* CLASS */ + )) : vue.createCommentVNode("v-if", true) + ], + 6 + /* CLASS, STYLE */ + ) + ]), + _: 3 + /* FORWARDED */ + }, 8, ["mode", "custom-style", "duration", "show", "onClick"]) + ], + 32 + /* NEED_HYDRATION */ + ) + ], + 6 + /* CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true); + } + const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-c66d5e79"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-popup/uv-popup.vue"]]); + const _sfc_main$6 = { + name: "uv-calendar-header", + mixins: [mpMixin, mixin], + props: { + // 标题 + title: { + type: String, + default: "" + }, + // 副标题 + subtitle: { + type: [String, null], + default: "" + }, + // 是否显示标题 + showTitle: { + type: Boolean, + default: true + }, + // 是否显示副标题 + showSubtitle: { + type: Boolean, + default: true + } + }, + data() { + return {}; + }, + methods: { + name() { + } + } + }; + function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { + return vue.openBlock(), vue.createElementBlock("view", { class: "uv-calendar-header uv-border-bottom" }, [ + $props.showTitle ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 0, + class: "uv-calendar-header__title" + }, + vue.toDisplayString($props.title), + 1 + /* TEXT */ + )) : vue.createCommentVNode("v-if", true), + $props.showSubtitle ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 1, + class: "uv-calendar-header__subtitle" + }, + vue.toDisplayString($props.subtitle), + 1 + /* TEXT */ + )) : vue.createCommentVNode("v-if", true), + vue.createElementVNode("view", { class: "uv-calendar-header__weekdays" }, [ + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "一"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "二"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "三"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "四"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "五"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "六"), + vue.createElementVNode("text", { class: "uv-calendar-header__weekdays__weekday" }, "日") + ]) + ]); + } + const uvHeader = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-de7aec68"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-calendar/header.vue"]]); + var __getOwnPropNames = Object.getOwnPropertyNames; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var require_dayjs_min = __commonJS({ + "uvuidayjs"(exports, module) { + !function(t, e) { + "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e(); + }(exports, function() { + var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) { + var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100; + return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]"; + } }, m = function(t2, e2, n2) { + var r2 = String(t2); + return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2; + }, v = { s: m, z: function(t2) { + var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60; + return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0"); + }, m: function t2(e2, n2) { + if (e2.date() < n2.date()) + return -t2(n2, e2); + var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f); + return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0); + }, a: function(t2) { + return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2); + }, p: function(t2) { + return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, ""); + }, u: function(t2) { + return void 0 === t2; + } }, g = "en", D = {}; + D[g] = M; + var p = function(t2) { + return t2 instanceof _; + }, S = function t2(e2, n2, r2) { + var i2; + if (!e2) + return g; + if ("string" == typeof e2) { + var s2 = e2.toLowerCase(); + D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2); + var u2 = e2.split("-"); + if (!i2 && u2.length > 1) + return t2(u2[0]); + } else { + var a2 = e2.name; + D[a2] = e2, i2 = a2; + } + return !r2 && i2 && (g = i2), i2 || !r2 && g; + }, w = function(t2, e2) { + if (p(t2)) + return t2.clone(); + var n2 = "object" == typeof e2 ? e2 : {}; + return n2.date = t2, n2.args = arguments, new _(n2); + }, O = v; + O.l = S, O.i = p, O.w = function(t2, e2) { + return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset }); + }; + var _ = function() { + function M2(t2) { + this.$L = S(t2.locale, null, true), this.parse(t2); + } + var m2 = M2.prototype; + return m2.parse = function(t2) { + this.$d = function(t3) { + var e2 = t3.date, n2 = t3.utc; + if (null === e2) + return /* @__PURE__ */ new Date(NaN); + if (O.u(e2)) + return /* @__PURE__ */ new Date(); + if (e2 instanceof Date) + return new Date(e2); + if ("string" == typeof e2 && !/Z$/i.test(e2)) { + var r2 = e2.match($); + if (r2) { + var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3); + return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2); + } + } + return new Date(e2); + }(t2), this.$x = t2.x || {}, this.init(); + }, m2.init = function() { + var t2 = this.$d; + this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds(); + }, m2.$utils = function() { + return O; + }, m2.isValid = function() { + return !(this.$d.toString() === l); + }, m2.isSame = function(t2, e2) { + var n2 = w(t2); + return this.startOf(e2) <= n2 && n2 <= this.endOf(e2); + }, m2.isAfter = function(t2, e2) { + return w(t2) < this.startOf(e2); + }, m2.isBefore = function(t2, e2) { + return this.endOf(e2) < w(t2); + }, m2.$g = function(t2, e2, n2) { + return O.u(t2) ? this[e2] : this.set(n2, t2); + }, m2.unix = function() { + return Math.floor(this.valueOf() / 1e3); + }, m2.valueOf = function() { + return this.$d.getTime(); + }, m2.startOf = function(t2, e2) { + var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), l2 = function(t3, e3) { + var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2); + return r2 ? i2 : i2.endOf(a); + }, $2 = function(t3, e3) { + return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2); + }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : ""); + switch (h2) { + case c: + return r2 ? l2(1, 0) : l2(31, 11); + case f: + return r2 ? l2(1, M3) : l2(0, M3 + 1); + case o: + var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2; + return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3); + case a: + case d: + return $2(v2 + "Hours", 0); + case u: + return $2(v2 + "Minutes", 1); + case s: + return $2(v2 + "Seconds", 2); + case i: + return $2(v2 + "Milliseconds", 3); + default: + return this.clone(); + } + }, m2.endOf = function(t2) { + return this.startOf(t2, false); + }, m2.$set = function(t2, e2) { + var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2; + if (o2 === f || o2 === c) { + var y2 = this.clone().set(d, 1); + y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d; + } else + l2 && this.$d[l2]($2); + return this.init(), this; + }, m2.set = function(t2, e2) { + return this.clone().$set(t2, e2); + }, m2.get = function(t2) { + return this[O.p(t2)](); + }, m2.add = function(r2, h2) { + var d2, l2 = this; + r2 = Number(r2); + var $2 = O.p(h2), y2 = function(t2) { + var e2 = w(l2); + return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2); + }; + if ($2 === f) + return this.set(f, this.$M + r2); + if ($2 === c) + return this.set(c, this.$y + r2); + if ($2 === a) + return y2(1); + if ($2 === o) + return y2(7); + var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3; + return O.w(m3, this); + }, m2.subtract = function(t2, e2) { + return this.add(-1 * t2, e2); + }, m2.format = function(t2) { + var e2 = this, n2 = this.$locale(); + if (!this.isValid()) + return n2.invalidDate || l; + var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) { + return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3); + }, c2 = function(t3) { + return O.s(s2 % 12 || 12, t3, "0"); + }, d2 = n2.meridiem || function(t3, e3, n3) { + var r3 = t3 < 12 ? "AM" : "PM"; + return n3 ? r3.toLowerCase() : r3; + }, $2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 }; + return r2.replace(y, function(t3, e3) { + return e3 || $2[t3] || i2.replace(":", ""); + }); + }, m2.utcOffset = function() { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }, m2.diff = function(r2, d2, l2) { + var $2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, v2 = this - M3, g2 = O.m(this, M3); + return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f] = g2, $2[h] = g2 / 3, $2[o] = (v2 - m3) / 6048e5, $2[a] = (v2 - m3) / 864e5, $2[u] = v2 / n, $2[s] = v2 / e, $2[i] = v2 / t, $2)[y2] || v2, l2 ? g2 : O.a(g2); + }, m2.daysInMonth = function() { + return this.endOf(f).$D; + }, m2.$locale = function() { + return D[this.$L]; + }, m2.locale = function(t2, e2) { + if (!t2) + return this.$L; + var n2 = this.clone(), r2 = S(t2, e2, true); + return r2 && (n2.$L = r2), n2; + }, m2.clone = function() { + return O.w(this.$d, this); + }, m2.toDate = function() { + return new Date(this.valueOf()); + }, m2.toJSON = function() { + return this.isValid() ? this.toISOString() : null; + }, m2.toISOString = function() { + return this.$d.toISOString(); + }, m2.toString = function() { + return this.$d.toUTCString(); + }, M2; + }(), T = _.prototype; + return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) { + T[t2[1]] = function(e2) { + return this.$g(e2, t2[0], t2[1]); + }; + }), w.extend = function(t2, e2) { + return t2.$i || (t2(e2, _, w), t2.$i = true), w; + }, w.locale = S, w.isDayjs = p, w.unix = function(t2) { + return w(1e3 * t2); + }, w.en = D[g], w.Ls = D, w.p = {}, w; + }); + } + }); + const dayjs = require_dayjs_min(); + const _sfc_main$5 = { + name: "uv-calendar-month", + emits: ["monthSelected", "updateMonthTop", "change"], + mixins: [mpMixin, mixin], + props: { + // 是否显示月份背景色 + showMark: { + type: Boolean, + default: true + }, + // 主题色,对底部按钮和选中日期有效 + color: { + type: String, + default: "#3c9cff" + }, + // 月份数据 + months: { + type: Array, + default: () => [] + }, + // 日期选择类型 + mode: { + type: String, + default: "single" + }, + // 日期行高 + rowHeight: { + type: [String, Number], + default: 58 + }, + // mode=multiple时,最多可选多少个日期 + maxCount: { + type: [String, Number], + default: Infinity + }, + // mode=range时,第一个日期底部的提示文字 + startText: { + type: String, + default: "开始" + }, + // mode=range时,最后一个日期底部的提示文字 + endText: { + type: String, + default: "结束" + }, + // 默认选中的日期,mode为multiple或range是必须为数组格式 + defaultDate: { + type: [Array, String, Date], + default: null + }, + // 最小的可选日期 + minDate: { + type: [String, Number], + default: 0 + }, + // 最大可选日期 + maxDate: { + type: [String, Number], + default: 0 + }, + // 如果没有设置maxDate,则往后推多少个月 + maxMonth: { + type: [String, Number], + default: 2 + }, + // 是否为只读状态,只读状态下禁止选择日期 + readonly: { + type: Boolean, + default: false + }, + // 日期区间最多可选天数,默认无限制,mode = range时有效 + maxRange: { + type: [Number, String], + default: Infinity + }, + // 范围选择超过最多可选天数时的提示文案,mode = range时有效 + rangePrompt: { + type: String, + default: "" + }, + // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效 + showRangePrompt: { + type: Boolean, + default: true + }, + // 是否允许日期范围的起止时间为同一天,mode = range时有效 + allowSameDay: { + type: Boolean, + default: false + } + }, + data() { + return { + // 每个日期的宽度 + width: 0, + // 当前选中的日期item + item: {}, + selected: [] + }; + }, + watch: { + selectedChange: { + immediate: true, + handler(n) { + this.setDefaultDate(); + } + } + }, + computed: { + // 多个条件的变化,会引起选中日期的变化,这里统一管理监听 + selectedChange() { + return [this.minDate, this.maxDate, this.defaultDate]; + }, + dayStyle(index1, index2, item) { + return (index12, index22, item2) => { + const style = {}; + let week = item2.week; + const dayWidth = Number(parseFloat(this.width / 7).toFixed(3).slice(0, -1)); + style.height = this.$uv.addUnit(this.rowHeight); + if (index22 === 0) { + week = (week === 0 ? 7 : week) - 1; + style.marginLeft = this.$uv.addUnit(week * dayWidth); + } + if (this.mode === "range") { + style.paddingLeft = 0; + style.paddingRight = 0; + style.paddingBottom = 0; + style.paddingTop = 0; + } + return style; + }; + }, + daySelectStyle() { + return (index1, index2, item) => { + let date2 = dayjs(item.date).format("YYYY-MM-DD"), style = {}; + if (this.selected.some((item2) => this.dateSame(item2, date2))) { + style.backgroundColor = this.color; + } + if (this.mode === "single") { + if (date2 === this.selected[0]) { + style.borderTopLeftRadius = "3px"; + style.borderBottomLeftRadius = "3px"; + style.borderTopRightRadius = "3px"; + style.borderBottomRightRadius = "3px"; + } + } else if (this.mode === "range") { + if (this.selected.length >= 2) { + const len = this.selected.length - 1; + if (this.dateSame(date2, this.selected[0])) { + style.borderTopLeftRadius = "3px"; + style.borderBottomLeftRadius = "3px"; + } + if (this.dateSame(date2, this.selected[len])) { + style.borderTopRightRadius = "3px"; + style.borderBottomRightRadius = "3px"; + } + if (dayjs(date2).isAfter(dayjs(this.selected[0])) && dayjs(date2).isBefore(dayjs(this.selected[len]))) { + style.backgroundColor = colorGradient(this.color, "#ffffff", 100)[90]; + style.opacity = 0.7; + } + } else if (this.selected.length === 1) { + style.borderTopLeftRadius = "3px"; + style.borderBottomLeftRadius = "3px"; + } + } else { + if (this.selected.some((item2) => this.dateSame(item2, date2))) { + style.borderTopLeftRadius = "3px"; + style.borderBottomLeftRadius = "3px"; + style.borderTopRightRadius = "3px"; + style.borderBottomRightRadius = "3px"; + } + } + return style; + }; + }, + // 某个日期是否被选中 + textStyle() { + return (item) => { + const date2 = dayjs(item.date).format("YYYY-MM-DD"), style = {}; + if (this.selected.some((item2) => this.dateSame(item2, date2))) { + style.color = "#ffffff"; + } + if (this.mode === "range") { + const len = this.selected.length - 1; + if (dayjs(date2).isAfter(dayjs(this.selected[0])) && dayjs(date2).isBefore(dayjs(this.selected[len]))) { + style.color = this.color; + } + } + return style; + }; + }, + // 获取顶部的提示文字 + getTopInfo() { + return (index1, index2, item) => { + return item.topInfo; + }; + }, + // 获取底部的提示文字 + getBottomInfo() { + return (index1, index2, item) => { + const date2 = dayjs(item.date).format("YYYY-MM-DD"); + const bottomInfo = item.bottomInfo; + if (this.mode === "range" && this.selected.length > 0) { + if (this.selected.length === 1) { + if (this.dateSame(date2, this.selected[0])) + return this.startText; + else + return bottomInfo; + } else { + const len = this.selected.length - 1; + if (this.dateSame(date2, this.selected[0]) && this.dateSame(date2, this.selected[1]) && len === 1) { + return `${this.startText}/${this.endText}`; + } else if (this.dateSame(date2, this.selected[0])) { + return this.startText; + } else if (this.dateSame(date2, this.selected[len])) { + return this.endText; + } else { + return bottomInfo; + } + } + } else { + return bottomInfo; + } + }; + } + }, + mounted() { + this.init(); + }, + methods: { + init() { + this.$emit("monthSelected", this.selected); + this.$nextTick(() => { + this.$uv.sleep(10).then(() => { + this.getWrapperWidth(); + this.getMonthRect(); + }); + }); + }, + // 判断两个日期是否相等 + dateSame(date1, date2) { + return dayjs(date1).isSame(dayjs(date2)); + }, + // 获取月份数据区域的宽度,因为nvue不支持百分比,所以无法通过css设置每个日期item的宽度 + getWrapperWidth() { + this.$uvGetRect(".uv-calendar-month-wrapper").then((size) => { + this.width = size.width; + }); + }, + getMonthRect() { + const promiseAllArr = this.months.map((item, index2) => this.getMonthRectByPromise( + `uv-calendar-month-${index2}` + )); + Promise.all(promiseAllArr).then( + (sizes) => { + let height = 1; + const topArr = []; + for (let i = 0; i < this.months.length; i++) { + topArr[i] = height; + height += sizes[i].height; + } + this.$emit("updateMonthTop", topArr); + } + ); + }, + // 获取每个月份区域的尺寸 + getMonthRectByPromise(el) { + return new Promise((resolve) => { + this.$uvGetRect(`.${el}`).then((size) => { + resolve(size); + }); + }); + }, + // 点击某一个日期 + clickHandler(index1, index2, item) { + if (this.readonly) { + return; + } + this.item = item; + const date2 = dayjs(item.date).format("YYYY-MM-DD"); + if (item.disabled) + return; + let selected = this.$uv.deepClone(this.selected); + if (this.mode === "single") { + selected = [date2]; + } else if (this.mode === "multiple") { + if (selected.some((item2) => this.dateSame(item2, date2))) { + const itemIndex = selected.findIndex((item2) => dayjs(item2).format("YYYY-MM-DD") === dayjs(date2).format("YYYY-MM-DD")); + selected.splice(itemIndex, 1); + } else { + if (selected.length < this.maxCount) + selected.push(date2); + } + } else { + if (selected.length === 0 || selected.length >= 2) { + selected = [date2]; + } else if (selected.length === 1) { + const existsDate = selected[0]; + if (dayjs(date2).isBefore(existsDate)) { + selected = [date2]; + } else if (dayjs(date2).isAfter(existsDate)) { + if (dayjs(dayjs(date2).subtract(this.maxRange, "day")).isAfter(dayjs(selected[0])) && this.showRangePrompt) { + if (this.rangePrompt) { + this.$uv.toast(this.rangePrompt); + } else { + this.$uv.toast(`选择天数不能超过 ${this.maxRange} 天`); + } + return; + } + selected.push(date2); + const startDate = selected[0]; + const endDate = selected[1]; + const arr = []; + let i = 0; + do { + arr.push(dayjs(startDate).add(i, "day").format("YYYY-MM-DD")); + i++; + } while (dayjs(startDate).add(i, "day").isBefore(dayjs(endDate))); + arr.push(endDate); + selected = arr; + } else { + if (selected[0] === date2 && !this.allowSameDay) + return; + selected.push(date2); + } + } + } + this.setSelected(selected); + this.$emit("change", { + day: date2, + selected + }); + }, + // 设置默认日期 + setDefaultDate() { + if (!this.defaultDate) { + const selected = [dayjs().format("YYYY-MM-DD")]; + return this.setSelected(selected, false); + } + let defaultDate = []; + const minDate = this.minDate || dayjs().format("YYYY-MM-DD"); + const maxDate = this.maxDate || dayjs(minDate).add(this.maxMonth - 1, "month").format("YYYY-MM-DD"); + if (this.mode === "single") { + if (!this.$uv.test.array(this.defaultDate)) { + defaultDate = [dayjs(this.defaultDate).format("YYYY-MM-DD")]; + } else { + defaultDate = [this.defaultDate[0]]; + } + } else { + if (!this.$uv.test.array(this.defaultDate)) + return; + defaultDate = this.defaultDate; + } + defaultDate = defaultDate.filter((item) => { + return dayjs(item).isAfter(dayjs(minDate).subtract(1, "day")) && dayjs(item).isBefore(dayjs( + maxDate + ).add(1, "day")); + }); + this.setSelected(defaultDate, false); + }, + setSelected(selected, event = true) { + this.selected = selected; + event && this.$emit("monthSelected", this.selected); + } + } + }; + function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { + return vue.openBlock(), vue.createElementBlock( + "view", + { + class: "uv-calendar-month-wrapper", + ref: "uv-calendar-month-wrapper" + }, + [ + (vue.openBlock(true), vue.createElementBlock( + vue.Fragment, + null, + vue.renderList($props.months, (item, index2) => { + return vue.openBlock(), vue.createElementBlock("view", { + key: index2, + class: vue.normalizeClass([`uv-calendar-month-${index2}`]), + ref_for: true, + ref: `uv-calendar-month-${index2}`, + id: `month-${index2}` + }, [ + index2 !== 0 ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 0, + class: "uv-calendar-month__title" + }, + vue.toDisplayString(item.year) + "年" + vue.toDisplayString(item.month) + "月", + 1 + /* TEXT */ + )) : vue.createCommentVNode("v-if", true), + vue.createElementVNode("view", { class: "uv-calendar-month__days" }, [ + $props.showMark ? (vue.openBlock(), vue.createElementBlock("view", { + key: 0, + class: "uv-calendar-month__days__month-mark-wrapper" + }, [ + vue.createElementVNode( + "text", + { class: "uv-calendar-month__days__month-mark-wrapper__text" }, + vue.toDisplayString(item.month), + 1 + /* TEXT */ + ) + ])) : vue.createCommentVNode("v-if", true), + (vue.openBlock(true), vue.createElementBlock( + vue.Fragment, + null, + vue.renderList(item.date, (item1, index1) => { + return vue.openBlock(), vue.createElementBlock("view", { + class: vue.normalizeClass(["uv-calendar-month__days__day", [item1.selected && "uv-calendar-month__days__day__select--selected"]]), + key: index1, + style: vue.normalizeStyle([$options.dayStyle(index2, index1, item1)]), + onClick: ($event) => $options.clickHandler(index2, index1, item1) + }, [ + vue.createElementVNode( + "view", + { + class: "uv-calendar-month__days__day__select", + style: vue.normalizeStyle([$options.daySelectStyle(index2, index1, item1)]) + }, + [ + $options.getTopInfo(index2, index1, item1) ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 0, + class: vue.normalizeClass(["uv-calendar-month__days__day__select__top-info", [item1.disabled && "uv-calendar-month__days__day__select__top-info--disabled"]]), + style: vue.normalizeStyle([$options.textStyle(item1)]) + }, + vue.toDisplayString($options.getTopInfo(index2, index1, item1)), + 7 + /* TEXT, CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true), + vue.createElementVNode( + "text", + { + class: vue.normalizeClass(["uv-calendar-month__days__day__select__info", [item1.disabled && "uv-calendar-month__days__day__select__info--disabled"]]), + style: vue.normalizeStyle([$options.textStyle(item1)]) + }, + vue.toDisplayString(item1.day), + 7 + /* TEXT, CLASS, STYLE */ + ), + $options.getBottomInfo(index2, index1, item1) ? (vue.openBlock(), vue.createElementBlock( + "text", + { + key: 1, + class: vue.normalizeClass(["uv-calendar-month__days__day__select__buttom-info", [item1.disabled && "uv-calendar-month__days__day__select__buttom-info--disabled"]]), + style: vue.normalizeStyle([$options.textStyle(item1)]) + }, + vue.toDisplayString($options.getBottomInfo(index2, index1, item1)), + 7 + /* TEXT, CLASS, STYLE */ + )) : vue.createCommentVNode("v-if", true), + item1.dot ? (vue.openBlock(), vue.createElementBlock("text", { + key: 2, + class: "uv-calendar-month__days__day__select__dot" + })) : vue.createCommentVNode("v-if", true) + ], + 4 + /* STYLE */ + ) + ], 14, ["onClick"]); + }), + 128 + /* KEYED_FRAGMENT */ + )) + ]) + ], 10, ["id"]); + }), + 128 + /* KEYED_FRAGMENT */ + )) + ], + 512 + /* NEED_PATCH */ + ); + } + const uvMonth = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-b2cf4ec4"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-calendar/month.vue"]]); + const props$2 = { + props: { + // 日历顶部标题 + title: { + type: String, + default: "日期选择" + }, + // 是否显示标题 + showTitle: { + type: Boolean, + default: true + }, + // 是否显示副标题 + showSubtitle: { + type: Boolean, + default: true + }, + // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围 + mode: { + type: String, + default: "single" + }, + // mode=range时,第一个日期底部的提示文字 + startText: { + type: String, + default: "开始" + }, + // mode=range时,最后一个日期底部的提示文字 + endText: { + type: String, + default: "结束" + }, + // 自定义列表 + customList: { + type: Array, + default: () => [] + }, + // 主题色,对底部按钮和选中日期有效 + color: { + type: String, + default: "#3c9cff" + }, + // 最小的可选日期 + minDate: { + type: [String, Number], + default: 0 + }, + // 最大可选日期 + maxDate: { + type: [String, Number], + default: 0 + }, + // 默认选中的日期,mode为multiple或range是必须为数组格式 + defaultDate: { + type: [Array, String, Date, null], + default: null + }, + // mode=multiple时,最多可选多少个日期 + maxCount: { + type: [String, Number], + default: Number.MAX_SAFE_INTEGER + }, + // 日期行高 + rowHeight: { + type: [String, Number], + default: 56 + }, + // 日期格式化函数 + formatter: { + type: [Function, null], + default: null + }, + // 是否显示农历 + showLunar: { + type: Boolean, + default: false + }, + // 是否显示月份背景色 + showMark: { + type: Boolean, + default: true + }, + // 确定按钮的文字 + confirmText: { + type: String, + default: "确定" + }, + // 确认按钮处于禁用状态时的文字 + confirmDisabledText: { + type: String, + default: "确定" + }, + // 是否允许点击遮罩关闭日历 + closeOnClickOverlay: { + type: Boolean, + default: false + }, + // 是否允许点击确认按钮关闭日历 + closeOnClickConfirm: { + type: Boolean, + default: true + }, + // 是否为只读状态,只读状态下禁止选择日期 + readonly: { + type: Boolean, + default: false + }, + // 是否展示确认按钮 + showConfirm: { + type: Boolean, + default: true + }, + // 日期区间最多可选天数,默认无限制,mode = range时有效 Infinity + maxRange: { + type: [Number, String], + default: Number.MAX_SAFE_INTEGER + }, + // 范围选择超过最多可选天数时的提示文案,mode = range时有效 + rangePrompt: { + type: String, + default: "" + }, + // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效 + showRangePrompt: { + type: Boolean, + default: true + }, + // 是否允许日期范围的起止时间为同一天,mode = range时有效 + allowSameDay: { + type: Boolean, + default: false + }, + // 圆角值 + round: { + type: [Boolean, String, Number], + default: 0 + }, + // 最多展示月份数量 + monthNum: { + type: [Number, String], + default: 3 + }, + ...(_t = (_s = uni.$uv) == null ? void 0 : _s.props) == null ? void 0 : _t.calendar + } + }; + var calendar = { + /** + * 农历1900-2100的润大小信息表 + * @Array Of Property + * @return Hex + */ + lunarInfo: [ + 19416, + 19168, + 42352, + 21717, + 53856, + 55632, + 91476, + 22176, + 39632, + 21970, + // 1900-1909 + 19168, + 42422, + 42192, + 53840, + 119381, + 46400, + 54944, + 44450, + 38320, + 84343, + // 1910-1919 + 18800, + 42160, + 46261, + 27216, + 27968, + 109396, + 11104, + 38256, + 21234, + 18800, + // 1920-1929 + 25958, + 54432, + 59984, + 28309, + 23248, + 11104, + 100067, + 37600, + 116951, + 51536, + // 1930-1939 + 54432, + 120998, + 46416, + 22176, + 107956, + 9680, + 37584, + 53938, + 43344, + 46423, + // 1940-1949 + 27808, + 46416, + 86869, + 19872, + 42416, + 83315, + 21168, + 43432, + 59728, + 27296, + // 1950-1959 + 44710, + 43856, + 19296, + 43748, + 42352, + 21088, + 62051, + 55632, + 23383, + 22176, + // 1960-1969 + 38608, + 19925, + 19152, + 42192, + 54484, + 53840, + 54616, + 46400, + 46752, + 103846, + // 1970-1979 + 38320, + 18864, + 43380, + 42160, + 45690, + 27216, + 27968, + 44870, + 43872, + 38256, + // 1980-1989 + 19189, + 18800, + 25776, + 29859, + 59984, + 27480, + 23232, + 43872, + 38613, + 37600, + // 1990-1999 + 51552, + 55636, + 54432, + 55888, + 30034, + 22176, + 43959, + 9680, + 37584, + 51893, + // 2000-2009 + 43344, + 46240, + 47780, + 44368, + 21977, + 19360, + 42416, + 86390, + 21168, + 43312, + // 2010-2019 + 31060, + 27296, + 44368, + 23378, + 19296, + 42726, + 42208, + 53856, + 60005, + 54576, + // 2020-2029 + 23200, + 30371, + 38608, + 19195, + 19152, + 42192, + 118966, + 53840, + 54560, + 56645, + // 2030-2039 + 46496, + 22224, + 21938, + 18864, + 42359, + 42160, + 43600, + 111189, + 27936, + 44448, + // 2040-2049 + /** Add By JJonline@JJonline.Cn**/ + 84835, + 37744, + 18936, + 18800, + 25776, + 92326, + 59984, + 27424, + 108228, + 43744, + // 2050-2059 + 41696, + 53987, + 51552, + 54615, + 54432, + 55888, + 23893, + 22176, + 42704, + 21972, + // 2060-2069 + 21200, + 43448, + 43344, + 46240, + 46758, + 44368, + 21920, + 43940, + 42416, + 21168, + // 2070-2079 + 45683, + 26928, + 29495, + 27296, + 44368, + 84821, + 19296, + 42352, + 21732, + 53600, + // 2080-2089 + 59752, + 54560, + 55968, + 92838, + 22224, + 19168, + 43476, + 41680, + 53584, + 62034, + // 2090-2099 + 54560 + ], + // 2100 + /** + * 公历每个月份的天数普通表 + * @Array Of Property + * @return Number + */ + solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + /** + * 天干地支之天干速查表 + * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] + * @return Cn string + */ + Gan: ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"], + /** + * 天干地支之地支速查表 + * @Array Of Property + * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] + * @return Cn string + */ + Zhi: ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"], + /** + * 天干地支之地支速查表<=>生肖 + * @Array Of Property + * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] + * @return Cn string + */ + Animals: ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"], + /** + * 24节气速查表 + * @Array Of Property + * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"] + * @return Cn string + */ + solarTerm: ["小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至"], + /** + * 1900-2100各年的24节气日期速查表 + * @Array Of Property + * @return 0x string For splice + */ + sTermInfo: [ + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c3598082c95f8c965cc920f", + "97bd0b06bdb0722c965ce1cfcc920f", + "b027097bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c359801ec95f8c965cc920f", + "97bd0b06bdb0722c965ce1cfcc920f", + "b027097bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c359801ec95f8c965cc920f", + "97bd0b06bdb0722c965ce1cfcc920f", + "b027097bd097c36b0b6fc9274c91aa", + "9778397bd19801ec9210c965cc920e", + "97b6b97bd19801ec95f8c965cc920f", + "97bd09801d98082c95f8e1cfcc920f", + "97bd097bd097c36b0b6fc9210c8dc2", + "9778397bd197c36c9210c9274c91aa", + "97b6b97bd19801ec95f8c965cc920e", + "97bd09801d98082c95f8e1cfcc920f", + "97bd097bd097c36b0b6fc9210c8dc2", + "9778397bd097c36c9210c9274c91aa", + "97b6b97bd19801ec95f8c965cc920e", + "97bcf97c3598082c95f8e1cfcc920f", + "97bd097bd097c36b0b6fc9210c8dc2", + "9778397bd097c36c9210c9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c3598082c95f8c965cc920f", + "97bd097bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c3598082c95f8c965cc920f", + "97bd097bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c359801ec95f8c965cc920f", + "97bd097bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c359801ec95f8c965cc920f", + "97bd097bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf97c359801ec95f8c965cc920f", + "97bd097bd07f595b0b6fc920fb0722", + "9778397bd097c36b0b6fc9210c8dc2", + "9778397bd19801ec9210c9274c920e", + "97b6b97bd19801ec95f8c965cc920f", + "97bd07f5307f595b0b0bc920fb0722", + "7f0e397bd097c36b0b6fc9210c8dc2", + "9778397bd097c36c9210c9274c920e", + "97b6b97bd19801ec95f8c965cc920f", + "97bd07f5307f595b0b0bc920fb0722", + "7f0e397bd097c36b0b6fc9210c8dc2", + "9778397bd097c36c9210c9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bd07f1487f595b0b0bc920fb0722", + "7f0e397bd097c36b0b6fc9210c8dc2", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf7f1487f595b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf7f1487f595b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf7f1487f531b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c965cc920e", + "97bcf7f1487f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b97bd19801ec9210c9274c920e", + "97bcf7f0e47f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "9778397bd097c36b0b6fc9210c91aa", + "97b6b97bd197c36c9210c9274c920e", + "97bcf7f0e47f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "9778397bd097c36b0b6fc9210c8dc2", + "9778397bd097c36c9210c9274c920e", + "97b6b7f0e47f531b0723b0b6fb0722", + "7f0e37f5307f595b0b0bc920fb0722", + "7f0e397bd097c36b0b6fc9210c8dc2", + "9778397bd097c36b0b70c9274c91aa", + "97b6b7f0e47f531b0723b0b6fb0721", + "7f0e37f1487f595b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc9210c8dc2", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f595b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "9778397bd097c36b0b6fc9274c91aa", + "97b6b7f0e47f531b0723b0787b0721", + "7f0e27f0e47f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "9778397bd097c36b0b6fc9210c91aa", + "97b6b7f0e47f149b0723b0787b0721", + "7f0e27f0e47f531b0723b0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "9778397bd097c36b0b6fc9210c8dc2", + "977837f0e37f149b0723b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0722", + "7f0e37f5307f595b0b0bc920fb0722", + "7f0e397bd097c35b0b6fc9210c8dc2", + "977837f0e37f14998082b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e37f1487f595b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc9210c8dc2", + "977837f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "977837f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd097c35b0b6fc920fb0722", + "977837f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "977837f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "977837f0e37f14998082b0787b06bd", + "7f07e7f0e47f149b0723b0787b0721", + "7f0e27f0e47f531b0b0bb0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "977837f0e37f14998082b0723b06bd", + "7f07e7f0e37f149b0723b0787b0721", + "7f0e27f0e47f531b0723b0b6fb0722", + "7f0e397bd07f595b0b0bc920fb0722", + "977837f0e37f14898082b0723b02d5", + "7ec967f0e37f14998082b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0722", + "7f0e37f1487f595b0b0bb0b6fb0722", + "7f0e37f0e37f14898082b0723b02d5", + "7ec967f0e37f14998082b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0722", + "7f0e37f1487f531b0b0bb0b6fb0722", + "7f0e37f0e37f14898082b0723b02d5", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e37f1487f531b0b0bb0b6fb0722", + "7f0e37f0e37f14898082b072297c35", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e37f0e37f14898082b072297c35", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e37f0e366aa89801eb072297c35", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f149b0723b0787b0721", + "7f0e27f1487f531b0b0bb0b6fb0722", + "7f0e37f0e366aa89801eb072297c35", + "7ec967f0e37f14998082b0723b06bd", + "7f07e7f0e47f149b0723b0787b0721", + "7f0e27f0e47f531b0723b0b6fb0722", + "7f0e37f0e366aa89801eb072297c35", + "7ec967f0e37f14998082b0723b06bd", + "7f07e7f0e37f14998083b0787b0721", + "7f0e27f0e47f531b0723b0b6fb0722", + "7f0e37f0e366aa89801eb072297c35", + "7ec967f0e37f14898082b0723b02d5", + "7f07e7f0e37f14998082b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0722", + "7f0e36665b66aa89801e9808297c35", + "665f67f0e37f14898082b0723b02d5", + "7ec967f0e37f14998082b0787b0721", + "7f07e7f0e47f531b0723b0b6fb0722", + "7f0e36665b66a449801e9808297c35", + "665f67f0e37f14898082b0723b02d5", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e36665b66a449801e9808297c35", + "665f67f0e37f14898082b072297c35", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e26665b66a449801e9808297c35", + "665f67f0e37f1489801eb072297c35", + "7ec967f0e37f14998082b0787b06bd", + "7f07e7f0e47f531b0723b0b6fb0721", + "7f0e27f1487f531b0b0bb0b6fb0722" + ], + /** + * 数字转中文速查表 + * @Array Of Property + * @trans ['日','一','二','三','四','五','六','七','八','九','十'] + * @return Cn string + */ + nStr1: ["日", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"], + /** + * 日期转农历称呼速查表 + * @Array Of Property + * @trans ['初','十','廿','卅'] + * @return Cn string + */ + nStr2: ["初", "十", "廿", "卅"], + /** + * 月份转农历称呼速查表 + * @Array Of Property + * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊'] + * @return Cn string + */ + nStr3: ["正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "冬", "腊"], + /** + * 返回农历y年一整年的总天数 + * @param lunar Year + * @return Number + * @eg:var count = calendar.lYearDays(1987) ;//count=387 + */ + lYearDays: function(y) { + var i; + var sum = 348; + for (i = 32768; i > 8; i >>= 1) { + sum += this.lunarInfo[y - 1900] & i ? 1 : 0; + } + return sum + this.leapDays(y); + }, + /** + * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0 + * @param lunar Year + * @return Number (0-12) + * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 + */ + leapMonth: function(y) { + return this.lunarInfo[y - 1900] & 15; + }, + /** + * 返回农历y年闰月的天数 若该年没有闰月则返回0 + * @param lunar Year + * @return Number (0、29、30) + * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 + */ + leapDays: function(y) { + if (this.leapMonth(y)) { + return this.lunarInfo[y - 1900] & 65536 ? 30 : 29; + } + return 0; + }, + /** + * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法 + * @param lunar Year + * @return Number (-1、29、30) + * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 + */ + monthDays: function(y, m) { + if (m > 12 || m < 1) { + return -1; + } + return this.lunarInfo[y - 1900] & 65536 >> m ? 30 : 29; + }, + /** + * 返回公历(!)y年m月的天数 + * @param solar Year + * @return Number (-1、28、29、30、31) + * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 + */ + solarDays: function(y, m) { + if (m > 12 || m < 1) { + return -1; + } + var ms = m - 1; + if (ms == 1) { + return y % 4 == 0 && y % 100 != 0 || y % 400 == 0 ? 29 : 28; + } else { + return this.solarMonth[ms]; + } + }, + /** + * 农历年份转换为干支纪年 + * @param lYear 农历年的年份数 + * @return Cn string + */ + toGanZhiYear: function(lYear) { + var ganKey = (lYear - 3) % 10; + var zhiKey = (lYear - 3) % 12; + if (ganKey == 0) + ganKey = 10; + if (zhiKey == 0) + zhiKey = 12; + return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1]; + }, + /** + * 公历月、日判断所属星座 + * @param cMonth [description] + * @param cDay [description] + * @return Cn string + */ + toAstro: function(cMonth, cDay) { + var s = "魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯"; + var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]; + return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "座"; + }, + /** + * 传入offset偏移量返回干支 + * @param offset 相对甲子的偏移量 + * @return Cn string + */ + toGanZhi: function(offset) { + return this.Gan[offset % 10] + this.Zhi[offset % 12]; + }, + /** + * 传入公历(!)y年获得该年第n个节气的公历日期 + * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起 + * @return day Number + * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春 + */ + getTerm: function(y, n) { + if (y < 1900 || y > 2100) { + return -1; + } + if (n < 1 || n > 24) { + return -1; + } + var _table = this.sTermInfo[y - 1900]; + var _info = [ + parseInt("0x" + _table.substr(0, 5)).toString(), + parseInt("0x" + _table.substr(5, 5)).toString(), + parseInt("0x" + _table.substr(10, 5)).toString(), + parseInt("0x" + _table.substr(15, 5)).toString(), + parseInt("0x" + _table.substr(20, 5)).toString(), + parseInt("0x" + _table.substr(25, 5)).toString() + ]; + var _calday = [ + _info[0].substr(0, 1), + _info[0].substr(1, 2), + _info[0].substr(3, 1), + _info[0].substr(4, 2), + _info[1].substr(0, 1), + _info[1].substr(1, 2), + _info[1].substr(3, 1), + _info[1].substr(4, 2), + _info[2].substr(0, 1), + _info[2].substr(1, 2), + _info[2].substr(3, 1), + _info[2].substr(4, 2), + _info[3].substr(0, 1), + _info[3].substr(1, 2), + _info[3].substr(3, 1), + _info[3].substr(4, 2), + _info[4].substr(0, 1), + _info[4].substr(1, 2), + _info[4].substr(3, 1), + _info[4].substr(4, 2), + _info[5].substr(0, 1), + _info[5].substr(1, 2), + _info[5].substr(3, 1), + _info[5].substr(4, 2) + ]; + return parseInt(_calday[n - 1]); + }, + /** + * 传入农历数字月份返回汉语通俗表示法 + * @param lunar month + * @return Cn string + * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月' + */ + toChinaMonth: function(m) { + if (m > 12 || m < 1) { + return -1; + } + var s = this.nStr3[m - 1]; + s += "月"; + return s; + }, + /** + * 传入农历日期数字返回汉字表示法 + * @param lunar day + * @return Cn string + * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一' + */ + toChinaDay: function(d) { + var s; + switch (d) { + case 10: + s = "初十"; + break; + case 20: + s = "二十"; + break; + case 30: + s = "三十"; + break; + default: + s = this.nStr2[Math.floor(d / 10)]; + s += this.nStr1[d % 10]; + } + return s; + }, + /** + * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春” + * @param y year + * @return Cn string + * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔' + */ + getAnimal: function(y) { + return this.Animals[(y - 4) % 12]; + }, + /** + * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON + * @param y solar year + * @param m solar month + * @param d solar day + * @return JSON object + * @eg:__f__('log','at node_modules/@climblee/uv-ui/components/uv-calendar/calendar.js:381',calendar.solar2lunar(1987,11,01)); + */ + solar2lunar: function(y, m, d) { + if (y < 1900 || y > 2100) { + return -1; + } + if (y == 1900 && m == 1 && d < 31) { + return -1; + } + if (!y) { + var objDate = /* @__PURE__ */ new Date(); + } else { + var objDate = new Date(y, parseInt(m) - 1, d); + } + var i; + var leap = 0; + var temp = 0; + var y = objDate.getFullYear(); + var m = objDate.getMonth() + 1; + var d = objDate.getDate(); + var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 864e5; + for (i = 1900; i < 2101 && offset > 0; i++) { + temp = this.lYearDays(i); + offset -= temp; + } + if (offset < 0) { + offset += temp; + i--; + } + var isTodayObj = /* @__PURE__ */ new Date(); + var isToday = false; + if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) { + isToday = true; + } + var nWeek = objDate.getDay(); + var cWeek = this.nStr1[nWeek]; + if (nWeek == 0) { + nWeek = 7; + } + var year = i; + var leap = this.leapMonth(i); + var isLeap = false; + for (i = 1; i < 13 && offset > 0; i++) { + if (leap > 0 && i == leap + 1 && isLeap == false) { + --i; + isLeap = true; + temp = this.leapDays(year); + } else { + temp = this.monthDays(year, i); + } + if (isLeap == true && i == leap + 1) { + isLeap = false; + } + offset -= temp; + } + if (offset == 0 && leap > 0 && i == leap + 1) { + if (isLeap) { + isLeap = false; + } else { + isLeap = true; + --i; + } + } + if (offset < 0) { + offset += temp; + --i; + } + var month = i; + var day = offset + 1; + var sm = m - 1; + var gzY = this.toGanZhiYear(year); + var firstNode = this.getTerm(y, m * 2 - 1); + var secondNode = this.getTerm(y, m * 2); + var gzM = this.toGanZhi((y - 1900) * 12 + m + 11); + if (d >= firstNode) { + gzM = this.toGanZhi((y - 1900) * 12 + m + 12); + } + var isTerm = false; + var Term = null; + if (firstNode == d) { + isTerm = true; + Term = this.solarTerm[m * 2 - 2]; + } + if (secondNode == d) { + isTerm = true; + Term = this.solarTerm[m * 2 - 1]; + } + var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10; + var gzD = this.toGanZhi(dayCyclical + d - 1); + var astro = this.toAstro(m, d); + return { "lYear": year, "lMonth": month, "lDay": day, "Animal": this.getAnimal(year), "IMonthCn": (isLeap ? "闰" : "") + this.toChinaMonth(month), "IDayCn": this.toChinaDay(day), "cYear": y, "cMonth": m, "cDay": d, "gzYear": gzY, "gzMonth": gzM, "gzDay": gzD, "isToday": isToday, "isLeap": isLeap, "nWeek": nWeek, "ncWeek": "星期" + cWeek, "isTerm": isTerm, "Term": Term, "astro": astro }; + }, + /** + * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON + * @param y lunar year + * @param m lunar month + * @param d lunar day + * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] + * @return JSON object + * @eg:__f__('log','at node_modules/@climblee/uv-ui/components/uv-calendar/calendar.js:500',calendar.lunar2solar(1987,9,10)); + */ + lunar2solar: function(y, m, d, isLeapMonth) { + var isLeapMonth = !!isLeapMonth; + var leapMonth = this.leapMonth(y); + this.leapDays(y); + if (isLeapMonth && leapMonth != m) { + return -1; + } + if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { + return -1; + } + var day = this.monthDays(y, m); + var _day = day; + if (isLeapMonth) { + _day = this.leapDays(y, m); + } + if (y < 1900 || y > 2100 || d > _day) { + return -1; + } + var offset = 0; + for (var i = 1900; i < y; i++) { + offset += this.lYearDays(i); + } + var leap = 0; + var isAdd = false; + for (var i = 1; i < m; i++) { + leap = this.leapMonth(y); + if (!isAdd) { + if (leap <= i && leap > 0) { + offset += this.leapDays(y); + isAdd = true; + } + } + offset += this.monthDays(y, i); + } + if (isLeapMonth) { + offset += day; + } + var stmap = Date.UTC(1900, 1, 30, 0, 0, 0); + var calObj = new Date((offset + d - 31) * 864e5 + stmap); + var cY = calObj.getUTCFullYear(); + var cM = calObj.getUTCMonth() + 1; + var cD = calObj.getUTCDate(); + return this.solar2lunar(cY, cM, cD); + } + }; + const _sfc_main$4 = { + name: "uv-calendar", + emits: ["confirm", "close", "change"], + mixins: [mpMixin, mixin, props$2], + components: { + uvHeader, + uvMonth + }, + data() { + return { + // 需要显示的月份的数组 + months: [], + // 在月份滚动区域中,当前视图中月份的index索引 + monthIndex: 0, + // 月份滚动区域的高度 + listHeight: 0, + // month组件中选择的日期数组 + selected: [], + scrollIntoView: "", + scrollTop: 0, + // 过滤处理方法 + innerFormatter: (value) => value + }; + }, + watch: { + selectedChange: { + immediate: true, + handler(n) { + this.setMonth(); + } + } + }, + computed: { + // 由于maxDate和minDate可以为字符串(2021-10-10),或者数值(时间戳),但是dayjs如果接受字符串形式的时间戳会有问题,这里进行处理 + innerMaxDate() { + return this.$uv.test.number(this.maxDate) ? Number(this.maxDate) : this.maxDate; + }, + innerMinDate() { + return this.$uv.test.number(this.minDate) ? Number(this.minDate) : this.minDate; + }, + // 多个条件的变化,会引起选中日期的变化,这里统一管理监听 + selectedChange() { + return [this.innerMinDate, this.innerMaxDate, this.defaultDate]; + }, + subtitle() { + if (this.months.length) { + return `${this.months[this.monthIndex].year}年${this.months[this.monthIndex].month}月`; + } else { + return ""; + } + }, + buttonDisabled() { + if (this.mode === "range") { + if (this.selected.length <= 1) { + return true; + } else { + return false; + } + } else { + return false; + } + } + }, + mounted() { + this.start = Date.now(); + this.init(); + }, + methods: { + // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用 + setFormatter(e) { + this.innerFormatter = e; + }, + // 点击日期框触发 + changeDay(e) { + this.$emit("change", e); + }, + // month组件内部选择日期后,通过事件通知给父组件 + monthSelected(e) { + this.selected = e; + if (!this.showConfirm) { + if (this.mode === "multiple" || this.mode === "single" || this.mode === "range" && this.selected.length >= 2) { + this.$emit("confirm", this.selected); + } + } + }, + init() { + if (this.innerMaxDate && this.innerMinDate && new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()) { + return this.$uv.error("maxDate不能小于minDate"); + } + this.listHeight = this.rowHeight * 5 + 30; + this.setMonth(); + }, + open() { + this.setMonth(); + this.$refs.calendarPopup.open(); + }, + popupChange(e) { + if (!e.show) { + this.$emit("close"); + } + }, + // 点击确定按钮 + confirm() { + if (!this.buttonDisabled) { + this.$emit("confirm", this.selected); + } + if (this.closeOnClickConfirm) { + this.$refs.calendarPopup.close(); + } + }, + // 获得两个日期之间的月份数 + getMonths(minDate, maxDate) { + const minYear = dayjs(minDate).year(); + const minMonth = dayjs(minDate).month() + 1; + const maxYear = dayjs(maxDate).year(); + const maxMonth = dayjs(maxDate).month() + 1; + return (maxYear - minYear) * 12 + (maxMonth - minMonth) + 1; + }, + // 设置月份数据 + setMonth() { + const minDate = this.innerMinDate || dayjs().valueOf(); + const maxDate = this.innerMaxDate || dayjs(minDate).add(this.monthNum - 1, "month").valueOf(); + const months = this.$uv.range( + 1, + this.monthNum, + this.getMonths(minDate, maxDate) + ); + this.months = []; + for (let i = 0; i < months; i++) { + this.months.push({ + date: new Array( + dayjs(minDate).add(i, "month").daysInMonth() + ).fill(1).map((item, index2) => { + let day = index2 + 1; + const week = dayjs(minDate).add(i, "month").date(day).day(); + const date2 = dayjs(minDate).add(i, "month").date(day).format("YYYY-MM-DD"); + let topInfo = ""; + let bottomInfo = ""; + if (this.showLunar) { + const lunar = calendar.solar2lunar( + dayjs(date2).year(), + dayjs(date2).month() + 1, + dayjs(date2).date() + ); + bottomInfo = lunar.IDayCn; + } + let config2 = { + day, + week, + // 小于最小允许的日期,或者大于最大的日期,则设置为disabled状态 + disabled: dayjs(date2).isBefore( + dayjs(minDate).format("YYYY-MM-DD") + ) || dayjs(date2).isAfter( + dayjs(maxDate).format("YYYY-MM-DD") + ), + // 返回一个日期对象,供外部的formatter获取当前日期的年月日等信息,进行加工处理 + date: new Date(date2), + topInfo, + bottomInfo, + dot: false, + month: dayjs(minDate).add(i, "month").month() + 1 + }; + const formatter = this.formatter || this.innerFormatter; + return formatter(config2); + }), + // 当前所属的月份 + month: dayjs(minDate).add(i, "month").month() + 1, + // 当前年份 + year: dayjs(minDate).add(i, "month").year() + }); + } + }, + // 滚动到默认设置的月份 + scrollIntoDefaultMonth(selected) { + const _index = this.months.findIndex(({ + year, + month + }) => { + month = this.$uv.padZero(month); + return `${year}-${month}` === selected; + }); + if (_index !== -1) { + this.$nextTick(() => { + this.scrollIntoView = `month-${_index}`; + }); + } + }, + // scroll-view滚动监听 + onScroll(event) { + const scrollTop = Math.max(0, event.detail.scrollTop); + for (let i = 0; i < this.months.length; i++) { + if (scrollTop >= (this.months[i].top || this.listHeight)) { + this.monthIndex = i; + } + } + }, + // 更新月份的top值 + updateMonthTop(topArr = []) { + topArr.map((item, index2) => { + this.months[index2].top = item; + }); + if (!this.defaultDate) { + const selected2 = dayjs().format("YYYY-MM"); + this.scrollIntoDefaultMonth(selected2); + return; + } + let selected = dayjs().format("YYYY-MM"); + if (!this.$uv.test.array(this.defaultDate)) { + selected = dayjs(this.defaultDate).format("YYYY-MM"); + } else { + selected = dayjs(this.defaultDate[0]).format("YYYY-MM"); + } + this.scrollIntoDefaultMonth(selected); + } + } + }; + function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uvHeader = vue.resolveComponent("uvHeader"); + const _component_uvMonth = vue.resolveComponent("uvMonth"); + const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_0$2); + const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_1); + return vue.openBlock(), vue.createBlock(_component_uv_popup, { + ref: "calendarPopup", + mode: "bottom", + closeable: "", + round: _ctx.round, + closeOnClickOverlay: _ctx.closeOnClickOverlay, + onChange: $options.popupChange + }, { + default: vue.withCtx(() => [ + vue.createElementVNode("view", { class: "uv-calendar" }, [ + vue.createVNode(_component_uvHeader, { + title: _ctx.title, + subtitle: $options.subtitle, + showSubtitle: _ctx.showSubtitle, + showTitle: _ctx.showTitle + }, null, 8, ["title", "subtitle", "showSubtitle", "showTitle"]), + vue.createElementVNode("scroll-view", { + style: vue.normalizeStyle({ height: _ctx.$uv.addUnit($data.listHeight) }), + "scroll-y": "", + onScroll: _cache[0] || (_cache[0] = (...args) => $options.onScroll && $options.onScroll(...args)), + "scroll-top": $data.scrollTop, + scrollIntoView: $data.scrollIntoView + }, [ + vue.createVNode(_component_uvMonth, { + color: _ctx.color, + rowHeight: _ctx.rowHeight, + showMark: _ctx.showMark, + months: $data.months, + mode: _ctx.mode, + maxCount: _ctx.maxCount, + startText: _ctx.startText, + endText: _ctx.endText, + defaultDate: _ctx.defaultDate, + minDate: $options.innerMinDate, + maxDate: $options.innerMaxDate, + maxMonth: _ctx.monthNum, + readonly: _ctx.readonly, + maxRange: _ctx.maxRange, + rangePrompt: _ctx.rangePrompt, + showRangePrompt: _ctx.showRangePrompt, + allowSameDay: _ctx.allowSameDay, + ref: "month", + onMonthSelected: $options.monthSelected, + onUpdateMonthTop: $options.updateMonthTop, + onChange: $options.changeDay + }, null, 8, ["color", "rowHeight", "showMark", "months", "mode", "maxCount", "startText", "endText", "defaultDate", "minDate", "maxDate", "maxMonth", "readonly", "maxRange", "rangePrompt", "showRangePrompt", "allowSameDay", "onMonthSelected", "onUpdateMonthTop", "onChange"]) + ], 44, ["scroll-top", "scrollIntoView"]), + _ctx.showConfirm ? vue.renderSlot(_ctx.$slots, "footer", { key: 0 }, () => [ + vue.createElementVNode("view", { class: "uv-calendar__confirm" }, [ + vue.createVNode(_component_uv_button, { + shape: "circle", + text: $options.buttonDisabled ? _ctx.confirmDisabledText : _ctx.confirmText, + color: _ctx.color, + onClick: $options.confirm, + disabled: $options.buttonDisabled + }, null, 8, ["text", "color", "onClick", "disabled"]) + ]) + ], true) : vue.createCommentVNode("v-if", true) + ]) + ]), + _: 3 + /* FORWARDED */ + }, 8, ["round", "closeOnClickOverlay", "onChange"]); + } + const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-225ec0b9"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-calendar/uv-calendar.vue"]]); + const props$1 = { + props: { + // item标签的名称,作为与uv-tabbar的value参数匹配的标识符 + name: { + type: [String, Number, null], + default: null + }, + // uv-ui内置图标或者绝对路径的图片 + icon: { + icon: String, + default: "" + }, + // 图标大小,默认uv-tabbar的iconSize=20 + iconSize: { + type: [String, Number], + default: "" + }, + // 右上角的角标提示信息 + badge: { + type: [String, Number, null], + default: null + }, + // 是否显示圆点,将会覆盖badge参数 + dot: { + type: Boolean, + default: false + }, + // 描述文本 + text: { + type: String, + default: "" + }, + // 控制徽标的位置,对象或者字符串形式,可以设置top和right属性 + badgeStyle: { + type: [Object, String], + default: "top: 6px;right:2px;" + }, + ...(_v = (_u = uni.$uv) == null ? void 0 : _u.props) == null ? void 0 : _v.tabbarItem + } + }; + const _sfc_main$3 = { + name: "uv-tabbar-item", + mixins: [mpMixin, mixin, props$1], + emits: ["click", "change"], + data() { + return { + isActive: false, + // 是否处于激活状态 + parentData: { + value: null, + activeColor: "", + inactiveColor: "", + iconSize: 20 + } + }; + }, + created() { + this.init(); + }, + methods: { + init() { + this.updateParentData(); + if (!this.parent) { + this.$uv.error("uv-tabbar-item必须搭配uv-tabbar组件使用"); + } + const index2 = this.parent.children.indexOf(this); + this.isActive = (this.name || index2) === this.parentData.value; + }, + updateParentData() { + this.getParentData("uv-tabbar"); + }, + // 此方法将会被父组件uv-tabbar调用 + updateFromParent() { + this.init(); + }, + clickHandler() { + this.$nextTick(() => { + const index2 = this.parent.children.indexOf(this); + const name = this.name || index2; + if (name !== this.parent.value) { + this.parent.$emit("change", name); + } + this.$emit("click", name); + }); + } + } + }; + function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_1$2); + const _component_uv_badge = resolveEasycom(vue.resolveDynamicComponent("uv-badge"), __easycom_1$3); + return vue.openBlock(), vue.createElementBlock( + "view", + { + class: "uv-tabbar-item", + style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)]), + onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)) + }, + [ + vue.createElementVNode("view", { class: "uv-tabbar-item__icon" }, [ + _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, { + key: 0, + name: _ctx.icon, + color: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor, + size: _ctx.iconSize ? _ctx.iconSize : $data.parentData.iconSize + }, null, 8, ["name", "color", "size"])) : (vue.openBlock(), vue.createElementBlock( + vue.Fragment, + { key: 1 }, + [ + $data.isActive ? vue.renderSlot(_ctx.$slots, "active-icon", { key: 0 }, void 0, true) : vue.renderSlot(_ctx.$slots, "inactive-icon", { key: 1 }, void 0, true) + ], + 64 + /* STABLE_FRAGMENT */ + )), + vue.createVNode(_component_uv_badge, { + absolute: "", + offset: [0, _ctx.dot ? "34rpx" : _ctx.badge > 9 ? "14rpx" : "20rpx"], + customStyle: _ctx.badgeStyle, + isDot: _ctx.dot, + value: _ctx.badge || (_ctx.dot ? 1 : null), + show: _ctx.dot || _ctx.badge > 0 + }, null, 8, ["offset", "customStyle", "isDot", "value", "show"]) + ]), + vue.renderSlot(_ctx.$slots, "text", {}, () => [ + vue.createElementVNode( + "text", + { + class: "uv-tabbar-item__text", + style: vue.normalizeStyle({ + color: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor + }) + }, + vue.toDisplayString(_ctx.text), + 5 + /* TEXT, STYLE */ + ) + ], true) + ], + 4 + /* STYLE */ + ); + } + const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-095eeec5"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-tabbar-item/uv-tabbar-item.vue"]]); + const props = { + props: { + // 当前匹配项的name + value: { + type: [String, Number, null], + default: null + }, + // 是否为iPhoneX留出底部安全距离 + safeAreaInsetBottom: { + type: Boolean, + default: true + }, + // 是否显示上方边框 + border: { + type: Boolean, + default: true + }, + // 元素层级z-index + zIndex: { + type: [String, Number], + default: 9 + }, + // 选中标签的颜色 + activeColor: { + type: String, + default: "#1989fa" + }, + // 未选中标签的颜色 + inactiveColor: { + type: String, + default: "#7d7e80" + }, + // 是否固定在底部 + fixed: { + type: Boolean, + default: true + }, + // fixed定位固定在底部时,是否生成一个等高元素防止塌陷 + placeholder: { + type: Boolean, + default: true + }, + // 图标大小 + iconSize: { + type: [String, Number], + default: 20 + }, + ...(_x = (_w = uni.$uv) == null ? void 0 : _w.props) == null ? void 0 : _x.tabbar + } + }; + const _sfc_main$2 = { + name: "uv-tabbar", + mixins: [mpMixin, mixin, props], + data() { + return { + placeholderHeight: 0 + }; + }, + computed: { + tabbarStyle() { + const style = { + zIndex: this.zIndex + }; + return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle)); + }, + // 监听多个参数的变化,通过在computed执行对应的操作 + updateChild() { + return [this.value, this.activeColor, this.inactiveColor]; + }, + updatePlaceholder() { + return [this.fixed, this.placeholder]; + } + }, + watch: { + updateChild() { + this.updateChildren(); + }, + updatePlaceholder() { + this.setPlaceholderHeight(); + } + }, + created() { + this.children = []; + }, + mounted() { + this.setPlaceholderHeight(); + }, + methods: { + updateChildren() { + this.children.length && this.children.map((child) => child.updateFromParent()); + }, + // 设置用于防止塌陷元素的高度 + async setPlaceholderHeight() { + if (!this.fixed || !this.placeholder) + return; + await this.$uv.sleep(20); + this.$uvGetRect(".uv-tabbar__content").then(({ height = 50 }) => { + this.placeholderHeight = height; + }); + } + } + }; + function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uv_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("uv-safe-bottom"), __easycom_0); + return vue.openBlock(), vue.createElementBlock("view", { class: "uv-tabbar" }, [ + vue.createElementVNode( + "view", + { + class: vue.normalizeClass(["uv-tabbar__content", [_ctx.border && "uv-border-top", _ctx.fixed && "uv-tabbar--fixed"]]), + ref: "uv-tabbar__content", + onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"])), + style: vue.normalizeStyle([$options.tabbarStyle]) + }, + [ + vue.createElementVNode("view", { class: "uv-tabbar__content__item-wrapper" }, [ + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) + ]), + _ctx.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_uv_safe_bottom, { key: 0 })) : vue.createCommentVNode("v-if", true) + ], + 38 + /* CLASS, STYLE, NEED_HYDRATION */ + ), + _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: "uv-tabbar__placeholder", + style: vue.normalizeStyle({ + height: $data.placeholderHeight + "px" + }) + }, + null, + 4 + /* STYLE */ + )) : vue.createCommentVNode("v-if", true) + ]); + } + const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-20102e86"], ["__file", "D:/frontDev/project/OfficeSystem/node_modules/@climblee/uv-ui/components/uv-tabbar/uv-tabbar.vue"]]); const _sfc_main$1 = { data() { return { - title: "Hello UNI" + title: "Hello UNI", + value: 0, + list: [{ + name: "关注" + }, { + name: "推荐" + }, { + name: "电影" + }, { + name: "科技" + }, { + name: "音乐" + }, { + name: "美食" + }, { + name: "文化" + }, { + name: "财经" + }, { + name: "手工" + }] }; }, onLoad() { - formatAppLog("log", "at pages/index/index.vue:20", uni.$uv.os()); + formatAppLog("log", "at pages/index/index.vue:58", uni.$uv.os()); }, - methods: {} + methods: { + click(item) { + formatAppLog("log", "at pages/index/index.vue:62", "item", item); + }, + open() { + this.$refs.calendar.open(); + }, + confirm(e) { + formatAppLog("log", "at pages/index/index.vue:68", "日历选择:", e); + } + } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_0); - return vue.openBlock(), vue.createElementBlock("view", { class: "content" }, [ - vue.createElementVNode("image", { - class: "logo", - src: _imports_0 - }), - vue.createElementVNode("view", { class: "text-area" }, [ - vue.createElementVNode( - "text", - { class: "title" }, - vue.toDisplayString($data.title), - 1 - /* TEXT */ - ) - ]), - vue.createVNode(_component_uv_icon, { - name: "photo", - size: "30", - color: "#909399" - }) - ]); + const _component_uv_tabs = resolveEasycom(vue.resolveDynamicComponent("uv-tabs"), __easycom_0$4); + const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_1$2); + const _component_uv_calendar = resolveEasycom(vue.resolveDynamicComponent("uv-calendar"), __easycom_2); + const _component_uv_tabbar_item = resolveEasycom(vue.resolveDynamicComponent("uv-tabbar-item"), __easycom_3); + const _component_uv_tabbar = resolveEasycom(vue.resolveDynamicComponent("uv-tabbar"), __easycom_4); + return vue.openBlock(), vue.createElementBlock( + vue.Fragment, + null, + [ + vue.createVNode(_component_uv_tabs, { + list: $data.list, + onClick: $options.click + }, null, 8, ["list", "onClick"]), + vue.createElementVNode("view", { class: "content" }, [ + vue.createElementVNode("view", { class: "text-area" }, [ + vue.createElementVNode( + "text", + { class: "title" }, + vue.toDisplayString($data.title), + 1 + /* TEXT */ + ) + ]), + vue.createVNode(_component_uv_icon, { + name: "photo", + size: "30", + color: "#909399" + }), + vue.createElementVNode("button", { class: "uv-reset-button" }, "点击登录"), + vue.createElementVNode("button", null, "点击登录"), + vue.createElementVNode("view", null, [ + vue.createVNode(_component_uv_calendar, { + ref: "calendar", + mode: "single", + onConfirm: $options.confirm + }, null, 8, ["onConfirm"]), + vue.createElementVNode("button", { + onClick: _cache[0] || (_cache[0] = (...args) => $options.open && $options.open(...args)) + }, "打开") + ]) + ]), + vue.createVNode(_component_uv_tabbar, { + value: $data.value, + onChange: _cache[1] || (_cache[1] = (index2) => $data.value = index2) + }, { + default: vue.withCtx(() => [ + vue.createVNode(_component_uv_tabbar_item, { + text: "首页", + icon: "home", + dot: "" + }), + vue.createVNode(_component_uv_tabbar_item, { + text: "放映厅", + icon: "photo", + badge: "3" + }), + vue.createVNode(_component_uv_tabbar_item, { + text: "直播", + icon: "play-right" + }), + vue.createVNode(_component_uv_tabbar_item, { + text: "我的", + icon: "account" + }) + ]), + _: 1 + /* STABLE */ + }, 8, ["value"]) + ], + 64 + /* STABLE_FRAGMENT */ + ); } const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/frontDev/project/OfficeSystem/pages/index/index.vue"]]); __definePage("pages/index/index", PagesIndexIndex); @@ -2061,110 +6523,6 @@ if (uni.restoreGlobal) { return "3.1.0"; } } - function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) { - const startRGB = hexToRgb(startColor, false); - const startR = startRGB[0]; - const startG = startRGB[1]; - const startB = startRGB[2]; - const endRGB = hexToRgb(endColor, false); - const endR = endRGB[0]; - const endG = endRGB[1]; - const endB = endRGB[2]; - const sR = (endR - startR) / step; - const sG = (endG - startG) / step; - const sB = (endB - startB) / step; - const colorArr = []; - for (let i = 0; i < step; i++) { - let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`); - if (i === 0) - hex = rgbToHex(startColor); - if (i === step - 1) - hex = rgbToHex(endColor); - colorArr.push(hex); - } - return colorArr; - } - function hexToRgb(sColor, str = true) { - const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - sColor = String(sColor).toLowerCase(); - if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - let sColorNew = "#"; - for (let i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; - } - const sColorChange = []; - for (let i = 1; i < 7; i += 2) { - sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`)); - } - if (!str) { - return sColorChange; - } - return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`; - } - if (/^(rgb|RGB)/.test(sColor)) { - const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); - return arr.map((val) => Number(val)); - } - return sColor; - } - function rgbToHex(rgb) { - const _this = rgb; - const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - if (/^(rgb|RGB)/.test(_this)) { - const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); - let strHex = "#"; - for (let i = 0; i < aColor.length; i++) { - let hex = Number(aColor[i]).toString(16); - hex = String(hex).length == 1 ? `${0}${hex}` : hex; - if (hex === "0") { - hex += hex; - } - strHex += hex; - } - if (strHex.length !== 7) { - strHex = _this; - } - return strHex; - } - if (reg.test(_this)) { - const aNum = _this.replace(/#/, "").split(""); - if (aNum.length === 6) { - return _this; - } - if (aNum.length === 3) { - let numHex = "#"; - for (let i = 0; i < aNum.length; i += 1) { - numHex += aNum[i] + aNum[i]; - } - return numHex; - } - } else { - return _this; - } - } - function colorToRgba(color, alpha) { - color = rgbToHex(color); - const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - let sColor = String(color).toLowerCase(); - if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - let sColorNew = "#"; - for (let i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; - } - const sColorChange = []; - for (let i = 1; i < 7; i += 2) { - sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`)); - } - return `rgba(${sColorChange.join(",")},${alpha})`; - } - return sColor; - } const version = "1.1.20"; { formatAppLog("log", "at node_modules/@climblee/uv-ui/libs/config/config.js:6", ` @@ -2235,6 +6593,20 @@ if (uni.restoreGlobal) { function createApp() { const app = vue.createVueApp(App); app.use(uvUI); + uni.$uv.setConfig({ + // 修改$uv.config对象的属性 + // 修改$uv.props对象的属性 + props: { + // 修改uv-text组件的size参数的默认值,注意:默认值都要用default声明 + text: { + color: { + default: "red" + } + } + // 其他组件属性配置,具体的参数名称可以去每个组件的props.js中进行查看 + // ...... + } + }); return { app }; diff --git a/unpackage/dist/dev/app-plus/pages/index/index.css b/unpackage/dist/dev/app-plus/pages/index/index.css index a8d2c7b..bd9402a 100644 --- a/unpackage/dist/dev/app-plus/pages/index/index.css +++ b/unpackage/dist/dev/app-plus/pages/index/index.css @@ -23,6 +23,185 @@ /* 垂直间距 */ /* 透明度 */ /* 文章场景相关 */ +uni-view[data-v-747d4365], uni-scroll-view[data-v-747d4365], uni-swiper-item[data-v-747d4365] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-badge[data-v-747d4365] { + border-top-right-radius: 100px; + border-top-left-radius: 100px; + border-bottom-left-radius: 100px; + border-bottom-right-radius: 100px; + + display: flex; + + flex-direction: row; + line-height: 11px; + text-align: center; + font-size: 11px; + color: #FFFFFF; +} +.uv-badge--dot[data-v-747d4365] { + height: 8px; + width: 8px; +} +.uv-badge--inverted[data-v-747d4365] { + font-size: 13px; +} +.uv-badge--not-dot[data-v-747d4365] { + padding: 2px 5px; +} +.uv-badge--horn[data-v-747d4365] { + border-bottom-left-radius: 0; +} +.uv-badge--primary[data-v-747d4365] { + background-color: #3c9cff; +} +.uv-badge--primary--inverted[data-v-747d4365] { + color: #3c9cff; +} +.uv-badge--error[data-v-747d4365] { + background-color: #f56c6c; +} +.uv-badge--error--inverted[data-v-747d4365] { + color: #f56c6c; +} +.uv-badge--success[data-v-747d4365] { + background-color: #5ac725; +} +.uv-badge--success--inverted[data-v-747d4365] { + color: #5ac725; +} +.uv-badge--info[data-v-747d4365] { + background-color: #909399; +} +.uv-badge--info--inverted[data-v-747d4365] { + color: #909399; +} +.uv-badge--warning[data-v-747d4365] { + background-color: #f9ae3d; +} +.uv-badge--warning--inverted[data-v-747d4365] { + color: #f9ae3d; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +uni-view[data-v-0f3b9fa1], uni-scroll-view[data-v-0f3b9fa1], uni-swiper-item[data-v-0f3b9fa1] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-tabs__wrapper[data-v-0f3b9fa1] { + + display: flex; + + flex-direction: row; + align-items: center; +} +.uv-tabs__wrapper__scroll-view-wrapper[data-v-0f3b9fa1] { + flex: 1; + overflow: auto hidden; +} +.uv-tabs__wrapper__scroll-view[data-v-0f3b9fa1] { + + display: flex; + + flex-direction: row; + flex: 1; +} +.uv-tabs__wrapper__nav[data-v-0f3b9fa1] { + + display: flex; + + flex-direction: row; + position: relative; +} +.uv-tabs__wrapper__nav__item[data-v-0f3b9fa1] { + padding: 0 11px; + + display: flex; + + flex-direction: row; + align-items: center; + justify-content: center; +} +.uv-tabs__wrapper__nav__item--disabled[data-v-0f3b9fa1] { + cursor: not-allowed; +} +.uv-tabs__wrapper__nav__item__text[data-v-0f3b9fa1] { + font-size: 15px; + color: #606266; +} +.uv-tabs__wrapper__nav__item__text--disabled[data-v-0f3b9fa1] { + color: #c8c9cc !important; +} +.uv-tabs__wrapper__nav__line[data-v-0f3b9fa1] { + height: 3px; + background: #3c9cff; + width: 30px; + position: absolute; + bottom: 2px; + border-radius: 100px; + transition-property: transform; + transition-duration: 300ms; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ uni-view[data-v-7cc7ad3f], uni-scroll-view[data-v-7cc7ad3f], uni-swiper-item[data-v-7cc7ad3f] { display: flex; flex-direction: column; @@ -112,6 +291,938 @@ uni-view[data-v-7cc7ad3f], uni-scroll-view[data-v-7cc7ad3f], uni-swiper-item[dat /* 垂直间距 */ /* 透明度 */ /* 文章场景相关 */ +uni-view[data-v-daf2e960], uni-scroll-view[data-v-daf2e960], uni-swiper-item[data-v-daf2e960] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-loading-icon[data-v-daf2e960] { + flex-direction: row; + align-items: center; + justify-content: center; + color: #c8c9cc; +} +.uv-loading-icon__text[data-v-daf2e960] { + margin-left: 4px; + color: #606266; + font-size: 14px; + line-height: 20px; +} +.uv-loading-icon__spinner[data-v-daf2e960] { + width: 30px; + height: 30px; + position: relative; + box-sizing: border-box; + max-width: 100%; + max-height: 100%; + animation: uv-rotate-daf2e960 1s linear infinite; +} +.uv-loading-icon__spinner--semicircle[data-v-daf2e960] { + 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; +} +.uv-loading-icon__spinner--circle[data-v-daf2e960] { + 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; +} +.uv-loading-icon--vertical[data-v-daf2e960] { + flex-direction: column; +} +[data-v-daf2e960]:host { + font-size: 0px; + line-height: 1; +} +.uv-loading-icon__spinner--spinner[data-v-daf2e960] { + animation-timing-function: steps(12); +} +.uv-loading-icon__text[data-v-daf2e960]:empty { + display: none; +} +.uv-loading-icon--vertical .uv-loading-icon__text[data-v-daf2e960] { + margin: 6px 0 0; + color: #606266; +} +.uv-loading-icon__dot[data-v-daf2e960] { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.uv-loading-icon__dot[data-v-daf2e960]:before { + display: block; + width: 2px; + height: 25%; + margin: 0 auto; + background-color: currentColor; + border-radius: 40%; + content: " "; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(1) { + transform: rotate(30deg); + opacity: 1; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(2) { + transform: rotate(60deg); + opacity: 0.9375; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(3) { + transform: rotate(90deg); + opacity: 0.875; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(4) { + transform: rotate(120deg); + opacity: 0.8125; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(5) { + transform: rotate(150deg); + opacity: 0.75; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(6) { + transform: rotate(180deg); + opacity: 0.6875; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(7) { + transform: rotate(210deg); + opacity: 0.625; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(8) { + transform: rotate(240deg); + opacity: 0.5625; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(9) { + transform: rotate(270deg); + opacity: 0.5; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(10) { + transform: rotate(300deg); + opacity: 0.4375; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(11) { + transform: rotate(330deg); + opacity: 0.375; +} +.uv-loading-icon__dot[data-v-daf2e960]:nth-of-type(12) { + transform: rotate(360deg); + opacity: 0.3125; +} +@keyframes uv-rotate-daf2e960 { +0% { + transform: rotate(0deg); +} +to { + transform: rotate(1turn); +} +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-reset-button[data-v-1ac9ef43] { + padding: 0; + background-color: transparent; +} +.uv-reset-button[data-v-1ac9ef43]::after { + border: none; +} +uni-view[data-v-1ac9ef43], uni-scroll-view[data-v-1ac9ef43], uni-swiper-item[data-v-1ac9ef43] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-button-wrapper[data-v-1ac9ef43] { + position: relative; +} +.uv-button-wrapper--dis[data-v-1ac9ef43] { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 9; +} +.uv-button[data-v-1ac9ef43] { + width: 100%; +} +.uv-button__text[data-v-1ac9ef43] { + white-space: nowrap; + line-height: 1; +} +.uv-button[data-v-1ac9ef43]: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; +} +.uv-button--active[data-v-1ac9ef43]:before { + opacity: 0.15; +} +.uv-button__icon + .uv-button__text[data-v-1ac9ef43]:not(:empty), .uv-button__loading-text[data-v-1ac9ef43] { + margin-left: 4px; +} +.uv-button--plain.uv-button--primary[data-v-1ac9ef43] { + color: #3c9cff; +} +.uv-button--plain.uv-button--info[data-v-1ac9ef43] { + color: #909399; +} +.uv-button--plain.uv-button--success[data-v-1ac9ef43] { + color: #5ac725; +} +.uv-button--plain.uv-button--error[data-v-1ac9ef43] { + color: #f56c6c; +} +.uv-button--plain.uv-button--warning[data-v-1ac9ef43] { + color: #f9ae3d; +} +.uv-button[data-v-1ac9ef43] { + height: 40px; + position: relative; + align-items: center; + justify-content: center; + + display: flex; + + flex-direction: row; + box-sizing: border-box; + flex-direction: row; +} +.uv-button__text[data-v-1ac9ef43] { + font-size: 15px; +} +.uv-button__loading-text[data-v-1ac9ef43] { + font-size: 15px; + margin-left: 4px; +} +.uv-button--large[data-v-1ac9ef43] { + width: 100%; + height: 50px; + padding: 0 15px; +} +.uv-button--normal[data-v-1ac9ef43] { + padding: 0 12px; + font-size: 14px; +} +.uv-button--small[data-v-1ac9ef43] { + min-width: 60px; + height: 30px; + padding: 0px 8px; + font-size: 12px; +} +.uv-button--mini[data-v-1ac9ef43] { + height: 22px; + font-size: 10px; + min-width: 50px; + padding: 0px 8px; +} +.uv-button--disabled[data-v-1ac9ef43] { + opacity: 0.5; +} +.uv-button--info[data-v-1ac9ef43] { + color: #323233; + background-color: #fff; + border-color: #ebedf0; + border-width: 1px; + border-style: solid; +} +.uv-button--success[data-v-1ac9ef43] { + color: #fff; + background-color: #5ac725; + border-color: #5ac725; + border-width: 1px; + border-style: solid; +} +.uv-button--primary[data-v-1ac9ef43] { + color: #fff; + background-color: #3c9cff; + border-color: #3c9cff; + border-width: 1px; + border-style: solid; +} +.uv-button--error[data-v-1ac9ef43] { + color: #fff; + background-color: #f56c6c; + border-color: #f56c6c; + border-width: 1px; + border-style: solid; +} +.uv-button--warning[data-v-1ac9ef43] { + color: #fff; + background-color: #f9ae3d; + border-color: #f9ae3d; + border-width: 1px; + border-style: solid; +} +.uv-button--block[data-v-1ac9ef43] { + + display: flex; + + flex-direction: row; + width: 100%; +} +.uv-button--circle[data-v-1ac9ef43] { + border-top-right-radius: 100px; + border-top-left-radius: 100px; + border-bottom-left-radius: 100px; + border-bottom-right-radius: 100px; +} +.uv-button--square[data-v-1ac9ef43] { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.uv-button__icon[data-v-1ac9ef43] { + min-width: 1em; + line-height: inherit !important; + vertical-align: top; +} +.uv-button--plain[data-v-1ac9ef43] { + background-color: #fff; +} +.uv-button--hairline[data-v-1ac9ef43] { + border-width: 0.5px !important; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-overlay[data-v-b1e8b0c8] { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-status-bar[data-v-4ff5a0d7] { + width: 100%; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-safe-bottom[data-v-a55db101] { + width: 100%; +} +.uv-safe-area-inset-top[data-v-a55db101] { + padding-top: 0; + padding-top: constant(safe-area-inset-top); + padding-top: env(safe-area-inset-top); +} +.uv-safe-area-inset-right[data-v-a55db101] { + padding-right: 0; + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right); +} +.uv-safe-area-inset-bottom[data-v-a55db101] { + padding-bottom: 0; + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); +} +.uv-safe-area-inset-left[data-v-a55db101] { + padding-left: 0; + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left); +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-popup[data-v-c66d5e79] { + position: fixed; + z-index: 99; +} +.uv-popup.top[data-v-c66d5e79], .uv-popup.left[data-v-c66d5e79], .uv-popup.right[data-v-c66d5e79] { + top: 0; +} +.uv-popup .uv-popup__content[data-v-c66d5e79] { + display: block; + overflow: hidden; + position: relative; +} +.uv-popup .uv-popup__content.left[data-v-c66d5e79], .uv-popup .uv-popup__content.right[data-v-c66d5e79] { + padding-top: 0; + flex: 1; +} +.uv-popup .uv-popup__content__close[data-v-c66d5e79] { + position: absolute; +} +.uv-popup .uv-popup__content__close--hover[data-v-c66d5e79] { + opacity: 0.4; +} +.uv-popup .uv-popup__content__close--top-left[data-v-c66d5e79] { + top: 15px; + left: 15px; +} +.uv-popup .uv-popup__content__close--top-right[data-v-c66d5e79] { + top: 15px; + right: 15px; +} +.uv-popup .uv-popup__content__close--bottom-left[data-v-c66d5e79] { + bottom: 15px; + left: 15px; +} +.uv-popup .uv-popup__content__close--bottom-right[data-v-c66d5e79] { + right: 15px; + bottom: 15px; +} +.fixforpc-z-index[data-v-c66d5e79] { + z-index: 999; +} +.fixforpc-top[data-v-c66d5e79] { + top: 0; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-border-bottom[data-v-de7aec68] { + border-bottom-width: 0.5px !important; + border-color: #dadbde !important; + border-bottom-style: solid; +} +uni-view[data-v-de7aec68], uni-scroll-view[data-v-de7aec68], uni-swiper-item[data-v-de7aec68] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-calendar-header[data-v-de7aec68] { + padding-bottom: 4px; +} +.uv-calendar-header__title[data-v-de7aec68] { + font-size: 16px; + color: #303133; + text-align: center; + height: 42px; + line-height: 42px; + font-weight: bold; +} +.uv-calendar-header__subtitle[data-v-de7aec68] { + font-size: 14px; + color: #303133; + height: 40px; + text-align: center; + line-height: 40px; + font-weight: bold; +} +.uv-calendar-header__weekdays[data-v-de7aec68] { + + display: flex; + + flex-direction: row; + justify-content: space-between; +} +.uv-calendar-header__weekdays__weekday[data-v-de7aec68] { + font-size: 13px; + color: #303133; + line-height: 30px; + flex: 1; + text-align: center; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +uni-view[data-v-b2cf4ec4], uni-scroll-view[data-v-b2cf4ec4], uni-swiper-item[data-v-b2cf4ec4] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-calendar-month-wrapper[data-v-b2cf4ec4] { + margin-top: 4px; +} +.uv-calendar-month__title[data-v-b2cf4ec4] { + font-size: 14px; + line-height: 42px; + height: 42px; + color: #303133; + text-align: center; + font-weight: bold; +} +.uv-calendar-month__days[data-v-b2cf4ec4] { + position: relative; + + display: flex; + + flex-direction: row; + flex-wrap: wrap; +} +.uv-calendar-month__days__month-mark-wrapper[data-v-b2cf4ec4] { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + + display: flex; + + flex-direction: row; + justify-content: center; + align-items: center; +} +.uv-calendar-month__days__month-mark-wrapper__text[data-v-b2cf4ec4] { + font-size: 155px; + color: rgba(231, 232, 234, 0.83); +} +.uv-calendar-month__days__day[data-v-b2cf4ec4] { + + display: flex; + + flex-direction: row; + padding: 2px; + width: 14.2857142857%; + box-sizing: border-box; +} +.uv-calendar-month__days__day__select[data-v-b2cf4ec4] { + flex: 1; + + display: flex; + + flex-direction: row; + align-items: center; + justify-content: center; + position: relative; +} +.uv-calendar-month__days__day__select__dot[data-v-b2cf4ec4] { + width: 7px; + height: 7px; + border-radius: 100px; + background-color: #f56c6c; + position: absolute; + top: 12px; + right: 7px; +} +.uv-calendar-month__days__day__select__top-info[data-v-b2cf4ec4] { + color: #606266; + text-align: center; + position: absolute; + top: 2px; + font-size: 10px; + text-align: center; + left: 0; + right: 0; +} +.uv-calendar-month__days__day__select__top-info--selected[data-v-b2cf4ec4] { + color: #ffffff; +} +.uv-calendar-month__days__day__select__top-info--disabled[data-v-b2cf4ec4] { + color: #cacbcd; +} +.uv-calendar-month__days__day__select__buttom-info[data-v-b2cf4ec4] { + color: #606266; + text-align: center; + position: absolute; + bottom: 5px; + font-size: 10px; + text-align: center; + left: 0; + right: 0; +} +.uv-calendar-month__days__day__select__buttom-info--selected[data-v-b2cf4ec4] { + color: #ffffff; +} +.uv-calendar-month__days__day__select__buttom-info--disabled[data-v-b2cf4ec4] { + color: #cacbcd; +} +.uv-calendar-month__days__day__select__info[data-v-b2cf4ec4] { + text-align: center; + font-size: 16px; +} +.uv-calendar-month__days__day__select__info--selected[data-v-b2cf4ec4] { + color: #ffffff; +} +.uv-calendar-month__days__day__select__info--disabled[data-v-b2cf4ec4] { + color: #cacbcd; +} +.uv-calendar-month__days__day__select--selected[data-v-b2cf4ec4] { + background-color: #3c9cff; + + display: flex; + + flex-direction: row; + justify-content: center; + align-items: center; + flex: 1; + border-radius: 3px; +} +.uv-calendar-month__days__day__select--range-selected[data-v-b2cf4ec4] { + opacity: 0.3; + border-radius: 0; +} +.uv-calendar-month__days__day__select--range-start-selected[data-v-b2cf4ec4] { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.uv-calendar-month__days__day__select--range-end-selected[data-v-b2cf4ec4] { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-calendar__confirm[data-v-225ec0b9] { + padding: 7px 18px; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +uni-view[data-v-095eeec5], uni-scroll-view[data-v-095eeec5], uni-swiper-item[data-v-095eeec5] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-tabbar-item[data-v-095eeec5] { + + display: flex; + + flex-direction: column; + align-items: center; + justify-content: center; + flex: 1; +} +.uv-tabbar-item__icon[data-v-095eeec5] { + + display: flex; + + flex-direction: row; + position: relative; + width: 4.6875rem; + justify-content: center; +} +.uv-tabbar-item__text[data-v-095eeec5] { + margin-top: 2px; + font-size: 12px; + color: #606266; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.uv-border-top[data-v-20102e86] { + border-top-width: 0.5px !important; + border-color: #dadbde !important; + border-top-style: solid; +} +uni-view[data-v-20102e86], uni-scroll-view[data-v-20102e86], uni-swiper-item[data-v-20102e86] { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; +} +.uv-tabbar[data-v-20102e86] { + + display: flex; + + flex-direction: column; + flex: 1; + justify-content: center; +} +.uv-tabbar__content[data-v-20102e86] { + + display: flex; + + flex-direction: column; + background-color: #fff; +} +.uv-tabbar__content__item-wrapper[data-v-20102e86] { + height: 50px; + + display: flex; + + flex-direction: row; +} +.uv-tabbar--fixed[data-v-20102e86] { + position: fixed; + bottom: 0; + left: 0; + right: 0; +} +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ .content[data-v-1cf27b2a] { display: flex; flex-direction: column; @@ -133,4 +1244,8 @@ uni-view[data-v-7cc7ad3f], uni-scroll-view[data-v-7cc7ad3f], uni-swiper-item[dat .title[data-v-1cf27b2a] { font-size: 1.125rem; color: #007aff; +} +.icon[data-v-1cf27b2a] { + width: 1.125rem; + height: 1.125rem; } \ No newline at end of file