if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor;
return this.then(
(value) => promise.resolve(callback()).then(() => value),
(reason) => promise.resolve(callback()).then(() => {
throw reason;
})
);
};
}
;
if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
const global2 = uni.requireGlobal();
ArrayBuffer = global2.ArrayBuffer;
Int8Array = global2.Int8Array;
Uint8Array = global2.Uint8Array;
Uint8ClampedArray = global2.Uint8ClampedArray;
Int16Array = global2.Int16Array;
Uint16Array = global2.Uint16Array;
Int32Array = global2.Int32Array;
Uint32Array = global2.Uint32Array;
Float32Array = global2.Float32Array;
Float64Array = global2.Float64Array;
BigInt64Array = global2.BigInt64Array;
BigUint64Array = global2.BigUint64Array;
}
;
if (uni.restoreGlobal) {
uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
}
(function(vue) {
var _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
"use strict";
function formatAppLog(type2, filename, ...args) {
if (uni.__log__) {
uni.__log__(type2, filename, ...args);
} else {
console[type2].apply(console, [...args, filename]);
}
}
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
}
const baseUrl = "https://app.chienxutech.com:30443";
function dorequest(method2, url2, data, header = {}) {
return uni.request({
method: method2,
url: url2,
data
});
}
function addlog(data, e, callback = null) {
let url2 = baseUrl + "/index.php/index/Logmanger/addlog";
dorequest("post", url2, data).then((res) => {
if (callback) {
callback(res);
} else {
res = res.data;
if (0 == res.code) {
e.$refs.toast.show({
type: "error",
message: res.errmsg
});
}
}
});
}
function islogin() {
let userinfo = uni.getStorageSync("userinfo");
if (!userinfo) {
return false;
}
return true;
}
function saveuserinfo(info) {
uni.setStorage({
key: "userinfo",
data: info,
success: function() {
},
fail: function(error2) {
formatAppLog("log", "at common/js/common.js:42", "error");
addlog({
json: "用户信息保存失败",
type: "uniapp错误"
});
}
});
}
function tostemlistnext(startindex, next = 0, scaleid_1 = false, srid_1 = false) {
startindex = parseInt(startindex) + next;
let stemlist = uni.getStorageSync("stemlist");
if (!stemlist) {
return false;
}
let item = stemlist[startindex];
if (!item) {
return false;
}
uni.setStorage({
key: "stemitem",
data: item
});
if (item == void 0) {
return false;
}
if (scaleid_1 !== false && srid_1 !== false) {
if (item.stemtype < 101) {
uni.navigateTo({
url: "/pages/topic/common?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex
});
} else {
let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex;
uni.navigateTo({
url: url2
});
}
} else {
let scaleid = 4;
let srid = uni.getStorageSync("srid");
if (item.stemtype < 101) {
uni.navigateTo({
url: "/pages/topic/common?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex
});
} else {
let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex;
uni.navigateTo({
url: url2
});
}
}
return true;
}
function tohome() {
uni.redirectTo({
url: "/pages/index/index"
});
}
const _export_sfc = (sfc, props2) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props2) {
target[key] = val;
}
return target;
};
if (islogin()) {
uni.redirectTo({
url: "/pages/index/index"
});
} else {
uni.redirectTo({
url: "/pages/login/login"
});
}
const _sfc_main$D = {};
function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
return null;
}
const PagesIndexShow = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "D:/workspace/uniapp/health2/pages/index/show.vue"]]);
const mpMixin = {};
function email(value2) {
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value2);
}
function mobile(value2) {
return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value2);
}
function url(value2) {
return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(value2);
}
function date$1(value2) {
if (!value2)
return false;
if (number$2(value2))
value2 = +value2;
return !/Invalid|NaN/.test(new Date(value2).toString());
}
function dateISO(value2) {
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value2);
}
function number$2(value2) {
return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value2);
}
function string$1(value2) {
return typeof value2 === "string";
}
function digits(value2) {
return /^\d+$/.test(value2);
}
function idCard(value2) {
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(
value2
);
}
function carNo(value2) {
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 (value2.length === 7) {
return creg.test(value2);
}
if (value2.length === 8) {
return xreg.test(value2);
}
return false;
}
function amount(value2) {
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value2);
}
function chinese(value2) {
const reg = /^[\u4e00-\u9fa5]+$/gi;
return reg.test(value2);
}
function letter(value2) {
return /^[a-zA-Z]*$/.test(value2);
}
function enOrNum(value2) {
const reg = /^[0-9a-zA-Z]*$/g;
return reg.test(value2);
}
function contains(value2, param) {
return value2.indexOf(param) >= 0;
}
function range$2(value2, param) {
return value2 >= param[0] && value2 <= param[1];
}
function rangeLength(value2, param) {
return value2.length >= param[0] && value2.length <= param[1];
}
function landline(value2) {
const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
return reg.test(value2);
}
function empty(value2) {
switch (typeof value2) {
case "undefined":
return true;
case "string":
if (value2.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
return true;
break;
case "boolean":
if (!value2)
return true;
break;
case "number":
if (value2 === 0 || isNaN(value2))
return true;
break;
case "object":
if (value2 === null || value2.length === 0)
return true;
for (const i in value2) {
return false;
}
return true;
}
return false;
}
function jsonString(value2) {
if (typeof value2 === "string") {
try {
const obj = JSON.parse(value2);
if (typeof obj === "object" && obj) {
return true;
}
return false;
} catch (e) {
return false;
}
}
return false;
}
function array$1(value2) {
if (typeof Array.isArray === "function") {
return Array.isArray(value2);
}
return Object.prototype.toString.call(value2) === "[object Array]";
}
function object$1(value2) {
return Object.prototype.toString.call(value2) === "[object Object]";
}
function code(value2, len = 6) {
return new RegExp(`^\\d{${len}}$`).test(value2);
}
function func(value2) {
return typeof value2 === "function";
}
function promise(value2) {
return object$1(value2) && func(value2.then) && func(value2.catch);
}
function image(value2) {
const newValue = value2.split("?")[0];
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
return IMAGE_REGEXP.test(newValue);
}
function video(value2) {
const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
return VIDEO_REGEXP.test(value2);
}
function regExp(o) {
return o && Object.prototype.toString.call(o) === "[object RegExp]";
}
const test = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
amount,
array: array$1,
carNo,
chinese,
code,
contains,
date: date$1,
dateISO,
digits,
email,
empty,
enOrNum,
func,
idCard,
image,
jsonString,
landline,
letter,
mobile,
number: number$2,
object: object$1,
promise,
range: range$2,
rangeLength,
regExp,
string: string$1,
url,
video
}, Symbol.toStringTag, { value: "Module" }));
function strip(num, precision = 15) {
return +parseFloat(Number(num).toPrecision(precision));
}
function digitLength(num) {
const eSplit = num.toString().split(/[eE]/);
const len = (eSplit[0].split(".")[1] || "").length - +(eSplit[1] || 0);
return len > 0 ? len : 0;
}
function float2Fixed(num) {
if (num.toString().indexOf("e") === -1) {
return Number(num.toString().replace(".", ""));
}
const dLen = digitLength(num);
return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
}
function checkBoundary(num) {
{
if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
formatAppLog("warn", "at uni_modules/uv-ui-tools/libs/function/digit.js:45", `${num} 超出了精度限制,结果可能不正确`);
}
}
}
function iteratorOperation(arr, operation) {
const [num1, num2, ...others] = arr;
let res = operation(num1, num2);
others.forEach((num) => {
res = operation(res, num);
});
return res;
}
function times(...nums) {
if (nums.length > 2) {
return iteratorOperation(nums, times);
}
const [num1, num2] = nums;
const num1Changed = float2Fixed(num1);
const num2Changed = float2Fixed(num2);
const baseNum = digitLength(num1) + digitLength(num2);
const leftValue = num1Changed * num2Changed;
checkBoundary(leftValue);
return leftValue / Math.pow(10, baseNum);
}
function divide(...nums) {
if (nums.length > 2) {
return iteratorOperation(nums, divide);
}
const [num1, num2] = nums;
const num1Changed = float2Fixed(num1);
const num2Changed = float2Fixed(num2);
checkBoundary(num1Changed);
checkBoundary(num2Changed);
return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
}
function round(num, ratio2) {
const base = Math.pow(10, ratio2);
let result = divide(Math.round(Math.abs(times(num, base))), base);
if (num < 0 && result !== 0) {
result = times(result, -1);
}
return result;
}
function range$1(min = 0, max = 0, value2 = 0) {
return Math.max(min, Math.min(max, Number(value2)));
}
function getPx(value2, unit = false) {
if (number$2(value2)) {
return unit ? `${value2}px` : Number(value2);
}
if (/(rpx|upx)$/.test(value2)) {
return unit ? `${uni.upx2px(parseInt(value2))}px` : Number(uni.upx2px(parseInt(value2)));
}
return unit ? `${parseInt(value2)}px` : parseInt(value2);
}
function sleep(value2 = 30) {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, value2);
});
}
function os() {
return uni.getSystemInfoSync().platform.toLowerCase();
}
function sys() {
return uni.getSystemInfoSync();
}
function random(min, max) {
if (min >= 0 && max > 0 && max >= min) {
const gab = max - min + 1;
return Math.floor(Math.random() * gab + min);
}
return 0;
}
function guid(len = 32, firstU = true, radix = null) {
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
const uuid = [];
radix = radix || chars.length;
if (len) {
for (let i = 0; i < len; i++)
uuid[i] = chars[0 | Math.random() * radix];
} else {
let r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
uuid[14] = "4";
for (let i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
}
}
}
if (firstU) {
uuid.shift();
return `u${uuid.join("")}`;
}
return uuid.join("");
}
function $parent(name = void 0) {
let parent = this.$parent;
while (parent) {
if (parent.$options && parent.$options.name !== name) {
parent = parent.$parent;
} else {
return parent;
}
}
return false;
}
function addStyle(customStyle, target = "object") {
if (empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
return customStyle;
}
if (target === "object") {
customStyle = trim(customStyle);
const styleArray = customStyle.split(";");
const style = {};
for (let i = 0; i < styleArray.length; i++) {
if (styleArray[i]) {
const item = styleArray[i].split(":");
style[trim(item[0])] = trim(item[1]);
}
}
return style;
}
let string2 = "";
for (const i in customStyle) {
const key = i.replace(/([A-Z])/g, "-$1").toLowerCase();
string2 += `${key}:${customStyle[i]};`;
}
return trim(string2);
}
function addUnit(value2 = "auto", unit = ((_b) => (_b = ((_a) => (_a = uni == null ? void 0 : uni.$uv) == null ? void 0 : _a.config)()) == null ? void 0 : _b.unit)() ? ((_d) => (_d = ((_c) => (_c = uni == null ? void 0 : uni.$uv) == null ? void 0 : _c.config)()) == null ? void 0 : _d.unit)() : "px") {
value2 = String(value2);
return number$2(value2) ? `${value2}${unit}` : value2;
}
function deepClone(obj, cache2 = /* @__PURE__ */ new WeakMap()) {
if (obj === null || typeof obj !== "object")
return obj;
if (cache2.has(obj))
return cache2.get(obj);
let clone;
if (obj instanceof Date) {
clone = new Date(obj.getTime());
} else if (obj instanceof RegExp) {
clone = new RegExp(obj);
} else if (obj instanceof Map) {
clone = new Map(Array.from(obj, ([key, value2]) => [key, deepClone(value2, cache2)]));
} else if (obj instanceof Set) {
clone = new Set(Array.from(obj, (value2) => deepClone(value2, cache2)));
} else if (Array.isArray(obj)) {
clone = obj.map((value2) => deepClone(value2, cache2));
} else if (Object.prototype.toString.call(obj) === "[object Object]") {
clone = Object.create(Object.getPrototypeOf(obj));
cache2.set(obj, clone);
for (const [key, value2] of Object.entries(obj)) {
clone[key] = deepClone(value2, cache2);
}
} else {
clone = Object.assign({}, obj);
}
cache2.set(obj, clone);
return clone;
}
function deepMerge$1(target = {}, source = {}) {
target = deepClone(target);
if (typeof target !== "object" || target === null || typeof source !== "object" || source === null)
return target;
const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
for (const prop in source) {
if (!source.hasOwnProperty(prop))
continue;
const sourceValue = source[prop];
const targetValue = merged[prop];
if (sourceValue instanceof Date) {
merged[prop] = new Date(sourceValue);
} else if (sourceValue instanceof RegExp) {
merged[prop] = new RegExp(sourceValue);
} else if (sourceValue instanceof Map) {
merged[prop] = new Map(sourceValue);
} else if (sourceValue instanceof Set) {
merged[prop] = new Set(sourceValue);
} else if (typeof sourceValue === "object" && sourceValue !== null) {
merged[prop] = deepMerge$1(targetValue, sourceValue);
} else {
merged[prop] = sourceValue;
}
}
return merged;
}
function error(err) {
{
formatAppLog("error", "at uni_modules/uv-ui-tools/libs/function/index.js:250", `uvui提示:${err}`);
}
}
function randomArray(array2 = []) {
return array2.sort(() => Math.random() - 0.5);
}
if (!String.prototype.padStart) {
String.prototype.padStart = function(maxLength, fillString = " ") {
if (Object.prototype.toString.call(fillString) !== "[object String]") {
throw new TypeError(
"fillString must be String"
);
}
const str = this;
if (str.length >= maxLength)
return String(str);
const fillLength = maxLength - str.length;
let times2 = Math.ceil(fillLength / fillString.length);
while (times2 >>= 1) {
fillString += fillString;
if (times2 === 1) {
fillString += fillString;
}
}
return fillString.slice(0, fillLength) + str;
};
}
function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
let date2;
if (!dateTime) {
date2 = /* @__PURE__ */ new Date();
} else if (/^\d{10}$/.test(dateTime == null ? void 0 : dateTime.toString().trim())) {
date2 = new Date(dateTime * 1e3);
} else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
date2 = new Date(Number(dateTime));
} else if (typeof dateTime === "string" && dateTime.includes("-") && !dateTime.includes("T")) {
date2 = new Date(dateTime.replace(/-/g, "/"));
} else {
date2 = new Date(dateTime);
}
const timeSource = {
"y": date2.getFullYear().toString(),
// 年
"m": (date2.getMonth() + 1).toString().padStart(2, "0"),
// 月
"d": date2.getDate().toString().padStart(2, "0"),
// 日
"h": date2.getHours().toString().padStart(2, "0"),
// 时
"M": date2.getMinutes().toString().padStart(2, "0"),
// 分
"s": date2.getSeconds().toString().padStart(2, "0")
// 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (const key in timeSource) {
const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
if (ret) {
const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
}
}
return formatStr;
}
function timeFrom(timestamp = null, format2 = "yyyy-mm-dd") {
if (timestamp == null)
timestamp = Number(/* @__PURE__ */ new Date());
timestamp = parseInt(timestamp);
if (timestamp.toString().length == 10)
timestamp *= 1e3;
let timer = (/* @__PURE__ */ new Date()).getTime() - timestamp;
timer = parseInt(timer / 1e3);
let tips = "";
switch (true) {
case timer < 300:
tips = "刚刚";
break;
case (timer >= 300 && timer < 3600):
tips = `${parseInt(timer / 60)}分钟前`;
break;
case (timer >= 3600 && timer < 86400):
tips = `${parseInt(timer / 3600)}小时前`;
break;
case (timer >= 86400 && timer < 2592e3):
tips = `${parseInt(timer / 86400)}天前`;
break;
default:
if (format2 === false) {
if (timer >= 2592e3 && timer < 365 * 86400) {
tips = `${parseInt(timer / (86400 * 30))}个月前`;
} else {
tips = `${parseInt(timer / (86400 * 365))}年前`;
}
} else {
tips = timeFormat(timestamp, format2);
}
}
return tips;
}
function trim(str, pos = "both") {
str = String(str);
if (pos == "both") {
return str.replace(/^\s+|\s+$/g, "");
}
if (pos == "left") {
return str.replace(/^\s*/, "");
}
if (pos == "right") {
return str.replace(/(\s*$)/g, "");
}
if (pos == "all") {
return str.replace(/\s+/g, "");
}
return str;
}
function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
const prefix = isPrefix ? "?" : "";
const _result = [];
if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
arrayFormat = "brackets";
for (const key in data) {
const value2 = data[key];
if (["", void 0, null].indexOf(value2) >= 0) {
continue;
}
if (value2.constructor === Array) {
switch (arrayFormat) {
case "indices":
for (let i = 0; i < value2.length; i++) {
_result.push(`${key}[${i}]=${value2[i]}`);
}
break;
case "brackets":
value2.forEach((_value) => {
_result.push(`${key}[]=${_value}`);
});
break;
case "repeat":
value2.forEach((_value) => {
_result.push(`${key}=${_value}`);
});
break;
case "comma":
let commaStr = "";
value2.forEach((_value) => {
commaStr += (commaStr ? "," : "") + _value;
});
_result.push(`${key}=${commaStr}`);
break;
default:
value2.forEach((_value) => {
_result.push(`${key}[]=${_value}`);
});
}
} else {
_result.push(`${key}=${value2}`);
}
}
return _result.length ? prefix + _result.join("&") : "";
}
function toast(title, duration = 2e3) {
uni.showToast({
title: String(title),
icon: "none",
duration
});
}
function type2icon(type2 = "success", fill = false) {
if (["primary", "info", "error", "warning", "success"].indexOf(type2) == -1)
type2 = "success";
let iconName = "";
switch (type2) {
case "primary":
iconName = "info-circle";
break;
case "info":
iconName = "info-circle";
break;
case "error":
iconName = "close-circle";
break;
case "warning":
iconName = "error-circle";
break;
case "success":
iconName = "checkmark-circle";
break;
default:
iconName = "checkmark-circle";
}
if (fill)
iconName += "-fill";
return iconName;
}
function priceFormat(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
const n2 = !isFinite(+number2) ? 0 : +number2;
const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
let s = "";
s = (prec ? round(n2, prec) + "" : `${Math.round(n2)}`).split(".");
const re = /(-?\d+)(\d{3})/;
while (re.test(s[0])) {
s[0] = s[0].replace(re, `$1${sep}$2`);
}
if ((s[1] || "").length < prec) {
s[1] = s[1] || "";
s[1] += new Array(prec - s[1].length + 1).join("0");
}
return s.join(dec);
}
function getDuration(value2, unit = true) {
const valueNum = parseInt(value2);
if (unit) {
if (/s$/.test(value2))
return value2;
return value2 > 30 ? `${value2}ms` : `${value2}s`;
}
if (/ms$/.test(value2))
return valueNum;
if (/s$/.test(value2))
return valueNum > 30 ? valueNum : valueNum * 1e3;
return valueNum;
}
function padZero(value2) {
return `00${value2}`.slice(-2);
}
function formValidate(instance, event) {
const formItem = $parent.call(instance, "uv-form-item");
const form = $parent.call(instance, "uv-form");
if (formItem && form) {
form.validateField(formItem.prop, () => {
}, event);
}
}
function getProperty(obj, key) {
if (!obj) {
return;
}
if (typeof key !== "string" || key === "") {
return "";
}
if (key.indexOf(".") !== -1) {
const keys = key.split(".");
let firstObj = obj[keys[0]] || {};
for (let i = 1; i < keys.length; i++) {
if (firstObj) {
firstObj = firstObj[keys[i]];
}
}
return firstObj;
}
return obj[key];
}
function setProperty(obj, key, value2) {
if (!obj) {
return;
}
const inFn = function(_obj, keys, v) {
if (keys.length === 1) {
_obj[keys[0]] = v;
return;
}
while (keys.length > 1) {
const k = keys[0];
if (!_obj[k] || typeof _obj[k] !== "object") {
_obj[k] = {};
}
keys.shift();
inFn(_obj[k], keys, v);
}
};
if (typeof key !== "string" || key === "")
;
else if (key.indexOf(".") !== -1) {
const keys = key.split(".");
inFn(obj, keys, value2);
} else {
obj[key] = value2;
}
}
function page() {
var _a;
const pages2 = getCurrentPages();
const route2 = (_a = pages2[pages2.length - 1]) == null ? void 0 : _a.route;
return `/${route2 ? route2 : ""}`;
}
function pages() {
const pages2 = getCurrentPages();
return pages2;
}
function getHistoryPage(back = 0) {
const pages2 = getCurrentPages();
const len = pages2.length;
return pages2[len - 1 + back];
}
function setConfig({
props: props2 = {},
config: config2 = {},
color = {},
zIndex = {}
}) {
const {
deepMerge: deepMerge2
} = uni.$uv;
uni.$uv.config = deepMerge2(uni.$uv.config, config2);
uni.$uv.props = deepMerge2(uni.$uv.props, props2);
uni.$uv.color = deepMerge2(uni.$uv.color, color);
uni.$uv.zIndex = deepMerge2(uni.$uv.zIndex, zIndex);
}
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
$parent,
addStyle,
addUnit,
deepClone,
deepMerge: deepMerge$1,
error,
formValidate,
getDuration,
getHistoryPage,
getProperty,
getPx,
guid,
os,
padZero,
page,
pages,
priceFormat,
queryParams,
random,
randomArray,
range: range$1,
setConfig,
setProperty,
sleep,
sys,
timeFormat,
timeFrom,
toast,
trim,
type2icon
}, Symbol.toStringTag, { value: "Module" }));
class Router {
constructor() {
this.config = {
type: "navigateTo",
url: "",
delta: 1,
// navigateBack页面后退时,回退的层数
params: {},
// 传递的参数
animationType: "pop-in",
// 窗口动画,只在APP有效
animationDuration: 300,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept: false,
// 是否需要拦截
events: {}
// 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
};
this.route = this.route.bind(this);
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath(url2) {
return url2[0] === "/" ? url2 : `/${url2}`;
}
// 整合路由参数
mixinParam(url2, params) {
url2 = url2 && this.addRootPath(url2);
let query = "";
if (/.*\/.*\?.*=.*/.test(url2)) {
query = queryParams(params, false);
return url2 += `&${query}`;
}
query = 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 = deepMerge$1(this.config, options);
mergeConfig.url = this.mixinParam(options.url, options.params);
}
if (mergeConfig.url === page())
return;
if (params.intercept) {
mergeConfig.intercept = params.intercept;
}
mergeConfig.params = params;
mergeConfig = deepMerge$1(this.config, mergeConfig);
if (typeof mergeConfig.intercept === "function") {
const isNext = await new Promise((resolve, reject) => {
mergeConfig.intercept(mergeConfig, resolve);
});
isNext && this.openPage(mergeConfig);
} else {
this.openPage(mergeConfig);
}
}
// 执行路由跳转
openPage(config2) {
const {
url: url2,
type: type2,
delta,
animationType,
animationDuration,
events
} = config2;
if (config2.type == "navigateTo" || config2.type == "to") {
uni.navigateTo({
url: url2,
animationType,
animationDuration,
events
});
}
if (config2.type == "redirectTo" || config2.type == "redirect") {
uni.redirectTo({
url: url2
});
}
if (config2.type == "switchTab" || config2.type == "tab") {
uni.switchTab({
url: url2
});
}
if (config2.type == "reLaunch" || config2.type == "launch") {
uni.reLaunch({
url: url2
});
}
if (config2.type == "navigateBack" || config2.type == "back") {
uni.navigateBack({
delta
});
}
}
}
const route = new Router().route;
let timeout = null;
function debounce(func2, wait = 500, immediate = false) {
if (timeout !== null)
clearTimeout(timeout);
if (immediate) {
const callNow = !timeout;
timeout = setTimeout(() => {
timeout = null;
}, wait);
if (callNow)
typeof func2 === "function" && func2();
} else {
timeout = setTimeout(() => {
typeof func2 === "function" && func2();
}, wait);
}
}
let flag;
function throttle(func2, wait = 500, immediate = true) {
if (immediate) {
if (!flag) {
flag = true;
typeof func2 === "function" && func2();
setTimeout(() => {
flag = false;
}, wait);
}
} else if (!flag) {
flag = true;
setTimeout(() => {
flag = false;
typeof func2 === "function" && func2();
}, wait);
}
}
const mixin = {
// 定义每个组件都可能需要用到的外部样式以及类名
props: {
// 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
customStyle: {
type: [Object, String],
default: () => ({})
},
customClass: {
type: String,
default: ""
},
// 跳转的页面路径
url: {
type: String,
default: ""
},
// 页面跳转的类型
linkType: {
type: String,
default: "navigateTo"
}
},
data() {
return {};
},
onLoad() {
this.$uv.getRect = this.$uvGetRect;
},
created() {
this.$uv.getRect = this.$uvGetRect;
},
computed: {
$uv() {
var _a, _b;
return {
...index,
test,
route,
debounce,
throttle,
unit: (_b = (_a = uni == null ? void 0 : uni.$uv) == null ? void 0 : _a.config) == null ? void 0 : _b.unit
};
},
/**
* 生成bem规则类名
* 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
* 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
* @param {String} name 组件名称
* @param {Array} fixed 一直会存在的类名
* @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
* @returns {Array|string}
*/
bem() {
return function(name, fixed, change) {
const prefix = `uv-${name}--`;
const classes = {};
if (fixed) {
fixed.map((item) => {
classes[prefix + this[item]] = true;
});
}
if (change) {
change.map((item) => {
this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
});
}
return Object.keys(classes);
};
}
},
methods: {
// 跳转某一个页面
openPage(urlKey = "url") {
const url2 = this[urlKey];
if (url2) {
uni[this.linkType]({
url: url2
});
}
},
// 查询节点信息
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
// 解决办法为在组件根部再套一个没有任何作用的view元素
$uvGetRect(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 = {};
this.parent = this.$uv.$parent.call(this, parentName);
if (this.parent.children) {
this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
}
if (this.parent && this.parentData) {
Object.keys(this.parentData).map((key) => {
this.parentData[key] = this.parent[key];
});
}
},
// 阻止事件冒泡
preventEvent(e) {
e && typeof e.stopPropagation === "function" && e.stopPropagation();
},
// 空操作
noop(e) {
this.preventEvent(e);
}
},
onReachBottom() {
uni.$emit("uvOnReachBottom");
},
beforeDestroy() {
if (this.parent && array$1(this.parent.children)) {
const childrenList = this.parent.children;
childrenList.map((child, index2) => {
if (child === this) {
childrenList.splice(index2, 1);
}
});
}
},
// 兼容vue3
unmounted() {
if (this.parent && array$1(this.parent.children)) {
const childrenList = this.parent.children;
childrenList.map((child, index2) => {
if (child === this) {
childrenList.splice(index2, 1);
}
});
}
}
};
class MPAnimation {
constructor(options, _this) {
this.options = options;
this.animation = uni.createAnimation({
...options
});
this.currentStepAnimates = {};
this.next = 0;
this.$ = _this;
}
_nvuePushAnimates(type2, args) {
let aniObj = this.currentStepAnimates[this.next];
let styles = {};
if (!aniObj) {
styles = {
styles: {},
config: {}
};
} else {
styles = aniObj;
}
if (animateTypes1.includes(type2)) {
if (!styles.styles.transform) {
styles.styles.transform = "";
}
let unit = "";
if (type2 === "rotate") {
unit = "deg";
}
styles.styles.transform += `${type2}(${args + unit}) `;
} else {
styles.styles[type2] = `${args}`;
}
this.currentStepAnimates[this.next] = styles;
}
_animateRun(styles = {}, config2 = {}) {
let ref = this.$.$refs["ani"].ref;
if (!ref)
return;
return new Promise((resolve, reject) => {
nvueAnimation.transition(ref, {
styles,
...config2
}, (res) => {
resolve();
});
});
}
_nvueNextAnimate(animates, step = 0, fn) {
let obj = animates[step];
if (obj) {
let {
styles,
config: config2
} = obj;
this._animateRun(styles, config2).then(() => {
step += 1;
this._nvueNextAnimate(animates, step, fn);
});
} else {
this.currentStepAnimates = {};
typeof fn === "function" && fn();
this.isEnd = true;
}
}
step(config2 = {}) {
this.animation.step(config2);
return this;
}
run(fn) {
this.$.animationData = this.animation.export();
this.$.timer = setTimeout(() => {
typeof fn === "function" && fn();
}, this.$.durationTime);
}
}
const animateTypes1 = [
"matrix",
"matrix3d",
"rotate",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"scale",
"scale3d",
"scaleX",
"scaleY",
"scaleZ",
"skew",
"skewX",
"skewY",
"translate",
"translate3d",
"translateX",
"translateY",
"translateZ"
];
const animateTypes2 = ["opacity", "backgroundColor"];
const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
animateTypes1.concat(animateTypes2, animateTypes3).forEach((type2) => {
MPAnimation.prototype[type2] = function(...args) {
this.animation[type2](...args);
return this;
};
});
function createAnimation(option, _this) {
if (!_this)
return;
clearTimeout(_this.timer);
return new MPAnimation(option, _this);
}
const _sfc_main$C = {
name: "uv-transition",
mixins: [mpMixin, mixin],
emits: ["click", "change"],
props: {
// 是否展示组件
show: {
type: Boolean,
default: false
},
// 使用的动画模式
mode: {
type: [Array, String, null],
default() {
return "fade";
}
},
// 动画的执行时间,单位ms
duration: {
type: [String, Number],
default: 300
},
// 使用的动画过渡函数
timingFunction: {
type: String,
default: "ease-out"
},
customClass: {
type: String,
default: ""
},
// nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
cellChild: {
type: Boolean,
default: false
}
},
data() {
return {
isShow: false,
transform: "",
opacity: 1,
animationData: {},
durationTime: 300,
config: {}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open();
} else {
if (this.isShow) {
this.close();
}
}
},
immediate: true
}
},
computed: {
// 初始化动画条件
transformStyles() {
const style = {
transform: this.transform,
opacity: this.opacity,
...this.$uv.addStyle(this.customStyle),
"transition-duration": `${this.duration / 1e3}s`
};
return this.$uv.addStyle(style, "string");
}
},
created() {
this.config = {
duration: this.duration,
timingFunction: this.timingFunction,
transformOrigin: "50% 50%",
delay: 0
};
this.durationTime = this.duration;
},
methods: {
/**
* ref 触发 初始化动画
*/
init(obj = {}) {
if (obj.duration) {
this.durationTime = obj.duration;
}
this.animation = createAnimation(Object.assign(this.config, obj), this);
},
/**
* 点击组件触发回调
*/
onClick() {
this.$emit("click", {
detail: this.isShow
});
},
/**
* ref 触发 动画分组
* @param {Object} obj
*/
step(obj, config2 = {}) {
if (!this.animation)
return;
for (let i in obj) {
try {
if (typeof obj[i] === "object") {
this.animation[i](...obj[i]);
} else {
this.animation[i](obj[i]);
}
} catch (e) {
formatAppLog("error", "at uni_modules/uv-transition/components/uv-transition/uv-transition.vue:166", `方法 ${i} 不存在`);
}
}
this.animation.step(config2);
return this;
},
/**
* ref 触发 执行动画
*/
run(fn) {
if (!this.animation)
return;
this.animation.run(fn);
},
// 开始过度动画
open() {
clearTimeout(this.timer);
this.transform = "";
this.isShow = true;
let { opacity, transform } = this.styleInit(false);
if (typeof opacity !== "undefined") {
this.opacity = opacity;
}
this.transform = transform;
this.$nextTick(() => {
this.timer = setTimeout(() => {
this.animation = createAnimation(this.config, this);
this.tranfromInit(false).step();
this.animation.run();
this.$emit("change", {
detail: this.isShow
});
}, 20);
});
},
// 关闭过渡动画
close(type2) {
if (!this.animation)
return;
this.tranfromInit(true).step().run(() => {
this.isShow = false;
this.animationData = null;
this.animation = null;
let { opacity, transform } = this.styleInit(false);
this.opacity = opacity || 1;
this.transform = transform;
this.$emit("change", {
detail: this.isShow
});
});
},
// 处理动画开始前的默认样式
styleInit(type2) {
let styles = {
transform: ""
};
let buildStyle = (type3, mode) => {
if (mode === "fade") {
styles.opacity = this.animationType(type3)[mode];
} else {
styles.transform += this.animationType(type3)[mode] + " ";
}
};
if (typeof this.mode === "string") {
buildStyle(type2, this.mode);
} else {
this.mode.forEach((mode) => {
buildStyle(type2, mode);
});
}
return styles;
},
// 处理内置组合动画
tranfromInit(type2) {
let buildTranfrom = (type3, mode) => {
let aniNum = null;
if (mode === "fade") {
aniNum = type3 ? 0 : 1;
} else {
aniNum = type3 ? "-100%" : "0";
if (mode === "zoom-in") {
aniNum = type3 ? 0.8 : 1;
}
if (mode === "zoom-out") {
aniNum = type3 ? 1.2 : 1;
}
if (mode === "slide-right") {
aniNum = type3 ? "100%" : "0";
}
if (mode === "slide-bottom") {
aniNum = type3 ? "100%" : "0";
}
}
this.animation[this.animationMode()[mode]](aniNum);
};
if (typeof this.mode === "string") {
buildTranfrom(type2, this.mode);
} else {
this.mode.forEach((mode) => {
buildTranfrom(type2, mode);
});
}
return this.animation;
},
animationType(type2) {
return {
fade: type2 ? 1 : 0,
"slide-top": `translateY(${type2 ? "0" : "-100%"})`,
"slide-right": `translateX(${type2 ? "0" : "100%"})`,
"slide-bottom": `translateY(${type2 ? "0" : "100%"})`,
"slide-left": `translateX(${type2 ? "0" : "-100%"})`,
"zoom-in": `scaleX(${type2 ? 1 : 0.8}) scaleY(${type2 ? 1 : 0.8})`,
"zoom-out": `scaleX(${type2 ? 1 : 1.2}) scaleY(${type2 ? 1 : 1.2})`
};
},
// 内置动画类型与实际动画对应字典
animationMode() {
return {
fade: "opacity",
"slide-top": "translateY",
"slide-right": "translateX",
"slide-bottom": "translateY",
"slide-left": "translateX",
"zoom-in": "scale",
"zoom-out": "scale"
};
},
// 驼峰转中横线
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
};
function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", {
key: 0,
ref: "ani",
animation: $data.animationData,
class: vue.normalizeClass($props.customClass),
style: vue.normalizeStyle($options.transformStyles),
onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
}, [
vue.renderSlot(_ctx.$slots, "default")
], 14, ["animation"])) : vue.createCommentVNode("v-if", true);
}
const __easycom_4$1 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-transition/components/uv-transition/uv-transition.vue"]]);
const props$i = {
props: {
// 是否显示遮罩
show: {
type: Boolean,
default: false
},
// 层级z-index
zIndex: {
type: [String, Number],
default: 10070
},
// 遮罩的过渡时间,单位为ms
duration: {
type: [String, Number],
default: 300
},
// 不透明度值,当做rgba的第四个参数
opacity: {
type: [String, Number],
default: 0.5
},
...(_f = (_e = uni.$uv) == null ? void 0 : _e.props) == null ? void 0 : _f.overlay
}
};
const _sfc_main$B = {
name: "uv-overlay",
emits: ["click"],
mixins: [mpMixin, mixin, props$i],
watch: {
show(newVal) {
}
},
computed: {
overlayStyle() {
const style = {
position: "fixed",
top: 0,
left: 0,
right: 0,
zIndex: this.zIndex,
bottom: 0,
"background-color": `rgba(0, 0, 0, ${this.opacity})`
};
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
},
methods: {
clickHandler() {
this.$emit("click");
},
clear() {
}
}
};
function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
return vue.openBlock(), vue.createBlock(_component_uv_transition, {
show: _ctx.show,
mode: "fade",
"custom-class": "uv-overlay",
duration: _ctx.duration,
"custom-style": $options.overlayStyle,
onClick: $options.clickHandler,
onTouchmove: vue.withModifiers($options.clear, ["stop", "prevent"])
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
]),
_: 3
/* FORWARDED */
}, 8, ["show", "duration", "custom-style", "onClick", "onTouchmove"]);
}
const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-7303e1aa"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-overlay/components/uv-overlay/uv-overlay.vue"]]);
function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) {
const startRGB = hexToRgb(startColor, false);
const startR = startRGB[0];
const startG = startRGB[1];
const startB = startRGB[2];
const endRGB = hexToRgb(endColor, false);
const endR = endRGB[0];
const endG = endRGB[1];
const endB = endRGB[2];
const sR = (endR - startR) / step;
const sG = (endG - startG) / step;
const sB = (endB - startB) / step;
const colorArr = [];
for (let i = 0; i < step; i++) {
let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`);
if (i === 0)
hex = rgbToHex(startColor);
if (i === step - 1)
hex = rgbToHex(endColor);
colorArr.push(hex);
}
return colorArr;
}
function hexToRgb(sColor, str = true) {
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
sColor = String(sColor).toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
let sColorNew = "#";
for (let i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
const sColorChange = [];
for (let i = 1; i < 7; i += 2) {
sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`));
}
if (!str) {
return sColorChange;
}
return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
}
if (/^(rgb|RGB)/.test(sColor)) {
const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
return arr.map((val) => Number(val));
}
return sColor;
}
function rgbToHex(rgb) {
const _this = rgb;
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) {
const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
let strHex = "#";
for (let i = 0; i < aColor.length; i++) {
let hex = Number(aColor[i]).toString(16);
hex = String(hex).length == 1 ? `${0}${hex}` : hex;
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
}
if (reg.test(_this)) {
const aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
}
if (aNum.length === 3) {
let numHex = "#";
for (let i = 0; i < aNum.length; i += 1) {
numHex += aNum[i] + aNum[i];
}
return numHex;
}
} else {
return _this;
}
}
const props$h = {
props: {
// 是否显示组件
show: {
type: Boolean,
default: true
},
// 颜色
color: {
type: String,
default: "#909193"
},
// 提示文字颜色
textColor: {
type: String,
default: "#909193"
},
// 文字和图标是否垂直排列
vertical: {
type: Boolean,
default: false
},
// 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形
mode: {
type: String,
default: "spinner"
},
// 图标大小,单位默认px
size: {
type: [String, Number],
default: 24
},
// 文字大小
textSize: {
type: [String, Number],
default: 15
},
// 文字样式
textStyle: {
type: Object,
default() {
return {};
}
},
// 文字内容
text: {
type: [String, Number],
default: ""
},
// 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html
timingFunction: {
type: String,
default: "linear"
},
// 动画执行周期时间
duration: {
type: [String, Number],
default: 1200
},
// mode=circle时的暗边颜色
inactiveColor: {
type: String,
default: ""
},
...(_h = (_g = uni.$uv) == null ? void 0 : _g.props) == null ? void 0 : _h.loadingIcon
}
};
const _sfc_main$A = {
name: "uv-loading-icon",
mixins: [mpMixin, mixin, props$h],
data() {
return {
// Array.form可以通过一个伪数组对象创建指定长度的数组
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
array12: Array.from({
length: 12
}),
// 这里需要设置默认值为360,否则在安卓nvue上,会延迟一个duration周期后才执行
// 在iOS nvue上,则会一开始默认执行两个周期的动画
aniAngel: 360,
// 动画旋转角度
webviewHide: false,
// 监听webview的状态,如果隐藏了页面,则停止动画,以免性能消耗
loading: false
// 是否运行中,针对nvue使用
};
},
computed: {
// 当为circle类型时,给其另外三边设置一个更轻一些的颜色
// 之所以需要这么做的原因是,比如父组件传了color为红色,那么需要另外的三个边为浅红色
// 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
otherBorderColor() {
const lightColor = colorGradient(this.color, "#ffffff", 100)[80];
if (this.mode === "circle") {
return this.inactiveColor ? this.inactiveColor : lightColor;
} else {
return "transparent";
}
}
},
watch: {
show(n2) {
}
},
mounted() {
this.init();
},
methods: {
init() {
setTimeout(() => {
this.show && this.addEventListenerToWebview();
}, 20);
},
// 监听webview的显示与隐藏
addEventListenerToWebview() {
const pages2 = getCurrentPages();
const page2 = pages2[pages2.length - 1];
const currentWebview = page2.$getAppWebview();
currentWebview.addEventListener("hide", () => {
this.webviewHide = true;
});
currentWebview.addEventListener("show", () => {
this.webviewHide = false;
});
}
}
};
function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: vue.normalizeClass(["uv-loading-icon", [_ctx.vertical && "uv-loading-icon--vertical"]]),
style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)])
},
[
!$data.webviewHide ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: vue.normalizeClass(["uv-loading-icon__spinner", [`uv-loading-icon__spinner--${_ctx.mode}`]]),
ref: "ani",
style: vue.normalizeStyle({
color: _ctx.color,
width: _ctx.$uv.addUnit(_ctx.size),
height: _ctx.$uv.addUnit(_ctx.size),
borderTopColor: _ctx.color,
borderBottomColor: $options.otherBorderColor,
borderLeftColor: $options.otherBorderColor,
borderRightColor: $options.otherBorderColor,
"animation-duration": `${_ctx.duration}ms`,
"animation-timing-function": _ctx.mode === "semicircle" || _ctx.mode === "circle" ? _ctx.timingFunction : ""
})
},
[
_ctx.mode === "spinner" ? (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
vue.renderList($data.array12, (item, index2) => {
return vue.openBlock(), vue.createElementBlock("view", {
key: index2,
class: "uv-loading-icon__dot"
});
}),
128
/* KEYED_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true),
_ctx.text ? (vue.openBlock(), vue.createElementBlock(
"text",
{
key: 1,
class: "uv-loading-icon__text",
style: vue.normalizeStyle([{
fontSize: _ctx.$uv.addUnit(_ctx.textSize),
color: _ctx.textColor
}, _ctx.$uv.addStyle(_ctx.textStyle)])
},
vue.toDisplayString(_ctx.text),
5
/* TEXT, STYLE */
)) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true);
}
const __easycom_1$4 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-29b619ea"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-loading-icon/components/uv-loading-icon/uv-loading-icon.vue"]]);
const icons = {
"uvicon-level": "e68f",
"uvicon-checkbox-mark": "e659",
"uvicon-folder": "e694",
"uvicon-movie": "e67c",
"uvicon-star-fill": "e61e",
"uvicon-star": "e618",
"uvicon-phone-fill": "e6ac",
"uvicon-phone": "e6ba",
"uvicon-apple-fill": "e635",
"uvicon-backspace": "e64d",
"uvicon-attach": "e640",
"uvicon-empty-data": "e671",
"uvicon-empty-address": "e68a",
"uvicon-empty-favor": "e662",
"uvicon-empty-car": "e657",
"uvicon-empty-order": "e66b",
"uvicon-empty-list": "e672",
"uvicon-empty-search": "e677",
"uvicon-empty-permission": "e67d",
"uvicon-empty-news": "e67e",
"uvicon-empty-history": "e685",
"uvicon-empty-coupon": "e69b",
"uvicon-empty-page": "e60e",
"uvicon-empty-wifi-off": "e6cc",
"uvicon-reload": "e627",
"uvicon-order": "e695",
"uvicon-server-man": "e601",
"uvicon-search": "e632",
"uvicon-more-dot-fill": "e66f",
"uvicon-scan": "e631",
"uvicon-map": "e665",
"uvicon-map-fill": "e6a8",
"uvicon-tags": "e621",
"uvicon-tags-fill": "e613",
"uvicon-eye": "e664",
"uvicon-eye-fill": "e697",
"uvicon-eye-off": "e69c",
"uvicon-eye-off-outline": "e688",
"uvicon-mic": "e66d",
"uvicon-mic-off": "e691",
"uvicon-calendar": "e65c",
"uvicon-trash": "e623",
"uvicon-trash-fill": "e6ce",
"uvicon-play-left": "e6bf",
"uvicon-play-right": "e6b3",
"uvicon-minus": "e614",
"uvicon-plus": "e625",
"uvicon-info-circle": "e69f",
"uvicon-info-circle-fill": "e6a7",
"uvicon-question-circle": "e622",
"uvicon-question-circle-fill": "e6bc",
"uvicon-close": "e65a",
"uvicon-checkmark": "e64a",
"uvicon-checkmark-circle": "e643",
"uvicon-checkmark-circle-fill": "e668",
"uvicon-setting": "e602",
"uvicon-setting-fill": "e6d0",
"uvicon-heart": "e6a2",
"uvicon-heart-fill": "e68b",
"uvicon-camera": "e642",
"uvicon-camera-fill": "e650",
"uvicon-more-circle": "e69e",
"uvicon-more-circle-fill": "e684",
"uvicon-chat": "e656",
"uvicon-chat-fill": "e63f",
"uvicon-bag": "e647",
"uvicon-error-circle": "e66e",
"uvicon-error-circle-fill": "e655",
"uvicon-close-circle": "e64e",
"uvicon-close-circle-fill": "e666",
"uvicon-share": "e629",
"uvicon-share-fill": "e6bb",
"uvicon-share-square": "e6c4",
"uvicon-shopping-cart": "e6cb",
"uvicon-shopping-cart-fill": "e630",
"uvicon-bell": "e651",
"uvicon-bell-fill": "e604",
"uvicon-list": "e690",
"uvicon-list-dot": "e6a9",
"uvicon-zhifubao-circle-fill": "e617",
"uvicon-weixin-circle-fill": "e6cd",
"uvicon-weixin-fill": "e620",
"uvicon-qq-fill": "e608",
"uvicon-qq-circle-fill": "e6b9",
"uvicon-moments-circel-fill": "e6c2",
"uvicon-moments": "e6a0",
"uvicon-car": "e64f",
"uvicon-car-fill": "e648",
"uvicon-warning-fill": "e6c7",
"uvicon-warning": "e6c1",
"uvicon-clock-fill": "e64b",
"uvicon-clock": "e66c",
"uvicon-edit-pen": "e65d",
"uvicon-edit-pen-fill": "e679",
"uvicon-email": "e673",
"uvicon-email-fill": "e683",
"uvicon-minus-circle": "e6a5",
"uvicon-plus-circle": "e603",
"uvicon-plus-circle-fill": "e611",
"uvicon-file-text": "e687",
"uvicon-file-text-fill": "e67f",
"uvicon-pushpin": "e6d1",
"uvicon-pushpin-fill": "e6b6",
"uvicon-grid": "e68c",
"uvicon-grid-fill": "e698",
"uvicon-play-circle": "e6af",
"uvicon-play-circle-fill": "e62a",
"uvicon-pause-circle-fill": "e60c",
"uvicon-pause": "e61c",
"uvicon-pause-circle": "e696",
"uvicon-gift-fill": "e6b0",
"uvicon-gift": "e680",
"uvicon-kefu-ermai": "e660",
"uvicon-server-fill": "e610",
"uvicon-coupon-fill": "e64c",
"uvicon-coupon": "e65f",
"uvicon-integral": "e693",
"uvicon-integral-fill": "e6b1",
"uvicon-home-fill": "e68e",
"uvicon-home": "e67b",
"uvicon-account": "e63a",
"uvicon-account-fill": "e653",
"uvicon-thumb-down-fill": "e628",
"uvicon-thumb-down": "e60a",
"uvicon-thumb-up": "e612",
"uvicon-thumb-up-fill": "e62c",
"uvicon-lock-fill": "e6a6",
"uvicon-lock-open": "e68d",
"uvicon-lock-opened-fill": "e6a1",
"uvicon-lock": "e69d",
"uvicon-red-packet": "e6c3",
"uvicon-photo-fill": "e6b4",
"uvicon-photo": "e60d",
"uvicon-volume-off-fill": "e6c8",
"uvicon-volume-off": "e6bd",
"uvicon-volume-fill": "e624",
"uvicon-volume": "e605",
"uvicon-download": "e670",
"uvicon-arrow-up-fill": "e636",
"uvicon-arrow-down-fill": "e638",
"uvicon-play-left-fill": "e6ae",
"uvicon-play-right-fill": "e6ad",
"uvicon-arrow-downward": "e634",
"uvicon-arrow-leftward": "e63b",
"uvicon-arrow-rightward": "e644",
"uvicon-arrow-upward": "e641",
"uvicon-arrow-down": "e63e",
"uvicon-arrow-right": "e63c",
"uvicon-arrow-left": "e646",
"uvicon-arrow-up": "e633",
"uvicon-skip-back-left": "e6c5",
"uvicon-skip-forward-right": "e61f",
"uvicon-arrow-left-double": "e637",
"uvicon-man": "e675",
"uvicon-woman": "e626",
"uvicon-en": "e6b8",
"uvicon-twitte": "e607",
"uvicon-twitter-circle-fill": "e6cf"
};
const props$g = {
props: {
// 图标类名
name: {
type: String,
default: ""
},
// 图标颜色,可接受主题色
color: {
type: String,
default: "#606266"
},
// 字体大小,单位px
size: {
type: [String, Number],
default: "16px"
},
// 是否显示粗体
bold: {
type: Boolean,
default: false
},
// 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
index: {
type: [String, Number],
default: null
},
// 触摸图标时的类名
hoverClass: {
type: String,
default: ""
},
// 自定义扩展前缀,方便用户扩展自己的图标库
customPrefix: {
type: String,
default: "uvicon"
},
// 图标右边或者下面的文字
label: {
type: [String, Number],
default: ""
},
// label的位置,只能右边或者下边
labelPos: {
type: String,
default: "right"
},
// label的大小
labelSize: {
type: [String, Number],
default: "15px"
},
// label的颜色
labelColor: {
type: String,
default: "#606266"
},
// label与图标的距离
space: {
type: [String, Number],
default: "3px"
},
// 图片的mode
imgMode: {
type: String,
default: "aspectFit"
},
// 用于显示图片小图标时,图片的宽度
width: {
type: [String, Number],
default: ""
},
// 用于显示图片小图标时,图片的高度
height: {
type: [String, Number],
default: ""
},
// 用于解决某些情况下,让图标垂直居中的用途
top: {
type: [String, Number],
default: 0
},
// 是否阻止事件传播
stop: {
type: Boolean,
default: false
},
...(_j = (_i = uni.$uv) == null ? void 0 : _i.props) == null ? void 0 : _j.icon
}
};
const _sfc_main$z = {
name: "uv-icon",
emits: ["click"],
mixins: [mpMixin, mixin, props$g],
data() {
return {
colorType: [
"primary",
"success",
"info",
"error",
"warning"
]
};
},
computed: {
uClasses() {
let classes = [];
classes.push(this.customPrefix);
classes.push(this.customPrefix + "-" + this.name);
if (this.color && this.colorType.includes(this.color))
classes.push("uv-icon__icon--" + this.color);
return classes;
},
iconStyle() {
let style = {};
style = {
fontSize: this.$uv.addUnit(this.size),
lineHeight: this.$uv.addUnit(this.size),
fontWeight: this.bold ? "bold" : "normal",
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top: this.$uv.addUnit(this.top)
};
if (this.color && !this.colorType.includes(this.color))
style.color = this.color;
return style;
},
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
isImg() {
const isBase64 = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
return this.name.indexOf("/") !== -1 || isBase64;
},
imgStyle() {
let style = {};
style.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size);
style.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size);
return style;
},
// 通过图标名,查找对应的图标
icon() {
const code2 = icons["uvicon-" + this.name];
return code2 ? unescape(`%u${code2}`) : ["uvicon"].indexOf(this.customPrefix) > -1 ? this.name : "";
}
},
methods: {
clickHandler(e) {
this.$emit("click", this.index);
this.stop && this.preventEvent(e);
}
}
};
function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: vue.normalizeClass(["uv-icon", ["uv-icon--" + _ctx.labelPos]]),
onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
},
[
$options.isImg ? (vue.openBlock(), vue.createElementBlock("image", {
key: 0,
class: "uv-icon__img",
src: _ctx.name,
mode: _ctx.imgMode,
style: vue.normalizeStyle([$options.imgStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
}, null, 12, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("text", {
key: 1,
class: vue.normalizeClass(["uv-icon__icon", $options.uClasses]),
style: vue.normalizeStyle([$options.iconStyle, _ctx.$uv.addStyle(_ctx.customStyle)]),
"hover-class": _ctx.hoverClass
}, vue.toDisplayString($options.icon), 15, ["hover-class"])),
vue.createCommentVNode(' 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 '),
_ctx.label !== "" ? (vue.openBlock(), vue.createElementBlock(
"text",
{
key: 2,
class: "uv-icon__label",
style: vue.normalizeStyle({
color: _ctx.labelColor,
fontSize: _ctx.$uv.addUnit(_ctx.labelSize),
marginLeft: _ctx.labelPos == "right" ? _ctx.$uv.addUnit(_ctx.space) : 0,
marginTop: _ctx.labelPos == "bottom" ? _ctx.$uv.addUnit(_ctx.space) : 0,
marginRight: _ctx.labelPos == "left" ? _ctx.$uv.addUnit(_ctx.space) : 0,
marginBottom: _ctx.labelPos == "top" ? _ctx.$uv.addUnit(_ctx.space) : 0
})
},
vue.toDisplayString(_ctx.label),
5
/* TEXT, STYLE */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const __easycom_3$4 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-b7a6dd5d"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-icon/components/uv-icon/uv-icon.vue"]]);
const props$f = {
props: {
// 背景颜色(默认transparent)
bgColor: {
type: String,
default: "transparent"
},
// 分割槽高度,单位px(默认20)
height: {
type: [String, Number],
default: 20
},
// 与上一个组件的距离
marginTop: {
type: [String, Number],
default: 0
},
// 与下一个组件的距离
marginBottom: {
type: [String, Number],
default: 0
},
...(_l = (_k = uni.$uv) == null ? void 0 : _k.props) == null ? void 0 : _l.gap
}
};
const _sfc_main$y = {
name: "uv-gap",
mixins: [mpMixin, mixin, props$f],
computed: {
gapStyle() {
const style = {
backgroundColor: this.bgColor,
height: this.$uv.addUnit(this.height),
marginTop: this.$uv.addUnit(this.marginTop),
marginBottom: this.$uv.addUnit(this.marginBottom)
};
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
}
};
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: "uv-gap",
style: vue.normalizeStyle([$options.gapStyle])
},
null,
4
/* STYLE */
);
}
const __easycom_3$3 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-gap/components/uv-gap/uv-gap.vue"]]);
const _sfc_main$x = {
name: "uv-toast",
mixins: [mpMixin, mixin],
data() {
return {
isShow: false,
timer: null,
// 定时器
config: {
message: "",
// 显示文本
type: "",
// 主题类型,primary,success,error,warning,black
duration: 2e3,
// 显示的时间,毫秒
icon: true,
// 显示的图标
position: "center",
// toast出现的位置
complete: null,
// 执行完后的回调函数
overlay: true,
// 是否防止触摸穿透
loading: false,
// 是否加载中状态
zIndex: 10090
//弹出的层级
},
tmpConfig: {},
// 将用户配置和内置配置合并后的临时配置变量
rect: {},
opacity: 0
};
},
computed: {
iconName() {
if (!this.tmpConfig.icon || this.tmpConfig.icon == "none") {
return "";
}
if (["error", "warning", "success", "primary"].includes(this.tmpConfig.type)) {
return this.$uv.type2icon(this.tmpConfig.type);
} else {
return "";
}
},
overlayStyle() {
const style = {
justifyContent: "center",
alignItems: "center",
display: "flex",
zIndex: this.tmpConfig.zIndex
};
style.backgroundColor = "rgba(0, 0, 0, 0)";
return style;
},
iconStyle() {
const style = {};
style.marginRight = "4px";
return style;
},
aniStyle() {
const style = {
position: "fixed",
zIndex: this.tmpConfig.zIndex
};
return style;
},
// 内容盒子的样式
contentStyle() {
this.$uv.sys();
const style = {
position: "fixed",
top: "50%",
left: "50%"
};
let value2 = 0;
if (this.tmpConfig.position === "top") {
style.top = "25%";
} else if (this.tmpConfig.position === "bottom") {
style.top = "75%";
} else {
value2 = "-50%";
}
style.transform = `translate(-50%,${value2})`;
return style;
}
},
created() {
["primary", "success", "error", "warning", "default", "loading"].map((item) => {
this[item] = (message) => this.show({
type: item,
message
});
});
},
methods: {
// 显示toast组件,由父组件通过this.$refs.xxx.show(options)形式调用
show(options) {
this.tmpConfig = this.$uv.deepMerge(this.config, options);
this.clearTimer();
this.isShow = true;
this.timer = setTimeout(() => {
this.clearTimer();
typeof this.tmpConfig.complete === "function" && this.tmpConfig.complete();
}, this.tmpConfig.duration);
},
// 查询内容高度
queryRect() {
return new Promise((resolve) => {
const ref = this.$refs["uvToastContent"];
dom.getComponentRect(ref, (res) => {
resolve(res.size);
});
});
},
// 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
hide() {
this.clearTimer();
},
clearTimer() {
this.isShow = false;
clearTimeout(this.timer);
this.timer = null;
}
},
unmounted() {
this.clearTimer();
}
};
function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$3);
const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
const _component_uv_gap = resolveEasycom(vue.resolveDynamicComponent("uv-gap"), __easycom_3$3);
const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
return vue.openBlock(), vue.createElementBlock("view", { class: "uv-toast" }, [
vue.createVNode(_component_uv_overlay, {
show: $data.isShow && $data.tmpConfig.overlay,
"custom-style": $options.overlayStyle
}, null, 8, ["show", "custom-style"]),
vue.createVNode(_component_uv_transition, {
show: $data.isShow,
mode: "fade",
"custom-style": $options.aniStyle
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{
class: vue.normalizeClass(["uv-toast__content", ["uv-type-" + $data.tmpConfig.type, $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? "uv-toast__content--loading" : ""]]),
ref: "uvToastContent",
style: vue.normalizeStyle([$options.contentStyle])
},
[
$data.tmpConfig.type === "loading" ? (vue.openBlock(), vue.createBlock(_component_uv_loading_icon, {
key: 0,
mode: "circle",
color: "rgb(255, 255, 255)",
inactiveColor: "rgb(120, 120, 120)",
size: "25"
})) : $data.tmpConfig.type !== "defalut" && $options.iconName ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
key: 1,
name: $options.iconName,
size: "17",
color: $data.tmpConfig.type,
customStyle: $options.iconStyle
}, null, 8, ["name", "color", "customStyle"])) : vue.createCommentVNode("v-if", true),
$data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? (vue.openBlock(), vue.createBlock(_component_uv_gap, {
key: 2,
height: "12",
bgColor: "transparent"
})) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"text",
{
class: vue.normalizeClass(["uv-toast__content__text", ["uv-toast__content__text--" + $data.tmpConfig.type]]),
style: { "max-width": "400rpx" }
},
vue.toDisplayString($data.tmpConfig.message),
3
/* TEXT, CLASS */
)
],
6
/* CLASS, STYLE */
)
]),
_: 1
/* STABLE */
}, 8, ["show", "custom-style"])
]);
}
const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-70f56d7c"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-toast/components/uv-toast/uv-toast.vue"]]);
const props$e = {
props: {
// 文字颜色
color: {
type: String,
default: ""
},
// 字体大小,单位px
fontSize: {
type: [String, Number],
default: 14
},
// 是否显示下划线
underLine: {
type: Boolean,
default: false
},
// 要跳转的链接
href: {
type: String,
default: ""
},
// 小程序中复制到粘贴板的提示语
mpTips: {
type: String,
default: "链接已复制,请在浏览器打开"
},
// 下划线颜色
lineColor: {
type: String,
default: ""
},
// 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
text: {
type: String,
default: ""
},
...(_n = (_m = uni.$uv) == null ? void 0 : _m.props) == null ? void 0 : _n.link
}
};
const _sfc_main$w = {
name: "uv-link",
emits: ["click"],
mixins: [mpMixin, mixin, props$e],
computed: {
linkStyle() {
const style = {
color: this.color,
fontSize: this.$uv.addUnit(this.fontSize),
// line-height设置为比字体大小多2px
lineHeight: this.$uv.addUnit(this.$uv.getPx(this.fontSize) + 2),
textDecoration: this.underLine ? "underline" : "none"
};
return style;
}
},
methods: {
openLink() {
plus.runtime.openURL(this.href);
this.$emit("click");
}
}
};
function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"text",
{
class: "uv-link",
onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.openLink && $options.openLink(...args), ["stop"])),
style: vue.normalizeStyle([$options.linkStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
},
vue.toDisplayString(_ctx.text),
5
/* TEXT, STYLE */
);
}
const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-86e87617"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-link/components/uv-link/uv-link.vue"]]);
const value$1 = {
computed: {
// 经处理后需要显示的值
value() {
const {
text,
mode,
format: format2,
href
} = this;
if (mode === "price") {
if (!/^\d+(\.\d+)?$/.test(text)) {
error("金额模式下,text参数需要为金额格式");
}
if (func(format2)) {
return format2(text);
}
return priceFormat(text, 2);
}
if (mode === "date") {
!date$1(text) && error("日期模式下,text参数需要为日期或时间戳格式");
if (func(format2)) {
return format2(text);
}
if (format2) {
return timeFormat(text, format2);
}
return timeFormat(text, "yyyy-mm-dd");
}
if (mode === "phone") {
if (func(format2)) {
return format2(text);
}
if (format2 === "encrypt") {
return `${text.substr(0, 3)}****${text.substr(7)}`;
}
return text;
}
if (mode === "name") {
!(typeof text === "string") && error("姓名模式下,text参数需要为字符串格式");
if (func(format2)) {
return format2(text);
}
if (format2 === "encrypt") {
return this.formatName(text);
}
return text;
}
if (mode === "link") {
!url(href) && error("超链接模式下,href参数需要为URL格式");
return text;
}
return text;
}
},
methods: {
// 默认的姓名脱敏规则
formatName(name) {
let value2 = "";
if (name.length === 2) {
value2 = name.substr(0, 1) + "*";
} else if (name.length > 2) {
let char = "";
for (let i = 0, len = name.length - 2; i < len; i++) {
char += "*";
}
value2 = name.substr(0, 1) + char + name.substr(-1, 1);
} else {
value2 = name;
}
return value2;
}
}
};
const props$d = {
props: {
// 主题颜色
type: {
type: String,
default: ""
},
// 是否显示
show: {
type: Boolean,
default: true
},
// 显示的值
text: {
type: [String, Number],
default: ""
},
// 前置图标
prefixIcon: {
type: String,
default: ""
},
// 后置图标
suffixIcon: {
type: String,
default: ""
},
// 文本处理的匹配模式
// text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
mode: {
type: String,
default: ""
},
// mode=link下,配置的链接
href: {
type: String,
default: ""
},
// 格式化规则
format: {
type: [String, Function],
default: ""
},
// mode=phone时,点击文本是否拨打电话
call: {
type: Boolean,
default: true
},
// 小程序的打开方式
openType: {
type: String,
default: ""
},
// 是否粗体,默认normal
bold: {
type: Boolean,
default: false
},
// 是否块状
block: {
type: Boolean,
default: false
},
// 文本显示的行数,如果设置,超出此行数,将会显示省略号
lines: {
type: [String, Number],
default: ""
},
// 文本颜色
color: {
type: String,
default: "#303133"
},
// 字体大小
size: {
type: [String, Number],
default: 15
},
// 图标的样式
iconStyle: {
type: [Object, String],
default: () => ({
fontSize: "15px"
})
},
// 文字装饰,下划线,中划线等,可选值 none|underline|line-through
decoration: {
type: String,
default: "none"
},
// 外边距,对象、字符串,数值形式均可
margin: {
type: [Object, String, Number],
default: 0
},
// 文本行高
lineHeight: {
type: [String, Number],
default: ""
},
// 文本对齐方式,可选值left|center|right
align: {
type: String,
default: "left"
},
// 文字换行,可选值break-word|normal|anywhere
wordWrap: {
type: String,
default: "normal"
},
...(_p = (_o = uni.$uv) == null ? void 0 : _o.props) == null ? void 0 : _p.text
}
};
const _sfc_main$v = {
name: "uv-text",
emits: ["click"],
mixins: [mpMixin, mixin, value$1, props$d],
computed: {
valueStyle() {
const style = {
textDecoration: this.decoration,
fontWeight: this.bold ? "bold" : "normal",
wordWrap: this.wordWrap,
fontSize: this.$uv.addUnit(this.size)
};
!this.type && (style.color = this.color);
this.isNvue && this.lines && (style.lines = this.lines);
if (this.isNvue && this.mode != "price" && !this.prefixIcon && !this.suffixIcon) {
style.flex = 1;
style.textAlign = this.align === "left" ? "flex-start" : this.align === "center" ? "center" : "right";
}
this.lineHeight && (style.lineHeight = this.$uv.addUnit(this.lineHeight));
!this.isNvue && this.block && (style.display = "block");
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
},
isNvue() {
let nvue = false;
return nvue;
},
isMp() {
let mp = false;
return mp;
}
},
data() {
return {};
},
methods: {
clickHandler() {
if (this.call && this.mode === "phone") {
uni.makePhoneCall({
phoneNumber: this.text
});
}
this.$emit("click");
}
}
};
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
const _component_uv_link = resolveEasycom(vue.resolveDynamicComponent("uv-link"), __easycom_1$3);
return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: vue.normalizeClass(["uv-text", []]),
style: vue.normalizeStyle({
margin: _ctx.margin,
justifyContent: _ctx.align === "left" ? "flex-start" : _ctx.align === "center" ? "center" : "flex-end"
}),
onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
},
[
_ctx.mode === "price" ? (vue.openBlock(), vue.createElementBlock(
"text",
{
key: 0,
class: vue.normalizeClass(["uv-text__price", _ctx.type && `uv-text__value--${_ctx.type}`]),
style: vue.normalizeStyle([$options.valueStyle])
},
"¥",
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true),
_ctx.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
key: 1,
class: "uv-text__prefix-icon"
}, [
vue.createVNode(_component_uv_icon, {
name: _ctx.prefixIcon,
customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
}, null, 8, ["name", "customStyle"])
])) : vue.createCommentVNode("v-if", true),
_ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_uv_link, {
key: 2,
text: _ctx.value,
href: _ctx.href,
underLine: ""
}, null, 8, ["text", "href"])) : _ctx.openType && $options.isMp ? (vue.openBlock(), vue.createElementBlock("button", {
key: 3,
class: "uv-reset-button uv-text__value",
style: vue.normalizeStyle([$options.valueStyle]),
openType: _ctx.openType,
onGetuserinfo: _cache[0] || (_cache[0] = (...args) => _ctx.onGetUserInfo && _ctx.onGetUserInfo(...args)),
onContact: _cache[1] || (_cache[1] = (...args) => _ctx.onContact && _ctx.onContact(...args)),
onGetphonenumber: _cache[2] || (_cache[2] = (...args) => _ctx.onGetPhoneNumber && _ctx.onGetPhoneNumber(...args)),
onError: _cache[3] || (_cache[3] = (...args) => _ctx.onError && _ctx.onError(...args)),
onLaunchapp: _cache[4] || (_cache[4] = (...args) => _ctx.onLaunchApp && _ctx.onLaunchApp(...args)),
onOpensetting: _cache[5] || (_cache[5] = (...args) => _ctx.onOpenSetting && _ctx.onOpenSetting(...args)),
lang: _ctx.lang,
"session-from": _ctx.sessionFrom,
"send-message-title": _ctx.sendMessageTitle,
"send-message-path": _ctx.sendMessagePath,
"send-message-img": _ctx.sendMessageImg,
"show-message-card": _ctx.showMessageCard,
"app-parameter": _ctx.appParameter
}, vue.toDisplayString(_ctx.value), 45, ["openType", "lang", "session-from", "send-message-title", "send-message-path", "send-message-img", "show-message-card", "app-parameter"])) : (vue.openBlock(), vue.createElementBlock(
"text",
{
key: 4,
class: vue.normalizeClass(["uv-text__value", [
_ctx.type && `uv-text__value--${_ctx.type}`,
_ctx.lines && `uv-line-${_ctx.lines}`
]]),
style: vue.normalizeStyle([$options.valueStyle])
},
vue.toDisplayString(_ctx.value),
7
/* TEXT, CLASS, STYLE */
)),
_ctx.suffixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
key: 5,
class: "uv-text__suffix-icon"
}, [
vue.createVNode(_component_uv_icon, {
name: _ctx.suffixIcon,
customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
}, null, 8, ["name", "customStyle"])
])) : vue.createCommentVNode("v-if", true)
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true);
}
const __easycom_2$4 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-8da47eb3"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-text/components/uv-text/uv-text.vue"]]);
const props$c = {
props: {
// 图片地址
src: {
type: String,
default: ""
},
// 裁剪模式
mode: {
type: String,
default: "aspectFill"
},
// 宽度,单位任意
width: {
type: [String, Number],
default: "300"
},
// 高度,单位任意
height: {
type: [String, Number],
default: "225"
},
// 图片形状,circle-圆形,square-方形
shape: {
type: String,
default: "square"
},
// 圆角,单位任意
radius: {
type: [String, Number],
default: 0
},
// 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
lazyLoad: {
type: Boolean,
default: true
},
// 是否开启observer懒加载,nvue不生效
observeLazyLoad: {
type: Boolean,
default: false
},
// 开启长按图片显示识别微信小程序码菜单
showMenuByLongpress: {
type: Boolean,
default: true
},
// 加载中的图标,或者小图片
loadingIcon: {
type: String,
default: "photo"
},
// 加载失败的图标,或者小图片
errorIcon: {
type: String,
default: "error-circle"
},
// 是否显示加载中的图标或者自定义的slot
showLoading: {
type: Boolean,
default: true
},
// 是否显示加载错误的图标或者自定义的slot
showError: {
type: Boolean,
default: true
},
// 是否需要淡入效果
fade: {
type: Boolean,
default: true
},
// 只支持网络资源,只对微信小程序有效
webp: {
type: Boolean,
default: false
},
// 过渡时间,单位ms
duration: {
type: [String, Number],
default: 500
},
// 背景颜色,用于深色页面加载图片时,为了和背景色融合
bgColor: {
type: String,
default: "#f3f4f6"
},
// nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
cellChild: {
type: Boolean,
default: false
},
...(_r = (_q = uni.$uv) == null ? void 0 : _q.props) == null ? void 0 : _r.image
}
};
const _sfc_main$u = {
name: "uv-image",
emits: ["click", "load", "error"],
mixins: [mpMixin, mixin, props$c],
data() {
return {
// 图片是否加载错误,如果是,则显示错误占位图
isError: false,
// 初始化组件时,默认为加载中状态
loading: true,
// 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
backgroundStyle: {},
// 用于fade模式的控制组件显示与否
show: false,
// 是否开启图片出现在可视范围进行加载(另一种懒加载)
observeShow: !this.observeLazyLoad,
elIndex: "",
// 因为props的值无法修改,故需要一个中间值
imgWidth: this.width,
// 因为props的值无法修改,故需要一个中间值
imgHeight: this.height,
thresholdValue: 50
};
},
watch: {
src: {
immediate: true,
handler(n2) {
if (!n2) {
this.isError = true;
} else {
this.isError = false;
this.loading = true;
}
}
},
width(newVal) {
this.show = false;
this.$uv.sleep(2).then((res) => {
this.show = true;
});
this.imgWidth = newVal;
},
height(newVal) {
this.show = false;
this.$uv.sleep(2).then((res) => {
this.show = true;
});
this.imgHeight = newVal;
}
},
computed: {
wrapStyle() {
let style = {};
if (this.mode !== "heightFix") {
style.width = this.$uv.addUnit(this.imgWidth);
}
if (this.mode !== "widthFix") {
style.height = this.$uv.addUnit(this.imgHeight);
}
style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
style.overflow = this.radius > 0 ? "hidden" : "visible";
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
},
imageStyle() {
let style = {};
style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
return style;
}
},
created() {
this.elIndex = this.$uv.guid();
this.observer = {};
this.observerName = "lazyLoadContentObserver";
},
mounted() {
this.show = true;
this.$nextTick(() => {
if (this.observeLazyLoad)
this.observerFn();
});
},
methods: {
// 点击图片
onClick() {
this.$emit("click");
},
// 图片加载失败
onErrorHandler(err) {
this.loading = false;
this.isError = true;
this.$emit("error", err);
},
// 图片加载完成,标记loading结束
onLoadHandler(event) {
if (this.mode == "widthFix")
this.imgHeight = "auto";
if (this.mode == "heightFix")
this.imgWidth = "auto";
this.loading = false;
this.isError = false;
this.$emit("load", event);
this.removeBgColor();
},
// 移除图片的背景色
removeBgColor() {
this.backgroundStyle = {
backgroundColor: "transparent"
};
},
// 观察图片是否在可见视口
observerFn() {
this.$nextTick(() => {
uni.$once("onLazyLoadReachBottom", () => {
if (!this.observeShow)
this.observeShow = true;
});
});
setTimeout(() => {
this.disconnectObserver(this.observerName);
const contentObserver = uni.createIntersectionObserver(this);
contentObserver.relativeToViewport({
bottom: this.thresholdValue
}).observe(`.uv-image--${this.elIndex}`, (res) => {
if (res.intersectionRatio > 0) {
this.observeShow = true;
this.disconnectObserver(this.observerName);
}
});
this[this.observerName] = contentObserver;
}, 50);
},
disconnectObserver(observerName) {
const observer = this[observerName];
observer && observer.disconnect();
}
}
};
function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
return $data.show ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
key: 0,
show: $data.show,
mode: "fade",
duration: _ctx.fade ? _ctx.duration : 0,
"cell-child": _ctx.cellChild,
"custom-style": $options.wrapStyle
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{
class: vue.normalizeClass(["uv-image", [`uv-image--${$data.elIndex}`]]),
onClick: _cache[2] || (_cache[2] = (...args) => $options.onClick && $options.onClick(...args)),
style: vue.normalizeStyle([$options.wrapStyle, $data.backgroundStyle])
},
[
!$data.isError && $data.observeShow ? (vue.openBlock(), vue.createElementBlock("image", {
key: 0,
src: _ctx.src,
mode: _ctx.mode,
onError: _cache[0] || (_cache[0] = (...args) => $options.onErrorHandler && $options.onErrorHandler(...args)),
onLoad: _cache[1] || (_cache[1] = (...args) => $options.onLoadHandler && $options.onLoadHandler(...args)),
"show-menuv-by-longpress": _ctx.showMenuByLongpress,
"lazy-load": _ctx.lazyLoad,
class: "uv-image__image",
style: vue.normalizeStyle([$options.imageStyle]),
webp: _ctx.webp
}, null, 44, ["src", "mode", "show-menuv-by-longpress", "lazy-load", "webp"])) : vue.createCommentVNode("v-if", true),
_ctx.showLoading && $data.loading ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 1,
class: "uv-image__loading",
style: vue.normalizeStyle({
borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
backgroundColor: _ctx.bgColor,
width: _ctx.$uv.addUnit(_ctx.width),
height: _ctx.$uv.addUnit(_ctx.height)
})
},
[
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
vue.createVNode(_component_uv_icon, {
name: _ctx.loadingIcon,
width: _ctx.width,
height: _ctx.height
}, null, 8, ["name", "width", "height"])
], true)
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true),
_ctx.showError && $data.isError && !$data.loading ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 2,
class: "uv-image__error",
style: vue.normalizeStyle({
borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
width: _ctx.$uv.addUnit(_ctx.width),
height: _ctx.$uv.addUnit(_ctx.height)
})
},
[
vue.renderSlot(_ctx.$slots, "error", {}, () => [
vue.createVNode(_component_uv_icon, {
name: _ctx.errorIcon,
width: _ctx.width,
height: _ctx.height
}, null, 8, ["name", "width", "height"])
], true)
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)
]),
_: 3
/* FORWARDED */
}, 8, ["show", "duration", "cell-child", "custom-style"])) : vue.createCommentVNode("v-if", true);
}
const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-8fe9e33e"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-image/components/uv-image/uv-image.vue"]]);
const props$b = {
props: {
// 指示器的整体宽度
indicatorWidth: {
type: [String, Number],
default: 50
},
// 滑块的宽度
indicatorBarWidth: {
type: [String, Number],
default: 20
},
// 是否显示面板指示器
indicator: {
type: Boolean,
default: true
},
// 指示器非激活颜色
indicatorColor: {
type: String,
default: "#f2f2f2"
},
// 指示器的激活颜色
indicatorActiveColor: {
type: String,
default: "#3c9cff"
},
// 指示器样式,可通过bottom,left,right进行定位
indicatorStyle: {
type: [String, Object],
default: ""
},
...(_t = (_s = uni.$uv) == null ? void 0 : _s.props) == null ? void 0 : _t.scrollList
}
};
const block0 = (Comp) => {
(Comp.$wxs || (Comp.$wxs = [])).push("wxs");
(Comp.$wxsModules || (Comp.$wxsModules = {}))["wxs"] = "1f01b1f2";
};
const _sfc_main$t = {
name: "uv-scroll-list",
mixins: [mpMixin, mixin, props$b],
data() {
return {
scrollInfo: {
scrollLeft: 0,
scrollWidth: 0
},
scrollWidth: 0
};
},
computed: {
// 指示器为线型的样式
barStyle() {
const style = {};
style.width = this.$uv.addUnit(this.indicatorBarWidth);
style.backgroundColor = this.indicatorActiveColor;
return style;
},
lineStyle() {
const style = {};
style.width = this.$uv.addUnit(this.indicatorWidth);
style.backgroundColor = this.indicatorColor;
return style;
}
},
mounted() {
this.init();
},
methods: {
init() {
this.getComponentWidth();
},
scrollEvent(status) {
this.$emit(status);
},
// 获取组件的宽度
async getComponentWidth() {
await this.$uv.sleep(30);
this.$uvGetRect(".uv-scroll-list").then((size) => {
this.scrollWidth = size.width;
});
}
}
};
function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: "uv-scroll-list",
ref: "uv-scroll-list"
},
[
vue.createCommentVNode(" 以上平台,支持wxs "),
vue.createElementVNode("scroll-view", {
class: "uv-scroll-list__scroll-view",
"scroll-x": "",
onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.wxs.scroll && _ctx.wxs.scroll(...args)),
onScrolltoupper: _cache[1] || (_cache[1] = (...args) => _ctx.wxs.scrolltoupper && _ctx.wxs.scrolltoupper(...args)),
onScrolltolower: _cache[2] || (_cache[2] = (...args) => _ctx.wxs.scrolltolower && _ctx.wxs.scrolltolower(...args)),
"data-scrollWidth": $data.scrollWidth,
"data-barWidth": _ctx.$uv.getPx(_ctx.indicatorBarWidth),
"data-indicatorWidth": _ctx.$uv.getPx(_ctx.indicatorWidth),
"show-scrollbar": false,
"upper-threshold": 0,
"lower-threshold": 0,
"data-unit": _ctx.$uv.unit
}, [
vue.createElementVNode("view", { class: "uv-scroll-list__scroll-view__content" }, [
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
])
], 40, ["data-scrollWidth", "data-barWidth", "data-indicatorWidth", "data-unit"]),
_ctx.indicator ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: "uv-scroll-list__indicator",
style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.indicatorStyle)])
},
[
vue.createElementVNode(
"view",
{
class: "uv-scroll-list__indicator__line",
style: vue.normalizeStyle([$options.lineStyle])
},
[
vue.createElementVNode(
"view",
{
class: "uv-scroll-list__indicator__line__bar",
style: vue.normalizeStyle([$options.barStyle]),
ref: "uv-scroll-list__indicator__line__bar"
},
null,
4
/* STYLE */
)
],
4
/* STYLE */
)
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" 避免报错 ")
],
512
/* NEED_PATCH */
);
}
if (typeof block0 === "function")
block0(_sfc_main$t);
const __easycom_3$2 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-145f8032"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-scroll-list/components/uv-scroll-list/uv-scroll-list.vue"]]);
const props$a = {
props: {
// 占父容器宽度的多少等分,总分为12份
span: {
type: [String, Number],
default: 12
},
// 指定栅格左侧的间隔数(总12栏)
offset: {
type: [String, Number],
default: 0
},
// 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
justify: {
type: String,
default: "start"
},
// 垂直对齐方式,可选值为top、center、bottom、stretch
align: {
type: String,
default: "stretch"
},
// 文字对齐方式
textAlign: {
type: String,
default: "left"
},
...(_v = (_u = uni.$uv) == null ? void 0 : _u.props) == null ? void 0 : _v.col
}
};
const _sfc_main$s = {
name: "uv-col",
emits: ["click"],
mixins: [mpMixin, mixin, props$a],
data() {
return {
width: 0,
parentData: {
gutter: 0
},
gridNum: 12
};
},
computed: {
uJustify() {
if (this.justify == "end" || this.justify == "start")
return "flex-" + this.justify;
else if (this.justify == "around" || this.justify == "between")
return "space-" + this.justify;
else
return this.justify;
},
uAlignItem() {
if (this.align == "top")
return "flex-start";
if (this.align == "bottom")
return "flex-end";
else
return this.align;
},
colStyle() {
const style = {
// 这里写成"padding: 0 10px"的形式是因为nvue的需要
paddingLeft: this.$uv.addUnit(this.$uv.getPx(this.parentData.gutter) / 2),
paddingRight: this.$uv.addUnit(this.$uv.getPx(this.parentData.gutter) / 2),
alignItems: this.uAlignItem,
justifyContent: this.uJustify,
textAlign: this.textAlign,
// 在非nvue上,使用百分比形式
flex: `0 0 ${100 / this.gridNum * this.span}%`,
marginLeft: 100 / 12 * this.offset + "%"
};
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
},
mounted() {
this.init();
},
methods: {
async init() {
this.updateParentData();
this.width = await this.parent.getComponentWidth();
},
updateParentData() {
this.getParentData("uv-row");
},
clickHandler(e) {
this.$emit("click");
}
}
};
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: vue.normalizeClass(["uv-col", [
"uv-col-" + _ctx.span
]]),
ref: "uv-col",
style: vue.normalizeStyle([$options.colStyle]),
onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
},
[
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
],
6
/* CLASS, STYLE */
);
}
const __easycom_2$3 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-d2bffd23"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-row/components/uv-col/uv-col.vue"]]);
const props$9 = {
props: {
// 给col添加间距,左右边距各占一半
gutter: {
type: [String, Number],
default: 0
},
// 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
justify: {
type: String,
default: "start"
},
// 垂直对齐方式,可选值为top、center、bottom
align: {
type: String,
default: "center"
},
...(_x = (_w = uni.$uv) == null ? void 0 : _w.props) == null ? void 0 : _x.row
}
};
const _sfc_main$r = {
name: "uv-row",
emits: ["click"],
mixins: [mpMixin, mixin, props$9],
data() {
return {};
},
computed: {
uJustify() {
if (this.justify == "end" || this.justify == "start")
return "flex-" + this.justify;
else if (this.justify == "around" || this.justify == "between")
return "space-" + this.justify;
else
return this.justify;
},
uAlignItem() {
if (this.align == "top")
return "flex-start";
if (this.align == "bottom")
return "flex-end";
else
return this.align;
},
rowStyle() {
const style = {
alignItems: this.uAlignItem,
justifyContent: this.uJustify
};
if (this.gutter) {
style.marginLeft = this.$uv.addUnit(-Number(this.gutter) / 2);
style.marginRight = this.$uv.addUnit(-Number(this.gutter) / 2);
}
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
},
methods: {
clickHandler(e) {
this.$emit("click");
},
async getComponentWidth() {
await this.$uv.sleep();
return new Promise((resolve) => {
this.$uvGetRect(".uv-row").then((res) => {
resolve(res.width);
});
});
}
}
};
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: "uv-row",
ref: "uv-row",
style: vue.normalizeStyle([$options.rowStyle]),
onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
},
[
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
],
4
/* STYLE */
);
}
const __easycom_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-692ff899"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-row/components/uv-row/uv-row.vue"]]);
function getlist(data) {
let url2 = baseUrl + "/index.php/index/Fmember/queryfmemberlistbyuserid";
return dorequest("post", url2, data);
}
function submembergenderbyuserid(data) {
let url2 = baseUrl + "/index.php/index/Fmember/submembergenderbyuserid";
return dorequest("post", url2, data);
}
function subfmemberlistbyuserid(data) {
let url2 = baseUrl + "/index.php/index/Fmember/subfmemberlistbyuserid";
return dorequest("post", url2, data);
}
function submembergenderwithuid(data) {
let url2 = baseUrl + "/index.php/index/Fmember/subgenderbyuserid";
let usedata = {
userid: data.userid,
fmemberid: data.fmemberid,
gender: data.gender
};
return dorequest("post", url2, usedata);
}
function querymergescalebyuserid(data) {
let url2 = baseUrl + "/index.php/index/Scale/querymergescalebyuserid";
return dorequest("post", url2, data);
}
function subanswerbyuserid(answer, data) {
let url2 = baseUrl + "/index.php/index/Scale/subanswerbyuserid";
let list = [];
if (!(answer instanceof Array)) {
let item = {
userid: data.userid,
fmemberid: data.fmemberid,
stemid: answer.stemid,
answertype: answer.answertype,
answervalue: answer.answervalue
};
if (answer.answeroptionid) {
item.answeroptionid = answer.answeroptionid;
}
if (answer.answeroption) {
item.answeroption = answer.answeroption;
}
list.push(item);
} else {
list = answer;
}
let usedata = {
answer: JSON.stringify(list),
userid: data.userid,
fmemberid: data.fmemberid,
srid: data.srid,
scaleid: data.scaleid
};
return dorequest("post", url2, usedata);
}
function subcomstatus(srid) {
let url2 = baseUrl + "/index.php/index/Scale/subcomstatus";
let usedata = {
srid
};
return dorequest("post", url2, usedata);
}
const _sfc_main$q = {
data() {
return {
shareimg: "https://backup-1306866048.cos.ap-nanjing.myqcloud.com/workercard/20231228/658d1042e1395.jpg"
};
},
methods: {
showshare() {
},
dosharewechat() {
this.$emit("dosharewechat", { shareimg: this.shareimg });
}
}
};
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
return vue.openBlock(), vue.createElementBlock("view", { class: "share_div" }, [
vue.createVNode(_component_uv_row, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, {
span: "10",
class: "text",
align: "center"
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。 ")
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_uv_col, { span: "2" }, {
default: vue.withCtx(() => [
vue.createElementVNode("view", {
class: "",
onClick: _cache[0] || (_cache[0] = (...args) => $options.dosharewechat && $options.dosharewechat(...args)),
align: "center"
}, [
vue.createVNode(_component_uv_image, {
class: "img",
src: "/static/image/wxfriend.png",
mode: "aspectFill",
shape: "circle",
"lazy-load": true,
width: "50",
height: "50"
}),
vue.createCommentVNode(' ')
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
})
]);
}
const share$3 = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-11758b78"], ["__file", "D:/workspace/uniapp/health2/components/share/share.vue"]]);
const _sfc_main$p = {
data() {
return {
userinfo: {},
userlist: [],
reportinfo: {},
selectuser: false
};
},
components: {
share: share$3
},
methods: {
getlist() {
let data = { userid: this.userinfo.id };
getlist(data).then((res) => {
res = res.data;
if (0 == res.code) {
this.$refs.toast.show({
type: "error",
message: res.errmsg
});
}
if (200 == res.code) {
let userlist = res.resultData;
let fmemberid = this.selectuser ? this.selectuser.fmemberid : this.userinfo.fmemberid;
if (this.selectuser) {
userlist.map((item, index2) => {
item.selected = 0;
if (item.fmemberid == fmemberid) {
item.selected = 1;
return;
}
});
} else {
userlist[0].selected = 1;
uni.setStorage({
key: "selectuser",
data: userlist[0]
});
this.selectuser = userlist[0];
uni.setStorage({
key: "selectuser",
data: this.selectuser
});
}
userlist.map((item, index2) => {
if (!item.gender) {
item.photourl = "/static/image/member.svg";
} else {
switch (item.gender) {
case "1":
item.photourl = "/static/image/selecttype/man.png";
break;
case "2":
item.photourl = "/static/image/selecttype/woman.png";
break;
}
}
});
this.userlist = userlist;
uni.setStorage({
key: "memberlist",
data: this.userlist
});
}
});
},
selected(index2) {
let that = this;
this.userlist.map((item, index1) => {
if (index1 == index2) {
item.selected = 1;
that.selectuser = item;
} else {
item.selected = 0;
}
});
uni.setStorage({
key: "selectuser",
data: this.selectuser
});
this.querymergescalebyuserid();
},
insertmembe() {
let count = this.userlist.length - 1;
if (count >= this.userinfo.fmembercount) {
this.$refs.toast.show({
type: "error",
message: this.$t("member_num_than_max")
});
} else {
uni.navigateTo({
url: "/pages/member/add"
});
}
},
querymergescalebyuserid() {
let userid = this.userinfo.id;
let fmemberid = this.selectuser.fmemberid ? this.selectuser.fmemberid : 0;
let data = { userid, fmemberid };
querymergescalebyuserid(data).then((res) => {
res = res.data;
if (0 == res.code) {
this.$refs.toast.show({
type: "error",
message: res.errmsg
});
return false;
}
if (200 == res.code) {
this.reportinfo = res.resultData;
}
});
},
showreport() {
uni.navigateTo({
url: "/pages/report/report"
});
},
init() {
this.userinfo = uni.getStorageSync("userinfo");
this.selectuser = uni.getStorageSync("selectuser");
this.getlist();
this.querymergescalebyuserid();
},
tostem() {
if (this.reportinfo.stemlist == void 0) {
return;
}
uni.setStorage({
key: "stemlist",
data: this.reportinfo.stemlist
});
if (this.reportinfo.srid == void 0) {
this.reportinfo.srid = 0;
}
this.reportinfo.stemlist;
let srid = this.reportinfo.srid;
uni.setStorage({
key: "srid",
data: srid
});
let stepprogress = this.reportinfo.stepprogress;
tostemlistnext(stepprogress);
},
restem() {
uni.setStorage({
key: "stemlist",
data: this.reportinfo.stemlist
});
if (this.reportinfo.srid == void 0) {
this.reportinfo.srid = 0;
}
this.reportinfo.stemlist;
let srid = 0;
uni.setStorage({
key: "srid",
data: srid
});
let stepprogress = 0;
var scaleid = 4;
tostemlistnext(stepprogress, 0, scaleid, srid);
},
share(data) {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
href: "testapp://",
//title: this.$t('navigationBarTitleText')+"分享",
title: this.$t("share"),
summary: this.$t("share_text"),
imageUrl: data.shareimg,
success: function(res) {
addlog({
json: JSON.stringify(res),
type: "uniapp信息"
});
formatAppLog("log", "at pages/index/index.vue:348", "success:" + JSON.stringify(res));
},
fail: function(err) {
addlog({
json: JSON.stringify(err),
type: "uniapp错误"
});
formatAppLog("log", "at pages/index/index.vue:355", "fail:" + JSON.stringify(err));
}
});
}
},
mounted() {
this.init();
},
onPullDownRefresh() {
this.init();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1e3);
}
};
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
const _component_uv_scroll_list = resolveEasycom(vue.resolveDynamicComponent("uv-scroll-list"), __easycom_3$2);
const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
return vue.openBlock(), vue.createElementBlock(
vue.Fragment,
null,
[
vue.createCommentVNode(` \r
{{$t('navigationBarTitleText')}}\r
`),
vue.createCommentVNode(` \r
\r
`),
vue.createVNode(
_component_uv_toast,
{ ref: "toast" },
null,
512
/* NEED_PATCH */
),
vue.createElementVNode("view", { class: "page" }, [
vue.createElementVNode("view", { class: "bar" }, [
vue.createVNode(_component_uv_text, {
text: _ctx.$t("navigationBarTitleText"),
align: "center",
color: "#fff",
size: "20"
}, null, 8, ["text"])
]),
vue.createElementVNode("view", { class: "bottomarc" }),
vue.createElementVNode("view", null, [
vue.createVNode(_component_uv_row, {
justify: "space-between",
customStyle: "margin-top: 6%"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, {
span: "10",
offset: "1",
class: "box1"
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{ class: "hometitle" },
vue.toDisplayString(_ctx.$t("index_text_1")),
1
/* TEXT */
),
vue.createElementVNode("view", { class: "userlist" }, [
vue.createVNode(_component_uv_row, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, {
span: "10",
class: "scroll_div"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_scroll_list, { indicator: false }, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList($data.userlist, (item, index2) => {
return vue.openBlock(), vue.createElementBlock("view", {
key: index2,
class: "item"
}, [
vue.createVNode(_component_uv_image, {
class: vue.normalizeClass(["img", { memberphoto_select: item.selected }]),
src: item.photourl,
mode: "aspectFill",
shape: "circle",
"lazy-load": true,
width: "60",
height: "60",
onClick: ($event) => $options.selected(index2)
}, null, 8, ["src", "class", "onClick"]),
vue.createVNode(_component_uv_text, {
text: item.membername,
align: "center",
customStyle: "margin-top:0.3rem"
}, null, 8, ["text"])
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_uv_col, { span: "2" }, {
default: vue.withCtx(() => [
vue.createElementVNode("view", { class: "addmember" }, [
vue.createVNode(_component_uv_image, {
class: "img",
src: "/static/image/fabu1.png",
mode: "aspectFill",
shape: "circle",
"lazy-load": true,
width: "50",
height: "50",
onClick: $options.insertmembe
}, null, 8, ["onClick"]),
vue.createVNode(_component_uv_text, {
text: _ctx.$t("new_member"),
align: "center",
customStyle: "margin-top:0.3rem"
}, null, 8, ["text"])
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
})
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}),
vue.createElementVNode("view", { class: "" }, [
vue.createVNode(_component_uv_row, {
justify: "space-between",
customStyle: "margin-top: 2rem"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, {
span: "10",
offset: "1"
}, {
default: vue.withCtx(() => [
vue.createElementVNode("view", { class: "box2" }, [
vue.createElementVNode(
"view",
{ class: "scalename" },
vue.toDisplayString(_ctx.$t("index_text_2")),
1
/* TEXT */
),
vue.createElementVNode("view", { class: "div1" }, [
vue.createVNode(_component_uv_row, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, { span: "6" }, {
default: vue.withCtx(() => [
vue.createElementVNode("image", {
class: "img",
src: "http://qiniusave.chienxutech.com/sdzyy/img/xgng3.png"
})
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_uv_col, { span: "6" }, {
default: vue.withCtx(() => [
vue.createElementVNode("view", { class: "" }, [
vue.createVNode(_component_uv_text, {
text: _ctx.$t("index_text_3")
}, null, 8, ["text"]),
vue.createVNode(_component_uv_text, {
text: _ctx.$t("index_text_4"),
align: "center",
customStyle: "margin-top:30px;margin-bottom:40px"
}, null, 8, ["text"]),
vue.createVNode(_component_uv_text, {
text: _ctx.$t("index_text_5"),
align: "center",
size: "12",
color: "#1a1a1a"
}, null, 8, ["text"])
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
})
]),
vue.createElementVNode(
"view",
{ class: "scalename" },
vue.toDisplayString(_ctx.$t("index_text_6")),
1
/* TEXT */
),
$data.selectuser ? (vue.openBlock(), vue.createElementBlock("view", {
key: 0,
class: "btns"
}, [
vue.createCommentVNode(' '),
vue.createElementVNode("view", null, [
vue.withDirectives(vue.createVNode(
_component_uv_row,
null,
{
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, {
span: "6",
offset: "3"
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{
class: "mybtn",
onClick: _cache[0] || (_cache[0] = (...args) => $options.tostem && $options.tostem(...args))
},
vue.toDisplayString(_ctx.$t("index_btn_1")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
), [
[vue.vShow, 0 == $data.reportinfo.comstatus]
]),
vue.withDirectives(vue.createVNode(
_component_uv_row,
{ gutter: "20" },
{
default: vue.withCtx(() => [
vue.createVNode(_component_uv_col, { span: "6" }, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{
class: "mybtn",
onClick: _cache[1] || (_cache[1] = (...args) => $options.showreport && $options.showreport(...args))
},
vue.toDisplayString(_ctx.$t("index_btn_2")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_uv_col, { span: "6" }, {
default: vue.withCtx(() => [
vue.createElementVNode(
"view",
{
class: "mybtn",
onClick: _cache[2] || (_cache[2] = (...args) => $options.restem && $options.restem(...args))
},
vue.toDisplayString(_ctx.$t("index_btn_3")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
), [
[vue.vShow, 1 == $data.reportinfo.comstatus]
])
])
])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
vue.createElementVNode(
"p",
null,
vue.toDisplayString(_ctx.$t("not_selected")),
1
/* TEXT */
)
])),
vue.createCommentVNode(" mergerscale.comstatus ")
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}),
vue.createCommentVNode(' \r\n \r\n \r\n \r\n ')
])
])
])
],
64
/* STABLE_FRAGMENT */
);
}
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/workspace/uniapp/health2/pages/index/index.vue"]]);
const props$8 = {
props: {
value: {
type: [String, Number],
default: ""
},
modelValue: {
type: [String, Number],
default: ""
},
// 输入框类型
// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
// idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
// digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
// text-文本输入键盘
type: {
type: String,
default: "text"
},
// 是否禁用输入框
disabled: {
type: Boolean,
default: false
},
// 禁用状态时的背景色
disabledColor: {
type: String,
default: "#f5f7fa"
},
// 是否显示清除控件
clearable: {
type: Boolean,
default: false
},
// 是否密码类型
password: {
type: Boolean,
default: false
},
// 最大输入长度,设置为 -1 的时候不限制最大长度
maxlength: {
type: [String, Number],
default: -1
},
// 输入框为空时的占位符
placeholder: {
type: String,
default: null
},
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
placeholderClass: {
type: String,
default: "input-placeholder"
},
// 指定placeholder的样式
placeholderStyle: {
type: [String, Object],
default: "color: #c0c4cc"
},
// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
// https://uniapp.dcloud.io/component/input
// https://uniapp.dcloud.io/component/textarea
confirmType: {
type: String,
default: "done"
},
// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
confirmHold: {
type: Boolean,
default: false
},
// focus时,点击页面的时候不收起键盘,微信小程序有效
holdKeyboard: {
type: Boolean,
default: false
},
// 自动获取焦点
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
focus: {
type: Boolean,
default: false
},
// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
autoBlur: {
type: Boolean,
default: false
},
// 指定focus时光标的位置
cursor: {
type: [String, Number],
default: -1
},
// 输入框聚焦时底部与键盘的距离
cursorSpacing: {
type: [String, Number],
default: 30
},
// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
selectionStart: {
type: [String, Number],
default: -1
},
// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
selectionEnd: {
type: [String, Number],
default: -1
},
// 键盘弹起时,是否自动上推页面
adjustPosition: {
type: Boolean,
default: true
},
// 输入框内容对齐方式,可选值为:left|center|right
inputAlign: {
type: String,
default: "left"
},
// 输入框字体的大小
fontSize: {
type: [String, Number],
default: "14px"
},
// 输入框字体颜色
color: {
type: String,
default: "#303133"
},
// 输入框前置图标
prefixIcon: {
type: String,
default: ""
},
// 前置图标样式,对象或字符串
prefixIconStyle: {
type: [String, Object],
default: ""
},
// 输入框后置图标
suffixIcon: {
type: String,
default: ""
},
// 后置图标样式,对象或字符串
suffixIconStyle: {
type: [String, Object],
default: ""
},
// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
border: {
type: String,
default: "surround"
},
// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
readonly: {
type: Boolean,
default: false
},
// 输入框形状,circle-圆形,square-方形
shape: {
type: String,
default: "square"
},
// 用于处理或者过滤输入框内容的方法
formatter: {
type: [Function, null],
default: null
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
},
...(_z = (_y = uni.$uv) == null ? void 0 : _y.props) == null ? void 0 : _z.input
}
};
const _sfc_main$o = {
name: "uv-input",
mixins: [mpMixin, mixin, props$8],
data() {
return {
// 输入框的值
innerValue: "",
// 是否处于获得焦点状态
focused: false,
// 过滤处理方法
innerFormatter: (value2) => value2
};
},
created() {
this.innerValue = this.modelValue;
},
watch: {
value(newVal) {
this.innerValue = newVal;
},
modelValue(newVal) {
this.innerValue = newVal;
}
},
computed: {
// 是否显示清除控件
isShowClear() {
const { clearable, readonly, focused, innerValue } = this;
return !!clearable && !readonly && !!focused && innerValue !== "";
},
// 组件的类名
inputClass() {
let classes = [], { border, disabled, shape } = this;
border === "surround" && (classes = classes.concat(["uv-border", "uv-input--radius"]));
classes.push(`uv-input--${shape}`);
border === "bottom" && (classes = classes.concat([
"uv-border-bottom",
"uv-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 this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
},
// 输入框的样式
inputStyle() {
const style = {
color: this.color,
fontSize: this.$uv.addUnit(this.fontSize),
textAlign: this.inputAlign
};
if (this.disabled || this.readonly) {
style["pointer-events"] = "none";
}
return style;
}
},
methods: {
// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
setFormatter(e) {
this.innerFormatter = e;
},
// 当键盘输入时,触发input事件
onInput(e) {
let { value: value2 = "" } = e.detail || {};
const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value2);
this.innerValue = value2;
this.$nextTick(() => {
this.innerValue = formatValue;
this.valueChange();
});
},
// 输入框失去焦点时触发
onBlur(event) {
this.$emit("blur", event.detail.value);
this.$uv.sleep(100).then(() => {
this.focused = false;
});
this.$uv.formValidate(this, "blur");
},
// 输入框聚焦时触发
onFocus(event) {
this.focused = true;
this.$emit("focus");
},
// 点击完成按钮时触发
onConfirm(event) {
this.$emit("confirm", this.innerValue);
},
// 键盘高度发生变化的时候触发此事件
// 兼容性:微信小程序2.7.0+、App 3.1.0+
onkeyboardheightchange(e) {
this.$emit("keyboardheightchange", e);
},
// 内容发生变化,进行处理
valueChange() {
if (this.isClear)
this.innerValue = "";
const value2 = this.innerValue;
this.$nextTick(() => {
this.$emit("input", value2);
this.$emit("update:modelValue", value2);
this.$emit("change", value2);
this.$uv.formValidate(this, "change");
});
},
// 点击清除控件
onClear() {
this.innerValue = "";
this.isClear = true;
this.$uv.sleep(200).then((res) => {
this.isClear = false;
});
this.$nextTick(() => {
this.$emit("clear");
this.valueChange();
});
},
/**
* 在安卓nvue上,事件无法冒泡
* 在某些时间,我们希望监听uv-from-item的点击事件,此时会导致点击uv-form-item内的uv-input后
* 无法触发uv-form-item的点击事件,这里通过手动调用uv-form-item的方法进行触发
*/
clickHandler() {
}
}
};
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: vue.normalizeClass(["uv-input", $options.inputClass]),
style: vue.normalizeStyle([$options.wrapperStyle])
},
[
vue.createElementVNode("view", { class: "uv-input__content" }, [
vue.createElementVNode("view", { class: "uv-input__content__prefix-icon" }, [
vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
_ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
key: 0,
name: _ctx.prefixIcon,
size: "18",
customStyle: _ctx.prefixIconStyle
}, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
], true)
]),
vue.createElementVNode("view", {
class: "uv-input__content__field-wrapper",
onClick: _cache[5] || (_cache[5] = (...args) => $options.clickHandler && $options.clickHandler(...args))
}, [
vue.createCommentVNode(" 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时\r\n 为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined\r\n "),
vue.createElementVNode("input", {
class: "uv-input__content__field-wrapper__field",
style: vue.normalizeStyle([$options.inputStyle]),
type: _ctx.type,
focus: _ctx.focus,
cursor: _ctx.cursor,
value: $data.innerValue,
"auto-blur": _ctx.autoBlur,
disabled: _ctx.disabled || _ctx.readonly,
maxlength: _ctx.maxlength,
placeholder: _ctx.placeholder,
"placeholder-style": _ctx.placeholderStyle,
"placeholder-class": _ctx.placeholderClass,
"confirm-type": _ctx.confirmType,
"confirm-hold": _ctx.confirmHold,
"hold-keyboard": _ctx.holdKeyboard,
"cursor-spacing": _ctx.cursorSpacing,
"adjust-position": _ctx.adjustPosition,
"selection-end": _ctx.selectionEnd,
"selection-start": _ctx.selectionStart,
password: _ctx.password || _ctx.type === "password" || void 0,
ignoreCompositionEvent: _ctx.ignoreCompositionEvent,
onInput: _cache[0] || (_cache[0] = (...args) => $options.onInput && $options.onInput(...args)),
onBlur: _cache[1] || (_cache[1] = (...args) => $options.onBlur && $options.onBlur(...args)),
onFocus: _cache[2] || (_cache[2] = (...args) => $options.onFocus && $options.onFocus(...args)),
onConfirm: _cache[3] || (_cache[3] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
onKeyboardheightchange: _cache[4] || (_cache[4] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
}, null, 44, ["type", "focus", "cursor", "value", "auto-blur", "disabled", "maxlength", "placeholder", "placeholder-style", "placeholder-class", "confirm-type", "confirm-hold", "hold-keyboard", "cursor-spacing", "adjust-position", "selection-end", "selection-start", "password", "ignoreCompositionEvent"])
]),
$options.isShowClear ? (vue.openBlock(), vue.createElementBlock("view", {
key: 0,
class: "uv-input__content__clear",
onClick: _cache[6] || (_cache[6] = (...args) => $options.onClear && $options.onClear(...args))
}, [
vue.createVNode(_component_uv_icon, {
name: "close",
size: "11",
color: "#ffffff",
customStyle: "line-height: 12px"
})
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("view", { class: "uv-input__content__subfix-icon" }, [
vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
_ctx.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
key: 0,
name: _ctx.suffixIcon,
size: "18",
customStyle: _ctx.suffixIconStyle
}, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
], true)
])
])
],
6
/* CLASS, STYLE */
);
}
const __easycom_6$1 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-651602aa"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-input/components/uv-input/uv-input.vue"]]);
const props$7 = {
props: {
color: {
type: String,
default: "#d6d7d9"
},
// 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
length: {
type: [String, Number],
default: "100%"
},
// 线条方向,col-竖向,row-横向
direction: {
type: String,
default: "row"
},
// 是否显示细边框
hairline: {
type: Boolean,
default: true
},
// 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
margin: {
type: [String, Number],
default: 0
},
// 是否虚线,true-虚线,false-实线
dashed: {
type: Boolean,
default: false
},
...(_B = (_A = uni.$uv) == null ? void 0 : _A.props) == null ? void 0 : _B.line
}
};
const _sfc_main$n = {
name: "uv-line",
mixins: [mpMixin, mixin, props$7],
computed: {
lineStyle() {
const style = {};
style.margin = this.margin;
if (this.direction === "row") {
style.borderBottomWidth = "1px";
style.borderBottomStyle = this.dashed ? "dashed" : "solid";
style.width = this.$uv.addUnit(this.length);
if (this.hairline)
style.transform = "scaleY(0.5)";
} else {
style.borderLeftWidth = "1px";
style.borderLeftStyle = this.dashed ? "dashed" : "solid";
style.height = this.$uv.addUnit(this.length);
if (this.hairline)
style.transform = "scaleX(0.5)";
}
style.borderColor = this.color;
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
}
};
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"view",
{
class: "uv-line",
style: vue.normalizeStyle([$options.lineStyle])
},
null,
4
/* STYLE */
);
}
const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-dcf8cb8f"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-line/components/uv-line/uv-line.vue"]]);
const props$6 = {
props: {
// input的label提示语
label: {
type: String,
default: ""
},
// 绑定的值
prop: {
type: String,
default: ""
},
// 是否显示表单域的下划线边框
borderBottom: {
type: [Boolean],
default: false
},
// label的位置,left-左边,top-上边
labelPosition: {
type: String,
default: ""
},
// label的宽度,单位px
labelWidth: {
type: [String, Number],
default: ""
},
// 右侧图标
rightIcon: {
type: String,
default: ""
},
// 左侧图标
leftIcon: {
type: String,
default: ""
},
// 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
required: {
type: Boolean,
default: false
},
leftIconStyle: {
type: [String, Object],
default: ""
},
...(_D = (_C = uni.$uv) == null ? void 0 : _C.props) == null ? void 0 : _D.formItem
}
};
const _sfc_main$m = {
name: "uv-form-item",
emits: ["click"],
mixins: [mpMixin, mixin, props$6],
data() {
return {
// 错误提示语
message: "",
parentData: {
// 提示文本的位置
labelPosition: "left",
// 提示文本对齐方式
labelAlign: "left",
// 提示文本的样式
labelStyle: {},
// 提示文本的宽度
labelWidth: 45,
// 错误提示方式
errorType: "message"
}
};
},
created() {
this.init();
},
methods: {
init() {
this.updateParentData();
if (!this.parent) {
this.$uv.error("uv-form-item需要结合uv-form组件使用");
}
},
// 获取父组件的参数
updateParentData() {
this.getParentData("uv-form");
},
// 移除uv-form-item的校验结果
clearValidate() {
this.message = null;
},
// 清空当前的组件的校验结果,并重置为初始值
resetField() {
const value2 = this.$uv.getProperty(this.parent.originalModel, this.prop);
this.$uv.setProperty(this.parent.model, this.prop, value2);
this.message = null;
},
// 点击组件
clickHandler() {
this.$emit("click");
}
}
};
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
return vue.openBlock(), vue.createElementBlock("view", { class: "uv-form-item" }, [
vue.createElementVNode(
"view",
{
class: "uv-form-item__body",
onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), {
flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
}])
},
[
vue.createCommentVNode(' 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" '),
vue.renderSlot(_ctx.$slots, "label", {}, () => [
_ctx.required || _ctx.leftIcon || _ctx.label ? (vue.openBlock(), vue.createElementBlock(
"view",
{
key: 0,
class: "uv-form-item__body__left",
style: vue.normalizeStyle({
width: _ctx.$uv.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
marginBottom: $data.parentData.labelPosition === "left" ? 0 : "5px"
})
},
[
vue.createCommentVNode(" 为了块对齐 "),
vue.createElementVNode("view", { class: "uv-form-item__body__left__content" }, [
vue.createCommentVNode(" nvue不支持伪元素before "),
_ctx.required ? (vue.openBlock(), vue.createElementBlock("text", {
key: 0,
class: "uv-form-item__body__left__content__required"
}, "*")) : vue.createCommentVNode("v-if", true),
_ctx.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", {
key: 1,
class: "uv-form-item__body__left__content__icon"
}, [
vue.createVNode(_component_uv_icon, {
name: _ctx.leftIcon,
"custom-style": _ctx.leftIconStyle
}, null, 8, ["name", "custom-style"])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"text",
{
class: "uv-form-item__body__left__content__label",
style: vue.normalizeStyle([$data.parentData.labelStyle, {
justifyContent: $data.parentData.labelAlign === "left" ? "flex-start" : $data.parentData.labelAlign === "center" ? "center" : "flex-end"
}])
},
vue.toDisplayString(_ctx.label),
5
/* TEXT, STYLE */
)
])
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true)
], true),
vue.createElementVNode("view", { class: "uv-form-item__body__right" }, [
vue.createElementVNode("view", { class: "uv-form-item__body__right__content" }, [
vue.createElementVNode("view", { class: "uv-form-item__body__right__content__slot" }, [
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
]),
vue.createElementVNode("view", { class: "item__body__right__content__icon" }, [
vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
])
])
])
],
4
/* STYLE */
),
vue.renderSlot(_ctx.$slots, "error", {}, () => [
!!$data.message && $data.parentData.errorType === "message" ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
key: 0,
show: true,
duration: 100,
mode: "fade"
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"text",
{
class: "uv-form-item__body__right__message",
style: vue.normalizeStyle({
marginLeft: _ctx.$uv.addUnit($data.parentData.labelPosition === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
})
},
vue.toDisplayString($data.message),
5
/* TEXT, STYLE */
)
]),
_: 1
/* STABLE */
})) : vue.createCommentVNode("v-if", true)
], true),
_ctx.borderBottom ? (vue.openBlock(), vue.createBlock(_component_uv_line, {
key: 0,
color: $data.message && $data.parentData.errorType === "border-bottom" ? "#f56c6c" : "#d6d7d9"
}, null, 8, ["color"])) : vue.createCommentVNode("v-if", true)
]);
}
const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-d1e73275"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-form/components/uv-form-item/uv-form-item.vue"]]);
const props$5 = {
props: {
// 是否细边框
hairline: {
type: Boolean,
default: true
},
// 按钮的预置样式,info,primary,error,warning,success
type: {
type: String,
default: "info"
},
// 按钮尺寸,large,normal,small,mini
size: {
type: String,
default: "normal"
},
// 按钮形状,circle(两边为半圆),square(带圆角)
shape: {
type: String,
default: "square"
},
// 按钮是否镂空
plain: {
type: Boolean,
default: false
},
// 是否禁止状态
disabled: {
type: Boolean,
default: false
},
// 是否加载中
loading: {
type: Boolean,
default: false
},
// 加载中提示文字
loadingText: {
type: [String, Number],
default: ""
},
// 加载状态图标类型
loadingMode: {
type: String,
default: "spinner"
},
// 加载图标大小
loadingSize: {
type: [String, Number],
default: 14
},
// 开放能力,具体请看uniapp稳定关于button组件部分说明
// https://uniapp.dcloud.io/component/button
openType: {
type: String,
default: ""
},
// 用于