You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4029 lines
139 KiB

2 months ago
  1. if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
  2. Promise.prototype.finally = function(callback) {
  3. const promise = this.constructor;
  4. return this.then(
  5. (value) => promise.resolve(callback()).then(() => value),
  6. (reason) => promise.resolve(callback()).then(() => {
  7. throw reason;
  8. })
  9. );
  10. };
  11. }
  12. ;
  13. if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
  14. const global2 = uni.requireGlobal();
  15. ArrayBuffer = global2.ArrayBuffer;
  16. Int8Array = global2.Int8Array;
  17. Uint8Array = global2.Uint8Array;
  18. Uint8ClampedArray = global2.Uint8ClampedArray;
  19. Int16Array = global2.Int16Array;
  20. Uint16Array = global2.Uint16Array;
  21. Int32Array = global2.Int32Array;
  22. Uint32Array = global2.Uint32Array;
  23. Float32Array = global2.Float32Array;
  24. Float64Array = global2.Float64Array;
  25. BigInt64Array = global2.BigInt64Array;
  26. BigUint64Array = global2.BigUint64Array;
  27. }
  28. ;
  29. if (uni.restoreGlobal) {
  30. uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
  31. }
  32. (function(vue) {
  33. "use strict";
  34. function formatAppLog(type, filename, ...args) {
  35. if (uni.__log__) {
  36. uni.__log__(type, filename, ...args);
  37. } else {
  38. console[type].apply(console, [...args, filename]);
  39. }
  40. }
  41. const defineMixin = (options) => {
  42. return options;
  43. };
  44. function email(value) {
  45. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  46. }
  47. function mobile(value) {
  48. return /^1[23456789]\d{9}$/.test(value);
  49. }
  50. function url(value) {
  51. 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(value);
  52. }
  53. function date(value) {
  54. if (!value)
  55. return false;
  56. if (number(value))
  57. value = +value;
  58. return !/Invalid|NaN/.test(new Date(value).toString());
  59. }
  60. function dateISO(value) {
  61. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  62. }
  63. function number(value) {
  64. return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value);
  65. }
  66. function string(value) {
  67. return typeof value === "string";
  68. }
  69. function digits(value) {
  70. return /^\d+$/.test(value);
  71. }
  72. function idCard(value) {
  73. 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(
  74. value
  75. );
  76. }
  77. function carNo(value) {
  78. const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  79. const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  80. if (value.length === 7) {
  81. return creg.test(value);
  82. }
  83. if (value.length === 8) {
  84. return xreg.test(value);
  85. }
  86. return false;
  87. }
  88. function amount(value) {
  89. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  90. }
  91. function chinese(value) {
  92. const reg = /^[\u4e00-\u9fa5]+$/gi;
  93. return reg.test(value);
  94. }
  95. function letter(value) {
  96. return /^[a-zA-Z]*$/.test(value);
  97. }
  98. function enOrNum(value) {
  99. const reg = /^[0-9a-zA-Z]*$/g;
  100. return reg.test(value);
  101. }
  102. function contains(value, param) {
  103. return value.indexOf(param) >= 0;
  104. }
  105. function range$1(value, param) {
  106. return value >= param[0] && value <= param[1];
  107. }
  108. function rangeLength(value, param) {
  109. return value.length >= param[0] && value.length <= param[1];
  110. }
  111. function landline(value) {
  112. const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  113. return reg.test(value);
  114. }
  115. function empty(value) {
  116. switch (typeof value) {
  117. case "undefined":
  118. return true;
  119. case "string":
  120. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
  121. return true;
  122. break;
  123. case "boolean":
  124. if (!value)
  125. return true;
  126. break;
  127. case "number":
  128. if (value === 0 || isNaN(value))
  129. return true;
  130. break;
  131. case "object":
  132. if (value === null || value.length === 0)
  133. return true;
  134. for (const i in value) {
  135. return false;
  136. }
  137. return true;
  138. }
  139. return false;
  140. }
  141. function jsonString(value) {
  142. if (typeof value === "string") {
  143. try {
  144. const obj2 = JSON.parse(value);
  145. if (typeof obj2 === "object" && obj2) {
  146. return true;
  147. }
  148. return false;
  149. } catch (e) {
  150. return false;
  151. }
  152. }
  153. return false;
  154. }
  155. function array(value) {
  156. if (typeof Array.isArray === "function") {
  157. return Array.isArray(value);
  158. }
  159. return Object.prototype.toString.call(value) === "[object Array]";
  160. }
  161. function object(value) {
  162. return Object.prototype.toString.call(value) === "[object Object]";
  163. }
  164. function code(value, len = 6) {
  165. return new RegExp(`^\\d{${len}}$`).test(value);
  166. }
  167. function func(value) {
  168. return typeof value === "function";
  169. }
  170. function promise(value) {
  171. return object(value) && func(value.then) && func(value.catch);
  172. }
  173. function image(value) {
  174. const newValue = value.split("?")[0];
  175. const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
  176. return IMAGE_REGEXP.test(newValue);
  177. }
  178. function video(value) {
  179. const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
  180. return VIDEO_REGEXP.test(value);
  181. }
  182. function regExp(o) {
  183. return o && Object.prototype.toString.call(o) === "[object RegExp]";
  184. }
  185. const test = {
  186. email,
  187. mobile,
  188. url,
  189. date,
  190. dateISO,
  191. number,
  192. digits,
  193. idCard,
  194. carNo,
  195. amount,
  196. chinese,
  197. letter,
  198. enOrNum,
  199. contains,
  200. range: range$1,
  201. rangeLength,
  202. empty,
  203. isEmpty: empty,
  204. jsonString,
  205. landline,
  206. object,
  207. array,
  208. code,
  209. func,
  210. promise,
  211. video,
  212. image,
  213. regExp,
  214. string
  215. };
  216. function strip(num, precision = 15) {
  217. return +parseFloat(Number(num).toPrecision(precision));
  218. }
  219. function digitLength(num) {
  220. const eSplit = num.toString().split(/[eE]/);
  221. const len = (eSplit[0].split(".")[1] || "").length - +(eSplit[1] || 0);
  222. return len > 0 ? len : 0;
  223. }
  224. function float2Fixed(num) {
  225. if (num.toString().indexOf("e") === -1) {
  226. return Number(num.toString().replace(".", ""));
  227. }
  228. const dLen = digitLength(num);
  229. return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
  230. }
  231. function checkBoundary(num) {
  232. {
  233. if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
  234. formatAppLog("warn", "at uni_modules/uview-plus/libs/function/digit.js:45", `${num} 超出了精度限制,结果可能不正确`);
  235. }
  236. }
  237. }
  238. function iteratorOperation(arr, operation) {
  239. const [num1, num2, ...others] = arr;
  240. let res = operation(num1, num2);
  241. others.forEach((num) => {
  242. res = operation(res, num);
  243. });
  244. return res;
  245. }
  246. function times(...nums) {
  247. if (nums.length > 2) {
  248. return iteratorOperation(nums, times);
  249. }
  250. const [num1, num2] = nums;
  251. const num1Changed = float2Fixed(num1);
  252. const num2Changed = float2Fixed(num2);
  253. const baseNum = digitLength(num1) + digitLength(num2);
  254. const leftValue = num1Changed * num2Changed;
  255. checkBoundary(leftValue);
  256. return leftValue / Math.pow(10, baseNum);
  257. }
  258. function divide(...nums) {
  259. if (nums.length > 2) {
  260. return iteratorOperation(nums, divide);
  261. }
  262. const [num1, num2] = nums;
  263. const num1Changed = float2Fixed(num1);
  264. const num2Changed = float2Fixed(num2);
  265. checkBoundary(num1Changed);
  266. checkBoundary(num2Changed);
  267. return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
  268. }
  269. function round(num, ratio) {
  270. const base = Math.pow(10, ratio);
  271. let result = divide(Math.round(Math.abs(times(num, base))), base);
  272. if (num < 0 && result !== 0) {
  273. result = times(result, -1);
  274. }
  275. return result;
  276. }
  277. const version = "3";
  278. {
  279. formatAppLog("log", "at uni_modules/uview-plus/libs/config/config.js:5", `
  280. %c uview-plus V${version} %c https://ijry.github.io/uview-plus/
  281. `, "color: #ffffff; background: #3c9cff; padding:5px 0;", "color: #3c9cff;background: #ffffff; padding:5px 0;");
  282. }
  283. const config = {
  284. v: version,
  285. version,
  286. // 主题名称
  287. type: [
  288. "primary",
  289. "success",
  290. "info",
  291. "error",
  292. "warning"
  293. ],
  294. // 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
  295. color: {
  296. "u-primary": "#2979ff",
  297. "u-warning": "#ff9900",
  298. "u-success": "#19be6b",
  299. "u-error": "#fa3534",
  300. "u-info": "#909399",
  301. "u-main-color": "#303133",
  302. "u-content-color": "#606266",
  303. "u-tips-color": "#909399",
  304. "u-light-color": "#c0c4cc"
  305. },
  306. // 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
  307. unit: "px"
  308. };
  309. function range(min = 0, max = 0, value = 0) {
  310. return Math.max(min, Math.min(max, Number(value)));
  311. }
  312. function getPx(value, unit = false) {
  313. if (number(value)) {
  314. return unit ? `${value}px` : Number(value);
  315. }
  316. if (/(rpx|upx)$/.test(value)) {
  317. return unit ? `${uni.upx2px(parseInt(value))}px` : Number(uni.upx2px(parseInt(value)));
  318. }
  319. return unit ? `${parseInt(value)}px` : parseInt(value);
  320. }
  321. function sleep(value = 30) {
  322. return new Promise((resolve) => {
  323. setTimeout(() => {
  324. resolve();
  325. }, value);
  326. });
  327. }
  328. function os() {
  329. return uni.getSystemInfoSync().platform.toLowerCase();
  330. }
  331. function sys() {
  332. return uni.getSystemInfoSync();
  333. }
  334. function random(min, max) {
  335. if (min >= 0 && max > 0 && max >= min) {
  336. const gab = max - min + 1;
  337. return Math.floor(Math.random() * gab + min);
  338. }
  339. return 0;
  340. }
  341. function guid(len = 32, firstU = true, radix = null) {
  342. const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  343. const uuid = [];
  344. radix = radix || chars.length;
  345. if (len) {
  346. for (let i = 0; i < len; i++)
  347. uuid[i] = chars[0 | Math.random() * radix];
  348. } else {
  349. let r;
  350. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  351. uuid[14] = "4";
  352. for (let i = 0; i < 36; i++) {
  353. if (!uuid[i]) {
  354. r = 0 | Math.random() * 16;
  355. uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
  356. }
  357. }
  358. }
  359. if (firstU) {
  360. uuid.shift();
  361. return `u${uuid.join("")}`;
  362. }
  363. return uuid.join("");
  364. }
  365. function $parent(name = void 0) {
  366. let parent = this.$parent;
  367. while (parent) {
  368. if (parent.$options && parent.$options.name !== name) {
  369. parent = parent.$parent;
  370. } else {
  371. return parent;
  372. }
  373. }
  374. return false;
  375. }
  376. function addStyle(customStyle, target = "object") {
  377. if (empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
  378. return customStyle;
  379. }
  380. if (target === "object") {
  381. customStyle = trim(customStyle);
  382. const styleArray = customStyle.split(";");
  383. const style = {};
  384. for (let i = 0; i < styleArray.length; i++) {
  385. if (styleArray[i]) {
  386. const item = styleArray[i].split(":");
  387. style[trim(item[0])] = trim(item[1]);
  388. }
  389. }
  390. return style;
  391. }
  392. let string2 = "";
  393. if (typeof customStyle === "object") {
  394. customStyle.forEach((val, i) => {
  395. const key = i.replace(/([A-Z])/g, "-$1").toLowerCase();
  396. string2 += `${key}:${val};`;
  397. });
  398. }
  399. return trim(string2);
  400. }
  401. function addUnit(value = "auto", unit = "") {
  402. if (!unit) {
  403. unit = config.unit || "px";
  404. }
  405. value = String(value);
  406. return number(value) ? `${value}${unit}` : value;
  407. }
  408. function deepClone(obj2) {
  409. if ([null, void 0, NaN, false].includes(obj2))
  410. return obj2;
  411. if (typeof obj2 !== "object" && typeof obj2 !== "function") {
  412. return obj2;
  413. }
  414. const o = array(obj2) ? [] : {};
  415. for (const i in obj2) {
  416. if (obj2.hasOwnProperty(i)) {
  417. o[i] = typeof obj2[i] === "object" ? deepClone(obj2[i]) : obj2[i];
  418. }
  419. }
  420. return o;
  421. }
  422. function deepMerge$1(targetOrigin = {}, source = {}) {
  423. let target = deepClone(targetOrigin);
  424. if (typeof target !== "object" || typeof source !== "object")
  425. return false;
  426. for (const prop in source) {
  427. if (!source.hasOwnProperty(prop))
  428. continue;
  429. if (prop in target) {
  430. if (source[prop] == null) {
  431. target[prop] = source[prop];
  432. } else if (typeof target[prop] !== "object") {
  433. target[prop] = source[prop];
  434. } else if (typeof source[prop] !== "object") {
  435. target[prop] = source[prop];
  436. } else if (target[prop].concat && source[prop].concat) {
  437. target[prop] = target[prop].concat(source[prop]);
  438. } else {
  439. target[prop] = deepMerge$1(target[prop], source[prop]);
  440. }
  441. } else {
  442. target[prop] = source[prop];
  443. }
  444. }
  445. return target;
  446. }
  447. function shallowMerge(target, source = {}) {
  448. if (typeof target !== "object" || typeof source !== "object")
  449. return false;
  450. for (const prop in source) {
  451. if (!source.hasOwnProperty(prop))
  452. continue;
  453. if (prop in target) {
  454. if (source[prop] == null) {
  455. target[prop] = source[prop];
  456. } else if (typeof target[prop] !== "object") {
  457. target[prop] = source[prop];
  458. } else if (typeof source[prop] !== "object") {
  459. target[prop] = source[prop];
  460. } else if (target[prop].concat && source[prop].concat) {
  461. target[prop] = target[prop].concat(source[prop]);
  462. } else {
  463. target[prop] = shallowMerge(target[prop], source[prop]);
  464. }
  465. } else {
  466. target[prop] = source[prop];
  467. }
  468. }
  469. return target;
  470. }
  471. function error(err) {
  472. {
  473. formatAppLog("error", "at uni_modules/uview-plus/libs/function/index.js:275", `uView提示:${err}`);
  474. }
  475. }
  476. function randomArray(array2 = []) {
  477. return array2.sort(() => Math.random() - 0.5);
  478. }
  479. if (!String.prototype.padStart) {
  480. String.prototype.padStart = function(maxLength, fillString = " ") {
  481. if (Object.prototype.toString.call(fillString) !== "[object String]") {
  482. throw new TypeError(
  483. "fillString must be String"
  484. );
  485. }
  486. const str = this;
  487. if (str.length >= maxLength)
  488. return String(str);
  489. const fillLength = maxLength - str.length;
  490. let times2 = Math.ceil(fillLength / fillString.length);
  491. while (times2 >>= 1) {
  492. fillString += fillString;
  493. if (times2 === 1) {
  494. fillString += fillString;
  495. }
  496. }
  497. return fillString.slice(0, fillLength) + str;
  498. };
  499. }
  500. function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
  501. let date2;
  502. if (!dateTime) {
  503. date2 = new Date();
  504. } else if (/^\d{10}$/.test(dateTime.toString().trim())) {
  505. date2 = new Date(dateTime * 1e3);
  506. } else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
  507. date2 = new Date(Number(dateTime));
  508. } else {
  509. date2 = new Date(
  510. typeof dateTime === "string" ? dateTime.replace(/-/g, "/") : dateTime
  511. );
  512. }
  513. const timeSource = {
  514. "y": date2.getFullYear().toString(),
  515. // 年
  516. "m": (date2.getMonth() + 1).toString().padStart(2, "0"),
  517. // 月
  518. "d": date2.getDate().toString().padStart(2, "0"),
  519. // 日
  520. "h": date2.getHours().toString().padStart(2, "0"),
  521. // 时
  522. "M": date2.getMinutes().toString().padStart(2, "0"),
  523. // 分
  524. "s": date2.getSeconds().toString().padStart(2, "0")
  525. // 秒
  526. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  527. };
  528. for (const key in timeSource) {
  529. const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
  530. if (ret) {
  531. const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
  532. formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
  533. }
  534. }
  535. return formatStr;
  536. }
  537. function timeFrom(timestamp = null, format = "yyyy-mm-dd") {
  538. if (timestamp == null)
  539. timestamp = Number(new Date());
  540. timestamp = parseInt(timestamp);
  541. if (timestamp.toString().length == 10)
  542. timestamp *= 1e3;
  543. let timer = new Date().getTime() - timestamp;
  544. timer = parseInt(timer / 1e3);
  545. let tips = "";
  546. switch (true) {
  547. case timer < 300:
  548. tips = "刚刚";
  549. break;
  550. case (timer >= 300 && timer < 3600):
  551. tips = `${parseInt(timer / 60)}分钟前`;
  552. break;
  553. case (timer >= 3600 && timer < 86400):
  554. tips = `${parseInt(timer / 3600)}小时前`;
  555. break;
  556. case (timer >= 86400 && timer < 2592e3):
  557. tips = `${parseInt(timer / 86400)}天前`;
  558. break;
  559. default:
  560. if (format === false) {
  561. if (timer >= 2592e3 && timer < 365 * 86400) {
  562. tips = `${parseInt(timer / (86400 * 30))}个月前`;
  563. } else {
  564. tips = `${parseInt(timer / (86400 * 365))}年前`;
  565. }
  566. } else {
  567. tips = timeFormat(timestamp, format);
  568. }
  569. }
  570. return tips;
  571. }
  572. function trim(str, pos = "both") {
  573. str = String(str);
  574. if (pos == "both") {
  575. return str.replace(/^\s+|\s+$/g, "");
  576. }
  577. if (pos == "left") {
  578. return str.replace(/^\s*/, "");
  579. }
  580. if (pos == "right") {
  581. return str.replace(/(\s*$)/g, "");
  582. }
  583. if (pos == "all") {
  584. return str.replace(/\s+/g, "");
  585. }
  586. return str;
  587. }
  588. function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
  589. const prefix = isPrefix ? "?" : "";
  590. const _result = [];
  591. if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
  592. arrayFormat = "brackets";
  593. for (const key in data) {
  594. const value = data[key];
  595. if (["", void 0, null].indexOf(value) >= 0) {
  596. continue;
  597. }
  598. if (value.constructor === Array) {
  599. switch (arrayFormat) {
  600. case "indices":
  601. for (let i = 0; i < value.length; i++) {
  602. _result.push(`${key}[${i}]=${value[i]}`);
  603. }
  604. break;
  605. case "brackets":
  606. value.forEach((_value) => {
  607. _result.push(`${key}[]=${_value}`);
  608. });
  609. break;
  610. case "repeat":
  611. value.forEach((_value) => {
  612. _result.push(`${key}=${_value}`);
  613. });
  614. break;
  615. case "comma":
  616. let commaStr = "";
  617. value.forEach((_value) => {
  618. commaStr += (commaStr ? "," : "") + _value;
  619. });
  620. _result.push(`${key}=${commaStr}`);
  621. break;
  622. default:
  623. value.forEach((_value) => {
  624. _result.push(`${key}[]=${_value}`);
  625. });
  626. }
  627. } else {
  628. _result.push(`${key}=${value}`);
  629. }
  630. }
  631. return _result.length ? prefix + _result.join("&") : "";
  632. }
  633. function toast(title, duration = 2e3) {
  634. uni.showToast({
  635. title: String(title),
  636. icon: "none",
  637. duration
  638. });
  639. }
  640. function type2icon(type = "success", fill = false) {
  641. if (["primary", "info", "error", "warning", "success"].indexOf(type) == -1)
  642. type = "success";
  643. let iconName = "";
  644. switch (type) {
  645. case "primary":
  646. iconName = "info-circle";
  647. break;
  648. case "info":
  649. iconName = "info-circle";
  650. break;
  651. case "error":
  652. iconName = "close-circle";
  653. break;
  654. case "warning":
  655. iconName = "error-circle";
  656. break;
  657. case "success":
  658. iconName = "checkmark-circle";
  659. break;
  660. default:
  661. iconName = "checkmark-circle";
  662. }
  663. if (fill)
  664. iconName += "-fill";
  665. return iconName;
  666. }
  667. function priceFormat(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
  668. number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
  669. const n = !isFinite(+number2) ? 0 : +number2;
  670. const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
  671. const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
  672. const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
  673. let s = "";
  674. s = (prec ? round(n, prec) + "" : `${Math.round(n)}`).split(".");
  675. const re = /(-?\d+)(\d{3})/;
  676. while (re.test(s[0])) {
  677. s[0] = s[0].replace(re, `$1${sep}$2`);
  678. }
  679. if ((s[1] || "").length < prec) {
  680. s[1] = s[1] || "";
  681. s[1] += new Array(prec - s[1].length + 1).join("0");
  682. }
  683. return s.join(dec);
  684. }
  685. function getDuration(value, unit = true) {
  686. const valueNum = parseInt(value);
  687. if (unit) {
  688. if (/s$/.test(value))
  689. return value;
  690. return value > 30 ? `${value}ms` : `${value}s`;
  691. }
  692. if (/ms$/.test(value))
  693. return valueNum;
  694. if (/s$/.test(value))
  695. return valueNum > 30 ? valueNum : valueNum * 1e3;
  696. return valueNum;
  697. }
  698. function padZero(value) {
  699. return `00${value}`.slice(-2);
  700. }
  701. function formValidate(instance, event) {
  702. const formItem = $parent.call(instance, "u-form-item");
  703. const form = $parent.call(instance, "u-form");
  704. if (formItem && form) {
  705. form.validateField(formItem.prop, () => {
  706. }, event);
  707. }
  708. }
  709. function getProperty(obj2, key) {
  710. if (typeof obj2 !== "object" || null == obj2) {
  711. return "";
  712. }
  713. if (typeof key !== "string" || key === "") {
  714. return "";
  715. }
  716. if (key.indexOf(".") !== -1) {
  717. const keys = key.split(".");
  718. let firstObj = obj2[keys[0]] || {};
  719. for (let i = 1; i < keys.length; i++) {
  720. if (firstObj) {
  721. firstObj = firstObj[keys[i]];
  722. }
  723. }
  724. return firstObj;
  725. }
  726. return obj2[key];
  727. }
  728. function setProperty(obj2, key, value) {
  729. if (typeof obj2 !== "object" || null == obj2) {
  730. return;
  731. }
  732. const inFn = function(_obj, keys, v) {
  733. if (keys.length === 1) {
  734. _obj[keys[0]] = v;
  735. return;
  736. }
  737. while (keys.length > 1) {
  738. const k = keys[0];
  739. if (!_obj[k] || typeof _obj[k] !== "object") {
  740. _obj[k] = {};
  741. }
  742. keys.shift();
  743. inFn(_obj[k], keys, v);
  744. }
  745. };
  746. if (typeof key !== "string" || key === "")
  747. ;
  748. else if (key.indexOf(".") !== -1) {
  749. const keys = key.split(".");
  750. inFn(obj2, keys, value);
  751. } else {
  752. obj2[key] = value;
  753. }
  754. }
  755. function page() {
  756. const pages2 = getCurrentPages();
  757. return `/${pages2[pages2.length - 1].route || ""}`;
  758. }
  759. function pages() {
  760. const pages2 = getCurrentPages();
  761. return pages2;
  762. }
  763. const index = {
  764. range,
  765. getPx,
  766. sleep,
  767. os,
  768. sys,
  769. random,
  770. guid,
  771. $parent,
  772. addStyle,
  773. addUnit,
  774. deepClone,
  775. deepMerge: deepMerge$1,
  776. shallowMerge,
  777. error,
  778. randomArray,
  779. timeFormat,
  780. timeFrom,
  781. trim,
  782. queryParams,
  783. toast,
  784. type2icon,
  785. priceFormat,
  786. getDuration,
  787. padZero,
  788. formValidate,
  789. getProperty,
  790. setProperty,
  791. page,
  792. pages
  793. // setConfig
  794. };
  795. class Router {
  796. constructor() {
  797. this.config = {
  798. type: "navigateTo",
  799. url: "",
  800. delta: 1,
  801. // navigateBack页面后退时,回退的层数
  802. params: {},
  803. // 传递的参数
  804. animationType: "pop-in",
  805. // 窗口动画,只在APP有效
  806. animationDuration: 300,
  807. // 窗口动画持续时间,单位毫秒,只在APP有效
  808. intercept: false
  809. // 是否需要拦截
  810. };
  811. this.route = this.route.bind(this);
  812. }
  813. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  814. addRootPath(url2) {
  815. return url2[0] === "/" ? url2 : `/${url2}`;
  816. }
  817. // 整合路由参数
  818. mixinParam(url2, params) {
  819. url2 = url2 && this.addRootPath(url2);
  820. let query = "";
  821. if (/.*\/.*\?.*=.*/.test(url2)) {
  822. query = queryParams(params, false);
  823. return url2 += `&${query}`;
  824. }
  825. query = queryParams(params);
  826. return url2 += query;
  827. }
  828. // 对外的方法名称
  829. async route(options = {}, params = {}) {
  830. let mergeConfig2 = {};
  831. if (typeof options === "string") {
  832. mergeConfig2.url = this.mixinParam(options, params);
  833. mergeConfig2.type = "navigateTo";
  834. } else {
  835. mergeConfig2 = deepMerge$1(this.config, options);
  836. mergeConfig2.url = this.mixinParam(options.url, options.params);
  837. }
  838. if (mergeConfig2.url === page())
  839. return;
  840. if (params.intercept) {
  841. this.config.intercept = params.intercept;
  842. }
  843. mergeConfig2.params = params;
  844. mergeConfig2 = deepMerge$1(this.config, mergeConfig2);
  845. if (typeof uni.$u.routeIntercept === "function") {
  846. const isNext = await new Promise((resolve, reject) => {
  847. uni.$u.routeIntercept(mergeConfig2, resolve);
  848. });
  849. isNext && this.openPage(mergeConfig2);
  850. } else {
  851. this.openPage(mergeConfig2);
  852. }
  853. }
  854. // 执行路由跳转
  855. openPage(config2) {
  856. const {
  857. url: url2,
  858. type,
  859. delta,
  860. animationType,
  861. animationDuration
  862. } = config2;
  863. if (config2.type == "navigateTo" || config2.type == "to") {
  864. uni.navigateTo({
  865. url: url2,
  866. animationType,
  867. animationDuration
  868. });
  869. }
  870. if (config2.type == "redirectTo" || config2.type == "redirect") {
  871. uni.redirectTo({
  872. url: url2
  873. });
  874. }
  875. if (config2.type == "switchTab" || config2.type == "tab") {
  876. uni.switchTab({
  877. url: url2
  878. });
  879. }
  880. if (config2.type == "reLaunch" || config2.type == "launch") {
  881. uni.reLaunch({
  882. url: url2
  883. });
  884. }
  885. if (config2.type == "navigateBack" || config2.type == "back") {
  886. uni.navigateBack({
  887. delta
  888. });
  889. }
  890. }
  891. }
  892. const route = new Router().route;
  893. const mixin = defineMixin({
  894. // 定义每个组件都可能需要用到的外部样式以及类名
  895. props: {
  896. // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
  897. customStyle: {
  898. type: [Object, String],
  899. default: () => ({})
  900. },
  901. customClass: {
  902. type: String,
  903. default: ""
  904. },
  905. // 跳转的页面路径
  906. url: {
  907. type: String,
  908. default: ""
  909. },
  910. // 页面跳转的类型
  911. linkType: {
  912. type: String,
  913. default: "navigateTo"
  914. }
  915. },
  916. data() {
  917. return {};
  918. },
  919. onLoad() {
  920. this.$u.getRect = this.$uGetRect;
  921. },
  922. created() {
  923. this.$u.getRect = this.$uGetRect;
  924. },
  925. computed: {
  926. // 在2.x版本中,将会把$u挂载到uni对象下,导致在模板中无法使用uni.$u.xxx形式
  927. // 所以这里通过computed计算属性将其附加到this.$u上,就可以在模板或者js中使用uni.$u.xxx
  928. // 只在nvue环境通过此方式引入完整的$u,其他平台会出现性能问题,非nvue则按需引入(主要原因是props过大)
  929. $u() {
  930. return deepMerge$1(uni.$u, {
  931. props: void 0,
  932. http: void 0,
  933. mixin: void 0
  934. });
  935. },
  936. /**
  937. * 生成bem规则类名
  938. * 由于微信小程序H5nvue之间绑定class的差异无法通过:class="[bem()]"的形式进行同用
  939. * 故采用如下折中做法最后返回的是数组一般平台或字符串支付宝和字节跳动平台类似['a', 'b', 'c']'a b c'的形式
  940. * @param {String} name 组件名称
  941. * @param {Array} fixed 一直会存在的类名
  942. * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
  943. * @returns {Array|string}
  944. */
  945. bem() {
  946. return function(name, fixed, change) {
  947. const prefix = `u-${name}--`;
  948. const classes = {};
  949. if (fixed) {
  950. fixed.map((item) => {
  951. classes[prefix + this[item]] = true;
  952. });
  953. }
  954. if (change) {
  955. change.map((item) => {
  956. this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
  957. });
  958. }
  959. return Object.keys(classes);
  960. };
  961. }
  962. },
  963. methods: {
  964. // 跳转某一个页面
  965. openPage(urlKey = "url") {
  966. const url2 = this[urlKey];
  967. if (url2) {
  968. route({ type: this.linkType, url: url2 });
  969. }
  970. },
  971. // 查询节点信息
  972. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  973. // 解决办法为在组件根部再套一个没有任何作用的view元素
  974. $uGetRect(selector, all) {
  975. return new Promise((resolve) => {
  976. uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
  977. if (all && Array.isArray(rect) && rect.length) {
  978. resolve(rect);
  979. }
  980. if (!all && rect) {
  981. resolve(rect);
  982. }
  983. }).exec();
  984. });
  985. },
  986. getParentData(parentName = "") {
  987. if (!this.parent)
  988. this.parent = {};
  989. this.parent = $parent.call(this, parentName);
  990. if (this.parent.children) {
  991. this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
  992. }
  993. if (this.parent && this.parentData) {
  994. Object.keys(this.parentData).map((key) => {
  995. this.parentData[key] = this.parent[key];
  996. });
  997. }
  998. },
  999. // 阻止事件冒泡
  1000. preventEvent(e) {
  1001. e && typeof e.stopPropagation === "function" && e.stopPropagation();
  1002. },
  1003. // 空操作
  1004. noop(e) {
  1005. this.preventEvent(e);
  1006. }
  1007. },
  1008. onReachBottom() {
  1009. uni.$emit("uOnReachBottom");
  1010. },
  1011. beforeUnmount() {
  1012. if (this.parent && test.array(this.parent.children)) {
  1013. const childrenList = this.parent.children;
  1014. childrenList.map((child, index2) => {
  1015. if (child === this) {
  1016. childrenList.splice(index2, 1);
  1017. }
  1018. });
  1019. }
  1020. }
  1021. });
  1022. const mpMixin = defineMixin({});
  1023. const { toString } = Object.prototype;
  1024. function isArray(val) {
  1025. return toString.call(val) === "[object Array]";
  1026. }
  1027. function isObject(val) {
  1028. return val !== null && typeof val === "object";
  1029. }
  1030. function isDate(val) {
  1031. return toString.call(val) === "[object Date]";
  1032. }
  1033. function isURLSearchParams(val) {
  1034. return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
  1035. }
  1036. function forEach(obj2, fn) {
  1037. if (obj2 === null || typeof obj2 === "undefined") {
  1038. return;
  1039. }
  1040. if (typeof obj2 !== "object") {
  1041. obj2 = [obj2];
  1042. }
  1043. if (isArray(obj2)) {
  1044. for (let i = 0, l = obj2.length; i < l; i++) {
  1045. fn.call(null, obj2[i], i, obj2);
  1046. }
  1047. } else {
  1048. for (const key in obj2) {
  1049. if (Object.prototype.hasOwnProperty.call(obj2, key)) {
  1050. fn.call(null, obj2[key], key, obj2);
  1051. }
  1052. }
  1053. }
  1054. }
  1055. function isPlainObject(obj2) {
  1056. return Object.prototype.toString.call(obj2) === "[object Object]";
  1057. }
  1058. function deepMerge() {
  1059. const result = {};
  1060. function assignValue(val, key) {
  1061. if (typeof result[key] === "object" && typeof val === "object") {
  1062. result[key] = deepMerge(result[key], val);
  1063. } else if (typeof val === "object") {
  1064. result[key] = deepMerge({}, val);
  1065. } else {
  1066. result[key] = val;
  1067. }
  1068. }
  1069. for (let i = 0, l = arguments.length; i < l; i++) {
  1070. forEach(arguments[i], assignValue);
  1071. }
  1072. return result;
  1073. }
  1074. function isUndefined(val) {
  1075. return typeof val === "undefined";
  1076. }
  1077. function encode(val) {
  1078. return encodeURIComponent(val).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  1079. }
  1080. function buildURL(url2, params) {
  1081. if (!params) {
  1082. return url2;
  1083. }
  1084. let serializedParams;
  1085. if (isURLSearchParams(params)) {
  1086. serializedParams = params.toString();
  1087. } else {
  1088. const parts = [];
  1089. forEach(params, (val, key) => {
  1090. if (val === null || typeof val === "undefined") {
  1091. return;
  1092. }
  1093. if (isArray(val)) {
  1094. key = `${key}[]`;
  1095. } else {
  1096. val = [val];
  1097. }
  1098. forEach(val, (v) => {
  1099. if (isDate(v)) {
  1100. v = v.toISOString();
  1101. } else if (isObject(v)) {
  1102. v = JSON.stringify(v);
  1103. }
  1104. parts.push(`${encode(key)}=${encode(v)}`);
  1105. });
  1106. });
  1107. serializedParams = parts.join("&");
  1108. }
  1109. if (serializedParams) {
  1110. const hashmarkIndex = url2.indexOf("#");
  1111. if (hashmarkIndex !== -1) {
  1112. url2 = url2.slice(0, hashmarkIndex);
  1113. }
  1114. url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  1115. }
  1116. return url2;
  1117. }
  1118. function isAbsoluteURL(url2) {
  1119. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
  1120. }
  1121. function combineURLs(baseURL, relativeURL) {
  1122. return relativeURL ? `${baseURL.replace(/\/+$/, "")}/${relativeURL.replace(/^\/+/, "")}` : baseURL;
  1123. }
  1124. function buildFullPath(baseURL, requestedURL) {
  1125. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1126. return combineURLs(baseURL, requestedURL);
  1127. }
  1128. return requestedURL;
  1129. }
  1130. function settle(resolve, reject, response) {
  1131. const { validateStatus } = response.config;
  1132. const status = response.statusCode;
  1133. if (status && (!validateStatus || validateStatus(status))) {
  1134. resolve(response);
  1135. } else {
  1136. reject(response);
  1137. }
  1138. }
  1139. const mergeKeys$1 = (keys, config2) => {
  1140. const config3 = {};
  1141. keys.forEach((prop) => {
  1142. if (!isUndefined(config2[prop])) {
  1143. config3[prop] = config2[prop];
  1144. }
  1145. });
  1146. return config3;
  1147. };
  1148. const adapter = (config2) => new Promise((resolve, reject) => {
  1149. const fullPath = buildURL(buildFullPath(config2.baseURL, config2.url), config2.params);
  1150. const _config = {
  1151. url: fullPath,
  1152. header: config2.header,
  1153. complete: (response) => {
  1154. config2.fullPath = fullPath;
  1155. response.config = config2;
  1156. try {
  1157. if (typeof response.data === "string") {
  1158. response.data = JSON.parse(response.data);
  1159. }
  1160. } catch (e) {
  1161. }
  1162. settle(resolve, reject, response);
  1163. }
  1164. };
  1165. let requestTask;
  1166. if (config2.method === "UPLOAD") {
  1167. delete _config.header["content-type"];
  1168. delete _config.header["Content-Type"];
  1169. const otherConfig = {
  1170. filePath: config2.filePath,
  1171. name: config2.name
  1172. };
  1173. const optionalKeys = [
  1174. "files",
  1175. "timeout",
  1176. "formData"
  1177. ];
  1178. requestTask = uni.uploadFile({ ..._config, ...otherConfig, ...mergeKeys$1(optionalKeys, config2) });
  1179. } else if (config2.method === "DOWNLOAD") {
  1180. if (!isUndefined(config2.timeout)) {
  1181. _config.timeout = config2.timeout;
  1182. }
  1183. requestTask = uni.downloadFile(_config);
  1184. } else {
  1185. const optionalKeys = [
  1186. "data",
  1187. "method",
  1188. "timeout",
  1189. "dataType",
  1190. "responseType",
  1191. "sslVerify",
  1192. "firstIpv4"
  1193. ];
  1194. requestTask = uni.request({ ..._config, ...mergeKeys$1(optionalKeys, config2) });
  1195. }
  1196. if (config2.getTask) {
  1197. config2.getTask(requestTask, config2);
  1198. }
  1199. });
  1200. const dispatchRequest = (config2) => adapter(config2);
  1201. function InterceptorManager() {
  1202. this.handlers = [];
  1203. }
  1204. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  1205. this.handlers.push({
  1206. fulfilled,
  1207. rejected
  1208. });
  1209. return this.handlers.length - 1;
  1210. };
  1211. InterceptorManager.prototype.eject = function eject(id) {
  1212. if (this.handlers[id]) {
  1213. this.handlers[id] = null;
  1214. }
  1215. };
  1216. InterceptorManager.prototype.forEach = function forEach2(fn) {
  1217. this.handlers.forEach((h) => {
  1218. if (h !== null) {
  1219. fn(h);
  1220. }
  1221. });
  1222. };
  1223. const mergeKeys = (keys, globalsConfig, config2) => {
  1224. const config3 = {};
  1225. keys.forEach((prop) => {
  1226. if (!isUndefined(config2[prop])) {
  1227. config3[prop] = config2[prop];
  1228. } else if (!isUndefined(globalsConfig[prop])) {
  1229. config3[prop] = globalsConfig[prop];
  1230. }
  1231. });
  1232. return config3;
  1233. };
  1234. const mergeConfig = (globalsConfig, config2 = {}) => {
  1235. const method = config2.method || globalsConfig.method || "GET";
  1236. let config3 = {
  1237. baseURL: globalsConfig.baseURL || "",
  1238. method,
  1239. url: config2.url || "",
  1240. params: config2.params || {},
  1241. custom: { ...globalsConfig.custom || {}, ...config2.custom || {} },
  1242. header: deepMerge(globalsConfig.header || {}, config2.header || {})
  1243. };
  1244. const defaultToConfig2Keys = ["getTask", "validateStatus"];
  1245. config3 = { ...config3, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2) };
  1246. if (method === "DOWNLOAD") {
  1247. if (!isUndefined(config2.timeout)) {
  1248. config3.timeout = config2.timeout;
  1249. } else if (!isUndefined(globalsConfig.timeout)) {
  1250. config3.timeout = globalsConfig.timeout;
  1251. }
  1252. } else if (method === "UPLOAD") {
  1253. delete config3.header["content-type"];
  1254. delete config3.header["Content-Type"];
  1255. const uploadKeys = [
  1256. "files",
  1257. "filePath",
  1258. "name",
  1259. "timeout",
  1260. "formData"
  1261. ];
  1262. uploadKeys.forEach((prop) => {
  1263. if (!isUndefined(config2[prop])) {
  1264. config3[prop] = config2[prop];
  1265. }
  1266. });
  1267. if (isUndefined(config3.timeout) && !isUndefined(globalsConfig.timeout)) {
  1268. config3.timeout = globalsConfig.timeout;
  1269. }
  1270. } else {
  1271. const defaultsKeys = [
  1272. "data",
  1273. "timeout",
  1274. "dataType",
  1275. "responseType",
  1276. "sslVerify",
  1277. "firstIpv4"
  1278. ];
  1279. config3 = { ...config3, ...mergeKeys(defaultsKeys, globalsConfig, config2) };
  1280. }
  1281. return config3;
  1282. };
  1283. const defaults = {
  1284. baseURL: "",
  1285. header: {},
  1286. method: "GET",
  1287. dataType: "json",
  1288. responseType: "text",
  1289. custom: {},
  1290. timeout: 6e4,
  1291. sslVerify: true,
  1292. firstIpv4: false,
  1293. validateStatus: function validateStatus(status) {
  1294. return status >= 200 && status < 300;
  1295. }
  1296. };
  1297. var clone = function() {
  1298. function _instanceof(obj2, type) {
  1299. return type != null && obj2 instanceof type;
  1300. }
  1301. var nativeMap;
  1302. try {
  1303. nativeMap = Map;
  1304. } catch (_) {
  1305. nativeMap = function() {
  1306. };
  1307. }
  1308. var nativeSet;
  1309. try {
  1310. nativeSet = Set;
  1311. } catch (_) {
  1312. nativeSet = function() {
  1313. };
  1314. }
  1315. var nativePromise;
  1316. try {
  1317. nativePromise = Promise;
  1318. } catch (_) {
  1319. nativePromise = function() {
  1320. };
  1321. }
  1322. function clone2(parent, circular, depth, prototype, includeNonEnumerable) {
  1323. if (typeof circular === "object") {
  1324. depth = circular.depth;
  1325. prototype = circular.prototype;
  1326. includeNonEnumerable = circular.includeNonEnumerable;
  1327. circular = circular.circular;
  1328. }
  1329. var allParents = [];
  1330. var allChildren = [];
  1331. var useBuffer = typeof Buffer != "undefined";
  1332. if (typeof circular == "undefined")
  1333. circular = true;
  1334. if (typeof depth == "undefined")
  1335. depth = Infinity;
  1336. function _clone(parent2, depth2) {
  1337. if (parent2 === null)
  1338. return null;
  1339. if (depth2 === 0)
  1340. return parent2;
  1341. var child;
  1342. var proto;
  1343. if (typeof parent2 != "object") {
  1344. return parent2;
  1345. }
  1346. if (_instanceof(parent2, nativeMap)) {
  1347. child = new nativeMap();
  1348. } else if (_instanceof(parent2, nativeSet)) {
  1349. child = new nativeSet();
  1350. } else if (_instanceof(parent2, nativePromise)) {
  1351. child = new nativePromise(function(resolve, reject) {
  1352. parent2.then(function(value) {
  1353. resolve(_clone(value, depth2 - 1));
  1354. }, function(err) {
  1355. reject(_clone(err, depth2 - 1));
  1356. });
  1357. });
  1358. } else if (clone2.__isArray(parent2)) {
  1359. child = [];
  1360. } else if (clone2.__isRegExp(parent2)) {
  1361. child = new RegExp(parent2.source, __getRegExpFlags(parent2));
  1362. if (parent2.lastIndex)
  1363. child.lastIndex = parent2.lastIndex;
  1364. } else if (clone2.__isDate(parent2)) {
  1365. child = new Date(parent2.getTime());
  1366. } else if (useBuffer && Buffer.isBuffer(parent2)) {
  1367. if (Buffer.from) {
  1368. child = Buffer.from(parent2);
  1369. } else {
  1370. child = new Buffer(parent2.length);
  1371. parent2.copy(child);
  1372. }
  1373. return child;
  1374. } else if (_instanceof(parent2, Error)) {
  1375. child = Object.create(parent2);
  1376. } else {
  1377. if (typeof prototype == "undefined") {
  1378. proto = Object.getPrototypeOf(parent2);
  1379. child = Object.create(proto);
  1380. } else {
  1381. child = Object.create(prototype);
  1382. proto = prototype;
  1383. }
  1384. }
  1385. if (circular) {
  1386. var index2 = allParents.indexOf(parent2);
  1387. if (index2 != -1) {
  1388. return allChildren[index2];
  1389. }
  1390. allParents.push(parent2);
  1391. allChildren.push(child);
  1392. }
  1393. if (_instanceof(parent2, nativeMap)) {
  1394. parent2.forEach(function(value, key) {
  1395. var keyChild = _clone(key, depth2 - 1);
  1396. var valueChild = _clone(value, depth2 - 1);
  1397. child.set(keyChild, valueChild);
  1398. });
  1399. }
  1400. if (_instanceof(parent2, nativeSet)) {
  1401. parent2.forEach(function(value) {
  1402. var entryChild = _clone(value, depth2 - 1);
  1403. child.add(entryChild);
  1404. });
  1405. }
  1406. for (var i in parent2) {
  1407. var attrs = Object.getOwnPropertyDescriptor(parent2, i);
  1408. if (attrs) {
  1409. child[i] = _clone(parent2[i], depth2 - 1);
  1410. }
  1411. try {
  1412. var objProperty = Object.getOwnPropertyDescriptor(parent2, i);
  1413. if (objProperty.set === "undefined") {
  1414. continue;
  1415. }
  1416. child[i] = _clone(parent2[i], depth2 - 1);
  1417. } catch (e) {
  1418. if (e instanceof TypeError) {
  1419. continue;
  1420. } else if (e instanceof ReferenceError) {
  1421. continue;
  1422. }
  1423. }
  1424. }
  1425. if (Object.getOwnPropertySymbols) {
  1426. var symbols = Object.getOwnPropertySymbols(parent2);
  1427. for (var i = 0; i < symbols.length; i++) {
  1428. var symbol = symbols[i];
  1429. var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
  1430. if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
  1431. continue;
  1432. }
  1433. child[symbol] = _clone(parent2[symbol], depth2 - 1);
  1434. Object.defineProperty(child, symbol, descriptor);
  1435. }
  1436. }
  1437. if (includeNonEnumerable) {
  1438. var allPropertyNames = Object.getOwnPropertyNames(parent2);
  1439. for (var i = 0; i < allPropertyNames.length; i++) {
  1440. var propertyName = allPropertyNames[i];
  1441. var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
  1442. if (descriptor && descriptor.enumerable) {
  1443. continue;
  1444. }
  1445. child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
  1446. Object.defineProperty(child, propertyName, descriptor);
  1447. }
  1448. }
  1449. return child;
  1450. }
  1451. return _clone(parent, depth);
  1452. }
  1453. clone2.clonePrototype = function clonePrototype(parent) {
  1454. if (parent === null)
  1455. return null;
  1456. var c = function() {
  1457. };
  1458. c.prototype = parent;
  1459. return new c();
  1460. };
  1461. function __objToStr(o) {
  1462. return Object.prototype.toString.call(o);
  1463. }
  1464. clone2.__objToStr = __objToStr;
  1465. function __isDate(o) {
  1466. return typeof o === "object" && __objToStr(o) === "[object Date]";
  1467. }
  1468. clone2.__isDate = __isDate;
  1469. function __isArray(o) {
  1470. return typeof o === "object" && __objToStr(o) === "[object Array]";
  1471. }
  1472. clone2.__isArray = __isArray;
  1473. function __isRegExp(o) {
  1474. return typeof o === "object" && __objToStr(o) === "[object RegExp]";
  1475. }
  1476. clone2.__isRegExp = __isRegExp;
  1477. function __getRegExpFlags(re) {
  1478. var flags = "";
  1479. if (re.global)
  1480. flags += "g";
  1481. if (re.ignoreCase)
  1482. flags += "i";
  1483. if (re.multiline)
  1484. flags += "m";
  1485. return flags;
  1486. }
  1487. clone2.__getRegExpFlags = __getRegExpFlags;
  1488. return clone2;
  1489. }();
  1490. class Request {
  1491. /**
  1492. * @param {Object} arg - 全局配置
  1493. * @param {String} arg.baseURL - 全局根路径
  1494. * @param {Object} arg.header - 全局header
  1495. * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
  1496. * @param {String} arg.dataType = [json] - 全局默认的dataType
  1497. * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType支付宝小程序不支持
  1498. * @param {Object} arg.custom - 全局默认的自定义参数
  1499. * @param {Number} arg.timeout - 全局默认的超时时间单位 ms默认60000H5(HBuilderX 2.9.9+)APP(HBuilderX 2.9.9+)微信小程序2.10.0支付宝小程序
  1500. * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书默认true.仅App安卓端支持HBuilderX 2.3.3+
  1501. * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证cookies默认false仅H5支持HBuilderX 2.6.15+
  1502. * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4默认false App-Android 支持 (HBuilderX 2.8.0+)
  1503. * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器默认statusCode >= 200 && statusCode < 300
  1504. */
  1505. constructor(arg = {}) {
  1506. if (!isPlainObject(arg)) {
  1507. arg = {};
  1508. formatAppLog("warn", "at uni_modules/uview-plus/libs/luch-request/core/Request.js:39", "设置全局参数必须接收一个Object");
  1509. }
  1510. this.config = clone({ ...defaults, ...arg });
  1511. this.interceptors = {
  1512. request: new InterceptorManager(),
  1513. response: new InterceptorManager()
  1514. };
  1515. }
  1516. /**
  1517. * @Function
  1518. * @param {Request~setConfigCallback} f - 设置全局默认配置
  1519. */
  1520. setConfig(f) {
  1521. this.config = f(this.config);
  1522. }
  1523. middleware(config2) {
  1524. config2 = mergeConfig(this.config, config2);
  1525. const chain = [dispatchRequest, void 0];
  1526. let promise2 = Promise.resolve(config2);
  1527. this.interceptors.request.forEach((interceptor) => {
  1528. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  1529. });
  1530. this.interceptors.response.forEach((interceptor) => {
  1531. chain.push(interceptor.fulfilled, interceptor.rejected);
  1532. });
  1533. while (chain.length) {
  1534. promise2 = promise2.then(chain.shift(), chain.shift());
  1535. }
  1536. return promise2;
  1537. }
  1538. /**
  1539. * @Function
  1540. * @param {Object} config - 请求配置项
  1541. * @prop {String} options.url - 请求路径
  1542. * @prop {Object} options.data - 请求参数
  1543. * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
  1544. * @prop {Object} [options.dataType = config.dataType] - 如果设为 json会尝试对返回的数据做一次 JSON.parse
  1545. * @prop {Object} [options.header = config.header] - 请求header
  1546. * @prop {Object} [options.method = config.method] - 请求方法
  1547. * @returns {Promise<unknown>}
  1548. */
  1549. request(config2 = {}) {
  1550. return this.middleware(config2);
  1551. }
  1552. get(url2, options = {}) {
  1553. return this.middleware({
  1554. url: url2,
  1555. method: "GET",
  1556. ...options
  1557. });
  1558. }
  1559. post(url2, data, options = {}) {
  1560. return this.middleware({
  1561. url: url2,
  1562. data,
  1563. method: "POST",
  1564. ...options
  1565. });
  1566. }
  1567. put(url2, data, options = {}) {
  1568. return this.middleware({
  1569. url: url2,
  1570. data,
  1571. method: "PUT",
  1572. ...options
  1573. });
  1574. }
  1575. delete(url2, data, options = {}) {
  1576. return this.middleware({
  1577. url: url2,
  1578. data,
  1579. method: "DELETE",
  1580. ...options
  1581. });
  1582. }
  1583. options(url2, data, options = {}) {
  1584. return this.middleware({
  1585. url: url2,
  1586. data,
  1587. method: "OPTIONS",
  1588. ...options
  1589. });
  1590. }
  1591. upload(url2, config2 = {}) {
  1592. config2.url = url2;
  1593. config2.method = "UPLOAD";
  1594. return this.middleware(config2);
  1595. }
  1596. download(url2, config2 = {}) {
  1597. config2.url = url2;
  1598. config2.method = "DOWNLOAD";
  1599. return this.middleware(config2);
  1600. }
  1601. }
  1602. function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) {
  1603. const startRGB = hexToRgb(startColor, false);
  1604. const startR = startRGB[0];
  1605. const startG = startRGB[1];
  1606. const startB = startRGB[2];
  1607. const endRGB = hexToRgb(endColor, false);
  1608. const endR = endRGB[0];
  1609. const endG = endRGB[1];
  1610. const endB = endRGB[2];
  1611. const sR = (endR - startR) / step;
  1612. const sG = (endG - startG) / step;
  1613. const sB = (endB - startB) / step;
  1614. const colorArr = [];
  1615. for (let i = 0; i < step; i++) {
  1616. let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`);
  1617. if (i === 0)
  1618. hex = rgbToHex(startColor);
  1619. if (i === step - 1)
  1620. hex = rgbToHex(endColor);
  1621. colorArr.push(hex);
  1622. }
  1623. return colorArr;
  1624. }
  1625. function hexToRgb(sColor, str = true) {
  1626. const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  1627. sColor = String(sColor).toLowerCase();
  1628. if (sColor && reg.test(sColor)) {
  1629. if (sColor.length === 4) {
  1630. let sColorNew = "#";
  1631. for (let i = 1; i < 4; i += 1) {
  1632. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  1633. }
  1634. sColor = sColorNew;
  1635. }
  1636. const sColorChange = [];
  1637. for (let i = 1; i < 7; i += 2) {
  1638. sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`));
  1639. }
  1640. if (!str) {
  1641. return sColorChange;
  1642. }
  1643. return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
  1644. }
  1645. if (/^(rgb|RGB)/.test(sColor)) {
  1646. const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  1647. return arr.map((val) => Number(val));
  1648. }
  1649. return sColor;
  1650. }
  1651. function rgbToHex(rgb) {
  1652. const _this = rgb;
  1653. const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  1654. if (/^(rgb|RGB)/.test(_this)) {
  1655. const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  1656. let strHex = "#";
  1657. for (let i = 0; i < aColor.length; i++) {
  1658. let hex = Number(aColor[i]).toString(16);
  1659. hex = String(hex).length == 1 ? `${0}${hex}` : hex;
  1660. if (hex === "0") {
  1661. hex += hex;
  1662. }
  1663. strHex += hex;
  1664. }
  1665. if (strHex.length !== 7) {
  1666. strHex = _this;
  1667. }
  1668. return strHex;
  1669. }
  1670. if (reg.test(_this)) {
  1671. const aNum = _this.replace(/#/, "").split("");
  1672. if (aNum.length === 6) {
  1673. return _this;
  1674. }
  1675. if (aNum.length === 3) {
  1676. let numHex = "#";
  1677. for (let i = 0; i < aNum.length; i += 1) {
  1678. numHex += aNum[i] + aNum[i];
  1679. }
  1680. return numHex;
  1681. }
  1682. } else {
  1683. return _this;
  1684. }
  1685. }
  1686. function colorToRgba(color2, alpha) {
  1687. color2 = rgbToHex(color2);
  1688. const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  1689. let sColor = String(color2).toLowerCase();
  1690. if (sColor && reg.test(sColor)) {
  1691. if (sColor.length === 4) {
  1692. let sColorNew = "#";
  1693. for (let i = 1; i < 4; i += 1) {
  1694. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  1695. }
  1696. sColor = sColorNew;
  1697. }
  1698. const sColorChange = [];
  1699. for (let i = 1; i < 7; i += 2) {
  1700. sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`));
  1701. }
  1702. return `rgba(${sColorChange.join(",")},${alpha})`;
  1703. }
  1704. return sColor;
  1705. }
  1706. const colorGradient$1 = {
  1707. colorGradient,
  1708. hexToRgb,
  1709. rgbToHex,
  1710. colorToRgba
  1711. };
  1712. let timeout = null;
  1713. function debounce(func2, wait = 500, immediate = false) {
  1714. if (timeout !== null)
  1715. clearTimeout(timeout);
  1716. if (immediate) {
  1717. const callNow = !timeout;
  1718. timeout = setTimeout(() => {
  1719. timeout = null;
  1720. }, wait);
  1721. if (callNow)
  1722. typeof func2 === "function" && func2();
  1723. } else {
  1724. timeout = setTimeout(() => {
  1725. typeof func2 === "function" && func2();
  1726. }, wait);
  1727. }
  1728. }
  1729. let flag;
  1730. function throttle(func2, wait = 500, immediate = true) {
  1731. if (immediate) {
  1732. if (!flag) {
  1733. flag = true;
  1734. typeof func2 === "function" && func2();
  1735. setTimeout(() => {
  1736. flag = false;
  1737. }, wait);
  1738. }
  1739. } else if (!flag) {
  1740. flag = true;
  1741. setTimeout(() => {
  1742. flag = false;
  1743. typeof func2 === "function" && func2();
  1744. }, wait);
  1745. }
  1746. }
  1747. const ActionSheet = {
  1748. // action-sheet组件
  1749. actionSheet: {
  1750. show: false,
  1751. title: "",
  1752. description: "",
  1753. actions: [],
  1754. index: "",
  1755. cancelText: "",
  1756. closeOnClickAction: true,
  1757. safeAreaInsetBottom: true,
  1758. openType: "",
  1759. closeOnClickOverlay: true,
  1760. round: 0
  1761. }
  1762. };
  1763. const Album = {
  1764. // album 组件
  1765. album: {
  1766. urls: [],
  1767. keyName: "",
  1768. singleSize: 180,
  1769. multipleSize: 70,
  1770. space: 6,
  1771. singleMode: "scaleToFill",
  1772. multipleMode: "aspectFill",
  1773. maxCount: 9,
  1774. previewFullImage: true,
  1775. rowCount: 3,
  1776. showMore: true
  1777. }
  1778. };
  1779. const Alert = {
  1780. // alert警告组件
  1781. alert: {
  1782. title: "",
  1783. type: "warning",
  1784. description: "",
  1785. closable: false,
  1786. showIcon: false,
  1787. effect: "light",
  1788. center: false,
  1789. fontSize: 14
  1790. }
  1791. };
  1792. const Avatar = {
  1793. // avatar 组件
  1794. avatar: {
  1795. src: "",
  1796. shape: "circle",
  1797. size: 40,
  1798. mode: "scaleToFill",
  1799. text: "",
  1800. bgColor: "#c0c4cc",
  1801. color: "#ffffff",
  1802. fontSize: 18,
  1803. icon: "",
  1804. mpAvatar: false,
  1805. randomBgColor: false,
  1806. defaultUrl: "",
  1807. colorIndex: "",
  1808. name: ""
  1809. }
  1810. };
  1811. const AvatarGroup = {
  1812. // avatarGroup 组件
  1813. avatarGroup: {
  1814. urls: [],
  1815. maxCount: 5,
  1816. shape: "circle",
  1817. mode: "scaleToFill",
  1818. showMore: true,
  1819. size: 40,
  1820. keyName: "",
  1821. gap: 0.5,
  1822. extraValue: 0
  1823. }
  1824. };
  1825. const Backtop = {
  1826. // backtop组件
  1827. backtop: {
  1828. mode: "circle",
  1829. icon: "arrow-upward",
  1830. text: "",
  1831. duration: 100,
  1832. scrollTop: 0,
  1833. top: 400,
  1834. bottom: 100,
  1835. right: 20,
  1836. zIndex: 9,
  1837. iconStyle: {
  1838. color: "#909399",
  1839. fontSize: "19px"
  1840. }
  1841. }
  1842. };
  1843. const Badge = {
  1844. // 徽标数组件
  1845. badge: {
  1846. isDot: false,
  1847. value: "",
  1848. show: true,
  1849. max: 999,
  1850. type: "error",
  1851. showZero: false,
  1852. bgColor: null,
  1853. color: null,
  1854. shape: "circle",
  1855. numberType: "overflow",
  1856. offset: [],
  1857. inverted: false,
  1858. absolute: false
  1859. }
  1860. };
  1861. const Button = {
  1862. // button组件
  1863. button: {
  1864. hairline: false,
  1865. type: "info",
  1866. size: "normal",
  1867. shape: "square",
  1868. plain: false,
  1869. disabled: false,
  1870. loading: false,
  1871. loadingText: "",
  1872. loadingMode: "spinner",
  1873. loadingSize: 15,
  1874. openType: "",
  1875. formType: "",
  1876. appParameter: "",
  1877. hoverStopPropagation: true,
  1878. lang: "en",
  1879. sessionFrom: "",
  1880. sendMessageTitle: "",
  1881. sendMessagePath: "",
  1882. sendMessageImg: "",
  1883. showMessageCard: false,
  1884. dataName: "",
  1885. throttleTime: 0,
  1886. hoverStartTime: 0,
  1887. hoverStayTime: 200,
  1888. text: "",
  1889. icon: "",
  1890. iconColor: "",
  1891. color: ""
  1892. }
  1893. };
  1894. const Calendar = {
  1895. // calendar 组件
  1896. calendar: {
  1897. title: "日期选择",
  1898. showTitle: true,
  1899. showSubtitle: true,
  1900. mode: "single",
  1901. startText: "开始",
  1902. endText: "结束",
  1903. customList: [],
  1904. color: "#3c9cff",
  1905. minDate: 0,
  1906. maxDate: 0,
  1907. defaultDate: null,
  1908. maxCount: Number.MAX_SAFE_INTEGER,
  1909. // Infinity
  1910. rowHeight: 56,
  1911. formatter: null,
  1912. showLunar: false,
  1913. showMark: true,
  1914. confirmText: "确定",
  1915. confirmDisabledText: "确定",
  1916. show: false,
  1917. closeOnClickOverlay: false,
  1918. readonly: false,
  1919. showConfirm: true,
  1920. maxRange: Number.MAX_SAFE_INTEGER,
  1921. // Infinity
  1922. rangePrompt: "",
  1923. showRangePrompt: true,
  1924. allowSameDay: false,
  1925. round: 0,
  1926. monthNum: 3
  1927. }
  1928. };
  1929. const CarKeyboard = {
  1930. // 车牌号键盘
  1931. carKeyboard: {
  1932. random: false
  1933. }
  1934. };
  1935. const Cell = {
  1936. // cell组件的props
  1937. cell: {
  1938. customClass: "",
  1939. title: "",
  1940. label: "",
  1941. value: "",
  1942. icon: "",
  1943. disabled: false,
  1944. border: true,
  1945. center: false,
  1946. url: "",
  1947. linkType: "navigateTo",
  1948. clickable: false,
  1949. isLink: false,
  1950. required: false,
  1951. arrowDirection: "",
  1952. iconStyle: {},
  1953. rightIconStyle: {},
  1954. rightIcon: "arrow-right",
  1955. titleStyle: {},
  1956. size: "",
  1957. stop: true,
  1958. name: ""
  1959. }
  1960. };
  1961. const CellGroup = {
  1962. // cell-group组件的props
  1963. cellGroup: {
  1964. title: "",
  1965. border: true,
  1966. customStyle: {}
  1967. }
  1968. };
  1969. const Checkbox = {
  1970. // checkbox组件
  1971. checkbox: {
  1972. name: "",
  1973. shape: "",
  1974. size: "",
  1975. checkbox: false,
  1976. disabled: "",
  1977. activeColor: "",
  1978. inactiveColor: "",
  1979. iconSize: "",
  1980. iconColor: "",
  1981. label: "",
  1982. labelSize: "",
  1983. labelColor: "",
  1984. labelDisabled: ""
  1985. }
  1986. };
  1987. const CheckboxGroup = {
  1988. // checkbox-group组件
  1989. checkboxGroup: {
  1990. name: "",
  1991. value: [],
  1992. shape: "square",
  1993. disabled: false,
  1994. activeColor: "#2979ff",
  1995. inactiveColor: "#c8c9cc",
  1996. size: 18,
  1997. placement: "row",
  1998. labelSize: 14,
  1999. labelColor: "#303133",
  2000. labelDisabled: false,
  2001. iconColor: "#ffffff",
  2002. iconSize: 12,
  2003. iconPlacement: "left",
  2004. borderBottom: false
  2005. }
  2006. };
  2007. const CircleProgress = {
  2008. // circleProgress 组件
  2009. circleProgress: {
  2010. percentage: 30
  2011. }
  2012. };
  2013. const Code = {
  2014. // code 组件
  2015. code: {
  2016. seconds: 60,
  2017. startText: "获取验证码",
  2018. changeText: "X秒重新获取",
  2019. endText: "重新获取",
  2020. keepRunning: false,
  2021. uniqueKey: ""
  2022. }
  2023. };
  2024. const CodeInput = {
  2025. // codeInput 组件
  2026. codeInput: {
  2027. adjustPosition: true,
  2028. maxlength: 6,
  2029. dot: false,
  2030. mode: "box",
  2031. hairline: false,
  2032. space: 10,
  2033. value: "",
  2034. focus: false,
  2035. bold: false,
  2036. color: "#606266",
  2037. fontSize: 18,
  2038. size: 35,
  2039. disabledKeyboard: false,
  2040. borderColor: "#c9cacc",
  2041. disabledDot: true
  2042. }
  2043. };
  2044. const Col = {
  2045. // col 组件
  2046. col: {
  2047. span: 12,
  2048. offset: 0,
  2049. justify: "start",
  2050. align: "stretch",
  2051. textAlign: "left"
  2052. }
  2053. };
  2054. const Collapse = {
  2055. // collapse 组件
  2056. collapse: {
  2057. value: null,
  2058. accordion: false,
  2059. border: true
  2060. }
  2061. };
  2062. const CollapseItem = {
  2063. // collapseItem 组件
  2064. collapseItem: {
  2065. title: "",
  2066. value: "",
  2067. label: "",
  2068. disabled: false,
  2069. isLink: true,
  2070. clickable: true,
  2071. border: true,
  2072. align: "left",
  2073. name: "",
  2074. icon: "",
  2075. duration: 300
  2076. }
  2077. };
  2078. const ColumnNotice = {
  2079. // columnNotice 组件
  2080. columnNotice: {
  2081. text: "",
  2082. icon: "volume",
  2083. mode: "",
  2084. color: "#f9ae3d",
  2085. bgColor: "#fdf6ec",
  2086. fontSize: 14,
  2087. speed: 80,
  2088. step: false,
  2089. duration: 1500,
  2090. disableTouch: true
  2091. }
  2092. };
  2093. const CountDown = {
  2094. // u-count-down 计时器组件
  2095. countDown: {
  2096. time: 0,
  2097. format: "HH:mm:ss",
  2098. autoStart: true,
  2099. millisecond: false
  2100. }
  2101. };
  2102. const CountTo = {
  2103. // countTo 组件
  2104. countTo: {
  2105. startVal: 0,
  2106. endVal: 0,
  2107. duration: 2e3,
  2108. autoplay: true,
  2109. decimals: 0,
  2110. useEasing: true,
  2111. decimal: ".",
  2112. color: "#606266",
  2113. fontSize: 22,
  2114. bold: false,
  2115. separator: ""
  2116. }
  2117. };
  2118. const DatetimePicker = {
  2119. // datetimePicker 组件
  2120. datetimePicker: {
  2121. show: false,
  2122. popupMode: "bottom",
  2123. showToolbar: true,
  2124. value: "",
  2125. title: "",
  2126. mode: "datetime",
  2127. maxDate: new Date(new Date().getFullYear() + 10, 0, 1).getTime(),
  2128. minDate: new Date(new Date().getFullYear() - 10, 0, 1).getTime(),
  2129. minHour: 0,
  2130. maxHour: 23,
  2131. minMinute: 0,
  2132. maxMinute: 59,
  2133. filter: null,
  2134. formatter: null,
  2135. loading: false,
  2136. itemHeight: 44,
  2137. cancelText: "取消",
  2138. confirmText: "确认",
  2139. cancelColor: "#909193",
  2140. confirmColor: "#3c9cff",
  2141. visibleItemCount: 5,
  2142. closeOnClickOverlay: false,
  2143. defaultIndex: []
  2144. }
  2145. };
  2146. const Divider = {
  2147. // divider组件
  2148. divider: {
  2149. dashed: false,
  2150. hairline: true,
  2151. dot: false,
  2152. textPosition: "center",
  2153. text: "",
  2154. textSize: 14,
  2155. textColor: "#909399",
  2156. lineColor: "#dcdfe6"
  2157. }
  2158. };
  2159. const Empty = {
  2160. // empty组件
  2161. empty: {
  2162. icon: "",
  2163. text: "",
  2164. textColor: "#c0c4cc",
  2165. textSize: 14,
  2166. iconColor: "#c0c4cc",
  2167. iconSize: 90,
  2168. mode: "data",
  2169. width: 160,
  2170. height: 160,
  2171. show: true,
  2172. marginTop: 0
  2173. }
  2174. };
  2175. const Form = {
  2176. // form 组件
  2177. form: {
  2178. model: {},
  2179. rules: {},
  2180. errorType: "message",
  2181. borderBottom: true,
  2182. labelPosition: "left",
  2183. labelWidth: 45,
  2184. labelAlign: "left",
  2185. labelStyle: {}
  2186. }
  2187. };
  2188. const GormItem = {
  2189. // formItem 组件
  2190. formItem: {
  2191. label: "",
  2192. prop: "",
  2193. rule: "",
  2194. borderBottom: "",
  2195. labelPosition: "",
  2196. labelWidth: "",
  2197. rightIcon: "",
  2198. leftIcon: "",
  2199. required: false,
  2200. leftIconStyle: ""
  2201. }
  2202. };
  2203. const Gap = {
  2204. // gap组件
  2205. gap: {
  2206. bgColor: "transparent",
  2207. height: 20,
  2208. marginTop: 0,
  2209. marginBottom: 0,
  2210. customStyle: {}
  2211. }
  2212. };
  2213. const Grid = {
  2214. // grid组件
  2215. grid: {
  2216. col: 3,
  2217. border: false,
  2218. align: "left"
  2219. }
  2220. };
  2221. const GridItem = {
  2222. // grid-item组件
  2223. gridItem: {
  2224. name: null,
  2225. bgColor: "transparent"
  2226. }
  2227. };
  2228. const {
  2229. color: color$3
  2230. } = config;
  2231. const Icon = {
  2232. // icon组件
  2233. icon: {
  2234. name: "",
  2235. color: color$3["u-content-color"],
  2236. size: "16px",
  2237. bold: false,
  2238. index: "",
  2239. hoverClass: "",
  2240. customPrefix: "uicon",
  2241. label: "",
  2242. labelPos: "right",
  2243. labelSize: "15px",
  2244. labelColor: color$3["u-content-color"],
  2245. space: "3px",
  2246. imgMode: "",
  2247. width: "",
  2248. height: "",
  2249. top: 0,
  2250. stop: false
  2251. }
  2252. };
  2253. const Image = {
  2254. // image组件
  2255. image: {
  2256. src: "",
  2257. mode: "aspectFill",
  2258. width: "300",
  2259. height: "225",
  2260. shape: "square",
  2261. radius: 0,
  2262. lazyLoad: true,
  2263. showMenuByLongpress: true,
  2264. loadingIcon: "photo",
  2265. errorIcon: "error-circle",
  2266. showLoading: true,
  2267. showError: true,
  2268. fade: true,
  2269. webp: false,
  2270. duration: 500,
  2271. bgColor: "#f3f4f6"
  2272. }
  2273. };
  2274. const IndexAnchor = {
  2275. // indexAnchor 组件
  2276. indexAnchor: {
  2277. text: "",
  2278. color: "#606266",
  2279. size: 14,
  2280. bgColor: "#dedede",
  2281. height: 32
  2282. }
  2283. };
  2284. const IndexList = {
  2285. // indexList 组件
  2286. indexList: {
  2287. inactiveColor: "#606266",
  2288. activeColor: "#5677fc",
  2289. indexList: [],
  2290. sticky: true,
  2291. customNavHeight: 0
  2292. }
  2293. };
  2294. const Input = {
  2295. // index 组件
  2296. input: {
  2297. value: "",
  2298. type: "text",
  2299. fixed: false,
  2300. disabled: false,
  2301. disabledColor: "#f5f7fa",
  2302. clearable: false,
  2303. password: false,
  2304. maxlength: -1,
  2305. placeholder: null,
  2306. placeholderClass: "input-placeholder",
  2307. placeholderStyle: "color: #c0c4cc",
  2308. showWordLimit: false,
  2309. confirmType: "done",
  2310. confirmHold: false,
  2311. holdKeyboard: false,
  2312. focus: false,
  2313. autoBlur: false,
  2314. disableDefaultPadding: false,
  2315. cursor: -1,
  2316. cursorSpacing: 30,
  2317. selectionStart: -1,
  2318. selectionEnd: -1,
  2319. adjustPosition: true,
  2320. inputAlign: "left",
  2321. fontSize: "15px",
  2322. color: "#303133",
  2323. prefixIcon: "",
  2324. prefixIconStyle: "",
  2325. suffixIcon: "",
  2326. suffixIconStyle: "",
  2327. border: "surround",
  2328. readonly: false,
  2329. shape: "square",
  2330. formatter: null
  2331. }
  2332. };
  2333. const Keyboard = {
  2334. // 键盘组件
  2335. keyboard: {
  2336. mode: "number",
  2337. dotDisabled: false,
  2338. tooltip: true,
  2339. showTips: true,
  2340. tips: "",
  2341. showCancel: true,
  2342. showConfirm: true,
  2343. random: false,
  2344. safeAreaInsetBottom: true,
  2345. closeOnClickOverlay: true,
  2346. show: false,
  2347. overlay: true,
  2348. zIndex: 10075,
  2349. cancelText: "取消",
  2350. confirmText: "确定",
  2351. autoChange: false
  2352. }
  2353. };
  2354. const Line = {
  2355. // line组件
  2356. line: {
  2357. color: "#d6d7d9",
  2358. length: "100%",
  2359. direction: "row",
  2360. hairline: true,
  2361. margin: 0,
  2362. dashed: false
  2363. }
  2364. };
  2365. const LineProgress = {
  2366. // lineProgress 组件
  2367. lineProgress: {
  2368. activeColor: "#19be6b",
  2369. inactiveColor: "#ececec",
  2370. percentage: 0,
  2371. showText: true,
  2372. height: 12
  2373. }
  2374. };
  2375. const {
  2376. color: color$2
  2377. } = config;
  2378. const Link = {
  2379. // link超链接组件props参数
  2380. link: {
  2381. color: color$2["u-primary"],
  2382. fontSize: 15,
  2383. underLine: false,
  2384. href: "",
  2385. mpTips: "链接已复制,请在浏览器打开",
  2386. lineColor: "",
  2387. text: ""
  2388. }
  2389. };
  2390. const List = {
  2391. // list 组件
  2392. list: {
  2393. showScrollbar: false,
  2394. lowerThreshold: 50,
  2395. upperThreshold: 0,
  2396. scrollTop: 0,
  2397. offsetAccuracy: 10,
  2398. enableFlex: false,
  2399. pagingEnabled: false,
  2400. scrollable: true,
  2401. scrollIntoView: "",
  2402. scrollWithAnimation: false,
  2403. enableBackToTop: false,
  2404. height: 0,
  2405. width: 0,
  2406. preLoadScreen: 1
  2407. }
  2408. };
  2409. const ListItem = {
  2410. // listItem 组件
  2411. listItem: {
  2412. anchor: ""
  2413. }
  2414. };
  2415. const {
  2416. color: color$1
  2417. } = config;
  2418. const LoadingIcon = {
  2419. // loading-icon加载中图标组件
  2420. loadingIcon: {
  2421. show: true,
  2422. color: color$1["u-tips-color"],
  2423. textColor: color$1["u-tips-color"],
  2424. vertical: false,
  2425. mode: "spinner",
  2426. size: 24,
  2427. textSize: 15,
  2428. text: "",
  2429. timingFunction: "ease-in-out",
  2430. duration: 1200,
  2431. inactiveColor: ""
  2432. }
  2433. };
  2434. const LoadingPage = {
  2435. // loading-page组件
  2436. loadingPage: {
  2437. loadingText: "正在加载",
  2438. image: "",
  2439. loadingMode: "circle",
  2440. loading: false,
  2441. bgColor: "#ffffff",
  2442. color: "#C8C8C8",
  2443. fontSize: 19,
  2444. iconSize: 28,
  2445. loadingColor: "#C8C8C8"
  2446. }
  2447. };
  2448. const Loadmore = {
  2449. // loadmore 组件
  2450. loadmore: {
  2451. status: "loadmore",
  2452. bgColor: "transparent",
  2453. icon: true,
  2454. fontSize: 14,
  2455. iconSize: 17,
  2456. color: "#606266",
  2457. loadingIcon: "spinner",
  2458. loadmoreText: "加载更多",
  2459. loadingText: "正在加载...",
  2460. nomoreText: "没有更多了",
  2461. isDot: false,
  2462. iconColor: "#b7b7b7",
  2463. marginTop: 10,
  2464. marginBottom: 10,
  2465. height: "auto",
  2466. line: false,
  2467. lineColor: "#E6E8EB",
  2468. dashed: false
  2469. }
  2470. };
  2471. const Modal = {
  2472. // modal 组件
  2473. modal: {
  2474. show: false,
  2475. title: "",
  2476. content: "",
  2477. confirmText: "确认",
  2478. cancelText: "取消",
  2479. showConfirmButton: true,
  2480. showCancelButton: false,
  2481. confirmColor: "#2979ff",
  2482. cancelColor: "#606266",
  2483. buttonReverse: false,
  2484. zoom: true,
  2485. asyncClose: false,
  2486. closeOnClickOverlay: false,
  2487. negativeTop: 0,
  2488. width: "650rpx",
  2489. confirmButtonShape: ""
  2490. }
  2491. };
  2492. const color = {
  2493. primary: "#3c9cff",
  2494. info: "#909399",
  2495. default: "#909399",
  2496. warning: "#f9ae3d",
  2497. error: "#f56c6c",
  2498. success: "#5ac725",
  2499. mainColor: "#303133",
  2500. contentColor: "#606266",
  2501. tipsColor: "#909399",
  2502. lightColor: "#c0c4cc",
  2503. borderColor: "#e4e7ed"
  2504. };
  2505. const Navbar = {
  2506. // navbar 组件
  2507. navbar: {
  2508. safeAreaInsetTop: true,
  2509. placeholder: false,
  2510. fixed: true,
  2511. border: false,
  2512. leftIcon: "arrow-left",
  2513. leftText: "",
  2514. rightText: "",
  2515. rightIcon: "",
  2516. title: "",
  2517. bgColor: "#ffffff",
  2518. titleWidth: "400rpx",
  2519. height: "44px",
  2520. leftIconSize: 20,
  2521. leftIconColor: color.mainColor,
  2522. autoBack: false,
  2523. titleStyle: ""
  2524. }
  2525. };
  2526. const NoNetwork = {
  2527. // noNetwork
  2528. noNetwork: {
  2529. tips: "哎呀,网络信号丢失",
  2530. zIndex: "",
  2531. image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABLKADAAQAAAABAAABLAAAAADYYILnAABAAElEQVR4Ae29CZhkV3kefNeq6m2W7tn3nl0aCbHIAgmQPGB+sLCNzSID9g9PYrAf57d/+4+DiW0cy8QBJ06c2In/PLFDHJ78+MGCGNsYgyxwIwktwEijAc1ohtmnZ+2Z7p5eq6vu9r/vuXWrq25VdVV1V3dXVX9Hmj73nv285963vvOd75yraeIEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaD8E9PbrkvRopSMwMBBYRs+5O/yJS68cPnzYXel4tFP/jXbqjPRFEAiCQNe6Bw/6gdFn9Oy9Q90LLG2DgBBW2wyldIQIPPPCte2a5q3jtR+4ff/4wuBuXotrDwSEsNpjHKUXQODppy+udYJMEUEZgbd94DvnNwlA7YGAEFZ7jOOK78Xp06eTTkq7sxwQhmXuf/754VXl4iSstRAQwmqt8ZLWlkHg0UcD49qYfUjXfLtMtOZ7npExJu4iqZWLl7DWQUAIq3XGSlpaAYHD77q8xwuCOSUoXw8Sl0eMux977DGzQjES3AIICGG1wCBJEysj8PXnz230XXdr5RQFMYbRvWnv6w8UhMhliyGwYghr4Pjg3oEXL34ey9zyC9tiD2ml5h47dr1LN7S6CMjz/A3PvHh1Z6UyJby5EVgRhKUe7Kz/JU0LfvrJo5f+Y3MPibSuFgQGBgasYSd9l6GDsup0WS/T/9RTp9fXmU2SNwECdQ92E7S57iaMeJnPQLK6ixkDLfjlb7546RfrLkQyNBcC3dsP6oHWMd9G+V3JgwPHh7rnm1/yLQ8CbU9Y33zp0j+nZFUMb/DHmB7+SHGY3LUKAk8cObtD00xlHDrfNge+Z2ozU3c9dvx4Yr5lSL6lR6CtCWvg6OAPw9z538ZhhZRl6XrwhW8du1KX/iNejtwvPQIDR8+vSRqJ/obU7GupjdNdh2gW0ZDypJBFR6BtB2rg2OVtuub9JcmpHIpBoK1xfffLzx4f7C0XL2HNiYDp6bs9z23Ypn1fC1Y/9PCFDc3ZW2lVHIG2JKzTp4Ok7nv/G6Q054MIvda+bNb74pEgKGtwGAdL7pcfAa8vOKEZ2kyjWuLr7uDh+/qvN6o8KWdxEWhLwroyeek/g4zuqwU6kNrhyZcu/UktaSXN8iNwuL9/RuvVXtJ9PbPQ1vhmcP6t9+47u9ByJP/SIdB2hDVw9MJHQFYfrQdCph84evFX68kjaZcPAZJWwjMXRFpJ2zr91tfuvrh8vZCa54NA2xGWrunvmg8QWCJ/N4ir7fCYDxatkOeBB7an501agXbygVdvv9IK/ZQ2FiPQdi9osGbH+zRNf7y4m9Xu9Me7N9nv0HXdr5ZS4psHgXpJC9P/wDRTx0Vn1TxjWG9LGrbaUm/Fi5meSvcrkxf/Cg/ow9XqAUk91v3qHT97r6471dJKfHMi8Oyzgx1Z03t1YAQVT2MwgsC3u+yXHzi0faQ5eyGtqgWBtpOw2Ol9+/TM+sTOn8L08MtzgQCy+tOHXr3jA0JWc6HU/HF5Scssr4jXcYqfP6V/T8iq+ceyWgvbUsKKOn38eJAYyl56TAuCEr2WYei//9Crd/5GlFb81kdASVopSFrerKRlaoZj9HR+700H10+0fg+lB21NWBxe2lhNHsUpDZr27mi4dV379R9+za4/iO7Fbx8ECknLCPTsTDJ17O33bJpqnx6u7J60PWFxeAcCbMV56dJfQKf1bkMLfuGh1+76zMoe9vbuPUnLsb2DtmOe5HSxvXsrvWtLBEhaTx29+Ma27Jx0ShAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaEsEVoQdVluO3BJ06ptHL34b1XRjp4Ch6Rq24+kmjG4Nwwg+9uA9u/73EjRBqhAEihAoe3xwUQq5WTYEzp0b3ZnV/Ncf6O/9AvY9wlh/6dy3X7ncN512Zw9BVLXjuAP4np44vnQtkZoEgVkEhLBmsWiKqwsXpjbPBOn3gRfenwnc+7GBe+zsjclvonFDS9nA9Iy/u3x9+vAP3735VPk4CRUEFhcBIazFxbfm0k9fHD7k+v4nQFaPQIrx8Gmyx/GJ0J/t7ez7mw0b9MmaC2pQQgh0/ZSm4g5TwueWWtqLt0HuVy4CQljLPPYnB0depTn+b3t+8B4t0AdBUv93h2H9xc6da0aXs2m+r1WQsLRnl7NdUvfKRkAIa5nG//r1oGtsZvjTgev/kqYHF/TA+AXoqv4npJemOEiQU1Eo2l+G0movBK1UBBPU7s9E1+ILAkuNgKwSLjXiqO/khVtvARH8dxDBRkMzPrF/V+9/BlG5y9CUqlXinHv9mRPXtvuus88L9H3JPv2zD2yXExCqAicJBIFWRwAvv3Xqwq0/Pnn+lv/K+ZvfPH3p9p5W75O0fxaBp793ce3AwIDMWmYhafiVgNtwSMsXeHp4eNXJC8Nf0PAdRCiuf/XgrnWUqsqotcvnl9DmRkCdweX4b9N7+m/ih+mbMraLM14yJVwcXItKpT1VRve+ArC3Qqn+3gM7132jKEGZm6tXg86J7OhDfuA/iHwPUpfUZSfu2L59tXxEoQxeyxkEgjKeOnLxHb4RqC+NY5H3+2953d4XlrNN7Vq3ENYij+yZwbG9jpt9GkBPQ5H9zgP9607OVeWp87cOQtn9zwJf+xDMNFfj+jryPqXpxj8c2Nn7P+SXey70lidu4IXzb0DNB4tr9751+HV7zxSHyd1CERDCWiiCc+QPjUCnsaqmZ62O5IN7N/VUNP48ee7mAZDTf4Tt049iUG4Guv4ZfNLos9UIbo7qJWoJEHjy+bP7fNsoOcnW0A0/aacef8PdG28sQTNWTBVCWIs01OfPj66BpfqTmq732UnjgT1bei+Vq4pTv7HM8Ceg2/o1qLQug7T+FaaM3IqTLZdewpoHgYEjV9fphvOj+OShWa5V+CxvZtpzv/LwG/aNl4uXsPoRwI+4uEYjAJ2GmdG8L0FK2mYa+tsrkdXZy+P7x2ZuHdW14P+BLdank9q6Qwd3rf+ckFWjR6Tx5Q2cP58K9Jm3VCIr1ogt48lO237r3//96YofeG18y9q7RFklXITxPXV+5DchKb3ZDMy37Nu5tuxG4R9cHH6b42QfAzlds+3EPXu2rfrBIjRFilwkBIIR7SHoJDurFU89ZOd680Gke6JaWomvjoBIWNUxqivFD87fej0e0n8Fwvr0/t1rnyqX+QfnRz7g+8FX8Rv8vL3auF/IqhxKzR2WCPxXqKeq3krDTdj2ierpJEUtCIgOqxaUakwzNBR0D09yiqePHOjveyOkpxLr9VMXb73V97S/h3nDXx7Y2fdPkAYbncW1IgIDxy5vM7LZt/hgrnLtxyaBrJNxv/72N+6tuNhSLp+EVUZACKsyNnXHvHL+1qcgNf2KbSXu2bt9dcmS9qlzo/fARgcmCtpzB3b1/Vg5QiuslLowENy
  2532. }
  2533. };
  2534. const NoticeBar = {
  2535. // noticeBar
  2536. noticeBar: {
  2537. text: [],
  2538. direction: "row",
  2539. step: false,
  2540. icon: "volume",
  2541. mode: "",
  2542. color: "#f9ae3d",
  2543. bgColor: "#fdf6ec",
  2544. speed: 80,
  2545. fontSize: 14,
  2546. duration: 2e3,
  2547. disableTouch: true,
  2548. url: "",
  2549. linkType: "navigateTo"
  2550. }
  2551. };
  2552. const Notify = {
  2553. // notify组件
  2554. notify: {
  2555. top: 0,
  2556. type: "primary",
  2557. color: "#ffffff",
  2558. bgColor: "",
  2559. message: "",
  2560. duration: 3e3,
  2561. fontSize: 15,
  2562. safeAreaInsetTop: false
  2563. }
  2564. };
  2565. const NumberBox = {
  2566. // 步进器组件
  2567. numberBox: {
  2568. name: "",
  2569. value: 0,
  2570. min: 1,
  2571. max: Number.MAX_SAFE_INTEGER,
  2572. step: 1,
  2573. integer: false,
  2574. disabled: false,
  2575. disabledInput: false,
  2576. asyncChange: false,
  2577. inputWidth: 35,
  2578. showMinus: true,
  2579. showPlus: true,
  2580. decimalLength: null,
  2581. longPress: true,
  2582. color: "#323233",
  2583. buttonSize: 30,
  2584. bgColor: "#EBECEE",
  2585. cursorSpacing: 100,
  2586. disableMinus: false,
  2587. disablePlus: false,
  2588. iconStyle: ""
  2589. }
  2590. };
  2591. const NumberKeyboard = {
  2592. // 数字键盘
  2593. numberKeyboard: {
  2594. mode: "number",
  2595. dotDisabled: false,
  2596. random: false
  2597. }
  2598. };
  2599. const Overlay = {
  2600. // overlay组件
  2601. overlay: {
  2602. show: false,
  2603. zIndex: 10070,
  2604. duration: 300,
  2605. opacity: 0.5
  2606. }
  2607. };
  2608. const Parse = {
  2609. // parse
  2610. parse: {
  2611. copyLink: true,
  2612. errorImg: "",
  2613. lazyLoad: false,
  2614. loadingImg: "",
  2615. pauseVideo: true,
  2616. previewImg: true,
  2617. setTitle: true,
  2618. showImgMenu: true
  2619. }
  2620. };
  2621. const Picker = {
  2622. // picker
  2623. picker: {
  2624. show: false,
  2625. popupMode: "bottom",
  2626. showToolbar: true,
  2627. title: "",
  2628. columns: [],
  2629. loading: false,
  2630. itemHeight: 44,
  2631. cancelText: "取消",
  2632. confirmText: "确定",
  2633. cancelColor: "#909193",
  2634. confirmColor: "#3c9cff",
  2635. visibleItemCount: 5,
  2636. keyName: "text",
  2637. closeOnClickOverlay: false,
  2638. defaultIndex: [],
  2639. immediateChange: true
  2640. }
  2641. };
  2642. const Popup = {
  2643. // popup组件
  2644. popup: {
  2645. show: false,
  2646. overlay: true,
  2647. mode: "bottom",
  2648. duration: 300,
  2649. closeable: false,
  2650. overlayStyle: {},
  2651. closeOnClickOverlay: true,
  2652. zIndex: 10075,
  2653. safeAreaInsetBottom: true,
  2654. safeAreaInsetTop: false,
  2655. closeIconPos: "top-right",
  2656. round: 0,
  2657. zoom: true,
  2658. bgColor: "",
  2659. overlayOpacity: 0.5
  2660. }
  2661. };
  2662. const Radio = {
  2663. // radio组件
  2664. radio: {
  2665. name: "",
  2666. shape: "",
  2667. disabled: "",
  2668. labelDisabled: "",
  2669. activeColor: "",
  2670. inactiveColor: "",
  2671. iconSize: "",
  2672. labelSize: "",
  2673. label: "",
  2674. labelColor: "",
  2675. size: "",
  2676. iconColor: "",
  2677. placement: ""
  2678. }
  2679. };
  2680. const RadioGroup = {
  2681. // radio-group组件
  2682. radioGroup: {
  2683. value: "",
  2684. disabled: false,
  2685. shape: "circle",
  2686. activeColor: "#2979ff",
  2687. inactiveColor: "#c8c9cc",
  2688. name: "",
  2689. size: 18,
  2690. placement: "row",
  2691. label: "",
  2692. labelColor: "#303133",
  2693. labelSize: 14,
  2694. labelDisabled: false,
  2695. iconColor: "#ffffff",
  2696. iconSize: 12,
  2697. borderBottom: false,
  2698. iconPlacement: "left"
  2699. }
  2700. };
  2701. const Rate = {
  2702. // rate组件
  2703. rate: {
  2704. value: 1,
  2705. count: 5,
  2706. disabled: false,
  2707. size: 18,
  2708. inactiveColor: "#b2b2b2",
  2709. activeColor: "#FA3534",
  2710. gutter: 4,
  2711. minCount: 1,
  2712. allowHalf: false,
  2713. activeIcon: "star-fill",
  2714. inactiveIcon: "star",
  2715. touchable: true
  2716. }
  2717. };
  2718. const ReadMore = {
  2719. // readMore
  2720. readMore: {
  2721. showHeight: 400,
  2722. toggle: false,
  2723. closeText: "展开阅读全文",
  2724. openText: "收起",
  2725. color: "#2979ff",
  2726. fontSize: 14,
  2727. textIndent: "2em",
  2728. name: ""
  2729. }
  2730. };
  2731. const Row = {
  2732. // row
  2733. row: {
  2734. gutter: 0,
  2735. justify: "start",
  2736. align: "center"
  2737. }
  2738. };
  2739. const RowNotice = {
  2740. // rowNotice
  2741. rowNotice: {
  2742. text: "",
  2743. icon: "volume",
  2744. mode: "",
  2745. color: "#f9ae3d",
  2746. bgColor: "#fdf6ec",
  2747. fontSize: 14,
  2748. speed: 80
  2749. }
  2750. };
  2751. const ScrollList = {
  2752. // scrollList
  2753. scrollList: {
  2754. indicatorWidth: 50,
  2755. indicatorBarWidth: 20,
  2756. indicator: true,
  2757. indicatorColor: "#f2f2f2",
  2758. indicatorActiveColor: "#3c9cff",
  2759. indicatorStyle: ""
  2760. }
  2761. };
  2762. const Search = {
  2763. // search
  2764. search: {
  2765. shape: "round",
  2766. bgColor: "#f2f2f2",
  2767. placeholder: "请输入关键字",
  2768. clearabled: true,
  2769. focus: false,
  2770. showAction: true,
  2771. actionStyle: {},
  2772. actionText: "搜索",
  2773. inputAlign: "left",
  2774. inputStyle: {},
  2775. disabled: false,
  2776. borderColor: "transparent",
  2777. searchIconColor: "#909399",
  2778. searchIconSize: 22,
  2779. color: "#606266",
  2780. placeholderColor: "#909399",
  2781. searchIcon: "search",
  2782. margin: "0",
  2783. animation: false,
  2784. value: "",
  2785. maxlength: "-1",
  2786. height: 32,
  2787. label: null
  2788. }
  2789. };
  2790. const Section = {
  2791. // u-section组件
  2792. section: {
  2793. title: "",
  2794. subTitle: "更多",
  2795. right: true,
  2796. fontSize: 15,
  2797. bold: true,
  2798. color: "#303133",
  2799. subColor: "#909399",
  2800. showLine: true,
  2801. lineColor: "",
  2802. arrow: true
  2803. }
  2804. };
  2805. const Skeleton = {
  2806. // skeleton
  2807. skeleton: {
  2808. loading: true,
  2809. animate: true,
  2810. rows: 0,
  2811. rowsWidth: "100%",
  2812. rowsHeight: 18,
  2813. title: true,
  2814. titleWidth: "50%",
  2815. titleHeight: 18,
  2816. avatar: false,
  2817. avatarSize: 32,
  2818. avatarShape: "circle"
  2819. }
  2820. };
  2821. const Slider = {
  2822. // slider组件
  2823. slider: {
  2824. value: 0,
  2825. blockSize: 18,
  2826. min: 0,
  2827. max: 100,
  2828. step: 1,
  2829. activeColor: "#2979ff",
  2830. inactiveColor: "#c0c4cc",
  2831. blockColor: "#ffffff",
  2832. showValue: false,
  2833. disabled: false,
  2834. blockStyle: {}
  2835. }
  2836. };
  2837. const StatusBar = {
  2838. // statusBar
  2839. statusBar: {
  2840. bgColor: "transparent"
  2841. }
  2842. };
  2843. const Steps = {
  2844. // steps组件
  2845. steps: {
  2846. direction: "row",
  2847. current: 0,
  2848. activeColor: "#3c9cff",
  2849. inactiveColor: "#969799",
  2850. activeIcon: "",
  2851. inactiveIcon: "",
  2852. dot: false
  2853. }
  2854. };
  2855. const StepsItem = {
  2856. // steps-item组件
  2857. stepsItem: {
  2858. title: "",
  2859. desc: "",
  2860. iconSize: 17,
  2861. error: false
  2862. }
  2863. };
  2864. const Sticky = {
  2865. // sticky组件
  2866. sticky: {
  2867. offsetTop: 0,
  2868. customNavHeight: 0,
  2869. disabled: false,
  2870. bgColor: "transparent",
  2871. zIndex: "",
  2872. index: ""
  2873. }
  2874. };
  2875. const Subsection = {
  2876. // subsection组件
  2877. subsection: {
  2878. list: [],
  2879. current: 0,
  2880. activeColor: "#3c9cff",
  2881. inactiveColor: "#303133",
  2882. mode: "button",
  2883. fontSize: 12,
  2884. bold: true,
  2885. bgColor: "#eeeeef",
  2886. keyName: "name"
  2887. }
  2888. };
  2889. const SwipeAction = {
  2890. // swipe-action组件
  2891. swipeAction: {
  2892. autoClose: true
  2893. }
  2894. };
  2895. const SwipeActionItem = {
  2896. // swipeActionItem 组件
  2897. swipeActionItem: {
  2898. show: false,
  2899. name: "",
  2900. disabled: false,
  2901. threshold: 20,
  2902. autoClose: true,
  2903. options: [],
  2904. duration: 300
  2905. }
  2906. };
  2907. const Swiper = {
  2908. // swiper 组件
  2909. swiper: {
  2910. list: [],
  2911. indicator: false,
  2912. indicatorActiveColor: "#FFFFFF",
  2913. indicatorInactiveColor: "rgba(255, 255, 255, 0.35)",
  2914. indicatorStyle: "",
  2915. indicatorMode: "line",
  2916. autoplay: true,
  2917. current: 0,
  2918. currentItemId: "",
  2919. interval: 3e3,
  2920. duration: 300,
  2921. circular: false,
  2922. previousMargin: 0,
  2923. nextMargin: 0,
  2924. acceleration: false,
  2925. displayMultipleItems: 1,
  2926. easingFunction: "default",
  2927. keyName: "url",
  2928. imgMode: "aspectFill",
  2929. height: 130,
  2930. bgColor: "#f3f4f6",
  2931. radius: 4,
  2932. loading: false,
  2933. showTitle: false
  2934. }
  2935. };
  2936. const SwipterIndicator = {
  2937. // swiperIndicator 组件
  2938. swiperIndicator: {
  2939. length: 0,
  2940. current: 0,
  2941. indicatorActiveColor: "",
  2942. indicatorInactiveColor: "",
  2943. indicatorMode: "line"
  2944. }
  2945. };
  2946. const Switch = {
  2947. // switch
  2948. switch: {
  2949. loading: false,
  2950. disabled: false,
  2951. size: 25,
  2952. activeColor: "#2979ff",
  2953. inactiveColor: "#ffffff",
  2954. value: false,
  2955. activeValue: true,
  2956. inactiveValue: false,
  2957. asyncChange: false,
  2958. space: 0
  2959. }
  2960. };
  2961. const Tabbar = {
  2962. // tabbar
  2963. tabbar: {
  2964. value: null,
  2965. safeAreaInsetBottom: true,
  2966. border: true,
  2967. zIndex: 1,
  2968. activeColor: "#1989fa",
  2969. inactiveColor: "#7d7e80",
  2970. fixed: true,
  2971. placeholder: true
  2972. }
  2973. };
  2974. const TabbarItem = {
  2975. //
  2976. tabbarItem: {
  2977. name: null,
  2978. icon: "",
  2979. badge: null,
  2980. dot: false,
  2981. text: "",
  2982. badgeStyle: "top: 6px;right:2px;"
  2983. }
  2984. };
  2985. const Tabs = {
  2986. //
  2987. tabs: {
  2988. duration: 300,
  2989. list: [],
  2990. lineColor: "#3c9cff",
  2991. activeStyle: {
  2992. color: "#303133"
  2993. },
  2994. inactiveStyle: {
  2995. color: "#606266"
  2996. },
  2997. lineWidth: 20,
  2998. lineHeight: 3,
  2999. lineBgSize: "cover",
  3000. itemStyle: {
  3001. height: "44px"
  3002. },
  3003. scrollable: true,
  3004. current: 0,
  3005. keyName: "name"
  3006. }
  3007. };
  3008. const Tag = {
  3009. // tag 组件
  3010. tag: {
  3011. type: "primary",
  3012. disabled: false,
  3013. size: "medium",
  3014. shape: "square",
  3015. text: "",
  3016. bgColor: "",
  3017. color: "",
  3018. borderColor: "",
  3019. closeColor: "#C6C7CB",
  3020. name: "",
  3021. plainFill: false,
  3022. plain: false,
  3023. closable: false,
  3024. show: true,
  3025. icon: "",
  3026. iconColor: ""
  3027. }
  3028. };
  3029. const Text = {
  3030. // text 组件
  3031. text: {
  3032. type: "",
  3033. show: true,
  3034. text: "",
  3035. prefixIcon: "",
  3036. suffixIcon: "",
  3037. mode: "",
  3038. href: "",
  3039. format: "",
  3040. call: false,
  3041. openType: "",
  3042. bold: false,
  3043. block: false,
  3044. lines: "",
  3045. color: "#303133",
  3046. size: 15,
  3047. iconStyle: {
  3048. fontSize: "15px"
  3049. },
  3050. decoration: "none",
  3051. margin: 0,
  3052. lineHeight: "",
  3053. align: "left",
  3054. wordWrap: "normal"
  3055. }
  3056. };
  3057. const Textarea = {
  3058. // textarea 组件
  3059. textarea: {
  3060. value: "",
  3061. placeholder: "",
  3062. placeholderClass: "textarea-placeholder",
  3063. placeholderStyle: "color: #c0c4cc",
  3064. height: 70,
  3065. confirmType: "done",
  3066. disabled: false,
  3067. count: false,
  3068. focus: false,
  3069. autoHeight: false,
  3070. fixed: false,
  3071. cursorSpacing: 0,
  3072. cursor: "",
  3073. showConfirmBar: true,
  3074. selectionStart: -1,
  3075. selectionEnd: -1,
  3076. adjustPosition: true,
  3077. disableDefaultPadding: false,
  3078. holdKeyboard: false,
  3079. maxlength: 140,
  3080. border: "surround",
  3081. formatter: null
  3082. }
  3083. };
  3084. const Toast = {
  3085. // toast组件
  3086. toast: {
  3087. zIndex: 10090,
  3088. loading: false,
  3089. text: "",
  3090. icon: "",
  3091. type: "",
  3092. loadingMode: "",
  3093. show: "",
  3094. overlay: false,
  3095. position: "center",
  3096. params: {},
  3097. duration: 2e3,
  3098. isTab: false,
  3099. url: "",
  3100. callback: null,
  3101. back: false
  3102. }
  3103. };
  3104. const Toolbar = {
  3105. // toolbar 组件
  3106. toolbar: {
  3107. show: true,
  3108. cancelText: "取消",
  3109. confirmText: "确认",
  3110. cancelColor: "#909193",
  3111. confirmColor: "#3c9cff",
  3112. title: ""
  3113. }
  3114. };
  3115. const Tooltip = {
  3116. // tooltip 组件
  3117. tooltip: {
  3118. text: "",
  3119. copyText: "",
  3120. size: 14,
  3121. color: "#606266",
  3122. bgColor: "transparent",
  3123. direction: "top",
  3124. zIndex: 10071,
  3125. showCopy: true,
  3126. buttons: [],
  3127. overlay: true,
  3128. showToast: true
  3129. }
  3130. };
  3131. const Transition = {
  3132. // transition动画组件的props
  3133. transition: {
  3134. show: false,
  3135. mode: "fade",
  3136. duration: "300",
  3137. timingFunction: "ease-out"
  3138. }
  3139. };
  3140. const Upload = {
  3141. // upload组件
  3142. upload: {
  3143. accept: "image",
  3144. extension: [],
  3145. capture: ["album", "camera"],
  3146. compressed: true,
  3147. camera: "back",
  3148. maxDuration: 60,
  3149. uploadIcon: "camera-fill",
  3150. uploadIconColor: "#D3D4D6",
  3151. useBeforeRead: false,
  3152. previewFullImage: true,
  3153. maxCount: 52,
  3154. disabled: false,
  3155. imageMode: "aspectFill",
  3156. name: "",
  3157. sizeType: ["original", "compressed"],
  3158. multiple: false,
  3159. deletable: true,
  3160. maxSize: Number.MAX_VALUE,
  3161. fileList: [],
  3162. uploadText: "",
  3163. width: 80,
  3164. height: 80,
  3165. previewImage: true
  3166. }
  3167. };
  3168. const props = {
  3169. ...ActionSheet,
  3170. ...Album,
  3171. ...Alert,
  3172. ...Avatar,
  3173. ...AvatarGroup,
  3174. ...Backtop,
  3175. ...Badge,
  3176. ...Button,
  3177. ...Calendar,
  3178. ...CarKeyboard,
  3179. ...Cell,
  3180. ...CellGroup,
  3181. ...Checkbox,
  3182. ...CheckboxGroup,
  3183. ...CircleProgress,
  3184. ...Code,
  3185. ...CodeInput,
  3186. ...Col,
  3187. ...Collapse,
  3188. ...CollapseItem,
  3189. ...ColumnNotice,
  3190. ...CountDown,
  3191. ...CountTo,
  3192. ...DatetimePicker,
  3193. ...Divider,
  3194. ...Empty,
  3195. ...Form,
  3196. ...GormItem,
  3197. ...Gap,
  3198. ...Grid,
  3199. ...GridItem,
  3200. ...Icon,
  3201. ...Image,
  3202. ...IndexAnchor,
  3203. ...IndexList,
  3204. ...Input,
  3205. ...Keyboard,
  3206. ...Line,
  3207. ...LineProgress,
  3208. ...Link,
  3209. ...List,
  3210. ...ListItem,
  3211. ...LoadingIcon,
  3212. ...LoadingPage,
  3213. ...Loadmore,
  3214. ...Modal,
  3215. ...Navbar,
  3216. ...NoNetwork,
  3217. ...NoticeBar,
  3218. ...Notify,
  3219. ...NumberBox,
  3220. ...NumberKeyboard,
  3221. ...Overlay,
  3222. ...Parse,
  3223. ...Picker,
  3224. ...Popup,
  3225. ...Radio,
  3226. ...RadioGroup,
  3227. ...Rate,
  3228. ...ReadMore,
  3229. ...Row,
  3230. ...RowNotice,
  3231. ...ScrollList,
  3232. ...Search,
  3233. ...Section,
  3234. ...Skeleton,
  3235. ...Slider,
  3236. ...StatusBar,
  3237. ...Steps,
  3238. ...StepsItem,
  3239. ...Sticky,
  3240. ...Subsection,
  3241. ...SwipeAction,
  3242. ...SwipeActionItem,
  3243. ...Swiper,
  3244. ...SwipterIndicator,
  3245. ...Switch,
  3246. ...Tabbar,
  3247. ...TabbarItem,
  3248. ...Tabs,
  3249. ...Tag,
  3250. ...Text,
  3251. ...Textarea,
  3252. ...Toast,
  3253. ...Toolbar,
  3254. ...Tooltip,
  3255. ...Transition,
  3256. ...Upload
  3257. };
  3258. const zIndex = {
  3259. toast: 10090,
  3260. noNetwork: 10080,
  3261. // popup包含popup,actionsheet,keyboard,picker的值
  3262. popup: 10075,
  3263. mask: 10070,
  3264. navbar: 980,
  3265. topTips: 975,
  3266. sticky: 970,
  3267. indexListSticky: 965
  3268. };
  3269. let platform = "none";
  3270. platform = "vue3";
  3271. platform = "plus";
  3272. const platform$1 = platform;
  3273. const http = new Request();
  3274. let themeType = ["primary", "success", "error", "warning", "info"];
  3275. function setConfig(configs) {
  3276. index.shallowMerge(config, configs.config || {});
  3277. index.shallowMerge(props, configs.props || {});
  3278. index.shallowMerge(color, configs.color || {});
  3279. index.shallowMerge(zIndex, configs.zIndex || {});
  3280. }
  3281. index.setConfig = setConfig;
  3282. const $u = {
  3283. route,
  3284. date: index.timeFormat,
  3285. // 另名date
  3286. colorGradient: colorGradient$1.colorGradient,
  3287. hexToRgb: colorGradient$1.hexToRgb,
  3288. rgbToHex: colorGradient$1.rgbToHex,
  3289. colorToRgba: colorGradient$1.colorToRgba,
  3290. test,
  3291. type: themeType,
  3292. http,
  3293. config,
  3294. // uview-plus配置信息相关,比如版本号
  3295. zIndex,
  3296. debounce,
  3297. throttle,
  3298. mixin,
  3299. mpMixin,
  3300. props,
  3301. ...index,
  3302. color,
  3303. platform: platform$1
  3304. };
  3305. uni.$u = $u;
  3306. const install = (Vue2) => {
  3307. Vue2.config.globalProperties.$u = $u;
  3308. Vue2.mixin(mixin);
  3309. };
  3310. const uviewPlus = {
  3311. install
  3312. };
  3313. const getBannerList = (params = {}) => http.get("business/video/getBannerList", { params });
  3314. const _export_sfc = (sfc, props2) => {
  3315. const target = sfc.__vccOpts || sfc;
  3316. for (const [key, val] of props2) {
  3317. target[key] = val;
  3318. }
  3319. return target;
  3320. };
  3321. const _sfc_main$1 = {
  3322. __name: "index",
  3323. setup(__props) {
  3324. async function getBannerListFn() {
  3325. const { data: res } = await getBannerList();
  3326. formatAppLog("log", "at pages/index/index.vue:13", res);
  3327. }
  3328. getBannerListFn();
  3329. return (_ctx, _cache) => {
  3330. return vue.openBlock(), vue.createElementBlock("view", { class: "content" }, " 题库 ");
  3331. };
  3332. }
  3333. };
  3334. const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/work/questionbankvue3/pages/index/index.vue"]]);
  3335. __definePage("pages/index/index", PagesIndexIndex);
  3336. const _sfc_main = {
  3337. onLaunch: function() {
  3338. formatAppLog("log", "at App.vue:6", "App Launch");
  3339. },
  3340. onShow: function() {
  3341. formatAppLog("log", "at App.vue:9", "App Show");
  3342. },
  3343. onHide: function() {
  3344. formatAppLog("log", "at App.vue:12", "App Hide");
  3345. }
  3346. };
  3347. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/work/questionbankvue3/App.vue"]]);
  3348. let obj = {
  3349. H5_API: "",
  3350. //h5代理
  3351. WX_API: "http://www.lyjppt.com/",
  3352. //非代理地址 不要忘记加/
  3353. website: "http://192.168.1.37",
  3354. httpPrefix: "app-api/",
  3355. imgUrl: "https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/",
  3356. // 支付测试地址
  3357. // preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u6/index.html',
  3358. // const preUrl = 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html'
  3359. // 生产地址
  3360. preUrl: "https://zmcht.zybank.com.cn/cem_ysb/index.html"
  3361. };
  3362. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  3363. function getAugmentedNamespace(n) {
  3364. if (n.__esModule)
  3365. return n;
  3366. var f = n.default;
  3367. if (typeof f == "function") {
  3368. var a = function a2() {
  3369. if (this instanceof a2) {
  3370. var args = [null];
  3371. args.push.apply(args, arguments);
  3372. var Ctor = Function.bind.apply(f, args);
  3373. return new Ctor();
  3374. }
  3375. return f.apply(this, arguments);
  3376. };
  3377. a.prototype = f.prototype;
  3378. } else
  3379. a = {};
  3380. Object.defineProperty(a, "__esModule", { value: true });
  3381. Object.keys(n).forEach(function(k) {
  3382. var d = Object.getOwnPropertyDescriptor(n, k);
  3383. Object.defineProperty(a, k, d.get ? d : {
  3384. enumerable: true,
  3385. get: function() {
  3386. return n[k];
  3387. }
  3388. });
  3389. });
  3390. return a;
  3391. }
  3392. var md5Exports = {};
  3393. var md5$1 = {
  3394. get exports() {
  3395. return md5Exports;
  3396. },
  3397. set exports(v) {
  3398. md5Exports = v;
  3399. }
  3400. };
  3401. const __viteBrowserExternal = new Proxy({}, {
  3402. get(_, key) {
  3403. throw new Error(`Module "" has been externalized for browser compatibility. Cannot access ".${key}" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`);
  3404. }
  3405. });
  3406. const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3407. __proto__: null,
  3408. default: __viteBrowserExternal
  3409. }, Symbol.toStringTag, { value: "Module" }));
  3410. const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
  3411. /**
  3412. * [js-md5]{@link https://github.com/emn178/js-md5}
  3413. *
  3414. * @namespace md5
  3415. * @version 0.8.3
  3416. * @author Chen, Yi-Cyuan [emn178@gmail.com]
  3417. * @copyright Chen, Yi-Cyuan 2014-2023
  3418. * @license MIT
  3419. */
  3420. (function(module) {
  3421. (function() {
  3422. var INPUT_ERROR = "input is invalid type";
  3423. var FINALIZE_ERROR = "finalize already called";
  3424. var WINDOW = typeof window === "object";
  3425. var root = WINDOW ? window : {};
  3426. if (root.JS_MD5_NO_WINDOW) {
  3427. WINDOW = false;
  3428. }
  3429. var WEB_WORKER = !WINDOW && typeof self === "object";
  3430. var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node;
  3431. if (NODE_JS) {
  3432. root = commonjsGlobal;
  3433. } else if (WEB_WORKER) {
  3434. root = self;
  3435. }
  3436. var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && true && module.exports;
  3437. var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
  3438. var HEX_CHARS = "0123456789abcdef".split("");
  3439. var EXTRA = [128, 32768, 8388608, -2147483648];
  3440. var SHIFT = [0, 8, 16, 24];
  3441. var OUTPUT_TYPES = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"];
  3442. var BASE64_ENCODE_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
  3443. var blocks = [], buffer8;
  3444. if (ARRAY_BUFFER) {
  3445. var buffer = new ArrayBuffer(68);
  3446. buffer8 = new Uint8Array(buffer);
  3447. blocks = new Uint32Array(buffer);
  3448. }
  3449. var isArray2 = Array.isArray;
  3450. if (root.JS_MD5_NO_NODE_JS || !isArray2) {
  3451. isArray2 = function(obj2) {
  3452. return Object.prototype.toString.call(obj2) === "[object Array]";
  3453. };
  3454. }
  3455. var isView = ArrayBuffer.isView;
  3456. if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
  3457. isView = function(obj2) {
  3458. return typeof obj2 === "object" && obj2.buffer && obj2.buffer.constructor === ArrayBuffer;
  3459. };
  3460. }
  3461. var formatMessage = function(message) {
  3462. var type = typeof message;
  3463. if (type === "string") {
  3464. return [message, true];
  3465. }
  3466. if (type !== "object" || message === null) {
  3467. throw new Error(INPUT_ERROR);
  3468. }
  3469. if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
  3470. return [new Uint8Array(message), false];
  3471. }
  3472. if (!isArray2(message) && !isView(message)) {
  3473. throw new Error(INPUT_ERROR);
  3474. }
  3475. return [message, false];
  3476. };
  3477. var createOutputMethod = function(outputType) {
  3478. return function(message) {
  3479. return new Md5(true).update(message)[outputType]();
  3480. };
  3481. };
  3482. var createMethod = function() {
  3483. var method = createOutputMethod("hex");
  3484. if (NODE_JS) {
  3485. method = nodeWrap(method);
  3486. }
  3487. method.create = function() {
  3488. return new Md5();
  3489. };
  3490. method.update = function(message) {
  3491. return method.create().update(message);
  3492. };
  3493. for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
  3494. var type = OUTPUT_TYPES[i];
  3495. method[type] = createOutputMethod(type);
  3496. }
  3497. return method;
  3498. };
  3499. var nodeWrap = function(method) {
  3500. var crypto = require$$1;
  3501. var Buffer2 = require$$1.Buffer;
  3502. var bufferFrom;
  3503. if (Buffer2.from && !root.JS_MD5_NO_BUFFER_FROM) {
  3504. bufferFrom = Buffer2.from;
  3505. } else {
  3506. bufferFrom = function(message) {
  3507. return new Buffer2(message);
  3508. };
  3509. }
  3510. var nodeMethod = function(message) {
  3511. if (typeof message === "string") {
  3512. return crypto.createHash("md5").update(message, "utf8").digest("hex");
  3513. } else {
  3514. if (message === null || message === void 0) {
  3515. throw new Error(INPUT_ERROR);
  3516. } else if (message.constructor === ArrayBuffer) {
  3517. message = new Uint8Array(message);
  3518. }
  3519. }
  3520. if (isArray2(message) || isView(message) || message.constructor === Buffer2) {
  3521. return crypto.createHash("md5").update(bufferFrom(message)).digest("hex");
  3522. } else {
  3523. return method(message);
  3524. }
  3525. };
  3526. return nodeMethod;
  3527. };
  3528. var createHmacOutputMethod = function(outputType) {
  3529. return function(key, message) {
  3530. return new HmacMd5(key, true).update(message)[outputType]();
  3531. };
  3532. };
  3533. var createHmacMethod = function() {
  3534. var method = createHmacOutputMethod("hex");
  3535. method.create = function(key) {
  3536. return new HmacMd5(key);
  3537. };
  3538. method.update = function(key, message) {
  3539. return method.create(key).update(message);
  3540. };
  3541. for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
  3542. var type = OUTPUT_TYPES[i];
  3543. method[type] = createHmacOutputMethod(type);
  3544. }
  3545. return method;
  3546. };
  3547. function Md5(sharedMemory) {
  3548. if (sharedMemory) {
  3549. blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
  3550. this.blocks = blocks;
  3551. this.buffer8 = buffer8;
  3552. } else {
  3553. if (ARRAY_BUFFER) {
  3554. var buffer2 = new ArrayBuffer(68);
  3555. this.buffer8 = new Uint8Array(buffer2);
  3556. this.blocks = new Uint32Array(buffer2);
  3557. } else {
  3558. this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  3559. }
  3560. }
  3561. this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
  3562. this.finalized = this.hashed = false;
  3563. this.first = true;
  3564. }
  3565. Md5.prototype.update = function(message) {
  3566. if (this.finalized) {
  3567. throw new Error(FINALIZE_ERROR);
  3568. }
  3569. var result = formatMessage(message);
  3570. message = result[0];
  3571. var isString = result[1];
  3572. var code2, index2 = 0, i, length = message.length, blocks2 = this.blocks;
  3573. var buffer82 = this.buffer8;
  3574. while (index2 < length) {
  3575. if (this.hashed) {
  3576. this.hashed = false;
  3577. blocks2[0] = blocks2[16];
  3578. blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
  3579. }
  3580. if (isString) {
  3581. if (ARRAY_BUFFER) {
  3582. for (i = this.start; index2 < length && i < 64; ++index2) {
  3583. code2 = message.charCodeAt(index2);
  3584. if (code2 < 128) {
  3585. buffer82[i++] = code2;
  3586. } else if (code2 < 2048) {
  3587. buffer82[i++] = 192 | code2 >>> 6;
  3588. buffer82[i++] = 128 | code2 & 63;
  3589. } else if (code2 < 55296 || code2 >= 57344) {
  3590. buffer82[i++] = 224 | code2 >>> 12;
  3591. buffer82[i++] = 128 | code2 >>> 6 & 63;
  3592. buffer82[i++] = 128 | code2 & 63;
  3593. } else {
  3594. code2 = 65536 + ((code2 & 1023) << 10 | message.charCodeAt(++index2) & 1023);
  3595. buffer82[i++] = 240 | code2 >>> 18;
  3596. buffer82[i++] = 128 | code2 >>> 12 & 63;
  3597. buffer82[i++] = 128 | code2 >>> 6 & 63;
  3598. buffer82[i++] = 128 | code2 & 63;
  3599. }
  3600. }
  3601. } else {
  3602. for (i = this.start; index2 < length && i < 64; ++index2) {
  3603. code2 = message.charCodeAt(index2);
  3604. if (code2 < 128) {
  3605. blocks2[i >>> 2] |= code2 << SHIFT[i++ & 3];
  3606. } else if (code2 < 2048) {
  3607. blocks2[i >>> 2] |= (192 | code2 >>> 6) << SHIFT[i++ & 3];
  3608. blocks2[i >>> 2] |= (128 | code2 & 63) << SHIFT[i++ & 3];
  3609. } else if (code2 < 55296 || code2 >= 57344) {
  3610. blocks2[i >>> 2] |= (224 | code2 >>> 12) << SHIFT[i++ & 3];
  3611. blocks2[i >>> 2] |= (128 | code2 >>> 6 & 63) << SHIFT[i++ & 3];
  3612. blocks2[i >>> 2] |= (128 | code2 & 63) << SHIFT[i++ & 3];
  3613. } else {
  3614. code2 = 65536 + ((code2 & 1023) << 10 | message.charCodeAt(++index2) & 1023);
  3615. blocks2[i >>> 2] |= (240 | code2 >>> 18) << SHIFT[i++ & 3];
  3616. blocks2[i >>> 2] |= (128 | code2 >>> 12 & 63) << SHIFT[i++ & 3];
  3617. blocks2[i >>> 2] |= (128 | code2 >>> 6 & 63) << SHIFT[i++ & 3];
  3618. blocks2[i >>> 2] |= (128 | code2 & 63) << SHIFT[i++ & 3];
  3619. }
  3620. }
  3621. }
  3622. } else {
  3623. if (ARRAY_BUFFER) {
  3624. for (i = this.start; index2 < length && i < 64; ++index2) {
  3625. buffer82[i++] = message[index2];
  3626. }
  3627. } else {
  3628. for (i = this.start; index2 < length && i < 64; ++index2) {
  3629. blocks2[i >>> 2] |= message[index2] << SHIFT[i++ & 3];
  3630. }
  3631. }
  3632. }
  3633. this.lastByteIndex = i;
  3634. this.bytes += i - this.start;
  3635. if (i >= 64) {
  3636. this.start = i - 64;
  3637. this.hash();
  3638. this.hashed = true;
  3639. } else {
  3640. this.start = i;
  3641. }
  3642. }
  3643. if (this.bytes > 4294967295) {
  3644. this.hBytes += this.bytes / 4294967296 << 0;
  3645. this.bytes = this.bytes % 4294967296;
  3646. }
  3647. return this;
  3648. };
  3649. Md5.prototype.finalize = function() {
  3650. if (this.finalized) {
  3651. return;
  3652. }
  3653. this.finalized = true;
  3654. var blocks2 = this.blocks, i = this.lastByteIndex;
  3655. blocks2[i >>> 2] |= EXTRA[i & 3];
  3656. if (i >= 56) {
  3657. if (!this.hashed) {
  3658. this.hash();
  3659. }
  3660. blocks2[0] = blocks2[16];
  3661. blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
  3662. }
  3663. blocks2[14] = this.bytes << 3;
  3664. blocks2[15] = this.hBytes << 3 | this.bytes >>> 29;
  3665. this.hash();
  3666. };
  3667. Md5.prototype.hash = function() {
  3668. var a, b, c, d, bc, da, blocks2 = this.blocks;
  3669. if (this.first) {
  3670. a = blocks2[0] - 680876937;
  3671. a = (a << 7 | a >>> 25) - 271733879 << 0;
  3672. d = (-1732584194 ^ a & 2004318071) + blocks2[1] - 117830708;
  3673. d = (d << 12 | d >>> 20) + a << 0;
  3674. c = (-271733879 ^ d & (a ^ -271733879)) + blocks2[2] - 1126478375;
  3675. c = (c << 17 | c >>> 15) + d << 0;
  3676. b = (a ^ c & (d ^ a)) + blocks2[3] - 1316259209;
  3677. b = (b << 22 | b >>> 10) + c << 0;
  3678. } else {
  3679. a = this.h0;
  3680. b = this.h1;
  3681. c = this.h2;
  3682. d = this.h3;
  3683. a += (d ^ b & (c ^ d)) + blocks2[0] - 680876936;
  3684. a = (a << 7 | a >>> 25) + b << 0;
  3685. d += (c ^ a & (b ^ c)) + blocks2[1] - 389564586;
  3686. d = (d << 12 | d >>> 20) + a << 0;
  3687. c += (b ^ d & (a ^ b)) + blocks2[2] + 606105819;
  3688. c = (c << 17 | c >>> 15) + d << 0;
  3689. b += (a ^ c & (d ^ a)) + blocks2[3] - 1044525330;
  3690. b = (b << 22 | b >>> 10) + c << 0;
  3691. }
  3692. a += (d ^ b & (c ^ d)) + blocks2[4] - 176418897;
  3693. a = (a << 7 | a >>> 25) + b << 0;
  3694. d += (c ^ a & (b ^ c)) + blocks2[5] + 1200080426;
  3695. d = (d << 12 | d >>> 20) + a << 0;
  3696. c += (b ^ d & (a ^ b)) + blocks2[6] - 1473231341;
  3697. c = (c << 17 | c >>> 15) + d << 0;
  3698. b += (a ^ c & (d ^ a)) + blocks2[7] - 45705983;
  3699. b = (b << 22 | b >>> 10) + c << 0;
  3700. a += (d ^ b & (c ^ d)) + blocks2[8] + 1770035416;
  3701. a = (a << 7 | a >>> 25) + b << 0;
  3702. d += (c ^ a & (b ^ c)) + blocks2[9] - 1958414417;
  3703. d = (d << 12 | d >>> 20) + a << 0;
  3704. c += (b ^ d & (a ^ b)) + blocks2[10] - 42063;
  3705. c = (c << 17 | c >>> 15) + d << 0;
  3706. b += (a ^ c & (d ^ a)) + blocks2[11] - 1990404162;
  3707. b = (b << 22 | b >>> 10) + c << 0;
  3708. a += (d ^ b & (c ^ d)) + blocks2[12] + 1804603682;
  3709. a = (a << 7 | a >>> 25) + b << 0;
  3710. d += (c ^ a & (b ^ c)) + blocks2[13] - 40341101;
  3711. d = (d << 12 | d >>> 20) + a << 0;
  3712. c += (b ^ d & (a ^ b)) + blocks2[14] - 1502002290;
  3713. c = (c << 17 | c >>> 15) + d << 0;
  3714. b += (a ^ c & (d ^ a)) + blocks2[15] + 1236535329;
  3715. b = (b << 22 | b >>> 10) + c << 0;
  3716. a += (c ^ d & (b ^ c)) + blocks2[1] - 165796510;
  3717. a = (a << 5 | a >>> 27) + b << 0;
  3718. d += (b ^ c & (a ^ b)) + blocks2[6] - 1069501632;
  3719. d = (d << 9 | d >>> 23) + a << 0;
  3720. c += (a ^ b & (d ^ a)) + blocks2[11] + 643717713;
  3721. c = (c << 14 | c >>> 18) + d << 0;
  3722. b += (d ^ a & (c ^ d)) + blocks2[0] - 373897302;
  3723. b = (b << 20 | b >>> 12) + c << 0;
  3724. a += (c ^ d & (b ^ c)) + blocks2[5] - 701558691;
  3725. a = (a << 5 | a >>> 27) + b << 0;
  3726. d += (b ^ c & (a ^ b)) + blocks2[10] + 38016083;
  3727. d = (d << 9 | d >>> 23) + a << 0;
  3728. c += (a ^ b & (d ^ a)) + blocks2[15] - 660478335;
  3729. c = (c << 14 | c >>> 18) + d << 0;
  3730. b += (d ^ a & (c ^ d)) + blocks2[4] - 405537848;
  3731. b = (b << 20 | b >>> 12) + c << 0;
  3732. a += (c ^ d & (b ^ c)) + blocks2[9] + 568446438;
  3733. a = (a << 5 | a >>> 27) + b << 0;
  3734. d += (b ^ c & (a ^ b)) + blocks2[14] - 1019803690;
  3735. d = (d << 9 | d >>> 23) + a << 0;
  3736. c += (a ^ b & (d ^ a)) + blocks2[3] - 187363961;
  3737. c = (c << 14 | c >>> 18) + d << 0;
  3738. b += (d ^ a & (c ^ d)) + blocks2[8] + 1163531501;
  3739. b = (b << 20 | b >>> 12) + c << 0;
  3740. a += (c ^ d & (b ^ c)) + blocks2[13] - 1444681467;
  3741. a = (a << 5 | a >>> 27) + b << 0;
  3742. d += (b ^ c & (a ^ b)) + blocks2[2] - 51403784;
  3743. d = (d << 9 | d >>> 23) + a << 0;
  3744. c += (a ^ b & (d ^ a)) + blocks2[7] + 1735328473;
  3745. c = (c << 14 | c >>> 18) + d << 0;
  3746. b += (d ^ a & (c ^ d)) + blocks2[12] - 1926607734;
  3747. b = (b << 20 | b >>> 12) + c << 0;
  3748. bc = b ^ c;
  3749. a += (bc ^ d) + blocks2[5] - 378558;
  3750. a = (a << 4 | a >>> 28) + b << 0;
  3751. d += (bc ^ a) + blocks2[8] - 2022574463;
  3752. d = (d << 11 | d >>> 21) + a << 0;
  3753. da = d ^ a;
  3754. c += (da ^ b) + blocks2[11] + 1839030562;
  3755. c = (c << 16 | c >>> 16) + d << 0;
  3756. b += (da ^ c) + blocks2[14] - 35309556;
  3757. b = (b << 23 | b >>> 9) + c << 0;
  3758. bc = b ^ c;
  3759. a += (bc ^ d) + blocks2[1] - 1530992060;
  3760. a = (a << 4 | a >>> 28) + b << 0;
  3761. d += (bc ^ a) + blocks2[4] + 1272893353;
  3762. d = (d << 11 | d >>> 21) + a << 0;
  3763. da = d ^ a;
  3764. c += (da ^ b) + blocks2[7] - 155497632;
  3765. c = (c << 16 | c >>> 16) + d << 0;
  3766. b += (da ^ c) + blocks2[10] - 1094730640;
  3767. b = (b << 23 | b >>> 9) + c << 0;
  3768. bc = b ^ c;
  3769. a += (bc ^ d) + blocks2[13] + 681279174;
  3770. a = (a << 4 | a >>> 28) + b << 0;
  3771. d += (bc ^ a) + blocks2[0] - 358537222;
  3772. d = (d << 11 | d >>> 21) + a << 0;
  3773. da = d ^ a;
  3774. c += (da ^ b) + blocks2[3] - 722521979;
  3775. c = (c << 16 | c >>> 16) + d << 0;
  3776. b += (da ^ c) + blocks2[6] + 76029189;
  3777. b = (b << 23 | b >>> 9) + c << 0;
  3778. bc = b ^ c;
  3779. a += (bc ^ d) + blocks2[9] - 640364487;
  3780. a = (a << 4 | a >>> 28) + b << 0;
  3781. d += (bc ^ a) + blocks2[12] - 421815835;
  3782. d = (d << 11 | d >>> 21) + a << 0;
  3783. da = d ^ a;
  3784. c += (da ^ b) + blocks2[15] + 530742520;
  3785. c = (c << 16 | c >>> 16) + d << 0;
  3786. b += (da ^ c) + blocks2[2] - 995338651;
  3787. b = (b << 23 | b >>> 9) + c << 0;
  3788. a += (c ^ (b | ~d)) + blocks2[0] - 198630844;
  3789. a = (a << 6 | a >>> 26) + b << 0;
  3790. d += (b ^ (a | ~c)) + blocks2[7] + 1126891415;
  3791. d = (d << 10 | d >>> 22) + a << 0;
  3792. c += (a ^ (d | ~b)) + blocks2[14] - 1416354905;
  3793. c = (c << 15 | c >>> 17) + d << 0;
  3794. b += (d ^ (c | ~a)) + blocks2[5] - 57434055;
  3795. b = (b << 21 | b >>> 11) + c << 0;
  3796. a += (c ^ (b | ~d)) + blocks2[12] + 1700485571;
  3797. a = (a << 6 | a >>> 26) + b << 0;
  3798. d += (b ^ (a | ~c)) + blocks2[3] - 1894986606;
  3799. d = (d << 10 | d >>> 22) + a << 0;
  3800. c += (a ^ (d | ~b)) + blocks2[10] - 1051523;
  3801. c = (c << 15 | c >>> 17) + d << 0;
  3802. b += (d ^ (c | ~a)) + blocks2[1] - 2054922799;
  3803. b = (b << 21 | b >>> 11) + c << 0;
  3804. a += (c ^ (b | ~d)) + blocks2[8] + 1873313359;
  3805. a = (a << 6 | a >>> 26) + b << 0;
  3806. d += (b ^ (a | ~c)) + blocks2[15] - 30611744;
  3807. d = (d << 10 | d >>> 22) + a << 0;
  3808. c += (a ^ (d | ~b)) + blocks2[6] - 1560198380;
  3809. c = (c << 15 | c >>> 17) + d << 0;
  3810. b += (d ^ (c | ~a)) + blocks2[13] + 1309151649;
  3811. b = (b << 21 | b >>> 11) + c << 0;
  3812. a += (c ^ (b | ~d)) + blocks2[4] - 145523070;
  3813. a = (a << 6 | a >>> 26) + b << 0;
  3814. d += (b ^ (a | ~c)) + blocks2[11] - 1120210379;
  3815. d = (d << 10 | d >>> 22) + a << 0;
  3816. c += (a ^ (d | ~b)) + blocks2[2] + 718787259;
  3817. c = (c << 15 | c >>> 17) + d << 0;
  3818. b += (d ^ (c | ~a)) + blocks2[9] - 343485551;
  3819. b = (b << 21 | b >>> 11) + c << 0;
  3820. if (this.first) {
  3821. this.h0 = a + 1732584193 << 0;
  3822. this.h1 = b - 271733879 << 0;
  3823. this.h2 = c - 1732584194 << 0;
  3824. this.h3 = d + 271733878 << 0;
  3825. this.first = false;
  3826. } else {
  3827. this.h0 = this.h0 + a << 0;
  3828. this.h1 = this.h1 + b << 0;
  3829. this.h2 = this.h2 + c << 0;
  3830. this.h3 = this.h3 + d << 0;
  3831. }
  3832. };
  3833. Md5.prototype.hex = function() {
  3834. this.finalize();
  3835. var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
  3836. return HEX_CHARS[h0 >>> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h0 >>> 12 & 15] + HEX_CHARS[h0 >>> 8 & 15] + HEX_CHARS[h0 >>> 20 & 15] + HEX_CHARS[h0 >>> 16 & 15] + HEX_CHARS[h0 >>> 28 & 15] + HEX_CHARS[h0 >>> 24 & 15] + HEX_CHARS[h1 >>> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h1 >>> 12 & 15] + HEX_CHARS[h1 >>> 8 & 15] + HEX_CHARS[h1 >>> 20 & 15] + HEX_CHARS[h1 >>> 16 & 15] + HEX_CHARS[h1 >>> 28 & 15] + HEX_CHARS[h1 >>> 24 & 15] + HEX_CHARS[h2 >>> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h2 >>> 12 & 15] + HEX_CHARS[h2 >>> 8 & 15] + HEX_CHARS[h2 >>> 20 & 15] + HEX_CHARS[h2 >>> 16 & 15] + HEX_CHARS[h2 >>> 28 & 15] + HEX_CHARS[h2 >>> 24 & 15] + HEX_CHARS[h3 >>> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h3 >>> 12 & 15] + HEX_CHARS[h3 >>> 8 & 15] + HEX_CHARS[h3 >>> 20 & 15] + HEX_CHARS[h3 >>> 16 & 15] + HEX_CHARS[h3 >>> 28 & 15] + HEX_CHARS[h3 >>> 24 & 15];
  3837. };
  3838. Md5.prototype.toString = Md5.prototype.hex;
  3839. Md5.prototype.digest = function() {
  3840. this.finalize();
  3841. var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
  3842. return [
  3843. h0 & 255,
  3844. h0 >>> 8 & 255,
  3845. h0 >>> 16 & 255,
  3846. h0 >>> 24 & 255,
  3847. h1 & 255,
  3848. h1 >>> 8 & 255,
  3849. h1 >>> 16 & 255,
  3850. h1 >>> 24 & 255,
  3851. h2 & 255,
  3852. h2 >>> 8 & 255,
  3853. h2 >>> 16 & 255,
  3854. h2 >>> 24 & 255,
  3855. h3 & 255,
  3856. h3 >>> 8 & 255,
  3857. h3 >>> 16 & 255,
  3858. h3 >>> 24 & 255
  3859. ];
  3860. };
  3861. Md5.prototype.array = Md5.prototype.digest;
  3862. Md5.prototype.arrayBuffer = function() {
  3863. this.finalize();
  3864. var buffer2 = new ArrayBuffer(16);
  3865. var blocks2 = new Uint32Array(buffer2);
  3866. blocks2[0] = this.h0;
  3867. blocks2[1] = this.h1;
  3868. blocks2[2] = this.h2;
  3869. blocks2[3] = this.h3;
  3870. return buffer2;
  3871. };
  3872. Md5.prototype.buffer = Md5.prototype.arrayBuffer;
  3873. Md5.prototype.base64 = function() {
  3874. var v1, v2, v3, base64Str = "", bytes = this.array();
  3875. for (var i = 0; i < 15; ) {
  3876. v1 = bytes[i++];
  3877. v2 = bytes[i++];
  3878. v3 = bytes[i++];
  3879. base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] + BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] + BASE64_ENCODE_CHAR[v3 & 63];
  3880. }
  3881. v1 = bytes[i];
  3882. base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[v1 << 4 & 63] + "==";
  3883. return base64Str;
  3884. };
  3885. function HmacMd5(key, sharedMemory) {
  3886. var i, result = formatMessage(key);
  3887. key = result[0];
  3888. if (result[1]) {
  3889. var bytes = [], length = key.length, index2 = 0, code2;
  3890. for (i = 0; i < length; ++i) {
  3891. code2 = key.charCodeAt(i);
  3892. if (code2 < 128) {
  3893. bytes[index2++] = code2;
  3894. } else if (code2 < 2048) {
  3895. bytes[index2++] = 192 | code2 >>> 6;
  3896. bytes[index2++] = 128 | code2 & 63;
  3897. } else if (code2 < 55296 || code2 >= 57344) {
  3898. bytes[index2++] = 224 | code2 >>> 12;
  3899. bytes[index2++] = 128 | code2 >>> 6 & 63;
  3900. bytes[index2++] = 128 | code2 & 63;
  3901. } else {
  3902. code2 = 65536 + ((code2 & 1023) << 10 | key.charCodeAt(++i) & 1023);
  3903. bytes[index2++] = 240 | code2 >>> 18;
  3904. bytes[index2++] = 128 | code2 >>> 12 & 63;
  3905. bytes[index2++] = 128 | code2 >>> 6 & 63;
  3906. bytes[index2++] = 128 | code2 & 63;
  3907. }
  3908. }
  3909. key = bytes;
  3910. }
  3911. if (key.length > 64) {
  3912. key = new Md5(true).update(key).array();
  3913. }
  3914. var oKeyPad = [], iKeyPad = [];
  3915. for (i = 0; i < 64; ++i) {
  3916. var b = key[i] || 0;
  3917. oKeyPad[i] = 92 ^ b;
  3918. iKeyPad[i] = 54 ^ b;
  3919. }
  3920. Md5.call(this, sharedMemory);
  3921. this.update(iKeyPad);
  3922. this.oKeyPad = oKeyPad;
  3923. this.inner = true;
  3924. this.sharedMemory = sharedMemory;
  3925. }
  3926. HmacMd5.prototype = new Md5();
  3927. HmacMd5.prototype.finalize = function() {
  3928. Md5.prototype.finalize.call(this);
  3929. if (this.inner) {
  3930. this.inner = false;
  3931. var innerHash = this.array();
  3932. Md5.call(this, this.sharedMemory);
  3933. this.update(this.oKeyPad);
  3934. this.update(innerHash);
  3935. Md5.prototype.finalize.call(this);
  3936. }
  3937. };
  3938. var exports = createMethod();
  3939. exports.md5 = exports;
  3940. exports.md5.hmac = createHmacMethod();
  3941. if (COMMON_JS) {
  3942. module.exports = exports;
  3943. } else {
  3944. root.md5 = exports;
  3945. }
  3946. })();
  3947. })(md5$1);
  3948. const md5 = md5Exports;
  3949. let { H5_API, WX_API, httpPrefix } = obj;
  3950. let secretKey = "22d90e09d1374f0f9e4accd07d333e55";
  3951. const request = (vm) => {
  3952. uni.$u.http.setConfig((config2) => {
  3953. let prefix = config2.prefix ? config2.prefix : httpPrefix;
  3954. config2.baseURL = H5_API + WX_API + prefix;
  3955. return config2;
  3956. });
  3957. uni.$u.http.interceptors.request.use((config2) => {
  3958. var _a;
  3959. config2.data = config2.data || {};
  3960. config2.data["timestamp"] = Date.now();
  3961. let jsonString2 = JSON.stringify(config2.data);
  3962. let strSecretKey = jsonString2 + secretKey;
  3963. let hash = md5(strSecretKey);
  3964. config2.header["Signature"] = hash;
  3965. config2.data = jsonString2;
  3966. let noToken = (_a = config2.custom) == null ? void 0 : _a.noToken;
  3967. if (noToken && config2.header.Authorization) {
  3968. delete config2.header.Authorization;
  3969. }
  3970. formatAppLog("log", "at config/request.js:45", "config");
  3971. formatAppLog("log", "at config/request.js:46", config2);
  3972. return config2;
  3973. }, (config2) => {
  3974. return Promise.reject(config2);
  3975. });
  3976. uni.$u.http.interceptors.response.use(async (response) => {
  3977. var _a;
  3978. const data = response.data;
  3979. if (data.code == 406 && response.config.url != "member/auth/refresh-token" && response.config.url !== "member/auth/logout") {
  3980. let obj2 = response.config;
  3981. let method = obj2.method.toLowerCase();
  3982. if (method == "get") {
  3983. return uni.$u.http[method](obj2.url, { params: obj2.params });
  3984. } else {
  3985. return uni.$u.http[method](obj2.url, obj2.data);
  3986. }
  3987. }
  3988. if (data.code == 401) {
  3989. formatAppLog("log", "at config/request.js:68", "报401的接口");
  3990. formatAppLog("log", "at config/request.js:69", response.config.url);
  3991. return uni.$u.debounce(vm.$store.commit("goLogin"), 1500);
  3992. }
  3993. const custom = (_a = response.config) == null ? void 0 : _a.custom;
  3994. if (data.code !== 0 && data.code != 406 && data.code != "200240213") {
  3995. formatAppLog("log", "at config/request.js:76", "不正常的code");
  3996. formatAppLog("log", "at config/request.js:77", data);
  3997. if (custom.toast !== false) {
  3998. uni.$u.toast(data.msg);
  3999. }
  4000. if (custom == null ? void 0 : custom.catch) {
  4001. return Promise.reject(data);
  4002. } else {
  4003. return new Promise(() => {
  4004. });
  4005. }
  4006. }
  4007. return data === void 0 ? {} : data;
  4008. }, (response) => {
  4009. return Promise.reject(response);
  4010. });
  4011. };
  4012. function createApp() {
  4013. const app = vue.createVueApp(App);
  4014. app.use(uviewPlus);
  4015. request(app);
  4016. return {
  4017. app
  4018. };
  4019. }
  4020. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  4021. uni.Vuex = __Vuex__;
  4022. uni.Pinia = __Pinia__;
  4023. __app__.provide("__globalStyles", __uniConfig.styles);
  4024. __app__._component.mpType = "app";
  4025. __app__._component.render = () => {
  4026. };
  4027. __app__.mount("#app");
  4028. })(Vue);