基本功能都已完成
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
const ActionSheet = {
|
||||
// action-sheet组件
|
||||
actionSheet: {
|
||||
show: false,
|
||||
title: "",
|
||||
description: "",
|
||||
actions: [],
|
||||
index: "",
|
||||
cancelText: "",
|
||||
closeOnClickAction: true,
|
||||
safeAreaInsetBottom: true,
|
||||
openType: "",
|
||||
closeOnClickOverlay: true,
|
||||
round: 0,
|
||||
wrapMaxHeight: "600px"
|
||||
}
|
||||
};
|
||||
exports.ActionSheet = ActionSheet;
|
||||
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
const Album = {
|
||||
// album 组件
|
||||
album: {
|
||||
urls: [],
|
||||
keyName: "",
|
||||
singleSize: 180,
|
||||
multipleSize: 70,
|
||||
space: 6,
|
||||
singleMode: "scaleToFill",
|
||||
multipleMode: "aspectFill",
|
||||
maxCount: 9,
|
||||
previewFullImage: true,
|
||||
rowCount: 3,
|
||||
showMore: true,
|
||||
autoWrap: false,
|
||||
unit: "px",
|
||||
stop: true
|
||||
}
|
||||
};
|
||||
exports.Album = Album;
|
||||
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
const Alert = {
|
||||
// alert警告组件
|
||||
alert: {
|
||||
title: "",
|
||||
type: "warning",
|
||||
description: "",
|
||||
closable: false,
|
||||
showIcon: false,
|
||||
effect: "light",
|
||||
center: false,
|
||||
fontSize: 14,
|
||||
transitionMode: "fade",
|
||||
duration: 0,
|
||||
icon: "",
|
||||
value: true
|
||||
}
|
||||
};
|
||||
exports.Alert = Alert;
|
||||
@@ -1,16 +0,0 @@
|
||||
"use strict";
|
||||
const AvatarGroup = {
|
||||
// avatarGroup 组件
|
||||
avatarGroup: {
|
||||
urls: [],
|
||||
maxCount: 5,
|
||||
shape: "circle",
|
||||
mode: "scaleToFill",
|
||||
showMore: true,
|
||||
size: 40,
|
||||
keyName: "",
|
||||
gap: 0.5,
|
||||
extraValue: 0
|
||||
}
|
||||
};
|
||||
exports.AvatarGroup = AvatarGroup;
|
||||
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
const Avatar = {
|
||||
// avatar 组件
|
||||
avatar: {
|
||||
src: "",
|
||||
shape: "circle",
|
||||
size: 40,
|
||||
mode: "scaleToFill",
|
||||
text: "",
|
||||
bgColor: "#c0c4cc",
|
||||
color: "#ffffff",
|
||||
fontSize: 18,
|
||||
icon: "",
|
||||
mpAvatar: false,
|
||||
randomBgColor: false,
|
||||
defaultUrl: "",
|
||||
colorIndex: "",
|
||||
name: ""
|
||||
}
|
||||
};
|
||||
exports.Avatar = Avatar;
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
const Backtop = {
|
||||
// backtop组件
|
||||
backtop: {
|
||||
mode: "circle",
|
||||
icon: "arrow-upward",
|
||||
text: "",
|
||||
duration: 100,
|
||||
scrollTop: 0,
|
||||
top: 400,
|
||||
bottom: 100,
|
||||
right: 20,
|
||||
zIndex: 9,
|
||||
iconStyle: {
|
||||
color: "#909399",
|
||||
fontSize: "19px"
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.Backtop = Backtop;
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
const Badge = {
|
||||
// 徽标数组件
|
||||
badge: {
|
||||
isDot: false,
|
||||
value: "",
|
||||
show: true,
|
||||
max: 999,
|
||||
type: "error",
|
||||
showZero: false,
|
||||
bgColor: null,
|
||||
color: null,
|
||||
shape: "circle",
|
||||
numberType: "overflow",
|
||||
offset: [],
|
||||
inverted: false,
|
||||
absolute: false
|
||||
}
|
||||
};
|
||||
exports.Badge = Badge;
|
||||
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
const Button = {
|
||||
// button组件
|
||||
button: {
|
||||
hairline: false,
|
||||
type: "info",
|
||||
size: "normal",
|
||||
shape: "square",
|
||||
plain: false,
|
||||
disabled: false,
|
||||
loading: false,
|
||||
loadingText: "",
|
||||
loadingMode: "spinner",
|
||||
loadingSize: 15,
|
||||
openType: "",
|
||||
formType: "",
|
||||
appParameter: "",
|
||||
hoverStopPropagation: true,
|
||||
lang: "en",
|
||||
sessionFrom: "",
|
||||
sendMessageTitle: "",
|
||||
sendMessagePath: "",
|
||||
sendMessageImg: "",
|
||||
showMessageCard: false,
|
||||
dataName: "",
|
||||
throttleTime: 0,
|
||||
hoverStartTime: 0,
|
||||
hoverStayTime: 200,
|
||||
text: "",
|
||||
icon: "",
|
||||
iconColor: "",
|
||||
color: "",
|
||||
stop: true
|
||||
}
|
||||
};
|
||||
exports.Button = Button;
|
||||
@@ -1,161 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 是否细边框
|
||||
hairline: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.hairline
|
||||
},
|
||||
// 按钮的预置样式,info,primary,error,warning,success
|
||||
type: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.type
|
||||
},
|
||||
// 按钮尺寸,large,normal,small,mini
|
||||
size: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.size
|
||||
},
|
||||
// 按钮形状,circle(两边为半圆),square(带圆角)
|
||||
shape: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.shape
|
||||
},
|
||||
// 按钮是否镂空
|
||||
plain: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.plain
|
||||
},
|
||||
// 是否禁止状态
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.disabled
|
||||
},
|
||||
// 是否加载中
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.loading
|
||||
},
|
||||
// 加载中提示文字
|
||||
loadingText: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.loadingText
|
||||
},
|
||||
// 加载状态图标类型
|
||||
loadingMode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.loadingMode
|
||||
},
|
||||
// 加载图标大小
|
||||
loadingSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.loadingSize
|
||||
},
|
||||
// 开放能力,具体请看uniapp稳定关于button组件部分说明
|
||||
// https://uniapp.dcloud.io/component/button
|
||||
openType: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.openType
|
||||
},
|
||||
// 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
|
||||
// 取值为submit(提交表单),reset(重置表单)
|
||||
formType: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.formType
|
||||
},
|
||||
// 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
|
||||
// 只微信小程序、QQ小程序有效
|
||||
appParameter: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.appParameter
|
||||
},
|
||||
// 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
|
||||
hoverStopPropagation: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.hoverStopPropagation
|
||||
},
|
||||
// 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
|
||||
lang: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.lang
|
||||
},
|
||||
// 会话来源,open-type="contact"时有效。只微信小程序有效
|
||||
sessionFrom: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.sessionFrom
|
||||
},
|
||||
// 会话内消息卡片标题,open-type="contact"时有效
|
||||
// 默认当前标题,只微信小程序有效
|
||||
sendMessageTitle: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.sendMessageTitle
|
||||
},
|
||||
// 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
|
||||
// 默认当前分享路径,只微信小程序有效
|
||||
sendMessagePath: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.sendMessagePath
|
||||
},
|
||||
// 会话内消息卡片图片,open-type="contact"时有效
|
||||
// 默认当前页面截图,只微信小程序有效
|
||||
sendMessageImg: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.sendMessageImg
|
||||
},
|
||||
// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
|
||||
// 用户点击后可以快速发送小程序消息,open-type="contact"时有效
|
||||
showMessageCard: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.showMessageCard
|
||||
},
|
||||
// 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
||||
dataName: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.dataName
|
||||
},
|
||||
// 节流,一定时间内只能触发一次
|
||||
throttleTime: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.throttleTime
|
||||
},
|
||||
// 按住后多久出现点击态,单位毫秒
|
||||
hoverStartTime: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.hoverStartTime
|
||||
},
|
||||
// 手指松开后点击态保留时间,单位毫秒
|
||||
hoverStayTime: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.hoverStayTime
|
||||
},
|
||||
// 按钮文字,之所以通过props传入,是因为slot传入的话
|
||||
// nvue中无法控制文字的样式
|
||||
text: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.text
|
||||
},
|
||||
// 按钮图标
|
||||
icon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.icon
|
||||
},
|
||||
// 按钮图标
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.icon
|
||||
},
|
||||
// 按钮颜色,支持传入linear-gradient渐变色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.color
|
||||
},
|
||||
// 停止冒泡
|
||||
stop: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.button.stop
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,208 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_mixin_button = require("../../libs/mixin/button.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_openType = require("../../libs/mixin/openType.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_components_uButton_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_libs_function_throttle = require("../../libs/function/throttle.js");
|
||||
const uni_modules_uviewPlus_libs_config_color = require("../../libs/config/color.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-button",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_libs_mixin_button.buttonMixin, uni_modules_uviewPlus_libs_mixin_openType.openType, uni_modules_uviewPlus_components_uButton_props.props],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
// 生成bem风格的类名
|
||||
bemClass() {
|
||||
if (!this.color) {
|
||||
return this.bem(
|
||||
"button",
|
||||
["type", "shape", "size"],
|
||||
["disabled", "plain", "hairline"]
|
||||
);
|
||||
} else {
|
||||
return this.bem(
|
||||
"button",
|
||||
["shape", "size"],
|
||||
["disabled", "plain", "hairline"]
|
||||
);
|
||||
}
|
||||
},
|
||||
loadingColor() {
|
||||
if (this.plain) {
|
||||
return this.color ? this.color : uni_modules_uviewPlus_libs_config_color.color[`u-${this.type}`];
|
||||
}
|
||||
if (this.type === "info") {
|
||||
return "#c9c9c9";
|
||||
}
|
||||
return "rgb(200, 200, 200)";
|
||||
},
|
||||
iconColorCom() {
|
||||
if (this.iconColor)
|
||||
return this.iconColor;
|
||||
if (this.plain) {
|
||||
return this.color ? this.color : this.type;
|
||||
} else {
|
||||
return this.type === "info" ? "#000000" : "#ffffff";
|
||||
}
|
||||
},
|
||||
baseColor() {
|
||||
let style = {};
|
||||
if (this.color) {
|
||||
style.color = this.plain ? this.color : "white";
|
||||
if (!this.plain) {
|
||||
style["background-color"] = this.color;
|
||||
}
|
||||
if (this.color.indexOf("gradient") !== -1) {
|
||||
style.borderTopWidth = 0;
|
||||
style.borderRightWidth = 0;
|
||||
style.borderBottomWidth = 0;
|
||||
style.borderLeftWidth = 0;
|
||||
if (!this.plain) {
|
||||
style.backgroundImage = this.color;
|
||||
}
|
||||
} else {
|
||||
style.borderColor = this.color;
|
||||
style.borderWidth = "1px";
|
||||
style.borderStyle = "solid";
|
||||
}
|
||||
}
|
||||
return style;
|
||||
},
|
||||
// nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
|
||||
nvueTextStyle() {
|
||||
let style = {};
|
||||
if (this.type === "info") {
|
||||
style.color = "#323233";
|
||||
}
|
||||
if (this.color) {
|
||||
style.color = this.plain ? this.color : "white";
|
||||
}
|
||||
style.fontSize = this.textSize + "px";
|
||||
return style;
|
||||
},
|
||||
// 字体大小
|
||||
textSize() {
|
||||
let fontSize = 14, { size } = this;
|
||||
if (size === "large")
|
||||
fontSize = 16;
|
||||
if (size === "normal")
|
||||
fontSize = 14;
|
||||
if (size === "small")
|
||||
fontSize = 12;
|
||||
if (size === "mini")
|
||||
fontSize = 10;
|
||||
return fontSize;
|
||||
}
|
||||
},
|
||||
emits: [
|
||||
"click",
|
||||
"getphonenumber",
|
||||
"getuserinfo",
|
||||
"error",
|
||||
"opensetting",
|
||||
"launchapp",
|
||||
"agreeprivacyauthorization"
|
||||
],
|
||||
methods: {
|
||||
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
|
||||
clickHandler(e) {
|
||||
if (!this.disabled && !this.loading) {
|
||||
uni_modules_uviewPlus_libs_function_throttle.throttle(() => {
|
||||
this.$emit("click", e);
|
||||
}, this.throttleTime);
|
||||
}
|
||||
this.stop && this.preventEvent(e);
|
||||
},
|
||||
// 下面为对接uniapp官方按钮开放能力事件回调的对接
|
||||
getphonenumber(res) {
|
||||
this.$emit("getphonenumber", res);
|
||||
},
|
||||
getuserinfo(res) {
|
||||
this.$emit("getuserinfo", res);
|
||||
},
|
||||
error(res) {
|
||||
this.$emit("error", res);
|
||||
},
|
||||
opensetting(res) {
|
||||
this.$emit("opensetting", res);
|
||||
},
|
||||
launchapp(res) {
|
||||
this.$emit("launchapp", res);
|
||||
},
|
||||
agreeprivacyauthorization(res) {
|
||||
this.$emit("agreeprivacyauthorization", res);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
|
||||
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
||||
(_easycom_u_loading_icon2 + _easycom_up_icon2)();
|
||||
}
|
||||
const _easycom_u_loading_icon = () => "../u-loading-icon/u-loading-icon.js";
|
||||
const _easycom_up_icon = () => "../u-icon/u-icon.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_loading_icon + _easycom_up_icon)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.loading
|
||||
}, _ctx.loading ? {
|
||||
b: common_vendor.p({
|
||||
mode: _ctx.loadingMode,
|
||||
size: _ctx.loadingSize * 1.15,
|
||||
color: $options.loadingColor
|
||||
}),
|
||||
c: common_vendor.t(_ctx.loadingText || _ctx.text),
|
||||
d: common_vendor.s({
|
||||
fontSize: $options.textSize + "px"
|
||||
})
|
||||
} : common_vendor.e({
|
||||
e: _ctx.icon
|
||||
}, _ctx.icon ? {
|
||||
f: common_vendor.p({
|
||||
name: _ctx.icon,
|
||||
color: $options.iconColorCom,
|
||||
size: $options.textSize * 1.35,
|
||||
customStyle: {
|
||||
marginRight: "2px"
|
||||
}
|
||||
})
|
||||
} : {}, {
|
||||
g: common_vendor.t(_ctx.text),
|
||||
h: common_vendor.s({
|
||||
fontSize: $options.textSize + "px"
|
||||
})
|
||||
}), {
|
||||
i: Number(_ctx.hoverStartTime),
|
||||
j: Number(_ctx.hoverStayTime),
|
||||
k: _ctx.formType,
|
||||
l: _ctx.openType,
|
||||
m: _ctx.appParameter,
|
||||
n: _ctx.hoverStopPropagation,
|
||||
o: _ctx.sendMessageTitle,
|
||||
p: _ctx.sendMessagePath,
|
||||
q: _ctx.lang,
|
||||
r: _ctx.dataName,
|
||||
s: _ctx.sessionFrom,
|
||||
t: _ctx.sendMessageImg,
|
||||
v: _ctx.showMessageCard,
|
||||
w: common_vendor.o((...args) => $options.getphonenumber && $options.getphonenumber(...args)),
|
||||
x: common_vendor.o((...args) => $options.getuserinfo && $options.getuserinfo(...args)),
|
||||
y: common_vendor.o((...args) => $options.error && $options.error(...args)),
|
||||
z: common_vendor.o((...args) => $options.opensetting && $options.opensetting(...args)),
|
||||
A: common_vendor.o((...args) => $options.launchapp && $options.launchapp(...args)),
|
||||
B: common_vendor.o((...args) => $options.agreeprivacyauthorization && $options.agreeprivacyauthorization(...args)),
|
||||
C: !_ctx.disabled && !_ctx.loading ? "u-button--active" : "",
|
||||
D: common_vendor.s($options.baseColor),
|
||||
E: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
F: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
|
||||
G: common_vendor.n($options.bemClass)
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5ce41ee6"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-loading-icon": "../u-loading-icon/u-loading-icon",
|
||||
"up-icon": "../u-icon/u-icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<button hover-start-time="{{i}}" hover-stay-time="{{j}}" form-type="{{k}}" open-type="{{l}}" app-parameter="{{m}}" hover-stop-propagation="{{n}}" send-message-title="{{o}}" send-message-path="{{p}}" lang="{{q}}" data-name="{{r}}" session-from="{{s}}" send-message-img="{{t}}" show-message-card="{{v}}" bindgetphonenumber="{{w}}" bindgetuserinfo="{{x}}" binderror="{{y}}" bindopensetting="{{z}}" bindlaunchapp="{{A}}" bindagreeprivacyauthorization="{{B}}" hover-class="{{C}}" style="{{D + ';' + E + ';' + virtualHostStyle}}" bindtap="{{F}}" class="{{['u-button', 'u-reset-button', 'data-v-5ce41ee6', G, virtualHostClass]}}"><block wx:if="{{a}}"><u-loading-icon wx:if="{{b}}" class="data-v-5ce41ee6" virtualHostClass="data-v-5ce41ee6" u-i="5ce41ee6-0" bind:__l="__l" u-p="{{b}}"></u-loading-icon><text class="u-button__loading-text data-v-5ce41ee6" style="{{d}}">{{c}}</text></block><block wx:else><up-icon wx:if="{{e}}" class="data-v-5ce41ee6" virtualHostClass="data-v-5ce41ee6" u-i="5ce41ee6-1" bind:__l="__l" u-p="{{f}}"></up-icon><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><text class="u-button__text data-v-5ce41ee6" style="{{h}}">{{g}}</text></block></block></button>
|
||||
@@ -1,173 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-button.data-v-5ce41ee6 {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.u-button__text.data-v-5ce41ee6 {
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
}
|
||||
.u-button.data-v-5ce41ee6:before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: inherit;
|
||||
border-radius: inherit;
|
||||
transform: translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
content: " ";
|
||||
background-color: #000;
|
||||
border-color: #000;
|
||||
}
|
||||
.u-button--active.data-v-5ce41ee6:before {
|
||||
opacity: 0.15;
|
||||
}
|
||||
.u-button__icon + .u-button__text.data-v-5ce41ee6:not(:empty), .u-button__loading-text.data-v-5ce41ee6 {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.u-button--plain.u-button--primary.data-v-5ce41ee6 {
|
||||
color: #3c9cff;
|
||||
}
|
||||
.u-button--plain.u-button--info.data-v-5ce41ee6 {
|
||||
color: #909399;
|
||||
}
|
||||
.u-button--plain.u-button--success.data-v-5ce41ee6 {
|
||||
color: #5ac725;
|
||||
}
|
||||
.u-button--plain.u-button--error.data-v-5ce41ee6 {
|
||||
color: #f56c6c;
|
||||
}
|
||||
.u-button--plain.u-button--warning.data-v-5ce41ee6 {
|
||||
color: #f9ae3d;
|
||||
}
|
||||
.u-button.data-v-5ce41ee6 {
|
||||
height: 40px;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
flex-direction: row;
|
||||
}
|
||||
.u-button__text.data-v-5ce41ee6 {
|
||||
font-size: 15px;
|
||||
}
|
||||
.u-button__loading-text.data-v-5ce41ee6 {
|
||||
font-size: 15px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.u-button--large.data-v-5ce41ee6 {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
.u-button--normal.data-v-5ce41ee6 {
|
||||
padding: 0 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.u-button--small.data-v-5ce41ee6 {
|
||||
min-width: 60px;
|
||||
height: 30px;
|
||||
padding: 0px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.u-button--mini.data-v-5ce41ee6 {
|
||||
height: 22px;
|
||||
font-size: 10px;
|
||||
min-width: 50px;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
.u-button--disabled.data-v-5ce41ee6 {
|
||||
opacity: 0.5;
|
||||
}
|
||||
.u-button--info.data-v-5ce41ee6 {
|
||||
color: #323233;
|
||||
background-color: #fff;
|
||||
border-color: #ebedf0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.u-button--success.data-v-5ce41ee6 {
|
||||
color: #fff;
|
||||
background-color: #5ac725;
|
||||
border-color: #5ac725;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.u-button--primary.data-v-5ce41ee6 {
|
||||
color: #fff;
|
||||
background-color: #3c9cff;
|
||||
border-color: #3c9cff;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.u-button--error.data-v-5ce41ee6 {
|
||||
color: #fff;
|
||||
background-color: #f56c6c;
|
||||
border-color: #f56c6c;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.u-button--warning.data-v-5ce41ee6 {
|
||||
color: #fff;
|
||||
background-color: #f9ae3d;
|
||||
border-color: #f9ae3d;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
.u-button--block.data-v-5ce41ee6 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
.u-button--circle.data-v-5ce41ee6 {
|
||||
border-top-right-radius: 100px;
|
||||
border-top-left-radius: 100px;
|
||||
border-bottom-left-radius: 100px;
|
||||
border-bottom-right-radius: 100px;
|
||||
}
|
||||
.u-button--square.data-v-5ce41ee6 {
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
.u-button__icon.data-v-5ce41ee6 {
|
||||
min-width: 1em;
|
||||
line-height: inherit !important;
|
||||
vertical-align: top;
|
||||
}
|
||||
.u-button--plain.data-v-5ce41ee6 {
|
||||
background-color: #fff;
|
||||
}
|
||||
.u-button--hairline.data-v-5ce41ee6 {
|
||||
border-width: 0.5px !important;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_i18n_index = require("../../libs/i18n/index.js");
|
||||
const Calendar = {
|
||||
// calendar 组件
|
||||
calendar: {
|
||||
title: uni_modules_uviewPlus_libs_i18n_index.t("up.calendar.chooseDates"),
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
mode: "single",
|
||||
startText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.start"),
|
||||
endText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.end"),
|
||||
customList: [],
|
||||
color: "#3c9cff",
|
||||
minDate: 0,
|
||||
maxDate: 0,
|
||||
defaultDate: null,
|
||||
maxCount: Number.MAX_SAFE_INTEGER,
|
||||
// Infinity
|
||||
rowHeight: 56,
|
||||
formatter: null,
|
||||
showLunar: false,
|
||||
showMark: true,
|
||||
confirmText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.confirm"),
|
||||
confirmDisabledText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.confirm"),
|
||||
show: false,
|
||||
closeOnClickOverlay: false,
|
||||
readonly: false,
|
||||
showConfirm: true,
|
||||
maxRange: Number.MAX_SAFE_INTEGER,
|
||||
// Infinity
|
||||
rangePrompt: "",
|
||||
showRangePrompt: true,
|
||||
allowSameDay: false,
|
||||
round: 0,
|
||||
monthNum: 3,
|
||||
weekText: [uni_modules_uviewPlus_libs_i18n_index.t("up.week.one"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.two"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.three"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.four"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.five"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.six"), uni_modules_uviewPlus_libs_i18n_index.t("up.week.seven")],
|
||||
forbidDays: [],
|
||||
forbidDaysToast: uni_modules_uviewPlus_libs_i18n_index.t("up.calendar.disabled"),
|
||||
monthFormat: "",
|
||||
pageInline: false
|
||||
}
|
||||
};
|
||||
exports.Calendar = Calendar;
|
||||
@@ -1,65 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-calendar-header",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin],
|
||||
props: {
|
||||
// 标题
|
||||
title: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 副标题
|
||||
subtitle: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 是否显示标题
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否显示副标题
|
||||
showSubtitle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 星期文本
|
||||
weekText: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
name() {
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.showTitle
|
||||
}, $props.showTitle ? {
|
||||
b: common_vendor.t($props.title)
|
||||
} : {}, {
|
||||
c: $props.showSubtitle
|
||||
}, $props.showSubtitle ? {
|
||||
d: common_vendor.t($props.subtitle)
|
||||
} : {}, {
|
||||
e: common_vendor.t($props.weekText[0]),
|
||||
f: common_vendor.t($props.weekText[1]),
|
||||
g: common_vendor.t($props.weekText[2]),
|
||||
h: common_vendor.t($props.weekText[3]),
|
||||
i: common_vendor.t($props.weekText[4]),
|
||||
j: common_vendor.t($props.weekText[5]),
|
||||
k: common_vendor.t($props.weekText[6])
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7f0f7602"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-calendar-header', 'u-border-bottom', 'data-v-7f0f7602', virtualHostClass]}}" style="{{virtualHostStyle}}"><text wx:if="{{a}}" class="u-calendar-header__title data-v-7f0f7602">{{b}}</text><text wx:if="{{c}}" class="u-calendar-header__subtitle data-v-7f0f7602">{{d}}</text><view class="u-calendar-header__weekdays data-v-7f0f7602"><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{e}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{f}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{g}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{h}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{i}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{j}}</text><text class="u-calendar-header__weekdays__weekday data-v-7f0f7602">{{k}}</text></view></view>
|
||||
@@ -1,59 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-calendar-header.data-v-7f0f7602 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
.u-calendar-header__title.data-v-7f0f7602 {
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
text-align: center;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.u-calendar-header__subtitle.data-v-7f0f7602 {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.u-calendar-header__weekdays.data-v-7f0f7602 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.u-calendar-header__weekdays__weekday.data-v-7f0f7602 {
|
||||
font-size: 13px;
|
||||
color: #303133;
|
||||
line-height: 30px;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1,435 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_libs_function_colorGradient = require("../../libs/function/colorGradient.js");
|
||||
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min = require("../u-datetime-picker/dayjs.esm.min.js");
|
||||
const uni_modules_uviewPlus_libs_i18n_index = require("../../libs/i18n/index.js");
|
||||
const _sfc_main = {
|
||||
name: "u-calendar-month",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.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: () => uni_modules_uviewPlus_libs_config_props.props.calendar.readonly
|
||||
},
|
||||
// 日期区间最多可选天数,默认无限制,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
|
||||
},
|
||||
forbidDays: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
forbidDaysToast: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
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 = uni_modules_uviewPlus_libs_function_index.addUnit(this.rowHeight, "px");
|
||||
if (index22 === 0) {
|
||||
week = (week === 0 ? 7 : week) - 1;
|
||||
style.marginLeft = uni_modules_uviewPlus_libs_function_index.addUnit(week * dayWidth, "px");
|
||||
}
|
||||
if (this.mode === "range") {
|
||||
style.paddingLeft = 0;
|
||||
style.paddingRight = 0;
|
||||
style.paddingBottom = 0;
|
||||
style.paddingTop = 0;
|
||||
}
|
||||
return style;
|
||||
};
|
||||
},
|
||||
daySelectStyle() {
|
||||
return (index1, index2, item) => {
|
||||
let date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item.date).format("YYYY-MM-DD"), style = {};
|
||||
if (this.selected.some((item2) => this.dateSame(item2, date))) {
|
||||
style.backgroundColor = this.color;
|
||||
}
|
||||
if (this.mode === "single") {
|
||||
if (date === 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(date, this.selected[0])) {
|
||||
style.borderTopLeftRadius = "3px";
|
||||
style.borderBottomLeftRadius = "3px";
|
||||
}
|
||||
if (this.dateSame(date, this.selected[len])) {
|
||||
style.borderTopRightRadius = "3px";
|
||||
style.borderBottomRightRadius = "3px";
|
||||
}
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isAfter(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.selected[0])) && uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isBefore(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.selected[len]))) {
|
||||
style.backgroundColor = uni_modules_uviewPlus_libs_function_colorGradient.colorGradient$1(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, date))) {
|
||||
style.borderTopLeftRadius = "3px";
|
||||
style.borderBottomLeftRadius = "3px";
|
||||
style.borderTopRightRadius = "3px";
|
||||
style.borderBottomRightRadius = "3px";
|
||||
}
|
||||
}
|
||||
return style;
|
||||
};
|
||||
},
|
||||
// 某个日期是否被选中
|
||||
textStyle() {
|
||||
return (item) => {
|
||||
const date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item.date).format("YYYY-MM-DD"), style = {};
|
||||
if (this.selected.some((item2) => this.dateSame(item2, date))) {
|
||||
style.color = "#ffffff";
|
||||
}
|
||||
if (this.mode === "range") {
|
||||
const len = this.selected.length - 1;
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isAfter(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.selected[0])) && uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isBefore(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.selected[len]))) {
|
||||
style.color = this.color;
|
||||
}
|
||||
}
|
||||
return style;
|
||||
};
|
||||
},
|
||||
// 获取底部的提示文字
|
||||
getBottomInfo() {
|
||||
return (index1, index2, item) => {
|
||||
const date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(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(date, this.selected[0]))
|
||||
return this.startText;
|
||||
else
|
||||
return bottomInfo;
|
||||
} else {
|
||||
const len = this.selected.length - 1;
|
||||
if (this.dateSame(date, this.selected[0]) && this.dateSame(date, this.selected[1]) && len === 1) {
|
||||
return `${this.startText}/${this.endText}`;
|
||||
} else if (this.dateSame(date, this.selected[0])) {
|
||||
return this.startText;
|
||||
} else if (this.dateSame(date, this.selected[len])) {
|
||||
return this.endText;
|
||||
} else {
|
||||
return bottomInfo;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return bottomInfo;
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
emits: ["monthSelected", "updateMonthTop"],
|
||||
methods: {
|
||||
init() {
|
||||
this.$emit("monthSelected", this.selected);
|
||||
this.$nextTick(() => {
|
||||
uni_modules_uviewPlus_libs_function_index.sleep(10).then(() => {
|
||||
this.getWrapperWidth();
|
||||
this.getMonthRect();
|
||||
});
|
||||
});
|
||||
},
|
||||
monthTitle(item) {
|
||||
if (common_vendor.index.getLocale() == "zh-Hans" || common_vendor.index.getLocale() == "zh-Hant") {
|
||||
return item.year + "年" + (item.month < 10 ? "0" + item.month : item.month) + "月";
|
||||
} else {
|
||||
return (item.month < 10 ? "0" + item.month : item.month) + "/" + item.year;
|
||||
}
|
||||
},
|
||||
isForbid(item) {
|
||||
let date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item.date).format("YYYY-MM-DD");
|
||||
if (this.mode !== "range" && this.forbidDays.includes(date)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// 判断两个日期是否相等
|
||||
dateSame(date1, date2) {
|
||||
return uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date1).isSame(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date2));
|
||||
},
|
||||
// 获取月份数据区域的宽度,因为nvue不支持百分比,所以无法通过css设置每个日期item的宽度
|
||||
getWrapperWidth() {
|
||||
this.$uGetRect(".u-calendar-month-wrapper").then((size) => {
|
||||
this.width = size.width;
|
||||
});
|
||||
},
|
||||
getMonthRect() {
|
||||
const promiseAllArr = this.months.map((item, index) => this.getMonthRectByPromise(
|
||||
`u-calendar-month-${index}`
|
||||
));
|
||||
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.$uGetRect(`.${el}`).then((size) => {
|
||||
resolve(size);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 点击某一个日期
|
||||
clickHandler(index1, index2, item) {
|
||||
if (this.readonly) {
|
||||
return;
|
||||
}
|
||||
this.item = item;
|
||||
const date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item.date).format("YYYY-MM-DD");
|
||||
if (item.disabled)
|
||||
return;
|
||||
if (this.isForbid(item)) {
|
||||
common_vendor.index.showToast({
|
||||
title: this.forbidDaysToast
|
||||
});
|
||||
return;
|
||||
}
|
||||
let selected = uni_modules_uviewPlus_libs_function_index.deepClone(this.selected);
|
||||
if (this.mode === "single") {
|
||||
selected = [date];
|
||||
} else if (this.mode === "multiple") {
|
||||
if (selected.some((item2) => this.dateSame(item2, date))) {
|
||||
const itemIndex = selected.findIndex((item2) => item2 === date);
|
||||
selected.splice(itemIndex, 1);
|
||||
} else {
|
||||
if (selected.length < this.maxCount)
|
||||
selected.push(date);
|
||||
}
|
||||
} else {
|
||||
if (selected.length === 0 || selected.length >= 2) {
|
||||
selected = [date];
|
||||
} else if (selected.length === 1) {
|
||||
const existsDate = selected[0];
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isBefore(existsDate)) {
|
||||
selected = [date];
|
||||
} else if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isAfter(existsDate)) {
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).subtract(this.maxRange, "day")).isAfter(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(selected[0])) && this.showRangePrompt) {
|
||||
if (this.rangePrompt) {
|
||||
uni_modules_uviewPlus_libs_function_index.toast(this.rangePrompt);
|
||||
} else {
|
||||
uni_modules_uviewPlus_libs_function_index.toast(uni_modules_uviewPlus_libs_i18n_index.t("up.calendar.daysExceed", { days: this.maxRange }));
|
||||
}
|
||||
return;
|
||||
}
|
||||
selected.push(date);
|
||||
const startDate = selected[0];
|
||||
const endDate = selected[1];
|
||||
const arr = [];
|
||||
let i = 0;
|
||||
do {
|
||||
arr.push(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(startDate).add(i, "day").format("YYYY-MM-DD"));
|
||||
i++;
|
||||
} while (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(startDate).add(i, "day").isBefore(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(endDate)));
|
||||
arr.push(endDate);
|
||||
selected = arr;
|
||||
} else {
|
||||
if (selected[0] === date && !this.allowSameDay)
|
||||
return;
|
||||
selected.push(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setSelected(selected);
|
||||
},
|
||||
// 设置默认日期
|
||||
setDefaultDate() {
|
||||
if (!this.defaultDate) {
|
||||
const selected = [uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e().format("YYYY-MM-DD")];
|
||||
return this.setSelected(selected, false);
|
||||
}
|
||||
let defaultDate = [];
|
||||
const minDate = this.minDate || uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e().format("YYYY-MM-DD");
|
||||
const maxDate = this.maxDate || uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(this.maxMonth - 1, "month").format("YYYY-MM-DD");
|
||||
if (this.mode === "single") {
|
||||
if (!uni_modules_uviewPlus_libs_function_test.test.array(this.defaultDate)) {
|
||||
defaultDate = [uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.defaultDate).format("YYYY-MM-DD")];
|
||||
} else {
|
||||
defaultDate = [this.defaultDate[0]];
|
||||
}
|
||||
} else {
|
||||
if (!uni_modules_uviewPlus_libs_function_test.test.array(this.defaultDate))
|
||||
return;
|
||||
defaultDate = this.defaultDate;
|
||||
}
|
||||
defaultDate = defaultDate.filter((item) => {
|
||||
return uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item).isAfter(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).subtract(1, "day")) && uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(item).isBefore(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(
|
||||
maxDate
|
||||
).add(1, "day"));
|
||||
});
|
||||
this.setSelected(defaultDate, false);
|
||||
},
|
||||
setSelected(selected, event = true) {
|
||||
this.selected = selected;
|
||||
event && this.$emit("monthSelected", this.selected, "tap");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($props.months, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: index !== 0
|
||||
}, index !== 0 ? {
|
||||
b: common_vendor.t($options.monthTitle(item))
|
||||
} : {}, $props.showMark ? {
|
||||
c: common_vendor.t(item.month)
|
||||
} : {}, {
|
||||
d: common_vendor.f(item.date, (item1, index1, i1) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item1.day),
|
||||
b: common_vendor.n(item1.disabled || $options.isForbid(item1) ? "u-calendar-month__days__day__select__info--disabled" : ""),
|
||||
c: common_vendor.s($options.textStyle(item1)),
|
||||
d: $options.getBottomInfo(index, index1, item1)
|
||||
}, $options.getBottomInfo(index, index1, item1) ? {
|
||||
e: common_vendor.t($options.getBottomInfo(index, index1, item1)),
|
||||
f: common_vendor.n(item1.disabled || $options.isForbid(item1) ? "u-calendar-month__days__day__select__buttom-info--disabled" : ""),
|
||||
g: common_vendor.s($options.textStyle(item1))
|
||||
} : {}, {
|
||||
h: item1.dot
|
||||
}, item1.dot ? {} : {}, {
|
||||
i: common_vendor.s($options.daySelectStyle(index, index1, item1)),
|
||||
j: index1,
|
||||
k: common_vendor.s($options.dayStyle(index, index1, item1)),
|
||||
l: common_vendor.o(($event) => $options.clickHandler(index, index1, item1), index1),
|
||||
m: common_vendor.n(item1.selected && "u-calendar-month__days__day__select--selected")
|
||||
});
|
||||
}),
|
||||
e: index,
|
||||
f: common_vendor.n(`u-calendar-month-${index}`),
|
||||
g: `u-calendar-month-${index}`,
|
||||
h: `month-${index}`
|
||||
});
|
||||
}),
|
||||
b: $props.showMark
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3c847935"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view ref="u-calendar-month-wrapper" class="{{['u-calendar-month-wrapper', 'data-v-3c847935', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="e" class="{{['data-v-3c847935', item.f]}}" ref="{{item.g}}" id="{{item.h}}"><text wx:if="{{item.a}}" class="u-calendar-month__title data-v-3c847935">{{item.b}}</text><view class="u-calendar-month__days data-v-3c847935"><view wx:if="{{b}}" class="u-calendar-month__days__month-mark-wrapper data-v-3c847935"><text class="u-calendar-month__days__month-mark-wrapper__text data-v-3c847935">{{item.c}}</text></view><view wx:for="{{item.d}}" wx:for-item="item1" wx:key="j" style="{{item1.k}}" bindtap="{{item1.l}}" class="{{['u-calendar-month__days__day', 'data-v-3c847935', item1.m]}}"><view class="u-calendar-month__days__day__select data-v-3c847935" style="{{item1.i}}"><text class="{{['u-calendar-month__days__day__select__info', 'data-v-3c847935', item1.b]}}" style="{{item1.c}}">{{item1.a}}</text><text wx:if="{{item1.d}}" class="{{['u-calendar-month__days__day__select__buttom-info', 'data-v-3c847935', item1.f]}}" style="{{item1.g}}">{{item1.e}}</text><text wx:if="{{item1.h}}" class="u-calendar-month__days__day__select__dot data-v-3c847935"></text></view></view></view></view></view>
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-calendar-month-wrapper.data-v-3c847935 {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.u-calendar-month__title.data-v-3c847935 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 14px;
|
||||
line-height: 42px;
|
||||
height: 42px;
|
||||
color: #303133;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.u-calendar-month__days.data-v-3c847935 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.u-calendar-month__days__month-mark-wrapper.data-v-3c847935 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.u-calendar-month__days__month-mark-wrapper__text.data-v-3c847935 {
|
||||
font-size: 155px;
|
||||
color: rgba(231, 232, 234, 0.83);
|
||||
}
|
||||
.u-calendar-month__days__day.data-v-3c847935 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 2px;
|
||||
width: 14.2857142857%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.u-calendar-month__days__day__select.data-v-3c847935 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
.u-calendar-month__days__day__select__dot.data-v-3c847935 {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 100px;
|
||||
background-color: #f56c6c;
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 7px;
|
||||
}
|
||||
.u-calendar-month__days__day__select__buttom-info.data-v-3c847935 {
|
||||
color: #606266;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.u-calendar-month__days__day__select__buttom-info--selected.data-v-3c847935 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.u-calendar-month__days__day__select__buttom-info--disabled.data-v-3c847935 {
|
||||
color: #cacbcd;
|
||||
}
|
||||
.u-calendar-month__days__day__select__info.data-v-3c847935 {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
.u-calendar-month__days__day__select__info--selected.data-v-3c847935 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.u-calendar-month__days__day__select__info--disabled.data-v-3c847935 {
|
||||
color: #cacbcd;
|
||||
}
|
||||
.u-calendar-month__days__day__select--selected.data-v-3c847935 {
|
||||
background-color: #3c9cff;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.u-calendar-month__days__day__select--range-selected.data-v-3c847935 {
|
||||
opacity: 0.3;
|
||||
border-radius: 0;
|
||||
}
|
||||
.u-calendar-month__days__day__select--range-start-selected.data-v-3c847935 {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.u-calendar-month__days__day__select--range-end-selected.data-v-3c847935 {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 日历顶部标题
|
||||
title: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.title
|
||||
},
|
||||
// 是否显示标题
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showTitle
|
||||
},
|
||||
// 是否显示副标题
|
||||
showSubtitle: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showSubtitle
|
||||
},
|
||||
// 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围
|
||||
mode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.mode
|
||||
},
|
||||
// mode=range时,第一个日期底部的提示文字
|
||||
startText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.startText
|
||||
},
|
||||
// mode=range时,最后一个日期底部的提示文字
|
||||
endText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.endText
|
||||
},
|
||||
// 自定义列表
|
||||
customList: {
|
||||
type: Array,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.customList
|
||||
},
|
||||
// 主题色,对底部按钮和选中日期有效
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.color
|
||||
},
|
||||
// 最小的可选日期
|
||||
minDate: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.minDate
|
||||
},
|
||||
// 最大可选日期
|
||||
maxDate: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.maxDate
|
||||
},
|
||||
// 默认选中的日期,mode为multiple或range是必须为数组格式
|
||||
defaultDate: {
|
||||
type: [Array, String, Date, null],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.defaultDate
|
||||
},
|
||||
// mode=multiple时,最多可选多少个日期
|
||||
maxCount: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.maxCount
|
||||
},
|
||||
// 日期行高
|
||||
rowHeight: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.rowHeight
|
||||
},
|
||||
// 日期格式化函数
|
||||
formatter: {
|
||||
type: [Function, null],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.formatter
|
||||
},
|
||||
// 是否显示农历
|
||||
showLunar: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showLunar
|
||||
},
|
||||
// 是否显示月份背景色
|
||||
showMark: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showMark
|
||||
},
|
||||
// 确定按钮的文字
|
||||
confirmText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.confirmText
|
||||
},
|
||||
// 确认按钮处于禁用状态时的文字
|
||||
confirmDisabledText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.confirmDisabledText
|
||||
},
|
||||
// 是否显示日历弹窗
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.show
|
||||
},
|
||||
// 是否允许点击遮罩关闭日历
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.closeOnClickOverlay
|
||||
},
|
||||
// 是否为只读状态,只读状态下禁止选择日期
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.readonly
|
||||
},
|
||||
// 是否展示确认按钮
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showConfirm
|
||||
},
|
||||
// 日期区间最多可选天数,默认无限制,mode = range时有效
|
||||
maxRange: {
|
||||
type: [Number, String],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.maxRange
|
||||
},
|
||||
// 范围选择超过最多可选天数时的提示文案,mode = range时有效
|
||||
rangePrompt: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.rangePrompt
|
||||
},
|
||||
// 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
|
||||
showRangePrompt: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.showRangePrompt
|
||||
},
|
||||
// 是否允许日期范围的起止时间为同一天,mode = range时有效
|
||||
allowSameDay: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.allowSameDay
|
||||
},
|
||||
// 圆角值
|
||||
round: {
|
||||
type: [Boolean, String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.calendar.round
|
||||
},
|
||||
// 最多展示月份数量
|
||||
monthNum: {
|
||||
type: [Number, String],
|
||||
default: 3
|
||||
},
|
||||
// 星期文案
|
||||
weekText: {
|
||||
type: Array,
|
||||
default: uni_modules_uviewPlus_libs_config_props.props.calendar.weekText
|
||||
},
|
||||
forbidDays: {
|
||||
type: Array,
|
||||
default: uni_modules_uviewPlus_libs_config_props.props.calendar.forbidDays
|
||||
},
|
||||
forbidDaysToast: {
|
||||
type: String,
|
||||
default: uni_modules_uviewPlus_libs_config_props.props.calendar.forbidDaysToast
|
||||
},
|
||||
monthFormat: {
|
||||
type: String,
|
||||
default: uni_modules_uviewPlus_libs_config_props.props.calendar.monthFormat
|
||||
},
|
||||
// 是否页面内展示
|
||||
pageInline: {
|
||||
type: Boolean,
|
||||
default: uni_modules_uviewPlus_libs_config_props.props.calendar.pageInline
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,317 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uviewPlus_components_uCalendar_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min = require("../u-datetime-picker/dayjs.esm.min.js");
|
||||
const uni_modules_uviewPlus_libs_util_calendar = require("../../libs/util/calendar.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
|
||||
const uHeader = () => "./header.js";
|
||||
const uMonth = () => "./month.js";
|
||||
const _sfc_main = {
|
||||
name: "u-calendar",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCalendar_props.props],
|
||||
components: {
|
||||
uHeader,
|
||||
uMonth
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 需要显示的月份的数组
|
||||
months: [],
|
||||
// 在月份滚动区域中,当前视图中月份的index索引
|
||||
monthIndex: 0,
|
||||
// 月份滚动区域的高度
|
||||
listHeight: 0,
|
||||
// month组件中选择的日期数组
|
||||
selected: [],
|
||||
scrollIntoView: "",
|
||||
scrollIntoViewScroll: "",
|
||||
scrollTop: 0,
|
||||
// 过滤处理方法
|
||||
innerFormatter: (value) => value
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
scrollIntoView: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
}
|
||||
},
|
||||
selectedChange: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
this.setMonth();
|
||||
}
|
||||
},
|
||||
// 打开弹窗时,设置月份数据
|
||||
show: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
if (n) {
|
||||
this.setMonth();
|
||||
} else {
|
||||
this.scrollIntoView = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 由于maxDate和minDate可以为字符串(2021-10-10),或者数值(时间戳),但是dayjs如果接受字符串形式的时间戳会有问题,这里进行处理
|
||||
innerMaxDate() {
|
||||
return uni_modules_uviewPlus_libs_function_test.test.number(this.maxDate) ? Number(this.maxDate) : this.maxDate;
|
||||
},
|
||||
innerMinDate() {
|
||||
return uni_modules_uviewPlus_libs_function_test.test.number(this.minDate) ? Number(this.minDate) : this.minDate;
|
||||
},
|
||||
// 多个条件的变化,会引起选中日期的变化,这里统一管理监听
|
||||
selectedChange() {
|
||||
return [this.innerMinDate, this.innerMaxDate, this.defaultDate];
|
||||
},
|
||||
subtitle() {
|
||||
if (this.months.length) {
|
||||
if (common_vendor.index.getLocale() == "zh-Hans" || common_vendor.index.getLocale() == "zh-Hant") {
|
||||
return this.months[this.monthIndex].year + "年" + (this.months[this.monthIndex].month < 10 ? "0" + this.months[this.monthIndex].month : this.months[this.monthIndex].month) + "月";
|
||||
} else {
|
||||
return (this.months[this.monthIndex].month < 10 ? "0" + this.months[this.monthIndex].month : this.months[this.monthIndex].month) + "/" + this.months[this.monthIndex].year;
|
||||
}
|
||||
} 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();
|
||||
},
|
||||
emits: ["confirm", "close"],
|
||||
methods: {
|
||||
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
|
||||
// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
|
||||
setFormatter(e) {
|
||||
this.innerFormatter = e;
|
||||
},
|
||||
// month组件内部选择日期后,通过事件通知给父组件
|
||||
monthSelected(e, scene = "init") {
|
||||
this.selected = e;
|
||||
if (!this.showConfirm) {
|
||||
if (this.mode === "multiple" || this.mode === "single" || this.mode === "range" && this.selected.length >= 2) {
|
||||
if (scene === "init") {
|
||||
return;
|
||||
}
|
||||
if (scene === "tap") {
|
||||
this.$emit("confirm", this.selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
if (this.innerMaxDate && this.innerMinDate && new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()) {
|
||||
return uni_modules_uviewPlus_libs_function_index.error("maxDate不能小于minDate时间");
|
||||
}
|
||||
let bottomPadding = 0;
|
||||
if (this.pageInline) {
|
||||
bottomPadding = 0;
|
||||
} else {
|
||||
bottomPadding = 30;
|
||||
}
|
||||
this.listHeight = this.rowHeight * 5 + bottomPadding;
|
||||
this.setMonth();
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
// 点击确定按钮
|
||||
confirm() {
|
||||
if (!this.buttonDisabled) {
|
||||
this.$emit("confirm", this.selected);
|
||||
}
|
||||
},
|
||||
// 获得两个日期之间的月份数
|
||||
getMonths(minDate, maxDate) {
|
||||
const minYear = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).year();
|
||||
const minMonth = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).month() + 1;
|
||||
const maxYear = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(maxDate).year();
|
||||
const maxMonth = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(maxDate).month() + 1;
|
||||
return (maxYear - minYear) * 12 + (maxMonth - minMonth) + 1;
|
||||
},
|
||||
// 设置月份数据
|
||||
setMonth() {
|
||||
const minDate = this.innerMinDate || uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e().valueOf();
|
||||
const maxDate = this.innerMaxDate || uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(this.monthNum - 1, "month").valueOf();
|
||||
const months = uni_modules_uviewPlus_libs_function_index.range(
|
||||
1,
|
||||
this.monthNum,
|
||||
this.getMonths(minDate, maxDate)
|
||||
);
|
||||
this.months = [];
|
||||
for (let i = 0; i < months; i++) {
|
||||
this.months.push({
|
||||
date: new Array(
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").daysInMonth()
|
||||
).fill(1).map((item, index) => {
|
||||
let day = index + 1;
|
||||
const week = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").date(day).day();
|
||||
const date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").date(day).format("YYYY-MM-DD");
|
||||
let bottomInfo = "";
|
||||
if (this.showLunar) {
|
||||
const lunar = uni_modules_uviewPlus_libs_util_calendar.Calendar.solar2lunar(
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).year(),
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).month() + 1,
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).date()
|
||||
);
|
||||
bottomInfo = lunar.IDayCn;
|
||||
}
|
||||
let config = {
|
||||
day,
|
||||
week,
|
||||
// 小于最小允许的日期,或者大于最大的日期,则设置为disabled状态
|
||||
disabled: uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isBefore(
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).format("YYYY-MM-DD")
|
||||
) || uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(date).isAfter(
|
||||
uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(maxDate).format("YYYY-MM-DD")
|
||||
),
|
||||
// 返回一个日期对象,供外部的formatter获取当前日期的年月日等信息,进行加工处理
|
||||
date: new Date(date),
|
||||
bottomInfo,
|
||||
dot: false,
|
||||
month: uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").month() + 1
|
||||
};
|
||||
const formatter = this.formatter || this.innerFormatter;
|
||||
return formatter(config);
|
||||
}),
|
||||
// 当前所属的月份
|
||||
month: uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").month() + 1,
|
||||
// 当前年份
|
||||
year: uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(minDate).add(i, "month").year()
|
||||
});
|
||||
}
|
||||
},
|
||||
// 滚动到默认设置的月份
|
||||
scrollIntoDefaultMonth(selected) {
|
||||
const _index = this.months.findIndex(({
|
||||
year,
|
||||
month
|
||||
}) => {
|
||||
month = uni_modules_uviewPlus_libs_function_index.padZero(month);
|
||||
return `${year}-${month}` === selected;
|
||||
});
|
||||
if (_index !== -1) {
|
||||
this.scrollTop = this.months[_index].top || 0;
|
||||
}
|
||||
},
|
||||
// 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;
|
||||
this.scrollIntoViewScroll = `month-${i}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 更新月份的top值
|
||||
updateMonthTop(topArr = []) {
|
||||
topArr.map((item, index) => {
|
||||
this.months[index].top = item;
|
||||
});
|
||||
if (!this.defaultDate) {
|
||||
const selected2 = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e().format("YYYY-MM");
|
||||
this.scrollIntoDefaultMonth(selected2);
|
||||
return;
|
||||
}
|
||||
let selected = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e().format("YYYY-MM");
|
||||
if (!uni_modules_uviewPlus_libs_function_test.test.array(this.defaultDate)) {
|
||||
selected = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.defaultDate).format("YYYY-MM");
|
||||
} else {
|
||||
selected = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.defaultDate[0]).format("YYYY-MM");
|
||||
}
|
||||
this.scrollIntoDefaultMonth(selected);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_uHeader = common_vendor.resolveComponent("uHeader");
|
||||
const _component_uMonth = common_vendor.resolveComponent("uMonth");
|
||||
const _easycom_u_button2 = common_vendor.resolveComponent("u-button");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_component_uHeader + _component_uMonth + _easycom_u_button2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_u_button = () => "../u-button/u-button.js";
|
||||
const _easycom_u_popup = () => "../u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_button + _easycom_u_popup)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
title: _ctx.title,
|
||||
subtitle: $options.subtitle,
|
||||
showSubtitle: _ctx.showSubtitle,
|
||||
showTitle: _ctx.showTitle,
|
||||
weekText: _ctx.weekText
|
||||
}),
|
||||
b: common_vendor.sr("month", "c9867878-2,c9867878-0"),
|
||||
c: common_vendor.o($options.monthSelected),
|
||||
d: common_vendor.o($options.updateMonthTop),
|
||||
e: common_vendor.p({
|
||||
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,
|
||||
forbidDays: _ctx.forbidDays,
|
||||
forbidDaysToast: _ctx.forbidDaysToast,
|
||||
monthFormat: _ctx.monthFormat
|
||||
}),
|
||||
f: $options.addUnit($data.listHeight, "px"),
|
||||
g: common_vendor.o((...args) => $options.onScroll && $options.onScroll(...args)),
|
||||
h: $data.scrollTop,
|
||||
i: $data.scrollIntoView,
|
||||
j: _ctx.showConfirm
|
||||
}, _ctx.showConfirm ? {
|
||||
k: common_vendor.o($options.confirm),
|
||||
l: common_vendor.p({
|
||||
shape: "circle",
|
||||
text: $options.buttonDisabled ? _ctx.confirmDisabledText : _ctx.confirmText,
|
||||
color: _ctx.color,
|
||||
disabled: $options.buttonDisabled
|
||||
})
|
||||
} : {}, {
|
||||
m: common_vendor.o($options.close),
|
||||
n: common_vendor.p({
|
||||
show: _ctx.show,
|
||||
mode: "bottom",
|
||||
closeable: !_ctx.pageInline,
|
||||
round: _ctx.round,
|
||||
pageInline: _ctx.pageInline,
|
||||
closeOnClickOverlay: _ctx.closeOnClickOverlay
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c9867878"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-header": "./header",
|
||||
"u-month": "./month",
|
||||
"u-button": "../u-button/u-button",
|
||||
"u-popup": "../u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<u-popup wx:if="{{n}}" u-s="{{['d']}}" bindclose="{{m}}" u-i="c9867878-0" bind:__l="__l" u-p="{{n}}" class="{{['data-v-c9867878', virtualHostClass]}}" virtualHostClass="{{['data-v-c9867878', virtualHostClass]}}" style="{{virtualHostStyle}}" virtualHostStyle="{{virtualHostStyle}}"><view class="u-calendar data-v-c9867878"><u-header wx:if="{{a}}" class="data-v-c9867878" virtualHostClass="data-v-c9867878" u-i="c9867878-1,c9867878-0" bind:__l="__l" u-p="{{a}}"></u-header><scroll-view class="data-v-c9867878" style="{{'height:' + f}}" scroll-y bindscroll="{{g}}" scroll-top="{{h}}" scrollIntoView="{{i}}"><u-month wx:if="{{e}}" class="r data-v-c9867878" virtualHostClass="r data-v-c9867878" u-r="month" bindmonthSelected="{{c}}" bindupdateMonthTop="{{d}}" u-i="c9867878-2,c9867878-0" bind:__l="__l" u-p="{{e}}"></u-month></scroll-view><block wx:if="{{j}}"><block wx:if="{{$slots.footer}}"><slot name="footer"></slot></block><block wx:else><view class="u-calendar__confirm data-v-c9867878"><u-button wx:if="{{l}}" class="data-v-c9867878" virtualHostClass="data-v-c9867878" bindclick="{{k}}" u-i="c9867878-3,c9867878-0" bind:__l="__l" u-p="{{l}}"></u-button></view></block></block></view></u-popup>
|
||||
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-calendar__confirm.data-v-c9867878 {
|
||||
padding: 7px 18px;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
require("../u-datetime-picker/dayjs.esm.min.js");
|
||||
@@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
const CarKeyboard = {
|
||||
// 车牌号键盘
|
||||
carKeyboard: {
|
||||
random: false
|
||||
}
|
||||
};
|
||||
exports.CarKeyboard = CarKeyboard;
|
||||
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
const Card = {
|
||||
// card组件的props
|
||||
card: {
|
||||
full: false,
|
||||
title: "",
|
||||
titleColor: "#303133",
|
||||
titleSize: "15px",
|
||||
subTitle: "",
|
||||
subTitleColor: "#909399",
|
||||
subTitleSize: "13px",
|
||||
border: true,
|
||||
index: "",
|
||||
margin: "15px",
|
||||
borderRadius: "8px",
|
||||
headStyle: {},
|
||||
bodyStyle: {},
|
||||
footStyle: {},
|
||||
headBorderBottom: true,
|
||||
footBorderTop: true,
|
||||
thumb: "",
|
||||
thumbWidth: "30px",
|
||||
thumbCircle: false,
|
||||
padding: "15px",
|
||||
paddingHead: "",
|
||||
paddingBody: "",
|
||||
paddingFoot: "",
|
||||
showHead: true,
|
||||
showFoot: true,
|
||||
boxShadow: "none"
|
||||
}
|
||||
};
|
||||
exports.Card = Card;
|
||||
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
const CellGroup = {
|
||||
// cell-group组件的props
|
||||
cellGroup: {
|
||||
title: "",
|
||||
border: true,
|
||||
customStyle: {}
|
||||
}
|
||||
};
|
||||
exports.CellGroup = CellGroup;
|
||||
@@ -1,28 +0,0 @@
|
||||
"use strict";
|
||||
const Cell = {
|
||||
// cell组件的props
|
||||
cell: {
|
||||
customClass: "",
|
||||
title: "",
|
||||
label: "",
|
||||
value: "",
|
||||
icon: "",
|
||||
disabled: false,
|
||||
border: true,
|
||||
center: false,
|
||||
url: "",
|
||||
linkType: "navigateTo",
|
||||
clickable: false,
|
||||
isLink: false,
|
||||
required: false,
|
||||
arrowDirection: "",
|
||||
iconStyle: {},
|
||||
rightIconStyle: {},
|
||||
rightIcon: "arrow-right",
|
||||
titleStyle: {},
|
||||
size: "",
|
||||
stop: true,
|
||||
name: ""
|
||||
}
|
||||
};
|
||||
exports.Cell = Cell;
|
||||
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
const CheckboxGroup = {
|
||||
// checkbox-group组件
|
||||
checkboxGroup: {
|
||||
name: "",
|
||||
value: [],
|
||||
shape: "square",
|
||||
disabled: false,
|
||||
activeColor: "#2979ff",
|
||||
inactiveColor: "#c8c9cc",
|
||||
size: 18,
|
||||
placement: "row",
|
||||
labelSize: 14,
|
||||
labelColor: "#303133",
|
||||
labelDisabled: false,
|
||||
iconColor: "#ffffff",
|
||||
iconSize: 12,
|
||||
iconPlacement: "left",
|
||||
borderBottom: false
|
||||
}
|
||||
};
|
||||
exports.CheckboxGroup = CheckboxGroup;
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
const Checkbox = {
|
||||
// checkbox组件
|
||||
checkbox: {
|
||||
name: "",
|
||||
shape: "",
|
||||
size: "",
|
||||
checkbox: false,
|
||||
disabled: "",
|
||||
activeColor: "",
|
||||
inactiveColor: "",
|
||||
iconSize: "",
|
||||
iconColor: "",
|
||||
label: "",
|
||||
labelSize: "",
|
||||
labelColor: "",
|
||||
labelDisabled: ""
|
||||
}
|
||||
};
|
||||
exports.Checkbox = Checkbox;
|
||||
@@ -1,108 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "up-choose",
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
modelValue: {
|
||||
type: [Number, String, Array],
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: [String],
|
||||
default: "radio"
|
||||
},
|
||||
itemWidth: {
|
||||
type: [String],
|
||||
default: "auto"
|
||||
},
|
||||
itemHeight: {
|
||||
type: [String],
|
||||
default: "50px"
|
||||
},
|
||||
itemPadding: {
|
||||
type: [String],
|
||||
default: "8px"
|
||||
},
|
||||
labelName: {
|
||||
type: String,
|
||||
default: "title"
|
||||
},
|
||||
valueName: {
|
||||
type: String,
|
||||
default: "value"
|
||||
},
|
||||
customClick: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否换行
|
||||
wrap: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentIndex: ""
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
this.currentIndex = this.modelValue;
|
||||
},
|
||||
emits: ["update:modelValue", "custom-click"],
|
||||
methods: {
|
||||
change(index) {
|
||||
if (this.customClick) {
|
||||
this.$emit("custom-click", index);
|
||||
} else {
|
||||
this.currentIndex = index;
|
||||
this.$emit("update:modelValue", index);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_tag2 = common_vendor.resolveComponent("up-tag");
|
||||
_easycom_up_tag2();
|
||||
}
|
||||
const _easycom_up_tag = () => "../u-tag/u-tag.js";
|
||||
if (!Math) {
|
||||
_easycom_up_tag();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($props.options, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item[$props.labelName]),
|
||||
b: common_vendor.n($data.currentIndex === index ? "active" : ""),
|
||||
c: common_vendor.o(($event) => $options.change(index), item.id),
|
||||
d: "03109c79-0-" + i0,
|
||||
e: common_vendor.p({
|
||||
type: index == $data.currentIndex ? "primary" : "info",
|
||||
size: "large",
|
||||
plain: index == $data.currentIndex ? false : true,
|
||||
height: $props.itemHeight
|
||||
}),
|
||||
f: "d-" + i0,
|
||||
g: common_vendor.r("d", {
|
||||
item,
|
||||
index
|
||||
}, i0),
|
||||
h: item.id
|
||||
};
|
||||
}),
|
||||
b: $props.itemWidth,
|
||||
c: $props.itemPadding,
|
||||
d: $props.itemWidth,
|
||||
e: $props.wrap === false,
|
||||
f: common_vendor.n($props.wrap ? "up-choose-wrap" : "up-choose-nowrap")
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-03109c79"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"up-tag": "../u-tag/u-tag"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<scroll-view scroll-x="{{e}}" class="{{['data-v-03109c79', 'up-choose', f, virtualHostClass]}}" style="{{virtualHostStyle}}"><block wx:for="{{a}}" wx:for-item="item" wx:key="h"><view class="data-v-03109c79" style="{{'width:' + d + ';' + ('display:' + 'inline-block')}}"><block wx:if="{{$slots.d}}"><slot name="{{item.f}}"></slot></block><block wx:else><up-tag wx:if="{{item.e}}" u-s="{{['d']}}" class="{{['data-v-03109c79', item.b]}}" virtualHostClass="{{['data-v-03109c79', item.b]}}" style="{{'width:' + b + ';' + ('padding:' + c)}}" virtualHostStyle="{{'width:' + b + ';' + ('padding:' + c)}}" bindclick="{{item.c}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}">{{item.a}}</up-tag></block></view></block></scroll-view>
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.up-choose.data-v-03109c79 .up-tag {
|
||||
font-weight: 600;
|
||||
}
|
||||
.up-choose.data-v-03109c79:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
.up-choose-wrap.data-v-03109c79 {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.up-choose-nowrap.data-v-03109c79 {
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
const CircleProgress = {
|
||||
// circleProgress 组件
|
||||
circleProgress: {
|
||||
percentage: 30
|
||||
}
|
||||
};
|
||||
exports.CircleProgress = CircleProgress;
|
||||
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
const CodeInput = {
|
||||
// codeInput 组件
|
||||
codeInput: {
|
||||
adjustPosition: true,
|
||||
maxlength: 6,
|
||||
dot: false,
|
||||
mode: "box",
|
||||
hairline: false,
|
||||
space: 10,
|
||||
value: "",
|
||||
focus: false,
|
||||
bold: false,
|
||||
color: "#606266",
|
||||
fontSize: 18,
|
||||
size: 35,
|
||||
disabledKeyboard: false,
|
||||
borderColor: "#c9cacc",
|
||||
disabledDot: true
|
||||
}
|
||||
};
|
||||
exports.CodeInput = CodeInput;
|
||||
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_i18n_index = require("../../libs/i18n/index.js");
|
||||
const Code = {
|
||||
// code 组件
|
||||
code: {
|
||||
seconds: 60,
|
||||
startText: uni_modules_uviewPlus_libs_i18n_index.t("up.code.send"),
|
||||
changeText: uni_modules_uviewPlus_libs_i18n_index.t("up.code.resendAfter"),
|
||||
endText: uni_modules_uviewPlus_libs_i18n_index.t("up.code.resend"),
|
||||
keepRunning: false,
|
||||
uniqueKey: ""
|
||||
}
|
||||
};
|
||||
exports.Code = Code;
|
||||
@@ -1,12 +0,0 @@
|
||||
"use strict";
|
||||
const Col = {
|
||||
// col 组件
|
||||
col: {
|
||||
span: 12,
|
||||
offset: 0,
|
||||
justify: "start",
|
||||
align: "stretch",
|
||||
textAlign: "left"
|
||||
}
|
||||
};
|
||||
exports.Col = Col;
|
||||
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
const CollapseItem = {
|
||||
// collapseItem 组件
|
||||
collapseItem: {
|
||||
title: "",
|
||||
value: "",
|
||||
label: "",
|
||||
disabled: false,
|
||||
isLink: true,
|
||||
clickable: true,
|
||||
border: true,
|
||||
align: "left",
|
||||
name: "",
|
||||
icon: "",
|
||||
duration: 300,
|
||||
showRight: true,
|
||||
titleStyle: {},
|
||||
iconStyle: {},
|
||||
rightIconStyle: {},
|
||||
cellCustomStyle: {},
|
||||
cellCustomClass: ""
|
||||
}
|
||||
};
|
||||
exports.CollapseItem = CollapseItem;
|
||||
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
const Collapse = {
|
||||
// collapse 组件
|
||||
collapse: {
|
||||
value: null,
|
||||
accordion: false,
|
||||
border: true
|
||||
}
|
||||
};
|
||||
exports.Collapse = Collapse;
|
||||
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
const ColumnNotice = {
|
||||
// columnNotice 组件
|
||||
columnNotice: {
|
||||
text: "",
|
||||
icon: "volume",
|
||||
mode: "",
|
||||
color: "#f9ae3d",
|
||||
bgColor: "#fdf6ec",
|
||||
fontSize: 14,
|
||||
speed: 80,
|
||||
step: false,
|
||||
duration: 1500,
|
||||
disableTouch: true,
|
||||
justifyContent: "flex-start"
|
||||
}
|
||||
};
|
||||
exports.ColumnNotice = ColumnNotice;
|
||||
@@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
const CountDown = {
|
||||
// u-count-down 计时器组件
|
||||
countDown: {
|
||||
time: 0,
|
||||
format: "HH:mm:ss",
|
||||
autoStart: true,
|
||||
millisecond: false
|
||||
}
|
||||
};
|
||||
exports.CountDown = CountDown;
|
||||
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
const CountTo = {
|
||||
// countTo 组件
|
||||
countTo: {
|
||||
startVal: 0,
|
||||
endVal: 0,
|
||||
duration: 2e3,
|
||||
autoplay: true,
|
||||
decimals: 0,
|
||||
useEasing: true,
|
||||
decimal: ".",
|
||||
color: "#606266",
|
||||
fontSize: 22,
|
||||
bold: false,
|
||||
separator: ""
|
||||
}
|
||||
};
|
||||
exports.CountTo = CountTo;
|
||||
@@ -1,37 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_i18n_index = require("../../libs/i18n/index.js");
|
||||
const DatetimePicker = {
|
||||
// datetimePicker 组件
|
||||
datetimePicker: {
|
||||
show: false,
|
||||
popupMode: "bottom",
|
||||
showToolbar: true,
|
||||
value: "",
|
||||
title: "",
|
||||
mode: "datetime",
|
||||
maxDate: new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 0, 1).getTime(),
|
||||
minDate: new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1).getTime(),
|
||||
minHour: 0,
|
||||
maxHour: 23,
|
||||
minMinute: 0,
|
||||
maxMinute: 59,
|
||||
filter: null,
|
||||
formatter: null,
|
||||
loading: false,
|
||||
itemHeight: 44,
|
||||
cancelText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.cancel"),
|
||||
confirmText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.confirm"),
|
||||
cancelColor: "#909193",
|
||||
confirmColor: "#3c9cff",
|
||||
visibleItemCount: 5,
|
||||
closeOnClickOverlay: false,
|
||||
defaultIndex: [],
|
||||
inputBorder: "surround",
|
||||
disabled: false,
|
||||
disabledColor: "",
|
||||
placeholder: uni_modules_uviewPlus_libs_i18n_index.t("up.common.pleaseChoose"),
|
||||
inputProps: {},
|
||||
pageInline: false
|
||||
}
|
||||
};
|
||||
exports.DatetimePicker = DatetimePicker;
|
||||
@@ -1,287 +0,0 @@
|
||||
"use strict";
|
||||
var e = function() {
|
||||
var t = 1e3, e2 = 6e4, n = 36e5, r = "millisecond", s = "second", i = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "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 e3 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
||||
return "[" + t2 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]";
|
||||
} }, g = function(t2, e3, n2) {
|
||||
var r2 = String(t2);
|
||||
return !r2 || r2.length >= e3 ? t2 : "" + Array(e3 + 1 - r2.length).join(n2) + t2;
|
||||
}, v = { s: g, z: function(t2) {
|
||||
var e3 = -t2.utcOffset(), n2 = Math.abs(e3), r2 = Math.floor(n2 / 60), s2 = n2 % 60;
|
||||
return (e3 <= 0 ? "+" : "-") + g(r2, 2, "0") + ":" + g(s2, 2, "0");
|
||||
}, m: function t2(e3, n2) {
|
||||
if (e3.date() < n2.date())
|
||||
return -t2(n2, e3);
|
||||
var r2 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), s2 = e3.clone().add(r2, c), i2 = n2 - s2 < 0, u2 = e3.clone().add(r2 + (i2 ? -1 : 1), c);
|
||||
return +(-(r2 + (n2 - s2) / (i2 ? s2 - u2 : u2 - s2)) || 0);
|
||||
}, a: function(t2) {
|
||||
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
||||
}, p: function(t2) {
|
||||
return { M: c, y: h, w: o, d: a, D: d, h: u, m: i, s, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
||||
}, u: function(t2) {
|
||||
return void 0 === t2;
|
||||
} }, m = "en", D = {};
|
||||
D[m] = M;
|
||||
var p = "$isDayjsObject", S = function(t2) {
|
||||
return t2 instanceof _ || !(!t2 || !t2[p]);
|
||||
}, w = function t2(e3, n2, r2) {
|
||||
var s2;
|
||||
if (!e3)
|
||||
return m;
|
||||
if ("string" == typeof e3) {
|
||||
var i2 = e3.toLowerCase();
|
||||
D[i2] && (s2 = i2), n2 && (D[i2] = n2, s2 = i2);
|
||||
var u2 = e3.split("-");
|
||||
if (!s2 && u2.length > 1)
|
||||
return t2(u2[0]);
|
||||
} else {
|
||||
var a2 = e3.name;
|
||||
D[a2] = e3, s2 = a2;
|
||||
}
|
||||
return !r2 && s2 && (m = s2), s2 || !r2 && m;
|
||||
}, b = function(t2, e3) {
|
||||
if (S(t2))
|
||||
return t2.clone();
|
||||
var n2 = "object" == typeof e3 ? e3 : {};
|
||||
return n2.date = t2, n2.args = arguments, new _(n2);
|
||||
}, O = v;
|
||||
O.l = w, O.i = S, O.w = function(t2, e3) {
|
||||
return b(t2, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
|
||||
};
|
||||
var _ = function() {
|
||||
function M2(t2) {
|
||||
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
||||
}
|
||||
var g2 = M2.prototype;
|
||||
return g2.parse = function(t2) {
|
||||
this.$d = function(t3) {
|
||||
var e3 = t3.date, n2 = t3.utc;
|
||||
if (null === e3)
|
||||
return /* @__PURE__ */ new Date(NaN);
|
||||
if (O.u(e3))
|
||||
return /* @__PURE__ */ new Date();
|
||||
if (e3 instanceof Date)
|
||||
return new Date(e3);
|
||||
if ("string" == typeof e3 && !/Z$/i.test(e3)) {
|
||||
var r2 = e3.match($);
|
||||
if (r2) {
|
||||
var s2 = r2[2] - 1 || 0, i2 = (r2[7] || "0").substring(0, 3);
|
||||
return n2 ? new Date(Date.UTC(r2[1], s2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, i2)) : new Date(r2[1], s2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, i2);
|
||||
}
|
||||
}
|
||||
return new Date(e3);
|
||||
}(t2), this.init();
|
||||
}, g2.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();
|
||||
}, g2.$utils = function() {
|
||||
return O;
|
||||
}, g2.isValid = function() {
|
||||
return !(this.$d.toString() === l);
|
||||
}, g2.isSame = function(t2, e3) {
|
||||
var n2 = b(t2);
|
||||
return this.startOf(e3) <= n2 && n2 <= this.endOf(e3);
|
||||
}, g2.isAfter = function(t2, e3) {
|
||||
return b(t2) < this.startOf(e3);
|
||||
}, g2.isBefore = function(t2, e3) {
|
||||
return this.endOf(e3) < b(t2);
|
||||
}, g2.$g = function(t2, e3, n2) {
|
||||
return O.u(t2) ? this[e3] : this.set(n2, t2);
|
||||
}, g2.unix = function() {
|
||||
return Math.floor(this.valueOf() / 1e3);
|
||||
}, g2.valueOf = function() {
|
||||
return this.$d.getTime();
|
||||
}, g2.startOf = function(t2, e3) {
|
||||
var n2 = this, r2 = !!O.u(e3) || e3, f2 = O.p(t2), l2 = function(t3, e4) {
|
||||
var s2 = O.w(n2.$u ? Date.UTC(n2.$y, e4, t3) : new Date(n2.$y, e4, t3), n2);
|
||||
return r2 ? s2 : s2.endOf(a);
|
||||
}, $2 = function(t3, e4) {
|
||||
return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2);
|
||||
}, y2 = this.$W, M3 = this.$M, g3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
||||
switch (f2) {
|
||||
case h:
|
||||
return r2 ? l2(1, 0) : l2(31, 11);
|
||||
case c:
|
||||
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
||||
case o:
|
||||
var m2 = this.$locale().weekStart || 0, D2 = (y2 < m2 ? y2 + 7 : y2) - m2;
|
||||
return l2(r2 ? g3 - D2 : g3 + (6 - D2), M3);
|
||||
case a:
|
||||
case d:
|
||||
return $2(v2 + "Hours", 0);
|
||||
case u:
|
||||
return $2(v2 + "Minutes", 1);
|
||||
case i:
|
||||
return $2(v2 + "Seconds", 2);
|
||||
case s:
|
||||
return $2(v2 + "Milliseconds", 3);
|
||||
default:
|
||||
return this.clone();
|
||||
}
|
||||
}, g2.endOf = function(t2) {
|
||||
return this.startOf(t2, false);
|
||||
}, g2.$set = function(t2, e3) {
|
||||
var n2, o2 = O.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[i] = f2 + "Minutes", n2[s] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e3 - this.$W) : e3;
|
||||
if (o2 === c || o2 === h) {
|
||||
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;
|
||||
}, g2.set = function(t2, e3) {
|
||||
return this.clone().$set(t2, e3);
|
||||
}, g2.get = function(t2) {
|
||||
return this[O.p(t2)]();
|
||||
}, g2.add = function(r2, f2) {
|
||||
var d2, l2 = this;
|
||||
r2 = Number(r2);
|
||||
var $2 = O.p(f2), y2 = function(t2) {
|
||||
var e3 = b(l2);
|
||||
return O.w(e3.date(e3.date() + Math.round(t2 * r2)), l2);
|
||||
};
|
||||
if ($2 === c)
|
||||
return this.set(c, this.$M + r2);
|
||||
if ($2 === h)
|
||||
return this.set(h, this.$y + r2);
|
||||
if ($2 === a)
|
||||
return y2(1);
|
||||
if ($2 === o)
|
||||
return y2(7);
|
||||
var M3 = (d2 = {}, d2[i] = e2, d2[u] = n, d2[s] = t, d2)[$2] || 1, g3 = this.$d.getTime() + r2 * M3;
|
||||
return O.w(g3, this);
|
||||
}, g2.subtract = function(t2, e3) {
|
||||
return this.add(-1 * t2, e3);
|
||||
}, g2.format = function(t2) {
|
||||
var e3 = this, n2 = this.$locale();
|
||||
if (!this.isValid())
|
||||
return n2.invalidDate || l;
|
||||
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", s2 = O.z(this), i2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, s3, i3) {
|
||||
return t3 && (t3[n3] || t3(e3, r2)) || s3[n3].slice(0, i3);
|
||||
}, d2 = function(t3) {
|
||||
return O.s(i2 % 12 || 12, t3, "0");
|
||||
}, $2 = f2 || function(t3, e4, n3) {
|
||||
var r3 = t3 < 12 ? "AM" : "PM";
|
||||
return n3 ? r3.toLowerCase() : r3;
|
||||
};
|
||||
return r2.replace(y, function(t3, r3) {
|
||||
return r3 || function(t4) {
|
||||
switch (t4) {
|
||||
case "YY":
|
||||
return String(e3.$y).slice(-2);
|
||||
case "YYYY":
|
||||
return O.s(e3.$y, 4, "0");
|
||||
case "M":
|
||||
return a2 + 1;
|
||||
case "MM":
|
||||
return O.s(a2 + 1, 2, "0");
|
||||
case "MMM":
|
||||
return h2(n2.monthsShort, a2, c2, 3);
|
||||
case "MMMM":
|
||||
return h2(c2, a2);
|
||||
case "D":
|
||||
return e3.$D;
|
||||
case "DD":
|
||||
return O.s(e3.$D, 2, "0");
|
||||
case "d":
|
||||
return String(e3.$W);
|
||||
case "dd":
|
||||
return h2(n2.weekdaysMin, e3.$W, o2, 2);
|
||||
case "ddd":
|
||||
return h2(n2.weekdaysShort, e3.$W, o2, 3);
|
||||
case "dddd":
|
||||
return o2[e3.$W];
|
||||
case "H":
|
||||
return String(i2);
|
||||
case "HH":
|
||||
return O.s(i2, 2, "0");
|
||||
case "h":
|
||||
return d2(1);
|
||||
case "hh":
|
||||
return d2(2);
|
||||
case "a":
|
||||
return $2(i2, u2, true);
|
||||
case "A":
|
||||
return $2(i2, u2, false);
|
||||
case "m":
|
||||
return String(u2);
|
||||
case "mm":
|
||||
return O.s(u2, 2, "0");
|
||||
case "s":
|
||||
return String(e3.$s);
|
||||
case "ss":
|
||||
return O.s(e3.$s, 2, "0");
|
||||
case "SSS":
|
||||
return O.s(e3.$ms, 3, "0");
|
||||
case "Z":
|
||||
return s2;
|
||||
}
|
||||
return null;
|
||||
}(t3) || s2.replace(":", "");
|
||||
});
|
||||
}, g2.utcOffset = function() {
|
||||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
||||
}, g2.diff = function(r2, d2, l2) {
|
||||
var $2, y2 = this, M3 = O.p(d2), g3 = b(r2), v2 = (g3.utcOffset() - this.utcOffset()) * e2, m2 = this - g3, D2 = function() {
|
||||
return O.m(y2, g3);
|
||||
};
|
||||
switch (M3) {
|
||||
case h:
|
||||
$2 = D2() / 12;
|
||||
break;
|
||||
case c:
|
||||
$2 = D2();
|
||||
break;
|
||||
case f:
|
||||
$2 = D2() / 3;
|
||||
break;
|
||||
case o:
|
||||
$2 = (m2 - v2) / 6048e5;
|
||||
break;
|
||||
case a:
|
||||
$2 = (m2 - v2) / 864e5;
|
||||
break;
|
||||
case u:
|
||||
$2 = m2 / n;
|
||||
break;
|
||||
case i:
|
||||
$2 = m2 / e2;
|
||||
break;
|
||||
case s:
|
||||
$2 = m2 / t;
|
||||
break;
|
||||
default:
|
||||
$2 = m2;
|
||||
}
|
||||
return l2 ? $2 : O.a($2);
|
||||
}, g2.daysInMonth = function() {
|
||||
return this.endOf(c).$D;
|
||||
}, g2.$locale = function() {
|
||||
return D[this.$L];
|
||||
}, g2.locale = function(t2, e3) {
|
||||
if (!t2)
|
||||
return this.$L;
|
||||
var n2 = this.clone(), r2 = w(t2, e3, true);
|
||||
return r2 && (n2.$L = r2), n2;
|
||||
}, g2.clone = function() {
|
||||
return O.w(this.$d, this);
|
||||
}, g2.toDate = function() {
|
||||
return new Date(this.valueOf());
|
||||
}, g2.toJSON = function() {
|
||||
return this.isValid() ? this.toISOString() : null;
|
||||
}, g2.toISOString = function() {
|
||||
return this.$d.toISOString();
|
||||
}, g2.toString = function() {
|
||||
return this.$d.toUTCString();
|
||||
}, M2;
|
||||
}(), k = _.prototype;
|
||||
return b.prototype = k, [["$ms", r], ["$s", s], ["$m", i], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
||||
k[t2[1]] = function(e3) {
|
||||
return this.$g(e3, t2[0], t2[1]);
|
||||
};
|
||||
}), b.extend = function(t2, e3) {
|
||||
return t2.$i || (t2(e3, _, b), t2.$i = true), b;
|
||||
}, b.locale = w, b.isDayjs = S, b.unix = function(t2) {
|
||||
return b(1e3 * t2);
|
||||
}, b.en = D[m], b.Ls = D, b.p = {}, b;
|
||||
}();
|
||||
exports.e = e;
|
||||
@@ -1,166 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 是否显示input
|
||||
hasInput: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
inputProps: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
inputBorder: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.inputBorder
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.disabled
|
||||
},
|
||||
disabledColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.disabledColor
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.placeholder
|
||||
},
|
||||
format: {
|
||||
type: String,
|
||||
default: () => ""
|
||||
},
|
||||
// 是否打开组件
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.show
|
||||
},
|
||||
// 弹出的方向,可选值为 top bottom right left center
|
||||
popupMode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.picker.popupMode
|
||||
},
|
||||
// 是否展示顶部的操作栏
|
||||
showToolbar: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.showToolbar
|
||||
},
|
||||
// 工具栏右侧内容
|
||||
toolbarRightSlot: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 绑定值
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.value
|
||||
},
|
||||
// 顶部标题
|
||||
title: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.title
|
||||
},
|
||||
// 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
|
||||
mode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.mode
|
||||
},
|
||||
// 可选的最大时间
|
||||
maxDate: {
|
||||
type: Number,
|
||||
// 最大默认值为后10年
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.maxDate
|
||||
},
|
||||
// 可选的最小时间
|
||||
minDate: {
|
||||
type: Number,
|
||||
// 最小默认值为前10年
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.minDate
|
||||
},
|
||||
// 可选的最小小时,仅mode=time有效
|
||||
minHour: {
|
||||
type: Number,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.minHour
|
||||
},
|
||||
// 可选的最大小时,仅mode=time有效
|
||||
maxHour: {
|
||||
type: Number,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.maxHour
|
||||
},
|
||||
// 可选的最小分钟,仅mode=time有效
|
||||
minMinute: {
|
||||
type: Number,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.minMinute
|
||||
},
|
||||
// 可选的最大分钟,仅mode=time有效
|
||||
maxMinute: {
|
||||
type: Number,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.maxMinute
|
||||
},
|
||||
// 选项过滤函数
|
||||
filter: {
|
||||
type: [Function, null],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.filter
|
||||
},
|
||||
// 选项格式化函数
|
||||
formatter: {
|
||||
type: [Function, null],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.formatter
|
||||
},
|
||||
// 是否显示加载中状态
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.loading
|
||||
},
|
||||
// 各列中,单个选项的高度
|
||||
itemHeight: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.itemHeight
|
||||
},
|
||||
// 取消按钮的文字
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.cancelText
|
||||
},
|
||||
// 确认按钮的文字
|
||||
confirmText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.confirmText
|
||||
},
|
||||
// 取消按钮的颜色
|
||||
cancelColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.cancelColor
|
||||
},
|
||||
// 确认按钮的颜色
|
||||
confirmColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.confirmColor
|
||||
},
|
||||
// 每列中可见选项的数量
|
||||
visibleItemCount: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.visibleItemCount
|
||||
},
|
||||
// 是否允许点击遮罩关闭选择器
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.closeOnClickOverlay
|
||||
},
|
||||
// 各列的默认索引
|
||||
defaultIndex: {
|
||||
type: Array,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.defaultIndex
|
||||
},
|
||||
// 是否页面内展示
|
||||
pageInline: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.datetimePicker.pageInline
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,398 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uDatetimePicker_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min = require("./dayjs.esm.min.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function times(n, iteratee) {
|
||||
let index = -1;
|
||||
const result = Array(n < 0 ? 0 : n);
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const _sfc_main = {
|
||||
name: "up-datetime-picker",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uDatetimePicker_props.props],
|
||||
data() {
|
||||
return {
|
||||
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
||||
inputValue: "",
|
||||
// 表单显示值
|
||||
showByClickInput: false,
|
||||
// 是否在hasInput模式下显示日期选择弹唱
|
||||
columns: [],
|
||||
innerDefaultIndex: [],
|
||||
innerFormatter: (type, value) => value
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show(newValue, oldValue) {
|
||||
if (newValue) {
|
||||
this.innerValue = this.correctValue(this.modelValue);
|
||||
this.updateColumnValue(this.innerValue);
|
||||
}
|
||||
},
|
||||
modelValue(newValue) {
|
||||
this.init();
|
||||
},
|
||||
propsChange() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 如果以下这些变量发生了变化,意味着需要重新初始化各列的值
|
||||
propsChange() {
|
||||
return [this.mode, this.maxDate, this.minDate, this.minHour, this.maxHour, this.minMinute, this.maxMinute, this.filter, this.modelValue];
|
||||
},
|
||||
// input的props
|
||||
inputPropsInner() {
|
||||
return {
|
||||
border: this.inputBorder,
|
||||
placeholder: this.placeholder,
|
||||
disabled: this.disabled,
|
||||
disabledColor: this.disabledColor,
|
||||
...this.inputProps
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
emits: ["close", "cancel", "confirm", "change", "update:modelValue"],
|
||||
methods: {
|
||||
getInputValue(newValue) {
|
||||
if (newValue == "" || !newValue || newValue == void 0) {
|
||||
this.inputValue = "";
|
||||
return;
|
||||
}
|
||||
if (this.mode == "time") {
|
||||
this.inputValue = newValue;
|
||||
} else {
|
||||
if (this.format) {
|
||||
this.inputValue = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(newValue).format(this.format);
|
||||
} else {
|
||||
let format = "";
|
||||
switch (this.mode) {
|
||||
case "date":
|
||||
format = "YYYY-MM-DD";
|
||||
break;
|
||||
case "year-month":
|
||||
format = "YYYY-MM";
|
||||
break;
|
||||
case "datehour":
|
||||
format = "YYYY-MM-DD HH";
|
||||
break;
|
||||
case "datetime":
|
||||
format = "YYYY-MM-DD HH:mm";
|
||||
break;
|
||||
case "time":
|
||||
format = "HH:mm";
|
||||
break;
|
||||
}
|
||||
this.inputValue = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(newValue).format(format);
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
this.innerValue = this.correctValue(this.modelValue);
|
||||
this.updateColumnValue(this.innerValue);
|
||||
this.getInputValue(this.innerValue);
|
||||
},
|
||||
// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
|
||||
setFormatter(e) {
|
||||
this.innerFormatter = e;
|
||||
},
|
||||
// 关闭选择器
|
||||
close() {
|
||||
if (this.closeOnClickOverlay) {
|
||||
this.$emit("close");
|
||||
}
|
||||
},
|
||||
// 点击工具栏的取消按钮
|
||||
cancel() {
|
||||
if (this.hasInput) {
|
||||
this.showByClickInput = false;
|
||||
}
|
||||
this.$emit("cancel");
|
||||
},
|
||||
// 点击工具栏的确定按钮
|
||||
confirm() {
|
||||
this.$emit("update:modelValue", this.innerValue);
|
||||
if (this.hasInput) {
|
||||
this.getInputValue(this.innerValue);
|
||||
this.showByClickInput = false;
|
||||
}
|
||||
this.$emit("confirm", {
|
||||
value: this.innerValue,
|
||||
mode: this.mode
|
||||
});
|
||||
},
|
||||
//用正则截取输出值,当出现多组数字时,抛出错误
|
||||
intercept(e, type) {
|
||||
let judge = e.match(/\d+/g);
|
||||
if (judge.length > 1) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("请勿在过滤或格式化函数时添加数字");
|
||||
return 0;
|
||||
} else if (type && judge[0].length == 4) {
|
||||
return judge[0];
|
||||
} else if (judge[0].length > 2) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("请勿在过滤或格式化函数时添加数字");
|
||||
return 0;
|
||||
} else {
|
||||
return judge[0];
|
||||
}
|
||||
},
|
||||
// 列发生变化时触发
|
||||
change(e) {
|
||||
const { indexs, values } = e;
|
||||
let selectValue = "";
|
||||
if (this.mode === "time") {
|
||||
selectValue = `${this.intercept(values[0][indexs[0]])}:${this.intercept(values[1][indexs[1]])}`;
|
||||
} else {
|
||||
const year = parseInt(this.intercept(values[0][indexs[0]], "year"));
|
||||
const month = parseInt(this.intercept(values[1][indexs[1]]));
|
||||
let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1);
|
||||
let hour = 0, minute = 0;
|
||||
const maxDate = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(`${year}-${month}`).daysInMonth();
|
||||
if (this.mode === "year-month") {
|
||||
date = 1;
|
||||
}
|
||||
date = Math.min(maxDate, date);
|
||||
if (this.mode === "datetime") {
|
||||
hour = parseInt(this.intercept(values[3][indexs[3]]));
|
||||
minute = parseInt(this.intercept(values[4][indexs[4]]));
|
||||
}
|
||||
selectValue = Number(new Date(year, month - 1, date, hour, minute));
|
||||
}
|
||||
selectValue = this.correctValue(selectValue);
|
||||
this.innerValue = selectValue;
|
||||
this.updateColumnValue(selectValue);
|
||||
this.$emit("change", {
|
||||
value: selectValue,
|
||||
mode: this.mode
|
||||
});
|
||||
},
|
||||
// 更新各列的值,进行补0、格式化等操作
|
||||
updateColumnValue(value) {
|
||||
this.innerValue = value;
|
||||
this.updateColumns();
|
||||
setTimeout(() => {
|
||||
this.updateIndexs(value);
|
||||
}, 0);
|
||||
},
|
||||
// 更新索引
|
||||
updateIndexs(value) {
|
||||
let values = [];
|
||||
const formatter = this.formatter || this.innerFormatter;
|
||||
if (this.mode === "time") {
|
||||
const timeArr = value.split(":");
|
||||
values = [formatter("hour", timeArr[0]), formatter("minute", timeArr[1])];
|
||||
} else {
|
||||
values = [
|
||||
formatter("year", `${uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).year()}`),
|
||||
// 月份补0
|
||||
formatter("month", uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).month() + 1))
|
||||
];
|
||||
if (this.mode === "date") {
|
||||
values.push(formatter("day", uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).date())));
|
||||
}
|
||||
if (this.mode === "datetime") {
|
||||
values.push(formatter("day", uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).date())), formatter("hour", uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).hour())), formatter("minute", uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).minute())));
|
||||
}
|
||||
}
|
||||
const indexs = this.columns.map((column, index) => {
|
||||
return Math.max(0, column.findIndex((item) => item === values[index]));
|
||||
});
|
||||
this.innerDefaultIndex = indexs;
|
||||
},
|
||||
// 更新各列的值
|
||||
updateColumns() {
|
||||
const formatter = this.formatter || this.innerFormatter;
|
||||
const results = this.getOriginColumns().map((column) => column.values.map((value) => formatter(column.type, value)));
|
||||
this.columns = results;
|
||||
},
|
||||
getOriginColumns() {
|
||||
const results = this.getRanges().map(({ type, range }) => {
|
||||
let values = times(range[1] - range[0] + 1, (index) => {
|
||||
let value = range[0] + index;
|
||||
value = type === "year" ? `${value}` : uni_modules_uviewPlus_libs_function_index.padZero(value);
|
||||
return value;
|
||||
});
|
||||
if (this.filter) {
|
||||
values = this.filter(type, values);
|
||||
if (!values || values && values.length == 0) {
|
||||
console.log("日期filter结果不能为空");
|
||||
}
|
||||
}
|
||||
return { type, values };
|
||||
});
|
||||
return results;
|
||||
},
|
||||
// 通过最大值和最小值生成数组
|
||||
generateArray(start, end) {
|
||||
return Array.from(new Array(end + 1).keys()).slice(start);
|
||||
},
|
||||
// 得出合法的时间
|
||||
correctValue(value) {
|
||||
const isDateMode = this.mode !== "time";
|
||||
if (isDateMode && !uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e.unix(value).isValid()) {
|
||||
value = this.minDate;
|
||||
} else if (!isDateMode && !value) {
|
||||
value = `${uni_modules_uviewPlus_libs_function_index.padZero(this.minHour)}:${uni_modules_uviewPlus_libs_function_index.padZero(this.minMinute)}`;
|
||||
}
|
||||
if (!isDateMode) {
|
||||
if (String(value).indexOf(":") === -1)
|
||||
return uni_modules_uviewPlus_libs_function_index.error("时间错误,请传递如12:24的格式");
|
||||
let [hour, minute] = value.split(":");
|
||||
hour = uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_libs_function_index.range(this.minHour, this.maxHour, Number(hour)));
|
||||
minute = uni_modules_uviewPlus_libs_function_index.padZero(uni_modules_uviewPlus_libs_function_index.range(this.minMinute, this.maxMinute, Number(minute)));
|
||||
return `${hour}:${minute}`;
|
||||
} else {
|
||||
value = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).isBefore(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.minDate)) ? this.minDate : value;
|
||||
value = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).isAfter(uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(this.maxDate)) ? this.maxDate : value;
|
||||
return value;
|
||||
}
|
||||
},
|
||||
// 获取每列的最大和最小值
|
||||
getRanges() {
|
||||
if (this.mode === "time") {
|
||||
return [
|
||||
{
|
||||
type: "hour",
|
||||
range: [this.minHour, this.maxHour]
|
||||
},
|
||||
{
|
||||
type: "minute",
|
||||
range: [this.minMinute, this.maxMinute]
|
||||
}
|
||||
];
|
||||
}
|
||||
const { maxYear, maxDate, maxMonth, maxHour, maxMinute } = this.getBoundary("max", this.innerValue);
|
||||
const { minYear, minDate, minMonth, minHour, minMinute } = this.getBoundary("min", this.innerValue);
|
||||
const result = [
|
||||
{
|
||||
type: "year",
|
||||
range: [minYear, maxYear]
|
||||
},
|
||||
{
|
||||
type: "month",
|
||||
range: [minMonth, maxMonth]
|
||||
},
|
||||
{
|
||||
type: "day",
|
||||
range: [minDate, maxDate]
|
||||
},
|
||||
{
|
||||
type: "hour",
|
||||
range: [minHour, maxHour]
|
||||
},
|
||||
{
|
||||
type: "minute",
|
||||
range: [minMinute, maxMinute]
|
||||
}
|
||||
];
|
||||
if (this.mode === "date")
|
||||
result.splice(3, 2);
|
||||
if (this.mode === "year-month")
|
||||
result.splice(2, 3);
|
||||
return result;
|
||||
},
|
||||
// 根据minDate、maxDate、minHour、maxHour等边界值,判断各列的开始和结束边界值
|
||||
getBoundary(type, innerValue) {
|
||||
let value = new Date(innerValue);
|
||||
if (isNaN(value.getTime())) {
|
||||
value = /* @__PURE__ */ new Date();
|
||||
}
|
||||
const boundary = new Date(this[`${type}Date`]);
|
||||
const year = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(boundary).year();
|
||||
let month = 1;
|
||||
let date = 1;
|
||||
let hour = 0;
|
||||
let minute = 0;
|
||||
if (type === "max") {
|
||||
month = 12;
|
||||
date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).daysInMonth();
|
||||
hour = 23;
|
||||
minute = 59;
|
||||
}
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).year() === year) {
|
||||
month = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(boundary).month() + 1;
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).month() + 1 === month) {
|
||||
date = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(boundary).date();
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).date() === date) {
|
||||
hour = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(boundary).hour();
|
||||
if (uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(value).hour() === hour) {
|
||||
minute = uni_modules_uviewPlus_components_uDatetimePicker_dayjs_esm_min.e(boundary).minute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
[`${type}Year`]: year,
|
||||
[`${type}Month`]: month,
|
||||
[`${type}Date`]: date,
|
||||
[`${type}Hour`]: hour,
|
||||
[`${type}Minute`]: minute
|
||||
};
|
||||
},
|
||||
onShowByClickInput() {
|
||||
if (!this.disabled) {
|
||||
this.showByClickInput = !this.showByClickInput;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_u_picker2 = common_vendor.resolveComponent("u-picker");
|
||||
(_easycom_up_input2 + _easycom_u_picker2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../u-input/u-input.js";
|
||||
const _easycom_u_picker = () => "../u-picker/u-picker.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_u_picker)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.hasInput
|
||||
}, _ctx.hasInput ? {
|
||||
b: common_vendor.o(($event) => $data.inputValue = $event),
|
||||
c: common_vendor.p({
|
||||
readonly: !!$data.showByClickInput,
|
||||
...$options.inputPropsInner,
|
||||
modelValue: $data.inputValue
|
||||
}),
|
||||
d: common_vendor.r("trigger", {
|
||||
value: $data.inputValue
|
||||
}),
|
||||
e: common_vendor.o((...args) => $options.onShowByClickInput && $options.onShowByClickInput(...args))
|
||||
} : {}, {
|
||||
f: common_vendor.sr("picker", "e7a0f1eb-1"),
|
||||
g: common_vendor.o($options.close),
|
||||
h: common_vendor.o($options.cancel),
|
||||
i: common_vendor.o($options.confirm),
|
||||
j: common_vendor.o($options.change),
|
||||
k: common_vendor.p({
|
||||
show: _ctx.pageInline || _ctx.show || _ctx.hasInput && $data.showByClickInput,
|
||||
popupMode: _ctx.popupMode,
|
||||
closeOnClickOverlay: _ctx.closeOnClickOverlay,
|
||||
columns: $data.columns,
|
||||
title: _ctx.title,
|
||||
itemHeight: _ctx.itemHeight,
|
||||
showToolbar: _ctx.showToolbar,
|
||||
visibleItemCount: _ctx.visibleItemCount,
|
||||
defaultIndex: $data.innerDefaultIndex,
|
||||
cancelText: _ctx.cancelText,
|
||||
confirmText: _ctx.confirmText,
|
||||
cancelColor: _ctx.cancelColor,
|
||||
confirmColor: _ctx.confirmColor,
|
||||
toolbarRightSlot: _ctx.toolbarRightSlot,
|
||||
pageInline: _ctx.pageInline
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e7a0f1eb"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"up-input": "../u-input/u-input",
|
||||
"u-picker": "../u-picker/u-picker"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-datetime-picker', 'data-v-e7a0f1eb', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:if="{{a}}" class="u-datetime-picker__has-input data-v-e7a0f1eb" bindtap="{{e}}"><block wx:if="{{$slots.trigger}}"><slot name="trigger"></slot></block><block wx:else><up-input wx:if="{{c}}" class="data-v-e7a0f1eb" virtualHostClass="data-v-e7a0f1eb" u-i="e7a0f1eb-0" bind:__l="__l" bindupdateModelValue="{{b}}" u-p="{{c}}"></up-input><cover-view class="input-cover data-v-e7a0f1eb"></cover-view></block></view><u-picker wx:if="{{k}}" class="r data-v-e7a0f1eb" virtualHostClass="r data-v-e7a0f1eb" u-s="{{['toolbar-right','toolbar-bottom']}}" u-r="picker" bindclose="{{g}}" bindcancel="{{h}}" bindconfirm="{{i}}" bindchange="{{j}}" u-i="e7a0f1eb-1" bind:__l="__l" u-p="{{k}}"><view slot="toolbar-right"><slot name="toolbar-right"></slot></view><view slot="toolbar-bottom"><slot name="toolbar-bottom"></slot></view></u-picker></view>
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-datetime-picker.data-v-e7a0f1eb {
|
||||
flex: 1;
|
||||
}
|
||||
.u-datetime-picker__has-input.data-v-e7a0f1eb {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
.u-datetime-picker__has-input .input-cover.data-v-e7a0f1eb {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee;
|
||||
padding: 0 10px;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
const Divider = {
|
||||
// divider组件
|
||||
divider: {
|
||||
dashed: false,
|
||||
hairline: true,
|
||||
dot: false,
|
||||
textPosition: "center",
|
||||
text: "",
|
||||
textSize: 14,
|
||||
textColor: "#909399",
|
||||
lineColor: "#dcdfe6"
|
||||
}
|
||||
};
|
||||
exports.Divider = Divider;
|
||||
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
const Empty = {
|
||||
// empty组件
|
||||
empty: {
|
||||
icon: "",
|
||||
text: "",
|
||||
textColor: "#c0c4cc",
|
||||
textSize: 14,
|
||||
iconColor: "#c0c4cc",
|
||||
iconSize: 90,
|
||||
mode: "data",
|
||||
width: 160,
|
||||
height: 160,
|
||||
show: true,
|
||||
marginTop: 0
|
||||
}
|
||||
};
|
||||
exports.Empty = Empty;
|
||||
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
const FormItem = {
|
||||
// formItem 组件
|
||||
formItem: {
|
||||
label: "",
|
||||
prop: "",
|
||||
rules: [],
|
||||
borderBottom: "",
|
||||
labelPosition: "",
|
||||
labelWidth: "",
|
||||
rightIcon: "",
|
||||
leftIcon: "",
|
||||
required: false,
|
||||
leftIconStyle: ""
|
||||
}
|
||||
};
|
||||
exports.FormItem = FormItem;
|
||||
@@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// input的label提示语
|
||||
label: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.label
|
||||
},
|
||||
// 绑定的值
|
||||
prop: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.prop
|
||||
},
|
||||
// 绑定的规则
|
||||
rules: {
|
||||
type: Array,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.rules
|
||||
},
|
||||
// 是否显示表单域的下划线边框
|
||||
borderBottom: {
|
||||
type: [String, Boolean],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.borderBottom
|
||||
},
|
||||
// label的位置,left-左边,top-上边
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.labelPosition
|
||||
},
|
||||
// label的宽度,单位px
|
||||
labelWidth: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.labelWidth
|
||||
},
|
||||
// 右侧图标
|
||||
rightIcon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.rightIcon
|
||||
},
|
||||
// 左侧图标
|
||||
leftIcon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.leftIcon
|
||||
},
|
||||
// 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
|
||||
required: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.required
|
||||
},
|
||||
leftIconStyle: {
|
||||
type: [String, Object],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.leftIconStyle
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,142 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uFormItem_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const uni_modules_uviewPlus_libs_config_color = require("../../libs/config/color.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-form-item",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uFormItem_props.props],
|
||||
data() {
|
||||
return {
|
||||
// 错误提示语
|
||||
message: "",
|
||||
parentData: {
|
||||
// 提示文本的位置
|
||||
labelPosition: "left",
|
||||
// 提示文本对齐方式
|
||||
labelAlign: "left",
|
||||
// 提示文本的样式
|
||||
labelStyle: {},
|
||||
// 提示文本的宽度
|
||||
labelWidth: 45,
|
||||
// 错误提示方式
|
||||
errorType: "message"
|
||||
},
|
||||
color: uni_modules_uviewPlus_libs_config_color.color,
|
||||
itemRules: []
|
||||
};
|
||||
},
|
||||
// 组件创建完成时,将当前实例保存到u-form中
|
||||
computed: {
|
||||
propsLine() {
|
||||
return uni_modules_uviewPlus_libs_config_props.props.line;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
emits: ["click"],
|
||||
watch: {
|
||||
// 监听规则的变化
|
||||
rules: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
this.setRules(n);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
|
||||
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
|
||||
init() {
|
||||
this.updateParentData();
|
||||
if (!this.parent) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("u-form-item需要结合u-form组件使用");
|
||||
}
|
||||
},
|
||||
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
|
||||
setRules(rules) {
|
||||
if (rules.length === 0) {
|
||||
this.itemRules = [];
|
||||
return;
|
||||
}
|
||||
this.itemRules = rules;
|
||||
},
|
||||
// 获取父组件的参数
|
||||
updateParentData() {
|
||||
this.getParentData("u-form");
|
||||
},
|
||||
// 移除u-form-item的校验结果
|
||||
clearValidate() {
|
||||
this.message = null;
|
||||
},
|
||||
// 清空当前的组件的校验结果,并重置为初始值
|
||||
resetField() {
|
||||
const value = uni_modules_uviewPlus_libs_function_index.getProperty(this.parent.originalModel, this.prop);
|
||||
uni_modules_uviewPlus_libs_function_index.setProperty(this.parent.model, this.prop, value);
|
||||
this.message = null;
|
||||
},
|
||||
// 点击组件
|
||||
clickHandler() {
|
||||
this.$emit("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
||||
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
|
||||
(_easycom_up_icon2 + _easycom_u_line2)();
|
||||
}
|
||||
const _easycom_up_icon = () => "../u-icon/u-icon.js";
|
||||
const _easycom_u_line = () => "../u-line/u-line.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_icon + _easycom_u_line)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.required || _ctx.leftIcon || _ctx.label
|
||||
}, _ctx.required || _ctx.leftIcon || _ctx.label ? common_vendor.e({
|
||||
b: _ctx.required
|
||||
}, _ctx.required ? {} : {}, {
|
||||
c: _ctx.leftIcon
|
||||
}, _ctx.leftIcon ? {
|
||||
d: common_vendor.p({
|
||||
name: _ctx.leftIcon,
|
||||
["custom-style"]: _ctx.leftIconStyle
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.t(_ctx.label),
|
||||
f: common_vendor.s($data.parentData.labelStyle),
|
||||
g: common_vendor.s({
|
||||
justifyContent: $data.parentData.labelAlign === "left" ? "flex-start" : $data.parentData.labelAlign === "center" ? "center" : "flex-end"
|
||||
}),
|
||||
h: $options.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
|
||||
i: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? 0 : "5px"
|
||||
}) : {}, {
|
||||
j: _ctx.$slots.right
|
||||
}, _ctx.$slots.right ? {} : {}, {
|
||||
k: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
|
||||
l: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
m: common_vendor.s({
|
||||
flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
|
||||
}),
|
||||
n: !!$data.message && $data.parentData.errorType === "message"
|
||||
}, !!$data.message && $data.parentData.errorType === "message" ? {
|
||||
o: common_vendor.t($data.message),
|
||||
p: $options.addUnit((_ctx.labelPosition || $data.parentData.labelPosition) === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
|
||||
} : {}, {
|
||||
q: _ctx.borderBottom
|
||||
}, _ctx.borderBottom ? {
|
||||
r: common_vendor.p({
|
||||
color: $data.message && $data.parentData.errorType === "border-bottom" ? $data.color.error : $options.propsLine.color,
|
||||
customStyle: `margin-top: ${$data.message && $data.parentData.errorType === "message" ? "5px" : 0}`
|
||||
})
|
||||
} : {}, {
|
||||
s: !!$data.message && $data.parentData.errorType === "message" ? 1 : ""
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-42bac3de"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"up-icon": "../u-icon/u-icon",
|
||||
"u-line": "../u-line/u-line"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-form-item', 'data-v-42bac3de', s && 'u-form-item--error', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="u-form-item__body data-v-42bac3de" bindtap="{{k}}" style="{{l + ';' + m}}"><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else><view wx:if="{{a}}" class="u-form-item__body__left data-v-42bac3de" style="{{'width:' + h + ';' + ('margin-bottom:' + i)}}"><view class="u-form-item__body__left__content data-v-42bac3de"><text wx:if="{{b}}" class="u-form-item__body__left__content__required data-v-42bac3de">*</text><view wx:if="{{c}}" class="u-form-item__body__left__content__icon data-v-42bac3de"><up-icon wx:if="{{d}}" class="data-v-42bac3de" virtualHostClass="data-v-42bac3de" u-i="42bac3de-0" bind:__l="__l" u-p="{{d}}"></up-icon></view><text class="u-form-item__body__left__content__label data-v-42bac3de" style="{{f + ';' + g}}">{{e}}</text></view></view></block><view class="u-form-item__body__right data-v-42bac3de"><view class="u-form-item__body__right__content data-v-42bac3de"><view class="u-form-item__body__right__content__slot data-v-42bac3de"><slot/></view><view wx:if="{{j}}" class="item__body__right__content__icon data-v-42bac3de"><slot name="right"/></view></view></view></view><block wx:if="{{$slots.error}}"><slot name="error"></slot></block><block wx:else><text wx:if="{{n}}" class="u-form-item__body__right__message data-v-42bac3de" style="{{'margin-left:' + p}}">{{o}}</text></block><u-line wx:if="{{q}}" class="data-v-42bac3de" virtualHostClass="data-v-42bac3de" u-i="42bac3de-1" bind:__l="__l" u-p="{{r}}"></u-line></view>
|
||||
@@ -1,94 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-form-item.data-v-42bac3de {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
}
|
||||
.u-form-item__body.data-v-42bac3de {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.u-form-item__body__left.data-v-42bac3de {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-form-item__body__left__content.data-v-42bac3de {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-right: 10rpx;
|
||||
flex: 1;
|
||||
}
|
||||
.u-form-item__body__left__content__icon.data-v-42bac3de {
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.u-form-item__body__left__content__required.data-v-42bac3de {
|
||||
position: absolute;
|
||||
left: -9px;
|
||||
color: #f56c6c;
|
||||
line-height: 20px;
|
||||
font-size: 20px;
|
||||
top: 3px;
|
||||
}
|
||||
.u-form-item__body__left__content__label.data-v-42bac3de {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
color: #303133;
|
||||
font-size: 15px;
|
||||
}
|
||||
.u-form-item__body__right.data-v-42bac3de {
|
||||
flex: 1;
|
||||
}
|
||||
.u-form-item__body__right__content.data-v-42bac3de {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
.u-form-item__body__right__content__slot.data-v-42bac3de {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-form-item__body__right__content__icon.data-v-42bac3de {
|
||||
margin-left: 10rpx;
|
||||
color: #c0c4cc;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.u-form-item__body__right__message.data-v-42bac3de {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
const Form = {
|
||||
// form 组件
|
||||
form: {
|
||||
model: {},
|
||||
rules: {},
|
||||
errorType: "message",
|
||||
borderBottom: true,
|
||||
labelPosition: "left",
|
||||
labelWidth: 45,
|
||||
labelAlign: "left",
|
||||
labelStyle: {}
|
||||
}
|
||||
};
|
||||
exports.Form = Form;
|
||||
@@ -1,49 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 当前form的需要验证字段的集合
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.model
|
||||
},
|
||||
// 验证规则
|
||||
rules: {
|
||||
type: [Object, Function, Array],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.rules
|
||||
},
|
||||
// 有错误时的提示方式,message-提示信息,toast-进行toast提示
|
||||
// border-bottom-下边框呈现红色,none-无提示
|
||||
errorType: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.errorType
|
||||
},
|
||||
// 是否显示表单域的下划线边框
|
||||
borderBottom: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.borderBottom
|
||||
},
|
||||
// label的位置,left-左边,top-上边
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelPosition
|
||||
},
|
||||
// label的宽度,单位px
|
||||
labelWidth: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelWidth
|
||||
},
|
||||
// lable字体的对齐方式
|
||||
labelAlign: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelAlign
|
||||
},
|
||||
// lable的样式,对象形式
|
||||
labelStyle: {
|
||||
type: Object,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelStyle
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,208 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uForm_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_util_asyncValidator = require("../../libs/util/async-validator.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
uni_modules_uviewPlus_libs_util_asyncValidator.Schema.warning = function() {
|
||||
};
|
||||
const _sfc_main = {
|
||||
name: "u-form",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uForm_props.props],
|
||||
provide() {
|
||||
return {
|
||||
uForm: this
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formRules: {},
|
||||
// 规则校验器
|
||||
validator: {},
|
||||
// 原始的model快照,用于resetFields方法重置表单时使用
|
||||
originalModel: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 监听规则的变化
|
||||
rules: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
this.setRules(n);
|
||||
}
|
||||
},
|
||||
// 监听属性的变化,通知子组件u-form-item重新获取信息
|
||||
propsChange(n) {
|
||||
var _a;
|
||||
if ((_a = this.children) == null ? void 0 : _a.length) {
|
||||
this.children.map((child) => {
|
||||
typeof child.updateParentData == "function" && child.updateParentData();
|
||||
});
|
||||
}
|
||||
},
|
||||
// 监听model的初始值作为重置表单的快照
|
||||
model: {
|
||||
immediate: true,
|
||||
handler(n) {
|
||||
if (!this.originalModel) {
|
||||
this.originalModel = uni_modules_uviewPlus_libs_function_index.deepClone(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
propsChange() {
|
||||
return [
|
||||
this.errorType,
|
||||
this.borderBottom,
|
||||
this.labelPosition,
|
||||
this.labelWidth,
|
||||
this.labelAlign,
|
||||
this.labelStyle
|
||||
];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.children = [];
|
||||
},
|
||||
methods: {
|
||||
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
|
||||
setRules(rules) {
|
||||
if (Object.keys(rules).length === 0)
|
||||
return;
|
||||
if (Object.keys(this.model).length === 0) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("设置rules,model必须设置!如果已经设置,请刷新页面。");
|
||||
return;
|
||||
}
|
||||
this.formRules = rules;
|
||||
this.validator = new uni_modules_uviewPlus_libs_util_asyncValidator.Schema(rules);
|
||||
},
|
||||
// 清空所有u-form-item组件的内容,本质上是调用了u-form-item组件中的resetField()方法
|
||||
resetFields() {
|
||||
this.resetModel();
|
||||
},
|
||||
// 重置model为初始值的快照
|
||||
resetModel(obj) {
|
||||
this.children.map((child) => {
|
||||
const prop = child == null ? void 0 : child.prop;
|
||||
const value = uni_modules_uviewPlus_libs_function_index.getProperty(this.originalModel, prop);
|
||||
uni_modules_uviewPlus_libs_function_index.setProperty(this.model, prop, value);
|
||||
});
|
||||
},
|
||||
// 清空校验结果
|
||||
clearValidate(props2) {
|
||||
props2 = [].concat(props2);
|
||||
this.children.map((child) => {
|
||||
if (props2[0] === void 0 || props2.includes(child.prop)) {
|
||||
child.message = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 对部分表单字段进行校验
|
||||
async validateField(value, callback, event = null, options) {
|
||||
this.$nextTick(() => {
|
||||
const errorsRes = [];
|
||||
value = [].concat(value);
|
||||
let promises = this.children.map((child) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const childErrors = [];
|
||||
if (value.includes(child.prop)) {
|
||||
const propertyVal = uni_modules_uviewPlus_libs_function_index.getProperty(
|
||||
this.model,
|
||||
child.prop
|
||||
);
|
||||
const propertyChain = child.prop.split(".");
|
||||
const propertyName = propertyChain[propertyChain.length - 1];
|
||||
let rule = [];
|
||||
if (child.itemRules && child.itemRules.length > 0) {
|
||||
rule = child.itemRules;
|
||||
} else {
|
||||
rule = this.formRules[child.prop];
|
||||
}
|
||||
if (!rule) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const rules = [].concat(rule);
|
||||
if (!rules.length) {
|
||||
resolve();
|
||||
}
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
const ruleItem = rules[i];
|
||||
const trigger = [].concat(ruleItem == null ? void 0 : ruleItem.trigger);
|
||||
if (event && !trigger.includes(event)) {
|
||||
resolve();
|
||||
continue;
|
||||
}
|
||||
const validator = new uni_modules_uviewPlus_libs_util_asyncValidator.Schema({
|
||||
[propertyName]: ruleItem
|
||||
});
|
||||
validator.validate(
|
||||
{
|
||||
[propertyName]: propertyVal
|
||||
},
|
||||
(errors, fields) => {
|
||||
var _a;
|
||||
if (uni_modules_uviewPlus_libs_function_test.test.array(errors)) {
|
||||
errors.forEach((element) => {
|
||||
element.prop = child.prop;
|
||||
});
|
||||
errorsRes.push(...errors);
|
||||
childErrors.push(...errors);
|
||||
}
|
||||
if (!options || (options == null ? void 0 : options.showErrorMsg) == true) {
|
||||
child.message = ((_a = childErrors[0]) == null ? void 0 : _a.message) ? childErrors[0].message : null;
|
||||
}
|
||||
if (i == rules.length - 1) {
|
||||
resolve(errorsRes);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
resolve({});
|
||||
}
|
||||
});
|
||||
});
|
||||
Promise.all(promises).then((results) => {
|
||||
typeof callback === "function" && callback(errorsRes);
|
||||
}).catch((error2) => {
|
||||
console.error("An error occurred:", error2);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 校验全部数据
|
||||
* @param {Object} options
|
||||
* @param {Boolean} options.showErrorMsg -是否显示校验信息,
|
||||
*/
|
||||
validate(options) {
|
||||
if (Object.keys(this.formRules).length === 0) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("未设置rules,请看文档说明!如果已经设置,请刷新页面。");
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$nextTick(() => {
|
||||
const formItemProps = this.children.map(
|
||||
(item) => item.prop
|
||||
);
|
||||
this.validateField(formItemProps, (errors) => {
|
||||
if (errors.length) {
|
||||
this.errorType === "toast" && uni_modules_uviewPlus_libs_function_index.toast(errors[0].message);
|
||||
reject(errors);
|
||||
} else {
|
||||
resolve(true);
|
||||
}
|
||||
}, null, options);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-form', virtualHostClass]}}" style="{{virtualHostStyle}}"><slot/></view>
|
||||
@@ -1,12 +0,0 @@
|
||||
"use strict";
|
||||
const Gap = {
|
||||
// gap组件
|
||||
gap: {
|
||||
bgColor: "transparent",
|
||||
height: 20,
|
||||
marginTop: 0,
|
||||
marginBottom: 0,
|
||||
customStyle: {}
|
||||
}
|
||||
};
|
||||
exports.Gap = Gap;
|
||||
@@ -1,28 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 背景颜色(默认transparent)
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.gap.bgColor
|
||||
},
|
||||
// 分割槽高度,单位px(默认30)
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.gap.height
|
||||
},
|
||||
// 与上一个组件的距离
|
||||
marginTop: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.gap.marginTop
|
||||
},
|
||||
// 与下一个组件的距离
|
||||
marginBottom: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.gap.marginBottom
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,28 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uGap_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-gap",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uGap_props.props],
|
||||
computed: {
|
||||
gapStyle() {
|
||||
const style = {
|
||||
backgroundColor: this.bgColor,
|
||||
height: uni_modules_uviewPlus_libs_function_index.addUnit(this.height),
|
||||
marginTop: uni_modules_uviewPlus_libs_function_index.addUnit(this.marginTop),
|
||||
marginBottom: uni_modules_uviewPlus_libs_function_index.addUnit(this.marginBottom)
|
||||
};
|
||||
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.s($options.gapStyle)
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view style="{{a + ';' + virtualHostStyle}}" class="{{['u-gap', virtualHostClass]}}"></view>
|
||||
@@ -1,9 +0,0 @@
|
||||
"use strict";
|
||||
const GridItem = {
|
||||
// grid-item组件
|
||||
gridItem: {
|
||||
name: null,
|
||||
bgColor: "transparent"
|
||||
}
|
||||
};
|
||||
exports.GridItem = GridItem;
|
||||
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
const Grid = {
|
||||
// grid组件
|
||||
grid: {
|
||||
col: 3,
|
||||
border: false,
|
||||
align: "left"
|
||||
}
|
||||
};
|
||||
exports.Grid = Grid;
|
||||
@@ -1,28 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_config_config = require("../../libs/config/config.js");
|
||||
const {
|
||||
color
|
||||
} = uni_modules_uviewPlus_libs_config_config.config;
|
||||
const Icon = {
|
||||
// icon组件
|
||||
icon: {
|
||||
name: "",
|
||||
color: color["u-content-color"],
|
||||
size: "16px",
|
||||
bold: false,
|
||||
index: "",
|
||||
hoverClass: "",
|
||||
customPrefix: "uicon",
|
||||
label: "",
|
||||
labelPos: "right",
|
||||
labelSize: "15px",
|
||||
labelColor: color["u-content-color"],
|
||||
space: "3px",
|
||||
imgMode: "",
|
||||
width: "",
|
||||
height: "",
|
||||
top: 0,
|
||||
stop: false
|
||||
}
|
||||
};
|
||||
exports.Icon = Icon;
|
||||
@@ -1,216 +0,0 @@
|
||||
"use strict";
|
||||
const icons = {
|
||||
"uicon-level": "",
|
||||
"uicon-column-line": "",
|
||||
"uicon-checkbox-mark": "",
|
||||
"uicon-folder": "",
|
||||
"uicon-movie": "",
|
||||
"uicon-star-fill": "",
|
||||
"uicon-star": "",
|
||||
"uicon-phone-fill": "",
|
||||
"uicon-phone": "",
|
||||
"uicon-apple-fill": "",
|
||||
"uicon-chrome-circle-fill": "",
|
||||
"uicon-backspace": "",
|
||||
"uicon-attach": "",
|
||||
"uicon-cut": "",
|
||||
"uicon-empty-car": "",
|
||||
"uicon-empty-coupon": "",
|
||||
"uicon-empty-address": "",
|
||||
"uicon-empty-favor": "",
|
||||
"uicon-empty-permission": "",
|
||||
"uicon-empty-news": "",
|
||||
"uicon-empty-search": "",
|
||||
"uicon-github-circle-fill": "",
|
||||
"uicon-rmb": "",
|
||||
"uicon-person-delete-fill": "",
|
||||
"uicon-reload": "",
|
||||
"uicon-order": "",
|
||||
"uicon-server-man": "",
|
||||
"uicon-search": "",
|
||||
"uicon-fingerprint": "",
|
||||
"uicon-more-dot-fill": "",
|
||||
"uicon-scan": "",
|
||||
"uicon-share-square": "",
|
||||
"uicon-map": "",
|
||||
"uicon-map-fill": "",
|
||||
"uicon-tags": "",
|
||||
"uicon-tags-fill": "",
|
||||
"uicon-bookmark-fill": "",
|
||||
"uicon-bookmark": "",
|
||||
"uicon-eye": "",
|
||||
"uicon-eye-fill": "",
|
||||
"uicon-mic": "",
|
||||
"uicon-mic-off": "",
|
||||
"uicon-calendar": "",
|
||||
"uicon-calendar-fill": "",
|
||||
"uicon-trash": "",
|
||||
"uicon-trash-fill": "",
|
||||
"uicon-play-left": "",
|
||||
"uicon-play-right": "",
|
||||
"uicon-minus": "",
|
||||
"uicon-plus": "",
|
||||
"uicon-info": "",
|
||||
"uicon-info-circle": "",
|
||||
"uicon-info-circle-fill": "",
|
||||
"uicon-question": "",
|
||||
"uicon-error": "",
|
||||
"uicon-close": "",
|
||||
"uicon-checkmark": "",
|
||||
"uicon-android-circle-fill": "",
|
||||
"uicon-android-fill": "",
|
||||
"uicon-ie": "",
|
||||
"uicon-IE-circle-fill": "",
|
||||
"uicon-google": "",
|
||||
"uicon-google-circle-fill": "",
|
||||
"uicon-setting-fill": "",
|
||||
"uicon-setting": "",
|
||||
"uicon-minus-square-fill": "",
|
||||
"uicon-plus-square-fill": "",
|
||||
"uicon-heart": "",
|
||||
"uicon-heart-fill": "",
|
||||
"uicon-camera": "",
|
||||
"uicon-camera-fill": "",
|
||||
"uicon-more-circle": "",
|
||||
"uicon-more-circle-fill": "",
|
||||
"uicon-chat": "",
|
||||
"uicon-chat-fill": "",
|
||||
"uicon-bag-fill": "",
|
||||
"uicon-bag": "",
|
||||
"uicon-error-circle-fill": "",
|
||||
"uicon-error-circle": "",
|
||||
"uicon-close-circle": "",
|
||||
"uicon-close-circle-fill": "",
|
||||
"uicon-checkmark-circle": "",
|
||||
"uicon-checkmark-circle-fill": "",
|
||||
"uicon-question-circle-fill": "",
|
||||
"uicon-question-circle": "",
|
||||
"uicon-share": "",
|
||||
"uicon-share-fill": "",
|
||||
"uicon-shopping-cart": "",
|
||||
"uicon-shopping-cart-fill": "",
|
||||
"uicon-bell": "",
|
||||
"uicon-bell-fill": "",
|
||||
"uicon-list": "",
|
||||
"uicon-list-dot": "",
|
||||
"uicon-zhihu": "",
|
||||
"uicon-zhihu-circle-fill": "",
|
||||
"uicon-zhifubao": "",
|
||||
"uicon-zhifubao-circle-fill": "",
|
||||
"uicon-weixin-circle-fill": "",
|
||||
"uicon-weixin-fill": "",
|
||||
"uicon-twitter-circle-fill": "",
|
||||
"uicon-twitter": "",
|
||||
"uicon-taobao-circle-fill": "",
|
||||
"uicon-taobao": "",
|
||||
"uicon-weibo-circle-fill": "",
|
||||
"uicon-weibo": "",
|
||||
"uicon-qq-fill": "",
|
||||
"uicon-qq-circle-fill": "",
|
||||
"uicon-moments-circel-fill": "",
|
||||
"uicon-moments": "",
|
||||
"uicon-qzone": "",
|
||||
"uicon-qzone-circle-fill": "",
|
||||
"uicon-baidu-circle-fill": "",
|
||||
"uicon-baidu": "",
|
||||
"uicon-facebook-circle-fill": "",
|
||||
"uicon-facebook": "",
|
||||
"uicon-car": "",
|
||||
"uicon-car-fill": "",
|
||||
"uicon-warning-fill": "",
|
||||
"uicon-warning": "",
|
||||
"uicon-clock-fill": "",
|
||||
"uicon-clock": "",
|
||||
"uicon-edit-pen": "",
|
||||
"uicon-edit-pen-fill": "",
|
||||
"uicon-email": "",
|
||||
"uicon-email-fill": "",
|
||||
"uicon-minus-circle": "",
|
||||
"uicon-minus-circle-fill": "",
|
||||
"uicon-plus-circle": "",
|
||||
"uicon-plus-circle-fill": "",
|
||||
"uicon-file-text": "",
|
||||
"uicon-file-text-fill": "",
|
||||
"uicon-pushpin": "",
|
||||
"uicon-pushpin-fill": "",
|
||||
"uicon-grid": "",
|
||||
"uicon-grid-fill": "",
|
||||
"uicon-play-circle": "",
|
||||
"uicon-play-circle-fill": "",
|
||||
"uicon-pause-circle-fill": "",
|
||||
"uicon-pause": "",
|
||||
"uicon-pause-circle": "",
|
||||
"uicon-eye-off": "",
|
||||
"uicon-eye-off-outline": "",
|
||||
"uicon-gift-fill": "",
|
||||
"uicon-gift": "",
|
||||
"uicon-rmb-circle-fill": "",
|
||||
"uicon-rmb-circle": "",
|
||||
"uicon-kefu-ermai": "",
|
||||
"uicon-server-fill": "",
|
||||
"uicon-coupon-fill": "",
|
||||
"uicon-coupon": "",
|
||||
"uicon-integral": "",
|
||||
"uicon-integral-fill": "",
|
||||
"uicon-home-fill": "",
|
||||
"uicon-home": "",
|
||||
"uicon-hourglass-half-fill": "",
|
||||
"uicon-hourglass": "",
|
||||
"uicon-account": "",
|
||||
"uicon-plus-people-fill": "",
|
||||
"uicon-minus-people-fill": "",
|
||||
"uicon-account-fill": "",
|
||||
"uicon-thumb-down-fill": "",
|
||||
"uicon-thumb-down": "",
|
||||
"uicon-thumb-up": "",
|
||||
"uicon-thumb-up-fill": "",
|
||||
"uicon-lock-fill": "",
|
||||
"uicon-lock-open": "",
|
||||
"uicon-lock-opened-fill": "",
|
||||
"uicon-lock": "",
|
||||
"uicon-red-packet-fill": "",
|
||||
"uicon-photo-fill": "",
|
||||
"uicon-photo": "",
|
||||
"uicon-volume-off-fill": "",
|
||||
"uicon-volume-off": "",
|
||||
"uicon-volume-fill": "",
|
||||
"uicon-volume": "",
|
||||
"uicon-red-packet": "",
|
||||
"uicon-download": "",
|
||||
"uicon-arrow-up-fill": "",
|
||||
"uicon-arrow-down-fill": "",
|
||||
"uicon-play-left-fill": "",
|
||||
"uicon-play-right-fill": "",
|
||||
"uicon-rewind-left-fill": "",
|
||||
"uicon-rewind-right-fill": "",
|
||||
"uicon-arrow-downward": "",
|
||||
"uicon-arrow-leftward": "",
|
||||
"uicon-arrow-rightward": "",
|
||||
"uicon-arrow-upward": "",
|
||||
"uicon-arrow-down": "",
|
||||
"uicon-arrow-right": "",
|
||||
"uicon-arrow-left": "",
|
||||
"uicon-arrow-up": "",
|
||||
"uicon-skip-back-left": "",
|
||||
"uicon-skip-forward-right": "",
|
||||
"uicon-rewind-right": "",
|
||||
"uicon-rewind-left": "",
|
||||
"uicon-arrow-right-double": "",
|
||||
"uicon-arrow-left-double": "",
|
||||
"uicon-wifi-off": "",
|
||||
"uicon-wifi": "",
|
||||
"uicon-empty-data": "",
|
||||
"uicon-empty-history": "",
|
||||
"uicon-empty-list": "",
|
||||
"uicon-empty-page": "",
|
||||
"uicon-empty-order": "",
|
||||
"uicon-man": "",
|
||||
"uicon-woman": "",
|
||||
"uicon-man-add": "",
|
||||
"uicon-man-add-fill": "",
|
||||
"uicon-man-delete": "",
|
||||
"uicon-man-delete-fill": "",
|
||||
"uicon-zh": "",
|
||||
"uicon-en": ""
|
||||
};
|
||||
exports.icons = icons;
|
||||
@@ -1,93 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 图标类名
|
||||
name: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.name
|
||||
},
|
||||
// 图标颜色,可接受主题色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.color
|
||||
},
|
||||
// 字体大小,单位px
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.size
|
||||
},
|
||||
// 是否显示粗体
|
||||
bold: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.bold
|
||||
},
|
||||
// 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
|
||||
index: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.index
|
||||
},
|
||||
// 触摸图标时的类名
|
||||
hoverClass: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.hoverClass
|
||||
},
|
||||
// 自定义扩展前缀,方便用户扩展自己的图标库
|
||||
customPrefix: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.customPrefix
|
||||
},
|
||||
// 图标右边或者下面的文字
|
||||
label: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.label
|
||||
},
|
||||
// label的位置,只能右边或者下边
|
||||
labelPos: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.labelPos
|
||||
},
|
||||
// label的大小
|
||||
labelSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.labelSize
|
||||
},
|
||||
// label的颜色
|
||||
labelColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.labelColor
|
||||
},
|
||||
// label与图标的距离
|
||||
space: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.space
|
||||
},
|
||||
// 图片的mode
|
||||
imgMode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.imgMode
|
||||
},
|
||||
// 用于显示图片小图标时,图片的宽度
|
||||
width: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.width
|
||||
},
|
||||
// 用于显示图片小图标时,图片的高度
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.height
|
||||
},
|
||||
// 用于解决某些情况下,让图标垂直居中的用途
|
||||
top: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.top
|
||||
},
|
||||
// 是否阻止事件传播
|
||||
stop: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.icon.stop
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,108 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uIcon_icons = require("./icons.js");
|
||||
const uni_modules_uviewPlus_components_uIcon_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_config_config = require("../../libs/config/config.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_components_uIcon_util = require("./util.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-icon",
|
||||
beforeCreate() {
|
||||
if (!uni_modules_uviewPlus_components_uIcon_util.fontUtil.params.loaded) {
|
||||
uni_modules_uviewPlus_components_uIcon_util.fontUtil.loadFont();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
emits: ["click"],
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uIcon_props.props],
|
||||
computed: {
|
||||
uClasses() {
|
||||
let classes = [];
|
||||
classes.push(this.customPrefix + "-" + this.name);
|
||||
if (this.customPrefix == "uicon") {
|
||||
classes.push("u-iconfont");
|
||||
} else {
|
||||
classes.push(this.customPrefix);
|
||||
}
|
||||
if (this.color && uni_modules_uviewPlus_libs_config_config.config.type.includes(this.color))
|
||||
classes.push("u-icon__icon--" + this.color);
|
||||
return classes;
|
||||
},
|
||||
iconStyle() {
|
||||
let style = {};
|
||||
style = {
|
||||
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.size),
|
||||
lineHeight: uni_modules_uviewPlus_libs_function_index.addUnit(this.size),
|
||||
fontWeight: this.bold ? "bold" : "normal",
|
||||
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
|
||||
top: uni_modules_uviewPlus_libs_function_index.addUnit(this.top)
|
||||
};
|
||||
if (this.customPrefix !== "uicon") {
|
||||
style.fontFamily = this.customPrefix;
|
||||
}
|
||||
if (this.color && !uni_modules_uviewPlus_libs_config_config.config.type.includes(this.color))
|
||||
style.color = this.color;
|
||||
return style;
|
||||
},
|
||||
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
|
||||
isImg() {
|
||||
return this.name.indexOf("/") !== -1;
|
||||
},
|
||||
imgStyle() {
|
||||
let style = {};
|
||||
style.width = this.width ? uni_modules_uviewPlus_libs_function_index.addUnit(this.width) : uni_modules_uviewPlus_libs_function_index.addUnit(this.size);
|
||||
style.height = this.height ? uni_modules_uviewPlus_libs_function_index.addUnit(this.height) : uni_modules_uviewPlus_libs_function_index.addUnit(this.size);
|
||||
return style;
|
||||
},
|
||||
// 通过图标名,查找对应的图标
|
||||
icon() {
|
||||
if (this.customPrefix !== "uicon") {
|
||||
return uni_modules_uviewPlus_libs_config_config.config.customIcons[this.name] || this.name;
|
||||
}
|
||||
return uni_modules_uviewPlus_components_uIcon_icons.icons["uicon-" + this.name] || this.name;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
|
||||
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
|
||||
clickHandler(e) {
|
||||
this.$emit("click", this.index, e);
|
||||
this.stop && this.preventEvent(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $options.isImg
|
||||
}, $options.isImg ? {
|
||||
b: _ctx.name,
|
||||
c: _ctx.imgMode,
|
||||
d: common_vendor.s($options.imgStyle),
|
||||
e: common_vendor.s($options.addStyle(_ctx.customStyle))
|
||||
} : {
|
||||
f: common_vendor.t($options.icon),
|
||||
g: common_vendor.n($options.uClasses),
|
||||
h: common_vendor.s($options.iconStyle),
|
||||
i: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
j: _ctx.hoverClass
|
||||
}, {
|
||||
k: _ctx.label !== ""
|
||||
}, _ctx.label !== "" ? {
|
||||
l: common_vendor.t(_ctx.label),
|
||||
m: _ctx.labelColor,
|
||||
n: $options.addUnit(_ctx.labelSize),
|
||||
o: _ctx.labelPos == "right" ? $options.addUnit(_ctx.space) : 0,
|
||||
p: _ctx.labelPos == "bottom" ? $options.addUnit(_ctx.space) : 0,
|
||||
q: _ctx.labelPos == "left" ? $options.addUnit(_ctx.space) : 0,
|
||||
r: _ctx.labelPos == "top" ? $options.addUnit(_ctx.space) : 0
|
||||
} : {}, {
|
||||
s: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
|
||||
t: common_vendor.n("u-icon--" + _ctx.labelPos)
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ac70166d"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view bindtap="{{s}}" class="{{['u-icon', 'data-v-ac70166d', t, virtualHostClass]}}" style="{{virtualHostStyle}}"><image wx:if="{{a}}" class="u-icon__img data-v-ac70166d" src="{{b}}" mode="{{c}}" style="{{d + ';' + e}}"></image><text wx:else class="{{['u-icon__icon', 'data-v-ac70166d', g]}}" style="{{h + ';' + i}}" hover-class="{{j}}">{{f}}</text><text wx:if="{{k}}" class="u-icon__label data-v-ac70166d" style="{{'color:' + m + ';' + ('font-size:' + n) + ';' + ('margin-left:' + o) + ';' + ('margin-top:' + p) + ';' + ('margin-right:' + q) + ';' + ('margin-bottom:' + r)}}">{{l}}</text></view>
|
||||
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-icon.data-v-ac70166d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--left.data-v-ac70166d {
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--right.data-v-ac70166d {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon--top.data-v-ac70166d {
|
||||
flex-direction: column-reverse;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-icon--bottom.data-v-ac70166d {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-icon__icon.data-v-ac70166d {
|
||||
font-family: uicon-iconfont;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.u-icon__icon--primary.data-v-ac70166d {
|
||||
color: #3c9cff;
|
||||
}
|
||||
.u-icon__icon--success.data-v-ac70166d {
|
||||
color: #5ac725;
|
||||
}
|
||||
.u-icon__icon--error.data-v-ac70166d {
|
||||
color: #f56c6c;
|
||||
}
|
||||
.u-icon__icon--warning.data-v-ac70166d {
|
||||
color: #f9ae3d;
|
||||
}
|
||||
.u-icon__icon--info.data-v-ac70166d {
|
||||
color: #909399;
|
||||
}
|
||||
.u-icon__img.data-v-ac70166d {
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
.u-icon__label.data-v-ac70166d {
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uviewPlus_libs_config_config = require("../../libs/config/config.js");
|
||||
let params = {
|
||||
loaded: false
|
||||
};
|
||||
const loadFont = () => {
|
||||
if (uni_modules_uviewPlus_libs_config_config.config.loadFontOnce) {
|
||||
params.loaded = true;
|
||||
}
|
||||
common_vendor.index.loadFontFace({
|
||||
global: true,
|
||||
// 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。
|
||||
family: "uicon-iconfont",
|
||||
source: 'url("' + uni_modules_uviewPlus_libs_config_config.config.iconUrl + '")',
|
||||
success() {
|
||||
},
|
||||
fail() {
|
||||
}
|
||||
});
|
||||
if (uni_modules_uviewPlus_libs_config_config.config.customIcon.family) {
|
||||
common_vendor.index.loadFontFace({
|
||||
global: true,
|
||||
// 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。
|
||||
family: uni_modules_uviewPlus_libs_config_config.config.customIcon.family,
|
||||
source: 'url("' + uni_modules_uviewPlus_libs_config_config.config.customIcon.url + '")',
|
||||
success() {
|
||||
},
|
||||
fail() {
|
||||
}
|
||||
});
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const fontUtil = {
|
||||
params,
|
||||
loadFont
|
||||
};
|
||||
exports.fontUtil = fontUtil;
|
||||
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
const Image = {
|
||||
// image组件
|
||||
image: {
|
||||
src: "",
|
||||
mode: "aspectFill",
|
||||
width: "300",
|
||||
height: "225",
|
||||
shape: "square",
|
||||
radius: 0,
|
||||
lazyLoad: true,
|
||||
showMenuByLongpress: true,
|
||||
loadingIcon: "photo",
|
||||
errorIcon: "error-circle",
|
||||
showLoading: true,
|
||||
showError: true,
|
||||
fade: true,
|
||||
webp: false,
|
||||
duration: 500,
|
||||
bgColor: "#f3f4f6"
|
||||
}
|
||||
};
|
||||
exports.Image = Image;
|
||||
@@ -1,12 +0,0 @@
|
||||
"use strict";
|
||||
const IndexAnchor = {
|
||||
// indexAnchor 组件
|
||||
indexAnchor: {
|
||||
text: "",
|
||||
color: "#606266",
|
||||
size: 14,
|
||||
bgColor: "#f1f1f1",
|
||||
height: 32
|
||||
}
|
||||
};
|
||||
exports.IndexAnchor = IndexAnchor;
|
||||
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
const IndexList = {
|
||||
// indexList 组件
|
||||
indexList: {
|
||||
inactiveColor: "#606266",
|
||||
activeColor: "#5677fc",
|
||||
indexList: [],
|
||||
sticky: true,
|
||||
customNavHeight: 0,
|
||||
safeBottomFix: false,
|
||||
itemMargin: "0rpx"
|
||||
}
|
||||
};
|
||||
exports.IndexList = IndexList;
|
||||
@@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
const Input = {
|
||||
// index 组件
|
||||
input: {
|
||||
value: "",
|
||||
type: "text",
|
||||
fixed: false,
|
||||
disabled: false,
|
||||
disabledColor: "#f5f7fa",
|
||||
clearable: false,
|
||||
password: false,
|
||||
maxlength: 140,
|
||||
placeholder: null,
|
||||
placeholderClass: "input-placeholder",
|
||||
placeholderStyle: "color: #c0c4cc",
|
||||
showWordLimit: false,
|
||||
confirmType: "done",
|
||||
confirmHold: false,
|
||||
holdKeyboard: false,
|
||||
focus: false,
|
||||
autoBlur: false,
|
||||
disableDefaultPadding: false,
|
||||
cursor: -1,
|
||||
cursorSpacing: 30,
|
||||
selectionStart: -1,
|
||||
selectionEnd: -1,
|
||||
adjustPosition: true,
|
||||
inputAlign: "left",
|
||||
fontSize: "15px",
|
||||
color: "#303133",
|
||||
prefixIcon: "",
|
||||
prefixIconStyle: "",
|
||||
suffixIcon: "",
|
||||
suffixIconStyle: "",
|
||||
border: "surround",
|
||||
readonly: false,
|
||||
shape: "square",
|
||||
formatter: null,
|
||||
cursorColor: "",
|
||||
passwordVisibilityToggle: true
|
||||
}
|
||||
};
|
||||
exports.Input = Input;
|
||||
@@ -1,205 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 绑定的值
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.value
|
||||
},
|
||||
// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
|
||||
// idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
|
||||
// digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
|
||||
// text-文本输入键盘
|
||||
type: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.type
|
||||
},
|
||||
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
|
||||
// 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.fixed
|
||||
},
|
||||
// 是否禁用输入框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.disabled
|
||||
},
|
||||
// 禁用状态时的背景色
|
||||
disabledColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.disabledColor
|
||||
},
|
||||
// 是否显示清除控件
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否仅在聚焦时显示清除控件
|
||||
onlyClearableOnFocused: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否密码类型
|
||||
password: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.password
|
||||
},
|
||||
// 最大输入长度,设置为 -1 的时候不限制最大长度
|
||||
maxlength: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.maxlength
|
||||
},
|
||||
// 输入框为空时的占位符
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.placeholder
|
||||
},
|
||||
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
|
||||
placeholderClass: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.placeholderClass
|
||||
},
|
||||
// 指定placeholder的样式
|
||||
placeholderStyle: {
|
||||
type: [String, Object],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.placeholderStyle
|
||||
},
|
||||
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
|
||||
showWordLimit: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.showWordLimit
|
||||
},
|
||||
// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
|
||||
// https://uniapp.dcloud.io/component/input
|
||||
// https://uniapp.dcloud.io/component/textarea
|
||||
confirmType: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.confirmType
|
||||
},
|
||||
// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
|
||||
confirmHold: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.confirmHold
|
||||
},
|
||||
// focus时,点击页面的时候不收起键盘,微信小程序有效
|
||||
holdKeyboard: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.holdKeyboard
|
||||
},
|
||||
// 自动获取焦点
|
||||
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
|
||||
focus: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.focus
|
||||
},
|
||||
// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
|
||||
autoBlur: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.autoBlur
|
||||
},
|
||||
// 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
|
||||
disableDefaultPadding: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.disableDefaultPadding
|
||||
},
|
||||
// 指定focus时光标的位置
|
||||
cursor: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.cursor
|
||||
},
|
||||
// 输入框聚焦时底部与键盘的距离
|
||||
cursorSpacing: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.cursorSpacing
|
||||
},
|
||||
// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
||||
selectionStart: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.selectionStart
|
||||
},
|
||||
// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
||||
selectionEnd: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.selectionEnd
|
||||
},
|
||||
// 键盘弹起时,是否自动上推页面
|
||||
adjustPosition: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.adjustPosition
|
||||
},
|
||||
// 输入框内容对齐方式,可选值为:left|center|right
|
||||
inputAlign: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.inputAlign
|
||||
},
|
||||
// 输入框字体的大小
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.fontSize
|
||||
},
|
||||
// 输入框字体颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.color
|
||||
},
|
||||
// 输入框前置图标
|
||||
prefixIcon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.prefixIcon
|
||||
},
|
||||
// 前置图标样式,对象或字符串
|
||||
prefixIconStyle: {
|
||||
type: [String, Object],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.prefixIconStyle
|
||||
},
|
||||
// 输入框后置图标
|
||||
suffixIcon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.suffixIcon
|
||||
},
|
||||
// 后置图标样式,对象或字符串
|
||||
suffixIconStyle: {
|
||||
type: [String, Object],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.suffixIconStyle
|
||||
},
|
||||
// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
|
||||
border: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.border
|
||||
},
|
||||
// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.readonly
|
||||
},
|
||||
// 输入框形状,circle-圆形,square-方形
|
||||
shape: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.shape
|
||||
},
|
||||
// 用于处理或者过滤输入框内容的方法
|
||||
formatter: {
|
||||
type: [Function, null],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.formatter
|
||||
},
|
||||
// 是否忽略组件内对文本合成系统事件的处理
|
||||
ignoreCompositionEvent: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 光标颜色
|
||||
cursorColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.cursorColor
|
||||
},
|
||||
// 密码类型可见性切换
|
||||
passwordVisibilityToggle: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.input.passwordVisibilityToggle
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,277 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uviewPlus_components_uInput_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const _sfc_main = {
|
||||
name: "u-input",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uInput_props.props],
|
||||
data() {
|
||||
return {
|
||||
// 清除操作
|
||||
clearInput: false,
|
||||
// 输入框的值
|
||||
innerValue: "",
|
||||
// 是否处于获得焦点状态
|
||||
focused: false,
|
||||
// value是否第一次变化,在watch中,由于加入immediate属性,会在第一次触发,此时不应该认为value发生了变化
|
||||
firstChange: true,
|
||||
// value绑定值的变化是由内部还是外部引起的
|
||||
changeFromInner: false,
|
||||
// 过滤处理方法
|
||||
innerFormatter: (value) => value,
|
||||
showPassword: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.formatter) {
|
||||
this.innerFormatter = this.formatter;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue: {
|
||||
immediate: true,
|
||||
handler(newVal, oldVal) {
|
||||
if (this.changeFromInner || this.innerValue === newVal) {
|
||||
this.changeFromInner = false;
|
||||
return;
|
||||
}
|
||||
this.innerValue = newVal;
|
||||
if (this.firstChange === false && this.changeFromInner === false) {
|
||||
this.valueChange(this.innerValue, true);
|
||||
} else {
|
||||
if (!this.firstChange)
|
||||
uni_modules_uviewPlus_libs_function_index.formValidate(this, "change");
|
||||
}
|
||||
this.firstChange = false;
|
||||
this.changeFromInner = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 是否密码
|
||||
isPassword() {
|
||||
let ret = false;
|
||||
if (this.password) {
|
||||
ret = true;
|
||||
} else if (this.type == "password") {
|
||||
ret = true;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
if (this.showPassword) {
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
// 是否显示清除控件
|
||||
isShowClear() {
|
||||
const { clearable, readonly, focused, innerValue, onlyClearableOnFocused } = this;
|
||||
if (!clearable || readonly) {
|
||||
return false;
|
||||
}
|
||||
if (onlyClearableOnFocused) {
|
||||
return !!focused && innerValue !== "";
|
||||
} else {
|
||||
return innerValue !== "";
|
||||
}
|
||||
},
|
||||
// 组件的类名
|
||||
inputClass() {
|
||||
let classes = [], { border, disabled, shape } = this;
|
||||
border === "surround" && (classes = classes.concat(["u-border", "u-input--radius"]));
|
||||
classes.push(`u-input--${shape}`);
|
||||
border === "bottom" && (classes = classes.concat([
|
||||
"u-border-bottom",
|
||||
"u-input--no-radius"
|
||||
]));
|
||||
return classes.join(" ");
|
||||
},
|
||||
// 组件的样式
|
||||
wrapperStyle() {
|
||||
const style = {};
|
||||
if (this.disabled) {
|
||||
style.backgroundColor = this.disabledColor;
|
||||
}
|
||||
if (this.border === "none") {
|
||||
style.padding = "0";
|
||||
} else {
|
||||
style.paddingTop = "6px";
|
||||
style.paddingBottom = "6px";
|
||||
style.paddingLeft = "9px";
|
||||
style.paddingRight = "9px";
|
||||
}
|
||||
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
|
||||
},
|
||||
// 输入框的样式
|
||||
inputStyle() {
|
||||
const style = {
|
||||
color: this.color,
|
||||
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
|
||||
textAlign: this.inputAlign
|
||||
};
|
||||
return style;
|
||||
}
|
||||
},
|
||||
emits: ["update:modelValue", "focus", "blur", "change", "confirm", "clear", "keyboardheightchange", "nicknamereview"],
|
||||
methods: {
|
||||
// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
|
||||
setFormatter(e) {
|
||||
this.innerFormatter = e;
|
||||
},
|
||||
// 当键盘输入时,触发input事件
|
||||
onInput(e) {
|
||||
let { value = "" } = e.detail || {};
|
||||
this.innerValue = value;
|
||||
this.$nextTick(() => {
|
||||
let formatValue = this.innerFormatter(value);
|
||||
this.innerValue = formatValue;
|
||||
this.valueChange(formatValue);
|
||||
});
|
||||
},
|
||||
// 输入框失去焦点时触发
|
||||
onBlur(event) {
|
||||
this.$emit("blur", event.detail.value);
|
||||
uni_modules_uviewPlus_libs_function_index.sleep(150).then(() => {
|
||||
this.focused = false;
|
||||
});
|
||||
uni_modules_uviewPlus_libs_function_index.formValidate(this, "blur");
|
||||
},
|
||||
// 输入框聚焦时触发
|
||||
onFocus(event) {
|
||||
this.focused = true;
|
||||
this.$emit("focus");
|
||||
},
|
||||
doFocus() {
|
||||
this.$refs["input-native"].focus();
|
||||
},
|
||||
doBlur() {
|
||||
this.$refs["input-native"].blur();
|
||||
},
|
||||
// 点击完成按钮时触发
|
||||
onConfirm(event) {
|
||||
this.$emit("confirm", this.innerValue);
|
||||
},
|
||||
// 键盘高度发生变化的时候触发此事件
|
||||
// 兼容性:微信小程序2.7.0+、App 3.1.0+
|
||||
onkeyboardheightchange(event) {
|
||||
this.$emit("keyboardheightchange", event);
|
||||
},
|
||||
onnicknamereview(event) {
|
||||
this.$emit("nicknamereview", event);
|
||||
},
|
||||
// 内容发生变化,进行处理
|
||||
valueChange(value, isOut = false) {
|
||||
if (this.clearInput) {
|
||||
this.innerValue = "";
|
||||
this.clearInput = false;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
if (!isOut || this.clearInput) {
|
||||
this.changeFromInner = true;
|
||||
this.$emit("change", value);
|
||||
this.$emit("update:modelValue", value);
|
||||
}
|
||||
uni_modules_uviewPlus_libs_function_index.formValidate(this, "change");
|
||||
});
|
||||
},
|
||||
// 点击清除控件
|
||||
onClear() {
|
||||
this.clearInput = true;
|
||||
this.innerValue = "";
|
||||
this.$nextTick(() => {
|
||||
this.valueChange("");
|
||||
this.$emit("clear");
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 在安卓nvue上,事件无法冒泡
|
||||
* 在某些时间,我们希望监听u-from-item的点击事件,此时会导致点击u-form-item内的u-input后
|
||||
* 无法触发u-form-item的点击事件,这里通过手动调用u-form-item的方法进行触发
|
||||
*/
|
||||
clickHandler() {
|
||||
if (this.disabled || this.readonly) {
|
||||
common_vendor.index.hideKeyboard();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
||||
_easycom_up_icon2();
|
||||
}
|
||||
const _easycom_up_icon = () => "../u-icon/u-icon.js";
|
||||
if (!Math) {
|
||||
_easycom_up_icon();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.prefixIcon || _ctx.$slots.prefix
|
||||
}, _ctx.prefixIcon || _ctx.$slots.prefix ? {
|
||||
b: common_vendor.p({
|
||||
name: _ctx.prefixIcon,
|
||||
size: "18",
|
||||
customStyle: _ctx.prefixIconStyle
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.s($options.inputStyle),
|
||||
d: $data.showPassword && "password" == _ctx.type ? "text" : _ctx.type,
|
||||
e: _ctx.focus,
|
||||
f: _ctx.cursor,
|
||||
g: $data.innerValue,
|
||||
h: _ctx.autoBlur,
|
||||
i: _ctx.disabled || _ctx.readonly,
|
||||
j: _ctx.maxlength,
|
||||
k: _ctx.placeholder,
|
||||
l: _ctx.placeholderStyle,
|
||||
m: _ctx.placeholderClass,
|
||||
n: _ctx.confirmType,
|
||||
o: _ctx.confirmHold,
|
||||
p: _ctx.holdKeyboard,
|
||||
q: _ctx.cursorColor,
|
||||
r: _ctx.cursorSpacing,
|
||||
s: _ctx.adjustPosition,
|
||||
t: _ctx.selectionEnd,
|
||||
v: _ctx.selectionStart,
|
||||
w: $options.isPassword,
|
||||
x: _ctx.ignoreCompositionEvent,
|
||||
y: common_vendor.o((...args) => $options.onInput && $options.onInput(...args)),
|
||||
z: common_vendor.o((...args) => $options.onBlur && $options.onBlur(...args)),
|
||||
A: common_vendor.o((...args) => $options.onFocus && $options.onFocus(...args)),
|
||||
B: common_vendor.o((...args) => $options.onConfirm && $options.onConfirm(...args)),
|
||||
C: common_vendor.o((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args)),
|
||||
D: common_vendor.o((...args) => $options.onnicknamereview && $options.onnicknamereview(...args)),
|
||||
E: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
|
||||
F: $options.isShowClear
|
||||
}, $options.isShowClear ? {
|
||||
G: common_vendor.p({
|
||||
name: "close",
|
||||
size: "11",
|
||||
color: "#ffffff",
|
||||
customStyle: "line-height: 12px"
|
||||
}),
|
||||
H: common_vendor.o((...args) => $options.onClear && $options.onClear(...args))
|
||||
} : {}, {
|
||||
I: (_ctx.type == "password" || _ctx.password) && _ctx.passwordVisibilityToggle
|
||||
}, (_ctx.type == "password" || _ctx.password) && _ctx.passwordVisibilityToggle ? {
|
||||
J: common_vendor.o(($event) => $data.showPassword = !$data.showPassword),
|
||||
K: common_vendor.p({
|
||||
name: $data.showPassword ? "eye-off" : "eye-fill",
|
||||
size: "18"
|
||||
})
|
||||
} : {}, {
|
||||
L: _ctx.suffixIcon || _ctx.$slots.suffix
|
||||
}, _ctx.suffixIcon || _ctx.$slots.suffix ? {
|
||||
M: common_vendor.p({
|
||||
name: _ctx.suffixIcon,
|
||||
size: "18",
|
||||
customStyle: _ctx.suffixIconStyle
|
||||
})
|
||||
} : {}, {
|
||||
N: common_vendor.n($options.inputClass),
|
||||
O: common_vendor.s($options.wrapperStyle)
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-df79975b"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"up-icon": "../u-icon/u-icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-input', 'data-v-df79975b', N, virtualHostClass]}}" style="{{O + ';' + virtualHostStyle}}"><view class="u-input__content data-v-df79975b"><view wx:if="{{a}}" class="u-input__content__prefix-icon data-v-df79975b"><block wx:if="{{$slots.prefix}}"><slot name="prefix"></slot></block><block wx:else><up-icon wx:if="{{b}}" class="data-v-df79975b" virtualHostClass="data-v-df79975b" u-i="df79975b-0" bind:__l="__l" u-p="{{b}}"></up-icon></block></view><view class="u-input__content__field-wrapper data-v-df79975b" bindtap="{{E}}"><block wx:if="{{r0}}"><input ref="input-native" class="u-input__content__field-wrapper__field data-v-df79975b" style="{{c}}" type="{{d}}" focus="{{e}}" cursor="{{f}}" value="{{g}}" auto-blur="{{h}}" disabled="{{i}}" maxlength="{{j}}" placeholder="{{k}}" placeholder-style="{{l}}" placeholder-class="{{m}}" confirm-type="{{n}}" confirm-hold="{{o}}" hold-keyboard="{{p}}" cursor-color="{{q}}" cursor-spacing="{{r}}" adjust-position="{{s}}" selection-end="{{t}}" selection-start="{{v}}" password="{{w}}" ignoreCompositionEvent="{{x}}" bindinput="{{y}}" bindblur="{{z}}" bindfocus="{{A}}" bindconfirm="{{B}}" bindkeyboardheightchange="{{C}}" bindnicknamereview="{{D}}"/></block></view><view wx:if="{{F}}" class="u-input__content__clear data-v-df79975b" bindtap="{{H}}"><up-icon wx:if="{{G}}" class="data-v-df79975b" virtualHostClass="data-v-df79975b" u-i="df79975b-1" bind:__l="__l" u-p="{{G}}"></up-icon></view><view wx:if="{{I}}" class="u-input__content__subfix-password-shower data-v-df79975b"><up-icon wx:if="{{K}}" class="data-v-df79975b" virtualHostClass="data-v-df79975b" bindclick="{{J}}" u-i="df79975b-2" bind:__l="__l" u-p="{{K}}"></up-icon></view><view wx:if="{{L}}" class="u-input__content__subfix-icon data-v-df79975b"><block wx:if="{{$slots.suffix}}"><slot name="suffix"></slot></block><block wx:else><up-icon wx:if="{{M}}" class="data-v-df79975b" virtualHostClass="data-v-df79975b" u-i="df79975b-3" bind:__l="__l" u-p="{{M}}"></up-icon></block></view></view></view>
|
||||
@@ -1,82 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-input.data-v-df79975b {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
}
|
||||
.u-input--radius.data-v-df79975b, .u-input--square.data-v-df79975b {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.u-input--no-radius.data-v-df79975b {
|
||||
border-radius: 0;
|
||||
}
|
||||
.u-input--circle.data-v-df79975b {
|
||||
border-radius: 100px;
|
||||
}
|
||||
.u-input__content.data-v-df79975b {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.u-input__content__field-wrapper.data-v-df79975b {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.u-input__content__field-wrapper__field.data-v-df79975b {
|
||||
line-height: 26px;
|
||||
text-align: left;
|
||||
color: #303133;
|
||||
height: 24px;
|
||||
font-size: 15px;
|
||||
flex: 1;
|
||||
}
|
||||
.u-input__content__clear.data-v-df79975b {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 100px;
|
||||
background-color: #c6c7cb;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform: scale(0.82);
|
||||
margin-left: 4px;
|
||||
}
|
||||
.u-input__content__subfix-icon.data-v-df79975b {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.u-input__content__prefix-icon.data-v-df79975b {
|
||||
margin-right: 4px;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_i18n_index = require("../../libs/i18n/index.js");
|
||||
const Keyboard = {
|
||||
// 键盘组件
|
||||
keyboard: {
|
||||
mode: "number",
|
||||
dotDisabled: false,
|
||||
tooltip: true,
|
||||
showTips: true,
|
||||
tips: "",
|
||||
showCancel: true,
|
||||
showConfirm: true,
|
||||
random: false,
|
||||
safeAreaInsetBottom: true,
|
||||
closeOnClickOverlay: true,
|
||||
show: false,
|
||||
overlay: true,
|
||||
zIndex: 10075,
|
||||
cancelText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.cancel"),
|
||||
confirmText: uni_modules_uviewPlus_libs_i18n_index.t("up.common.confirm"),
|
||||
autoChange: false
|
||||
}
|
||||
};
|
||||
exports.Keyboard = Keyboard;
|
||||
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
const LineProgress = {
|
||||
// lineProgress 组件
|
||||
lineProgress: {
|
||||
activeColor: "#19be6b",
|
||||
inactiveColor: "#ececec",
|
||||
percentage: 0,
|
||||
showText: true,
|
||||
height: 12,
|
||||
fromRight: false
|
||||
}
|
||||
};
|
||||
exports.LineProgress = LineProgress;
|
||||
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
const Line = {
|
||||
// line组件
|
||||
line: {
|
||||
color: "#d6d7d9",
|
||||
length: "100%",
|
||||
direction: "row",
|
||||
hairline: true,
|
||||
margin: 0,
|
||||
dashed: false
|
||||
}
|
||||
};
|
||||
exports.Line = Line;
|
||||
@@ -1,37 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.color
|
||||
},
|
||||
// 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
|
||||
length: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.length
|
||||
},
|
||||
// 线条方向,col-竖向,row-横向
|
||||
direction: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.direction
|
||||
},
|
||||
// 是否显示细边框
|
||||
hairline: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.hairline
|
||||
},
|
||||
// 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
|
||||
margin: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.margin
|
||||
},
|
||||
// 是否虚线,true-虚线,false-实线
|
||||
dashed: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.line.dashed
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
@@ -1,38 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uLine_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-line",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLine_props.props],
|
||||
computed: {
|
||||
lineStyle() {
|
||||
const style = {};
|
||||
style.margin = this.margin;
|
||||
if (this.direction === "row") {
|
||||
style.borderBottomWidth = "1px";
|
||||
style.borderBottomStyle = this.dashed ? "dashed" : "solid";
|
||||
style.width = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
|
||||
if (this.hairline)
|
||||
style.transform = "scaleY(0.5)";
|
||||
} else {
|
||||
style.borderLeftWidth = "1px";
|
||||
style.borderLeftStyle = this.dashed ? "dashed" : "solid";
|
||||
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
|
||||
if (this.hairline)
|
||||
style.transform = "scaleX(0.5)";
|
||||
}
|
||||
style.borderColor = this.color;
|
||||
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.s($options.lineStyle)
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-72791e59"]]);
|
||||
wx.createComponent(Component);
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view style="{{a + ';' + virtualHostStyle}}" class="{{['u-line', 'data-v-72791e59', virtualHostClass]}}"></view>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user