You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1022 lines
27 KiB
1022 lines
27 KiB
// node_modules/vk-uview-ui/libs/mixin/mixin.js
|
|
var mixin_default = {
|
|
data() {
|
|
return {};
|
|
},
|
|
onLoad() {
|
|
this.$u.getRect = this.$uGetRect;
|
|
},
|
|
methods: {
|
|
$uGetRect(selector, all) {
|
|
return new Promise((resolve) => {
|
|
uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
|
|
if (all && Array.isArray(rect) && rect.length) {
|
|
resolve(rect);
|
|
}
|
|
if (!all && rect) {
|
|
resolve(rect);
|
|
}
|
|
}).exec();
|
|
});
|
|
},
|
|
getParentData(parentName = "") {
|
|
if (!this.parent)
|
|
this.parent = false;
|
|
this.parent = this.$u.$parent.call(this, parentName);
|
|
if (this.parent) {
|
|
Object.keys(this.parentData).map((key) => {
|
|
this.parentData[key] = this.parent[key];
|
|
});
|
|
this.parentData.value = this.parent.modelValue;
|
|
}
|
|
},
|
|
preventEvent(e) {
|
|
e && e.stopPropagation && e.stopPropagation();
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
uni.$emit("uOnReachBottom");
|
|
},
|
|
beforeUnmount() {
|
|
if (this.parent && uni.$u.test.array(this.parent.children)) {
|
|
const childrenList = this.parent.children;
|
|
childrenList.map((child, index) => {
|
|
if (child === this) {
|
|
childrenList.splice(index, 1);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/vk-uview-ui/libs/function/deepClone.js
|
|
function isArray(arr) {
|
|
return Object.prototype.toString.call(arr) === "[object Array]";
|
|
}
|
|
function deepClone(obj) {
|
|
if ([null, void 0, NaN, false].includes(obj))
|
|
return obj;
|
|
if (typeof obj !== "object" && typeof obj !== "function") {
|
|
return obj;
|
|
}
|
|
var o = isArray(obj) ? [] : {};
|
|
for (let i in obj) {
|
|
if (obj.hasOwnProperty(i)) {
|
|
o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
|
|
}
|
|
}
|
|
return o;
|
|
}
|
|
var deepClone_default = deepClone;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/deepMerge.js
|
|
function deepMerge(target = {}, source = {}) {
|
|
target = deepClone_default(target);
|
|
if (typeof target !== "object" || typeof source !== "object")
|
|
return false;
|
|
for (var prop in source) {
|
|
if (!source.hasOwnProperty(prop))
|
|
continue;
|
|
if (prop in target) {
|
|
if (typeof target[prop] !== "object") {
|
|
target[prop] = source[prop];
|
|
} else {
|
|
if (typeof source[prop] !== "object") {
|
|
target[prop] = source[prop];
|
|
} else {
|
|
if (target[prop].concat && source[prop].concat) {
|
|
target[prop] = target[prop].concat(source[prop]);
|
|
} else {
|
|
target[prop] = deepMerge(target[prop], source[prop]);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
target[prop] = source[prop];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
var deepMerge_default = deepMerge;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/test.js
|
|
function email(value) {
|
|
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
|
|
}
|
|
function mobile(value) {
|
|
return /^1[23456789]\d{9}$/.test(value);
|
|
}
|
|
function url(value) {
|
|
return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
|
|
}
|
|
function date(value) {
|
|
return !/Invalid|NaN/.test(new Date(value).toString());
|
|
}
|
|
function dateISO(value) {
|
|
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
|
|
}
|
|
function number(value) {
|
|
return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
|
|
}
|
|
function digits(value) {
|
|
return /^\d+$/.test(value);
|
|
}
|
|
function idCard(value) {
|
|
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
|
|
value
|
|
);
|
|
}
|
|
function carNo(value) {
|
|
const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
|
|
const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
|
|
if (value.length === 7) {
|
|
return creg.test(value);
|
|
} else if (value.length === 8) {
|
|
return xreg.test(value);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function amount(value) {
|
|
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
|
|
}
|
|
function chinese(value) {
|
|
let reg = /^[\u4e00-\u9fa5]+$/gi;
|
|
return reg.test(value);
|
|
}
|
|
function letter(value) {
|
|
return /^[a-zA-Z]*$/.test(value);
|
|
}
|
|
function enOrNum(value) {
|
|
let reg = /^[0-9a-zA-Z]*$/g;
|
|
return reg.test(value);
|
|
}
|
|
function contains(value, param) {
|
|
return value.indexOf(param) >= 0;
|
|
}
|
|
function range(value, param) {
|
|
return value >= param[0] && value <= param[1];
|
|
}
|
|
function rangeLength(value, param) {
|
|
return value.length >= param[0] && value.length <= param[1];
|
|
}
|
|
function landline(value) {
|
|
let reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
|
|
return reg.test(value);
|
|
}
|
|
function empty(value) {
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
return true;
|
|
case "string":
|
|
if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
|
|
return true;
|
|
break;
|
|
case "boolean":
|
|
if (!value)
|
|
return true;
|
|
break;
|
|
case "number":
|
|
if (0 === value || isNaN(value))
|
|
return true;
|
|
break;
|
|
case "object":
|
|
if (null === value || value.length === 0)
|
|
return true;
|
|
for (var i in value) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function jsonString(value) {
|
|
if (typeof value == "string") {
|
|
try {
|
|
var obj = JSON.parse(value);
|
|
if (typeof obj == "object" && obj) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function array(value) {
|
|
if (typeof Array.isArray === "function") {
|
|
return Array.isArray(value);
|
|
} else {
|
|
return Object.prototype.toString.call(value) === "[object Array]";
|
|
}
|
|
}
|
|
function object(value) {
|
|
return Object.prototype.toString.call(value) === "[object Object]";
|
|
}
|
|
function code(value, len = 6) {
|
|
return new RegExp(`^\\d{${len}}$`).test(value);
|
|
}
|
|
var test_default = {
|
|
email,
|
|
mobile,
|
|
url,
|
|
date,
|
|
dateISO,
|
|
number,
|
|
digits,
|
|
idCard,
|
|
carNo,
|
|
amount,
|
|
chinese,
|
|
letter,
|
|
enOrNum,
|
|
contains,
|
|
range,
|
|
rangeLength,
|
|
empty,
|
|
isEmpty: empty,
|
|
jsonString,
|
|
landline,
|
|
object,
|
|
array,
|
|
code
|
|
};
|
|
|
|
// node_modules/vk-uview-ui/libs/request/index.js
|
|
var Request = class {
|
|
setConfig(customConfig) {
|
|
this.config = deepMerge_default(this.config, customConfig);
|
|
}
|
|
request(options = {}) {
|
|
if (this.interceptor.request && typeof this.interceptor.request === "function") {
|
|
let tmpConfig = {};
|
|
let interceptorRequest = this.interceptor.request(options);
|
|
if (interceptorRequest === false) {
|
|
return new Promise(() => {
|
|
});
|
|
}
|
|
this.options = interceptorRequest;
|
|
}
|
|
options.dataType = options.dataType || this.config.dataType;
|
|
options.responseType = options.responseType || this.config.responseType;
|
|
options.url = options.url || "";
|
|
options.params = options.params || {};
|
|
options.header = Object.assign({}, this.config.header, options.header);
|
|
options.method = options.method || this.config.method;
|
|
return new Promise((resolve, reject) => {
|
|
options.complete = (response) => {
|
|
uni.hideLoading();
|
|
clearTimeout(this.config.timer);
|
|
this.config.timer = null;
|
|
if (this.config.originalData) {
|
|
if (this.interceptor.response && typeof this.interceptor.response === "function") {
|
|
let resInterceptors = this.interceptor.response(response);
|
|
if (resInterceptors !== false) {
|
|
resolve(resInterceptors);
|
|
} else {
|
|
reject(response);
|
|
}
|
|
} else {
|
|
resolve(response);
|
|
}
|
|
} else {
|
|
if (response.statusCode == 200) {
|
|
if (this.interceptor.response && typeof this.interceptor.response === "function") {
|
|
let resInterceptors = this.interceptor.response(response.data);
|
|
if (resInterceptors !== false) {
|
|
resolve(resInterceptors);
|
|
} else {
|
|
reject(response.data);
|
|
}
|
|
} else {
|
|
resolve(response.data);
|
|
}
|
|
} else {
|
|
reject(response);
|
|
}
|
|
}
|
|
};
|
|
options.url = test_default.url(options.url) ? options.url : this.config.baseUrl + (options.url.indexOf("/") == 0 ? options.url : "/" + options.url);
|
|
if (this.config.showLoading && !this.config.timer) {
|
|
this.config.timer = setTimeout(() => {
|
|
uni.showLoading({
|
|
title: this.config.loadingText,
|
|
mask: this.config.loadingMask
|
|
});
|
|
this.config.timer = null;
|
|
}, this.config.loadingTime);
|
|
}
|
|
uni.request(options);
|
|
});
|
|
}
|
|
constructor() {
|
|
this.config = {
|
|
baseUrl: "",
|
|
header: {},
|
|
method: "POST",
|
|
dataType: "json",
|
|
responseType: "text",
|
|
showLoading: true,
|
|
loadingText: "\u8BF7\u6C42\u4E2D...",
|
|
loadingTime: 800,
|
|
timer: null,
|
|
originalData: false,
|
|
loadingMask: true
|
|
};
|
|
this.interceptor = {
|
|
request: null,
|
|
response: null
|
|
};
|
|
this.get = (url2, data = {}, header = {}) => {
|
|
return this.request({
|
|
method: "GET",
|
|
url: url2,
|
|
header,
|
|
data
|
|
});
|
|
};
|
|
this.post = (url2, data = {}, header = {}) => {
|
|
return this.request({
|
|
url: url2,
|
|
method: "POST",
|
|
header,
|
|
data
|
|
});
|
|
};
|
|
this.put = (url2, data = {}, header = {}) => {
|
|
return this.request({
|
|
url: url2,
|
|
method: "PUT",
|
|
header,
|
|
data
|
|
});
|
|
};
|
|
this.delete = (url2, data = {}, header = {}) => {
|
|
return this.request({
|
|
url: url2,
|
|
method: "DELETE",
|
|
header,
|
|
data
|
|
});
|
|
};
|
|
}
|
|
};
|
|
var request_default = new Request();
|
|
|
|
// node_modules/vk-uview-ui/libs/function/queryParams.js
|
|
function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
|
|
let prefix = isPrefix ? "?" : "";
|
|
let _result = [];
|
|
if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
|
|
arrayFormat = "brackets";
|
|
for (let key in data) {
|
|
let value = data[key];
|
|
if (["", void 0, null].indexOf(value) >= 0) {
|
|
continue;
|
|
}
|
|
if (value.constructor === Array) {
|
|
switch (arrayFormat) {
|
|
case "indices":
|
|
for (let i = 0; i < value.length; i++) {
|
|
_result.push(key + "[" + i + "]=" + value[i]);
|
|
}
|
|
break;
|
|
case "brackets":
|
|
value.forEach((_value) => {
|
|
_result.push(key + "[]=" + _value);
|
|
});
|
|
break;
|
|
case "repeat":
|
|
value.forEach((_value) => {
|
|
_result.push(key + "=" + _value);
|
|
});
|
|
break;
|
|
case "comma":
|
|
let commaStr = "";
|
|
value.forEach((_value) => {
|
|
commaStr += (commaStr ? "," : "") + _value;
|
|
});
|
|
_result.push(key + "=" + commaStr);
|
|
break;
|
|
default:
|
|
value.forEach((_value) => {
|
|
_result.push(key + "[]=" + _value);
|
|
});
|
|
}
|
|
} else {
|
|
_result.push(key + "=" + value);
|
|
}
|
|
}
|
|
return _result.length ? prefix + _result.join("&") : "";
|
|
}
|
|
var queryParams_default = queryParams;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/route.js
|
|
var Router = class {
|
|
constructor() {
|
|
this.config = {
|
|
type: "navigateTo",
|
|
url: "",
|
|
delta: 1,
|
|
params: {},
|
|
animationType: "pop-in",
|
|
animationDuration: 300,
|
|
intercept: false
|
|
};
|
|
this.route = this.route.bind(this);
|
|
}
|
|
addRootPath(url2) {
|
|
return url2[0] === "/" ? url2 : `/${url2}`;
|
|
}
|
|
mixinParam(url2, params) {
|
|
url2 = url2 && this.addRootPath(url2);
|
|
let query = "";
|
|
if (/.*\/.*\?.*=.*/.test(url2)) {
|
|
query = uni.$u.queryParams(params, false);
|
|
return url2 += "&" + query;
|
|
} else {
|
|
query = uni.$u.queryParams(params);
|
|
return url2 += query;
|
|
}
|
|
}
|
|
async route(options = {}, params = {}) {
|
|
let mergeConfig = {};
|
|
if (typeof options === "string") {
|
|
mergeConfig.url = this.mixinParam(options, params);
|
|
mergeConfig.type = "navigateTo";
|
|
} else {
|
|
mergeConfig = uni.$u.deepClone(options, this.config);
|
|
mergeConfig.url = this.mixinParam(options.url, options.params);
|
|
}
|
|
if (params.intercept) {
|
|
this.config.intercept = params.intercept;
|
|
}
|
|
mergeConfig.params = params;
|
|
mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
|
|
if (typeof uni.$u.routeIntercept === "function") {
|
|
const isNext = await new Promise((resolve, reject) => {
|
|
uni.$u.routeIntercept(mergeConfig, resolve);
|
|
});
|
|
isNext && this.openPage(mergeConfig);
|
|
} else {
|
|
this.openPage(mergeConfig);
|
|
}
|
|
}
|
|
openPage(config) {
|
|
const {
|
|
url: url2,
|
|
type,
|
|
delta,
|
|
animationType,
|
|
animationDuration
|
|
} = config;
|
|
if (config.type == "navigateTo" || config.type == "to") {
|
|
uni.navigateTo({
|
|
url: url2,
|
|
animationType,
|
|
animationDuration
|
|
});
|
|
}
|
|
if (config.type == "redirectTo" || config.type == "redirect") {
|
|
uni.redirectTo({
|
|
url: url2
|
|
});
|
|
}
|
|
if (config.type == "switchTab" || config.type == "tab") {
|
|
uni.switchTab({
|
|
url: url2
|
|
});
|
|
}
|
|
if (config.type == "reLaunch" || config.type == "launch") {
|
|
uni.reLaunch({
|
|
url: url2
|
|
});
|
|
}
|
|
if (config.type == "navigateBack" || config.type == "back") {
|
|
uni.navigateBack({
|
|
delta
|
|
});
|
|
}
|
|
}
|
|
};
|
|
var route_default = new Router().route;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/timeFormat.js
|
|
if (!String.prototype.padStart) {
|
|
String.prototype.padStart = function(maxLength, fillString = " ") {
|
|
if (Object.prototype.toString.call(fillString) !== "[object String]")
|
|
throw new TypeError(
|
|
"fillString must be String"
|
|
);
|
|
let str = this;
|
|
if (str.length >= maxLength)
|
|
return String(str);
|
|
let fillLength = maxLength - str.length, times = Math.ceil(fillLength / fillString.length);
|
|
while (times >>= 1) {
|
|
fillString += fillString;
|
|
if (times === 1) {
|
|
fillString += fillString;
|
|
}
|
|
}
|
|
return fillString.slice(0, fillLength) + str;
|
|
};
|
|
}
|
|
function timeFormat(dateTime = null, fmt = "yyyy-mm-dd") {
|
|
if (!dateTime)
|
|
dateTime = Number(new Date());
|
|
if (dateTime.toString().length == 10)
|
|
dateTime *= 1e3;
|
|
let date2 = new Date(dateTime);
|
|
let ret;
|
|
let opt = {
|
|
"y+": date2.getFullYear().toString(),
|
|
"m+": (date2.getMonth() + 1).toString(),
|
|
"d+": date2.getDate().toString(),
|
|
"h+": date2.getHours().toString(),
|
|
"M+": date2.getMinutes().toString(),
|
|
"s+": date2.getSeconds().toString()
|
|
};
|
|
for (let k in opt) {
|
|
ret = new RegExp("(" + k + ")").exec(fmt);
|
|
if (ret) {
|
|
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
|
|
}
|
|
;
|
|
}
|
|
;
|
|
return fmt;
|
|
}
|
|
var timeFormat_default = timeFormat;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/timeFrom.js
|
|
function timeFrom(dateTime = null, format = "yyyy-mm-dd") {
|
|
if (!dateTime)
|
|
dateTime = Number(new Date());
|
|
if (dateTime.toString().length == 10)
|
|
dateTime *= 1e3;
|
|
let timestamp = +new Date(Number(dateTime));
|
|
let timer = (Number(new Date()) - timestamp) / 1e3;
|
|
let tips = "";
|
|
switch (true) {
|
|
case timer < 300:
|
|
tips = "\u521A\u521A";
|
|
break;
|
|
case (timer >= 300 && timer < 3600):
|
|
tips = parseInt(timer / 60) + "\u5206\u949F\u524D";
|
|
break;
|
|
case (timer >= 3600 && timer < 86400):
|
|
tips = parseInt(timer / 3600) + "\u5C0F\u65F6\u524D";
|
|
break;
|
|
case (timer >= 86400 && timer < 2592e3):
|
|
tips = parseInt(timer / 86400) + "\u5929\u524D";
|
|
break;
|
|
default:
|
|
if (format === false) {
|
|
if (timer >= 2592e3 && timer < 365 * 86400) {
|
|
tips = parseInt(timer / (86400 * 30)) + "\u4E2A\u6708\u524D";
|
|
} else {
|
|
tips = parseInt(timer / (86400 * 365)) + "\u5E74\u524D";
|
|
}
|
|
} else {
|
|
tips = timeFormat_default(timestamp, format);
|
|
}
|
|
}
|
|
return tips;
|
|
}
|
|
var timeFrom_default = timeFrom;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/colorGradient.js
|
|
function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) {
|
|
let startRGB = hexToRgb(startColor, false);
|
|
let startR = startRGB[0];
|
|
let startG = startRGB[1];
|
|
let startB = startRGB[2];
|
|
let endRGB = hexToRgb(endColor, false);
|
|
let endR = endRGB[0];
|
|
let endG = endRGB[1];
|
|
let endB = endRGB[2];
|
|
let sR = (endR - startR) / step;
|
|
let sG = (endG - startG) / step;
|
|
let sB = (endB - startB) / step;
|
|
let colorArr = [];
|
|
for (let i = 0; i < step; i++) {
|
|
let hex = rgbToHex("rgb(" + Math.round(sR * i + startR) + "," + Math.round(sG * i + startG) + "," + Math.round(sB * i + startB) + ")");
|
|
colorArr.push(hex);
|
|
}
|
|
return colorArr;
|
|
}
|
|
function hexToRgb(sColor, str = true) {
|
|
let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
sColor = sColor.toLowerCase();
|
|
if (sColor && reg.test(sColor)) {
|
|
if (sColor.length === 4) {
|
|
let sColorNew = "#";
|
|
for (let i = 1; i < 4; i += 1) {
|
|
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
|
|
}
|
|
sColor = sColorNew;
|
|
}
|
|
let sColorChange = [];
|
|
for (let i = 1; i < 7; i += 2) {
|
|
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
|
|
}
|
|
if (!str) {
|
|
return sColorChange;
|
|
} else {
|
|
return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
|
|
}
|
|
} else if (/^(rgb|RGB)/.test(sColor)) {
|
|
let arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
|
|
return arr.map((val) => Number(val));
|
|
} else {
|
|
return sColor;
|
|
}
|
|
}
|
|
function rgbToHex(rgb) {
|
|
let _this = rgb;
|
|
let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
if (/^(rgb|RGB)/.test(_this)) {
|
|
let aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
|
|
let strHex = "#";
|
|
for (let i = 0; i < aColor.length; i++) {
|
|
let hex = Number(aColor[i]).toString(16);
|
|
hex = String(hex).length == 1 ? 0 + "" + hex : hex;
|
|
if (hex === "0") {
|
|
hex += hex;
|
|
}
|
|
strHex += hex;
|
|
}
|
|
if (strHex.length !== 7) {
|
|
strHex = _this;
|
|
}
|
|
return strHex;
|
|
} else if (reg.test(_this)) {
|
|
let aNum = _this.replace(/#/, "").split("");
|
|
if (aNum.length === 6) {
|
|
return _this;
|
|
} else if (aNum.length === 3) {
|
|
let numHex = "#";
|
|
for (let i = 0; i < aNum.length; i += 1) {
|
|
numHex += aNum[i] + aNum[i];
|
|
}
|
|
return numHex;
|
|
}
|
|
} else {
|
|
return _this;
|
|
}
|
|
}
|
|
function colorToRgba(color2, alpha = 0.3) {
|
|
color2 = rgbToHex(color2);
|
|
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
let sColor = color2.toLowerCase();
|
|
if (sColor && reg.test(sColor)) {
|
|
if (sColor.length === 4) {
|
|
var sColorNew = "#";
|
|
for (let i = 1; i < 4; i += 1) {
|
|
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
|
|
}
|
|
sColor = sColorNew;
|
|
}
|
|
var sColorChange = [];
|
|
for (let i = 1; i < 7; i += 2) {
|
|
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
|
|
}
|
|
return "rgba(" + sColorChange.join(",") + "," + alpha + ")";
|
|
} else {
|
|
return sColor;
|
|
}
|
|
}
|
|
var colorGradient_default = {
|
|
colorGradient,
|
|
hexToRgb,
|
|
rgbToHex,
|
|
colorToRgba
|
|
};
|
|
|
|
// node_modules/vk-uview-ui/libs/function/guid.js
|
|
function guid(len = 32, firstU = true, radix = null) {
|
|
let chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
let uuid = [];
|
|
radix = radix || chars.length;
|
|
if (len) {
|
|
for (let i = 0; i < len; i++)
|
|
uuid[i] = chars[0 | Math.random() * radix];
|
|
} else {
|
|
let r;
|
|
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
|
|
uuid[14] = "4";
|
|
for (let i = 0; i < 36; i++) {
|
|
if (!uuid[i]) {
|
|
r = 0 | Math.random() * 16;
|
|
uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
|
|
}
|
|
}
|
|
}
|
|
if (firstU) {
|
|
uuid.shift();
|
|
return "u" + uuid.join("");
|
|
} else {
|
|
return uuid.join("");
|
|
}
|
|
}
|
|
var guid_default = guid;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/color.js
|
|
var color = {
|
|
primary: "#2979ff",
|
|
primaryDark: "#2b85e4",
|
|
primaryDisabled: "#a0cfff",
|
|
primaryLight: "#ecf5ff",
|
|
bgColor: "#f3f4f6",
|
|
info: "#909399",
|
|
infoDark: "#82848a",
|
|
infoDisabled: "#c8c9cc",
|
|
infoLight: "#f4f4f5",
|
|
warning: "#ff9900",
|
|
warningDark: "#f29100",
|
|
warningDisabled: "#fcbd71",
|
|
warningLight: "#fdf6ec",
|
|
error: "#fa3534",
|
|
errorDark: "#dd6161",
|
|
errorDisabled: "#fab6b6",
|
|
errorLight: "#fef0f0",
|
|
success: "#19be6b",
|
|
successDark: "#18b566",
|
|
successDisabled: "#71d5a1",
|
|
successLight: "#dbf1e1",
|
|
mainColor: "#303133",
|
|
contentColor: "#606266",
|
|
tipsColor: "#909399",
|
|
lightColor: "#c0c4cc",
|
|
borderColor: "#e4e7ed"
|
|
};
|
|
var color_default = color;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/type2icon.js
|
|
function type2icon(type = "success", fill = false) {
|
|
if (["primary", "info", "error", "warning", "success"].indexOf(type) == -1)
|
|
type = "success";
|
|
let iconName = "";
|
|
switch (type) {
|
|
case "primary":
|
|
iconName = "info-circle";
|
|
break;
|
|
case "info":
|
|
iconName = "info-circle";
|
|
break;
|
|
case "error":
|
|
iconName = "close-circle";
|
|
break;
|
|
case "warning":
|
|
iconName = "error-circle";
|
|
break;
|
|
case "success":
|
|
iconName = "checkmark-circle";
|
|
break;
|
|
default:
|
|
iconName = "checkmark-circle";
|
|
}
|
|
if (fill)
|
|
iconName += "-fill";
|
|
return iconName;
|
|
}
|
|
var type2icon_default = type2icon;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/randomArray.js
|
|
function randomArray(array2 = []) {
|
|
return array2.sort(() => Math.random() - 0.5);
|
|
}
|
|
var randomArray_default = randomArray;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/addUnit.js
|
|
function addUnit(value = "auto", unit = "rpx") {
|
|
value = String(value);
|
|
return test_default.number(value) ? `${value}${unit}` : value;
|
|
}
|
|
|
|
// node_modules/vk-uview-ui/libs/function/random.js
|
|
function random(min, max) {
|
|
if (min >= 0 && max > 0 && max >= min) {
|
|
let gab = max - min + 1;
|
|
return Math.floor(Math.random() * gab + min);
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
var random_default = random;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/trim.js
|
|
function trim(str, pos = "both") {
|
|
if (pos == "both") {
|
|
return str.replace(/^\s+|\s+$/g, "");
|
|
} else if (pos == "left") {
|
|
return str.replace(/^\s*/, "");
|
|
} else if (pos == "right") {
|
|
return str.replace(/(\s*$)/g, "");
|
|
} else if (pos == "all") {
|
|
return str.replace(/\s+/g, "");
|
|
} else {
|
|
return str;
|
|
}
|
|
}
|
|
var trim_default = trim;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/toast.js
|
|
function toast(title, duration = 1500) {
|
|
uni.showToast({
|
|
title,
|
|
icon: "none",
|
|
duration
|
|
});
|
|
}
|
|
var toast_default = toast;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/getParent.js
|
|
function getParent(name, keys) {
|
|
let parent = this.$parent;
|
|
while (parent) {
|
|
if (parent.$options.name !== name) {
|
|
parent = parent.$parent;
|
|
} else {
|
|
let data = {};
|
|
if (Array.isArray(keys)) {
|
|
keys.map((val) => {
|
|
data[val] = parent[val] ? parent[val] : "";
|
|
});
|
|
} else {
|
|
for (let i in keys) {
|
|
if (Array.isArray(keys[i])) {
|
|
if (keys[i].length) {
|
|
data[i] = keys[i];
|
|
} else {
|
|
data[i] = parent[i];
|
|
}
|
|
} else if (keys[i].constructor === Object) {
|
|
if (Object.keys(keys[i]).length) {
|
|
data[i] = keys[i];
|
|
} else {
|
|
data[i] = parent[i];
|
|
}
|
|
} else {
|
|
data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
|
|
}
|
|
}
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
|
|
// node_modules/vk-uview-ui/libs/function/$parent.js
|
|
function $parent(name = void 0) {
|
|
let parent = this.$parent;
|
|
while (parent) {
|
|
if (parent.$options && parent.$options.name !== name) {
|
|
parent = parent.$parent;
|
|
} else {
|
|
return parent;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// node_modules/vk-uview-ui/libs/function/sys.js
|
|
function os() {
|
|
return uni.getSystemInfoSync().platform;
|
|
}
|
|
function sys() {
|
|
return uni.getSystemInfoSync();
|
|
}
|
|
|
|
// node_modules/vk-uview-ui/libs/function/debounce.js
|
|
var timeout = null;
|
|
function debounce(func, wait = 500, immediate = false) {
|
|
if (timeout !== null)
|
|
clearTimeout(timeout);
|
|
if (immediate) {
|
|
var callNow = !timeout;
|
|
timeout = setTimeout(function() {
|
|
timeout = null;
|
|
}, wait);
|
|
if (callNow)
|
|
typeof func === "function" && func();
|
|
} else {
|
|
timeout = setTimeout(function() {
|
|
typeof func === "function" && func();
|
|
}, wait);
|
|
}
|
|
}
|
|
var debounce_default = debounce;
|
|
|
|
// node_modules/vk-uview-ui/libs/function/throttle.js
|
|
var timeoutArr = [];
|
|
var flagArr = [];
|
|
function throttle(fn, time = 500, isImmediate = true, timeoutName = "default") {
|
|
if (!timeoutArr[timeoutName])
|
|
timeoutArr[timeoutName] = null;
|
|
if (isImmediate) {
|
|
if (!flagArr[timeoutName]) {
|
|
flagArr[timeoutName] = true;
|
|
if (typeof fn === "function")
|
|
fn();
|
|
timeoutArr[timeoutName] = setTimeout(() => {
|
|
flagArr[timeoutName] = false;
|
|
}, time);
|
|
}
|
|
} else {
|
|
if (!flagArr[timeoutName]) {
|
|
flagArr[timeoutName] = true;
|
|
timeoutArr[timeoutName] = setTimeout(() => {
|
|
flagArr[timeoutName] = false;
|
|
if (typeof fn === "function")
|
|
fn();
|
|
}, time);
|
|
}
|
|
}
|
|
}
|
|
var throttle_default = throttle;
|
|
|
|
// node_modules/vk-uview-ui/libs/config/config.js
|
|
var version = "1.10.1";
|
|
var config_default = {
|
|
v: version,
|
|
version,
|
|
type: [
|
|
"primary",
|
|
"success",
|
|
"info",
|
|
"error",
|
|
"warning"
|
|
]
|
|
};
|
|
|
|
// node_modules/vk-uview-ui/libs/config/zIndex.js
|
|
var zIndex_default = {
|
|
toast: 10090,
|
|
noNetwork: 10080,
|
|
popup: 10075,
|
|
mask: 10070,
|
|
navbar: 980,
|
|
topTips: 975,
|
|
sticky: 970,
|
|
indexListSticky: 965
|
|
};
|
|
|
|
// node_modules/vk-uview-ui/index.js
|
|
function wranning(str) {
|
|
if (true) {
|
|
console.warn(str);
|
|
}
|
|
}
|
|
var $u = {
|
|
queryParams: queryParams_default,
|
|
route: route_default,
|
|
timeFormat: timeFormat_default,
|
|
date: timeFormat_default,
|
|
timeFrom: timeFrom_default,
|
|
colorGradient: colorGradient_default.colorGradient,
|
|
colorToRgba: colorGradient_default.colorToRgba,
|
|
guid: guid_default,
|
|
color: color_default,
|
|
sys,
|
|
os,
|
|
type2icon: type2icon_default,
|
|
randomArray: randomArray_default,
|
|
wranning,
|
|
get: request_default.get,
|
|
post: request_default.post,
|
|
put: request_default.put,
|
|
"delete": request_default.delete,
|
|
hexToRgb: colorGradient_default.hexToRgb,
|
|
rgbToHex: colorGradient_default.rgbToHex,
|
|
test: test_default,
|
|
random: random_default,
|
|
deepClone: deepClone_default,
|
|
deepMerge: deepMerge_default,
|
|
getParent,
|
|
$parent,
|
|
addUnit,
|
|
trim: trim_default,
|
|
type: ["primary", "success", "error", "warning", "info"],
|
|
http: request_default,
|
|
toast: toast_default,
|
|
config: config_default,
|
|
zIndex: zIndex_default,
|
|
debounce: debounce_default,
|
|
throttle: throttle_default
|
|
};
|
|
uni.$u = $u;
|
|
var install = (Vue) => {
|
|
Vue.mixin(mixin_default);
|
|
Vue.config.globalProperties.$u = $u;
|
|
};
|
|
var vk_uview_ui_default = {
|
|
install
|
|
};
|
|
export {
|
|
vk_uview_ui_default as default
|
|
};
|
|
//# sourceMappingURL=vk-uview-ui.js.map
|
|
|