yyw #1
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Build and Release Folders
|
||||
bin-debug/
|
||||
bin-release/
|
||||
[Oo]bj/
|
||||
[Bb]in/
|
||||
|
||||
# Other files and folders
|
||||
.settings/
|
||||
unpackage/
|
||||
dist/**
|
||||
.DS_Store
|
||||
|
||||
# Executables
|
||||
*.swf
|
||||
*.air
|
||||
*.ipa
|
||||
*.apk
|
||||
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
||||
29
.hbuilderx/launch.json
Normal file
29
.hbuilderx/launch.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"openVueDevtools" : true,
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"openVueDevtools" : true,
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
}
|
||||
23
.vite/deps/_metadata.json
Normal file
23
.vite/deps/_metadata.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"hash": "27ca6c53",
|
||||
"browserHash": "ddb93c4c",
|
||||
"optimized": {
|
||||
"dayjs": {
|
||||
"src": "../../node_modules/dayjs/dayjs.min.js",
|
||||
"file": "dayjs.js",
|
||||
"fileHash": "4f773eae",
|
||||
"needsInterop": true
|
||||
},
|
||||
"dayjs/esm/index": {
|
||||
"src": "../../node_modules/dayjs/esm/index.js",
|
||||
"file": "dayjs_esm_index.js",
|
||||
"fileHash": "a6f15937",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-RSJERJUL": {
|
||||
"file": "chunk-RSJERJUL.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
9
.vite/deps/chunk-RSJERJUL.js
Normal file
9
.vite/deps/chunk-RSJERJUL.js
Normal file
@ -0,0 +1,9 @@
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
|
||||
export {
|
||||
__commonJS
|
||||
};
|
||||
//# sourceMappingURL=chunk-RSJERJUL.js.map
|
||||
7
.vite/deps/chunk-RSJERJUL.js.map
Normal file
7
.vite/deps/chunk-RSJERJUL.js.map
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
299
.vite/deps/dayjs.js
Normal file
299
.vite/deps/dayjs.js
Normal file
@ -0,0 +1,299 @@
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-RSJERJUL.js";
|
||||
|
||||
// ../../../shop_app/node_modules/dayjs/dayjs.min.js
|
||||
var require_dayjs_min = __commonJS({
|
||||
"../../../shop_app/node_modules/dayjs/dayjs.min.js"(exports, module) {
|
||||
!function(t, e) {
|
||||
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
||||
}(exports, function() {
|
||||
"use strict";
|
||||
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
||||
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
||||
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
||||
} }, m = function(t2, e2, n2) {
|
||||
var r2 = String(t2);
|
||||
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
||||
}, v = { s: m, z: function(t2) {
|
||||
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
||||
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
||||
}, m: function t2(e2, n2) {
|
||||
if (e2.date() < n2.date())
|
||||
return -t2(n2, e2);
|
||||
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
||||
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
||||
}, a: function(t2) {
|
||||
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
||||
}, p: function(t2) {
|
||||
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
||||
}, u: function(t2) {
|
||||
return void 0 === t2;
|
||||
} }, g = "en", D = {};
|
||||
D[g] = M;
|
||||
var p = "$isDayjsObject", S = function(t2) {
|
||||
return t2 instanceof _ || !(!t2 || !t2[p]);
|
||||
}, w = function t2(e2, n2, r2) {
|
||||
var i2;
|
||||
if (!e2)
|
||||
return g;
|
||||
if ("string" == typeof e2) {
|
||||
var s2 = e2.toLowerCase();
|
||||
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
||||
var u2 = e2.split("-");
|
||||
if (!i2 && u2.length > 1)
|
||||
return t2(u2[0]);
|
||||
} else {
|
||||
var a2 = e2.name;
|
||||
D[a2] = e2, i2 = a2;
|
||||
}
|
||||
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
||||
}, O = function(t2, e2) {
|
||||
if (S(t2))
|
||||
return t2.clone();
|
||||
var n2 = "object" == typeof e2 ? e2 : {};
|
||||
return n2.date = t2, n2.args = arguments, new _(n2);
|
||||
}, b = v;
|
||||
b.l = w, b.i = S, b.w = function(t2, e2) {
|
||||
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
||||
};
|
||||
var _ = function() {
|
||||
function M2(t2) {
|
||||
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
||||
}
|
||||
var m2 = M2.prototype;
|
||||
return m2.parse = function(t2) {
|
||||
this.$d = function(t3) {
|
||||
var e2 = t3.date, n2 = t3.utc;
|
||||
if (null === e2)
|
||||
return new Date(NaN);
|
||||
if (b.u(e2))
|
||||
return new Date();
|
||||
if (e2 instanceof Date)
|
||||
return new Date(e2);
|
||||
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
||||
var r2 = e2.match($);
|
||||
if (r2) {
|
||||
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
||||
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
||||
}
|
||||
}
|
||||
return new Date(e2);
|
||||
}(t2), this.init();
|
||||
}, m2.init = function() {
|
||||
var t2 = this.$d;
|
||||
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
||||
}, m2.$utils = function() {
|
||||
return b;
|
||||
}, m2.isValid = function() {
|
||||
return !(this.$d.toString() === l);
|
||||
}, m2.isSame = function(t2, e2) {
|
||||
var n2 = O(t2);
|
||||
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
||||
}, m2.isAfter = function(t2, e2) {
|
||||
return O(t2) < this.startOf(e2);
|
||||
}, m2.isBefore = function(t2, e2) {
|
||||
return this.endOf(e2) < O(t2);
|
||||
}, m2.$g = function(t2, e2, n2) {
|
||||
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
||||
}, m2.unix = function() {
|
||||
return Math.floor(this.valueOf() / 1e3);
|
||||
}, m2.valueOf = function() {
|
||||
return this.$d.getTime();
|
||||
}, m2.startOf = function(t2, e2) {
|
||||
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
||||
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
||||
return r2 ? i2 : i2.endOf(a);
|
||||
}, $2 = function(t3, e3) {
|
||||
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
||||
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
||||
switch (f2) {
|
||||
case h:
|
||||
return r2 ? l2(1, 0) : l2(31, 11);
|
||||
case c:
|
||||
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
||||
case o:
|
||||
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
||||
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
||||
case a:
|
||||
case d:
|
||||
return $2(v2 + "Hours", 0);
|
||||
case u:
|
||||
return $2(v2 + "Minutes", 1);
|
||||
case s:
|
||||
return $2(v2 + "Seconds", 2);
|
||||
case i:
|
||||
return $2(v2 + "Milliseconds", 3);
|
||||
default:
|
||||
return this.clone();
|
||||
}
|
||||
}, m2.endOf = function(t2) {
|
||||
return this.startOf(t2, false);
|
||||
}, m2.$set = function(t2, e2) {
|
||||
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
||||
if (o2 === c || o2 === h) {
|
||||
var y2 = this.clone().set(d, 1);
|
||||
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
||||
} else
|
||||
l2 && this.$d[l2]($2);
|
||||
return this.init(), this;
|
||||
}, m2.set = function(t2, e2) {
|
||||
return this.clone().$set(t2, e2);
|
||||
}, m2.get = function(t2) {
|
||||
return this[b.p(t2)]();
|
||||
}, m2.add = function(r2, f2) {
|
||||
var d2, l2 = this;
|
||||
r2 = Number(r2);
|
||||
var $2 = b.p(f2), y2 = function(t2) {
|
||||
var e2 = O(l2);
|
||||
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
||||
};
|
||||
if ($2 === c)
|
||||
return this.set(c, this.$M + r2);
|
||||
if ($2 === h)
|
||||
return this.set(h, this.$y + r2);
|
||||
if ($2 === a)
|
||||
return y2(1);
|
||||
if ($2 === o)
|
||||
return y2(7);
|
||||
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
||||
return b.w(m3, this);
|
||||
}, m2.subtract = function(t2, e2) {
|
||||
return this.add(-1 * t2, e2);
|
||||
}, m2.format = function(t2) {
|
||||
var e2 = this, n2 = this.$locale();
|
||||
if (!this.isValid())
|
||||
return n2.invalidDate || l;
|
||||
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
||||
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
||||
}, d2 = function(t3) {
|
||||
return b.s(s2 % 12 || 12, t3, "0");
|
||||
}, $2 = f2 || function(t3, e3, n3) {
|
||||
var r3 = t3 < 12 ? "AM" : "PM";
|
||||
return n3 ? r3.toLowerCase() : r3;
|
||||
};
|
||||
return r2.replace(y, function(t3, r3) {
|
||||
return r3 || function(t4) {
|
||||
switch (t4) {
|
||||
case "YY":
|
||||
return String(e2.$y).slice(-2);
|
||||
case "YYYY":
|
||||
return b.s(e2.$y, 4, "0");
|
||||
case "M":
|
||||
return a2 + 1;
|
||||
case "MM":
|
||||
return b.s(a2 + 1, 2, "0");
|
||||
case "MMM":
|
||||
return h2(n2.monthsShort, a2, c2, 3);
|
||||
case "MMMM":
|
||||
return h2(c2, a2);
|
||||
case "D":
|
||||
return e2.$D;
|
||||
case "DD":
|
||||
return b.s(e2.$D, 2, "0");
|
||||
case "d":
|
||||
return String(e2.$W);
|
||||
case "dd":
|
||||
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
||||
case "ddd":
|
||||
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
||||
case "dddd":
|
||||
return o2[e2.$W];
|
||||
case "H":
|
||||
return String(s2);
|
||||
case "HH":
|
||||
return b.s(s2, 2, "0");
|
||||
case "h":
|
||||
return d2(1);
|
||||
case "hh":
|
||||
return d2(2);
|
||||
case "a":
|
||||
return $2(s2, u2, true);
|
||||
case "A":
|
||||
return $2(s2, u2, false);
|
||||
case "m":
|
||||
return String(u2);
|
||||
case "mm":
|
||||
return b.s(u2, 2, "0");
|
||||
case "s":
|
||||
return String(e2.$s);
|
||||
case "ss":
|
||||
return b.s(e2.$s, 2, "0");
|
||||
case "SSS":
|
||||
return b.s(e2.$ms, 3, "0");
|
||||
case "Z":
|
||||
return i2;
|
||||
}
|
||||
return null;
|
||||
}(t3) || i2.replace(":", "");
|
||||
});
|
||||
}, m2.utcOffset = function() {
|
||||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
||||
}, m2.diff = function(r2, d2, l2) {
|
||||
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
||||
return b.m(y2, m3);
|
||||
};
|
||||
switch (M3) {
|
||||
case h:
|
||||
$2 = D2() / 12;
|
||||
break;
|
||||
case c:
|
||||
$2 = D2();
|
||||
break;
|
||||
case f:
|
||||
$2 = D2() / 3;
|
||||
break;
|
||||
case o:
|
||||
$2 = (g2 - v2) / 6048e5;
|
||||
break;
|
||||
case a:
|
||||
$2 = (g2 - v2) / 864e5;
|
||||
break;
|
||||
case u:
|
||||
$2 = g2 / n;
|
||||
break;
|
||||
case s:
|
||||
$2 = g2 / e;
|
||||
break;
|
||||
case i:
|
||||
$2 = g2 / t;
|
||||
break;
|
||||
default:
|
||||
$2 = g2;
|
||||
}
|
||||
return l2 ? $2 : b.a($2);
|
||||
}, m2.daysInMonth = function() {
|
||||
return this.endOf(c).$D;
|
||||
}, m2.$locale = function() {
|
||||
return D[this.$L];
|
||||
}, m2.locale = function(t2, e2) {
|
||||
if (!t2)
|
||||
return this.$L;
|
||||
var n2 = this.clone(), r2 = w(t2, e2, true);
|
||||
return r2 && (n2.$L = r2), n2;
|
||||
}, m2.clone = function() {
|
||||
return b.w(this.$d, this);
|
||||
}, m2.toDate = function() {
|
||||
return new Date(this.valueOf());
|
||||
}, m2.toJSON = function() {
|
||||
return this.isValid() ? this.toISOString() : null;
|
||||
}, m2.toISOString = function() {
|
||||
return this.$d.toISOString();
|
||||
}, m2.toString = function() {
|
||||
return this.$d.toUTCString();
|
||||
}, M2;
|
||||
}(), k = _.prototype;
|
||||
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
||||
k[t2[1]] = function(e2) {
|
||||
return this.$g(e2, t2[0], t2[1]);
|
||||
};
|
||||
}), O.extend = function(t2, e2) {
|
||||
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
||||
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
||||
return O(1e3 * t2);
|
||||
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
||||
});
|
||||
}
|
||||
});
|
||||
export default require_dayjs_min();
|
||||
//# sourceMappingURL=dayjs.js.map
|
||||
7
.vite/deps/dayjs.js.map
Normal file
7
.vite/deps/dayjs.js.map
Normal file
File diff suppressed because one or more lines are too long
494
.vite/deps/dayjs_esm_index.js
Normal file
494
.vite/deps/dayjs_esm_index.js
Normal file
@ -0,0 +1,494 @@
|
||||
import "./chunk-RSJERJUL.js";
|
||||
|
||||
// ../../../shop_app/node_modules/dayjs/esm/constant.js
|
||||
var SECONDS_A_MINUTE = 60;
|
||||
var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60;
|
||||
var SECONDS_A_DAY = SECONDS_A_HOUR * 24;
|
||||
var SECONDS_A_WEEK = SECONDS_A_DAY * 7;
|
||||
var MILLISECONDS_A_SECOND = 1e3;
|
||||
var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND;
|
||||
var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND;
|
||||
var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND;
|
||||
var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND;
|
||||
var MS = "millisecond";
|
||||
var S = "second";
|
||||
var MIN = "minute";
|
||||
var H = "hour";
|
||||
var D = "day";
|
||||
var W = "week";
|
||||
var M = "month";
|
||||
var Q = "quarter";
|
||||
var Y = "year";
|
||||
var DATE = "date";
|
||||
var FORMAT_DEFAULT = "YYYY-MM-DDTHH:mm:ssZ";
|
||||
var INVALID_DATE_STRING = "Invalid Date";
|
||||
var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
|
||||
var REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
|
||||
|
||||
// ../../../shop_app/node_modules/dayjs/esm/locale/en.js
|
||||
var en_default = {
|
||||
name: "en",
|
||||
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
||||
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
||||
ordinal: function ordinal(n) {
|
||||
var s = ["th", "st", "nd", "rd"];
|
||||
var v = n % 100;
|
||||
return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
|
||||
}
|
||||
};
|
||||
|
||||
// ../../../shop_app/node_modules/dayjs/esm/utils.js
|
||||
var padStart = function padStart2(string, length, pad) {
|
||||
var s = String(string);
|
||||
if (!s || s.length >= length)
|
||||
return string;
|
||||
return "" + Array(length + 1 - s.length).join(pad) + string;
|
||||
};
|
||||
var padZoneStr = function padZoneStr2(instance) {
|
||||
var negMinutes = -instance.utcOffset();
|
||||
var minutes = Math.abs(negMinutes);
|
||||
var hourOffset = Math.floor(minutes / 60);
|
||||
var minuteOffset = minutes % 60;
|
||||
return (negMinutes <= 0 ? "+" : "-") + padStart(hourOffset, 2, "0") + ":" + padStart(minuteOffset, 2, "0");
|
||||
};
|
||||
var monthDiff = function monthDiff2(a, b) {
|
||||
if (a.date() < b.date())
|
||||
return -monthDiff2(b, a);
|
||||
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month());
|
||||
var anchor = a.clone().add(wholeMonthDiff, M);
|
||||
var c = b - anchor < 0;
|
||||
var anchor2 = a.clone().add(wholeMonthDiff + (c ? -1 : 1), M);
|
||||
return +(-(wholeMonthDiff + (b - anchor) / (c ? anchor - anchor2 : anchor2 - anchor)) || 0);
|
||||
};
|
||||
var absFloor = function absFloor2(n) {
|
||||
return n < 0 ? Math.ceil(n) || 0 : Math.floor(n);
|
||||
};
|
||||
var prettyUnit = function prettyUnit2(u) {
|
||||
var special = {
|
||||
M,
|
||||
y: Y,
|
||||
w: W,
|
||||
d: D,
|
||||
D: DATE,
|
||||
h: H,
|
||||
m: MIN,
|
||||
s: S,
|
||||
ms: MS,
|
||||
Q
|
||||
};
|
||||
return special[u] || String(u || "").toLowerCase().replace(/s$/, "");
|
||||
};
|
||||
var isUndefined = function isUndefined2(s) {
|
||||
return s === void 0;
|
||||
};
|
||||
var utils_default = {
|
||||
s: padStart,
|
||||
z: padZoneStr,
|
||||
m: monthDiff,
|
||||
a: absFloor,
|
||||
p: prettyUnit,
|
||||
u: isUndefined
|
||||
};
|
||||
|
||||
// ../../../shop_app/node_modules/dayjs/esm/index.js
|
||||
var L = "en";
|
||||
var Ls = {};
|
||||
Ls[L] = en_default;
|
||||
var IS_DAYJS = "$isDayjsObject";
|
||||
var isDayjs = function isDayjs2(d) {
|
||||
return d instanceof Dayjs || !!(d && d[IS_DAYJS]);
|
||||
};
|
||||
var parseLocale = function parseLocale2(preset, object, isLocal) {
|
||||
var l;
|
||||
if (!preset)
|
||||
return L;
|
||||
if (typeof preset === "string") {
|
||||
var presetLower = preset.toLowerCase();
|
||||
if (Ls[presetLower]) {
|
||||
l = presetLower;
|
||||
}
|
||||
if (object) {
|
||||
Ls[presetLower] = object;
|
||||
l = presetLower;
|
||||
}
|
||||
var presetSplit = preset.split("-");
|
||||
if (!l && presetSplit.length > 1) {
|
||||
return parseLocale2(presetSplit[0]);
|
||||
}
|
||||
} else {
|
||||
var name = preset.name;
|
||||
Ls[name] = preset;
|
||||
l = name;
|
||||
}
|
||||
if (!isLocal && l)
|
||||
L = l;
|
||||
return l || !isLocal && L;
|
||||
};
|
||||
var dayjs = function dayjs2(date, c) {
|
||||
if (isDayjs(date)) {
|
||||
return date.clone();
|
||||
}
|
||||
var cfg = typeof c === "object" ? c : {};
|
||||
cfg.date = date;
|
||||
cfg.args = arguments;
|
||||
return new Dayjs(cfg);
|
||||
};
|
||||
var wrapper = function wrapper2(date, instance) {
|
||||
return dayjs(date, {
|
||||
locale: instance.$L,
|
||||
utc: instance.$u,
|
||||
x: instance.$x,
|
||||
$offset: instance.$offset
|
||||
// todo: refactor; do not use this.$offset in you code
|
||||
});
|
||||
};
|
||||
var Utils = utils_default;
|
||||
Utils.l = parseLocale;
|
||||
Utils.i = isDayjs;
|
||||
Utils.w = wrapper;
|
||||
var parseDate = function parseDate2(cfg) {
|
||||
var date = cfg.date, utc = cfg.utc;
|
||||
if (date === null)
|
||||
return new Date(NaN);
|
||||
if (Utils.u(date))
|
||||
return new Date();
|
||||
if (date instanceof Date)
|
||||
return new Date(date);
|
||||
if (typeof date === "string" && !/Z$/i.test(date)) {
|
||||
var d = date.match(REGEX_PARSE);
|
||||
if (d) {
|
||||
var m = d[2] - 1 || 0;
|
||||
var ms = (d[7] || "0").substring(0, 3);
|
||||
if (utc) {
|
||||
return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
|
||||
}
|
||||
return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
|
||||
}
|
||||
}
|
||||
return new Date(date);
|
||||
};
|
||||
var Dayjs = function() {
|
||||
function Dayjs2(cfg) {
|
||||
this.$L = parseLocale(cfg.locale, null, true);
|
||||
this.parse(cfg);
|
||||
this.$x = this.$x || cfg.x || {};
|
||||
this[IS_DAYJS] = true;
|
||||
}
|
||||
var _proto = Dayjs2.prototype;
|
||||
_proto.parse = function parse(cfg) {
|
||||
this.$d = parseDate(cfg);
|
||||
this.init();
|
||||
};
|
||||
_proto.init = function init() {
|
||||
var $d = this.$d;
|
||||
this.$y = $d.getFullYear();
|
||||
this.$M = $d.getMonth();
|
||||
this.$D = $d.getDate();
|
||||
this.$W = $d.getDay();
|
||||
this.$H = $d.getHours();
|
||||
this.$m = $d.getMinutes();
|
||||
this.$s = $d.getSeconds();
|
||||
this.$ms = $d.getMilliseconds();
|
||||
};
|
||||
_proto.$utils = function $utils() {
|
||||
return Utils;
|
||||
};
|
||||
_proto.isValid = function isValid() {
|
||||
return !(this.$d.toString() === INVALID_DATE_STRING);
|
||||
};
|
||||
_proto.isSame = function isSame(that, units) {
|
||||
var other = dayjs(that);
|
||||
return this.startOf(units) <= other && other <= this.endOf(units);
|
||||
};
|
||||
_proto.isAfter = function isAfter(that, units) {
|
||||
return dayjs(that) < this.startOf(units);
|
||||
};
|
||||
_proto.isBefore = function isBefore(that, units) {
|
||||
return this.endOf(units) < dayjs(that);
|
||||
};
|
||||
_proto.$g = function $g(input, get, set) {
|
||||
if (Utils.u(input))
|
||||
return this[get];
|
||||
return this.set(set, input);
|
||||
};
|
||||
_proto.unix = function unix() {
|
||||
return Math.floor(this.valueOf() / 1e3);
|
||||
};
|
||||
_proto.valueOf = function valueOf() {
|
||||
return this.$d.getTime();
|
||||
};
|
||||
_proto.startOf = function startOf(units, _startOf) {
|
||||
var _this = this;
|
||||
var isStartOf = !Utils.u(_startOf) ? _startOf : true;
|
||||
var unit = Utils.p(units);
|
||||
var instanceFactory = function instanceFactory2(d, m) {
|
||||
var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this);
|
||||
return isStartOf ? ins : ins.endOf(D);
|
||||
};
|
||||
var instanceFactorySet = function instanceFactorySet2(method, slice) {
|
||||
var argumentStart = [0, 0, 0, 0];
|
||||
var argumentEnd = [23, 59, 59, 999];
|
||||
return Utils.w(_this.toDate()[method].apply(
|
||||
// eslint-disable-line prefer-spread
|
||||
_this.toDate("s"),
|
||||
(isStartOf ? argumentStart : argumentEnd).slice(slice)
|
||||
), _this);
|
||||
};
|
||||
var $W = this.$W, $M = this.$M, $D = this.$D;
|
||||
var utcPad = "set" + (this.$u ? "UTC" : "");
|
||||
switch (unit) {
|
||||
case Y:
|
||||
return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11);
|
||||
case M:
|
||||
return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1);
|
||||
case W: {
|
||||
var weekStart = this.$locale().weekStart || 0;
|
||||
var gap = ($W < weekStart ? $W + 7 : $W) - weekStart;
|
||||
return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M);
|
||||
}
|
||||
case D:
|
||||
case DATE:
|
||||
return instanceFactorySet(utcPad + "Hours", 0);
|
||||
case H:
|
||||
return instanceFactorySet(utcPad + "Minutes", 1);
|
||||
case MIN:
|
||||
return instanceFactorySet(utcPad + "Seconds", 2);
|
||||
case S:
|
||||
return instanceFactorySet(utcPad + "Milliseconds", 3);
|
||||
default:
|
||||
return this.clone();
|
||||
}
|
||||
};
|
||||
_proto.endOf = function endOf(arg) {
|
||||
return this.startOf(arg, false);
|
||||
};
|
||||
_proto.$set = function $set(units, _int) {
|
||||
var _C$D$C$DATE$C$M$C$Y$C;
|
||||
var unit = Utils.p(units);
|
||||
var utcPad = "set" + (this.$u ? "UTC" : "");
|
||||
var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit];
|
||||
var arg = unit === D ? this.$D + (_int - this.$W) : _int;
|
||||
if (unit === M || unit === Y) {
|
||||
var date = this.clone().set(DATE, 1);
|
||||
date.$d[name](arg);
|
||||
date.init();
|
||||
this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d;
|
||||
} else if (name)
|
||||
this.$d[name](arg);
|
||||
this.init();
|
||||
return this;
|
||||
};
|
||||
_proto.set = function set(string, _int2) {
|
||||
return this.clone().$set(string, _int2);
|
||||
};
|
||||
_proto.get = function get(unit) {
|
||||
return this[Utils.p(unit)]();
|
||||
};
|
||||
_proto.add = function add(number, units) {
|
||||
var _this2 = this, _C$MIN$C$H$C$S$unit;
|
||||
number = Number(number);
|
||||
var unit = Utils.p(units);
|
||||
var instanceFactorySet = function instanceFactorySet2(n) {
|
||||
var d = dayjs(_this2);
|
||||
return Utils.w(d.date(d.date() + Math.round(n * number)), _this2);
|
||||
};
|
||||
if (unit === M) {
|
||||
return this.set(M, this.$M + number);
|
||||
}
|
||||
if (unit === Y) {
|
||||
return this.set(Y, this.$y + number);
|
||||
}
|
||||
if (unit === D) {
|
||||
return instanceFactorySet(1);
|
||||
}
|
||||
if (unit === W) {
|
||||
return instanceFactorySet(7);
|
||||
}
|
||||
var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[MIN] = MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[H] = MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[S] = MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1;
|
||||
var nextTimeStamp = this.$d.getTime() + number * step;
|
||||
return Utils.w(nextTimeStamp, this);
|
||||
};
|
||||
_proto.subtract = function subtract(number, string) {
|
||||
return this.add(number * -1, string);
|
||||
};
|
||||
_proto.format = function format(formatStr) {
|
||||
var _this3 = this;
|
||||
var locale = this.$locale();
|
||||
if (!this.isValid())
|
||||
return locale.invalidDate || INVALID_DATE_STRING;
|
||||
var str = formatStr || FORMAT_DEFAULT;
|
||||
var zoneStr = Utils.z(this);
|
||||
var $H = this.$H, $m = this.$m, $M = this.$M;
|
||||
var weekdays = locale.weekdays, months = locale.months, meridiem = locale.meridiem;
|
||||
var getShort = function getShort2(arr, index, full, length) {
|
||||
return arr && (arr[index] || arr(_this3, str)) || full[index].slice(0, length);
|
||||
};
|
||||
var get$H = function get$H2(num) {
|
||||
return Utils.s($H % 12 || 12, num, "0");
|
||||
};
|
||||
var meridiemFunc = meridiem || function(hour, minute, isLowercase) {
|
||||
var m = hour < 12 ? "AM" : "PM";
|
||||
return isLowercase ? m.toLowerCase() : m;
|
||||
};
|
||||
var matches = function matches2(match) {
|
||||
switch (match) {
|
||||
case "YY":
|
||||
return String(_this3.$y).slice(-2);
|
||||
case "YYYY":
|
||||
return Utils.s(_this3.$y, 4, "0");
|
||||
case "M":
|
||||
return $M + 1;
|
||||
case "MM":
|
||||
return Utils.s($M + 1, 2, "0");
|
||||
case "MMM":
|
||||
return getShort(locale.monthsShort, $M, months, 3);
|
||||
case "MMMM":
|
||||
return getShort(months, $M);
|
||||
case "D":
|
||||
return _this3.$D;
|
||||
case "DD":
|
||||
return Utils.s(_this3.$D, 2, "0");
|
||||
case "d":
|
||||
return String(_this3.$W);
|
||||
case "dd":
|
||||
return getShort(locale.weekdaysMin, _this3.$W, weekdays, 2);
|
||||
case "ddd":
|
||||
return getShort(locale.weekdaysShort, _this3.$W, weekdays, 3);
|
||||
case "dddd":
|
||||
return weekdays[_this3.$W];
|
||||
case "H":
|
||||
return String($H);
|
||||
case "HH":
|
||||
return Utils.s($H, 2, "0");
|
||||
case "h":
|
||||
return get$H(1);
|
||||
case "hh":
|
||||
return get$H(2);
|
||||
case "a":
|
||||
return meridiemFunc($H, $m, true);
|
||||
case "A":
|
||||
return meridiemFunc($H, $m, false);
|
||||
case "m":
|
||||
return String($m);
|
||||
case "mm":
|
||||
return Utils.s($m, 2, "0");
|
||||
case "s":
|
||||
return String(_this3.$s);
|
||||
case "ss":
|
||||
return Utils.s(_this3.$s, 2, "0");
|
||||
case "SSS":
|
||||
return Utils.s(_this3.$ms, 3, "0");
|
||||
case "Z":
|
||||
return zoneStr;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
return str.replace(REGEX_FORMAT, function(match, $1) {
|
||||
return $1 || matches(match) || zoneStr.replace(":", "");
|
||||
});
|
||||
};
|
||||
_proto.utcOffset = function utcOffset() {
|
||||
return -Math.round(this.$d.getTimezoneOffset() / 15) * 15;
|
||||
};
|
||||
_proto.diff = function diff(input, units, _float) {
|
||||
var _this4 = this;
|
||||
var unit = Utils.p(units);
|
||||
var that = dayjs(input);
|
||||
var zoneDelta = (that.utcOffset() - this.utcOffset()) * MILLISECONDS_A_MINUTE;
|
||||
var diff2 = this - that;
|
||||
var getMonth = function getMonth2() {
|
||||
return Utils.m(_this4, that);
|
||||
};
|
||||
var result;
|
||||
switch (unit) {
|
||||
case Y:
|
||||
result = getMonth() / 12;
|
||||
break;
|
||||
case M:
|
||||
result = getMonth();
|
||||
break;
|
||||
case Q:
|
||||
result = getMonth() / 3;
|
||||
break;
|
||||
case W:
|
||||
result = (diff2 - zoneDelta) / MILLISECONDS_A_WEEK;
|
||||
break;
|
||||
case D:
|
||||
result = (diff2 - zoneDelta) / MILLISECONDS_A_DAY;
|
||||
break;
|
||||
case H:
|
||||
result = diff2 / MILLISECONDS_A_HOUR;
|
||||
break;
|
||||
case MIN:
|
||||
result = diff2 / MILLISECONDS_A_MINUTE;
|
||||
break;
|
||||
case S:
|
||||
result = diff2 / MILLISECONDS_A_SECOND;
|
||||
break;
|
||||
default:
|
||||
result = diff2;
|
||||
break;
|
||||
}
|
||||
return _float ? result : Utils.a(result);
|
||||
};
|
||||
_proto.daysInMonth = function daysInMonth() {
|
||||
return this.endOf(M).$D;
|
||||
};
|
||||
_proto.$locale = function $locale() {
|
||||
return Ls[this.$L];
|
||||
};
|
||||
_proto.locale = function locale(preset, object) {
|
||||
if (!preset)
|
||||
return this.$L;
|
||||
var that = this.clone();
|
||||
var nextLocaleName = parseLocale(preset, object, true);
|
||||
if (nextLocaleName)
|
||||
that.$L = nextLocaleName;
|
||||
return that;
|
||||
};
|
||||
_proto.clone = function clone() {
|
||||
return Utils.w(this.$d, this);
|
||||
};
|
||||
_proto.toDate = function toDate() {
|
||||
return new Date(this.valueOf());
|
||||
};
|
||||
_proto.toJSON = function toJSON() {
|
||||
return this.isValid() ? this.toISOString() : null;
|
||||
};
|
||||
_proto.toISOString = function toISOString() {
|
||||
return this.$d.toISOString();
|
||||
};
|
||||
_proto.toString = function toString() {
|
||||
return this.$d.toUTCString();
|
||||
};
|
||||
return Dayjs2;
|
||||
}();
|
||||
var proto = Dayjs.prototype;
|
||||
dayjs.prototype = proto;
|
||||
[["$ms", MS], ["$s", S], ["$m", MIN], ["$H", H], ["$W", D], ["$M", M], ["$y", Y], ["$D", DATE]].forEach(function(g) {
|
||||
proto[g[1]] = function(input) {
|
||||
return this.$g(input, g[0], g[1]);
|
||||
};
|
||||
});
|
||||
dayjs.extend = function(plugin, option) {
|
||||
if (!plugin.$i) {
|
||||
plugin(option, Dayjs, dayjs);
|
||||
plugin.$i = true;
|
||||
}
|
||||
return dayjs;
|
||||
};
|
||||
dayjs.locale = parseLocale;
|
||||
dayjs.isDayjs = isDayjs;
|
||||
dayjs.unix = function(timestamp) {
|
||||
return dayjs(timestamp * 1e3);
|
||||
};
|
||||
dayjs.en = Ls[L];
|
||||
dayjs.Ls = Ls;
|
||||
dayjs.p = {};
|
||||
var esm_default = dayjs;
|
||||
export {
|
||||
esm_default as default
|
||||
};
|
||||
//# sourceMappingURL=dayjs_esm_index.js.map
|
||||
7
.vite/deps/dayjs_esm_index.js.map
Normal file
7
.vite/deps/dayjs_esm_index.js.map
Normal file
File diff suppressed because one or more lines are too long
1
.vite/deps/package.json
Normal file
1
.vite/deps/package.json
Normal file
@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
248
App.vue
Normal file
248
App.vue
Normal file
@ -0,0 +1,248 @@
|
||||
<script>
|
||||
import { get, post } from './api/request.js'
|
||||
import { compareVersion } from './utils/index.js'
|
||||
import { getShopInfo } from './components/common.js'
|
||||
import api from "./api/index.js"
|
||||
|
||||
export default {
|
||||
onLaunch: function(options) {
|
||||
// this.authLogin(options.scene, options.query.source || '')
|
||||
getShopInfo()
|
||||
// this.isLogin()
|
||||
// this.judgeLogin()
|
||||
// plus.runtime.quit()
|
||||
},
|
||||
methods: {
|
||||
judgeLogin() {
|
||||
let saveTime = uni.getStorageSync('saveTime')
|
||||
let expires_in = uni.getStorageSync('expires_in')
|
||||
let token = uni.getStorageSync('token')
|
||||
if((saveTime && expires_in && Date.now() > saveTime + expires_in) || !expires_in || !saveTime || !token) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
} else {
|
||||
getShopInfo().then((ress) => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
})
|
||||
this.getMsgNum()
|
||||
}
|
||||
},
|
||||
isLogin() {
|
||||
let val = {
|
||||
data: {
|
||||
access_token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zaG9wLmNodXRhbmc2Ni5jb21cL2FwaVwvdjFcL2F1dGhcL2xvZ2luIiwiaWF0IjoxNzQzOTkwODEyLCJleHAiOjE3NDQwNzcyMTIsIm5iZiI6MTc0Mzk5MDgxMiwianRpIjoiQmY1ZWk4VUF2YXV5VlRibSIsInN1YiI6MTUsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.E-be6v6i7_zFKijrzDhkZ7K5-IWQKsqTIKZ8ntK7oF4',
|
||||
avatar: 'https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/07/13/19DnMNnjGlwKrBlPafc6gtLyrS9aqw3hb5xHYc7q.jpg',
|
||||
crop_user: true,
|
||||
expires_in: 86400,
|
||||
has_sale: true,
|
||||
is_authorized: 1,
|
||||
is_default_avatar: false,
|
||||
is_new: false,
|
||||
is_subscribe: 0,
|
||||
is_vip: false,
|
||||
nickname: "Van",
|
||||
role: 0,
|
||||
token_type: "Bearer"
|
||||
}
|
||||
}
|
||||
let token = val.data.token_type + ' ' + val.data.access_token
|
||||
uni.setStorageSync('token', token)
|
||||
uni.setStorageSync('subscribe', val.data.is_subscribe)
|
||||
uni.setStorageSync('avatar', val.data.avatar)
|
||||
uni.setStorageSync('nickname', val.data.nickname)
|
||||
uni.setStorageSync('role', val.data.role)
|
||||
uni.setStorageSync('is_vip', val.data.is_vip)
|
||||
uni.setStorageSync('is_new', val.data.is_new)
|
||||
uni.setStorageSync('is_authorized', val.data.is_authorized)
|
||||
uni.setStorageSync('is_default_avatar', val.data.is_default_avatar)
|
||||
uni.setStorageSync('sessionKey', val.data.session_key)
|
||||
uni.setStorageSync('has_sale', val.data.has_sale)
|
||||
uni.setStorageSync('saveTime', Date.now()) // 存储时间
|
||||
uni.setStorageSync('expires_in', val.data.expires_in * 1000) // 失效时间
|
||||
getShopInfo()
|
||||
this.getMsgNum()
|
||||
|
||||
// let saveTime = uni.getStorageSync('saveTime')
|
||||
// let expires_in = uni.getStorageSync('expires_in')
|
||||
// if((saveTime && expires_in && Date.now() > saveTime + expires_in) || !expires_in || !saveTime) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/user/login'
|
||||
// })
|
||||
// }
|
||||
},
|
||||
authLogin(scene, source) {
|
||||
console.log('authLogin')
|
||||
const _this = this
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: res => {
|
||||
let { code } = res
|
||||
uni.request({
|
||||
method: 'POST',
|
||||
url: api.url + '/api/v1/auth/login',
|
||||
data: {code, from: 0, source: source},
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || '',
|
||||
accept: "application/json",
|
||||
appid: api.appId
|
||||
},
|
||||
success: (val) => {
|
||||
console.log('wx-login')
|
||||
if(!Array.isArray(val.data)) {
|
||||
let token = val.data.token_type + ' ' + val.data.access_token
|
||||
uni.setStorageSync('token', token)
|
||||
uni.setStorageSync('subscribe', val.data.is_subscribe)
|
||||
uni.setStorageSync('avatar', val.data.avatar)
|
||||
uni.setStorageSync('nickname', val.data.nickname)
|
||||
uni.setStorageSync('role', 0)
|
||||
uni.setStorageSync('login_type', 'mini-app')
|
||||
uni.setStorageSync('is_vip', val.data.is_vip)
|
||||
uni.setStorageSync('is_new', val.data.is_new)
|
||||
uni.setStorageSync('is_authorized', val.data.is_authorized)
|
||||
uni.setStorageSync('is_default_avatar', val.data.is_default_avatar)
|
||||
uni.setStorageSync('sessionKey', val.data.session_key)
|
||||
uni.setStorageSync('has_sale', val.data.has_sale)
|
||||
uni.setStorageSync('saveTime', Date.now()) // 存储时间
|
||||
uni.setStorageSync('expires_in', val.data.expires_in * 1000) // 失效时间
|
||||
uni.setStorageSync('is_crop_user', val.data.crop_user)
|
||||
getShopInfo()
|
||||
// 如果是普通用户-则在onLaunch向后台发送opengid
|
||||
if(val.data.role === 0) {
|
||||
if(!val.data.crop_user) {
|
||||
setTimeout(() => {
|
||||
_this.getUserHome()
|
||||
}, 30000)
|
||||
}
|
||||
}
|
||||
_this.getMsgNum()
|
||||
}
|
||||
_this.$isResolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMsgNum() {
|
||||
get('/api/v1/messages/count').then((res) => {
|
||||
uni.setStorageSync('msgNum', res.data.total)
|
||||
})
|
||||
},
|
||||
getUserHome() {
|
||||
get('/api/v1/user/home').then((res) => {
|
||||
uni.setStorageSync('is_crop_user', res.data.is_crop_user)
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow: function(options) {
|
||||
// #ifdef APP-PLUS
|
||||
uni.hideTabBar()
|
||||
// #endif
|
||||
},
|
||||
onHide: function() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import "@/uni_modules/uview-plus/index.scss";
|
||||
@import url("/static/icon/iconfont.css");
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: $uni-bg-color;
|
||||
overflow: auto;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
font-family: 'Microsoft YaHei';
|
||||
position: static !important;
|
||||
}
|
||||
.tabbar .u-badge{
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: 4px;
|
||||
top: 4px;
|
||||
}
|
||||
uni-view uni-button, button {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
button:after, uni-view uni-button:after{
|
||||
border:none;
|
||||
}
|
||||
.u-icon{
|
||||
display: inline-flex !important;
|
||||
}
|
||||
.u-transition{
|
||||
display: inline-block;
|
||||
}
|
||||
.u-tag-wrapper{
|
||||
display: inline-block;
|
||||
}
|
||||
.u-tag{
|
||||
display: inline-flex;
|
||||
}
|
||||
.u-tag+.u-tag {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.u-tag--mini{
|
||||
height: 18px !important;
|
||||
line-height: 18px !important;
|
||||
margin-right: 4px !important;
|
||||
}
|
||||
.scrollbar::-webkit-scrollbar {
|
||||
width: 12px;
|
||||
height: 4px;
|
||||
color:#ffffff;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*定义滚动条轨道 内阴影+圆角*/
|
||||
.scrollbar::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 6px;
|
||||
background-color:#FFFFFF;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*定义滑块 内阴影+圆角*/
|
||||
.scrollbar::-webkit-scrollbar-thumb {
|
||||
border-radius: 6px;
|
||||
-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
|
||||
background-color: #F14939;
|
||||
display: block;
|
||||
}
|
||||
.kuajing{
|
||||
background: linear-gradient(to bottom , #A500FF, #63009B);
|
||||
color: #fff;
|
||||
font-size: 22rpx;
|
||||
margin-right: 10rpx;
|
||||
display: inline-block;
|
||||
height: 32rpx;
|
||||
vertical-align: middle;
|
||||
width: 100rpx;
|
||||
border-radius: 6rpx;
|
||||
text-align: center;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
.u-button{
|
||||
width: auto !important;
|
||||
}
|
||||
.u-number-box__plus, .u-number-box__minus{
|
||||
width: 25px !important;
|
||||
height: 25px !important;
|
||||
}
|
||||
.u-number-box__plus .u-icon__icon, .u-number-box__minus .u-icon__icon{
|
||||
font-size: 12px !important;
|
||||
}
|
||||
.u-number-box__input{
|
||||
background-color: #fff !important;
|
||||
height: 25px !important;
|
||||
}
|
||||
</style>
|
||||
19
README.md
19
README.md
@ -1,3 +1,16 @@
|
||||
# shop_app
|
||||
|
||||
APP应用
|
||||
## UniApp App端 注意与问题
|
||||
1. 某些dom元素不可包裹在template中,可能不显示
|
||||
2. disabled的元素click事件无效,例如input
|
||||
3. video在APP端存在层级问题,需放到.nvue文件中或使用其他插件
|
||||
4. 系统所使用的video插件仅支持APP端,在小程序运行会报错([地址](https://ext.dcloud.net.cn/plugin?id=11304))
|
||||
5. v-bind在弹窗组件中使用时,需要包裹一层view,否则会无效
|
||||
6. 步进器up-number-box的赋值v-model不可使用逻辑运算符 || &&
|
||||
7. 小程序视频可拖动播放的功能在APP未实现
|
||||
8. 仅打包的apk可以微信登录,基座运行是无效的
|
||||
9. <button open-type="launchApp" :app-parameter="parameter">返回APP</button> parameter需要是String类型,否则在APP无法解析
|
||||
10. get('/api/v1/carts', parmas) cart_ids的参数是字符串类型,和小程序不一样,不知道是什么diao问题
|
||||
11. APP中订阅模板消息和分享需要跳转到小程序进行
|
||||
12. [Android平台隐私与政策提示框](https://uniapp.dcloud.net.cn/tutorial/app-privacy-android.html)
|
||||
13. 在ios中,子组件内的dom元素,有时click事件不生效,需要将dom的宽高设置大一下
|
||||
14. 2024-11-16后的销售页面未更新
|
||||
15. 04-14完成
|
||||
39
androidPrivacy.json
Normal file
39
androidPrivacy.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"version" : "1", // 隐私政策版本号,如果应用升级后希望重新弹出隐私政策提示框,则需要设置新版本
|
||||
"prompt" : "template",
|
||||
"title" : "用户协议和隐私政策",
|
||||
"message" : " 您在使用妙选商城前,请认真阅读并充分理解相关用户条款、平台规则及隐私政策,当您点击同意相关条款,并开始使用产品或服务,即表示您已理解并同意该条款。<br/> 您可阅读<a href=\"static/userAgreement.html\">《用户协议》</a>和<a href=\"static/privacyPolicy.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept" : "同意并接受",
|
||||
"buttonRefuse" : "暂不同意",
|
||||
"hrefLoader" : "default",
|
||||
"backToExit" : "true",
|
||||
"second" : {
|
||||
"title" : "温馨提示",
|
||||
"message" : "",
|
||||
// "message": " 进入应用前,您需先同意<a href=\"\">《用户协议》</a>和<a href=\"\">《隐私政策》</a>,否则将退出应用。", // 为空时,则不弹出二次确认弹窗
|
||||
"buttonAccept" : "同意并继续",
|
||||
"buttonRefuse" : "退出应用"
|
||||
},
|
||||
"disagreeMode" : {
|
||||
"support" : false,
|
||||
"loadNativePlugins" : false,
|
||||
"visitorEntry" : false,
|
||||
"showAlways" : false
|
||||
},
|
||||
"styles" : {
|
||||
"backgroundColor" : "#eee",
|
||||
"borderRadius" : "5px",
|
||||
"title" : {
|
||||
"color" : "#000"
|
||||
},
|
||||
"buttonAccept" : {
|
||||
"color" : "#DFA656"
|
||||
},
|
||||
"buttonRefuse" : {
|
||||
"color" : "#333"
|
||||
},
|
||||
"buttonVisitor" : {
|
||||
"color" : "#00ffff"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
api/index.js
Normal file
19
api/index.js
Normal file
@ -0,0 +1,19 @@
|
||||
const url = 'https://shop.chutang66.com' // 正式
|
||||
// const url = 'https://shop.dev.chutang66.com' // 测试
|
||||
// const url = 'http://warehouse.dev.chutang66.com' // 测试
|
||||
// const url = 'http://192.168.31.70:82' // 本地1
|
||||
// const url = 'http://192.168.30.6:8092' // 本地2
|
||||
const appId = 'wx73163c7bace1750b'
|
||||
const protoId = 'gh_ca74730c9f77'
|
||||
const webUrl = 'http://uniapp.dcloud.io'
|
||||
const name = '妙选商城'
|
||||
const version = '1.0.3'
|
||||
|
||||
export default {
|
||||
url,
|
||||
appId,
|
||||
protoId,
|
||||
webUrl,
|
||||
version,
|
||||
name
|
||||
}
|
||||
177
api/request.js
Normal file
177
api/request.js
Normal file
@ -0,0 +1,177 @@
|
||||
import api from "./index.js"
|
||||
import { showToast } from '../components/common.js'
|
||||
let authToken = ''
|
||||
|
||||
export function toLogin(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let saveTime = uni.getStorageSync('saveTime')
|
||||
let expires_in = uni.getStorageSync('expires_in')
|
||||
let token = uni.getStorageSync('token')
|
||||
|
||||
if(url.indexOf('api/v1') !== -1 && ((saveTime && expires_in && Date.now() > saveTime + expires_in) || !expires_in || !saveTime || !token)) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
|
||||
// if((saveTime && expires_in && Date.now() > saveTime + expires_in) || !expires_in || !saveTime) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/user/login'
|
||||
// })
|
||||
// resolve()
|
||||
// } else {
|
||||
// resolve()
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
export function get (url = '', data = {}, flag = true) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if(!url.includes('/pay/')) {
|
||||
await toLogin(url)
|
||||
}
|
||||
uni.request({
|
||||
url: api.url + url,
|
||||
data: data,
|
||||
method: 'GET',
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || authToken,
|
||||
accept: "application/json",
|
||||
appid: api.appId
|
||||
},
|
||||
success: res => {
|
||||
if (res.statusCode === 200 || res.statusCode === 201) {
|
||||
resolve(res.data)
|
||||
} else if (res.statusCode === 404){
|
||||
showToast(res.data.message || res.data.error)
|
||||
reject(res.data.message || res.data.error)
|
||||
setTimeout(function() {
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 1000)
|
||||
} else if(res.statusCode === 401 && flag) {
|
||||
get(url, data, false)
|
||||
} else if(res.statusCode === 429) {
|
||||
resolve(res.data)
|
||||
showToast('系统繁忙,请稍后重试')
|
||||
} else {
|
||||
let msg = res.data.message || res.data.error
|
||||
if(msg) {
|
||||
if(msg == 'Unauthenticated') {
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('saveTime')
|
||||
uni.removeStorageSync('expires_in')
|
||||
uni.redirectTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
reject(msg)
|
||||
}
|
||||
},
|
||||
fail:(err)=>{
|
||||
console.log('fail', err)
|
||||
},
|
||||
complete: async(complete) => {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getReq (url = '', data = {}, flag = true) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: api.url + url,
|
||||
data: data,
|
||||
method: 'GET',
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || authToken,
|
||||
accept: "application/json",
|
||||
appid: api.appId
|
||||
},
|
||||
success: res => {
|
||||
if (res.statusCode === 200 || res.statusCode === 201) {
|
||||
resolve(res.data)
|
||||
} else if(res.statusCode === 401 && flag) {
|
||||
reject(res.data)
|
||||
getReq(url, data, false)
|
||||
} else if (res.statusCode === 401 && !flag){
|
||||
showToast(res.data.message || res.data.error)
|
||||
resolve(res.data)
|
||||
} else if (res.statusCode === 404){
|
||||
reject(res.data.message)
|
||||
} else if(res.statusCode === 429) {
|
||||
showToast('系统繁忙,请稍后重试')
|
||||
resolve(res.data)
|
||||
} else {
|
||||
let msg = res.data.message || res.data.error
|
||||
if(msg) {
|
||||
if(msg == 'Unauthenticated') {
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('saveTime')
|
||||
uni.removeStorageSync('expires_in')
|
||||
uni.redirectTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
reject(msg)
|
||||
reject(res.data.message || res.data.error)
|
||||
}
|
||||
},
|
||||
fail:(err)=>{
|
||||
|
||||
},
|
||||
complete: async(complete) => {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function post (url = '', data = {}, requestType = 'POST', flag = true) {
|
||||
return new Promise(async(resolve, reject) => {
|
||||
if(!url.includes('order/create') && !url.includes('user/vip')) {
|
||||
await toLogin(url)
|
||||
}
|
||||
uni.request({
|
||||
method: requestType,
|
||||
url: api.url + url,
|
||||
data,
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || authToken,
|
||||
accept: "application/json",
|
||||
appid: api.appId
|
||||
},
|
||||
success: res => {
|
||||
if (res.statusCode === 200 || res.statusCode === 201) {
|
||||
resolve(res.data)
|
||||
} else if (res.statusCode === 404){
|
||||
showToast(res.data.message || res.data.error)
|
||||
reject(res.data.message)
|
||||
} else if(res.statusCode === 401 && flag) {
|
||||
post(url, data, requestType, false)
|
||||
} else if(res.statusCode === 429) {
|
||||
showToast('系统繁忙,请稍后重试')
|
||||
resolve(res.data)
|
||||
} else {
|
||||
let msg = res.data.message || res.data.error
|
||||
if(url.indexOf('decrypt/data') === -1 && msg == 'Unauthenticated') {
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('saveTime')
|
||||
uni.removeStorageSync('expires_in')
|
||||
uni.redirectTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
}
|
||||
reject(msg)
|
||||
}
|
||||
},
|
||||
fail:(err)=>{
|
||||
},
|
||||
complete: async (complete) => {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
533
components/DomVideoPlayer/index.vue
Normal file
533
components/DomVideoPlayer/index.vue
Normal file
@ -0,0 +1,533 @@
|
||||
<!-- eslint-disable -->
|
||||
<template>
|
||||
<view
|
||||
class="player-wrapper"
|
||||
:id="videoWrapperId"
|
||||
:parentId="id"
|
||||
:randomNum="randomNum"
|
||||
:change:randomNum="domVideoPlayer.randomNumChange"
|
||||
:viewportProps="viewportProps"
|
||||
:change:viewportProps="domVideoPlayer.viewportChange"
|
||||
:videoSrc="videoSrc"
|
||||
:change:videoSrc="domVideoPlayer.initVideoPlayer"
|
||||
:command="eventCommand"
|
||||
:change:command="domVideoPlayer.triggerCommand"
|
||||
:func="renderFunc"
|
||||
:change:func="domVideoPlayer.triggerFunc"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
autoplay: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
loop: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
controls: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
objectFit: {
|
||||
type: String,
|
||||
default: 'contain'
|
||||
},
|
||||
muted: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
playbackRate: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
poster: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
randomNum: Math.floor(Math.random() * 100000000),
|
||||
videoSrc: '',
|
||||
// 父组件向子组件传递的事件指令(video的原生事件)
|
||||
eventCommand: null,
|
||||
// 父组件传递过来的,对 renderjs 层的函数执行(对视频控制的自定义事件)
|
||||
renderFunc: {
|
||||
name: null,
|
||||
params: null
|
||||
},
|
||||
// 提供给父组件进行获取的视频属性
|
||||
currentTime: 0,
|
||||
duration: 0,
|
||||
playing: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听视频资源地址更新
|
||||
src: {
|
||||
handler(val) {
|
||||
if (!val) return
|
||||
setTimeout(() => {
|
||||
this.videoSrc = val
|
||||
}, 0)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
videoWrapperId() {
|
||||
return `video-wrapper-${this.randomNum}`
|
||||
},
|
||||
// 聚合视图层的所有数据变化,传给renderjs的渲染层
|
||||
viewportProps() {
|
||||
return {
|
||||
autoplay: this.autoplay,
|
||||
muted: this.muted,
|
||||
controls: this.controls,
|
||||
loop: this.loop,
|
||||
objectFit: this.objectFit,
|
||||
poster: this.poster,
|
||||
isLoading: this.isLoading,
|
||||
playbackRate: this.playbackRate
|
||||
}
|
||||
}
|
||||
},
|
||||
// 方法
|
||||
methods: {
|
||||
// 传递事件指令给父组件
|
||||
eventEmit({ event, data }) {
|
||||
this.$emit(event, data)
|
||||
},
|
||||
// 修改view视图层的data数据
|
||||
setViewData({ key, value }) {
|
||||
key && this.$set(this, key, value)
|
||||
},
|
||||
// 重置事件指令
|
||||
resetEventCommand() {
|
||||
this.eventCommand = null
|
||||
},
|
||||
// 播放指令
|
||||
play() {
|
||||
this.eventCommand = 'play'
|
||||
},
|
||||
// 暂停指令
|
||||
pause() {
|
||||
this.eventCommand = 'pause'
|
||||
},
|
||||
// 重置自定义函数指令
|
||||
resetFunc() {
|
||||
this.renderFunc = {
|
||||
name: null,
|
||||
params: null
|
||||
}
|
||||
},
|
||||
// 自定义函数 - 移除视频
|
||||
remove(params) {
|
||||
this.renderFunc = {
|
||||
name: 'removeHandler',
|
||||
params
|
||||
}
|
||||
},
|
||||
// 自定义函数 - 全屏播放
|
||||
fullScreen(params) {
|
||||
this.renderFunc = {
|
||||
name: 'fullScreenHandler',
|
||||
params
|
||||
}
|
||||
},
|
||||
// 自定义函数 - 跳转到指定时间点
|
||||
toSeek(sec, isDelay = false) {
|
||||
this.renderFunc = {
|
||||
name: 'toSeekHandler',
|
||||
params: { sec, isDelay }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script module="domVideoPlayer" lang="renderjs">
|
||||
const PLAYER_ID = 'DOM_VIDEO_PLAYER'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
num: '',
|
||||
videoEl: null,
|
||||
loadingEl: null,
|
||||
// 延迟生效的函数
|
||||
delayFunc: null,
|
||||
renderProps: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
playerId() {
|
||||
return `${PLAYER_ID}_${this.num}`
|
||||
},
|
||||
wrapperId() {
|
||||
return `video-wrapper-${this.num}`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isApple() {
|
||||
const ua = navigator.userAgent.toLowerCase()
|
||||
return ua.indexOf('iphone') !== -1 || ua.indexOf('ipad') !== -1
|
||||
},
|
||||
async initVideoPlayer(src) {
|
||||
this.delayFunc = null
|
||||
await this.$nextTick()
|
||||
if (!src) return
|
||||
if (this.videoEl) {
|
||||
// 切换视频源
|
||||
if (!this.isApple() && this.loadingEl) {
|
||||
this.loadingEl.style.display = 'block'
|
||||
}
|
||||
this.videoEl.src = src
|
||||
return
|
||||
}
|
||||
|
||||
const videoEl = document.createElement('video')
|
||||
this.videoEl = videoEl
|
||||
// 开始监听视频相关事件
|
||||
this.listenVideoEvent()
|
||||
|
||||
const { autoplay, muted, controls, loop, playbackRate, objectFit, poster } = this.renderProps
|
||||
videoEl.src = src
|
||||
videoEl.autoplay = autoplay
|
||||
videoEl.controls = controls
|
||||
videoEl.loop = loop
|
||||
videoEl.muted = muted
|
||||
videoEl.playbackRate = playbackRate
|
||||
videoEl.id = this.playerId
|
||||
// videoEl.setAttribute('x5-video-player-type', 'h5')
|
||||
videoEl.setAttribute('preload', 'auto')
|
||||
videoEl.setAttribute('playsinline', true)
|
||||
videoEl.setAttribute('webkit-playsinline', true)
|
||||
videoEl.setAttribute('crossorigin', 'anonymous')
|
||||
videoEl.setAttribute('controlslist', 'nodownload')
|
||||
videoEl.setAttribute('disablePictureInPicture', true)
|
||||
videoEl.style.objectFit = objectFit
|
||||
poster && (videoEl.poster = poster)
|
||||
videoEl.style.width = '100%'
|
||||
videoEl.style.height = '100%'
|
||||
|
||||
// 插入视频元素
|
||||
// document.getElementById(this.wrapperId).appendChild(videoEl)
|
||||
const playerWrapper = document.getElementById(this.wrapperId)
|
||||
playerWrapper.insertBefore(videoEl, playerWrapper.firstChild)
|
||||
|
||||
// 插入loading 元素(遮挡安卓的默认加载过程中的黑色播放按钮)
|
||||
this.createLoading()
|
||||
},
|
||||
// 创建 loading
|
||||
createLoading() {
|
||||
const { isLoading } = this.renderProps
|
||||
if (!this.isApple() && isLoading) {
|
||||
const loadingEl = document.createElement('div')
|
||||
this.loadingEl = loadingEl
|
||||
loadingEl.className = 'loading-wrapper'
|
||||
loadingEl.style.position = 'absolute'
|
||||
loadingEl.style.top = '0'
|
||||
loadingEl.style.left = '0'
|
||||
loadingEl.style.zIndex = '1'
|
||||
loadingEl.style.width = '100%'
|
||||
loadingEl.style.height = '100%'
|
||||
loadingEl.style.backgroundColor = 'black'
|
||||
document.getElementById(this.wrapperId).appendChild(loadingEl)
|
||||
|
||||
// 创建 loading 动画
|
||||
const animationEl = document.createElement('div')
|
||||
animationEl.className = 'loading'
|
||||
animationEl.style.zIndex = '2'
|
||||
animationEl.style.position = 'absolute'
|
||||
animationEl.style.top = '50%'
|
||||
animationEl.style.left = '50%'
|
||||
animationEl.style.marginTop = '-15px'
|
||||
animationEl.style.marginLeft = '-15px'
|
||||
animationEl.style.width = '30px'
|
||||
animationEl.style.height = '30px'
|
||||
animationEl.style.border = '2px solid #FFF'
|
||||
animationEl.style.borderTopColor = 'rgba(255, 255, 255, 0.2)'
|
||||
animationEl.style.borderRightColor = 'rgba(255, 255, 255, 0.2)'
|
||||
animationEl.style.borderBottomColor = 'rgba(255, 255, 255, 0.2)'
|
||||
animationEl.style.borderRadius = '100%'
|
||||
animationEl.style.animation = 'circle infinite 0.75s linear'
|
||||
loadingEl.appendChild(animationEl)
|
||||
|
||||
// 创建 loading 动画所需的 keyframes
|
||||
const style = document.createElement('style')
|
||||
const keyframes = `
|
||||
@keyframes circle {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
`
|
||||
style.type = 'text/css'
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = keyframes
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(keyframes))
|
||||
}
|
||||
document.head.appendChild(style)
|
||||
}
|
||||
},
|
||||
// 监听视频相关事件
|
||||
listenVideoEvent() {
|
||||
// 播放事件监听
|
||||
const playHandler = () => {
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'play' })
|
||||
this.$ownerInstance.callMethod('setViewData', {
|
||||
key: 'playing',
|
||||
value: true
|
||||
})
|
||||
|
||||
if (this.loadingEl) {
|
||||
this.loadingEl.style.display = 'none'
|
||||
}
|
||||
}
|
||||
this.videoEl.removeEventListener('play', playHandler)
|
||||
this.videoEl.addEventListener('play', playHandler)
|
||||
|
||||
// 暂停事件监听
|
||||
const pauseHandler = () => {
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'pause' })
|
||||
this.$ownerInstance.callMethod('setViewData', {
|
||||
key: 'playing',
|
||||
value: false
|
||||
})
|
||||
}
|
||||
this.videoEl.removeEventListener('pause', pauseHandler)
|
||||
this.videoEl.addEventListener('pause', pauseHandler)
|
||||
|
||||
// 结束事件监听
|
||||
const endedHandler = () => {
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'ended' })
|
||||
this.$ownerInstance.callMethod('resetEventCommand')
|
||||
}
|
||||
this.videoEl.removeEventListener('ended', endedHandler)
|
||||
this.videoEl.addEventListener('ended', endedHandler)
|
||||
|
||||
// 加载完成事件监听
|
||||
const canPlayHandler = () => {
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'canplay' })
|
||||
this.execDelayFunc()
|
||||
}
|
||||
this.videoEl.removeEventListener('canplay', canPlayHandler)
|
||||
this.videoEl.addEventListener('canplay', canPlayHandler)
|
||||
|
||||
// 加载失败事件监听
|
||||
const errorHandler = (e) => {
|
||||
if (this.loadingEl) {
|
||||
this.loadingEl.style.display = 'block'
|
||||
}
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'error' })
|
||||
}
|
||||
this.videoEl.removeEventListener('error', errorHandler)
|
||||
this.videoEl.addEventListener('error', errorHandler)
|
||||
|
||||
// loadedmetadata 事件监听
|
||||
const loadedMetadataHandler = () => {
|
||||
this.$ownerInstance.callMethod('eventEmit', { event: 'loadedmetadata' })
|
||||
// 获取视频的长度
|
||||
const duration = this.videoEl.duration
|
||||
this.$ownerInstance.callMethod('eventEmit', {
|
||||
event: 'durationchange',
|
||||
data: duration
|
||||
})
|
||||
|
||||
this.$ownerInstance.callMethod('setViewData', {
|
||||
key: 'duration',
|
||||
value: duration
|
||||
})
|
||||
|
||||
// 加载首帧视频 模拟出封面图
|
||||
this.loadFirstFrame()
|
||||
}
|
||||
this.videoEl.removeEventListener('loadedmetadata', loadedMetadataHandler)
|
||||
this.videoEl.addEventListener('loadedmetadata', loadedMetadataHandler)
|
||||
|
||||
// 播放进度监听
|
||||
const timeupdateHandler = (e) => {
|
||||
const currentTime = e.target.currentTime
|
||||
this.$ownerInstance.callMethod('eventEmit', {
|
||||
event: 'timeupdate',
|
||||
data: currentTime
|
||||
})
|
||||
|
||||
this.$ownerInstance.callMethod('setViewData', {
|
||||
key: 'currentTime',
|
||||
value: currentTime
|
||||
})
|
||||
|
||||
}
|
||||
this.videoEl.removeEventListener('timeupdate', timeupdateHandler)
|
||||
this.videoEl.addEventListener('timeupdate', timeupdateHandler)
|
||||
|
||||
// 倍速播放监听
|
||||
const ratechangeHandler = (e) => {
|
||||
const playbackRate = e.target.playbackRate
|
||||
this.$ownerInstance.callMethod('eventEmit', {
|
||||
event: 'ratechange',
|
||||
data: playbackRate
|
||||
})
|
||||
}
|
||||
this.videoEl.removeEventListener('ratechange', ratechangeHandler)
|
||||
this.videoEl.addEventListener('ratechange', ratechangeHandler)
|
||||
|
||||
// 全屏事件监听
|
||||
if (this.isApple()) {
|
||||
const webkitbeginfullscreenHandler = () => {
|
||||
const presentationMode = this.videoEl.webkitPresentationMode
|
||||
let isFullScreen = null
|
||||
if (presentationMode === 'fullscreen') {
|
||||
isFullScreen = true
|
||||
} else {
|
||||
isFullScreen = false
|
||||
}
|
||||
this.$ownerInstance.callMethod('eventEmit', {
|
||||
event: 'fullscreenchange',
|
||||
data: isFullScreen
|
||||
})
|
||||
}
|
||||
this.videoEl.removeEventListener('webkitpresentationmodechanged', webkitbeginfullscreenHandler)
|
||||
this.videoEl.addEventListener('webkitpresentationmodechanged', webkitbeginfullscreenHandler)
|
||||
} else {
|
||||
const fullscreenchangeHandler = () => {
|
||||
let isFullScreen = null
|
||||
if (document.fullscreenElement) {
|
||||
isFullScreen = true
|
||||
} else {
|
||||
isFullScreen = false
|
||||
}
|
||||
this.$ownerInstance.callMethod('eventEmit', {
|
||||
event: 'fullscreenchange',
|
||||
data: isFullScreen
|
||||
})
|
||||
}
|
||||
document.removeEventListener('fullscreenchange', fullscreenchangeHandler)
|
||||
document.addEventListener('fullscreenchange', fullscreenchangeHandler)
|
||||
}
|
||||
},
|
||||
// 加载首帧视频,模拟出封面图
|
||||
loadFirstFrame() {
|
||||
let { autoplay, muted } = this.renderProps
|
||||
if (this.isApple()) {
|
||||
this.videoEl.play()
|
||||
if (!autoplay) {
|
||||
this.videoEl.pause()
|
||||
}
|
||||
} else {
|
||||
// optimize: timeout 延迟调用是为了规避控制台的`https://goo.gl/LdLk22`这个报错
|
||||
/**
|
||||
* 原因:chromium 内核中,谷歌协议规定,视频不允许在非静音状态下进行自动播放
|
||||
* 解决:在自动播放时,先将视频静音,然后延迟调用 play 方法,播放视频
|
||||
* 说明:iOS 的 Safari 内核不会有这个,仅在 Android 设备出现,即使有这个报错也不影响的,所以不介意控制台报错的话是可以删掉这个 timeout 的
|
||||
*/
|
||||
this.videoEl.muted = true
|
||||
setTimeout(() => {
|
||||
this.videoEl.play()
|
||||
this.videoEl.muted = muted
|
||||
if (!autoplay) {
|
||||
setTimeout(() => {
|
||||
this.videoEl.pause()
|
||||
}, 100)
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
},
|
||||
triggerCommand(eventType) {
|
||||
if (eventType) {
|
||||
this.$ownerInstance.callMethod('resetEventCommand')
|
||||
this.videoEl && this.videoEl[eventType]()
|
||||
}
|
||||
},
|
||||
triggerFunc(func) {
|
||||
const { name, params } = func || {}
|
||||
if (name) {
|
||||
this[name](params)
|
||||
this.$ownerInstance.callMethod('resetFunc')
|
||||
}
|
||||
},
|
||||
removeHandler() {
|
||||
if (this.videoEl) {
|
||||
this.videoEl.pause()
|
||||
this.videoEl.src = ''
|
||||
this.$ownerInstance.callMethod('setViewData', {
|
||||
key: 'videoSrc',
|
||||
value: ''
|
||||
})
|
||||
this.videoEl.load()
|
||||
}
|
||||
},
|
||||
fullScreenHandler() {
|
||||
if (this.isApple()) {
|
||||
this.videoEl.webkitEnterFullscreen()
|
||||
} else {
|
||||
this.videoEl.requestFullscreen()
|
||||
}
|
||||
},
|
||||
toSeekHandler({ sec, isDelay }) {
|
||||
const func = () => {
|
||||
if (this.videoEl) {
|
||||
this.videoEl.currentTime = sec
|
||||
}
|
||||
}
|
||||
|
||||
// 延迟执行
|
||||
if (isDelay) {
|
||||
this.delayFunc = func
|
||||
} else {
|
||||
func()
|
||||
}
|
||||
},
|
||||
// 执行延迟函数
|
||||
execDelayFunc() {
|
||||
this.delayFunc && this.delayFunc()
|
||||
this.delayFunc = null
|
||||
},
|
||||
viewportChange(props) {
|
||||
this.renderProps = props
|
||||
const { autoplay, muted, controls, loop, playbackRate } = props
|
||||
if (this.videoEl) {
|
||||
this.videoEl.autoplay = autoplay
|
||||
this.videoEl.controls = controls
|
||||
this.videoEl.loop = loop
|
||||
this.videoEl.muted = muted
|
||||
this.videoEl.playbackRate = playbackRate
|
||||
}
|
||||
},
|
||||
randomNumChange(val) {
|
||||
this.num = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.player-wrapper {
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
512
components/Popover/index.vue
Normal file
512
components/Popover/index.vue
Normal file
@ -0,0 +1,512 @@
|
||||
<template>
|
||||
<view class="Popover" :style="{'--theme-bg-color':bgStyleColor}">
|
||||
<view class="mark" @click="close()" v-show="inited"></view>
|
||||
<view @click.stop="handleClick" class="zb-button-popover">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view class="zb-popover" v-show="inited" ref="zb-transition" :class="[classes,`zb-popover-${placement}`]"
|
||||
:style="[mergeStyle]" @touchmove="noop">
|
||||
<view class="zb-popover-arrow" :style="[arrowStyle]" :class="[{
|
||||
'zb_popper__up':placement.indexOf('bottom')===0,
|
||||
'zb_popper__arrow':placement.indexOf('top')===0,
|
||||
'zb_popper__right':placement.indexOf('right')===0,
|
||||
'zb_popper__left':placement.indexOf('left')===0,
|
||||
}]">
|
||||
</view>
|
||||
<slot name="content">
|
||||
<view :class="[{'horizontal__action':actionsDirection==='horizontal'}]">
|
||||
<view @click.stop="actionAction(item)" v-for="item,index in options" class="zb-popover__action"
|
||||
:class="[{'dark__action':theme==='dark'}]" :key="index">
|
||||
<up-icon :name="item.icon" size="18" color="#333" />
|
||||
<view class="zb-popover__action-text">{{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const tranClass = {
|
||||
enter: "zb-fade-zoom-enter zb-fade-zoom-enter-active",
|
||||
'enter-to': "zb-fade-zoom-enter-to zb-fade-zoom-enter-active",
|
||||
leave: "zb-fade-zoom-leave zb-fade-zoom-leave-active",
|
||||
'leave-to': "zb-fade-zoom-leave-to zb-fade-zoom-leave-active",
|
||||
}
|
||||
export default {
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
placement: {
|
||||
type: String,
|
||||
default: 'bottom-start'
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
|
||||
},
|
||||
// light dark
|
||||
theme: {
|
||||
type: String,
|
||||
default: 'light'
|
||||
},
|
||||
// horizontal vertical
|
||||
actionsDirection: {
|
||||
type: String,
|
||||
default: 'vertical'
|
||||
}
|
||||
},
|
||||
name: "Popover",
|
||||
watch: {
|
||||
show: {
|
||||
handler(newVal) {
|
||||
newVal ? this.vueEnter() : this.vueLeave()
|
||||
},
|
||||
// 表示同时监听初始化时的props的show的意思
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
inited: false, // 是否显示/隐藏组件
|
||||
classes: '', // 应用的类名
|
||||
display: false, // 组件是否展示
|
||||
duration: 100,
|
||||
popoverStyle: {
|
||||
|
||||
},
|
||||
arrowOldStyle: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
bgStyleColor() {
|
||||
if (this.bgColor) {
|
||||
return this.bgColor
|
||||
}
|
||||
if (this.theme === 'light') {
|
||||
return 'white'
|
||||
}
|
||||
if (this.theme === 'dark') {
|
||||
return '#4a4a4a'
|
||||
}
|
||||
},
|
||||
|
||||
mergeStyle() {
|
||||
return {
|
||||
transitionDuration: `${this.duration}ms`,
|
||||
transitionTimingFunction: `ease-out`,
|
||||
...this.popoverStyle
|
||||
}
|
||||
},
|
||||
arrowStyle() {
|
||||
return {
|
||||
...this.arrowOldStyle
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// window.addEventListener('click', () => {
|
||||
// this.show = false
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
if (this.show) {
|
||||
this.show = false
|
||||
} else {
|
||||
this.show = true
|
||||
}
|
||||
this.$emit('handleClick', this.show)
|
||||
},
|
||||
close() {
|
||||
this.show = false
|
||||
},
|
||||
actionAction(item) {
|
||||
this.$emit('select', item)
|
||||
this.show = false
|
||||
},
|
||||
sleep(value) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, value)
|
||||
})
|
||||
},
|
||||
vueEnter() {
|
||||
this.inited = true
|
||||
this.getPosition()
|
||||
this.classes = tranClass.enter
|
||||
this.$nextTick(async () => {
|
||||
await this.sleep(30)
|
||||
this.classes = tranClass['enter-to']
|
||||
|
||||
})
|
||||
},
|
||||
vueLeave() {
|
||||
this.classes = tranClass.leave
|
||||
|
||||
this.$nextTick(async () => {
|
||||
this.classes = tranClass['leave-to']
|
||||
await this.sleep(120)
|
||||
this.inited = false
|
||||
})
|
||||
},
|
||||
// 阻止事件冒泡
|
||||
preventEvent(e) {
|
||||
e && typeof(e.stopPropagation) === 'function' && e.stopPropagation()
|
||||
},
|
||||
|
||||
getPosition() {
|
||||
return new Promise((resolve) => {
|
||||
this.$nextTick(() => {
|
||||
let selectorQuery = uni.createSelectorQuery().in(this).selectAll(
|
||||
'.zb-button-popover,.zb-popover')
|
||||
selectorQuery.boundingClientRect(async (data) => {
|
||||
let {
|
||||
left,
|
||||
bottom,
|
||||
right,
|
||||
top,
|
||||
width,
|
||||
height
|
||||
} = data[0]
|
||||
let popoverClientRect = data[1]
|
||||
let popoverStyle = {}
|
||||
let arrowOldStyle = {}
|
||||
|
||||
switch (this.placement) {
|
||||
case 'top':
|
||||
if (popoverClientRect.width > width) {
|
||||
popoverStyle.left =
|
||||
`-${(popoverClientRect.width - width)/2}px`
|
||||
} else {
|
||||
popoverStyle.left =
|
||||
`${Math.abs(popoverClientRect.width - width)/2}px`
|
||||
}
|
||||
popoverStyle.bottom = `${height+8}px`
|
||||
arrowOldStyle.left = (popoverClientRect.width / 2 - 6) +
|
||||
'px'
|
||||
break;
|
||||
case 'top-start':
|
||||
popoverStyle.left = `0px`
|
||||
popoverStyle.bottom = `${height+8}px`
|
||||
arrowOldStyle.left = '16px'
|
||||
break;
|
||||
case 'top-end':
|
||||
popoverStyle.right = `0px`
|
||||
popoverStyle.bottom = `${height+8}px`
|
||||
arrowOldStyle.right = '16px'
|
||||
break;
|
||||
case 'bottom':
|
||||
if (popoverClientRect.width > width) {
|
||||
popoverStyle.left =
|
||||
`-${(popoverClientRect.width - width)/2}px`
|
||||
} else {
|
||||
popoverStyle.left =
|
||||
`${Math.abs(popoverClientRect.width - width)/2}px`
|
||||
}
|
||||
popoverStyle.top = `${height+8}px`
|
||||
arrowOldStyle.left = (popoverClientRect.width / 2 - 6) +
|
||||
'px'
|
||||
break;
|
||||
case 'bottom-start':
|
||||
popoverStyle.top = `${height+8}px`
|
||||
popoverStyle.left = `0px`
|
||||
arrowOldStyle.left = '16px'
|
||||
break;
|
||||
case 'bottom-end':
|
||||
popoverStyle.top = `${height+8}px`
|
||||
popoverStyle.right = `0px`
|
||||
arrowOldStyle.right = '16px'
|
||||
break;
|
||||
case 'right':
|
||||
popoverStyle.left = `${width+8}px`
|
||||
if (popoverClientRect.height > height) {
|
||||
popoverStyle.top =
|
||||
`-${(popoverClientRect.height - height)/2}px`
|
||||
} else {
|
||||
popoverStyle.top =
|
||||
`${Math.abs((popoverClientRect.height - height)/2)}px`
|
||||
}
|
||||
arrowOldStyle.top = `${popoverClientRect.height/2-6}px`
|
||||
break;
|
||||
case 'right-start':
|
||||
popoverStyle.left = `${width+8}px`
|
||||
popoverStyle.top = `0px`
|
||||
arrowOldStyle.top = `8px`
|
||||
break;
|
||||
case 'right-end':
|
||||
popoverStyle.left = `${width+8}px`
|
||||
popoverStyle.bottom = `0px`
|
||||
arrowOldStyle.bottom = `8px`
|
||||
break;
|
||||
case 'left':
|
||||
popoverStyle.right = `${width+8}px`
|
||||
if (popoverClientRect.height > height) {
|
||||
popoverStyle.top =
|
||||
`-${(popoverClientRect.height - height)/2}px`
|
||||
} else {
|
||||
popoverStyle.top =
|
||||
`${Math.abs((popoverClientRect.height - height)/2)}px`
|
||||
}
|
||||
arrowOldStyle.top = `${popoverClientRect.height/2-6}px`
|
||||
break;
|
||||
case 'left-start':
|
||||
popoverStyle.right = `${width+8}px`
|
||||
popoverStyle.top = `0px`
|
||||
arrowOldStyle.top = `8px`
|
||||
break;
|
||||
|
||||
case 'left-end':
|
||||
popoverStyle.right = `${width+8}px`
|
||||
popoverStyle.bottom = `0px`
|
||||
arrowOldStyle.bottom = `8px`
|
||||
break;
|
||||
}
|
||||
|
||||
this.popoverStyle = popoverStyle
|
||||
this.arrowOldStyle = arrowOldStyle
|
||||
resolve()
|
||||
}).exec()
|
||||
})
|
||||
})
|
||||
},
|
||||
// 空操作
|
||||
noop(e) {
|
||||
this.preventEvent(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mark { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 1; background-color: rgba(0, 0, 0, 0.4); }
|
||||
$theme-bg-color: var(--theme-bg-color);
|
||||
|
||||
.Popover {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.zb-button-popover {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.zb-popover {
|
||||
border-radius: 8px;
|
||||
z-index: 2144;
|
||||
position: absolute;
|
||||
background-color: $theme-bg-color;
|
||||
box-shadow: 0 2px 12px #3232331f;
|
||||
|
||||
}
|
||||
|
||||
.zb-popover-top {
|
||||
transform-origin: 50% bottom;
|
||||
}
|
||||
|
||||
.zb-popover-top-start {
|
||||
transform-origin: 50% bottom;
|
||||
}
|
||||
|
||||
.zb-popover-top-end {
|
||||
transform-origin: 0 bottom;
|
||||
}
|
||||
|
||||
.zb-popover-bottom {
|
||||
transform-origin: 50% 0;
|
||||
}
|
||||
|
||||
.zb-popover-bottom-end {
|
||||
transform-origin: 100% 0;
|
||||
}
|
||||
|
||||
.zb-popover-bottom-start {
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
|
||||
.zb-popover-right {
|
||||
transform-origin: left 50%;
|
||||
}
|
||||
|
||||
.zb-popover-right-start {
|
||||
transform-origin: left 0;
|
||||
}
|
||||
|
||||
.zb-popover-right-end {
|
||||
transform-origin: left 100%;
|
||||
}
|
||||
|
||||
.zb-popover-left {
|
||||
transform-origin: right 50%;
|
||||
}
|
||||
|
||||
.zb-popover-left-start {
|
||||
transform-origin: right 0;
|
||||
}
|
||||
|
||||
.zb-popover-left-end {
|
||||
transform-origin: right 100%;
|
||||
}
|
||||
|
||||
.zb-popover-arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px;
|
||||
color: $theme-bg-color;
|
||||
}
|
||||
|
||||
.zb_popper__up {
|
||||
border-top-width: 0;
|
||||
border-bottom-color: currentColor;
|
||||
top: -6px;
|
||||
}
|
||||
|
||||
.zb_popper__right {
|
||||
border-left-width: 0;
|
||||
border-right-color: currentColor;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.zb_popper__left {
|
||||
border-right-width: 0;
|
||||
border-left-color: currentColor;
|
||||
right: -5px;
|
||||
}
|
||||
|
||||
.zb_popper__arrow {
|
||||
border-bottom-width: 0;
|
||||
border-top-color: currentColor;
|
||||
bottom: -6px;
|
||||
}
|
||||
|
||||
.zb-popover__action {
|
||||
position: relative;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
height: 88rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.zb-popover__action-text {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
padding: 0 24rpx;
|
||||
border-bottom: 1rpx solid #ebedf0;
|
||||
word-wrap: break-word;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.zb-popover__action:last-child {
|
||||
.zb-popover__action-text {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dark__action {
|
||||
color: white;
|
||||
|
||||
.zb-popover__action-text {
|
||||
border-bottom: 1rpx solid #ebedf033
|
||||
}
|
||||
}
|
||||
|
||||
.horizontal__action {
|
||||
display: flex;
|
||||
|
||||
.zb-popover__action {
|
||||
padding: 0 20rpx;
|
||||
border-right: 1rpx solid #ebedf0;
|
||||
}
|
||||
|
||||
.zb-popover__action-text {
|
||||
padding: 0;
|
||||
//border-right:1rpx solid #ebedf0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$u-zoom-scale: scale(0.95);
|
||||
|
||||
.zb-fade-enter-active,
|
||||
.zb-fade-leave-active {
|
||||
transition-property: opacity;
|
||||
}
|
||||
|
||||
.zb-fade-enter,
|
||||
.zb-fade-leave-to {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.zb-fade-zoom-enter,
|
||||
.zb-fade-zoom-leave-to {
|
||||
transform: $u-zoom-scale;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.zb-fade-zoom-enter-active,
|
||||
.zb-fade-zoom-leave-active {
|
||||
transition-property: transform, opacity;
|
||||
}
|
||||
|
||||
.zb-fade-down-enter-active,
|
||||
.zb-fade-down-leave-active,
|
||||
.zb-fade-left-enter-active,
|
||||
.zb-fade-left-leave-active,
|
||||
.zb-fade-right-enter-active,
|
||||
.zb-fade-right-leave-active,
|
||||
.zb-fade-up-enter-active,
|
||||
.zb-fade-up-leave-active {
|
||||
transition-property: opacity, transform;
|
||||
}
|
||||
|
||||
.zb-fade-up-enter,
|
||||
.zb-fade-up-leave-to {
|
||||
transform: translate3d(0, 100%, 0);
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.zb-fade-down-enter,
|
||||
.zb-fade-down-leave-to {
|
||||
transform: translate3d(0, -100%, 0);
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.zb-fade-left-enter,
|
||||
.zb-fade-left-leave-to {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.zb-fade-right-enter,
|
||||
.zb-fade-right-leave-to {
|
||||
transform: translate3d(100%, 0, 0);
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
|
||||
.zb-popover__action {
|
||||
&:active {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
color: var(--van-popover-dark-action-disabled-text-color);
|
||||
|
||||
&:active {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
12046
components/areaList.js
Normal file
12046
components/areaList.js
Normal file
File diff suppressed because it is too large
Load Diff
200
components/buy/BuySuccess.vue
Normal file
200
components/buy/BuySuccess.vue
Normal file
@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<!-- 购买成功弹窗 -->
|
||||
<view>
|
||||
<up-popup :show="showBuy" :customStyle="customStyle" closeable @close="close" catchtouchmove="preventD" :close-on-click-overlay="false" mode="center">
|
||||
<view class="buy">
|
||||
<up-icon name="checkmark-circle-fill" size="60" :color="Color" />
|
||||
<view class="title">恭喜购买成功</view>
|
||||
<view class="user">
|
||||
<image :src="avatar"></image>
|
||||
<text>{{nickname}}</text>
|
||||
</view>
|
||||
<view class="text">转发到群聊,通知团长你已下单,尽快发货</view>
|
||||
<view class="label">
|
||||
<button @click="shareOrder" class="btn">分享到群聊</button>
|
||||
<text v-if="score_on && role && !from" class="text1">积分再+{{score_trade_share}}</text>
|
||||
</view>
|
||||
<view class="box" v-if="score_on && role && !from && !link_id">
|
||||
<view class="left">
|
||||
<image src="../../static/image/gift.png" mode="widthFix" class="img"></image>
|
||||
<view class="">
|
||||
<view class="tit">积分商城 <text class="text1">+{{score_trade * pay_price}}</text></view>
|
||||
<view class="tit">累计积分兑换奖品</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="to" @click="toScoreShop">去兑换</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
export default {
|
||||
props: {
|
||||
showBuy: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
payPrice: {
|
||||
type: String
|
||||
},
|
||||
from: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
nickname: uni.getStorageSync('nickname'),
|
||||
avatar: uni.getStorageSync('avatar'),
|
||||
role: Number(uni.getStorageSync('role')) !== 1,
|
||||
score_trade_share: Number(uni.getStorageSync('score_trade_share')),
|
||||
score_on: Number(uni.getStorageSync('score_on')) === 1,
|
||||
score_trade: Number(uni.getStorageSync('score_trade')),
|
||||
pay_price: 0,
|
||||
from: 0,
|
||||
link_id: 0,
|
||||
customStyle: {
|
||||
width: '86%',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
Color: uni.getStorageSync('theme_color')
|
||||
})
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
function preventD() {
|
||||
return
|
||||
}
|
||||
|
||||
function toScoreShop() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/scoreShop/index'
|
||||
})
|
||||
}
|
||||
|
||||
function shareOrder() {
|
||||
context.emit('share')
|
||||
close()
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if(newProps.showBuy) {
|
||||
data.nickname = uni.getStorageSync('nickname')
|
||||
data.avatar = uni.getStorageSync('avatar')
|
||||
data.pay_price = newProps.payPrice * 1
|
||||
data.from = newProps.from
|
||||
data.link_id = (newProps.link_id || 0) * 1
|
||||
}
|
||||
})
|
||||
return {
|
||||
...toRefs(data),
|
||||
close,
|
||||
preventD,
|
||||
toScoreShop,
|
||||
shareOrder
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.buy {
|
||||
text-align: center;
|
||||
padding: 60rpx 0;
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
color: v-bind('Color');
|
||||
margin-top: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
image {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
background: #98989f;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
color: #666666;
|
||||
font-size: 26rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.label{
|
||||
position: relative;
|
||||
margin: 36rpx auto 0;
|
||||
width: 88%;
|
||||
.text1{
|
||||
border-radius: 20rpx 20rpx 20rpx 0;
|
||||
border: 1px solid #fff;
|
||||
background-color: v-bind('Color');
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
padding: 6rpx 10rpx;
|
||||
position: absolute;
|
||||
top: -26rpx;
|
||||
left: 64%;
|
||||
}
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
background: v-bind('Color');
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.box{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx;
|
||||
width: 88%;
|
||||
margin: 30rpx auto 0;
|
||||
background: #F9F6E5;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
.left{
|
||||
width: calc(100% - 160rpx);
|
||||
display: flex;
|
||||
.img{
|
||||
width: 90rpx;
|
||||
}
|
||||
.tit{
|
||||
font-size: 28rpx;
|
||||
color: #744928;
|
||||
padding-left: 10rpx;
|
||||
text-align: left;
|
||||
.text1{
|
||||
color: v-bind('Color');
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
.to{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 50rpx;
|
||||
width: 140rpx;
|
||||
border-radius: 50rpx;
|
||||
background: v-bind('Color');
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
224
components/callCenter/index.vue
Normal file
224
components/callCenter/index.vue
Normal file
@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<!-- 客服 -->
|
||||
<view>
|
||||
<up-overlay :show="showService" :zIndex="999">
|
||||
<view class="serviceBox">
|
||||
<view class="block" @click.stop="preventD()">
|
||||
<!-- <image v-if="qrCodeBg" :src="qrCodeBg + '?x-oss-process=image/format,webp'" :webp="true" mode="widthFix" class="img" /> -->
|
||||
<image src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2022/11/07/tqVXV68gUSoUl5iOfRI72IvrdRHtcmZLb0ztnCa4.png?x-oss-process=image/format,webp" mode="widthFix" class="img" :webp="true" />
|
||||
<view class="openbox">
|
||||
<image :src="qrCodeImg" :webp="true" mode="widthFix" @longpress="toShare(qrCodeImg)" class="image"/>
|
||||
<view class="btn">
|
||||
<view class="icon" :style="{backgroundImage: 'url(' + sp2 + ')'}"></view>
|
||||
<text>长按图片分享到微信</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox">
|
||||
<view class="btn on" @click="close()">关闭</view>
|
||||
<view class="btn" @click="toPage">我要投诉</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
|
||||
<!-- <up-modal
|
||||
:show="showService"
|
||||
:showCancelButton="true"
|
||||
@confirm="toMiniProgram"
|
||||
@cancel="showService = false"
|
||||
:confirmColor="Color">
|
||||
<text>将跳转到小程序</text>
|
||||
</up-modal> -->
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { get } from '@/api/request.js'
|
||||
import { sp2 } from '@/components/img.js'
|
||||
import { func } from '../../uni_modules/uview-plus/libs/function/test'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
orderId: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
sp2: sp2,
|
||||
qrCodeBg: '',
|
||||
qrCodeImg: '',
|
||||
showService: false,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
orderId: 0,
|
||||
sweixin: null
|
||||
})
|
||||
|
||||
function getPlus() {
|
||||
var pages = getCurrentPages()
|
||||
var page = pages[pages.length - 1]
|
||||
var shares = null
|
||||
var pusher = plus.share.getServices(function(s){
|
||||
shares = {}
|
||||
for(var i in s){
|
||||
var t = s[i]
|
||||
shares[t.id] = t
|
||||
}
|
||||
data.sweixin = shares['weixin']
|
||||
}, function(e) {
|
||||
console.log("获取分享服务列表失败:" + e.message)
|
||||
})
|
||||
}
|
||||
|
||||
const toMiniProgram = () => {
|
||||
data.sweixin.launchMiniProgram({
|
||||
id: 'gh_ca74730c9f77',
|
||||
path: 'pages/user/index?type=kefu'
|
||||
})
|
||||
data.showService = false
|
||||
}
|
||||
|
||||
async function getQrCodeImg(type, orderId) {
|
||||
let url = `/api/v1/orderRefund/qrCode/${orderId}`
|
||||
if(type == 1) {
|
||||
url = '/api/v1/user/qrCode'
|
||||
}
|
||||
await get(url).then((res) => {
|
||||
data.qrCodeImg = res.data.qr_code
|
||||
data.qrCodeBg = res.data.service_background_img
|
||||
})
|
||||
}
|
||||
|
||||
const preventD = () => {
|
||||
return
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
function toPage() {
|
||||
close()
|
||||
uni.navigateTo({url: '/pages/mine/msg/select?order_id=' + data.orderId})
|
||||
}
|
||||
|
||||
function toShare(img) {
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: "WXSceneSession",
|
||||
type: 2,
|
||||
imageUrl: img,
|
||||
success: function (res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log("fail:" + JSON.stringify(err));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
if (newProps.show) {
|
||||
await getQrCodeImg(newProps.type, newProps.orderId)
|
||||
data.showService = true
|
||||
data.orderId = newProps.orderId || 0
|
||||
// getPlus()
|
||||
} else {
|
||||
data.showService = false
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getQrCodeImg,
|
||||
preventD,
|
||||
close,
|
||||
toPage,
|
||||
getPlus,
|
||||
toMiniProgram,
|
||||
toShare
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.serviceBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
padding-top: 80rpx;
|
||||
box-sizing: border-box;
|
||||
.block{
|
||||
width: 90%;
|
||||
padding: 0 0 100rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
.img{
|
||||
width: 100%;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
}
|
||||
.openbox{
|
||||
margin: 60rpx auto;
|
||||
width: 400rpx;
|
||||
.image{
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
.btn{
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
background: v-bind('Color');
|
||||
border-radius: 0 0 16rpx 16rpx;
|
||||
.icon{
|
||||
width: 22.5px;
|
||||
height: 22.5px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 678px 612px;
|
||||
background-position: -357px -286.5px;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btnBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
.btn{
|
||||
color: v-bind('Color');
|
||||
font-size: 28rpx;
|
||||
width: 44%;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid v-bind('Color');
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
&.on{
|
||||
background: v-bind('Color');
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
71
components/cfCloud/index.vue
Normal file
71
components/cfCloud/index.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<!-- 技术支持 -->
|
||||
<view class="cloudbox" v-if="technical_support">
|
||||
<view class="tit">
|
||||
<view class="tu" :style="{backgroundImage: 'url(' + sp2 + ')'}"></view>
|
||||
<text>{{technical_support_title}}提供技术支持</text>
|
||||
<view class="tu" :style="{backgroundImage: 'url(' + sp2 + ')'}"></view>
|
||||
</view>
|
||||
<view class="more" @click="toPage">了解更多<up-icon color="#fff" size="10" name="arrow-right" /></view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { sp2 } from '@/components/img.js'
|
||||
|
||||
export default {
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
sp2: sp2,
|
||||
technical_support: uni.getStorageSync('technical_support') || 0,
|
||||
technical_support_title: uni.getStorageSync('technical_support_title')
|
||||
})
|
||||
|
||||
const toPage = () => {
|
||||
uni.navigateTo({ url: '/pages/mine/aboutUs/join' })
|
||||
}
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
toPage
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cloudbox{
|
||||
text-align: center;
|
||||
padding: 30rpx 0;
|
||||
.tit{
|
||||
font-size: 22rpx;
|
||||
color: #A1A1A1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.tu{
|
||||
background-repeat: no-repeat;
|
||||
background-size: 339px 306px;
|
||||
background-position: -218.5px -105px;
|
||||
height: 8.25px;
|
||||
width: 15.5px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
.more{
|
||||
padding: 2px 4px 2px 7px;
|
||||
font-size: 20rpx;
|
||||
background-color: #A1A1A1;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1053
components/common.js
Normal file
1053
components/common.js
Normal file
File diff suppressed because it is too large
Load Diff
122
components/giftsVip/index.vue
Normal file
122
components/giftsVip/index.vue
Normal file
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<up-overlay :show="showGifts" :zIndex="9999">
|
||||
<view class="serviceBox">
|
||||
<view class="block">
|
||||
<view class="title">恭喜您获得</view>
|
||||
<view class="openbox">
|
||||
<image src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2022/11/08/l5SAwF75s4IQ5tglcLQo5bUlfixoFtnODw5CH4hT.png" mode="widthFix" class="image" />
|
||||
<view class="coupon">
|
||||
<view class="coupon-left">{{info.days}}天</view>
|
||||
<view class="coupon-right">会员权益</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @click="getHandle()">立即领取</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { showToast } from '../common.js'
|
||||
export default {
|
||||
props: {
|
||||
showGifts: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
info: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
|
||||
})
|
||||
|
||||
function getHandle() {
|
||||
showToast('领取成功')
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getHandle
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.serviceBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
padding-bottom: 80rpx;
|
||||
box-sizing: border-box;
|
||||
.block{
|
||||
width: 80%;
|
||||
background: #fff;
|
||||
padding-bottom: 80rpx;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
.title{
|
||||
padding: 40rpx 0;
|
||||
color: #333;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.openbox{
|
||||
margin: 0 auto;
|
||||
width: 86%;
|
||||
position: relative;
|
||||
.image{
|
||||
width: 100%;
|
||||
}
|
||||
.coupon{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
color: #F14939;
|
||||
.coupon-left {
|
||||
width: 36%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.coupon-right {
|
||||
width: 64%;
|
||||
padding-left: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
margin: 40rpx auto 0;
|
||||
width: 86%;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14939;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
455
components/homeList/Portrait.vue
Normal file
455
components/homeList/Portrait.vue
Normal file
@ -0,0 +1,455 @@
|
||||
<template>
|
||||
<!-- 团购纵向布局 -->
|
||||
<view class="shop" :class="type == 1 ? '' : 'home'">
|
||||
<view class="shop-goods" :class="type == 1 ? 'fenlei' : ''">
|
||||
<view class="shop-goods-group">
|
||||
<scroll-view scroll-y="true" class="scroll">
|
||||
<template v-for="(item, index) in groupList" :key="item.id">
|
||||
<view class="item" v-if="item.is_more !== 1" :class="groupId === item.id ? 'choose' : ''" @click="chooseGroup(item.id)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</template>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="shop-goods-list">
|
||||
<view class="sort_box" v-if="type == 1">
|
||||
<view class="sort_item" v-for="(item, index) in sortList" :key="index" @click.stop="chooseSort(index)">
|
||||
<text :class="sortIndex === index ? 'choose' : ''">{{item}}</text>
|
||||
<view class="icon" v-if="index === 2">
|
||||
<up-icon name="arrow-up" size="10" :color="priceType && sortIndex === 2 ? Color : ''" />
|
||||
<up-icon name="arrow-down" size="10" :color="!priceType && sortIndex === 2 ? Color : ''" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="goodbox" :class="type == 1 ? '' : 'padtop'" @scrolltolower="scorllBottom">
|
||||
<view class="goods" v-for="item in goodsList" :key="item.id" @click="toGoods(item.id)">
|
||||
<image class="goods-img" :src="item.face_img + '?x-oss-process=image/format,webp'" :webp="true" mode="aspectFill"></image>
|
||||
<view class="goods-info">
|
||||
<view>
|
||||
<view class="name">{{item.title}}</view>
|
||||
<view v-if="item.actives && item.actives.length">
|
||||
<view v-for="it in item.actives" class="move_img">{{it.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-info-price goods-info-vip">
|
||||
<view class="goods-info-price-left" v-if="item.group_goods.length === 1">
|
||||
<text class="icon">¥</text>
|
||||
<text class="price">
|
||||
<text v-if="item.group_goods[0].specs_type === 0">{{item.group_goods[0].price}}</text>
|
||||
<text v-else>
|
||||
<text v-if="item.group_goods[0].max_price === item.group_goods[0].min_price">{{item.group_goods[0].min_price}}</text>
|
||||
<text v-else>{{item.group_goods[0].min_price}}~{{item.group_goods[0].max_price}}</text>
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="goods-info-vip" v-else>
|
||||
<text class="icon">¥</text>
|
||||
<text class="price">
|
||||
<text v-if="item.max_price === item.min_price">{{item.min_price}}</text>
|
||||
<text v-else>{{item.min_price}}~{{item.max_price}}</text>
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view v-if="item.group_goods.length === 1">
|
||||
<template v-if="item.group_goods[0].specs_type == 0 && item.group_goods[0].goods.limit_type == 0">
|
||||
<view @click.stop="getGoodsSkus(item.group_goods[0])" class="goods-info-price-right">
|
||||
+
|
||||
</view>
|
||||
</template>
|
||||
<template v-else-if="item.group_goods[0].specs_type == 0 && item.group_goods[0].goods.limit_type != 0">
|
||||
<view class="goods-info-price-right">+</view>
|
||||
</template>
|
||||
<template v-if="item.group_goods[0].specs_type == 1">
|
||||
<view @click.stop="getGoodsSkus(item.group_goods[0])" class="goods-info-price-right">
|
||||
+
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="goods-info-price-right" v-else>
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" v-if="page >= lastPage">- 没有更多了 -</view>
|
||||
<view class="bottom" v-else>加载中...</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<choose-sku :show-sku="showSku" :show1='true' :sku-info="skuInfo" :skus_1="skus_1" @close="showSku = false" :isTabbar="true" @getnum="getnum" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import ChooseSku from '../sku/ChooseSku.vue'
|
||||
import { get } from '@/api/request.js'
|
||||
import { goodsItem } from '../common.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ChooseSku
|
||||
},
|
||||
props: {
|
||||
groupList: Array,
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
vipOn: Number
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
goodsList: [],
|
||||
groupId: '',
|
||||
page: 1,
|
||||
lastPage: 0,
|
||||
sortList: ['综合', '销量', '价格', '上新'],
|
||||
sortIndex: 0,
|
||||
priceType: false,
|
||||
sortFilter: {
|
||||
sales: '',
|
||||
price: '',
|
||||
score: 2,
|
||||
new: ''
|
||||
},
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
priceColor: Style[uni.getStorageSync('theme_index') * 1].priceColor
|
||||
})
|
||||
|
||||
// 获取分组商品
|
||||
async function getGoodsList() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
let params = {
|
||||
shop_group_id: data.groupId,
|
||||
page: data.page,
|
||||
sales: data.sortFilter.sales,
|
||||
price: data.sortFilter.price,
|
||||
score: data.sortFilter.score,
|
||||
new: data.sortFilter.new
|
||||
}
|
||||
await get('/api/app/search', params).then((res) => {
|
||||
data.goodsList = data.goodsList.concat(res.data)
|
||||
data.lastPage = res.meta.last_page
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
// 切换分组
|
||||
function chooseGroup(id) {
|
||||
if (id !== data.groupId) {
|
||||
data.groupId = id
|
||||
data.page = 1
|
||||
data.goodsList = []
|
||||
getGoodsList()
|
||||
}
|
||||
}
|
||||
|
||||
const { toGoods, showSku, getGoodsSku, skuInfo, getNum, skus_1 } = goodsItem()
|
||||
const getGoodsSkus = (item) => {
|
||||
getGoodsSku(item).then((res) => {
|
||||
if (item.specs_type === 0) {
|
||||
getnum()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 排序
|
||||
function chooseSort(index) {
|
||||
data.sortIndex = index
|
||||
if (index === 2) {
|
||||
data.priceType = !data.priceType
|
||||
data.sortFilter.price = data.priceType ? 1 : 2
|
||||
data.sortFilter.new = ''
|
||||
} else {
|
||||
data.sortFilter.price = ''
|
||||
}
|
||||
data.sortFilter.sales = index === 1 ? 2 : ''
|
||||
data.sortFilter.score = index === 0 ? 2 : ''
|
||||
data.sortFilter.new = index === 3 ? 2 : ''
|
||||
data.page = 1
|
||||
data.goodsList = []
|
||||
getGoodsList()
|
||||
}
|
||||
|
||||
const getnum = () => {
|
||||
context.emit('getnum')
|
||||
}
|
||||
getGoodsList()
|
||||
|
||||
function scorllBottom() {
|
||||
if (data.page < data.lastPage) {
|
||||
data.page++
|
||||
getGoodsList()
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
chooseGroup,
|
||||
showSku,
|
||||
getGoodsSku,
|
||||
toGoods,
|
||||
skuInfo,
|
||||
getNum,
|
||||
skus_1,
|
||||
getnum,
|
||||
getGoodsSkus,
|
||||
getGoodsList,
|
||||
chooseSort,
|
||||
scorllBottom
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.shop {
|
||||
height: calc(100vh - env(safe-area-inset-bottom));
|
||||
&.home{
|
||||
height: calc(100vh - 184rpx - env(safe-area-inset-bottom));
|
||||
}
|
||||
.shop-coupon {
|
||||
display: flex;
|
||||
height: 130rpx;
|
||||
padding: 15rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
box-shadow: 0rpx 0rpx 20rpx rgba(34, 34, 34, 0.1);
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
&-price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
padding-right: 40rpx;
|
||||
border-right: 2rpx solid #555555;
|
||||
.price {
|
||||
font-size: 40rpx;
|
||||
color: v-bind('priceColor');
|
||||
margin: 0 10rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
&-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
justify-content: space-between;
|
||||
margin-left: 30rpx;
|
||||
.left {
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
color: #555555;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
font-size: 24rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
width: 140rpx;
|
||||
border-radius: 40rpx;
|
||||
background: v-bind('Color');
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-goods {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
&.fenlei{
|
||||
height: calc(100% - 110rpx);
|
||||
}
|
||||
&-group,
|
||||
&-list {
|
||||
background-color: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
&-group {
|
||||
width: 25%;
|
||||
flex-shrink: 0;
|
||||
.scroll {
|
||||
height: 100%;
|
||||
.item {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding-left: 30rpx;
|
||||
font-size: 24rpx;
|
||||
&.choose {
|
||||
background-color: #f9f9f9;
|
||||
color: v-bind('Color');
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-list {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
width: 75%;
|
||||
.goods {
|
||||
display: flex;
|
||||
padding: 20rpx 0;
|
||||
margin: 0 30rpx;
|
||||
&-img {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
background: #cbcacb;
|
||||
border-radius: 10rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
&-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
min-height: 140rpx;
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
&-tag {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
&-item {
|
||||
font-size: 24rpx;
|
||||
color: v-bind('Color');
|
||||
background-color: #fff3f4;
|
||||
padding: 0 15rpx;
|
||||
margin-right: 5rpx;
|
||||
border-radius: 15rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
&-vip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: v-bind('priceColor');
|
||||
.price {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.icon {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.tag {
|
||||
margin-left: 10rpx;
|
||||
font-size: 20rpx;
|
||||
color: #fbe6c3;
|
||||
background: #353648;
|
||||
border-radius: 20rpx 0 0 0;
|
||||
padding: 2rpx 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&-price {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
&-left {
|
||||
.old {
|
||||
margin-left: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
&-right {
|
||||
background-color: v-bind('Color');
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
font-size: 19px;
|
||||
height: 17px;
|
||||
line-height: 15px;
|
||||
text-align: center;
|
||||
width: 17px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods:not(:first-child) {
|
||||
border-top: 1px solid #f2f2f2;
|
||||
}
|
||||
.bottom {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin: auto;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sort_box {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
height: 90rpx;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
.sort_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10rpx;
|
||||
.iconfont {
|
||||
font-size: 24rpx;
|
||||
line-height: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.choose {
|
||||
color: v-bind('Color');
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.goodbox{
|
||||
height: calc(100% - 90rpx);
|
||||
box-sizing: border-box;
|
||||
&.padtop{
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.move_img {
|
||||
display: inline-block;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
margin: 8rpx 10px 10rpx 0;
|
||||
background-image: url('@/static/image/move_img.png');
|
||||
background-repeat: no-repeat;
|
||||
padding: 0px 3px 0px 12px;
|
||||
height: 40rpx;
|
||||
background-size: 100% 100%;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
</style>
|
||||
243
components/homeList/allGroup.vue
Normal file
243
components/homeList/allGroup.vue
Normal file
@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<view class="customBox">
|
||||
<scroll-view scroll-y="true" class="contentBox" @scrolltolower="scorllBottom" :scroll-top="topNum">
|
||||
<view class="goodbox">
|
||||
<view class="item" @click="toGroups(item.id)" v-for="(item, index) in goodsList" :key="item.id">
|
||||
<div class="imgbox">
|
||||
<image :src="item.face_img + '?x-oss-process=image/format,webp'" :webp="true" mode="aspectFill" class="img"></image>
|
||||
<view class="out" v-if="item.sold_status === 2">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/01/16/Cr6cRRhhqYNhScigxIyumyV9hXXMI3vKvsE1jgt0.png" class="out_img" />
|
||||
</view>
|
||||
<view class="out" v-else-if="item.sold_status === 0">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/08/21/QBhUheeYWSJ3OGM27fkAufJAlFSA8GBhWjpY5oNy.png" class="out_img" />
|
||||
</view>
|
||||
<view class="out" v-else-if="item.total_stock === 0">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/08/21/pMTv6QiZZEpSqkJmk7hMcbEzIuNzMyp7YVBbe42H.png" class="out_img" />
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<view class="box">
|
||||
<view class="tit">{{item.title}}</view>
|
||||
<view class="bot">
|
||||
<view class="text">
|
||||
<text class="prefix">¥</text>
|
||||
<text class="txt1" v-if="parseFloat(item.min_price) == parseFloat(item.max_price)">{{item.min_price}}</text>
|
||||
<text class="txt1" v-else>{{item.min_price * 1}}~{{item.max_price}}</text>
|
||||
</view>
|
||||
<view class="icon"><up-icon name="shopping-cart" :color="Color" size="22" /></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" v-if="goodsList.length && page >= last_page && !loading1">
|
||||
— 没有更多了 —
|
||||
</view>
|
||||
<view v-if="!goodsList.length && !loading1" class="empty">暂无数据</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<view @click="handleTop" v-if="showTop" class="top">
|
||||
<up-icon name="arrow-upward" color="#000" size="24" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
props: {
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
topNum: 0,
|
||||
showTop: false,
|
||||
goodsList: [],
|
||||
page: 1,
|
||||
last_page: 0,
|
||||
shareUrl: '',
|
||||
loading1: false,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
priceColor: Style[uni.getStorageSync('theme_index') * 1].priceColor,
|
||||
imgHeight: 0
|
||||
})
|
||||
|
||||
async function getFetchList(val = 1) {
|
||||
data.loading1 = true
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
let params = {
|
||||
page: data.page,
|
||||
pageSize: 20
|
||||
}
|
||||
await get('/api/app/groupGoods/all', params).then((res) => {
|
||||
data.goodsList = val == 1 ? data.goodsList.concat(res.data) : res.data
|
||||
data.last_page = res.meta.last_page
|
||||
data.loading1 = false
|
||||
uni.hideLoading()
|
||||
}).catch(() => {
|
||||
data.loading1 = false
|
||||
})
|
||||
}
|
||||
|
||||
function scorllBottom() {
|
||||
if (data.page < data.last_page) {
|
||||
data.page ++
|
||||
getFetchList()
|
||||
}
|
||||
}
|
||||
|
||||
const toGroups = (id) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/groups/index?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
const handleTop = () => {
|
||||
data.topNum = data.topNum == 0 ? 0.1 : 0
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
data.Color = uni.getStorageSync('theme_color')
|
||||
getFetchList(0)
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getFetchList,
|
||||
scorllBottom,
|
||||
handleTop,
|
||||
toGroups
|
||||
}
|
||||
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 300) {
|
||||
this.showTop = true
|
||||
} else {
|
||||
this.showTop = false
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.customBox{
|
||||
padding: 0 0 1rpx;
|
||||
height: calc(100vh - 242rpx);
|
||||
box-sizing: border-box;
|
||||
.contentBox{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
.goodbox{
|
||||
padding: 24rpx 24rpx 1rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
.item{
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
width: calc(50% - 14rpx);
|
||||
margin: 0 24rpx 24rpx 0;
|
||||
&:nth-child(2n+2){
|
||||
margin: 0 0 24rpx 0;
|
||||
}
|
||||
.imgbox{
|
||||
position: relative;
|
||||
.out{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
.out_img{
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.img{
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
height: 292rpx;
|
||||
}
|
||||
.box{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #333;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
.tit{
|
||||
font-size: 28rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 40rpx;
|
||||
height: 80rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.txt1{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.bot{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.text{
|
||||
color: v-bind('priceColor');
|
||||
.prefix{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
text{
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty{
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
padding: 60rpx 0;
|
||||
}
|
||||
.bottom {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin: auto;
|
||||
padding: 0 0 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.top {
|
||||
position: fixed;
|
||||
bottom: 15%;
|
||||
right: 5%;
|
||||
background: #fff;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
480
components/homeList/groupClassify.vue
Normal file
480
components/homeList/groupClassify.vue
Normal file
@ -0,0 +1,480 @@
|
||||
<template>
|
||||
<view class="customBox" :style="{background: pageInfo.background_color || '#F5F5F5'}">
|
||||
<scroll-view scroll-y="true" class="contentBox" @scrolltolower="scorllBottom" :scroll-top="topNum" @scroll="scrollView">
|
||||
<!-- 头图 -->
|
||||
<view class="bg" v-if="pageInfo.image">
|
||||
<image :src="pageInfo.image + '?x-oss-process=image/format,webp'" :webp="true" mode="widthFix" class="image" @load="loadPageImage"></image>
|
||||
</view>
|
||||
|
||||
<!-- 分类 -->
|
||||
<view :style="{background: pageInfo.nav_bg_color || '#f3f3f3'}" class="tabsBox" :class="isFixed ? 'fixed' : ''" v-if="typeList.length">
|
||||
<up-tabs
|
||||
:list="typeList"
|
||||
:lineColor="pageInfo.nav_text_color"
|
||||
:inactiveStyle="{ color: pageInfo.nav_text_color }"
|
||||
:activeStyle="{ color: pageInfo.nav_text_color }"
|
||||
@click="changeTabs">
|
||||
</up-tabs>
|
||||
</view>
|
||||
|
||||
<!-- 排序 -->
|
||||
<view class="sort_box">
|
||||
<view class="sort_item" v-for="(item, index) in sortList" :key="index" @click.stop="chooseSort(index)">
|
||||
<text :class="sortIndex === index ? 'choose' : ''">{{item}}</text>
|
||||
<view class="icon" v-if="index === 2">
|
||||
<up-icon name="arrow-up" size="10" :color="priceType && sortIndex === 2 ? Color : ''" />
|
||||
<up-icon name="arrow-down" size="10" :color="!priceType && sortIndex === 2 ? Color : ''" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wholeBox">
|
||||
<view class="goodbox" :class="pageInfo.show_type === 2 ? 'two' : pageInfo.show_type === 3 ? 'three' : ''">
|
||||
<view class="item" @click="toGroups(item.id)" v-for="(item, index) in goodsList" :key="item.id">
|
||||
<div class="imgbox">
|
||||
<image :src="item.face_img + '?x-oss-process=image/format,webp'" :webp="true" mode="aspectFill" class="img"></image>
|
||||
<view class="out" v-if="item.sold_status === 2">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/01/16/Cr6cRRhhqYNhScigxIyumyV9hXXMI3vKvsE1jgt0.png" class="out_img" />
|
||||
</view>
|
||||
<view class="out" v-else-if="item.sold_status === 0">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/08/21/QBhUheeYWSJ3OGM27fkAufJAlFSA8GBhWjpY5oNy.png" class="out_img" />
|
||||
</view>
|
||||
<view class="out" v-else-if="item.total_stock === 0">
|
||||
<img src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2024/08/21/pMTv6QiZZEpSqkJmk7hMcbEzIuNzMyp7YVBbe42H.png" class="out_img" />
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<view class="box">
|
||||
<view class="tit">{{item.title}}</view>
|
||||
<view class="bot">
|
||||
<view class="text">
|
||||
<text class="prefix">¥</text>
|
||||
<text class="txt1" v-if="parseFloat(item.min_price) == parseFloat(item.max_price)">{{item.min_price}}</text>
|
||||
<text class="txt1" v-else>{{item.min_price * 1}}~{{item.max_price}}</text>
|
||||
</view>
|
||||
<view class="icon"><up-icon name="shopping-cart" :color="Color" size="22" /></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" v-if="goodsList.length && page >= last_page && !loading1" :style="{color: modifyTextColor(pageInfo.background_color)}">
|
||||
— 没有更多了 —
|
||||
</view>
|
||||
<view v-if="!goodsList.length && !loading1" class="empty" :style="{color: modifyTextColor(pageInfo.background_color)}">暂无数据</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<view @click="hanletop" v-if="showTop" class="top">
|
||||
<up-icon name="arrow-upward" color="#000" size="24" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted, watch } from 'vue'
|
||||
import { modifyTextColor } from '@/utils/index.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
import { get, post } from '@/api/request.js'
|
||||
export default {
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
props: {
|
||||
groupId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
topNum: 0,
|
||||
isFixed: false,
|
||||
showTop: false,
|
||||
goodsList: [],
|
||||
loading: false,
|
||||
pageInfo: {
|
||||
image: ''
|
||||
},
|
||||
page: 1,
|
||||
last_page: 0,
|
||||
shareUrl: '',
|
||||
typeId: 0,
|
||||
typeList: [],
|
||||
sortList: ['综合', '销量', '价格', '上新'],
|
||||
sortIndex: 0,
|
||||
priceType: false,
|
||||
sortFilter: {
|
||||
sales: '',
|
||||
price: '',
|
||||
score: 2,
|
||||
new: ''
|
||||
},
|
||||
loading1: false,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
imgHeight: 0,
|
||||
priceColor: Style[uni.getStorageSync('theme_index') * 1].priceColor
|
||||
})
|
||||
|
||||
async function getPageInfo() {
|
||||
data.id && await get('/api/app/showcase/type/category/' + data.id).then((res) => {
|
||||
data.pageInfo = res
|
||||
context.emit('handleShareInfo', res.share_image + '&&' + res.share_title)
|
||||
if(res.recommend_shop_group.length) {
|
||||
data.typeId = res.recommend_shop_group[0]
|
||||
data.typeList.push({id: data.typeId, name: '推荐'})
|
||||
getFetchList()
|
||||
getCategoryList(res.recommend_shop_group[0])
|
||||
}
|
||||
data.loading = true
|
||||
})
|
||||
}
|
||||
|
||||
async function getCategoryList(id) {
|
||||
await get('/api/app/group', { parent_id: id }).then((res) => {
|
||||
data.typeList = data.typeList.concat(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
async function getFetchList() {
|
||||
data.loading1 = true
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
let params = {
|
||||
page: data.page,
|
||||
pageSize: 24,
|
||||
sales: data.sortFilter.sales,
|
||||
price: data.sortFilter.price,
|
||||
score: data.sortFilter.score,
|
||||
new: data.sortFilter.new,
|
||||
keyword: '',
|
||||
shop_group_id: data.typeId
|
||||
}
|
||||
await get('/api/app/search', params).then((res) => {
|
||||
data.goodsList = data.goodsList.concat(res.data)
|
||||
data.last_page = res.meta.last_page
|
||||
data.loading1 = false
|
||||
uni.hideLoading()
|
||||
}).catch(() => {
|
||||
data.loading1 = false
|
||||
})
|
||||
}
|
||||
|
||||
// 排序搜索
|
||||
function chooseSort(index) {
|
||||
data.sortIndex = index
|
||||
if (index === 2) {
|
||||
data.priceType = !data.priceType
|
||||
data.sortFilter.price = data.priceType ? 1 : 2
|
||||
data.sortFilter.new = ''
|
||||
} else {
|
||||
data.sortFilter.price = ''
|
||||
}
|
||||
data.sortFilter.sales = index === 1 ? 2 : ''
|
||||
data.sortFilter.score = index === 0 ? 2 : ''
|
||||
data.sortFilter.new = index === 3 ? 2 : ''
|
||||
data.page = 1
|
||||
data.goodsList = []
|
||||
getFetchList()
|
||||
}
|
||||
|
||||
const changeTabs = (event) => {
|
||||
if (event.id == data.typeId) {
|
||||
return
|
||||
}
|
||||
data.typeId = event.id
|
||||
data.page = 1
|
||||
data.goodsList = []
|
||||
getFetchList()
|
||||
}
|
||||
|
||||
function scorllBottom() {
|
||||
if (data.page < data.last_page) {
|
||||
data.page ++
|
||||
getFetchList()
|
||||
}
|
||||
}
|
||||
|
||||
function scrollView(e) {
|
||||
data.isFixed = e.detail.scrollTop > data.imgHeight
|
||||
}
|
||||
|
||||
function loadPageImage(e) {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
data.imgHeight = res.windowWidth * e.detail.height / e.detail.width
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const toGroups = (id) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/groups/index?id=' + id + '&source_id=' + data.id + '&source_type=exclusive'
|
||||
})
|
||||
}
|
||||
|
||||
const hanletop = () => {
|
||||
data.topNum = data.topNum == 0 ? 0.1 : 0
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if(newProps.groupId) {
|
||||
data.id = newProps.groupId
|
||||
data.goodsList = []
|
||||
data.typeList = []
|
||||
getPageInfo()
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
data.Color = uni.getStorageSync('theme_color')
|
||||
data.id = props.groupId
|
||||
getPageInfo()
|
||||
})
|
||||
|
||||
return {
|
||||
modifyTextColor,
|
||||
...toRefs(data),
|
||||
getPageInfo,
|
||||
getFetchList,
|
||||
chooseSort,
|
||||
changeTabs,
|
||||
scorllBottom,
|
||||
hanletop,
|
||||
toGroups,
|
||||
scrollView,
|
||||
loadPageImage
|
||||
}
|
||||
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 300) {
|
||||
this.showTop = true
|
||||
} else {
|
||||
this.showTop = false
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.customBox{
|
||||
padding: 0 0 1rpx;
|
||||
height: calc(100vh - 242rpx);
|
||||
box-sizing: border-box;
|
||||
.contentBox{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
.bg{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.image{
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
.tabsBox{
|
||||
width: 100%;
|
||||
&.fixed{
|
||||
position: fixed;
|
||||
top: 132rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
.sort_box {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
height: 90rpx;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
.sort_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10rpx;
|
||||
.iconfont {
|
||||
font-size: 24rpx;
|
||||
line-height: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.choose {
|
||||
color: v-bind('Color');
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.goodbox{
|
||||
padding: 24rpx 24rpx 1rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
.item{
|
||||
margin: 0 0 24rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
.imgbox{
|
||||
position: relative;
|
||||
.out{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
.out_img{
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.img{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.box{
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
width: calc(100% - 220rpx);
|
||||
flex-direction: column;
|
||||
color: #333;
|
||||
justify-content: space-between;
|
||||
.tit{
|
||||
font-size: 28rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.bot{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.text{
|
||||
color: v-bind('priceColor');
|
||||
.prefix{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
text{
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.two{
|
||||
.item{
|
||||
width: calc(50% - 14rpx);
|
||||
margin: 0 24rpx 24rpx 0;
|
||||
display: block;
|
||||
&:nth-child(2n+2){
|
||||
margin: 0 0 24rpx 0;
|
||||
}
|
||||
.img{
|
||||
width: 100%;
|
||||
height: 292rpx;
|
||||
}
|
||||
.box{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
.tit{
|
||||
height: 80rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.txt1{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.imgbox{
|
||||
.out{
|
||||
.out_img{
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.three{
|
||||
.item{
|
||||
width: calc(33.3% - 18rpx);
|
||||
margin: 0 24rpx 24rpx 0;
|
||||
display: block;
|
||||
padding: 18rpx;
|
||||
&:nth-child(3n+3){
|
||||
margin: 0 0 24rpx 0;
|
||||
}
|
||||
.img{
|
||||
width: 100%;
|
||||
height: 184rpx;
|
||||
}
|
||||
.box{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
.text{
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tit{
|
||||
height: 80rpx;
|
||||
margin: 10rpx 0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.txt1{
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.icon{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty{
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
padding: 60rpx 0;
|
||||
}
|
||||
.bottom {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
margin: auto;
|
||||
padding: 0 0 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.top {
|
||||
position: fixed;
|
||||
bottom: 15%;
|
||||
right: 5%;
|
||||
background: #fff;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
380
components/homeList/index.vue
Normal file
380
components/homeList/index.vue
Normal file
@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<view style="background: #f5f5f5; padding-bottom: 1rpx;">
|
||||
<view class="home-top">
|
||||
<swiper v-if="images.length !== 0" class="home-top-swiper" :autoplay="true" :interval="5000" :duration="500" :indicator-dots="true" :circular="true">
|
||||
<swiper-item v-for="(item,index) in images" :key="index">
|
||||
<image class="item_img" :src="item.pic_url + '?x-oss-process=image/format,webp'" :webp="true" @click="onSwiperItem(item.link)"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="Minute">
|
||||
<view class="box" @click="hanlejump('/pages/sale/index')">
|
||||
<view class="h3">超级爆品 <view class="small">GO <up-icon name="arrow-right" size="10" /></view></view>
|
||||
<view style="display: flex;">
|
||||
<template v-for="(item, index) in hot" :key="index">
|
||||
<view v-if="index < 2">
|
||||
<view class="red">{{item.title}}</view>
|
||||
<view><image :src="item.face_img + '?x-oss-process=image/format,webp'" :webp="true" class="imgs" mode="aspectFill"></image></view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box" @click="hanlejump('/pages/sale/list?type=1')">
|
||||
<view class="h3">TOP榜单 <view class="small1">GO <up-icon name="arrow-right" size="10" /></view></view>
|
||||
<view style="display: flex;">
|
||||
<template v-for="(item, index) in top" :key="index">
|
||||
<view v-if="index < 2">
|
||||
<view class="bule">{{item.title}}</view>
|
||||
<view><image :src="item.face_img + '?x-oss-process=image/format,webp'" :webp="true" class="imgs" mode="aspectFill"></image></view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template v-for="(list, index) in merchant" :key="list.id">
|
||||
<view v-if="list.shop_goods.length !== 0" class="shop">
|
||||
<view v-if="list.sold_status != 2">
|
||||
<view class="banner" @click="jumpHall(list.id)">
|
||||
<image :src="list.ad_image + '?x-oss-process=image/format,webp'" :webp="true" mode="widthFix" class="img"></image>
|
||||
</view>
|
||||
<view class="title">
|
||||
<view class="activeTitle">
|
||||
<view class="name">{{list.name}}</view>
|
||||
<view class="toActive" @click="jumpHall(list.id)">进入会场</view>
|
||||
</view>
|
||||
<view class="activeTitle" style="margin-top: 10rpx;height: 44rpx;">
|
||||
<view>
|
||||
<view class="move" v-if="list.actives && list.actives.length > 0">
|
||||
{{list.actives && list.actives.length > 0 ? list.actives[0].name : ''}}
|
||||
</view>
|
||||
<view class="move">7天无理由</view>
|
||||
</view>
|
||||
<view class="endtime" v-if="list.sold_status == 1 && list.sold_off_time" v-html="DownTime(list.sold_off_time, 1)"></view>
|
||||
<view class="endtime" v-if="list.sold_status == 0" v-html="UpTime(list.sold_start_time, 1)"></view>
|
||||
</view>
|
||||
|
||||
<view class="goodscommodity">
|
||||
<view class="goodsgun" v-for="(it, index) in list.shop_goods" :key="index" @click="toDetail(it.id)">
|
||||
<image :src="it.face_img + '?x-oss-process=image/resize,m_fill,w_300,h_300'" :webp="true" class="img" mode="aspectFill"></image>
|
||||
<view class="price_list">
|
||||
<text class="icon">¥</text>
|
||||
<text v-if="it.price > 0">{{it.price}}</text>
|
||||
<block v-else>
|
||||
<text v-if="it.max_price == it.min_price">{{it.min_price}}</text>
|
||||
<text v-else>{{it.min_price * 1}}~{{it.max_price}}</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.shop_goods.length" @click="jumpHall(list.id)" class="viewmore">
|
||||
<text>查看更多</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { UpTime, DownTime } from '@/components/common.js'
|
||||
export default {
|
||||
props: {
|
||||
|
||||
},
|
||||
setup() {
|
||||
const data = reactive({
|
||||
images: [],
|
||||
hot: [],
|
||||
top: [],
|
||||
merchant: [],
|
||||
total: 0,
|
||||
page: 1,
|
||||
endTime: '',
|
||||
Color: ''
|
||||
})
|
||||
//跳转页面
|
||||
const hanlejump = (url) => {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
// 获取轮播图
|
||||
const getbanner = async () => {
|
||||
let res = await get('/api/v1/special/banner')
|
||||
data.images = res.data
|
||||
}
|
||||
//爆款
|
||||
const gethot = async () => {
|
||||
let res = await get('/api/v1/special/goods/hot')
|
||||
data.hot = res.data
|
||||
}
|
||||
//top榜
|
||||
const gettop = async () => {
|
||||
let res = await get('/api/v1/special/goods/top')
|
||||
data.top = res.data
|
||||
}
|
||||
//小店
|
||||
const getmerchant = async () => {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
let res = await get('/api/v1/special/merchant', {
|
||||
page: data.page,
|
||||
limit: 5
|
||||
})
|
||||
data.merchant = data.merchant.concat(res.data)
|
||||
data.total = res.meta.last_page
|
||||
uni.hideLoading()
|
||||
}
|
||||
// 轮播图跳转
|
||||
function onSwiperItem(url) {
|
||||
if (url) {
|
||||
if(url.indexOf('type=category') !== -1) {
|
||||
uni.navigateTo({ url: '/pages/lotRecom/index?' + url.split('?')[1] })
|
||||
} else if(url.indexOf('type=shop_group') !== -1) {
|
||||
uni.navigateTo({ url: '/pages/subset/index?' + url.split('?')[1] })
|
||||
} else {
|
||||
uni.navigateTo({ url: url })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const toDetail = (id) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/productDetails/index?id=' + id
|
||||
})
|
||||
}
|
||||
const jumpHall = (id) => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/smallshop/index?id=' + id
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
data.Color = uni.getStorageSync('theme_color')
|
||||
getbanner()
|
||||
gethot()
|
||||
gettop()
|
||||
getmerchant()
|
||||
})
|
||||
return {
|
||||
...toRefs(data),
|
||||
hanlejump,
|
||||
onSwiperItem,
|
||||
toDetail,
|
||||
jumpHall,
|
||||
getmerchant,
|
||||
DownTime,
|
||||
UpTime
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.page < this.total) {
|
||||
this.page++
|
||||
this.getmerchant()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.activeTitle {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.toActive {
|
||||
background-color: v-bind('Color');
|
||||
border-radius: 44rpx;
|
||||
color: #fff;
|
||||
padding: 4rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
height: 38rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.move {
|
||||
display: inline-block;
|
||||
border: 1px solid v-bind('Color');
|
||||
color:v-bind('Color');
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 6rpx;
|
||||
line-height: 1;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
.endtime {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 44rpx;
|
||||
b{
|
||||
color: #2c2c2c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.market_price {
|
||||
display: block;
|
||||
color: #676767;
|
||||
text-decoration: line-through;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
.go1 {
|
||||
margin-top: 108rpx;
|
||||
}
|
||||
.go {
|
||||
margin-top: 133rpx;
|
||||
}
|
||||
.shop {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin: 24rpx 20rpx;
|
||||
.banner {
|
||||
width: 100%;
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-top-left-radius: 10rpx;
|
||||
border-top-right-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 25rpx 13rpx;
|
||||
.name {
|
||||
font-weight: bolder;
|
||||
font-size: 30rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
.goodscommodity {
|
||||
display: flex;
|
||||
margin-top: 25rpx;
|
||||
overflow: auto;
|
||||
.goodsgun {
|
||||
padding: 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
width: 36%;
|
||||
.img {
|
||||
width: 214rpx;
|
||||
height: 214rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.title_list {
|
||||
font-size: 26rpx;
|
||||
color: #2c2c2c;
|
||||
margin: 10rpx 0;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.price_list {
|
||||
font-size: 26rpx;
|
||||
margin-top: 16rpx;
|
||||
.icon {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.viewmore{
|
||||
width: 214rpx;
|
||||
height: 214rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 6rpx;
|
||||
font-size: 28rpx;
|
||||
flex-direction: column;
|
||||
background-color: #F5F5F5;
|
||||
.line{
|
||||
width: 70%;
|
||||
height: 2px;
|
||||
background-color: #333;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.home-top-swiper {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
.item_img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.Minute {
|
||||
display: flex;
|
||||
border-radius: 20rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
margin: 24rpx 20rpx;
|
||||
padding: 26rpx 26rpx;
|
||||
box-sizing: border-box;
|
||||
.box {
|
||||
width: 50%;
|
||||
.h3 {
|
||||
font-weight: bolder;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.small {
|
||||
background: #F14939;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
border-radius: 15rpx;
|
||||
display: inline-flex;
|
||||
width: 60rpx;
|
||||
height: 30rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.red {
|
||||
color: #F14939;
|
||||
font-size: 26rpx;
|
||||
margin: 20rpx 0;
|
||||
width: 166rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.bule {
|
||||
color: #6bb3f2;
|
||||
font-size: 26rpx;
|
||||
margin: 20rpx 0;
|
||||
width: 166rpx;
|
||||
overflow: hidden; /*内容超出后隐藏*/
|
||||
text-overflow: ellipsis; /* 超出内容显示为省略号 */
|
||||
white-space: nowrap; /* 文本不进行换行 */
|
||||
}
|
||||
|
||||
.small1 {
|
||||
background: #6bb3f2;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
border-radius: 15rpx;
|
||||
display: inline-flex;
|
||||
width: 60rpx;
|
||||
height: 30rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
230
components/homeList/videoList.vue
Normal file
230
components/homeList/videoList.vue
Normal file
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view class="customBox">
|
||||
<scroll-view scroll-y="true" class="contentBox" @scrolltolower="scorllBottom" :scroll-top="topNum">
|
||||
<view class="content">
|
||||
<view class="left">
|
||||
<template v-for="(item, index) in list" :key="item.id">
|
||||
<view class="row" @click="toPage(item.id)" v-if="index % 2 == 0">
|
||||
<view class="img">
|
||||
<image :src="item.explain_video + '?x-oss-process=video/snapshot,t_1000,m_fast'" mode="widthFix"></image>
|
||||
<view class="icon"><up-icon name="play-right-fill" size="14" color="#fff" /></view>
|
||||
</view>
|
||||
<view class="desc">{{item.description}}</view>
|
||||
<view class="num">{{item.visitor}}人看过 | {{item.order_count}}人跟团</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="left">
|
||||
<template v-for="(item, index) in list" :key="item.id">
|
||||
<view class="row" @click="toPage(item.id)" v-if="index % 2 == 1">
|
||||
<view class="img">
|
||||
<image :src="item.explain_video + '?x-oss-process=video/snapshot,t_1000,m_fast'" mode="widthFix"></image>
|
||||
<view class="icon"><up-icon name="play-right-fill" size="14" color="#fff" /></view>
|
||||
</view>
|
||||
<view class="desc">{{item.description}}</view>
|
||||
<view class="num">{{item.visitor}}人看过 | {{item.order_count}}人跟团</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="noMore" v-if="list.length && !has_more && !loading">— 没有更多了 —</view>
|
||||
<view v-if="!list.length && !loading">
|
||||
<up-empty mode="list" icon="https://ct-upimg.yx090.com/g.ii090/images/sprite/empty/list.png" text="暂无数据"></up-empty>
|
||||
</view>
|
||||
<view v-if="loading" class="loadbox">
|
||||
<up-loading-icon text="加载中..." textSize="14"></up-loading-icon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<view @click="handleTop" v-if="showTop" class="top">
|
||||
<up-icon name="arrow-upward" color="#000" size="24" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted } from 'vue'
|
||||
import { get } from '@/api/request.js'
|
||||
|
||||
export default {
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
props: {
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
topNum: 0,
|
||||
showTop: false,
|
||||
last_id: 0,
|
||||
loading: true,
|
||||
has_more: true,
|
||||
list: []
|
||||
})
|
||||
|
||||
async function getFetchList() {
|
||||
data.loading = true
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
let params = {
|
||||
last_id: data.last_id,
|
||||
pageSize: 20
|
||||
}
|
||||
await get('/api/app/goods/videos', params).then((res) => {
|
||||
data.list = data.list.concat(res.data)
|
||||
data.last_id = res.last_id
|
||||
data.has_more = res.has_more
|
||||
data.loading = false
|
||||
uni.hideLoading()
|
||||
}).catch(() => {
|
||||
data.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
function scorllBottom() {
|
||||
if (data.has_more && !data.loading) {
|
||||
getFetchList()
|
||||
}
|
||||
}
|
||||
|
||||
function toPage(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/groups/video?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
const handleTop = () => {
|
||||
data.topNum = data.topNum == 0 ? 0.1 : 0
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFetchList()
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getFetchList,
|
||||
scorllBottom,
|
||||
handleTop,
|
||||
toPage
|
||||
}
|
||||
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 300) {
|
||||
this.showTop = true
|
||||
} else {
|
||||
this.showTop = false
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.customBox{
|
||||
padding: 0 0 1rpx;
|
||||
height: calc(100vh - 242rpx);
|
||||
box-sizing: border-box;
|
||||
.contentBox{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
.content{
|
||||
padding: 24rpx 1.5%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.left{
|
||||
width: 50%;
|
||||
padding: 0 1.5%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.row{
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
margin-bottom: 24rpx;
|
||||
overflow: hidden;
|
||||
.img{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
image{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.icon{
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 50%;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.desc{
|
||||
font-size: 28rpx;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
display: -webkit-box !important;
|
||||
-webkit-line-clamp: 2 !important;
|
||||
-webkit-box-orient: vertical !important;
|
||||
white-space: break-spaces !important;
|
||||
padding: 0 20rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.num{
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.noMore{
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin: auto;
|
||||
padding: 0 0 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.noMsg{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
padding-top: 20%;
|
||||
box-sizing: border-box;
|
||||
font-size: 26rpx;
|
||||
color: #9D9D9D;
|
||||
}
|
||||
.loadbox{
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
.top {
|
||||
position: fixed;
|
||||
bottom: 15%;
|
||||
right: 5%;
|
||||
background: #fff;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
2
components/img.js
Normal file
2
components/img.js
Normal file
@ -0,0 +1,2 @@
|
||||
// 雪碧图
|
||||
export const sp2 = 'https://ct-upimg.yx090.com/g.ii090/images/sprite/11791720144991.jpg'
|
||||
249
components/ktt/comment.vue
Normal file
249
components/ktt/comment.vue
Normal file
@ -0,0 +1,249 @@
|
||||
<template>
|
||||
<view class="dialogBox" v-if="show">
|
||||
<view class="dialog" @click="close()"></view>
|
||||
|
||||
<view class="block">
|
||||
<view class="title">
|
||||
<text>本团评价</text>
|
||||
<view class="close" @click="close()"><up-icon name="close" color="#666" /></view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="contentBox" @scrolltolower="scorllBottom">
|
||||
<view class="item" v-for="item in list" :key="item.id">
|
||||
<view class="user" v-if="item.user">
|
||||
<image :src="item.user.avatar"></image>
|
||||
<view class="box">
|
||||
<view class="name">{{item.user.nickname}}</view>
|
||||
<view class="time">{{item.date}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.item && item.item.sku_name" class="sku_name">规格:{{item.item.sku_name}}</view>
|
||||
<text class="comment">{{item.comment}}</text>
|
||||
<view class="box_zong" v-if="item.material.length">
|
||||
<view class="box_imgs" v-for="(it, index) in item.material" :key="index">
|
||||
<image :src="it.url" v-if="it.type === 1" @click="viewImg(it, item.material)" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="noMore" v-if="list.length && page >= lastPage && !loading">— 没有更多了 —</view>
|
||||
<view class="empty" v-if="!list.length && !loading">
|
||||
<up-empty mode="comment" icon="https://ct-upimg.yx090.com/g.ii090/images/sprite/empty/comment.png" text="暂无评价喔"></up-empty>
|
||||
</view>
|
||||
<view v-if="loading" class="loadbox">
|
||||
<up-loading-icon text="加载中..." textSize="14"></up-loading-icon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { get } from '@/api/request.js'
|
||||
import { showToast } from '../common.js'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
id: 0,
|
||||
show: false,
|
||||
list: [],
|
||||
loading: false,
|
||||
page: 1,
|
||||
lastPage: 0
|
||||
})
|
||||
|
||||
function getInfo(val) {
|
||||
data.loading = true
|
||||
get(`/api/v1/goods/comment/${data.id}`, {
|
||||
page: data.page,
|
||||
pageSize: 20,
|
||||
type: 1
|
||||
}).then((res) => {
|
||||
data.list = val == 1 ? data.list.concat(res.data) : res.data
|
||||
data.lastPage = res.meta.last_page
|
||||
data.loading = false
|
||||
}).catch(() => {
|
||||
data.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
function scorllBottom() {
|
||||
if (data.page < data.lastPage) {
|
||||
data.page ++
|
||||
getInfo(1)
|
||||
}
|
||||
}
|
||||
|
||||
const viewImg = (it, imgs) => {
|
||||
var img = []
|
||||
imgs.forEach((res) => {
|
||||
if (res.type == 1) {
|
||||
img.push(res.url)
|
||||
}
|
||||
})
|
||||
uni.previewImage({
|
||||
current: it.url,
|
||||
urls: img
|
||||
})
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
if (newProps.show) {
|
||||
data.show = true
|
||||
data.id = newProps.id * 1
|
||||
data.page = 1
|
||||
data.list = []
|
||||
getInfo(0)
|
||||
} else {
|
||||
data.show = false
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getInfo,
|
||||
close,
|
||||
scorllBottom,
|
||||
viewImg
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialogBox{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 200;
|
||||
overflow: hidden;
|
||||
.dialog{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.block{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
height: 78vh;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
.title{
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
height: 100rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
.close{
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
.contentBox{
|
||||
height: calc(100% - 100rpx);
|
||||
overflow-y: auto;
|
||||
.item{
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
.user{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
image{
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.box{
|
||||
width: calc(100% - 80rpx);
|
||||
.name{
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.time{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.sku_name{
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.comment{
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.box_zong{
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.box_imgs{
|
||||
margin-right: 20rpx;
|
||||
&:nth-child(3n+3) {
|
||||
margin-right: 0;
|
||||
}
|
||||
image{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.noMore{
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin: auto;
|
||||
padding: 30rpx 0 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.empty{
|
||||
width: 100%;
|
||||
padding: 120rpx 0;
|
||||
text-align: center;
|
||||
.img{
|
||||
width: 400rpx;
|
||||
}
|
||||
text{
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.loadbox{
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
187
components/ktt/expandable-text.vue
Normal file
187
components/ktt/expandable-text.vue
Normal file
@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view class="jj-expandable-text">
|
||||
<view class="text" :class="{'expandable': !collapse}" :style="{'--lineheight':lineHeight + 'rpx',
|
||||
'line-height': lineHeight + 'rpx',
|
||||
'max-height': collapse ? (lineHeight * line) + 'rpx' : '1000px'}">
|
||||
<view class="btn" v-if="lines > line" @click="collapse = !collapse"
|
||||
:class="{'clearboth': !collapse || line > 1}" :style="{'height': lineHeight + 'rpx'}">
|
||||
<template v-if="useExpandSlot">
|
||||
<slot v-if="collapse" name="expand-icon"></slot>
|
||||
<slot v-else name="fold-icon"></slot>
|
||||
</template>
|
||||
<text v-else class="opt-hint">{{collapse ? expandText : foldText}}</text>
|
||||
</view>
|
||||
<text class="jj-content">
|
||||
<slot>{{ longText ? longText : '' }}</slot>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ExpandableText',
|
||||
props: {
|
||||
// 展示多少行
|
||||
line: {
|
||||
type: [Number, String],
|
||||
default: 1
|
||||
},
|
||||
// 单行文本所占高度,rpx单位
|
||||
lineHeight: {
|
||||
type: [Number],
|
||||
default: 32
|
||||
},
|
||||
longText: {
|
||||
type: [String],
|
||||
default: ''
|
||||
},
|
||||
useExpandSlot: { // 自定义展开、收起布局
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 自定义展开文字
|
||||
expandText: {
|
||||
type: String,
|
||||
default: "展开"
|
||||
},
|
||||
// 自定义收起文字
|
||||
foldText: {
|
||||
type: String,
|
||||
default: "收起"
|
||||
},
|
||||
collapsev: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isHide: true, // 是否隐藏多余行。初始状态不隐藏
|
||||
// lineHeight: 33, // 单行文本所占高度,rpx单位
|
||||
textHeight: 0, // 全量所占文本高度
|
||||
// placeholder: '占位', // 占位文本,计算文字的行高
|
||||
collapse: true, // 是否处于文本收缩状态,默认是
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
longText() {
|
||||
let that = this
|
||||
that.collapse = true
|
||||
setTimeout(() => {
|
||||
let query = uni.createSelectorQuery().in(that);
|
||||
// 获取所有文本在html中的高度
|
||||
query.select('.jj-content').boundingClientRect(data => {
|
||||
that.textHeight = data.height
|
||||
}).exec();
|
||||
console.log('文字改变')
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let query = uni.createSelectorQuery().in(this);
|
||||
setTimeout(() => {
|
||||
// 获取所有文本在html中的高度
|
||||
query.select('.jj-content').boundingClientRect(data => {
|
||||
this.textHeight = data.height
|
||||
}).exec();
|
||||
console.log('collapse')
|
||||
}, 200)
|
||||
},
|
||||
computed: {
|
||||
// 全文本所占总行数
|
||||
lines() {
|
||||
let ll = 0
|
||||
if (this.textHeight > 0 && this.lineHeight > 0) {
|
||||
const actual = uni.upx2px(this.lineHeight)
|
||||
ll = Math.ceil(this.textHeight / actual)
|
||||
}
|
||||
return ll
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.clearboth {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.jj-expandable-text {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.jj-expandable-text .text {
|
||||
position: relative;
|
||||
line-height: 1.5;
|
||||
max-height: 1.5em;
|
||||
overflow: hidden;
|
||||
// transition: .3s max-height;
|
||||
}
|
||||
|
||||
.jj-expandable-text .text::before {
|
||||
content: '';
|
||||
float: right;
|
||||
width: 0;
|
||||
/*设置为0,或者不设置宽度*/
|
||||
height: calc(100% - var(--lineheight));
|
||||
/*先随便设置一个高度*/
|
||||
background: red;
|
||||
}
|
||||
|
||||
.jj-expandable-text .text::after {
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.jj-expandable-text .expandable {
|
||||
max-height: 1000px;
|
||||
/*超出最大行高度就可以了*/
|
||||
}
|
||||
|
||||
.jj-expandable-text .expandable::after {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.jj-expandable-text .btn {
|
||||
float: right;
|
||||
position: relative;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.jj-expandable-text .btn .opt-hint {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.jj-expandable-text .btn::before {
|
||||
content: '...';
|
||||
position: absolute;
|
||||
letter-spacing: 2rpx;
|
||||
left: -6rpx;
|
||||
bottom: -2rpx;
|
||||
color: inherit;
|
||||
transform: translateX(-100%)
|
||||
}
|
||||
|
||||
.jj-expandable-text .btn::after {
|
||||
content: '.';
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.jj-expandable-text .expandable .btn::after {
|
||||
content: '.';
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.jj-expandable-text .expandable .btn::before {
|
||||
visibility: hidden;
|
||||
/*在展开状态下隐藏省略号*/
|
||||
}
|
||||
|
||||
// .jj-placeholder {
|
||||
// visibility: hidden;
|
||||
// }
|
||||
</style>
|
||||
1170
components/ktt/goods.vue
Normal file
1170
components/ktt/goods.vue
Normal file
File diff suppressed because it is too large
Load Diff
396
components/ktt/singleSku.vue
Normal file
396
components/ktt/singleSku.vue
Normal file
@ -0,0 +1,396 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup :show="show" :round="10" mode="bottom" @close="handleClose" closeable catchtouchmove="preventD" :z-index="200">
|
||||
<view class="skuBox">
|
||||
<view class="oneBox">
|
||||
<image :src="info.face_img" mode="aspectFill"></image>
|
||||
<view class="box">
|
||||
<view class="tit">{{info.title}}</view>
|
||||
<view class="pricebox">
|
||||
<view class="text1" v-if="vipOn && info.vip_price > 0 && (is_vip || (!is_vip && vip_price_show))">
|
||||
<text class="icon1">¥</text>
|
||||
<text>{{info.price}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<!-- 显示会员价 -->
|
||||
<view v-if="vipOn && info.vip_price > 0 && (is_vip || (!is_vip && vip_price_show))" class="vip">
|
||||
<view class="vip-tag"><text>会员价 ¥</text>{{info.vip_price}}</view>
|
||||
</view>
|
||||
<!-- 显示普通价格 -->
|
||||
<view v-else class="vip">
|
||||
<text class="icon1">¥</text>
|
||||
<text>{{info.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text" v-if="show_stock === 1">剩余{{info.stock <= 0 ? 0 : info.stock}}件</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="scrollbox" scroll-y="true" enhanced="true">
|
||||
<view class="twoBox">
|
||||
<text>数量</text>
|
||||
<view class="stepper">
|
||||
<view class="minus flex" @click="minusNum()"><up-icon name="minus" size="12" :color="Color" /></view>
|
||||
<view class="num">{{num}}</view>
|
||||
<view class="plus flex" @click="plusNum()"><up-icon name="plus" size="12" color="#fff" /></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sku-buy" v-if="sales > 0">
|
||||
<view class="img" v-for="img in info.avatars" :key="img">
|
||||
<image :src="img"></image>
|
||||
</view>
|
||||
<view class="text">已有<text class="num">{{sales}}</text>个社群好友购买</view>
|
||||
</view>
|
||||
<view class="edition">
|
||||
<view v-for="(item, index) in info.text_modules" :key="item.id">
|
||||
<view v-if="item.type == 1" class="edition_box" @click="viewImg(item.imgs[0])">
|
||||
<view v-for="(imgs, index) in item.imgs" :key="index">
|
||||
<image :src="imgs" mode="widthFix" style="width: 100%;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edition_box" v-if="item.type == 2">
|
||||
<view class="small_img">
|
||||
<view v-for="(list, index) in item.img" :key="index" class="imgs" @click="viewImg(list)">
|
||||
<image :src="list" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 文字 -->
|
||||
<view class="edition_box text1_box" v-if="item.type == 4">
|
||||
<text user-select="true" class="text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="imgbox">
|
||||
<image v-for="(img, idx) in info.gallery" :key="idx" :src="img" class="img" mode="widthFix" @click="viewImg(img)"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="btn" :class="info.stock <= 0 || !canBuy ? 'dis' : ''" @click="(info.stock > 0 && canBuy) ? addCart():''">加入购物车</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { showToast } from '../common.js'
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
show_stock: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
canBuy: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
shortStatus: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
groupId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
sales: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
id: 0,
|
||||
show: false,
|
||||
info: {},
|
||||
vipOn: uni.getStorageSync('vip_on') === 1,
|
||||
is_vip: uni.getStorageSync('is_vip'),
|
||||
vip_price_show: uni.getStorageSync('vip_price_show') || false,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
show_stock: 0,
|
||||
canBuy: true,
|
||||
num: 1,
|
||||
groupId: 0,
|
||||
shortStatus: 1
|
||||
})
|
||||
|
||||
function getSpecInfo(val) {
|
||||
get(`/api/v1/goods/spec/${data.id}`).then((res) => {
|
||||
data.info = res.data
|
||||
data.info.avatars = res.data.avatars || []
|
||||
data.info.text_modules = res.data.text_modules || []
|
||||
data.info.gallery = res.data.gallery || []
|
||||
// 如果商品设置了起购
|
||||
data.num = 1
|
||||
if(res.data.limit_type == 1) {
|
||||
data.num = parseInt(res.data.start_sale_num)
|
||||
}
|
||||
if(data.shortStatus == 0) {
|
||||
data.info.stock = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 数量-减
|
||||
function minusNum() {
|
||||
// 如果设置了起购&&起购数量与现有数量相等、现有数量为1 不可减
|
||||
if((data.info.limit_type == 1 && data.num == parseInt(data.info.start_sale_num)) || data.num == 1) {
|
||||
|
||||
} else {
|
||||
data.num -= 1
|
||||
}
|
||||
}
|
||||
|
||||
// 数量-加
|
||||
function plusNum() {
|
||||
// 如果设置了限购&&起购数量与现有数量相等、现有数量大于等于库存 不可加
|
||||
if((data.info.limit_type == 2 && data.num == parseInt(data.info.limit)) || (data.num >= data.info.stock)) {
|
||||
|
||||
} else {
|
||||
data.num += 1
|
||||
}
|
||||
}
|
||||
|
||||
const viewImg = (img) => {
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: [img]
|
||||
})
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
const preventD = () => {
|
||||
return
|
||||
}
|
||||
|
||||
function addCart() {
|
||||
let params = {
|
||||
num: data.num,
|
||||
shop_goods_id: data.id,
|
||||
shop_goods_sku_id: 0,
|
||||
shop_group_goods_id: data.groupId,
|
||||
source_id: 0,
|
||||
source_type: 'normal'
|
||||
}
|
||||
post('/api/v1/carts', params).then((res) => {
|
||||
context.emit('refresh')
|
||||
})
|
||||
}
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
if (newProps.show) {
|
||||
data.show = true
|
||||
data.id = newProps.id
|
||||
data.groupId = newProps.groupId
|
||||
data.canBuy = newProps.canBuy
|
||||
data.shortStatus = newProps.shortStatus
|
||||
data.show_stock = newProps.show_stock
|
||||
getSpecInfo()
|
||||
} else {
|
||||
data.show = false
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getSpecInfo,
|
||||
handleClose,
|
||||
viewImg,
|
||||
preventD,
|
||||
minusNum,
|
||||
plusNum,
|
||||
addCart
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.skuBox{
|
||||
background: #fff;
|
||||
height: 78vh;
|
||||
overflow: hidden;
|
||||
.oneBox{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
image{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.box{
|
||||
width: calc(100% - 220rpx);
|
||||
.tit{
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.pricebox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin: 8rpx 0 20rpx;
|
||||
.text1{
|
||||
font-size: 34rpx;
|
||||
color: #f66d2d;
|
||||
font-weight: 600;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.icon1{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.vip{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 34rpx;
|
||||
color: #f66d2d;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.vip-tag {
|
||||
font-size: 32rpx;
|
||||
color: #fbe6c3;
|
||||
background: #353648;
|
||||
border-radius: 20rpx 0 0 0;
|
||||
padding: 8rpx 10rpx;
|
||||
line-height: 1;
|
||||
text{
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.scrollbox{
|
||||
width: 100%;
|
||||
height: calc(78vh - 358rpx);
|
||||
}
|
||||
.twoBox{
|
||||
font-size: 28rpx;
|
||||
padding: 30rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 1rpx solid #eee;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.stepper{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.flex{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.num{
|
||||
width: 80rpx;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.minus{
|
||||
border: 1px solid v-bind('Color');
|
||||
}
|
||||
.plus{
|
||||
background-color: v-bind('Color');
|
||||
}
|
||||
}
|
||||
}
|
||||
.sku-buy{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
.img{
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-left: -10rpx;
|
||||
border: 4rpx solid #fff;
|
||||
box-sizing: border-box;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
.num{
|
||||
color: v-bind('Color');
|
||||
}
|
||||
}
|
||||
}
|
||||
.edition{
|
||||
padding-bottom: 50rpx;
|
||||
.edition_box{
|
||||
margin: 8rpx 0;
|
||||
position: relative;
|
||||
padding: 0 20rpx;
|
||||
.img{
|
||||
width: 100%;
|
||||
}
|
||||
.small_img{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
.imgs{
|
||||
width: calc(33% - 11rpx);
|
||||
height: 220rpx;
|
||||
margin: 16rpx 16rpx 0 0;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
.imgs:nth-child(3n+3){
|
||||
margin: 16rpx 0 0 0;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
line-height: 55rpx;
|
||||
font-size: 30rpx;
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
.imgbox{
|
||||
padding: 20rpx 0;
|
||||
.img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
height: 110rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
background-color: v-bind('Color');
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
&.dis{
|
||||
opacity: 0.65;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
178
components/newVip/index.vue
Normal file
178
components/newVip/index.vue
Normal file
@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<!-- 新人专享优惠 -->
|
||||
<up-overlay :show="showVan" :zIndex="9999" class="new_overlay">
|
||||
<view class="serviceBox" @click="close()">
|
||||
<view class="block" @click.stop="preventD">
|
||||
<view class="title">恭喜获得</view>
|
||||
<view class="close" @click="close()"><up-icon name="close" /></view>
|
||||
<view class="box">
|
||||
<view v-for="it in couponInfo" :key="it.id" class="openbox">
|
||||
<image src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2022/11/08/l5SAwF75s4IQ5tglcLQo5bUlfixoFtnODw5CH4hT.png" mode="widthFix" class="image" />
|
||||
<view class="coupon">
|
||||
<view class="coupon-left">
|
||||
<text class="sign">¥<text class="money">{{it.amount * 1}}</text></text>
|
||||
<view class="desc" v-if="it.full_amount * 1 == 0">无门槛</view>
|
||||
<view class="desc" v-else>满{{it.full_amount * 1}}减{{it.amount * 1}}</view>
|
||||
</view>
|
||||
<view class="coupon-right">
|
||||
<view class="tit">新人专享优惠</view>
|
||||
<view class="text">所有团可用</view>
|
||||
<text class="time">有效期{{it.valid_days}}天</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @click="getHandle()">领取</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { showToast } from '../common.js'
|
||||
export default {
|
||||
props: {
|
||||
showVan: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
couponInfo: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
|
||||
})
|
||||
|
||||
function getHandle() {
|
||||
post('/api/v1/userCoupon/newUser/receive').then((res) => {
|
||||
showToast('领取成功')
|
||||
close()
|
||||
}).catch(() => {
|
||||
close()
|
||||
})
|
||||
}
|
||||
const preventD = () => {
|
||||
return
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
getHandle,
|
||||
preventD,
|
||||
close
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.serviceBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
padding-bottom: 80rpx;
|
||||
box-sizing: border-box;
|
||||
.block{
|
||||
width: 80%;
|
||||
background: #fff;
|
||||
padding-bottom: 80rpx;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
.close{
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
}
|
||||
.title{
|
||||
padding: 40rpx 0;
|
||||
color: #333;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.box{
|
||||
max-height: 450px;
|
||||
overflow: auto;
|
||||
}
|
||||
.openbox{
|
||||
margin: 0 auto;
|
||||
width: 86%;
|
||||
position: relative;
|
||||
.image{
|
||||
width: 100%;
|
||||
}
|
||||
.coupon{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
.coupon-left {
|
||||
width: 36%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
color: #F14939;
|
||||
.sign {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.money {
|
||||
font-size: 60rpx;
|
||||
}
|
||||
.desc{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.coupon-right {
|
||||
width: 64%;
|
||||
padding-left: 36rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
.tit {
|
||||
font-size: 32rpx;
|
||||
color: #F14939;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
.text{
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.time {
|
||||
font-size: 20rpx;
|
||||
color: #9C9C9C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
margin: 40rpx auto 0;
|
||||
width: 86%;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14939;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
132
components/order/CancelOrder.vue
Normal file
132
components/order/CancelOrder.vue
Normal file
@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<!-- 取消订单弹窗 -->
|
||||
<view class="">
|
||||
<up-popup :show="showCancel" mode="bottom" :round="10" @close="close" catchtouchmove="preventD">
|
||||
<view class="cancel">
|
||||
<view class="cancel-title">订单取消</view>
|
||||
<view class="tip">请选择取消订单原因</view>
|
||||
<view class="cancel-list">
|
||||
<view class="cancel-list-item" v-for="item in list" :key="item.id" @click="checked = item.id">
|
||||
<text>{{item.name}}</text>
|
||||
<span class="iconfont icon-checked" v-if="item.id === checked"></span>
|
||||
<span class="iconfont icon-circle" v-else></span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancel-btn">
|
||||
<view class="btn1" @click="close">暂不取消</view>
|
||||
<view class="btn2" @click="cancelOrder">确定取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs } from 'vue'
|
||||
import { showToast } from '../common.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
showCancel: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
list: [
|
||||
{ id: 0, name: '价格有点贵' },
|
||||
{ id: 1, name: '规格/款式/数量拍错' },
|
||||
{ id: 2, name: '收货地址拍错' },
|
||||
{ id: 3, name: '暂时不需要了' },
|
||||
{ id: 4, name: '其他' }
|
||||
],
|
||||
checked: '',
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
cartColor: Style[uni.getStorageSync('theme_index') * 1].cartColor
|
||||
})
|
||||
|
||||
function change(e) {
|
||||
console.log(e)
|
||||
data.checked = e.detail
|
||||
}
|
||||
|
||||
function cancelOrder() {
|
||||
if (data.checked !== '') {
|
||||
context.emit('cancelOrder', data.list[Number(data.checked)].name)
|
||||
data.checked = ''
|
||||
} else {
|
||||
showToast('请选择取消订单原因')
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
data.checked = ''
|
||||
}
|
||||
|
||||
function preventD() {
|
||||
return
|
||||
}
|
||||
return {
|
||||
...toRefs(data),
|
||||
close,
|
||||
change,
|
||||
cancelOrder,
|
||||
preventD
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel {
|
||||
font-size: 28rpx;
|
||||
padding: 30rpx 30rpx;
|
||||
&-title {
|
||||
text-align: center;
|
||||
padding: 0 0 20rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 5rpx;
|
||||
}
|
||||
.tip {
|
||||
color: #98989f;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
&-list {
|
||||
padding-bottom: 60rpx;
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-btn {
|
||||
display: flex;
|
||||
.btn1,
|
||||
.btn2 {
|
||||
width: 50%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
.btn1 {
|
||||
background-color: v-bind('cartColor');
|
||||
border-radius: 40rpx 0px 0px 40rpx;
|
||||
}
|
||||
.btn2 {
|
||||
background-color: v-bind('Color');
|
||||
border-radius: 0rpx 40rpx 40rpx 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.icon-checked{
|
||||
color: v-bind('Color');
|
||||
}
|
||||
</style>
|
||||
322
components/order/chooseAddr.vue
Normal file
322
components/order/chooseAddr.vue
Normal file
@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup :show="showPopup" mode="bottom" :round="10" @close="close" catchtouchmove="preventD">
|
||||
<view class="topTitle">选择地址</view>
|
||||
<view class="listbox">
|
||||
<view class="row flex1" v-for="(item, index) in addrList" :key="item.id" @click="selectAddr(item)">
|
||||
<span class="iconfont icon-checked" v-if="item.id === addr_id"></span>
|
||||
<span class="iconfont icon-circle" v-else></span>
|
||||
<view class="txt">
|
||||
<text>{{item.name}} {{item.mobile}}</text><text v-if="item.is_default === 1" class="default">默认</text><br>
|
||||
<text>
|
||||
{{item.province && item.province.name}}{{item.city && item.city.name}}{{item.area && item.area.name}}{{item.address}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="addrList.length === 0">
|
||||
<van-empty image="https://ct-upimg.yx090.com/g.ii090/images/sprite/empty/address.png" description="暂无地址信息" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom flex" @click="showAddr = true"><van-icon name="plus" color="#fff" size="18" />添加新地址</view>
|
||||
|
||||
<!-- 新增、编辑地址 -->
|
||||
<up-popup :show="showAddr" mode="bottom" :round="10" close-on-click-overlay closeable @close="showAddr = false">
|
||||
<view class="addrbox">
|
||||
<view class="title">添加地址</view>
|
||||
<view class="box">
|
||||
<view class="row_it flex1">
|
||||
<text>收件人</text>
|
||||
<input v-model="addrData.name" class="inpt" placeholder="请输入收件人姓名" />
|
||||
</view>
|
||||
<view class="row_it flex1">
|
||||
<text>联系电话</text>
|
||||
<input v-model="addrData.mobile" class="inpt" placeholder="请输入收件人联系电话" />
|
||||
</view>
|
||||
<view class="row_it flex1" @click="showArea = true">
|
||||
<text>位置</text>
|
||||
<view style="flex: 1;">
|
||||
<uni-data-picker
|
||||
placeholder="请选择"
|
||||
popup-title="请选择"
|
||||
:localdata="areaList"
|
||||
v-model="addrData.area_id"
|
||||
@change="chooseArea"
|
||||
:map="{text:'name',value:'id'}">
|
||||
</uni-data-picker>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="row_it flex1">
|
||||
<text>详细地址</text>
|
||||
<input v-model="addrData.address" class="inpt" placeholder="请输入详细地址" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
<view class="btn flex" @click="commitAddress()">保存并使用</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { showToast } from '../common.js'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { areaList } from '@/components/areaList.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
addrId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
showPopup: false,
|
||||
addrList: [
|
||||
{}
|
||||
],
|
||||
addr_id: '',
|
||||
showAddr: false,
|
||||
curAddrId: '',
|
||||
curAddrIndex: '',
|
||||
addrData: {
|
||||
comment: ''
|
||||
},
|
||||
areaNames: '',
|
||||
areaId: '',
|
||||
showArea: false,
|
||||
Color: uni.getStorageSync('theme_color')
|
||||
})
|
||||
|
||||
async function getAddrList() {
|
||||
await get(`/api/v1/address`).then((res) => {
|
||||
data.addrList = res.data
|
||||
})
|
||||
}
|
||||
|
||||
function selectAddr(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要修改当前订单的地址吗?',
|
||||
confirmColor: '#42b983',
|
||||
success(res) {
|
||||
if(res.confirm) {
|
||||
data.addr_id = item.id
|
||||
close()
|
||||
context.emit('choose', item)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function commitAddress() {
|
||||
if(!data.addrData.name) {
|
||||
showToast('请输入收件人姓名')
|
||||
return
|
||||
}
|
||||
if(!data.addrData.mobile) {
|
||||
showToast('请输入收件人联系电话')
|
||||
return
|
||||
}
|
||||
if(!data.addrData.area_id) {
|
||||
showToast('请选择位置信息')
|
||||
return
|
||||
}
|
||||
if(!data.addrData.address) {
|
||||
showToast('请输入详细地址')
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
name: data.addrData.name,
|
||||
mobile: data.addrData.mobile,
|
||||
province_id: data.addrData.province_id,
|
||||
city_id: data.addrData.city_id,
|
||||
area_id: data.addrData.area_id,
|
||||
address: data.addrData.address,
|
||||
postal_code: '',
|
||||
is_default: 0
|
||||
}
|
||||
post(`/api/v1/address`, params).then(async (res) => {
|
||||
await getAddrList()
|
||||
data.showAddr = false
|
||||
resetPopup()
|
||||
})
|
||||
}
|
||||
|
||||
function chooseArea(e) {
|
||||
console.log(e)
|
||||
if(e.detail.value.length) {
|
||||
let list = []
|
||||
for (let i = 0; i < e.detail.value.length; i++) {
|
||||
if (e.detail.value[i].text === '') {
|
||||
showToast('请选择完整地区信息')
|
||||
return
|
||||
}
|
||||
list.push({id: e.detail.value[i].value, name: e.detail.value[i].text})
|
||||
}
|
||||
|
||||
data.addrData.province_id = list[0].id
|
||||
data.addrData.city_id = list[1].id
|
||||
data.addrData.area_id = list[2].id
|
||||
} else {
|
||||
data.addrData.province_id = ''
|
||||
data.addrData.city_id = ''
|
||||
data.addrData.area_id = ''
|
||||
}
|
||||
}
|
||||
|
||||
function resetPopup() {
|
||||
data.curAddrId = ''
|
||||
data.addrData.name = ''
|
||||
data.addrData.mobile = ''
|
||||
data.addrData.address = ''
|
||||
data.areaId = ''
|
||||
data.areaNames = ''
|
||||
}
|
||||
|
||||
function close() {
|
||||
data.showPopup = false
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
function preventD() {
|
||||
return
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if (newProps.show) {
|
||||
data.addr_id = newProps.addrId
|
||||
data.showPopup = true
|
||||
getAddrList()
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
areaList,
|
||||
...toRefs(data),
|
||||
close,
|
||||
selectAddr,
|
||||
getAddrList,
|
||||
resetPopup,
|
||||
commitAddress,
|
||||
chooseArea,
|
||||
preventD
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.flex1{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.topTitle{
|
||||
font-size: 30rpx;
|
||||
color: #303030;
|
||||
font-weight: bold;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
.listbox{
|
||||
height: 65vh;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
.row{
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
.txt{
|
||||
padding: 24rpx 0;
|
||||
width: calc(100% - 60rpx);
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
}
|
||||
text{
|
||||
line-height: 50rpx;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.default{
|
||||
padding: 2rpx 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: v-bind('Color');
|
||||
border: 1px solid v-bind('Color');
|
||||
border-radius: 6rpx;
|
||||
line-height: 1;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom{
|
||||
width: 92%;
|
||||
height: 90rpx;
|
||||
background: v-bind('Color');
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
border-radius: 90rpx;
|
||||
margin: 24rpx auto;
|
||||
}
|
||||
|
||||
.addrbox{
|
||||
padding: 0 30rpx 40rpx;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
color: #303030;
|
||||
font-weight: bold;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
.box{
|
||||
padding-bottom: 200rpx;
|
||||
.row_it{
|
||||
padding: 20rpx 0;
|
||||
font-size: 28rpx;
|
||||
text{
|
||||
width: 130rpx;
|
||||
display: block;
|
||||
}
|
||||
.inpt{
|
||||
width: calc(100% - 130rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
.anniu{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
.btn{
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
border-radius: 80rpx;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid v-bind('Color');
|
||||
color: #fff;
|
||||
background: v-bind('Color');
|
||||
}
|
||||
}
|
||||
}
|
||||
.icon-checked{
|
||||
color: v-bind('Color');
|
||||
}
|
||||
</style>
|
||||
120
components/order/urgeDelivery.vue
Normal file
120
components/order/urgeDelivery.vue
Normal file
@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<!-- 催发货 -->
|
||||
<view class="">
|
||||
<up-popup :show="show" mode="bottom" :round="10" @close="close()" closeable>
|
||||
<view class="urgwBox">
|
||||
<view class="success"><up-icon name="checkbox-mark" size="36" :color="Color" /></view>
|
||||
<view class="title">已提醒卖家尽快发货</view>
|
||||
<view v-if="urge_status === 0" class="info">
|
||||
<template v-if="orderInfo.delivery_time">卖家承诺最晚于<text>{{orderInfo.delivery_time}}</text>发货</template>
|
||||
</view>
|
||||
<view v-else class="info">卖家超时发货,<template v-if="urge_status === 2 && deduct_amount">为您补偿<text>{{deduct_amount}}</text>元优惠券,<br>已自动发放到账户,</template>团长联系卖家尽快发货</view>
|
||||
<view class="box">
|
||||
<view class="btn" @click="comfirm()">联系团长</view>
|
||||
<view class="btn btn1" @click="close()">我知道了</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { typeList, returnList, refundList, Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
info: Object
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
deduct_amount: 0,
|
||||
urge_status: 0,
|
||||
orderInfo: {},
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
bgColor: Style[uni.getStorageSync('theme_index') * 1].bgColor
|
||||
})
|
||||
watch(props, (newProps) => {
|
||||
if (newProps.show) {
|
||||
data.orderInfo = newProps.info
|
||||
data.deduct_amount = newProps.info.deduct_amount
|
||||
console.log(typeof newProps.info.urge_status, newProps.info.urge_status)
|
||||
data.urge_status = newProps.info.urge_status
|
||||
}
|
||||
})
|
||||
|
||||
function comfirm() {
|
||||
close()
|
||||
context.emit('contactTeamer', data.orderInfo.id)
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
close,
|
||||
comfirm
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.urgwBox {
|
||||
padding: 70rpx 30rpx 30rpx;
|
||||
.success{
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: v-bind('bgColor');
|
||||
border-radius: 50%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #2c2c2c;
|
||||
margin: 60rpx 0 20rpx;
|
||||
}
|
||||
.info{
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
color: #666;
|
||||
}
|
||||
.box{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.btn {
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
border: 1px solid #9D9D9D;
|
||||
box-sizing: border-box;
|
||||
width: 48%;
|
||||
&.btn1{
|
||||
background-color: v-bind('Color');
|
||||
color: #fff;
|
||||
border: 1px solid v-bind('Color');
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
119
components/privacyPopup/index.vue
Normal file
119
components/privacyPopup/index.vue
Normal file
@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<up-popup :show="showDialog" round mode="bottom" @close="close()" catchtouchmove="preventD" :zIndex="202">
|
||||
<view class="pageBox">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="box">
|
||||
<view class="text">为给您提供更好的服务,允许我们在必要场景下,合理使用您的个人信息,并充分保障您的合法权利。
|
||||
请您在使用前仔细查阅以下协议条款,点击"允许"即表示您已阅读并同意对应的协议内容。
|
||||
</view>
|
||||
<view class="link" @click="openPrivacyContract">《隐私协议》</view>
|
||||
</view>
|
||||
<view class="btnbox">
|
||||
<button type="default" open-type="agreePrivacyAuthorization" id="agree-btn" class="agree" @agreeprivacyauthorization="handleAgree">允许</button>
|
||||
<view class="btn" @click="refuse()">拒绝</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs } from 'vue'
|
||||
import { get, post } from '@/api/request.js'
|
||||
export default {
|
||||
props: {
|
||||
showDialog: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
Color: uni.getStorageSync('theme_color')
|
||||
})
|
||||
|
||||
function handleAgree() {
|
||||
context.emit('agree')
|
||||
}
|
||||
|
||||
const preventD = () => {
|
||||
return
|
||||
}
|
||||
|
||||
function openPrivacyContract() {
|
||||
uni.openPrivacyContract({
|
||||
success: res => {
|
||||
console.log('openPrivacyContract success')
|
||||
},
|
||||
fail: res => {
|
||||
console.error('openPrivacyContract fail', res)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 拒绝
|
||||
function refuse() {
|
||||
context.emit('refuse')
|
||||
}
|
||||
|
||||
function close() {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
handleAgree,
|
||||
openPrivacyContract,
|
||||
preventD,
|
||||
refuse,
|
||||
close
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pageBox{
|
||||
padding-bottom: 200rpx;
|
||||
.title{
|
||||
font-size: 32rpx;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
.box{
|
||||
padding: 0 30rpx;
|
||||
font-size: 28rpx;
|
||||
.text{
|
||||
color: #555;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.link{
|
||||
color: #155BD4;
|
||||
}
|
||||
}
|
||||
.btnbox{
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
margin-top: 60rpx;
|
||||
.agree {
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
background-color: v-bind('Color');
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.btn{
|
||||
padding: 30rpx 0;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1
components/scene.js
Normal file
1
components/scene.js
Normal file
@ -0,0 +1 @@
|
||||
export const provTxt = { 110000:'北京',120000:'天津',130000:'河北',140000:'山西',150000:'内蒙古',210000:'辽宁',220000:'吉林',230000:'黑龙江',310000:'上海',320000:'江苏',330000:'浙江',340000:'安徽',350000:'福建',360000:'江西',370000:'山东',410000:'河南',420000:'湖北',430000:'湖南',440000:'广东',450000:'广西',460000:'海南',500000:'重庆',510000:'四川',520000:'贵州',530000:'云南',540000:'西藏',610000:'陕西',620000:'甘肃',630000:'青海',640000:'宁夏',650000:'新疆',710000:'台湾',810000:'香港',820000:'澳门'}
|
||||
94
components/searchInput/index.vue
Normal file
94
components/searchInput/index.vue
Normal file
@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<!-- 搜索输入框 -->
|
||||
<view class="searchBox">
|
||||
<view class="cont">
|
||||
<view class="box">
|
||||
<up-icon name="search" size="17" color="#A8A8A8"></up-icon>
|
||||
<input class="input"
|
||||
:auto-focus="show"
|
||||
type="text"
|
||||
:value="keyword"
|
||||
placeholder="搜索商品"
|
||||
@input="getValue"
|
||||
@confirm="search" />
|
||||
</view>
|
||||
<view class="btn" @click="search">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
export default {
|
||||
props: {
|
||||
searchValue: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
Color: uni.getStorageSync('theme_color')
|
||||
})
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
if (newProps) {
|
||||
keyword.value = newProps.searchValue
|
||||
}
|
||||
})
|
||||
|
||||
const keyword = ref('')
|
||||
function getValue(e) {
|
||||
keyword.value = e.detail.value
|
||||
context.emit('getvalue', e.detail.value)
|
||||
}
|
||||
|
||||
function search() {
|
||||
context.emit('searchBtn', keyword.value)
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
keyword,
|
||||
getValue,
|
||||
search
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBox{
|
||||
.cont{
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 10rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
.box{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
height: 66rpx;
|
||||
border-radius: 33rpx;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 30rpx;
|
||||
.input{
|
||||
font-size: 28rpx;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
color: v-bind('Color');
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 66rpx;
|
||||
width: 100rpx;
|
||||
height: 66rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
102
components/share/creatPoster.vue
Normal file
102
components/share/creatPoster.vue
Normal file
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<!-- 分享海报 -->
|
||||
<div class="content">
|
||||
<div class="share">
|
||||
<image class="poster" :src="posterImg" show-menu-by-longpress="{{true}}"
|
||||
@load="imgLoad"
|
||||
:style="{ width: imgWidth + 'px', height: imgHeight + 'px' }"
|
||||
></image>
|
||||
<view class="close" @click="closeShow"><up-icon name="close" color="#fff" size="26"/></view>
|
||||
<text>长按图片分享好友</text>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
export default {
|
||||
props: {
|
||||
posterImg: String
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
imgWidth: 1,
|
||||
imgHeight: 1
|
||||
})
|
||||
|
||||
// 关闭
|
||||
function closeShow() {
|
||||
context.emit('closeShow')
|
||||
}
|
||||
|
||||
function imgLoad(e) {
|
||||
let imgWidth = e.detail.width
|
||||
let imgHeight = e.detail.height
|
||||
let pWid = uni.getSystemInfoSync().windowWidth
|
||||
let pHig = uni.getSystemInfoSync().windowHeight
|
||||
let imgRate = imgWidth / imgHeight
|
||||
let pRate = pWid / pHig
|
||||
// 先判断图片宽高值
|
||||
if(imgWidth > imgHeight) {
|
||||
// 如果图片宽度大于屏幕宽度,就把图片宽度设为屏幕的宽度,高度设为其比例
|
||||
if(imgWidth > pWid) {
|
||||
data.imgWidth = pWid
|
||||
data.imgHeight = (pWid / imgRate).toFixed(2)
|
||||
} else {
|
||||
data.imgWidth = imgWidth
|
||||
data.imgHeight = imgHeight
|
||||
}
|
||||
} else {
|
||||
if(imgHeight > pHig * 0.65) {
|
||||
data.imgWidth = (pHig * 0.65 * imgRate).toFixed(2)
|
||||
data.imgHeight = (pHig * 0.65).toFixed(2)
|
||||
} else {
|
||||
data.imgWidth = imgWidth
|
||||
data.imgHeight = imgHeight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
closeShow,
|
||||
imgLoad
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba($color: #000000, $alpha: 0.7);
|
||||
z-index: 1001;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.share{
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
.close{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -70rpx;
|
||||
}
|
||||
text{
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.poster{
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
120
components/share/share.vue
Normal file
120
components/share/share.vue
Normal file
@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<div class="shareBox" v-if="showShare" @click="close">
|
||||
<div class="box1">
|
||||
<view class="share">
|
||||
<view class="share-btn">
|
||||
<button class="share-btn-item" v-for="(item, index) in iconList" :key="index"
|
||||
@click="shareBtn(index)" :open-type="index === 5 ? 'share' : ''">
|
||||
<view class="icon" :class="item.icon" :style="{backgroundImage: 'url(' + sp2 + ')'}"></view>
|
||||
<text>{{item.text}}</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="share-cancel" @click="close">取消</view>
|
||||
</view>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { post } from '@/api/request.js'
|
||||
import { sp2 } from '@/components/img.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
showShare: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
sp2: sp2,
|
||||
iconList: [
|
||||
{ icon: 'wechat', text: '分享到微信' },
|
||||
{ icon: 'friends', text: '分享到朋友圈' },
|
||||
{ icon: 'link', text: '复制链接' }
|
||||
]
|
||||
})
|
||||
|
||||
const shareBtn = (index) => {
|
||||
close()
|
||||
if (index === 0) {
|
||||
context.emit('getSaleShare')
|
||||
} else if (index === 1) {
|
||||
context.emit('creatShare')
|
||||
} else {
|
||||
context.emit('getLink')
|
||||
}
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
shareBtn,
|
||||
close
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.shareBox{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
.box1 {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.share {
|
||||
&-btn {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #d5d5d5;
|
||||
&-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
.icon{
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 452px 408px;
|
||||
background-position: -15px -15.67px;
|
||||
&.wechat{
|
||||
background-position: -15px -15.67px;
|
||||
}
|
||||
&.friends{
|
||||
background-position: -68.33px -15.67px;
|
||||
}
|
||||
&.link{
|
||||
background-position: -121.33px -15.67px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-cancel {
|
||||
height: 110rpx;
|
||||
text-align: center;
|
||||
line-height: 110rpx;
|
||||
font-size: 30rpx;
|
||||
color: #656565;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
110
components/share/vanShare.vue
Normal file
110
components/share/vanShare.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div class="box" v-if="showShare" @click="close">
|
||||
<div class="box1">
|
||||
<view class="share">
|
||||
<view class="share-btn">
|
||||
<button class="share-btn-item" v-for="(item, index) in iconList" :key="index" @click="shareBtn(index)" :open-type="index === 5 ? 'share' : ''">
|
||||
<view class="img" :class="'img' + index" :style="{backgroundImage: 'url(' + sp2 + ')'}"></view>
|
||||
<text>{{item}}</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="share-cancel" @click="close">取消</view>
|
||||
</view>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { post } from '@/api/request.js'
|
||||
import { sp2 } from '@/components/img.js'
|
||||
export default {
|
||||
props: {
|
||||
showShare: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
iconList: ['分享到朋友圈', '复制链接'],
|
||||
sp2: sp2
|
||||
})
|
||||
|
||||
const shareBtn = (index) => {
|
||||
close()
|
||||
if (index === 0) {
|
||||
context.emit('creatShare')
|
||||
} else {
|
||||
context.emit('getLink')
|
||||
}
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
context.emit('close')
|
||||
}
|
||||
return {
|
||||
...toRefs(data),
|
||||
shareBtn,
|
||||
close
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
.box1 {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
.img{
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 452px 408px;
|
||||
background-position: -15px -15.67px;
|
||||
&.img1{
|
||||
background-position: -121.33px -15.67px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.share {
|
||||
&-btn {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #d5d5d5;
|
||||
&-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-cancel {
|
||||
height: 110rpx;
|
||||
text-align: center;
|
||||
line-height: 110rpx;
|
||||
font-size: 36rpx;
|
||||
color: #656565;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
276
components/shareImg/shareImg.vue
Normal file
276
components/shareImg/shareImg.vue
Normal file
@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<!-- 分享海报 -->
|
||||
<view class="share" @click="closeShow" catchtouchmove="preventD">
|
||||
<view class="box" v-show="!showPrivacy">
|
||||
<canvas class="canvas" id="myCanvas" canvas-id="myCanvas" @click.stop></canvas>
|
||||
<view class="btn" @tap.stop="saveImage">保存图片</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 隐私协议弹窗 -->
|
||||
<privacy-popup :show-dialog="showPrivacy" @close="showPrivacy = false" @agree.stop="showPrivacy = false" @refuse="showPrivacy = false" />
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
|
||||
import { getOldDay, saveImg, judgePrivacy, showToast } from '../common.js'
|
||||
import { post } from '@/api/request.js'
|
||||
import api from '@/api/index.js'
|
||||
import privacyPopup from '../privacyPopup/index.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
privacyPopup
|
||||
},
|
||||
props: {
|
||||
goods: Object
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
canvasWidth: {},
|
||||
ctx: null,
|
||||
showImage: '',
|
||||
avatar: '',
|
||||
faceImg: '',
|
||||
loading: false,
|
||||
shareImg: '',
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
showPrivacy: false
|
||||
})
|
||||
|
||||
// 关闭
|
||||
function closeShow() {
|
||||
context.emit('closeShow')
|
||||
}
|
||||
|
||||
function draw1() {
|
||||
data.ctx.setFontSize(20)
|
||||
data.ctx.setFillStyle('white')
|
||||
data.ctx.fillRect(0, 0, data.canvasWidth.width || 275, data.canvasWidth.height || 470)
|
||||
data.ctx.drawImage(data.avatar, 15, 10, 30, 30)
|
||||
data.ctx.setFontSize(12)
|
||||
data.ctx.setFillStyle('#666666')
|
||||
var nickname = uni.getStorageSync('nickname')
|
||||
data.ctx.fillText(nickname, 50, 20)
|
||||
data.ctx.setFontSize(11)
|
||||
data.ctx.setFillStyle('#999999')
|
||||
data.ctx.fillText(getOldDay(), 50, 40)
|
||||
data.ctx.drawImage(data.faceImg, 15, 50, 245, 245)
|
||||
data.ctx.font = 'warp bold 15px Arial,sans-serif '
|
||||
data.ctx.setFillStyle('#111111')
|
||||
toFormateStr(data.ctx, props.goods.title, 15, 315, 15, 230, 1)
|
||||
data.ctx.setFontSize(12)
|
||||
data.ctx.setFillStyle('#999999')
|
||||
toFormateStr(data.ctx, props.goods.description.replace(/\s+/g, ''), 15, 335, 15, 230, 3)
|
||||
data.ctx.setFontSize(12)
|
||||
data.ctx.setFillStyle('#F14939')
|
||||
let price = ''
|
||||
if (props.goods.goods_size > 1) {
|
||||
if (parseInt(props.goods.max_price) < parseInt(props.goods.min_price)) {
|
||||
price = props.goods.max_price + '~' + props.goods.min_price
|
||||
} else {
|
||||
price = props.goods.min_price + '~' + props.goods.max_price
|
||||
}
|
||||
} else {
|
||||
if (props.goods.group_goods[0].specs_type === 0) {
|
||||
price = props.goods.group_goods[0].price
|
||||
} else {
|
||||
if (props.goods.group_goods[0].max_price === props.goods.group_goods[0].min_price) {
|
||||
price = props.goods.group_goods[0].min_price
|
||||
} else if (
|
||||
parseInt(props.goods.group_goods[0].max_price) <
|
||||
parseInt(props.goods.group_goods[0].min_price)
|
||||
) {
|
||||
price = props.goods.group_goods[0].max_price + '~' + props.goods.group_goods[0].min_price
|
||||
} else {
|
||||
price = props.goods.group_goods[0].min_price + '~' + props.goods.group_goods[0].max_price
|
||||
}
|
||||
}
|
||||
}
|
||||
data.ctx.fillText('¥', 15, 400)
|
||||
data.ctx.setFontSize(15)
|
||||
data.ctx.fillText(price, 27, 400)
|
||||
data.ctx.setFillStyle('rgba(246, 246, 246, 0.9)')
|
||||
data.ctx.fillRect(15, 410, 130, 55)
|
||||
data.ctx.setFontSize(11)
|
||||
data.ctx.setFillStyle('#999999')
|
||||
data.ctx.fillText('长按识别图中小程序', 25, 430)
|
||||
data.ctx.fillText('跟团购买>>', 25, 450)
|
||||
data.ctx.drawImage(data.showImage, 165, 375, 90, 90)
|
||||
data.ctx.draw()
|
||||
}
|
||||
|
||||
// 文本换行
|
||||
function toFormateStr(
|
||||
ctx,
|
||||
content,
|
||||
drawX, // 15
|
||||
drawY, // 335
|
||||
lineHeight, // 15
|
||||
lineMaxWidth, // 230
|
||||
lineNum // 3
|
||||
) {
|
||||
var drawTxt = '' // 当前绘制的内容
|
||||
var drawLine = 1 // 第几行开始绘制
|
||||
var drawIndex = 0 // 当前绘制内容的索引
|
||||
|
||||
// 判断内容是否可以一行绘制完毕
|
||||
if (ctx.measureText(content).width <= lineMaxWidth) {
|
||||
ctx.fillText(content.substring(drawIndex, i), drawX, drawY)
|
||||
} else {
|
||||
for (var i = 0; i < content.length; i++) {
|
||||
drawTxt += content[i]
|
||||
if (ctx.measureText(drawTxt).width >= lineMaxWidth) {
|
||||
if (drawLine >= lineNum) {
|
||||
ctx.fillText(content.substring(drawIndex, i) + '..', drawX, drawY)
|
||||
break
|
||||
} else {
|
||||
ctx.fillText(content.substring(drawIndex, i + 1), drawX, drawY)
|
||||
drawIndex = i + 1
|
||||
drawLine += 1
|
||||
drawY += lineHeight
|
||||
drawTxt = ''
|
||||
}
|
||||
} else {
|
||||
// 内容绘制完毕,但是剩下的内容宽度不到lineMaxWidth
|
||||
if (i === content.length - 1) {
|
||||
ctx.fillText(content.substring(drawIndex), drawX, drawY)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取单张图片信息
|
||||
const getImageInfo = async (imgSrc) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image.path)
|
||||
},
|
||||
fail(err) {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
// 获取页面二维码
|
||||
const getImg = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: api.url + '/api/v1/user/code',
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: 'pages/groups/index',
|
||||
shop_goods_id: props.goods.id
|
||||
},
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || '',
|
||||
appid: api.appId
|
||||
},
|
||||
responseType: 'arraybuffer',
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
let base64 = ''
|
||||
const bytes = new Uint8Array(res.data)
|
||||
const len = bytes.byteLength
|
||||
for (let i = 0; i < len; i++) {
|
||||
base64 += String.fromCharCode(bytes[i])
|
||||
}
|
||||
base64 = `data:image/png;base64,${btoa(base64)}`
|
||||
resolve(base64)
|
||||
} else {
|
||||
reject('')
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '海报生成中...'
|
||||
})
|
||||
const instance = getCurrentInstance()
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(instance)
|
||||
query.select('#myCanvas').boundingClientRect(async (res) => {
|
||||
console.log(res)
|
||||
data.canvasWidth = res || {}
|
||||
data.ctx = uni.createCanvasContext('myCanvas', instance)
|
||||
data.avatar = await getImageInfo(uni.getStorageSync('avatar'))
|
||||
data.faceImg = await getImageInfo(props.goods.face_img)
|
||||
data.showImage = await getImg()
|
||||
await draw1()
|
||||
uni.hideLoading()
|
||||
}).exec()
|
||||
}, 200)
|
||||
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
draw1,
|
||||
closeShow,
|
||||
getImg,
|
||||
getImageInfo
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async saveImage() {
|
||||
if(await judgePrivacy()) {
|
||||
this.showPrivacy = true
|
||||
return false
|
||||
}
|
||||
//保存到相册
|
||||
const _this = this
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
success(res) {
|
||||
saveImg(res.tempFilePath)
|
||||
},
|
||||
fail(err) {
|
||||
}
|
||||
}, _this)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.share {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba($color: #000000, $alpha: 0.7);
|
||||
z-index: 202;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.canvas {
|
||||
width: 275px;
|
||||
height: 470px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.btn {
|
||||
color: #fff;
|
||||
background-color: v-bind('Color');
|
||||
font-size: 30rpx;
|
||||
width: 340rpx;
|
||||
height: 76rpx;
|
||||
line-height: 76rpx;
|
||||
text-align: center;
|
||||
margin: 60rpx auto 0;
|
||||
border-radius: 76rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
210
components/shareImg/shareImg1.vue
Normal file
210
components/shareImg/shareImg1.vue
Normal file
@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<!-- 分享海报 -->
|
||||
<view class="share" @click="closeShow" catchtouchmove="preventD">
|
||||
<view v-show="!showPrivacy">
|
||||
<canvas class="canvas" id="myCanvas" canvas-id="myCanvas"></canvas>
|
||||
<view class="btn" @tap.stop="saveImage">保存图片</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 隐私协议弹窗 -->
|
||||
<privacy-popup :show-dialog="showPrivacy" @close="showPrivacy = false" @agree.stop="showPrivacy = false" @refuse="showPrivacy = false" />
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
|
||||
import { getOldDay, saveImg, judgePrivacy } from '../common.js'
|
||||
import { post } from '@/api/request.js'
|
||||
import api from '@/api/index.js'
|
||||
import privacyPopup from '../privacyPopup/index.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
privacyPopup
|
||||
},
|
||||
props: {
|
||||
shareImage: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
canvasWidth: {},
|
||||
ctx: null,
|
||||
showImage: '',
|
||||
avatar: '',
|
||||
faceImg: '',
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
showPrivacy: false,
|
||||
shareImage: '',
|
||||
rate: 0
|
||||
})
|
||||
|
||||
// 关闭
|
||||
function closeShow() {
|
||||
context.emit('closeShow')
|
||||
}
|
||||
|
||||
const getShareImg = async () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getImageInfo({
|
||||
src: props.shareImage,
|
||||
success: function(res) {
|
||||
data.rate = res.height / res.width
|
||||
resolve(res.path)
|
||||
},
|
||||
fail(err) {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function drawCanvas() {
|
||||
console.log(data.ctx)
|
||||
data.ctx.setFontSize(20)
|
||||
data.ctx.setFillStyle('white')
|
||||
data.ctx.fillRect(0, 0, data.canvasWidth.width, data.canvasWidth.height)
|
||||
data.ctx.drawImage(data.avatar, 20, 20, 40, 40)
|
||||
data.ctx.setFontSize(14)
|
||||
data.ctx.setFillStyle('#222')
|
||||
var nickname = uni.getStorageSync('nickname')
|
||||
data.ctx.fillText(nickname, 70, 35)
|
||||
data.ctx.setFontSize(13)
|
||||
data.ctx.setFillStyle('#777')
|
||||
data.ctx.fillText(getOldDay(), 70, 55)
|
||||
data.ctx.drawImage(data.shareImage, 30, 80, 211, 211 * data.rate)
|
||||
data.ctx.drawImage(data.faceImg, 90, 220, 92, 92)
|
||||
|
||||
data.ctx.draw()
|
||||
}
|
||||
|
||||
// 获取单张图片信息
|
||||
const getImageInfo = async (imgSrc) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image.path)
|
||||
},
|
||||
fail(err) {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
// 获取页面二维码
|
||||
const getFaceImg = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: api.url + '/api/v1/user/code',
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: 'pages/index/index'
|
||||
},
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('token') || '',
|
||||
appid: api.appId
|
||||
},
|
||||
responseType: 'arraybuffer',
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
let base64 = ''
|
||||
const bytes = new Uint8Array(res.data)
|
||||
const len = bytes.byteLength
|
||||
for (let i = 0; i < len; i++) {
|
||||
base64 += String.fromCharCode(bytes[i])
|
||||
}
|
||||
base64 = `data:image/png;base64,${btoa(base64)}`
|
||||
resolve(base64)
|
||||
} else {
|
||||
reject('')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
uni.showLoading({
|
||||
title: '二维码生成中...'
|
||||
})
|
||||
const instance = getCurrentInstance()
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(instance)
|
||||
query.select('#myCanvas').boundingClientRect(async (res) => {
|
||||
data.canvasWidth = res
|
||||
data.ctx = uni.createCanvasContext('myCanvas', instance)
|
||||
data.avatar = await getImageInfo(uni.getStorageSync('avatar'))
|
||||
data.faceImg = await getFaceImg()
|
||||
data.shareImage = await getShareImg()
|
||||
await drawCanvas()
|
||||
uni.hideLoading()
|
||||
}).exec()
|
||||
}, 200)
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
drawCanvas,
|
||||
closeShow,
|
||||
getFaceImg,
|
||||
getImageInfo,
|
||||
getShareImg
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async saveImage() {
|
||||
if(await judgePrivacy()) {
|
||||
this.showPrivacy = true
|
||||
return false
|
||||
}
|
||||
//保存到相册
|
||||
const _this = this
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
success(res) {
|
||||
saveImg(res.tempFilePath)
|
||||
},
|
||||
fail(err) {
|
||||
}
|
||||
}, _this)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.share {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba($color: #000000, $alpha: 0.7);
|
||||
z-index: 202;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
.canvas {
|
||||
width: 275px;
|
||||
height: 355px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.btn {
|
||||
color: #fff;
|
||||
background-color: v-bind('Color');
|
||||
font-size: 28rpx;
|
||||
width: 300rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
margin: 60rpx auto 0;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
132
components/shareSwiper/index.vue
Normal file
132
components/shareSwiper/index.vue
Normal file
@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<!-- 销售分享模板 -->
|
||||
<view>
|
||||
<up-overlay :show="showShareSwiper" @click="closeSwiper" z-index="1001">
|
||||
<view class="share">
|
||||
<swiper class="share-swiper" :indicator-dots="true" :circular="true" indicator-active-color="#fff"
|
||||
indicator-color="rgba(255, 255, 255, 0.4)" previous-margin='100rpx' next-margin='100rpx'
|
||||
:current="choose" @change="changeChoose">
|
||||
<swiper-item v-for="(item, index) in saleShareImg" :key="index">
|
||||
<button class="share-swiper-item" :open-type="index === choose ? 'share' : ''">
|
||||
<view class="shop" v-if="goodsInfo.shop">
|
||||
<image class="img" :src="goodsInfo.shop.logo"></image>
|
||||
<text>{{goodsInfo.shop.name}}</text>
|
||||
</view>
|
||||
<view class="title">{{goodsInfo.description}}</view>
|
||||
<image class="image" :src="item.image" mode="widthFix"></image>
|
||||
<view class="text">
|
||||
<image src="https://ct-upimg.yx090.com/ju8hn6/shop/image/2022/07/01/0jXVQFuf0rVJA0c8qLSAyCDsDtiHzOgodoIR0Fo3.png"
|
||||
mode="widthFix" class="img"></image>
|
||||
小程序
|
||||
</view>
|
||||
</button>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { post } from '../../api/request.js'
|
||||
export default {
|
||||
props: {
|
||||
showShareSwiper: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
saleShareImg: Array,
|
||||
goodsInfo: Object
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
choose: 0
|
||||
})
|
||||
const changeChoose = (e) => {
|
||||
data.choose = e.detail.current
|
||||
let img = props.saleShareImg[data.choose].image
|
||||
context.emit('changeShareImg', img)
|
||||
}
|
||||
const shareBtn = () => {}
|
||||
|
||||
const close = () => {
|
||||
context.emit('close')
|
||||
}
|
||||
const closeSwiper = () => {
|
||||
context.emit('closeSwiper')
|
||||
|
||||
}
|
||||
return {
|
||||
...toRefs(data),
|
||||
changeChoose,
|
||||
closeSwiper
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.share {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.share-swiper {
|
||||
position: absolute;
|
||||
transform: translate(-50%, -50%);
|
||||
top: 45%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
.share-swiper-item {
|
||||
width: 80%;
|
||||
margin: auto;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 30rpx 30rpx 0;
|
||||
text-align: start;
|
||||
line-height: 30rpx;
|
||||
.shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: #b3b3b3;
|
||||
.img {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background-color: #b3b3b3;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 20rpx 0;
|
||||
font-size: 30rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 100%;
|
||||
margin-bottom: 15rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
border-top: 2rpx solid #e1e1e1;
|
||||
padding-top: 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: #b3b3b3;
|
||||
padding-bottom: 25rpx;
|
||||
.img {
|
||||
width: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1118
components/sku/ChooseSku.vue
Normal file
1118
components/sku/ChooseSku.vue
Normal file
File diff suppressed because it is too large
Load Diff
2224
components/sku/directPay.vue
Normal file
2224
components/sku/directPay.vue
Normal file
File diff suppressed because it is too large
Load Diff
720
components/sku/multiple.vue
Normal file
720
components/sku/multiple.vue
Normal file
@ -0,0 +1,720 @@
|
||||
<template>
|
||||
<!-- 选规格弹窗 -->
|
||||
<view>
|
||||
<up-popup :show="showSku" mode="bottom" :round="10" @close="close" :safe-area-inset-bottom="true" catchtouchmove="preventD" :lock-scroll="true" :z-index="202">
|
||||
<view class="wholeBox">
|
||||
<view class="skuTop">
|
||||
<image class="img" :src="viewImg" @click="preViewImg(viewImg)" :style="{width: imgWidth + 'rpx', height: imgWidth + 'rpx'}" mode="aspectFill" />
|
||||
<view class="topInfo" :class="imgWidth == 200 ? '' : 'smallfont'">
|
||||
<view class="title" v-if="imgWidth == 200">{{skuInfo.title}}</view>
|
||||
<view class="priceBox">
|
||||
<!-- 会员下普通价格 -->
|
||||
<view class="text1" v-if="vipOn && chooseItem.vip_price > 0 && (is_vip || (!is_vip && vip_price_show))">
|
||||
<text class="icon1">¥</text>
|
||||
<text>{{chooseItem.price}}</text>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<!-- 显示会员价 -->
|
||||
<view v-if="vipOn && chooseItem.vip_price > 0 && (is_vip || (!is_vip && vip_price_show))" class="vip">
|
||||
<view class="vip-tag"><text class="txt">会员价 ¥</text>{{chooseItem.vip_price}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 显示普通价格 -->
|
||||
<view v-else class="vip">
|
||||
<text class="icon1">¥</text>
|
||||
<text>{{chooseItem.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text" v-if="show_stock === 1">剩余{{ chooseItem.stock > 0 ? chooseItem.stock : 0 }}件</view>
|
||||
<view class="sel">已选:{{skuName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="goodBox" scroll-y="true" enhanced="true" @scroll="skuScroll" :scroll-top="topNum">
|
||||
<view class="skuBox">
|
||||
<view class="sku_list" v-for="(items, idx) in specsList" :key="idx">
|
||||
<view class="title">第{{idx + 1}}件商品</view>
|
||||
<view class="sku_item" v-for="(item, index) in items" :key="index">
|
||||
<view class="spec_name">{{item.spec_name}}</view>
|
||||
<view class="sku_tag">
|
||||
<view class="tag" v-for="(it, i) in item.value" :key="it.id"
|
||||
@click="!it.show ? chooseSku(it, index, i, idx, items) :''"
|
||||
:class="pickSkuList[idx]['v'+ (index + 1) +'_id'] === it.id ? 'choose' : it.show ? 'dis' : '' ">
|
||||
<image :src="it.img" v-if="it.img" class="tag_img"></image>
|
||||
<text>{{it.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sku_num">
|
||||
<view class="num">
|
||||
<text>购买数量</text>
|
||||
<text v-if="show_stock === 1">(最多{{ chooseItem.stock > 0 ? chooseItem.stock : 0 }}件)</text>
|
||||
<view v-if="skuInfo.limit_type == 2" class="box_red">限购{{skuInfo.limit}}件</view>
|
||||
<view v-if="skuInfo.limit_type == 1" class="box_red">{{skuInfo.start_sale_num}}件起购</view>
|
||||
</view>
|
||||
<up-number-box
|
||||
v-model="chooseItem.num"
|
||||
:min="skuInfo.limit_type == 1 ? parseInt(skuInfo.start_sale_num) : skuInfo.limit_type === 0 ? 1 : 1 "
|
||||
:max="skuInfo.limit_type == 2 ? parseInt(skuInfo.limit) : skuInfo.limit_type === 0 ? (chooseItem.stock > 0 ? chooseItem.stock : 0) : 0"
|
||||
@overlimit="plusBtn(skuInfo.limit_type == 1 ? 0 : skuInfo.limit_type == 2 ? 1 : 2 ,chooseItem.num, skuInfo.limit)"
|
||||
disabledInput
|
||||
bgColor="#f2f3f5"
|
||||
:longPress="false"
|
||||
@change="changeNum">
|
||||
</up-number-box>
|
||||
</view>
|
||||
<view class="sku_buy" v-if="sales > 0">
|
||||
<view class="img" v-for="img in skuInfo.avatars" :key="img">
|
||||
<image :src="img" class="sku-buy-img"></image>
|
||||
</view>
|
||||
<view class="text">已有<text class="num">{{sales}}</text>个社群好友购买</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edition" v-if="textModule.length != 0">
|
||||
<view v-for="(item, index) in textModule" :key="index">
|
||||
<!-- 大图 -->
|
||||
<view v-if="item.type == 1" class="edition_box" @click="preViewImg(item.imgs[0])">
|
||||
<view v-for="(imgs, i) in item.imgs" :key="i">
|
||||
<image :src="imgs + '?x-oss-process=image/format,webp'" :webp="true" mode="widthFix" :lazy-load="true" style="width:100%"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 小图 -->
|
||||
<view class="edition_box" v-if="item.type == 2">
|
||||
<view class="small_img">
|
||||
<view v-for="(list, index1) in item.img" :key="index1" class="imgs" @click="getTextimg(item.img, list)">
|
||||
<image :src="list + '?x-oss-process=image/format,webp'" mode="aspectFill" :webp="true" class="image"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 视频 -->
|
||||
<view class="edition_box" v-if="item.type == 3">
|
||||
<video :src="item.video[0]" height="100%" width="250" class="video_box" style="display: block;margin: 0 auto;"></video>
|
||||
</view>
|
||||
|
||||
<!-- 文字 -->
|
||||
<view class="edition_box text1_box" v-if="item.type == 4">
|
||||
<text selectable="true" :user-select="true" class="text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="images.length != 0" class="imgbox">
|
||||
<image v-for="img in images" :key="img" :lazy-load="true" :src="img" class="img" mode="widthFix"></image>
|
||||
</view>
|
||||
<view v-if="images.length === 0 && mainImg.length !== 0" class="imgbox">
|
||||
<image v-for="img in mainImg" :key="img" :lazy-load="true" :src="img" class="img" mode="widthFix"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
<view class="sku_btn" v-if="soldStatus == 2" @click="arrivalNotice()">
|
||||
<view class="btn" v-if="!remindStock">到货提醒</view>
|
||||
<view class="btn dis" v-else>取消到货提醒</view>
|
||||
</view>
|
||||
<view class="sku_btn" v-else @click="(chooseItem.stock > 0 && canBuy) ? addToCart() : ''">
|
||||
<view class="btn" :class="(chooseItem.stock <= 0 || !canBuy) ? 'dis' : ''">加入购物车</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { showToast, goodsItem, toMiniProgram } from '../common.js'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
show_stock: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
sourceId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
sourceType: {
|
||||
type: String,
|
||||
default: 'normal'
|
||||
},
|
||||
canBuy: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
goodId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
groupId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
specsNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
remindStock: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
soldStatus: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
sales: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
remindTmplId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
showSku: false,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
priceColor: Style[uni.getStorageSync('theme_index') * 1].priceColor,
|
||||
cartColor: Style[uni.getStorageSync('theme_index') * 1].cartColor,
|
||||
bgColor: Style[uni.getStorageSync('theme_index') * 1].bgColor,
|
||||
vipOn: uni.getStorageSync('vip_on') === 1,
|
||||
vip_price_show: uni.getStorageSync('vip_price_show'),
|
||||
sourceId: 0,
|
||||
sourceType: '',
|
||||
viewImg: '',
|
||||
imgWidth: 200,
|
||||
skuInfo: {},
|
||||
skuName: '',
|
||||
is_vip: uni.getStorageSync('is_vip'),
|
||||
specsList: [],
|
||||
textModule: [],
|
||||
mainImg: [],
|
||||
images: [],
|
||||
chooseItem: {},
|
||||
goodId: 0,
|
||||
choose: [],
|
||||
sku_skuInfo: {},
|
||||
chooseIndex: [],
|
||||
pickSkuList: [],
|
||||
curIndex: 0,
|
||||
action: false,
|
||||
topNum: 0,
|
||||
specsNum: 0,
|
||||
isSale: uni.getStorageSync('role') == 1,
|
||||
canClick: true,
|
||||
remindStock: false
|
||||
})
|
||||
|
||||
const preventD = () => {
|
||||
return
|
||||
}
|
||||
|
||||
// 预览图片
|
||||
const preViewImg = (img) => {
|
||||
let img_preview_suffix = uni.getStorageSync('img_preview_suffix') || ''
|
||||
let imurl = img + img_preview_suffix
|
||||
if(img.indexOf('.gif') >= 0 || img.indexOf('.GIF') >= 0) {
|
||||
imurl = img
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: [imurl],
|
||||
current: 0
|
||||
})
|
||||
}
|
||||
|
||||
const hanleShare = () => {
|
||||
context.emit('buttomShow', true)
|
||||
}
|
||||
|
||||
function skuScroll(e) {
|
||||
if(e.detail.scrollTop > 200){
|
||||
data.imgWidth = 120
|
||||
} else {
|
||||
data.imgWidth = 200
|
||||
}
|
||||
}
|
||||
|
||||
function chooseSku(e, index, i_index, idx, items) {
|
||||
data.action = true
|
||||
if (e.img || e.img_800) {
|
||||
data.viewImg = e.img_800 || e.img
|
||||
}
|
||||
data.curIndex = idx
|
||||
data.choose[idx]['v' + (index + 1) + '_id'] = items[index].value[i_index].id
|
||||
|
||||
data.pickSkuList[idx]['v' + (index + 1) + '_id'] = items[index].value[i_index].id
|
||||
data.pickSkuList[idx]['v' + (index + 1)] = items[index].value[i_index].value
|
||||
data.chooseIndex[idx].push(index)
|
||||
data.chooseIndex[idx] = Array.from(new Set(data.chooseIndex[idx]))
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if(newProps.show) {
|
||||
data.showSku = true
|
||||
data.chooseItem = {}
|
||||
data.chooseItem.num = 1
|
||||
data.goodId = newProps.goodId
|
||||
data.sourceId = newProps.sourceId
|
||||
data.sourceType = newProps.sourceType
|
||||
data.specsNum = newProps.specsNum
|
||||
data.remindStock = newProps.remindStock
|
||||
data.images = []
|
||||
data.specsList = []
|
||||
data.pickSkuList = []
|
||||
data.choose = []
|
||||
data.chooseIndex = []
|
||||
|
||||
get(`/api/v1/goods/spec/${data.goodId}`).then((res) => {
|
||||
data.topNum = data.topNum == 0 ? 0.1 : 0
|
||||
data.skuInfo = res.data
|
||||
data.viewImg = res.data.face_img
|
||||
data.mainImg = res.data.gallery || []
|
||||
data.limit = res.data.limit
|
||||
|
||||
if(res.data.specs) {
|
||||
res.data.specs[0].value.forEach((it) => {
|
||||
if(it.img_800){
|
||||
data.images.push(it.img_800)
|
||||
}
|
||||
})
|
||||
let tempSpecs = JSON.parse(JSON.stringify(res.data.specs))
|
||||
if (res.data.specs.length === 1) {
|
||||
let sku = []
|
||||
res.data.skus.forEach((ress) => {
|
||||
if (ress.stock <= 0 || ress.price == 0) {
|
||||
sku.push(ress.v1_id)
|
||||
}
|
||||
})
|
||||
tempSpecs.forEach((res, i) => {
|
||||
res.value.forEach((req) => {
|
||||
if (sku.includes(req.id)) {
|
||||
req.show = true
|
||||
} else {
|
||||
req.show = false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
for (let index = 0; index < data.specsNum; index++) {
|
||||
data.pickSkuList[index] = {}
|
||||
for (let i = 0; i < tempSpecs.length; i++) {
|
||||
data.pickSkuList[index]['v' + (i + 1) + '_id'] = 0
|
||||
}
|
||||
data.specsList.push(JSON.parse(JSON.stringify(tempSpecs)))
|
||||
data.choose.push({})
|
||||
data.chooseIndex.push([])
|
||||
}
|
||||
}
|
||||
data.textModule = res.data.text_modules || []
|
||||
if(props.soldStatus == 2) {
|
||||
res.data.stock = 0
|
||||
res.data.skus.forEach((ress) => {
|
||||
ress.stock = 0
|
||||
})
|
||||
}
|
||||
data.sku_skuInfo = res.data.skus
|
||||
|
||||
data.chooseItem = JSON.parse(JSON.stringify(res.data.skus[0]))
|
||||
data.chooseItem.stock = res.data.stock
|
||||
|
||||
setTimeout(() => {
|
||||
data.imgWidth = 200
|
||||
}, 100)
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => data.choose,
|
||||
(newChoose) => {
|
||||
if(!data.action) {
|
||||
return
|
||||
}
|
||||
if (data.specsList[data.curIndex].length - Object.keys(data.choose[data.curIndex]).length == 1) {
|
||||
// 如果只有一个规格类未选中,则去判断未选中的这一项是否可选
|
||||
data.specsList[data.curIndex].forEach((req, i) => {
|
||||
if (data.chooseIndex[data.curIndex].indexOf(i) == -1) {
|
||||
req.value.forEach((rej, j) => {
|
||||
data.sku_skuInfo.forEach((ress, m) => {
|
||||
let flag = [rej.id === ress['v' + (i + 1) + '_id']]
|
||||
for (const key in data.choose[data.curIndex]) {
|
||||
flag.push(ress[key] == data.choose[data.curIndex][key])
|
||||
}
|
||||
if (flag.findIndex(target => target === false) == -1) {
|
||||
if (ress.stock <= 0 || ress.price == 0) {
|
||||
rej.show = true
|
||||
} else {
|
||||
rej.show = false
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (data.specsList[data.curIndex].length == Object.keys(data.choose[data.curIndex]).length) {
|
||||
for (const key in data.choose[data.curIndex]) {
|
||||
let i = parseInt(key.substr(1, 1))
|
||||
data.specsList[data.curIndex][i - 1].value.forEach((req) => {
|
||||
data.sku_skuInfo.forEach((ress, m) => {
|
||||
let flag = [req.id == ress['v' + i + '_id']]
|
||||
for (const k in data.choose[data.curIndex]) {
|
||||
let j = parseInt(k.substr(1, 1))
|
||||
if (i != j) {
|
||||
flag.push(ress[k] == data.choose[data.curIndex][k])
|
||||
}
|
||||
}
|
||||
if (flag.findIndex(target => target === false) == -1) {
|
||||
if ((ress.stock <= 0 || ress.price == 0)) {
|
||||
req.show = true
|
||||
} else {
|
||||
req.show = false
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
// 判断选择规格值是否完整
|
||||
for (let i = data.specsList[data.curIndex].length; i >= 1; i--) {
|
||||
if (!newChoose[data.curIndex]['v' + i + '_id']) {
|
||||
return
|
||||
}
|
||||
}
|
||||
// 对比选中项
|
||||
data.sku_skuInfo.forEach((sku, s_index) => {
|
||||
let num = data.chooseItem.num
|
||||
if (
|
||||
sku.v1_id === newChoose[data.curIndex].v1_id &&
|
||||
sku.v2_id === newChoose[data.curIndex].v2_id &&
|
||||
sku.v3_id === newChoose[data.curIndex].v3_id &&
|
||||
sku.v4_id === newChoose[data.curIndex].v4_id
|
||||
) {
|
||||
data.chooseItem = {
|
||||
...sku
|
||||
}
|
||||
if (num > 0) {
|
||||
data.chooseItem.num = num < sku.stock ? num : (sku.stock > 0 ? sku.stock : 0)
|
||||
} else if (sku.stock > 0) {
|
||||
data.chooseItem.num = data.skuInfo.limit_type == 0 ? 1 : data.skuInfo.limit_type == 1 ? parseInt(data.skuInfo.start_sale_num) : 1
|
||||
} else {
|
||||
data.chooseItem.num = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}, {
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
watch(() => data.pickSkuList, (newPickList) => {
|
||||
data.skuName = ''
|
||||
newPickList.forEach((item) => {
|
||||
let name = []
|
||||
for (let i = 0; i < data.specsNum; i++) {
|
||||
if(item['v' + (i + 1)]) {
|
||||
name.push(item['v' + (i + 1)])
|
||||
}
|
||||
}
|
||||
if(name.length) {
|
||||
data.skuName += '【' + name.join('-') + '】'
|
||||
}
|
||||
})
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
|
||||
function addToCart() {
|
||||
let params = [], flag = true
|
||||
for (let i = 0; i < data.pickSkuList.length; i++) {
|
||||
let pick = data.pickSkuList[i]
|
||||
for (let m = 0; m < data.sku_skuInfo.length; m++) {
|
||||
let sku = data.sku_skuInfo[m]
|
||||
if(pick.v1_id == sku.v1_id && pick.v2_id == sku.v2_id && pick.v3_id == sku.v3_id && pick.v4_id == sku.v4_id) {
|
||||
params.push({
|
||||
shop_goods_id: sku.shop_goods_id,
|
||||
shop_goods_sku_id: sku.id,
|
||||
shop_group_goods_id: props.groupId,
|
||||
num: data.chooseItem.num,
|
||||
source_id: data.sourceId,
|
||||
source_type: data.sourceType
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(params)
|
||||
if(params.length != data.specsNum) {
|
||||
showToast('请选择完整规格')
|
||||
return
|
||||
}
|
||||
post('/api/v1/carts/batch', { goods: params}).then((res) => {
|
||||
showToast('已加入购物车')
|
||||
getNum()
|
||||
context.emit('getnum')
|
||||
close()
|
||||
})
|
||||
}
|
||||
|
||||
function close(e) {
|
||||
data.action = false
|
||||
data.showSku = false
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
// 商品数量
|
||||
function changeNum(e) {
|
||||
data.chooseItem.num = e
|
||||
}
|
||||
|
||||
async function arrivalNotice() {
|
||||
// 取消提醒
|
||||
if(data.remindStock) {
|
||||
post(`/api/v1/goods/remind/cancel/${data.groupId}`, {type: 1}).then((res) => {
|
||||
data.remindStock = false
|
||||
uni.showToast({
|
||||
title: '已取消到货提醒',
|
||||
icon: 'none'
|
||||
})
|
||||
context.emit('remind', false)
|
||||
})
|
||||
} else {
|
||||
toMiniProgram('pages/groups/index?id=' + data.groupId)
|
||||
}
|
||||
}
|
||||
|
||||
const { getNum } = goodsItem()
|
||||
|
||||
return {
|
||||
toMiniProgram,
|
||||
...toRefs(data),
|
||||
preventD,
|
||||
preViewImg,
|
||||
hanleShare,
|
||||
skuScroll,
|
||||
chooseSku,
|
||||
close,
|
||||
addToCart,
|
||||
getNum,
|
||||
changeNum,
|
||||
arrivalNotice
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wholeBox{
|
||||
background-color: #fff;
|
||||
height: 70vh;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.skuTop{
|
||||
display: flex;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
.img{
|
||||
background: #bbbbbb;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 30rpx;
|
||||
transition: all 0.3s;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.topInfo{
|
||||
display: flex;
|
||||
width: calc(100% - 250rpx);
|
||||
flex-direction: column;
|
||||
&.smallfont{
|
||||
.title{
|
||||
display: none;
|
||||
}
|
||||
.price{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text{
|
||||
display: none;
|
||||
}
|
||||
.sel{
|
||||
font-size: 24rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
width: calc(100% - 50rpx);
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.priceBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
.text1{
|
||||
font-size: 32rpx;
|
||||
color: v-bind('priceColor');
|
||||
margin-right: 10rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.icon1{
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
.vip{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 34rpx;
|
||||
color: v-bind('priceColor');
|
||||
}
|
||||
}
|
||||
.text{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
.sel{
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.goodBox{
|
||||
height: calc(70vh - 280rpx);
|
||||
.skuBox{
|
||||
margin-bottom: 30rpx;
|
||||
.sku_list{
|
||||
padding: 10rpx 30rpx 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
position: relative;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.sku_item{
|
||||
.spec_name{
|
||||
font-size: 26rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.sku_tag{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 24rpx;
|
||||
.tag{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
background-color: #f4f4f4;
|
||||
margin-right: 22rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 10rpx 18rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 6rpx;
|
||||
.tag_img{
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
.dis{
|
||||
opacity: 0.35;
|
||||
}
|
||||
.choose {
|
||||
background-color: v-bind('bgColor');
|
||||
color: v-bind('Color');
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.sku_num{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
.num{
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.box_red{
|
||||
padding: 5rpx 10rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 25rpx;
|
||||
display: inline-block;
|
||||
color: #656565;
|
||||
}
|
||||
}
|
||||
}
|
||||
.sku_buy{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
.img{
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-left: -10rpx;
|
||||
border: 4rpx solid #fff;
|
||||
box-sizing: border-box;
|
||||
.sku-buy-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
.num {
|
||||
color: v-bind('Color');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.sku_btn{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
.btn{
|
||||
height: 104rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 104rpx;
|
||||
background: v-bind('Color');
|
||||
width: 100%;
|
||||
}
|
||||
.dis{
|
||||
opacity: 0.7;
|
||||
color: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
.vip-tag {
|
||||
font-size: 32rpx;
|
||||
color: #fbe6c3;
|
||||
background: #353648;
|
||||
border-radius: 20rpx 0 0 0;
|
||||
padding: 8rpx 10rpx;
|
||||
line-height: 1;
|
||||
.txt{
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
123
components/sku/previewImg.vue
Normal file
123
components/sku/previewImg.vue
Normal file
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-overlay :show="show" :z-index="9999">
|
||||
<view class="contBox" @click="close()">
|
||||
<view class="num">{{index + 1}}/{{specsList.length}}</view>
|
||||
<swiper class="swiper" :autoplay="false" :indicator-dots="false" :circular="true" @change="changeSwiper" :current="index">
|
||||
<swiper-item v-for="(item, index) in specsList" :key="index">
|
||||
<view class="box">
|
||||
<image class="img" mode="widthFix" :src="(item.img_800 || item.img) + '?x-oss-process=image/format,webp'" :webp="true"></image>
|
||||
<view class="title"><text>{{item.value}}</text></view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { showToast } from '../common.js'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
list: {
|
||||
type: Object,
|
||||
default: []
|
||||
},
|
||||
current: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
show: false,
|
||||
index: 0,
|
||||
specsList: [],
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
bgColor: Style[uni.getStorageSync('theme_index') * 1].bgColor
|
||||
})
|
||||
|
||||
function close() {
|
||||
data.show = false
|
||||
context.emit('close', data.index)
|
||||
}
|
||||
|
||||
function changeSwiper(event) {
|
||||
data.index = event.detail.current
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if(newProps.show) {
|
||||
data.show = true
|
||||
data.index = newProps.current
|
||||
data.specsList = newProps.list[0].value
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
close,
|
||||
changeSwiper
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contBox{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background-color: #191919;
|
||||
position: relative;
|
||||
.num{
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
top: 80rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
.swiper{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.box{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.img{
|
||||
width: 100%;
|
||||
}
|
||||
.title{
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
bottom: 80rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
text{
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
border-radius: 30rpx;
|
||||
padding: 10rpx 28rpx;
|
||||
background-color: #5E5E5E;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
312
components/sku/tileSku.vue
Normal file
312
components/sku/tileSku.vue
Normal file
@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<view class="skuBox" v-if="showSku">
|
||||
<view class="item" v-for="(items, idx) in specsList" :key="idx">
|
||||
<view class="title" v-if="specsNum > 1">第{{idx + 1}}件商品</view>
|
||||
<view class="col" v-for="(item, index) in items" :key="index">
|
||||
<view class="name">{{item.spec_name}}</view>
|
||||
<view class="tagBox">
|
||||
<view class="tag" v-for="(it, i) in item.value" :key="it.id"
|
||||
@click="!it.show ? chooseSku(it, index, i, idx, items) :''"
|
||||
:class="pickSkuList[idx]['v'+ (index + 1) +'_id'] === it.id ? 'choose' : it.show ? 'dis' : '' ">
|
||||
<image :src="it.img" v-if="it.img" class="tag_img"></image>
|
||||
<text>{{it.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import { showToast, goodsItem } from '../common.js'
|
||||
import { get, post } from '@/api/request.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
specsNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
goodId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
showSku: false,
|
||||
goodId: 0,
|
||||
Color: uni.getStorageSync('theme_color'),
|
||||
bgColor: Style[uni.getStorageSync('theme_index') * 1].bgColor,
|
||||
choose: [],
|
||||
skuName: '',
|
||||
skuInfo: {},
|
||||
mainImg: [],
|
||||
images: [],
|
||||
chooseItem: {},
|
||||
sku_skuInfo: {},
|
||||
chooseIndex: [],
|
||||
pickSkuList: [],
|
||||
curIndex: 0,
|
||||
specsList: [],
|
||||
action: false,
|
||||
specsNum: 0
|
||||
})
|
||||
|
||||
function chooseSku(e, index, i_index, idx, items) {
|
||||
data.action = true
|
||||
if (e.img || e.img_800) {
|
||||
data.viewImg = e.img_800 || e.img
|
||||
}
|
||||
data.curIndex = idx
|
||||
|
||||
data.pickSkuList[idx]['v' + (index + 1) + '_id'] = items[index].value[i_index].id
|
||||
data.pickSkuList[idx]['v' + (index + 1)] = items[index].value[i_index].value
|
||||
data.chooseIndex[idx].push(index)
|
||||
data.chooseIndex[idx] = Array.from(new Set(data.chooseIndex[idx]))
|
||||
data.choose[idx]['v' + (index + 1) + '_id'] = items[index].value[i_index].id
|
||||
}
|
||||
|
||||
watch(props, (newProps) => {
|
||||
if(newProps.show) {
|
||||
data.showSku = true
|
||||
data.goodId = newProps.goodId
|
||||
data.chooseItem = {}
|
||||
data.chooseItem.num = 1
|
||||
data.specsNum = newProps.specsNum
|
||||
data.images = []
|
||||
data.specsList = []
|
||||
data.pickSkuList = []
|
||||
data.choose = []
|
||||
data.chooseIndex = []
|
||||
|
||||
get(`/api/v1/goods/spec/${data.goodId}`).then((res) => {
|
||||
data.skuInfo = res.data
|
||||
data.viewImg = res.data.face_img
|
||||
data.mainImg = res.data.gallery || []
|
||||
|
||||
if(res.data.specs) {
|
||||
res.data.specs[0].value.forEach((it) => {
|
||||
if(it.img_800){
|
||||
data.images.push(it.img_800)
|
||||
}
|
||||
})
|
||||
for (let index = 0; index < data.specsNum; index++) {
|
||||
data.pickSkuList[index] = {}
|
||||
for (let i = 0; i < res.data.specs.length; i++) {
|
||||
data.pickSkuList[index]['v' + (i + 1) + '_id'] = 0
|
||||
}
|
||||
data.specsList.push(JSON.parse(JSON.stringify(res.data.specs)))
|
||||
data.choose.push({})
|
||||
data.chooseIndex.push([])
|
||||
}
|
||||
}
|
||||
data.sku_skuInfo = res.data.skus
|
||||
|
||||
data.viewImg = res.data.specs[0].value[0].img_800 || res.data.specs[0].value[0].img || res.data.face_img
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
if(res.data.skus[0].stock > 0) {
|
||||
// 如果第一个sku有库存,则选中第一个
|
||||
|
||||
data.curIndex = data.specsNum
|
||||
for (let m = 0; m < data.specsNum; m++) {
|
||||
res.data.specs.forEach((it, n) => {
|
||||
data.choose[m]['v' + (n + 1) + '_id'] = data.sku_skuInfo[0]['v' + (n + 1) + '_id']
|
||||
data.pickSkuList[m]['v' + (n + 1) + '_id'] = data.sku_skuInfo[0]['v' + (n + 1) + '_id']
|
||||
data.pickSkuList[m]['v' + (n + 1)] = data.sku_skuInfo[0]['v' + (n + 1)]
|
||||
})
|
||||
data.chooseIndex.push(m)
|
||||
}
|
||||
data.chooseItem = data.sku_skuInfo[0]
|
||||
|
||||
context.emit('back', data.pickSkuList, data.viewImg, data.chooseItem)
|
||||
} else {
|
||||
// 第一个sku没有库存,如果规格只有一个去判断规格的样式,即是否选中 大于一个不做判断
|
||||
if(res.data.specs.length == 1) { // 仅有一个规格
|
||||
// 如果第一个规格有库存,则选中第一个,否则判断规格的样式,即是否选中
|
||||
data.specsList.forEach((item) => {
|
||||
item.forEach((itm) => {
|
||||
itm.value.forEach((it, i) => {
|
||||
it.show = res.data.skus[i].stock <= 0 || res.data.skus[i].price * 1 == 0 ? true : false
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => data.choose,
|
||||
(newChoose) => {
|
||||
if(!data.action) {
|
||||
return
|
||||
}
|
||||
if (data.specsList[data.curIndex].length - Object.keys(data.choose[data.curIndex]).length == 1) {
|
||||
// 如果只有一个规格类未选中,则去判断未选中的这一项是否可选
|
||||
data.specsList[data.curIndex].forEach((req, i) => {
|
||||
if (data.chooseIndex[data.curIndex].indexOf(i) == -1) {
|
||||
req.value.forEach((rej, j) => {
|
||||
data.sku_skuInfo.forEach((ress, m) => {
|
||||
let flag = [rej.id === ress['v' + (i + 1) + '_id']]
|
||||
for (const key in data.choose[data.curIndex]) {
|
||||
flag.push(ress[key] == data.choose[data.curIndex][key])
|
||||
}
|
||||
if (flag.findIndex(target => target === false) == -1) {
|
||||
if (ress.stock <= 0 || ress.price == 0) {
|
||||
rej.show = true
|
||||
} else {
|
||||
rej.show = false
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (data.specsList[data.curIndex].length == Object.keys(data.choose[data.curIndex]).length) {
|
||||
for (const key in data.choose[data.curIndex]) {
|
||||
let i = parseInt(key.substr(1, 1))
|
||||
data.specsList[data.curIndex][i - 1].value.forEach((req) => {
|
||||
data.sku_skuInfo.forEach((ress, m) => {
|
||||
let flag = [req.id == ress['v' + i + '_id']]
|
||||
for (const k in data.choose[data.curIndex]) {
|
||||
let j = parseInt(k.substr(1, 1))
|
||||
if (i != j) {
|
||||
flag.push(ress[k] == data.choose[data.curIndex][k])
|
||||
}
|
||||
}
|
||||
if (flag.findIndex(target => target === false) == -1) {
|
||||
if ((ress.stock <= 0 || ress.price == 0)) {
|
||||
req.show = true
|
||||
} else {
|
||||
req.show = false
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
// 判断选择规格值是否完整
|
||||
for (let i = data.specsList[data.curIndex].length; i >= 1; i--) {
|
||||
if (!newChoose[data.curIndex]['v' + i + '_id']) {
|
||||
return
|
||||
}
|
||||
}
|
||||
// 对比选中项
|
||||
data.sku_skuInfo.forEach((sku, s_index) => {
|
||||
let num = data.chooseItem.num
|
||||
if (
|
||||
sku.v1_id === newChoose[data.curIndex].v1_id &&
|
||||
sku.v2_id === newChoose[data.curIndex].v2_id &&
|
||||
sku.v3_id === newChoose[data.curIndex].v3_id &&
|
||||
sku.v4_id === newChoose[data.curIndex].v4_id
|
||||
) {
|
||||
data.chooseItem = {
|
||||
...sku
|
||||
}
|
||||
if (num > 0) {
|
||||
data.chooseItem.num = num < sku.stock ? num : (sku.stock > 0 ? sku.stock : 0)
|
||||
} else if (sku.stock > 0) {
|
||||
data.chooseItem.num = data.skuInfo.limit_type == 0 ? 1 : data.skuInfo.limit_type == 1 ? parseInt(data.skuInfo.start_sale_num) : 1
|
||||
} else {
|
||||
data.chooseItem.num = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
context.emit('back', data.pickSkuList, data.viewImg, data.chooseItem)
|
||||
|
||||
}, {
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
watch(() => data.pickSkuList, (newPickList) => {
|
||||
data.skuName = ''
|
||||
newPickList.forEach((item) => {
|
||||
let name = []
|
||||
for (let i = 0; i < data.specsNum; i++) {
|
||||
if(item['v' + (i + 1)]) {
|
||||
name.push(item['v' + (i + 1)])
|
||||
}
|
||||
}
|
||||
if(name.length) {
|
||||
data.skuName += '【' + name.join('-') + '】'
|
||||
}
|
||||
})
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
chooseSku,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.skuBox{
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #fff;
|
||||
.item{
|
||||
padding: 10rpx 30rpx 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
position: relative;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.col{
|
||||
.name{
|
||||
font-size: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.tagBox{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 28rpx;
|
||||
.tag{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
background-color: #f4f4f4;
|
||||
margin-right: 22rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 10rpx 18rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 6rpx;
|
||||
.tag_img{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
.dis{
|
||||
opacity: 0.35;
|
||||
}
|
||||
.choose {
|
||||
background-color: v-bind('bgColor');
|
||||
color: v-bind('Color');
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
197
components/tabbar/index.vue
Normal file
197
components/tabbar/index.vue
Normal file
@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<!-- 自定义导航栏 -->
|
||||
<view class="tabbar">
|
||||
<view class="index" v-for="(item, index) in tabbarList" :key="index" @click="jumpTo(item.url, item.id)">
|
||||
<view class="icon" :class="index == chooseIndex ? 'choose' : ''">
|
||||
<text v-if="index == chooseIndex" class="iconfont" :class="'icon-' + item.fill"></text>
|
||||
<text v-else class="iconfont" :class="'icon-' + item.type"></text>
|
||||
</view>
|
||||
<text :class="index == chooseIndex ? 'choose text' : 'text' ">{{ item.title }}</text>
|
||||
|
||||
<up-badge :bgColor="priceColor" max="99" v-if="item.id == 2" :value="num"></up-badge>
|
||||
|
||||
<up-badge :bgColor="priceColor" max="99" v-if="item.id == 4 && msgNum" :value="msgNum"></up-badge>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, onMounted } from 'vue'
|
||||
import { whetherLogin } from '@/components/common.js'
|
||||
import { get } from '@/api/request.js'
|
||||
import { Style } from '@/utils/list.js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
chooseIndex: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
num: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
msgNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
tabbarList: [
|
||||
{
|
||||
id: 1,
|
||||
title: '首页',
|
||||
url: '/pages/index/index',
|
||||
type: 'home',
|
||||
fill: 'homefill'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '分类',
|
||||
url: '/pages/classify/new',
|
||||
type: 'fenlei',
|
||||
fill: 'fenleifill'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '互动',
|
||||
url: '/pages/message/index',
|
||||
type: 'msg',
|
||||
fill: 'msgfill'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '购物车',
|
||||
url: '/pages/cart/index',
|
||||
type: 'cart',
|
||||
fill: 'cartfill'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '我的',
|
||||
url: '/pages/user/index',
|
||||
type: 'mine',
|
||||
fill: 'minefill'
|
||||
}
|
||||
],
|
||||
role: uni.getStorageSync('role'),
|
||||
Color: '#F14939',
|
||||
Theme: '',
|
||||
priceColor: '#F14939',
|
||||
interval: null,
|
||||
has_multi_group: uni.getStorageSync('has_multi_group') || true
|
||||
})
|
||||
|
||||
const jumpTo = (url, id) => {
|
||||
if(id == 5) {
|
||||
if(data.has_multi_group) {
|
||||
uni.switchTab({
|
||||
url: '/pages/classify/new'
|
||||
})
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/classify/index'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if((id == 2 || id == 3 || id == 4) && !whetherLogin()) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/login'
|
||||
})
|
||||
} else {
|
||||
uni.switchTab({ url })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setColor() {
|
||||
data.Color = uni.getStorageSync('theme_color')
|
||||
data.Theme = uni.getStorageSync('theme_index') * 1
|
||||
data.priceColor = Style[uni.getStorageSync('theme_index') * 1] && Style[uni.getStorageSync('theme_index') * 1].priceColor
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setColor()
|
||||
if(!data.Color) {
|
||||
data.interval = setInterval(() => {
|
||||
if(!data.Color) {
|
||||
setColor()
|
||||
} else {
|
||||
clearInterval(data.interval)
|
||||
data.interval = null
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
setTimeout(() => {
|
||||
setColor()
|
||||
}, 1200)
|
||||
// #ifdef APP-PLUS
|
||||
uni.hideTabBar()
|
||||
// #endif
|
||||
})
|
||||
|
||||
|
||||
return {
|
||||
whetherLogin,
|
||||
...toRefs(data),
|
||||
jumpTo,
|
||||
setColor
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
uni.hideTabBar()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tabbar {
|
||||
width: 100%;
|
||||
height: 55px;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
background: #fff;
|
||||
box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.16);
|
||||
//兼容ios底部黑线
|
||||
bottom: 0;
|
||||
// padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
box-sizing: content-box;
|
||||
.index {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
position: relative;
|
||||
.text {
|
||||
margin-top: 2px;
|
||||
}
|
||||
.choose {
|
||||
color: v-bind('Color');
|
||||
}
|
||||
.tag{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transform: translate(60%, 0);
|
||||
}
|
||||
}
|
||||
.icon{
|
||||
font-size: 20px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.iconfont{
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
BIN
components/tf-verify-img/img/tf-arrows.png
Normal file
BIN
components/tf-verify-img/img/tf-arrows.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 685 B |
257
components/tf-verify-img/index.vue
Normal file
257
components/tf-verify-img/index.vue
Normal file
@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view class="sliderBox">
|
||||
<view class="content">
|
||||
<view class="headbox">
|
||||
<text class="text">请完成安全验证</text>
|
||||
<view class="tf-close" @click.stop="close_"><up-icon name="close" /></view>
|
||||
</view>
|
||||
<canvas :style="{ width: canvasW + 'px', height: canvasH + 'px' }" class="canvasBox" canvas-id="mycanvas" id="mycanvas"></canvas>
|
||||
<movable-area class="moveArea">
|
||||
<view class="text">滑动滑块完成拼图</view>
|
||||
<movable-view class="moveView" direction="all" :x="canvasX2" @change="changePath" @touchend="endTouch" @mouseup="endTouch">
|
||||
<view class="moveBox"></view>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
verifyImgs:{
|
||||
type:Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
verifyIndex: 0,
|
||||
canvasW: '',
|
||||
canvasH: '',
|
||||
canvasX2: 0,
|
||||
canvasX: 0,
|
||||
ctx: null,
|
||||
jgX: 0,
|
||||
dqImgPath:'',
|
||||
Color: uni.getStorageSync('theme_color')
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.canvasW = uni.upx2px(580)
|
||||
this.canvasH = uni.upx2px(290)
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(()=>{
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 生成从minNum到maxNum的随机数
|
||||
randomNum(minNum,maxNum){
|
||||
switch(arguments.length){
|
||||
case 1:
|
||||
return parseInt(Math.random() * minNum + 1, 10);
|
||||
break;
|
||||
case 2:
|
||||
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
},
|
||||
close_(){
|
||||
this.$emit('close')
|
||||
},
|
||||
async init(){
|
||||
if(this.verifyImgs.length == 0){
|
||||
uni.showToast({
|
||||
title: '背景图不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.canvasX2--
|
||||
this.canvasX = 0
|
||||
this.verifyIndex = this.randomNum(0, this.verifyImgs.length - 1)
|
||||
this.ctx = uni.createCanvasContext('mycanvas', this)
|
||||
this.jgX = this.randomNum(uni.upx2px(150),uni.upx2px(450))
|
||||
this.dqImgPath = await this.parseImagePath(this.verifyImgs[this.verifyIndex].src)
|
||||
this.huatu()
|
||||
},
|
||||
endTouch(){
|
||||
if(Math.abs(this.canvasX - this.jgX) <= 5){
|
||||
this.$emit('succeed')
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '验证失败',
|
||||
icon:"error"
|
||||
});
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
huatu(){
|
||||
let this_ = this
|
||||
let r = uni.upx2px(10)
|
||||
let XX = this.canvasX
|
||||
let YY = uni.upx2px(100)
|
||||
let cs = uni.upx2px(20)
|
||||
this_.ctx.drawImage(this_.dqImgPath, 0, 0, this_.canvasW, this_.canvasH)
|
||||
|
||||
//画不可移动的拼图块
|
||||
this_.ctx.beginPath()
|
||||
this_.ctx.moveTo(-2*r+this_.jgX+cs+2*r, YY-2*r+2*r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+2*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+3*r, XX-2+this_.jgX*r+cs+6.5*r, YY-2*r+3*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+7.5*r, YY-2*r+3*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+3*r, -2*r+this_.jgX+cs+8.5*r, YY-2*r+2*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+12*r, YY-2*r+2*r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+12*r, YY-2*r+11*r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+11*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+12*r, -2*r+this_.jgX+cs+7.5*r, YY-2*r+12*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+6.5*r, YY-2*r+12*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+12*r, -2*r+this_.jgX+cs+5.5*r, YY-2*r+11*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+11*r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+8*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+3*r, YY-2*r+8*r, -2*r+this_.jgX+cs+3*r, YY-2*r+7*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+3*r, YY-2*r+6*r)
|
||||
this_.ctx.arcTo(-2*r+this_.jgX+cs+3*r, YY-2*r+5*r, -2*r+this_.jgX+cs+2*r, YY-2*r+5*r, r)
|
||||
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+2*r)
|
||||
this_.ctx.shadowBlur = 10
|
||||
this_.ctx.shadowColor="#ffffff"
|
||||
this_.ctx.fillStyle = "rgba(0,0,0,0.5)"
|
||||
this_.ctx.fill()
|
||||
this_.ctx.restore()
|
||||
//画可移动的拼图块
|
||||
this_.ctx.beginPath()
|
||||
this_.ctx.save()
|
||||
this_.ctx.moveTo(XX-2*r+cs+2*r, YY-2*r+2*r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+5.5*r, YY-2*r+2*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+5.5*r, YY-2*r+3*r, XX-2*r+cs+6.5*r, YY-2*r+3*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+7.5*r, YY-2*r+3*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+8.5*r, YY-2*r+3*r, XX-2*r+cs+8.5*r, YY-2*r+2*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+12*r, YY-2*r+2*r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+12*r, YY-2*r+11*r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+8.5*r, YY-2*r+11*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+8.5*r, YY-2*r+12*r, XX-2*r+cs+7.5*r, YY-2*r+12*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+6.5*r, YY-2*r+12*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+5.5*r, YY-2*r+12*r, XX-2*r+cs+5.5*r, YY-2*r+11*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+11*r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+8*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+3*r, YY-2*r+8*r, XX-2*r+cs+3*r, YY-2*r+7*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+3*r, YY-2*r+6*r)
|
||||
this_.ctx.arcTo(XX-2*r+cs+3*r, YY-2*r+5*r, XX-2*r+cs+2*r, YY-2*r+5*r, r)
|
||||
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+2*r)
|
||||
this_.ctx.shadowBlur = 10
|
||||
this_.ctx.shadowColor = '#ffffff'
|
||||
this_.ctx.fill()
|
||||
this_.ctx.clip()
|
||||
this_.ctx.drawImage(this_.dqImgPath, this_.canvasX - this_.jgX, 0, this_.canvasW, this_.canvasH)
|
||||
this_.ctx.restore()
|
||||
//绘图
|
||||
this_.ctx.draw()
|
||||
},
|
||||
changePath(e) {
|
||||
this.canvasX = e.detail.x
|
||||
this.huatu()
|
||||
},
|
||||
async parseImagePath(imgSrc) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
success: function(image) {
|
||||
resolve(image.path)
|
||||
},
|
||||
fail(err) {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.sliderBox{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background-color: rgba(0,0,0,.3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.content{
|
||||
width: 640upx;
|
||||
height: 584upx;
|
||||
background-color: #fff;
|
||||
border-radius: 6upx;
|
||||
box-shadow: 0 0 50upx 0upx rgba(0, 0, 0, 0.2);
|
||||
.headbox{
|
||||
height: 100upx;
|
||||
line-height: 100upx;
|
||||
padding: 0 32upx;
|
||||
border-bottom: 1px solid #E1E3E9;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.text{
|
||||
font-size: 32upx;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.canvasBox{
|
||||
margin: 30rpx auto;
|
||||
align-self: center;
|
||||
}
|
||||
.moveArea{
|
||||
margin: 30rpx auto;
|
||||
align-self: center;
|
||||
width: 580upx;
|
||||
height: 75upx;
|
||||
line-height: 75upx;
|
||||
text-align: center;
|
||||
font-size: 28upx;
|
||||
border-radius: 6upx;
|
||||
border: 1px solid #E1E3E9;
|
||||
background-color: #F7F8F9;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
.text{
|
||||
width: 100%;
|
||||
height: 75upx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
color: #424649;
|
||||
text-align: center;
|
||||
}
|
||||
.moveView{
|
||||
height: 75upx;
|
||||
width: 75upx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10upx 0upx rgba(0, 0, 0, 0.2);
|
||||
background-image: url(img/tf-arrows.png);
|
||||
background-size: 34upx;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
.moveBox{
|
||||
position: absolute;
|
||||
background-color: v-bind('Color');
|
||||
top: 0;
|
||||
left: -580upx;
|
||||
width: 580upx;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
128
components/videoDialog/index.vue
Normal file
128
components/videoDialog/index.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<up-overlay :show="show" :z-index="1500" :custom-style="customStyle" :overlay-style="overlayStyle">
|
||||
<view class="BBox">
|
||||
|
||||
<view style="width: 100%;height: calc(100vh - 120px);">
|
||||
<DomVideoPlayer
|
||||
ref="domVideoPlayer"
|
||||
object-fit="contain"
|
||||
:controls="true"
|
||||
:autoplay="true"
|
||||
:loop="true"
|
||||
:src="url" />
|
||||
</view>
|
||||
|
||||
<view class="close" @click="close">
|
||||
<up-icon name="close" color="#ddd" size="30" />
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, toRefs, watch } from 'vue'
|
||||
import DomVideoPlayer from '@/components/DomVideoPlayer/index.vue'
|
||||
|
||||
export default {
|
||||
components: { DomVideoPlayer },
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
url: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
setup(props, context) {
|
||||
const data = reactive({
|
||||
url: '',
|
||||
show: false,
|
||||
customStyle: {},
|
||||
overlayStyle: {
|
||||
background: '#000',
|
||||
height: '100vh',
|
||||
width: '100%'
|
||||
},
|
||||
playing: false,
|
||||
duration: 0,
|
||||
currentTime: 0,
|
||||
playbackRate: 1
|
||||
})
|
||||
|
||||
const close = () => {
|
||||
data.show = false
|
||||
context.emit('close')
|
||||
}
|
||||
|
||||
const onPlay = () => {
|
||||
|
||||
data.playing = true
|
||||
}
|
||||
|
||||
const onPause = () => {
|
||||
data.playing = false
|
||||
}
|
||||
|
||||
const onEnded = () => {
|
||||
data.playing = false
|
||||
}
|
||||
|
||||
const onDurationChange = (e) => {
|
||||
console.log('onDurationChange', e)
|
||||
data.duration = e
|
||||
}
|
||||
|
||||
const onTimeUpdate = (e) => {
|
||||
data.currentTime = e
|
||||
}
|
||||
|
||||
const onRateChange = (e) => {
|
||||
console.log('onRateChange', e)
|
||||
data.playbackRate = e
|
||||
}
|
||||
|
||||
watch(props, async (newProps) => {
|
||||
if (newProps.show) {
|
||||
data.show = true
|
||||
data.url = newProps.url
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(data),
|
||||
close,
|
||||
onPlay,
|
||||
onPause,
|
||||
onEnded,
|
||||
onDurationChange,
|
||||
onTimeUpdate,
|
||||
onRateChange,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.BBox{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
padding: 60px 0 0;
|
||||
background-color: #000;
|
||||
|
||||
.video{
|
||||
width: 100%;
|
||||
height: calc(100vh - 120px);
|
||||
}
|
||||
.close{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
20
index.html
Normal file
20
index.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
7706
js_sdk/u-charts.js
Normal file
7706
js_sdk/u-charts.js
Normal file
File diff suppressed because it is too large
Load Diff
39
main.js
Normal file
39
main.js
Normal file
@ -0,0 +1,39 @@
|
||||
import App from './App'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.prototype.$onLaunched = new Promise(resolve => {
|
||||
Vue.prototype.$isResolve = resolve
|
||||
})
|
||||
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// import uviewPlus from '@/uni_modules/uview-plus'
|
||||
import uviewPlus, {setConfig} from '@/uni_modules/uview-plus'
|
||||
setConfig({
|
||||
// config: {
|
||||
// unit: 'rpx'
|
||||
// }
|
||||
})
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
app.config.globalProperties.$onLaunched = new Promise(resolve => {
|
||||
app.config.globalProperties.$isResolve = resolve
|
||||
})
|
||||
app.use(uviewPlus)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
206
manifest.json
Normal file
206
manifest.json
Normal file
@ -0,0 +1,206 @@
|
||||
{
|
||||
"name" : "妙选商城",
|
||||
"appid" : "__UNI__743F2C0",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.7",
|
||||
"versionCode" : 107,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"runmode" : "liberate",
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"OAuth" : {},
|
||||
"Payment" : {},
|
||||
"Share" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Camera" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
],
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||
"minSdkVersion" : 21,
|
||||
"targetSdkVersion" : 30,
|
||||
"schemes" : "miaoxuan"
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"dSYMs" : false,
|
||||
"urlschemewhitelist" : "alipays,alipay,safepay,weixin,wechat",
|
||||
"capabilities" : {
|
||||
"entitlements" : {
|
||||
"com.apple.developer.associated-domains" : [ "guan.chutang66.com" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"ad" : {},
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx18808d86a1251e0b",
|
||||
"appsecret" : "5bcae9d1e5da7cf6282675ba685f70a0",
|
||||
"UniversalLinks" : "https://guan.chutang66.com/app/"
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appid" : "wx18808d86a1251e0b",
|
||||
"UniversalLinks" : "https://guan.chutang66.com/app/"
|
||||
},
|
||||
"alipay" : {
|
||||
"__platform__" : [ "ios", "android" ]
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx18808d86a1251e0b",
|
||||
"UniversalLinks" : "https://guan.chutang66.com/app/"
|
||||
}
|
||||
},
|
||||
"statics" : {}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"useOriginalMsgbox" : true,
|
||||
"androidStyle" : "common"
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx73163c7bace1750b",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true,
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true,
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true,
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : true,
|
||||
"version" : "2",
|
||||
"reportInterval" : "40"
|
||||
},
|
||||
"vueVersion" : "3",
|
||||
"locale" : "zh-Hans",
|
||||
"fallbackLocale" : "zh-Hans",
|
||||
"h5" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-jd" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-kuaishou" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-lark" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"mp-qq" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"quickapp-webview-huawei" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
},
|
||||
"quickapp-webview-union" : {
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
71
node_modules/@qiun/ucharts/package.json
generated
vendored
Normal file
71
node_modules/@qiun/ucharts/package.json
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"_from": "@qiun/ucharts",
|
||||
"_id": "@qiun/ucharts@2.5.0-20230101",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-C7ccBgfPuGF6dxTRuMW0NPPMSCf1k/kh3I9zkRVBc5PaivudX/rPL+jd2Wty6gn5ya5L3Ob+YmYe09V5xw66Cw==",
|
||||
"_location": "/@qiun/ucharts",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "@qiun/ucharts",
|
||||
"name": "@qiun/ucharts",
|
||||
"escapedName": "@qiun%2fucharts",
|
||||
"scope": "@qiun",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmmirror.com/@qiun/ucharts/-/ucharts-2.5.0-20230101.tgz",
|
||||
"_shasum": "9ca5d646328ad4a002c745c28001f8916865c4f8",
|
||||
"_spec": "@qiun/ucharts",
|
||||
"_where": "C:\\chunfen\\shop_app",
|
||||
"author": {
|
||||
"name": "秋云"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "【原生uCharts】跨平台图表库,全端全平台支持的图表库,开箱即用。支持PC、H5、微信小程序、支付宝小程序、百度小程序、头条小程序、飞书小程序、QQ小程序、360小程序、快手小程序、钉钉小程序、淘宝小程序、京东小程序、Vue、Taro等更多支持canvas的框架,体积小巧、调用简单方便、性能及体验极佳。",
|
||||
"homepage": "https://www.ucharts.cn",
|
||||
"keywords": [
|
||||
"uCharts",
|
||||
"大图",
|
||||
"大屏",
|
||||
"可视化",
|
||||
"图表库",
|
||||
"饼图",
|
||||
"圆环图",
|
||||
"折线图",
|
||||
"柱状图",
|
||||
"山峰图",
|
||||
"区域图",
|
||||
"雷达图",
|
||||
"圆弧进度图",
|
||||
"仪表盘",
|
||||
"K线图",
|
||||
"条状图",
|
||||
"混合图",
|
||||
"玫瑰图",
|
||||
"漏斗图",
|
||||
"词云图",
|
||||
"时序图",
|
||||
"散点图",
|
||||
"气泡图",
|
||||
"地图"
|
||||
],
|
||||
"license": "Apache",
|
||||
"main": "u-charts.js",
|
||||
"name": "@qiun/ucharts",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "2.5.0-20230101"
|
||||
}
|
||||
78
node_modules/@qiun/ucharts/readme.md
generated
vendored
Normal file
78
node_modules/@qiun/ucharts/readme.md
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
<h1 align="center">原生uCharts</h1>
|
||||
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
[](https://gitee.com/uCharts/uCharts/stargazers)
|
||||
[](https://gitee.com/uCharts/uCharts/members)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
[](https://www.npmjs.com/~qiun)
|
||||
|
||||
</div>
|
||||
|
||||
## uCharts简介
|
||||
|
||||
`uCharts`是一款基于`canvas API`开发的适用于所有前端应用的图表库,开发者编写一套代码,可运行到 Web、iOS、Android(基于 uni-app / taro )、以及各种小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝)、快应用等更多支持 canvas API 的平台。
|
||||
|
||||
## 快速体验
|
||||
|
||||
一套代码编到多个平台,依次扫描二维码,亲自体验uCharts图表跨平台效果!其他平台请自行编译。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 官方网站
|
||||
## [https://www.uCharts.cn](https://www.ucharts.cn)
|
||||
|
||||
|
||||
## 视频教程
|
||||
## [uCharts新手入门教程](https://www.bilibili.com/video/BV1qA411Q7se/?share_source=copy_web&vd_source=42a1242f9aaade6427736af69eb2e1d9)
|
||||
|
||||
|
||||
## 致开发者
|
||||
|
||||
感谢各位开发者`四年`来对秋云及uCharts的支持,uCharts的进步离不开各位开发者的鼓励与贡献。为更好的帮助各位开发者使用图表工具,我们推出了新版官网,增加了在线定制、问答社区、在线配置等一些增值服务,为确保您能更好的应用图表组件,建议您先`仔细阅读本页指南`以及`常见问题`,而不是下载下来`直接使用`。如仍然不能解决,请到`官网社区`或开通会员后加入`专属VIP会员群`提问将会很快得到回答。
|
||||
|
||||
## 社群支持
|
||||
|
||||
uCharts官方拥有4个2000人的QQ群及专属VIP会员群支持,庞大的用户量证明我们一直在努力,请各位放心使用!uCharts的开源图表组件的开发,团队付出了大量的时间与精力,经过四来的考验,不会有比较明显的bug,请各位放心使用。如果您有更好的想法,可以在`码云提交Pull Requests`以帮助更多开发者完成需求,再次感谢各位对uCharts的鼓励与支持!
|
||||
|
||||
#### 官方交流群
|
||||
- 交流群1:371774600(已满)
|
||||
- 交流群2:619841586(已满)
|
||||
- 交流群3:955340127(已满)
|
||||
- 交流群4:641669795(已满)
|
||||
- 交流群5:236294809(只能扫码加入)
|
||||
|
||||

|
||||
|
||||
- 口令`npm`
|
||||
|
||||
#### 专属VIP会员群
|
||||
- 开通会员后详见【账号详情】页面中顶部的滚动通知
|
||||
- 口令`您的用户ID`
|
||||
|
||||
## 版权信息
|
||||
|
||||
uCharts始终坚持开源,遵循 [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 开源协议,意味着您无需支付任何费用,即可将uCharts应用到您的产品中。
|
||||
|
||||
注意:这并不意味着您可以将uCharts应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uCharts相关方及秋云科技不承担任何责任。
|
||||
|
||||
## 合作伙伴
|
||||
|
||||
[](https://uniapp.dcloud.io/)
|
||||
[](https://www.diygw.com/)
|
||||
[](https://gitee.com/howcode/has-chat)
|
||||
[](https://www.uviewui.com/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=7088)
|
||||
[](https://ext.dcloud.net.cn/publisher?id=202)
|
||||
[](https://www.firstui.cn/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=5169)
|
||||
[](https://www.graceui.com/)
|
||||
|
||||
|
||||
## 更新记录
|
||||
|
||||
详见官网指南中说明,[点击此处查看](https://www.ucharts.cn/v2/#/guide/index?id=100)
|
||||
7706
node_modules/@qiun/ucharts/u-charts.js
generated
vendored
Normal file
7706
node_modules/@qiun/ucharts/u-charts.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
node_modules/@qiun/ucharts/u-charts.min.js
generated
vendored
Normal file
18
node_modules/@qiun/ucharts/u-charts.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
71
node_modules/@qiun/vue-ucharts/package.json
generated
vendored
Normal file
71
node_modules/@qiun/vue-ucharts/package.json
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"_from": "@qiun/vue-ucharts",
|
||||
"_id": "@qiun/vue-ucharts@2.5.0-20230101",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-HZ4q6CBjzheAmocr//jY2nV3wO2Xu+2CX6NjwUD+uM1Jo/ewlnNIL2TiRRqtwMBhyaIoJh4nCzmnoeT7kUvlxA==",
|
||||
"_location": "/@qiun/vue-ucharts",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "@qiun/vue-ucharts",
|
||||
"name": "@qiun/vue-ucharts",
|
||||
"escapedName": "@qiun%2fvue-ucharts",
|
||||
"scope": "@qiun",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmmirror.com/@qiun/vue-ucharts/-/vue-ucharts-2.5.0-20230101.tgz",
|
||||
"_shasum": "1da4b857873aa6dd0ab05ae4bef198f3324d5de5",
|
||||
"_spec": "@qiun/vue-ucharts",
|
||||
"_where": "C:\\chunfen\\shop_app",
|
||||
"author": {
|
||||
"name": "秋云"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "【Vue-uCharts组件】uCharts跨平台图表库,全端全平台支持的图表库,开箱即用。支持PC、H5、微信小程序、支付宝小程序、百度小程序、头条小程序、飞书小程序、QQ小程序、360小程序、快手小程序、钉钉小程序、淘宝小程序、京东小程序、Vue、Taro等更多支持canvas的框架,体积小巧、调用简单方便、性能及体验极佳。",
|
||||
"homepage": "https://www.ucharts.cn",
|
||||
"keywords": [
|
||||
"uCharts",
|
||||
"大图",
|
||||
"大屏",
|
||||
"可视化",
|
||||
"图表库",
|
||||
"饼图",
|
||||
"圆环图",
|
||||
"折线图",
|
||||
"柱状图",
|
||||
"山峰图",
|
||||
"区域图",
|
||||
"雷达图",
|
||||
"圆弧进度图",
|
||||
"仪表盘",
|
||||
"K线图",
|
||||
"条状图",
|
||||
"混合图",
|
||||
"玫瑰图",
|
||||
"漏斗图",
|
||||
"词云图",
|
||||
"时序图",
|
||||
"散点图",
|
||||
"气泡图",
|
||||
"地图"
|
||||
],
|
||||
"license": "Apache",
|
||||
"main": "src/index.js",
|
||||
"name": "@qiun/vue-ucharts",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "2.5.0-20230101"
|
||||
}
|
||||
78
node_modules/@qiun/vue-ucharts/readme.md
generated
vendored
Normal file
78
node_modules/@qiun/vue-ucharts/readme.md
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
<h1 align="center">Vue uCharts组件</h1>
|
||||
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
[](https://gitee.com/uCharts/uCharts/stargazers)
|
||||
[](https://gitee.com/uCharts/uCharts/members)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
[](https://www.npmjs.com/~qiun)
|
||||
|
||||
</div>
|
||||
|
||||
## uCharts简介
|
||||
|
||||
`uCharts`是一款基于`canvas API`开发的适用于所有前端应用的图表库,开发者编写一套代码,可运行到 Web、iOS、Android(基于 uni-app / taro )、以及各种小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝/京东)、快应用等更多支持 canvas API 的平台。
|
||||
|
||||
## 官方网站
|
||||
|
||||
## [https://www.ucharts.cn](https://www.ucharts.cn)
|
||||
|
||||
## 快速体验
|
||||
|
||||
一套代码编到多个平台,依次扫描二维码,亲自体验uCharts图表跨平台效果!其他平台请自行编译。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
## 视频教程
|
||||
## [uCharts新手入门教程](https://www.bilibili.com/video/BV1qA411Q7se/?share_source=copy_web&vd_source=42a1242f9aaade6427736af69eb2e1d9)
|
||||
|
||||
## 致开发者
|
||||
|
||||
感谢各位开发者`四年`来对秋云及uCharts的支持,uCharts的进步离不开各位开发者的鼓励与贡献。为更好的帮助各位开发者使用图表工具,我们推出了新版官网,增加了在线定制、问答社区、在线配置等一些增值服务,为确保您能更好的应用图表组件,建议您先`仔细阅读本页指南`以及`常见问题`,而不是下载下来`直接使用`。如仍然不能解决,请到`官网社区`或开通会员后加入`专属VIP会员群`提问将会很快得到回答。
|
||||
|
||||
## 社群支持
|
||||
|
||||
uCharts官方拥有5个2000人的QQ群及专属VIP会员群支持,庞大的用户量证明我们一直在努力,请各位放心使用!uCharts的开源图表组件的开发,团队付出了大量的时间与精力,经过四来的考验,不会有比较明显的bug,请各位放心使用。如果您有更好的想法,可以在`码云提交Pull Requests`以帮助更多开发者完成需求,再次感谢各位对uCharts的鼓励与支持!
|
||||
|
||||
#### 官方交流群
|
||||
- 交流群1:371774600(已满)
|
||||
- 交流群2:619841586(已满)
|
||||
- 交流群3:955340127(已满)
|
||||
- 交流群4:641669795(已满)
|
||||
- 交流群5:236294809(只能扫码加入)
|
||||
|
||||

|
||||
|
||||
- 口令`npm`
|
||||
|
||||
#### 专属VIP会员群
|
||||
- 开通会员后详见【账号详情】页面中顶部的滚动通知
|
||||
- 口令`您的用户ID`
|
||||
|
||||
## 版权信息
|
||||
|
||||
uCharts始终坚持开源,遵循 [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 开源协议,意味着您无需支付任何费用,即可将uCharts应用到您的产品中。
|
||||
|
||||
注意:这并不意味着您可以将uCharts应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uCharts相关方及秋云科技不承担任何责任。
|
||||
|
||||
## 合作伙伴
|
||||
|
||||
[](https://uniapp.dcloud.io/)
|
||||
[](https://www.diygw.com/)
|
||||
[](https://gitee.com/howcode/has-chat)
|
||||
[](https://www.uviewui.com/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=7088)
|
||||
[](https://ext.dcloud.net.cn/publisher?id=202)
|
||||
[](https://www.firstui.cn/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=5169)
|
||||
[](https://www.graceui.com/)
|
||||
|
||||
|
||||
## 更新记录
|
||||
|
||||
详见官网指南中说明,[点击此处查看](https://www.ucharts.cn/v2/#/guide/index?id=100)
|
||||
601
node_modules/@qiun/vue-ucharts/src/config-ucharts.js
generated
vendored
Normal file
601
node_modules/@qiun/vue-ucharts/src/config-ucharts.js
generated
vendored
Normal file
@ -0,0 +1,601 @@
|
||||
/*
|
||||
* uCharts®
|
||||
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
|
||||
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
*
|
||||
* uCharts®官方网站
|
||||
* https://www.uCharts.cn
|
||||
*
|
||||
* 开源地址:
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
*/
|
||||
|
||||
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
|
||||
|
||||
//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改
|
||||
const formatDateTime = (timeStamp, returnType)=>{
|
||||
var date = new Date();
|
||||
date.setTime(timeStamp * 1000);
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
var d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
var h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
var minute = date.getMinutes();
|
||||
var second = date.getSeconds();
|
||||
minute = minute < 10 ? ('0' + minute) : minute;
|
||||
second = second < 10 ? ('0' + second) : second;
|
||||
if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;}
|
||||
if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;}
|
||||
if(returnType == 'h:m'){return h +':' + minute;}
|
||||
if(returnType == 'h:m:s'){return h +':' + minute +':' + second;}
|
||||
return [y, m, d, h, minute, second];
|
||||
}
|
||||
|
||||
const cfu = {
|
||||
//demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
|
||||
"type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"],
|
||||
"range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"],
|
||||
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
|
||||
//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
|
||||
"categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"],
|
||||
//instance为实例变量承载属性,不要删除
|
||||
"instance":{},
|
||||
//option为opts及eopts承载属性,不要删除
|
||||
"option":{},
|
||||
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||
"formatter":{
|
||||
"yAxisDemo1":function(val, index, opts){return val+'元'},
|
||||
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)},
|
||||
"xAxisDemo1":function(val, index, opts){return val+'年';},
|
||||
"xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')},
|
||||
"seriesDemo1":function(val, index, series, opts){return val+'元'},
|
||||
"tooltipDemo1":function(item, category, index, opts){
|
||||
if(index==0){
|
||||
return '随便用'+item.data+'年'
|
||||
}else{
|
||||
return '其他我没改'+item.data+'天'
|
||||
}
|
||||
},
|
||||
"pieDemo":function(val, index, series, opts){
|
||||
if(index !== undefined){
|
||||
return series[index].name+':'+series[index].data+'元'
|
||||
}
|
||||
},
|
||||
},
|
||||
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
|
||||
"demotype":{
|
||||
//我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
//下面是自定义配置,请添加项目所需的通用配置
|
||||
"pie":{
|
||||
"type": "pie",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"extra": {
|
||||
"pie": {
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"ring":{
|
||||
"type": "ring",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"rotate": false,
|
||||
"dataLabel": true,
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"title": {
|
||||
"name": "收益率",
|
||||
"fontSize": 15,
|
||||
"color": "#666666"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "70%",
|
||||
"fontSize": 25,
|
||||
"color": "#7cb5ec"
|
||||
},
|
||||
"extra": {
|
||||
"ring": {
|
||||
"ringWidth":30,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
"rose":{
|
||||
"type": "rose",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "left",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"rose": {
|
||||
"type": "area",
|
||||
"minRadius": 50,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": false,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"word":{
|
||||
"type": "word",
|
||||
"color": color,
|
||||
"extra": {
|
||||
"word": {
|
||||
"type": "normal",
|
||||
"autoColors": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"funnel":{
|
||||
"type": "funnel",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"extra": {
|
||||
"funnel": {
|
||||
"activeOpacity": 0.3,
|
||||
"activeWidth": 10,
|
||||
"border": true,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF",
|
||||
"fillOpacity": 1,
|
||||
"labelAlign": "right"
|
||||
},
|
||||
}
|
||||
},
|
||||
"map":{
|
||||
"type": "map",
|
||||
"color": color,
|
||||
"padding": [0,0,0,0],
|
||||
"dataLabel": true,
|
||||
"extra": {
|
||||
"map": {
|
||||
"border": true,
|
||||
"borderWidth": 1,
|
||||
"borderColor": "#666666",
|
||||
"fillOpacity": 0.6,
|
||||
"activeBorderColor": "#F04864",
|
||||
"activeFillColor": "#FACC14",
|
||||
"activeFillOpacity": 1
|
||||
},
|
||||
}
|
||||
},
|
||||
"arcbar":{
|
||||
"type": "arcbar",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "百分比",
|
||||
"fontSize": 25,
|
||||
"color": "#00FF00"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "默认标题",
|
||||
"fontSize": 15,
|
||||
"color": "#666666"
|
||||
},
|
||||
"extra": {
|
||||
"arcbar": {
|
||||
"type": "default",
|
||||
"width": 12,
|
||||
"backgroundColor": "#E9E9E9",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"gap": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"line":{
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "straight",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
"tline":{
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"boundaryGap":"justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data":[
|
||||
{
|
||||
"min":0,
|
||||
"max":80
|
||||
}
|
||||
]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
"tarea":{
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
"boundaryGap":"justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data":[
|
||||
{
|
||||
"min":0,
|
||||
"max":80
|
||||
}
|
||||
]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "curve",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": true
|
||||
},
|
||||
}
|
||||
},
|
||||
"column":{
|
||||
"type": "column",
|
||||
"color": color,
|
||||
"padding": [15,15,0,5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"data":[{"min":0}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"column": {
|
||||
"type": "group",
|
||||
"width": 30,
|
||||
"activeBgColor": "#000000",
|
||||
"activeBgOpacity": 0.08
|
||||
},
|
||||
}
|
||||
},
|
||||
"mount":{
|
||||
"type": "mount",
|
||||
"color": color,
|
||||
"padding": [15,15,0,5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"data":[{"min":0}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"mount": {
|
||||
"type": "mount",
|
||||
"widthRatio": 1.5,
|
||||
},
|
||||
}
|
||||
},
|
||||
"bar":{
|
||||
"type": "bar",
|
||||
"color": color,
|
||||
"padding": [15,30,0,5],
|
||||
"xAxis": {
|
||||
"boundaryGap":"justify",
|
||||
"disableGrid":false,
|
||||
"min":0,
|
||||
"axisLine":false
|
||||
},
|
||||
"yAxis": {
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"bar": {
|
||||
"type": "group",
|
||||
"width": 30,
|
||||
"meterBorde": 1,
|
||||
"meterFillColor": "#FFFFFF",
|
||||
"activeBgColor": "#000000",
|
||||
"activeBgOpacity": 0.08
|
||||
},
|
||||
}
|
||||
},
|
||||
"area":{
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "straight",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": false
|
||||
},
|
||||
}
|
||||
},
|
||||
"radar":{
|
||||
"type": "radar",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"dataLabel": false,
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"radar": {
|
||||
"gridType": "radar",
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridCount": 3,
|
||||
"opacity": 0.2,
|
||||
"max": 200
|
||||
},
|
||||
}
|
||||
},
|
||||
"gauge":{
|
||||
"type": "gauge",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "66Km/H",
|
||||
"fontSize": 25,
|
||||
"color": "#2fc25b",
|
||||
"offsetY": 50
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "实时速度",
|
||||
"fontSize": 15,
|
||||
"color": "#1890ff",
|
||||
"offsetY": -50
|
||||
},
|
||||
"extra": {
|
||||
"gauge": {
|
||||
"type": "default",
|
||||
"width": 30,
|
||||
"labelColor": "#666666",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"startNumber": 0,
|
||||
"endNumber": 100,
|
||||
"labelFormat": "",
|
||||
"splitLine": {
|
||||
"fixRadius": 0,
|
||||
"splitNumber": 10,
|
||||
"width": 30,
|
||||
"color": "#FFFFFF",
|
||||
"childNumber": 5,
|
||||
"childWidth": 12
|
||||
},
|
||||
"pointer": {
|
||||
"width": 24,
|
||||
"color": "auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"candle":{
|
||||
"type": "candle",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"enableScroll": true,
|
||||
"enableMarkLine": true,
|
||||
"dataLabel": false,
|
||||
"xAxis": {
|
||||
"labelCount": 4,
|
||||
"itemCount": 40,
|
||||
"disableGrid": true,
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridType": "solid",
|
||||
"dashLength": 4,
|
||||
"scrollShow": true,
|
||||
"scrollAlign": "left",
|
||||
"scrollColor": "#A6A6A6",
|
||||
"scrollBackgroundColor": "#EFEBEF"
|
||||
},
|
||||
"yAxis": {
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"candle": {
|
||||
"color": {
|
||||
"upLine": "#f04864",
|
||||
"upFill": "#f04864",
|
||||
"downLine": "#2fc25b",
|
||||
"downFill": "#2fc25b"
|
||||
},
|
||||
"average": {
|
||||
"show": true,
|
||||
"name": ["MA5","MA10","MA30"],
|
||||
"day": [5,10,20],
|
||||
"color": ["#1890ff","#2fc25b","#facc14"]
|
||||
}
|
||||
},
|
||||
"markLine": {
|
||||
"type": "dash",
|
||||
"dashLength": 5,
|
||||
"data": [
|
||||
{
|
||||
"value": 2150,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
},
|
||||
{
|
||||
"value": 2350,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"mix":{
|
||||
"type": "mix",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"disabled": false,
|
||||
"disableGrid": false,
|
||||
"splitNumber": 5,
|
||||
"gridType": "dash",
|
||||
"dashLength": 4,
|
||||
"gridColor": "#CCCCCC",
|
||||
"padding": 10,
|
||||
"showTitle": true,
|
||||
"data": []
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"mix": {
|
||||
"column": {
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
"scatter":{
|
||||
"type": "scatter",
|
||||
"color":color,
|
||||
"padding":[15,15,0,15],
|
||||
"dataLabel":false,
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"splitNumber":5,
|
||||
"boundaryGap":"justify",
|
||||
"min":0
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"scatter": {
|
||||
},
|
||||
}
|
||||
},
|
||||
"bubble":{
|
||||
"type": "bubble",
|
||||
"color":color,
|
||||
"padding":[15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"splitNumber":5,
|
||||
"boundaryGap":"justify",
|
||||
"min":0,
|
||||
"max":250
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"data":[{
|
||||
"min":0,
|
||||
"max":150
|
||||
}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"bubble": {
|
||||
"border":2,
|
||||
"opacity": 0.5,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default cfu;
|
||||
2
node_modules/@qiun/vue-ucharts/src/index.js
generated
vendored
Normal file
2
node_modules/@qiun/vue-ucharts/src/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import qiunVueUcharts from './qiun-vue-ucharts.vue'
|
||||
export default qiunVueUcharts;
|
||||
162
node_modules/@qiun/vue-ucharts/src/loading1.vue
generated
vendored
Normal file
162
node_modules/@qiun/vue-ucharts/src/loading1.vue
generated
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="container loading1">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading1',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
.container.loading1 {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading1 .shape1 {
|
||||
-webkit-animation: animation1shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, 16px);
|
||||
transform: translate(16px, 16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, 16px);
|
||||
transform: translate(16px, 16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape2 {
|
||||
-webkit-animation: animation1shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, 16px);
|
||||
transform: translate(-16px, 16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, 16px);
|
||||
transform: translate(-16px, 16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape3 {
|
||||
-webkit-animation: animation1shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, -16px);
|
||||
transform: translate(16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, -16px);
|
||||
transform: translate(16px, -16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape4 {
|
||||
-webkit-animation: animation1shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, -16px);
|
||||
transform: translate(-16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, -16px);
|
||||
transform: translate(-16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
170
node_modules/@qiun/vue-ucharts/src/loading2.vue
generated
vendored
Normal file
170
node_modules/@qiun/vue-ucharts/src/loading2.vue
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<view class="container loading2">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading2',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading2 {
|
||||
-webkit-transform: rotate(10deg);
|
||||
transform: rotate(10deg);
|
||||
}
|
||||
.container.loading2 .shape {
|
||||
border-radius: 5px;
|
||||
}
|
||||
.container.loading2{
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
|
||||
.loading2 .shape1 {
|
||||
-webkit-animation: animation2shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, 20px);
|
||||
transform: translate(20px, 20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, 20px);
|
||||
transform: translate(20px, 20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape2 {
|
||||
-webkit-animation: animation2shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, 20px);
|
||||
transform: translate(-20px, 20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, 20px);
|
||||
transform: translate(-20px, 20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape3 {
|
||||
-webkit-animation: animation2shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, -20px);
|
||||
transform: translate(20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, -20px);
|
||||
transform: translate(20px, -20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape4 {
|
||||
-webkit-animation: animation2shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, -20px);
|
||||
transform: translate(-20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, -20px);
|
||||
transform: translate(-20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
173
node_modules/@qiun/vue-ucharts/src/loading3.vue
generated
vendored
Normal file
173
node_modules/@qiun/vue-ucharts/src/loading3.vue
generated
vendored
Normal file
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view class="container loading3">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading3',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading3 {
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
.container.loading3 .shape1 {
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape2 {
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape3 {
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape4 {
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading3 .shape1 {
|
||||
-webkit-animation: animation3shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, 5px);
|
||||
transform: translate(5px, 5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, 5px);
|
||||
transform: translate(5px, 5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape2 {
|
||||
-webkit-animation: animation3shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, 5px);
|
||||
transform: translate(-5px, 5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, 5px);
|
||||
transform: translate(-5px, 5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape3 {
|
||||
-webkit-animation: animation3shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, -5px);
|
||||
transform: translate(5px, -5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, -5px);
|
||||
transform: translate(5px, -5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape4 {
|
||||
-webkit-animation: animation3shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, -5px);
|
||||
transform: translate(-5px, -5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, -5px);
|
||||
transform: translate(-5px, -5px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
222
node_modules/@qiun/vue-ucharts/src/loading4.vue
generated
vendored
Normal file
222
node_modules/@qiun/vue-ucharts/src/loading4.vue
generated
vendored
Normal file
@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<view class="container loading5">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading5',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading5 .shape {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading5 .shape1 {
|
||||
animation: animation5shape1 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, 15px);
|
||||
transform: translate(15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, 15px);
|
||||
transform: translate(15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
}
|
||||
.loading5 .shape2 {
|
||||
animation: animation5shape2 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, 15px);
|
||||
transform: translate(-15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, 15px);
|
||||
transform: translate(-15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
}
|
||||
.loading5 .shape3 {
|
||||
animation: animation5shape3 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, -15px);
|
||||
transform: translate(15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, -15px);
|
||||
transform: translate(15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
}
|
||||
.loading5 .shape4 {
|
||||
animation: animation5shape4 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, -15px);
|
||||
transform: translate(-15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, -15px);
|
||||
transform: translate(-15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
229
node_modules/@qiun/vue-ucharts/src/loading5.vue
generated
vendored
Normal file
229
node_modules/@qiun/vue-ucharts/src/loading5.vue
generated
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<view class="container loading6">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading6',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading6 {
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
.container.loading6 .shape {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
|
||||
.loading6 .shape1 {
|
||||
-webkit-animation: animation6shape1 2s linear 0s infinite normal;
|
||||
animation: animation6shape1 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, 18px);
|
||||
transform: translate(18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, 18px);
|
||||
transform: translate(18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
}
|
||||
.loading6 .shape2 {
|
||||
-webkit-animation: animation6shape2 2s linear 0s infinite normal;
|
||||
animation: animation6shape2 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, 18px);
|
||||
transform: translate(-18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, 18px);
|
||||
transform: translate(-18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
}
|
||||
.loading6 .shape3 {
|
||||
-webkit-animation: animation6shape3 2s linear 0s infinite normal;
|
||||
animation: animation6shape3 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, -18px);
|
||||
transform: translate(18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, -18px);
|
||||
transform: translate(18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
}
|
||||
.loading6 .shape4 {
|
||||
-webkit-animation: animation6shape4 2s linear 0s infinite normal;
|
||||
animation: animation6shape4 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, -18px);
|
||||
transform: translate(-18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, -18px);
|
||||
transform: translate(-18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
46
node_modules/@qiun/vue-ucharts/src/qiun-error.vue
generated
vendored
Normal file
46
node_modules/@qiun/vue-ucharts/src/qiun-error.vue
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
36
node_modules/@qiun/vue-ucharts/src/qiun-loading.vue
generated
vendored
Normal file
36
node_modules/@qiun/vue-ucharts/src/qiun-loading.vue
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<view>
|
||||
<Loading1 v-if="loadingType==1"/>
|
||||
<Loading2 v-if="loadingType==2"/>
|
||||
<Loading3 v-if="loadingType==3"/>
|
||||
<Loading4 v-if="loadingType==4"/>
|
||||
<Loading5 v-if="loadingType==5"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Loading1 from "./loading1.vue";
|
||||
import Loading2 from "./loading2.vue";
|
||||
import Loading3 from "./loading3.vue";
|
||||
import Loading4 from "./loading4.vue";
|
||||
import Loading5 from "./loading5.vue";
|
||||
export default {
|
||||
components:{Loading1,Loading2,Loading3,Loading4,Loading5},
|
||||
name: 'qiun-loading',
|
||||
props: {
|
||||
loadingType: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
769
node_modules/@qiun/vue-ucharts/src/qiun-vue-ucharts.vue
generated
vendored
Normal file
769
node_modules/@qiun/vue-ucharts/src/qiun-vue-ucharts.vue
generated
vendored
Normal file
@ -0,0 +1,769 @@
|
||||
<!--
|
||||
* qiun-data-charts 秋云高性能跨全端图表组件
|
||||
* Copyright (c) 2021 QIUN® 秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
* 为方便更多开发者使用,如有更好的建议请提交码云 Pull Requests !
|
||||
*
|
||||
* uCharts®官方网站
|
||||
* https://www.uCharts.cn
|
||||
*
|
||||
* 开源地址:
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<div class="chartsview" :id="'ChartBoxId'+cid">
|
||||
<div v-if="mixinDatacomLoading">
|
||||
<!-- 自定义加载状态,请改这里 -->
|
||||
<qiun-loading :loadingType="loadingType" />
|
||||
</div>
|
||||
<div v-if="mixinDatacomErrorMessage && errorShow" @tap="reloading">
|
||||
<!-- 自定义错误提示,请改这里 -->
|
||||
<qiun-error :errorMessage="errorMessage" />
|
||||
</div>
|
||||
<div :id="'UC'+cid">
|
||||
<canvas
:id="cid"
:canvasId="cid"
:width="cWidth*pixel"
:height="cHeight*pixel"
:style="{width:cWidth*pixel+'px',height:cHeight*pixel+'px', transform: 'scale('+(1/pixel)+')'}"
:disable-scroll="disableScroll"
|
||||
v-on:tap="tap"
|
||||
v-on:click="tap"
|
||||
v-on:mousemove="mouseMove"
|
||||
v-on:mousedown="mouseDown"
|
||||
v-on:mouseup="mouseUp"
|
||||
v-on:touchstart="touchStart"
|
||||
v-on:touchmove="touchMove"
|
||||
v-on:touchend="touchEnd"
v-show="showchart"
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uCharts from './u-charts.js';
|
||||
import cfu from './config-ucharts.js';
|
||||
import qiunLoading from './qiun-loading.vue';
|
||||
import qiunError from './qiun-error.vue';
|
||||
|
||||
function deepCloneAssign(origin = {}, ...args) {
|
||||
for (let i in args) {
|
||||
for (let key in args[i]) {
|
||||
if (args[i].hasOwnProperty(key)) {
|
||||
origin[key] = args[i][key] && typeof args[i][key] === 'object' ? deepCloneAssign(Array.isArray(args[i][key]) ? [] : {}, origin[key], args[i][key]) : args[i][key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return origin;
|
||||
}
|
||||
|
||||
function formatterAssign(args,formatter) {
|
||||
for (let key in args) {
|
||||
if(args.hasOwnProperty(key) && args[key] !== null && typeof args[key] === 'object'){
|
||||
formatterAssign(args[key],formatter)
|
||||
}else if(key === 'format' && typeof args[key] === 'string'){
|
||||
args['formatter'] = formatter[args[key]] ? formatter[args[key]] : undefined;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
function debounce(fn, wait) {
|
||||
let timer = false;
|
||||
return function() {
|
||||
clearTimeout(timer);
|
||||
timer && clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
timer = false;
|
||||
fn.apply(this, arguments);
|
||||
}, wait);
|
||||
};
|
||||
}
|
||||
|
||||
var rootdom = {top:0,left:0};
|
||||
var lastMoveTime = null;
|
||||
|
||||
export default {
|
||||
name: 'qiun-vue-ucharts',
|
||||
components: {
|
||||
qiunLoading,qiunError
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
canvasId: {
|
||||
type: String,
|
||||
default: 'uchartsid'
|
||||
},
|
||||
canvas2d: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
background: {
|
||||
type: String,
|
||||
default: 'rgba(0,0,0,0)'
|
||||
},
|
||||
animation: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
chartData: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
categories: [],
|
||||
series: []
|
||||
};
|
||||
}
|
||||
},
|
||||
localdata:{
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
opts: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
loadingType: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
errorShow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
errorReload: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
errorMessage: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
inScrollView: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
reshow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
reload: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disableScroll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
optsWatch: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
onzoom: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
ontap: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
ontouch: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
onmouse: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
onmovetip: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
tooltipShow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
tooltipFormat: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
tooltipCustom: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
},
|
||||
pageScrollTop: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
tapLegend: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
resizeObserver: null,
|
||||
cid: 'uchartsid',
|
||||
type2d: true,
|
||||
cWidth: 375,
|
||||
cHeight: 250,
|
||||
showchart: false,
|
||||
mixinDatacomErrorMessage:null,
|
||||
mixinDatacomLoading:true,
|
||||
pixel: 1,
|
||||
drawData:{},
|
||||
lastDrawTime:null,
|
||||
};
|
||||
},
|
||||
created(){
|
||||
this.cid = this.canvasId
|
||||
if (this.canvasId == 'uchartsid' || this.canvasId == '') {
|
||||
let t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
||||
let len = t.length
|
||||
let id = ''
|
||||
for (let i = 0; i < 32; i++) {
|
||||
id += t.charAt(Math.floor(Math.random() * len))
|
||||
}
|
||||
this.cid = id
|
||||
}
|
||||
const pixel = window.devicePixelRatio || 1;
|
||||
this.pixel = pixel;
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(()=>{
|
||||
this.beforeInit();
|
||||
})
|
||||
const time = 500;
|
||||
const _this = this;
|
||||
let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
|
||||
let element = document.getElementById('ChartBoxId'+this.cid);
|
||||
this.resizeObserver = new ResizeObserver(debounce(function(res) {
|
||||
if (_this.mixinDatacomLoading == true) {
|
||||
return;
|
||||
}
|
||||
let errmsg = _this.mixinDatacomErrorMessage;
|
||||
if (errmsg !== null && errmsg !== 'null' && errmsg !== '') {
|
||||
return;
|
||||
}
|
||||
_this.resizeHandler();
|
||||
}, time))
|
||||
this.resizeObserver.observe(element)
|
||||
},
|
||||
beforeDestroy() {
|
||||
delete cfu.option[this.cid]
|
||||
delete cfu.instance[this.cid]
|
||||
if (this.resizeObserver) {
|
||||
this.resizeObserver.disconnect();
|
||||
this.resizeObserver = null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartDataProps: {
|
||||
handler(val, oldval) {
|
||||
if (typeof val === 'object') {
|
||||
if (JSON.stringify(val) !== JSON.stringify(oldval)) {
|
||||
this._clearChart();
|
||||
if (val.series && val.series.length > 0) {
|
||||
this.beforeInit();
|
||||
}else{
|
||||
this.mixinDatacomLoading = true;
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.mixinDatacomLoading = false;
|
||||
this._clearChart();
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = '参数错误:chartData数据类型错误';
|
||||
}
|
||||
},
|
||||
immediate: false,
|
||||
deep: true
|
||||
},
|
||||
localdata:{
|
||||
handler(val, oldval) {
|
||||
if (JSON.stringify(val) !== JSON.stringify(oldval)) {
|
||||
if (val.length > 0) {
|
||||
this.beforeInit();
|
||||
}else{
|
||||
this.mixinDatacomLoading = true;
|
||||
this._clearChart();
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: false,
|
||||
deep: true
|
||||
},
|
||||
optsProps: {
|
||||
handler(val, oldval) {
|
||||
if (typeof val === 'object') {
|
||||
if (JSON.stringify(val) !== JSON.stringify(oldval) && this.optsWatch == true) {
|
||||
this.checkData(this.drawData);
|
||||
}
|
||||
} else {
|
||||
this.mixinDatacomLoading = false;
|
||||
this._clearChart();
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = '参数错误:opts数据类型错误';
|
||||
}
|
||||
},
|
||||
immediate: false,
|
||||
deep: true
|
||||
},
|
||||
reshow(val, oldval) {
|
||||
if (val === true && this.mixinDatacomLoading === false) {
|
||||
setTimeout(() => {
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
this.checkData(this.drawData);
|
||||
}, 200);
|
||||
}
|
||||
},
|
||||
reload(val, oldval) {
|
||||
if (val === true) {
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
this.reloading();
|
||||
}
|
||||
},
|
||||
mixinDatacomErrorMessage(val, oldval) {
|
||||
if (val) {
|
||||
this.emitMsg({name: 'error', params: {type:"error", errorShow: this.errorShow, msg: val, id: this.cid}});
|
||||
if(this.errorShow){
|
||||
console.log('[秋云图表组件]' + val);
|
||||
}
|
||||
}
|
||||
},
|
||||
errorMessage(val, oldval) {
|
||||
if (val && this.errorShow && val !== null && val !== 'null' && val !== '') {
|
||||
this.showchart = false;
|
||||
this.mixinDatacomLoading = false;
|
||||
this.mixinDatacomErrorMessage = val;
|
||||
} else {
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
this.reloading();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
optsProps() {
|
||||
return JSON.parse(JSON.stringify(this.opts));
|
||||
},
|
||||
chartDataProps() {
|
||||
return JSON.parse(JSON.stringify(this.chartData));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
beforeInit(){
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
if (typeof this.chartData === 'object' && this.chartData != null && this.chartData.series !== undefined && this.chartData.series.length > 0) {
|
||||
//拷贝一下chartData,为了opts变更后统一数据来源
|
||||
this.drawData = deepCloneAssign({}, this.chartData);
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = true;
|
||||
this.checkData(this.chartData);
|
||||
}else if(this.localdata.length>0){
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = true;
|
||||
this.localdataInit(this.localdata);
|
||||
}else{
|
||||
this.mixinDatacomLoading = true;
|
||||
}
|
||||
},
|
||||
localdataInit(resdata){
|
||||
//替换enum类型为正确的描述
|
||||
let needCategories = false;
|
||||
let tmpData = {categories:[], series:[]}
|
||||
let tmpcategories = []
|
||||
let tmpseries = [];
|
||||
//拼接categories
|
||||
needCategories = cfu.categories.includes(this.type)
|
||||
if(needCategories === true){
|
||||
//如果props中的chartData带有categories,则优先使用chartData的categories
|
||||
if(this.chartData && this.chartData.categories && this.chartData.categories.length>0){
|
||||
tmpcategories = this.chartData.categories
|
||||
}else{
|
||||
let tempckey = {};
|
||||
resdata.map(function(item, index) {
|
||||
if (item.text != undefined && !tempckey[item.text]) {
|
||||
tmpcategories.push(item.text)
|
||||
tempckey[item.text] = true
|
||||
}
|
||||
});
|
||||
}
|
||||
tmpData.categories = tmpcategories
|
||||
}
|
||||
//拼接series
|
||||
let tempskey = {};
|
||||
resdata.map(function(item, index) {
|
||||
if (item.group != undefined && !tempskey[item.group]) {
|
||||
tmpseries.push({ name: item.group, data: [] });
|
||||
tempskey[item.group] = true;
|
||||
}
|
||||
});
|
||||
//如果没有获取到分组名称(可能是带categories的数据,也可能是不带的饼图类)
|
||||
if (tmpseries.length == 0) {
|
||||
tmpseries = [{ name: '默认分组', data: [] }];
|
||||
//如果是需要categories的图表类型
|
||||
if(needCategories === true){
|
||||
for (let j = 0; j < tmpcategories.length; j++) {
|
||||
let seriesdata = 0;
|
||||
for (let i = 0; i < resdata.length; i++) {
|
||||
if (resdata[i].text == tmpcategories[j]) {
|
||||
seriesdata = resdata[i].value;
|
||||
}
|
||||
}
|
||||
tmpseries[0].data.push(seriesdata);
|
||||
}
|
||||
//如果是饼图类的图表类型
|
||||
}else{
|
||||
for (let i = 0; i < resdata.length; i++) {
|
||||
tmpseries[0].data.push({"name": resdata[i].text,"value": resdata[i].value});
|
||||
}
|
||||
}
|
||||
//如果有分组名
|
||||
} else {
|
||||
for (let k = 0; k < tmpseries.length; k++) {
|
||||
//如果有categories
|
||||
if (tmpcategories.length > 0) {
|
||||
for (let j = 0; j < tmpcategories.length; j++) {
|
||||
let seriesdata = 0;
|
||||
for (let i = 0; i < resdata.length; i++) {
|
||||
if (tmpseries[k].name == resdata[i].group && resdata[i].text == tmpcategories[j]) {
|
||||
seriesdata = resdata[i].value;
|
||||
}
|
||||
}
|
||||
tmpseries[k].data.push(seriesdata);
|
||||
}
|
||||
//如果传了group而没有传text,即没有categories(正常情况下这种数据是不符合数据要求规范的)
|
||||
} else {
|
||||
for (let i = 0; i < resdata.length; i++) {
|
||||
if (tmpseries[k].name == resdata[i].group) {
|
||||
tmpseries[k].data.push(resdata[i].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tmpData.series = tmpseries
|
||||
//拷贝一下chartData,为了opts变更后统一数据来源
|
||||
this.drawData = deepCloneAssign({}, tmpData);
|
||||
this.checkData(tmpData)
|
||||
},
|
||||
reloading() {
|
||||
if(this.errorReload === false){
|
||||
return;
|
||||
}
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
this.beforeInit();
|
||||
},
|
||||
checkData(anyData) {
|
||||
let cid = this.cid
|
||||
//复位opts
|
||||
if (this.type && cfu.type.includes(this.type)) {
|
||||
cfu.option[cid] = deepCloneAssign({}, cfu[this.type], this.opts);
|
||||
cfu.option[cid].canvasId = cid;
|
||||
} else {
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage = '参数错误:props参数中type类型不正确';
|
||||
}
|
||||
//挂载categories和series
|
||||
let newData = deepCloneAssign({}, anyData);
|
||||
if (newData.series !== undefined && newData.series.length > 0) {
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
cfu.option[cid].categories = newData.categories;
|
||||
cfu.option[cid].series = newData.series;
|
||||
this.$nextTick(()=>{
|
||||
this.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
resizeHandler() {
|
||||
//渲染防抖
|
||||
let currTime = Date.now();
|
||||
let lastDrawTime = this.lastDrawTime?this.lastDrawTime:currTime-3000;
|
||||
let duration = currTime - lastDrawTime;
|
||||
if (duration < 1000) return;
|
||||
let chartdom = document.getElementById('ChartBoxId'+this.cid).getBoundingClientRect();
|
||||
this.showchart = true;
|
||||
if (chartdom.width > 0 && chartdom.height > 0) {
|
||||
if (chartdom.width !== this.cWidth || chartdom.height !== this.cHeight) {
|
||||
this.checkData(this.drawData)
|
||||
}
|
||||
}
|
||||
},
|
||||
_clearChart() {
|
||||
let cid = this.cid
|
||||
if (cfu.option[cid] && cfu.option[cid].context) {
|
||||
const ctx = cfu.option[cid].context;
|
||||
if(typeof ctx === "object" && !!!cfu.option[cid].update){
|
||||
ctx.clearRect(0, 0, this.cWidth*this.pixel, this.cHeight*this.pixel);
|
||||
ctx.draw();
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
let cid = this.cid
|
||||
let chartdom = document.getElementById('ChartBoxId'+this.cid).getBoundingClientRect();
|
||||
if (chartdom.width > 0 && chartdom.height > 0) {
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = true;
|
||||
this.lastDrawTime = Date.now();
|
||||
this.cWidth = chartdom.width;
|
||||
this.cHeight = chartdom.height;
|
||||
cfu.option[cid].background = this.background == 'rgba(0,0,0,0)' ? '#FFFFFF' : this.background;
|
||||
cfu.option[cid].canvas2d = this.type2d;
|
||||
cfu.option[cid].pixelRatio = this.pixel;
|
||||
cfu.option[cid].animation = this.animation;
|
||||
cfu.option[cid].width = chartdom.width * this.pixel;
|
||||
cfu.option[cid].height = chartdom.height * this.pixel;
|
||||
cfu.option[cid].onzoom = this.onzoom;
|
||||
cfu.option[cid].ontap = this.ontap;
|
||||
cfu.option[cid].ontouch = this.ontouch;
|
||||
cfu.option[cid].onmouse = this.openmouse;
|
||||
cfu.option[cid].onmovetip = this.onmovetip;
|
||||
cfu.option[cid].tooltipShow = this.tooltipShow;
|
||||
cfu.option[cid].tooltipFormat = this.tooltipFormat;
|
||||
cfu.option[cid].tooltipCustom = this.tooltipCustom;
|
||||
cfu.option[cid].inScrollView = this.inScrollView;
|
||||
cfu.option[cid].lastDrawTime = this.lastDrawTime;
|
||||
cfu.option[cid].tapLegend = this.tapLegend;
|
||||
cfu.option[cid] = formatterAssign(cfu.option[cid],cfu.formatter)
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = true;
|
||||
cfu.option[cid].context = document.getElementById(cid).getContext("2d");
|
||||
if(cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update === true){
|
||||
this._updataUChart(cid)
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
cfu.option[cid].context.restore();
|
||||
cfu.option[cid].context.save();
|
||||
this._newChart(cid)
|
||||
},100)
|
||||
}
|
||||
} else {
|
||||
this.mixinDatacomLoading = false;
|
||||
this.showchart = false;
|
||||
if (this.reshow == true) {
|
||||
this.mixinDatacomErrorMessage = '布局错误:未获取到父元素宽高尺寸!canvas-id:' + cid;
|
||||
}
|
||||
}
|
||||
},
|
||||
getImage(){
|
||||
const canvas = document.getElementById(this.cid);
|
||||
this.emitMsg({name: 'getImage', params: {type:"getImage", base64: canvas.toDataURL('image/png')}});
|
||||
},
|
||||
_newChart(cid) {
|
||||
if (this.mixinDatacomLoading == true) {
|
||||
return;
|
||||
}
|
||||
this.showchart = true;
|
||||
cfu.instance[cid] = new uCharts(cfu.option[cid]);
|
||||
cfu.instance[cid].addEventListener('renderComplete', () => {
|
||||
this.emitMsg({name: 'complete', params: {type:"complete", complete: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
cfu.instance[cid].delEventListener('renderComplete')
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollLeft', () => {
|
||||
this.emitMsg({name: 'scrollLeft', params: {type:"scrollLeft", scrollLeft: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollRight', () => {
|
||||
this.emitMsg({name: 'scrollRight', params: {type:"scrollRight", scrollRight: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
});
|
||||
},
|
||||
_updataUChart(cid) {
|
||||
cfu.instance[cid].updateData(cfu.option[cid])
|
||||
},
|
||||
tooltipDefault(item, category, index, opts) {
|
||||
if (category) {
|
||||
let data = item.data
|
||||
if(typeof item.data === "object"){
|
||||
data = item.data.value
|
||||
}
|
||||
return category + ' ' + item.name + ':' + data;
|
||||
} else {
|
||||
if (item.properties && item.properties.name) {
|
||||
return item.properties.name ;
|
||||
} else {
|
||||
return item.name + ':' + item.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
showTooltip(e,cid) {
|
||||
let tc = cfu.option[cid].tooltipCustom
|
||||
if (tc && tc !== undefined && tc !== null) {
|
||||
let offset = undefined;
|
||||
if (tc.x >= 0 && tc.y >= 0) {
|
||||
offset = { x: tc.x, y: tc.y + 10 };
|
||||
}
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
index: tc.index,
|
||||
offset: offset,
|
||||
textList: tc.textList,
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this.tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this.tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
tap(e) {
|
||||
let cid = this.cid
|
||||
let ontap = this.ontap
|
||||
let tooltipShow = this.tooltipShow
|
||||
let tapLegend = this.tapLegend
|
||||
if(ontap == false) return;
|
||||
let currentIndex=null
|
||||
let legendIndex=null
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
// e.changedTouches = [];
|
||||
// e.changedTouches.unshift(tmpe)
|
||||
currentIndex=cfu.instance[cid].getCurrentDataIndex(e)
|
||||
legendIndex=cfu.instance[cid].getLegendDataIndex(e)
|
||||
if(tapLegend === true){
|
||||
cfu.instance[cid].touchLegend(e);
|
||||
}
|
||||
if(tooltipShow==true){
|
||||
this.showTooltip(e,cid)
|
||||
}
|
||||
this.emitMsg({name:"getIndex",params:{type:"getIndex",event:tmpe,currentIndex:currentIndex,legendIndex:legendIndex,id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchStart(e) {
|
||||
let cid = this.cid
|
||||
let ontouch = this.ontouch
|
||||
if(ontouch == false) return;
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
// e.changedTouches = [];
|
||||
// e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].enableScroll === true && e.touches.length == 1){
|
||||
cfu.instance[cid].scrollStart(e);
|
||||
}
|
||||
this.emitMsg({name:"getTouchStart",params:{type:"touchStart",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchMove(e) {
|
||||
let cid = this.cid
|
||||
let ontouch = this.ontouch
|
||||
if(ontouch == false) return;
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
// e.changedTouches = [];
|
||||
// e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].enableScroll === true && e.changedTouches.length == 1){
|
||||
cfu.instance[cid].scroll(e);
|
||||
}
|
||||
if(cfu.option[cid].ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true){
|
||||
if(cfu.option[cid].tooltipShow === true){
|
||||
this.showTooltip(e,cid)
|
||||
}
|
||||
}
|
||||
if(ontouch === true && cfu.option[cid].enableScroll === true && this.onzoom === true && e.changedTouches.length == 2){
|
||||
cfu.instance[cid].dobuleZoom(e);
|
||||
}
|
||||
this.emitMsg({name:"getTouchMove",params:{type:"touchMove",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchEnd(e) {
|
||||
let cid = this.cid
|
||||
let ontouch = this.ontouch
|
||||
if(ontouch == false) return;
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
// e.changedTouches = [];
|
||||
// e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].enableScroll === true && e.touches.length == 0){
|
||||
cfu.instance[cid].scrollEnd(e);
|
||||
}
|
||||
this.emitMsg({name:"getTouchEnd",params:{type:"touchEnd",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
if(this.ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true){
|
||||
this.tap(e,true)
|
||||
}
|
||||
},
|
||||
mouseDown(e) {
|
||||
let cid = this.cid
|
||||
let onmouse = this.onmouse
|
||||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
cfu.instance[cid].scrollStart(e)
|
||||
cfu.option[cid].mousedown=true;
|
||||
this.emitMsg({name:"getTouchStart",params:{type:"mouseDown",event:tmpe,id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
mouseMove(e) {
|
||||
let cid = this.cid
|
||||
let onmouse = this.onmouse
|
||||
let tooltipShow = this.tooltipShow
|
||||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].mousedown){
|
||||
cfu.instance[cid].scroll(e)
|
||||
this.emitMsg({name:"getTouchMove",params:{type:"mouseMove",event:tmpe,id:cid, opts: cfu.instance[cid].opts}})
|
||||
}else if(cfu.instance[cid]){
|
||||
if(tooltipShow==true){
|
||||
this.showTooltip(e,cid)
|
||||
}
|
||||
}
|
||||
},
|
||||
mouseUp(e) {
|
||||
let cid = this.cid
|
||||
let onmouse = this.onmouse
|
||||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = { x: e.offsetX / this.pixel, y:e.offsetY / this.pixel}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
cfu.instance[cid].scrollEnd(e)
|
||||
cfu.option[cid].mousedown=false;
|
||||
this.emitMsg({name:"getTouchEnd",params:{type:"mouseUp",event:tmpe,id:cid, opts: cfu.instance[cid].opts}});
|
||||
},
|
||||
emitMsg(msg) {
|
||||
this.$emit(msg.name, msg.params);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chartsview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
7706
node_modules/@qiun/vue-ucharts/src/u-charts.js
generated
vendored
Normal file
7706
node_modules/@qiun/vue-ucharts/src/u-charts.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
node_modules/@qiun/vue-ucharts/src/u-charts.min.js
generated
vendored
Normal file
18
node_modules/@qiun/vue-ucharts/src/u-charts.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/dayjs/.editorconfig
generated
vendored
Normal file
7
node_modules/dayjs/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_size = 2
|
||||
929
node_modules/dayjs/CHANGELOG.md
generated
vendored
Normal file
929
node_modules/dayjs/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,929 @@
|
||||
## [1.11.11](https://github.com/iamkun/dayjs/compare/v1.11.10...v1.11.11) (2024-04-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* day of week type literal ([#2630](https://github.com/iamkun/dayjs/issues/2630)) ([f68d73e](https://github.com/iamkun/dayjs/commit/f68d73efe562fdedd9e288ecb0ce6565e602f507))
|
||||
* improve locale "zh-hk" format and meridiem ([#2419](https://github.com/iamkun/dayjs/issues/2419)) ([a947a51](https://github.com/iamkun/dayjs/commit/a947a5171aad5695eaf593bc95fe073de0f0894a))
|
||||
* Update 'da' locale to match correct first week of year ([#2592](https://github.com/iamkun/dayjs/issues/2592)) ([44b0936](https://github.com/iamkun/dayjs/commit/44b0936ad709212b63e48672d8b9c225e2c3b830))
|
||||
* update locale Bulgarian monthsShort Jan ([#2538](https://github.com/iamkun/dayjs/issues/2538)) ([f0c9a41](https://github.com/iamkun/dayjs/commit/f0c9a41c6ec91528f3790e442b0c5dff15a4e640))
|
||||
|
||||
## [1.11.10](https://github.com/iamkun/dayjs/compare/v1.11.9...v1.11.10) (2023-09-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Korean Day of Month with ordinal ([#2395](https://github.com/iamkun/dayjs/issues/2395)) ([dd55ee2](https://github.com/iamkun/dayjs/commit/dd55ee2aadd1009242235e47d558bbf028827896))
|
||||
* change back fa locale to the Gregorian calendar equivalent ([#2411](https://github.com/iamkun/dayjs/issues/2411)) ([95e9458](https://github.com/iamkun/dayjs/commit/95e9458b221fe35e59ee4a160a5db247313a68fb))
|
||||
* duration plugin - MILLISECONDS_A_MONTH const calculation ([#2362](https://github.com/iamkun/dayjs/issues/2362)) ([f0a0b54](https://github.com/iamkun/dayjs/commit/f0a0b546b074b3b511c2319a1ce83d412894b91f))
|
||||
* duration plugin getter get result 0 instead of undefined ([#2369](https://github.com/iamkun/dayjs/issues/2369)) ([061aa7e](https://github.com/iamkun/dayjs/commit/061aa7ed6c31696974665fc9b11a74d30841ebed))
|
||||
* fix isDayjs check logic ([#2383](https://github.com/iamkun/dayjs/issues/2383)) ([5f3f878](https://github.com/iamkun/dayjs/commit/5f3f8786c796cd432fe6bcb6966a810daea89203))
|
||||
* fix timezone plugin to get correct locale setting ([#2420](https://github.com/iamkun/dayjs/issues/2420)) ([4f45012](https://github.com/iamkun/dayjs/commit/4f4501256fa1bc72128aae1d841bbd782df86aed))
|
||||
* **locale:** add meridiem in `ar` locale ([#2418](https://github.com/iamkun/dayjs/issues/2418)) ([361be5c](https://github.com/iamkun/dayjs/commit/361be5c7c628614ee833d710acbe154a598b904d))
|
||||
* round durations to millisecond precision for ISO string ([#2367](https://github.com/iamkun/dayjs/issues/2367)) ([890a17a](https://github.com/iamkun/dayjs/commit/890a17a8d8ddd43c7c8b806e3afc7b27f3288d27))
|
||||
* sub-second precisions need to be rounded at the seconds field to avoid adding floats ([#2377](https://github.com/iamkun/dayjs/issues/2377)) ([a9d7d03](https://github.com/iamkun/dayjs/commit/a9d7d0398d22ebd4bfc3812ca0134a97606d54d9))
|
||||
* update $x logic to avoid plugin error ([#2429](https://github.com/iamkun/dayjs/issues/2429)) ([2254635](https://github.com/iamkun/dayjs/commit/22546357f30924fcff3b3ffa14fd04be21f97a5e))
|
||||
* Update Slovenian locale for relative time ([#2396](https://github.com/iamkun/dayjs/issues/2396)) ([5470a15](https://github.com/iamkun/dayjs/commit/5470a15e437fac803797363063b24f3ba3bd5299))
|
||||
* update uzbek language translation ([#2327](https://github.com/iamkun/dayjs/issues/2327)) ([0a91056](https://github.com/iamkun/dayjs/commit/0a910564d76dc7c128da8e0d85d8e11ebdb5660b))
|
||||
|
||||
## [1.11.9](https://github.com/iamkun/dayjs/compare/v1.11.8...v1.11.9) (2023-07-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add null to min and max plugin return type ([#2355](https://github.com/iamkun/dayjs/issues/2355)) ([62d9042](https://github.com/iamkun/dayjs/commit/62d9042eb84b78d78324694ccbeaad1679d37e68))
|
||||
* check if null passed to objectSupport parser ([#2175](https://github.com/iamkun/dayjs/issues/2175)) ([013968f](https://github.com/iamkun/dayjs/commit/013968f609c32e2269df69b4dd1feb2e8e1e035a))
|
||||
* dayjs.diff improve performance ([#2244](https://github.com/iamkun/dayjs/issues/2244)) ([33c80e1](https://github.com/iamkun/dayjs/commit/33c80e14cf14f70ceb4f54639e266cd70a3c3996))
|
||||
* dayjs(null) throws error, not return dayjs object as invalid date ([#2334](https://github.com/iamkun/dayjs/issues/2334)) ([c79e2f5](https://github.com/iamkun/dayjs/commit/c79e2f5d03eef5660b1f13385b69c0c9668d2f98))
|
||||
* objectSupport plugin causes an error when null is passed to dayjs function (closes [#2277](https://github.com/iamkun/dayjs/issues/2277)) ([#2342](https://github.com/iamkun/dayjs/issues/2342)) ([89bf31c](https://github.com/iamkun/dayjs/commit/89bf31ce0a36dcfc892029dc019d85d3654cf5fb))
|
||||
* Optimize format method ([#2313](https://github.com/iamkun/dayjs/issues/2313)) ([1fe1b1d](https://github.com/iamkun/dayjs/commit/1fe1b1d9a214d3b8c9f267b432801424a493f1c4))
|
||||
* update Duration plugin add/subtract take into account days in month ([#2337](https://github.com/iamkun/dayjs/issues/2337)) ([3b1060f](https://github.com/iamkun/dayjs/commit/3b1060f92183ab3a3c49289c2d87fbdd34c1eacc))
|
||||
* update MinMax plugin 1. ignore the 'null' in args 2. return the only one arg ([#2330](https://github.com/iamkun/dayjs/issues/2330)) ([3c2c6ee](https://github.com/iamkun/dayjs/commit/3c2c6ee4db00bbb43a7a3bb0b56bc0d0f03daddc))
|
||||
|
||||
## [1.11.8](https://github.com/iamkun/dayjs/compare/v1.11.7...v1.11.8) (2023-06-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* .format add padding to 'YYYY' ([#2231](https://github.com/iamkun/dayjs/issues/2231)) ([00c223b](https://github.com/iamkun/dayjs/commit/00c223b7e92970d07557133994fcb225a6d4c960))
|
||||
* Added .valueOf method to Duration class ([#2226](https://github.com/iamkun/dayjs/issues/2226)) ([9b4fcfd](https://github.com/iamkun/dayjs/commit/9b4fcfde35b39693894be1821b6c7222fac98657))
|
||||
* timezone type mark `date` parameter as optional ([#2222](https://github.com/iamkun/dayjs/issues/2222)) ([b87aa0e](https://github.com/iamkun/dayjs/commit/b87aa0ed9a748c478a66ef48230cd1d6350d7b8a))
|
||||
* type file first parameter date is optional in isSame(), isBefore(), isAfter() ([#2272](https://github.com/iamkun/dayjs/issues/2272)) ([4d56f3e](https://github.com/iamkun/dayjs/commit/4d56f3eb2b3770879d60f824590bf1b32f237d47))
|
||||
|
||||
## [1.11.7](https://github.com/iamkun/dayjs/compare/v1.11.6...v1.11.7) (2022-12-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add locale (zh-tw) meridiem ([#2149](https://github.com/iamkun/dayjs/issues/2149)) ([1e9ba76](https://github.com/iamkun/dayjs/commit/1e9ba761ff4e3f2759106dfe1aa9054d5826451c))
|
||||
* update fa locale ([#2151](https://github.com/iamkun/dayjs/issues/2151)) ([1c26732](https://github.com/iamkun/dayjs/commit/1c267321a1a01b4947e1482bac67d67ebc7c3dfa))
|
||||
|
||||
## [1.11.6](https://github.com/iamkun/dayjs/compare/v1.11.5...v1.11.6) (2022-10-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add BigIntSupport plugin ([#2087](https://github.com/iamkun/dayjs/issues/2087)) ([f6dce48](https://github.com/iamkun/dayjs/commit/f6dce48a9e39677718b087867d9fd901d5078155))
|
||||
* Fix objectSupport collides with Duration plugin - issue [#2027](https://github.com/iamkun/dayjs/issues/2027) ([#2038](https://github.com/iamkun/dayjs/issues/2038)) ([c9370ea](https://github.com/iamkun/dayjs/commit/c9370ea96bf420439ee7eaa4146e8ed643160312))
|
||||
|
||||
## [1.11.5](https://github.com/iamkun/dayjs/compare/v1.11.4...v1.11.5) (2022-08-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ordinal for nl not working ([#2011](https://github.com/iamkun/dayjs/issues/2011)) ([c93c85e](https://github.com/iamkun/dayjs/commit/c93c85eaa11564a1aae2d823480a417812c01bf4))
|
||||
* wrong ordinal for french locale ([#2010](https://github.com/iamkun/dayjs/issues/2010)) ([dd192a7](https://github.com/iamkun/dayjs/commit/dd192a72fc5d26ce56481e89b0c1ccf5f939be0c))
|
||||
|
||||
## [1.11.4](https://github.com/iamkun/dayjs/compare/v1.11.3...v1.11.4) (2022-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* correct past property in ku (kurdish) locale ([#1916](https://github.com/iamkun/dayjs/issues/1916)) ([74e82b9](https://github.com/iamkun/dayjs/commit/74e82b9da5ec8b90361fc27ac7c8b63faf354502))
|
||||
* fix French [fr] local ordinal ([#1932](https://github.com/iamkun/dayjs/issues/1932)) ([8f09834](https://github.com/iamkun/dayjs/commit/8f09834a88b8e7f8353c6e7473d4711596890a8c))
|
||||
* fix objectSupport plugin ConfigTypeMap type ([#1441](https://github.com/iamkun/dayjs/issues/1441)) ([#1990](https://github.com/iamkun/dayjs/issues/1990)) ([fd51fe4](https://github.com/iamkun/dayjs/commit/fd51fe4f7fa799d8c598343e71fa59299ec4cf93))
|
||||
* fix type error to add ordianl property in InstanceLocaleDataReturn and GlobalLocaleDataReturn types ([#1931](https://github.com/iamkun/dayjs/issues/1931)) ([526f0ae](https://github.com/iamkun/dayjs/commit/526f0ae549ffbeeb9ef1099ca23964791fc59743))
|
||||
* update locale ar-* meridiem function ([#1954](https://github.com/iamkun/dayjs/issues/1954)) ([3d31611](https://github.com/iamkun/dayjs/commit/3d316117f04362d31f4e8bd349620b8414ce5d0c))
|
||||
* zh-tw / zh-hk locale ordinal error ([#1976](https://github.com/iamkun/dayjs/issues/1976)) ([0a1bd08](https://github.com/iamkun/dayjs/commit/0a1bd08e736be7d4e378aaca280caa6543f8066d))
|
||||
|
||||
## [1.11.3](https://github.com/iamkun/dayjs/compare/v1.11.2...v1.11.3) (2022-06-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* customParseFormat plugin to parse comma as a separator character ([#1913](https://github.com/iamkun/dayjs/issues/1913)) ([41b1405](https://github.com/iamkun/dayjs/commit/41b1405971e099431211ae6c2a100cd797da4427))
|
||||
* update Dutch [nl] locale ordinal ([#1908](https://github.com/iamkun/dayjs/issues/1908)) ([5da98f8](https://github.com/iamkun/dayjs/commit/5da98f8085d2d2847d79e38c795082703a14f24b))
|
||||
|
||||
## [1.11.2](https://github.com/iamkun/dayjs/compare/v1.11.1...v1.11.2) (2022-05-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add OpUnitType (week) to quarterOfYear startOf/endOf types ([#1865](https://github.com/iamkun/dayjs/issues/1865)) ([400bc3e](https://github.com/iamkun/dayjs/commit/400bc3e8915e0c58e7abbfd3a1235364b1abaf3e))
|
||||
* Fix type issue with ManipulateType ([#1864](https://github.com/iamkun/dayjs/issues/1864)) ([d033dfc](https://github.com/iamkun/dayjs/commit/d033dfcfc1d2ced39b2733898e8d85ad5984c9e9))
|
||||
* fix UTC plugin .valueOf not taking DST into account ([#1448](https://github.com/iamkun/dayjs/issues/1448)) ([27d1c50](https://github.com/iamkun/dayjs/commit/27d1c506100ae6624f258c21cc06b24768ced733))
|
||||
|
||||
## [1.11.1](https://github.com/iamkun/dayjs/compare/v1.11.0...v1.11.1) (2022-04-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add Bengali (Bangladesh) [bn-bd] locale ([#1806](https://github.com/iamkun/dayjs/issues/1806)) ([840ed76](https://github.com/iamkun/dayjs/commit/840ed76eedc085afefc4dedd05f31d44196b63b0))
|
||||
* refactor replace deprecated String.prototype.substr() ([#1836](https://github.com/iamkun/dayjs/issues/1836)) ([627fa39](https://github.com/iamkun/dayjs/commit/627fa393e4daf83c92431162dbe18534b23fcbae))
|
||||
* Update German [de] locale, adds the abbreviations for month including a . in the end, as in September -> Sept. ([#1831](https://github.com/iamkun/dayjs/issues/1831)) ([4e2802c](https://github.com/iamkun/dayjs/commit/4e2802cc3bec2941ffb737a15fb531c90951eafe))
|
||||
* update Italian (Switzerland) [it-ch] locale relativeTime ([#1829](https://github.com/iamkun/dayjs/issues/1829)) ([8e6d11d](https://github.com/iamkun/dayjs/commit/8e6d11d053393d97bee1ba411adb2d82de1a58c4))
|
||||
* update Kurdish [ku] locale strings and formatted output contains non-standard kurdish characters ([#1848](https://github.com/iamkun/dayjs/issues/1848)) ([a597d0b](https://github.com/iamkun/dayjs/commit/a597d0b1b8dd28e626f8c59d326622088f7b51e7))
|
||||
* update locale bo [Tibetan]: corrected the orders in formats ([#1823](https://github.com/iamkun/dayjs/issues/1823)) ([e790516](https://github.com/iamkun/dayjs/commit/e79051617af6787358f6c9b5443d987b8b53a9e1))
|
||||
|
||||
# [1.11.0](https://github.com/iamkun/dayjs/compare/v1.10.8...v1.11.0) (2022-03-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Kirundi (rn) locale ([#1793](https://github.com/iamkun/dayjs/issues/1793)) ([74e5247](https://github.com/iamkun/dayjs/commit/74e5247227a779fffde39bdfcd1ee19911496709))
|
||||
* add missing date shorthand D type definition ([#1752](https://github.com/iamkun/dayjs/issues/1752)) ([b045baf](https://github.com/iamkun/dayjs/commit/b045baf1646a81f7e4f446f355d02d5fb0ef4aa7))
|
||||
* Add relative time to Galician (gl) and fix ordinals ([#1800](https://github.com/iamkun/dayjs/issues/1800)) ([dcbf170](https://github.com/iamkun/dayjs/commit/dcbf1708400624addfbddbc71e0f6a9ac15fa961))
|
||||
* update German locales (de-at, de-ch) ([#1775](https://github.com/iamkun/dayjs/issues/1775)) ([f9055a7](https://github.com/iamkun/dayjs/commit/f9055a77bf3d84c575e5fcf99e21611138ba64d7))
|
||||
* update Icelandic [is] locale relativeTime config ([#1796](https://github.com/iamkun/dayjs/issues/1796)) ([76f9e17](https://github.com/iamkun/dayjs/commit/76f9e1756de7e99c01e471dab30ea074b9ec9629))
|
||||
* Update index.d.ts note ([#1716](https://github.com/iamkun/dayjs/issues/1716)) ([5a108ff](https://github.com/iamkun/dayjs/commit/5a108ff3159c53fd270ea7638f33c35c934d6457))
|
||||
* Update locale German [de] monthsShort ([#1746](https://github.com/iamkun/dayjs/issues/1746)) ([4a7b7d0](https://github.com/iamkun/dayjs/commit/4a7b7d07c885bb9338514c234dbb708e24e9863e))
|
||||
* update meridiem function to Kurdish (ku) locale ([#1725](https://github.com/iamkun/dayjs/issues/1725)) ([efd3904](https://github.com/iamkun/dayjs/commit/efd3904ff8cbf0a4fc064911dda76fc86b669f7b))
|
||||
* update updateLocal plugin typescript types ([#1692](https://github.com/iamkun/dayjs/issues/1692)) ([c7a3f73](https://github.com/iamkun/dayjs/commit/c7a3f73064dbb63b4d365b2ad4c792f075f4d8d8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Fallback to language only locale + support uppercase locales ([#1524](https://github.com/iamkun/dayjs/issues/1524)) ([9138dc2](https://github.com/iamkun/dayjs/commit/9138dc28206875372da4fb74c64716437cd11b95))
|
||||
|
||||
## [1.10.8](https://github.com/iamkun/dayjs/compare/v1.10.7...v1.10.8) (2022-02-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* set locale pt, pt-br correct weekdays and months ([#1697](https://github.com/iamkun/dayjs/issues/1697)) ([e019301](https://github.com/iamkun/dayjs/commit/e01930171c8235f58a114236f146086428f99569))
|
||||
|
||||
## [1.10.7](https://github.com/iamkun/dayjs/compare/v1.10.6...v1.10.7) (2021-09-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Spanish (Mexico) [es-mx] locale ([#1614](https://github.com/iamkun/dayjs/issues/1614)) ([3393f2a](https://github.com/iamkun/dayjs/commit/3393f2ad55346d55902683a2e31c6f253d96c8c2))
|
||||
* Add Arabic (Iraq) [ar-iq] locale ([#1627](https://github.com/iamkun/dayjs/issues/1627)) ([b5a1391](https://github.com/iamkun/dayjs/commit/b5a1391011b247d08863d291542db5937b23b427))
|
||||
* add format object type to type file ([#1572](https://github.com/iamkun/dayjs/issues/1572)) ([5a79cc6](https://github.com/iamkun/dayjs/commit/5a79cc6408e825d9e123629eb44fc19c996d7751))
|
||||
* duration plugin when parsing duration from ISO string, set missing components to 0 instead of NaN ([#1611](https://github.com/iamkun/dayjs/issues/1611)) ([252585b](https://github.com/iamkun/dayjs/commit/252585b4b2bd59508150e21bb994908a9d78f9b0))
|
||||
* narrow type for `add` and `subtract` ([#1576](https://github.com/iamkun/dayjs/issues/1576)) ([1686962](https://github.com/iamkun/dayjs/commit/16869621b1a42563064dbf87f80c1ebfd74c1188))
|
||||
* update customParseFormat plugin strict x X parsing ([#1571](https://github.com/iamkun/dayjs/issues/1571)) ([08adda5](https://github.com/iamkun/dayjs/commit/08adda54edbcca38601f57841921d0f87f84e49e))
|
||||
* update Lithuanian [lt] locale spelling for single month ([#1609](https://github.com/iamkun/dayjs/issues/1609)) ([255dc54](https://github.com/iamkun/dayjs/commit/255dc54d9295de135a9037ce6ca13cae4bfd2cfb))
|
||||
* Update Norwegian Bokmål [nb] local yearStart 4 ([#1608](https://github.com/iamkun/dayjs/issues/1608)) ([7a8467c](https://github.com/iamkun/dayjs/commit/7a8467c0b7d59821f7e19d4a6973bcda8e4c19b1))
|
||||
* update plugin advancedFormat `isValid` validation ([#1566](https://github.com/iamkun/dayjs/issues/1566)) ([755fc8b](https://github.com/iamkun/dayjs/commit/755fc8bb1c532eb991459f180eee81367d12016c))
|
||||
* update Sinhalese [si] locale month name ([#1475](https://github.com/iamkun/dayjs/issues/1475)) ([63de2a8](https://github.com/iamkun/dayjs/commit/63de2a8b7dcd7e68c132c85d88572d4c9d296907))
|
||||
* update utcOffset plugin type file ([#1604](https://github.com/iamkun/dayjs/issues/1604)) ([f68e4b1](https://github.com/iamkun/dayjs/commit/f68e4b1a29fc33542f74cde10ec6d9fb045ca37e))
|
||||
|
||||
## [1.10.6](https://github.com/iamkun/dayjs/compare/v1.10.5...v1.10.6) (2021-07-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add invalid date string override ([#1465](https://github.com/iamkun/dayjs/issues/1465)) ([#1470](https://github.com/iamkun/dayjs/issues/1470)) ([06f88f4](https://github.com/iamkun/dayjs/commit/06f88f425828b1ce96b737332d25145a95a4ee9d))
|
||||
* add sv-fi Finland Swedish locale ([#1522](https://github.com/iamkun/dayjs/issues/1522)) ([8e32164](https://github.com/iamkun/dayjs/commit/8e32164855cff724642e24c37a631eb4c4d760c8))
|
||||
* customParseFormat support parsing X x timestamp ([#1567](https://github.com/iamkun/dayjs/issues/1567)) ([eb087f5](https://github.com/iamkun/dayjs/commit/eb087f52861313b8dd8a5c1b77858665ec72859e))
|
||||
* dayjs ConfigTypeMap add null & undefined ([#1560](https://github.com/iamkun/dayjs/issues/1560)) ([b5e40e6](https://github.com/iamkun/dayjs/commit/b5e40e6f16abeaea6a0facfa466d20aefaa8a444))
|
||||
* Fix DayOfYear plugin when using BadMutable plugin ([#1511](https://github.com/iamkun/dayjs/issues/1511)) ([0b0c6a3](https://github.com/iamkun/dayjs/commit/0b0c6a31ec9c0aff991b0e8dd6eed116201274cc))
|
||||
* Implement ordinal in Bulgarian translation (fixes [#1501](https://github.com/iamkun/dayjs/issues/1501)) ([#1502](https://github.com/iamkun/dayjs/issues/1502)) ([b728da5](https://github.com/iamkun/dayjs/commit/b728da5ed9ed08210004ed20ce5fcd52a92de7da))
|
||||
* more strict delimiter in REGEX_PARSE ([#1555](https://github.com/iamkun/dayjs/issues/1555)) ([bfdab5c](https://github.com/iamkun/dayjs/commit/bfdab5c0d45a5736b68e8e1b1354fc021e05f607))
|
||||
* parameter type ([#1549](https://github.com/iamkun/dayjs/issues/1549)) ([f369844](https://github.com/iamkun/dayjs/commit/f369844dd69d253c4c7cbf68150939db3db233be))
|
||||
* update customParseFormat plugin to custom two-digit year parse function ([#1421](https://github.com/iamkun/dayjs/issues/1421)) ([bb5df55](https://github.com/iamkun/dayjs/commit/bb5df55cd3975dc7638b8f4e762afa470b6620f7))
|
||||
* update names of weekdays and months in Bulgarian [bg] to lowercase ([#1438](https://github.com/iamkun/dayjs/issues/1438)) ([b246210](https://github.com/iamkun/dayjs/commit/b24621091fec9cf6704de21e4b323f6f0c4abbf1))
|
||||
* update type file `.diff` ([#1505](https://github.com/iamkun/dayjs/issues/1505)) ([6508494](https://github.com/iamkun/dayjs/commit/6508494a4e62977b4397baaeef293d1bcf3c7235))
|
||||
* update UTC plugin type file for strict parsing ([#1443](https://github.com/iamkun/dayjs/issues/1443)) ([b4f28df](https://github.com/iamkun/dayjs/commit/b4f28df219fe63202dffdbeeaec5677c4d2c9111))
|
||||
|
||||
## [1.10.5](https://github.com/iamkun/dayjs/compare/v1.10.4...v1.10.5) (2021-05-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add meridiem in ar locales ([#1375](https://github.com/iamkun/dayjs/issues/1375)) ([319f616](https://github.com/iamkun/dayjs/commit/319f616e572a03b984013d04d1b3a18ffd5b1190))
|
||||
* Added Zulu support to customParseFormat ([#1359](https://github.com/iamkun/dayjs/issues/1359)) ([1138a3f](https://github.com/iamkun/dayjs/commit/1138a3f0a76592c6d72fb86c4399e133fa41e2ec))
|
||||
* fix Bengali [bn] locale monthsShort error ([a0e6c0c](https://github.com/iamkun/dayjs/commit/a0e6c0cf3e1828020dfa11432c6716990f6ed5e0))
|
||||
* fix missing types for ArraySupport plugin ([#1401](https://github.com/iamkun/dayjs/issues/1401)) ([b1abdc4](https://github.com/iamkun/dayjs/commit/b1abdc40ee6c9d18ff46c311a114e0755677ea6f))
|
||||
* fix Ukrainian [uk] locale ([#1463](https://github.com/iamkun/dayjs/issues/1463)) ([0fdac93](https://github.com/iamkun/dayjs/commit/0fdac93ff2531542301b76952be9b084b2e2dfa0))
|
||||
* hotfix for `Duration` types ([#1357](https://github.com/iamkun/dayjs/issues/1357)) ([855b7b3](https://github.com/iamkun/dayjs/commit/855b7b3d049a3903794f91db3419f167c00dabd2)), closes [#1354](https://github.com/iamkun/dayjs/issues/1354)
|
||||
* timezone plugin DST error ([#1352](https://github.com/iamkun/dayjs/issues/1352)) ([71bed15](https://github.com/iamkun/dayjs/commit/71bed155edf32bff24379930ac684fc783538d8f))
|
||||
* Update duration plugin change string to number ([#1394](https://github.com/iamkun/dayjs/issues/1394)) ([e1546d1](https://github.com/iamkun/dayjs/commit/e1546d1a0cdb97ae92cf11efe61d94707af6a3a3))
|
||||
* update Duration plugin to support no-argument ([#1400](https://github.com/iamkun/dayjs/issues/1400)) ([8d9a5ae](https://github.com/iamkun/dayjs/commit/8d9a5ae0749e1b4e76babd4deeaa3b1d9776c29b))
|
||||
* Update Finnish [fi] locale to set yearStart ([#1378](https://github.com/iamkun/dayjs/issues/1378)) ([f3370bd](https://github.com/iamkun/dayjs/commit/f3370bda4e435118f714c8a7daf5c88cfc4b69ba))
|
||||
* update Russian [ru] locale meridiem and unit tests ([#1403](https://github.com/iamkun/dayjs/issues/1403)) ([f10f39d](https://github.com/iamkun/dayjs/commit/f10f39de7db70244a3c35e4a421090a12972457b))
|
||||
* update Russian [ru] locale yearStart config ([#1372](https://github.com/iamkun/dayjs/issues/1372)) ([5052515](https://github.com/iamkun/dayjs/commit/5052515fe35b2444201ef8ef87220b1876a94d0a))
|
||||
* update Slovenian [sl] locale to set correct ordinal ([#1386](https://github.com/iamkun/dayjs/issues/1386)) ([cb4f746](https://github.com/iamkun/dayjs/commit/cb4f74633b3020d6dbf19548c8cb13613dafca18))
|
||||
* update Spanish [es] locale to change month names to lowercase ([#1414](https://github.com/iamkun/dayjs/issues/1414)) ([9c20e77](https://github.com/iamkun/dayjs/commit/9c20e77caf7b1b5eccf418175203b198d4e29535))
|
||||
* update Swedish [sv] locale to set correct yearStart ([#1385](https://github.com/iamkun/dayjs/issues/1385)) ([66c5935](https://github.com/iamkun/dayjs/commit/66c59354964ef456bcd5f6152819618f44978082))
|
||||
* update UTC plugin to support string argument like +HH:mm ([#1395](https://github.com/iamkun/dayjs/issues/1395)) ([656127c](https://github.com/iamkun/dayjs/commit/656127cc44eda50923a1ac755602863fc32b9e69))
|
||||
|
||||
## [1.10.4](https://github.com/iamkun/dayjs/compare/v1.10.3...v1.10.4) (2021-01-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Correct handling negative duration ([#1317](https://github.com/iamkun/dayjs/issues/1317)) ([3f5c085](https://github.com/iamkun/dayjs/commit/3f5c085608182472f20b84766b10949945663e44))
|
||||
* Improve `Duration` types ([#1338](https://github.com/iamkun/dayjs/issues/1338)) ([4aca4b1](https://github.com/iamkun/dayjs/commit/4aca4b1b584a15de1146d929f95c944594032f20))
|
||||
* parse a string for MMM month format with underscore delimiter ([#1349](https://github.com/iamkun/dayjs/issues/1349)) ([82ef9a3](https://github.com/iamkun/dayjs/commit/82ef9a304f06287ac0a14c4da9a7fe6152b5fec9))
|
||||
* Update Bengali [bn] locale ([#1329](https://github.com/iamkun/dayjs/issues/1329)) ([02d96ec](https://github.com/iamkun/dayjs/commit/02d96ec7189f62d6ef8987135919cbb5ceff20a6))
|
||||
* update locale Portuguese [pt] yearStart ([#1345](https://github.com/iamkun/dayjs/issues/1345)) ([5c785d5](https://github.com/iamkun/dayjs/commit/5c785d528cc08811638d7cbfc7fc158d67b32d75))
|
||||
* update Polish [pl] locale yearStart ([#1348](https://github.com/iamkun/dayjs/issues/1348)) ([e93e6b8](https://github.com/iamkun/dayjs/commit/e93e6b8ffa61036b26382f1763e3864d4a7d5df5))
|
||||
* Update Slovenian [sl] relativeTime locale ([#1333](https://github.com/iamkun/dayjs/issues/1333)) ([fe5f1d0](https://github.com/iamkun/dayjs/commit/fe5f1d0afbe57b70339e268047e6c3028ca3d59b))
|
||||
|
||||
## [1.10.3](https://github.com/iamkun/dayjs/compare/v1.10.2...v1.10.3) (2021-01-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix customParseFormat plugin strict mode parse meridiem bug ([#1321](https://github.com/iamkun/dayjs/issues/1321)) ([e49eeef](https://github.com/iamkun/dayjs/commit/e49eeefbe8acb36419d36ca2e7ed8bc152f73ac1))
|
||||
* fix weekYear plugin missing locale bug ([#1319](https://github.com/iamkun/dayjs/issues/1319)) ([344bdc0](https://github.com/iamkun/dayjs/commit/344bdc0eed6843edb05723dc7853a41833d88f08)), closes [#1304](https://github.com/iamkun/dayjs/issues/1304)
|
||||
* update advancedFormat plugin to add format options for iso week and weekyear ([#1309](https://github.com/iamkun/dayjs/issues/1309)) ([2c54c64](https://github.com/iamkun/dayjs/commit/2c54c6441871a175ac9b95e41e4cd075dbac10cb))
|
||||
* update devHelper to add dev warning setting locale before loading ([c5cc893](https://github.com/iamkun/dayjs/commit/c5cc89355e1e206ca72433c19c40cb528690b04f))
|
||||
* update German [de] locale yearStart ([1858df8](https://github.com/iamkun/dayjs/commit/1858df8008de56570680723df89b36a8cbc970ef)), closes [#1264](https://github.com/iamkun/dayjs/issues/1264)
|
||||
|
||||
## [1.10.2](https://github.com/iamkun/dayjs/compare/v1.10.1...v1.10.2) (2021-01-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix parse regex bug ([#1307](https://github.com/iamkun/dayjs/issues/1307)) ([db2b6a5](https://github.com/iamkun/dayjs/commit/db2b6a5ea8e70f9fda645d113ca33495aa96b616)), closes [#1305](https://github.com/iamkun/dayjs/issues/1305)
|
||||
* remove module entry in package.json to revert 1.10.1 change ([#1314](https://github.com/iamkun/dayjs/issues/1314)) ([824dcb8](https://github.com/iamkun/dayjs/commit/824dcb8dfcccf14f64b6a2741a00fcdfe53dcd98))
|
||||
* update devHelper add warning "passing Year as a Number will be parsed as a Unix timestamp" ([#1315](https://github.com/iamkun/dayjs/issues/1315)) ([b0dda31](https://github.com/iamkun/dayjs/commit/b0dda3139e25441ab4e7c1f4f192dee0ecce6ef8))
|
||||
|
||||
## [1.10.1](https://github.com/iamkun/dayjs/compare/v1.10.0...v1.10.1) (2021-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix typescript type error UnitTypeLongPlural ([#1302](https://github.com/iamkun/dayjs/issues/1302)) ([bfaabe4](https://github.com/iamkun/dayjs/commit/bfaabe4f398c11564eca6cda7c8aded22e1b231a)), closes [#1300](https://github.com/iamkun/dayjs/issues/1300)
|
||||
|
||||
# [1.10.0](https://github.com/iamkun/dayjs/compare/v1.9.8...v1.10.0) (2021-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add ordinal to localeData plugin ([#1266](https://github.com/iamkun/dayjs/issues/1266)) ([fd229fa](https://github.com/iamkun/dayjs/commit/fd229fa5bd26bcba810e2535eb937ea8d99106c2))
|
||||
* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](https://github.com/iamkun/dayjs/issues/1255)) ([f2e4790](https://github.com/iamkun/dayjs/commit/f2e479006a9a49bc0917f8620101d40ac645f7f2))
|
||||
* add type support for plural forms of units ([#1289](https://github.com/iamkun/dayjs/issues/1289)) ([de49bb1](https://github.com/iamkun/dayjs/commit/de49bb100badfb92b9a5933cc568841f340a923f))
|
||||
* escape last period to match only milliseconds ([#1239](https://github.com/iamkun/dayjs/issues/1239)) ([#1295](https://github.com/iamkun/dayjs/issues/1295)) ([64037e6](https://github.com/iamkun/dayjs/commit/64037e6a8cf303dcfd2b954f309bd9691f87fffc))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](https://github.com/iamkun/dayjs/issues/1298)) ([f63375d](https://github.com/iamkun/dayjs/commit/f63375dea89becbd3bb2bb8ea7289c58c752bfed)), closes [#598](https://github.com/iamkun/dayjs/issues/598) [#313](https://github.com/iamkun/dayjs/issues/313)
|
||||
|
||||
## [1.9.8](https://github.com/iamkun/dayjs/compare/v1.9.7...v1.9.8) (2020-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix Ukrainian [uk] locale typo ([1605cc0](https://github.com/iamkun/dayjs/commit/1605cc0f6fe0e9c46a92d529bc9cd6e130432337))
|
||||
* update Hebrew [he] locale for double units ([#1287](https://github.com/iamkun/dayjs/issues/1287)) ([1c4b0da](https://github.com/iamkun/dayjs/commit/1c4b0da1468522e59dc9ee646d10dd2b31477d99))
|
||||
* update zh locale meridiem "noon" ([0e7ff3d](https://github.com/iamkun/dayjs/commit/0e7ff3dd29ca3aed85cb76dfcb8298d326e26542))
|
||||
* update zh-cn locale definition of noon ([#1278](https://github.com/iamkun/dayjs/issues/1278)) ([d5930b9](https://github.com/iamkun/dayjs/commit/d5930b96ff884f4176ca3fcb1bc95e8f1ec75c71))
|
||||
|
||||
## [1.9.7](https://github.com/iamkun/dayjs/compare/v1.9.6...v1.9.7) (2020-12-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add duration.format to format a Duration ([#1202](https://github.com/iamkun/dayjs/issues/1202)) ([9a859a1](https://github.com/iamkun/dayjs/commit/9a859a147ba223a1eeff0f2bb6f33d97e0ccc6c7))
|
||||
* Add function handling for relativeTime.future and relativeTime.past ([#1197](https://github.com/iamkun/dayjs/issues/1197)) ([ef1979c](https://github.com/iamkun/dayjs/commit/ef1979ce85c61fe2d759ef3c37cb6aaf2358094f))
|
||||
* avoid install installed plugin ([#1214](https://github.com/iamkun/dayjs/issues/1214)) ([a92eb6c](https://github.com/iamkun/dayjs/commit/a92eb6c4dc1437ec920e69484d52984f5921a8ea))
|
||||
* avoid memory leak after installing a plugin too many times ([b8d2e32](https://github.com/iamkun/dayjs/commit/b8d2e32a9eb59661a7ed6200daa070687becaebd))
|
||||
* fix diff bug when UTC plugin enabled ([#1201](https://github.com/iamkun/dayjs/issues/1201)) ([9544ed2](https://github.com/iamkun/dayjs/commit/9544ed2a6c466b8308d26b33a388a6737435a1f4)), closes [#1200](https://github.com/iamkun/dayjs/issues/1200)
|
||||
* fix startOf/endOf bug in timezone plugin ([#1229](https://github.com/iamkun/dayjs/issues/1229)) ([eb5fbc4](https://github.com/iamkun/dayjs/commit/eb5fbc4c7d1b62a8615d2f263b404a9515d8e15c))
|
||||
* fix utc plugin diff edge case ([#1187](https://github.com/iamkun/dayjs/issues/1187)) ([971b3d4](https://github.com/iamkun/dayjs/commit/971b3d40b4c9403165138f1034e2223cd97c3abf))
|
||||
* update customParseFormat plugin to parse 2-digit offset ([#1209](https://github.com/iamkun/dayjs/issues/1209)) ([b56936a](https://github.com/iamkun/dayjs/commit/b56936ab77b8f6289a1b77d49307b495c4bf9f91)), closes [#1205](https://github.com/iamkun/dayjs/issues/1205)
|
||||
* Update timezone plugin type definition ([#1221](https://github.com/iamkun/dayjs/issues/1221)) ([34cfb92](https://github.com/iamkun/dayjs/commit/34cfb920b9653ad44d4b31fe49e533692a3ce01b))
|
||||
|
||||
## [1.9.6](https://github.com/iamkun/dayjs/compare/v1.9.5...v1.9.6) (2020-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix customParseFormat plugin parsing date bug ([#1198](https://github.com/iamkun/dayjs/issues/1198)) ([50f05ad](https://github.com/iamkun/dayjs/commit/50f05ad3addf27827c5657ae7519514e40d9faec)), closes [#1194](https://github.com/iamkun/dayjs/issues/1194)
|
||||
* Update lv (Latvian) locale relative time ([#1192](https://github.com/iamkun/dayjs/issues/1192)) ([6d6c684](https://github.com/iamkun/dayjs/commit/6d6c6841b13ba4f7e69de92caf132a3592c5253a))
|
||||
|
||||
## [1.9.5](https://github.com/iamkun/dayjs/compare/v1.9.4...v1.9.5) (2020-11-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* customParseFormat plugin supports parsing localizedFormats ([#1110](https://github.com/iamkun/dayjs/issues/1110)) ([402b603](https://github.com/iamkun/dayjs/commit/402b603aa3ee4199786950bc88b3fdc6b527aa35))
|
||||
* fix customParseFormat plugin parse meridiem bug ([#1169](https://github.com/iamkun/dayjs/issues/1169)) ([9e8f8d9](https://github.com/iamkun/dayjs/commit/9e8f8d96c69d557f4d267f42567c25ae9e7ab227)), closes [#1168](https://github.com/iamkun/dayjs/issues/1168)
|
||||
* fix devHelper error in umd bundle in browser ([#1165](https://github.com/iamkun/dayjs/issues/1165)) ([d11b5ee](https://github.com/iamkun/dayjs/commit/d11b5ee7dc11af671355f65ccda00f6ba42cc725))
|
||||
* fix utc plugin diff bug in DST ([#1171](https://github.com/iamkun/dayjs/issues/1171)) ([f8da3fe](https://github.com/iamkun/dayjs/commit/f8da3fe7e50c84c0502bf5be0b364910922dbd79)), closes [#1097](https://github.com/iamkun/dayjs/issues/1097) [#1021](https://github.com/iamkun/dayjs/issues/1021)
|
||||
* isoWeek plugin type ([#1177](https://github.com/iamkun/dayjs/issues/1177)) ([c3d0436](https://github.com/iamkun/dayjs/commit/c3d0436b06f74989e3a2c751a5d170f8072c4aad))
|
||||
* update localeData plugin to support meridiem ([#1174](https://github.com/iamkun/dayjs/issues/1174)) ([fdb09e4](https://github.com/iamkun/dayjs/commit/fdb09e4074cc7e8f6196846f18d3566c1f9e8fcd)), closes [#1172](https://github.com/iamkun/dayjs/issues/1172)
|
||||
* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](https://github.com/iamkun/dayjs/issues/1183)) ([a7f858b](https://github.com/iamkun/dayjs/commit/a7f858bb70ad81f718ba35c479e84b54eace48b2))
|
||||
|
||||
## [1.9.4](https://github.com/iamkun/dayjs/compare/v1.9.3...v1.9.4) (2020-10-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add descriptions to types ([#1148](https://github.com/iamkun/dayjs/issues/1148)) ([9a407a1](https://github.com/iamkun/dayjs/commit/9a407a140b089345a387d1aceab4d0d1635229c7))
|
||||
* add devHelper plugin ([#1163](https://github.com/iamkun/dayjs/issues/1163)) ([de49dc8](https://github.com/iamkun/dayjs/commit/de49dc80c83b85de4170571b64412bd60ada221b))
|
||||
* Fix Hungarian (hu) locale ([#1112](https://github.com/iamkun/dayjs/issues/1112)) ([ab13754](https://github.com/iamkun/dayjs/commit/ab13754f43c5033dacaa0eb2042dc4ab1a7a2754))
|
||||
* fix minMax plugin parsing empty array bug ([#1062](https://github.com/iamkun/dayjs/issues/1062)) ([368108b](https://github.com/iamkun/dayjs/commit/368108bc6d5cb1542f711b8eba722bd4dfaab0cd))
|
||||
* update adding/subtracting Duration from Dayjs object ([#1156](https://github.com/iamkun/dayjs/issues/1156)) ([f861aca](https://github.com/iamkun/dayjs/commit/f861acac3e83e28d3a4a96312c71119fd6b544fc))
|
||||
* update en-NZ locale to use proper ordinal formatting function ([#1143](https://github.com/iamkun/dayjs/issues/1143)) ([fcdbc58](https://github.com/iamkun/dayjs/commit/fcdbc5880710456a29b2bacf250542230bf48b99))
|
||||
* update localeData plugin type ([#1116](https://github.com/iamkun/dayjs/issues/1116)) ([ee5a4ec](https://github.com/iamkun/dayjs/commit/ee5a4ec41edddfb57d103c35182dc635c9264a10))
|
||||
* update timezone plugin to support custom parse format ([#1160](https://github.com/iamkun/dayjs/issues/1160)) ([48cbf31](https://github.com/iamkun/dayjs/commit/48cbf3118ba5427de428777c2e025896db654f2e)), closes [#1159](https://github.com/iamkun/dayjs/issues/1159)
|
||||
* update timezone plugin to support keepLocalTime ([#1161](https://github.com/iamkun/dayjs/issues/1161)) ([1d429e5](https://github.com/iamkun/dayjs/commit/1d429e5fe4467ebddcf81b43cf6f36e5e3be944c)), closes [#1149](https://github.com/iamkun/dayjs/issues/1149)
|
||||
|
||||
## [1.9.3](https://github.com/iamkun/dayjs/compare/v1.9.2...v1.9.3) (2020-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix localizedFormat export error ([#1133](https://github.com/iamkun/dayjs/issues/1133)) ([deecd6a](https://github.com/iamkun/dayjs/commit/deecd6ab8a2f4173ee7046f6b568b41fd2677531)), closes [#1132](https://github.com/iamkun/dayjs/issues/1132)
|
||||
|
||||
## [1.9.2](https://github.com/iamkun/dayjs/compare/v1.9.1...v1.9.2) (2020-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add arraySupport plugin ([#1129](https://github.com/iamkun/dayjs/issues/1129)) ([be505c2](https://github.com/iamkun/dayjs/commit/be505c2c540261027342cecc55d8919a3d18d893))
|
||||
* export type of duration plugin ([#1094](https://github.com/iamkun/dayjs/issues/1094)) ([2c92e71](https://github.com/iamkun/dayjs/commit/2c92e71bf55d09601120cdf433da7a19cc8abff6))
|
||||
* Fix LocaleData plugin longDateFormat lowercase error ([#1101](https://github.com/iamkun/dayjs/issues/1101)) ([7937ccd](https://github.com/iamkun/dayjs/commit/7937ccdeac47d094a60e65ebb62a6020b81c46f4))
|
||||
* Fix objectSupport plugin bug in UTC ([#1107](https://github.com/iamkun/dayjs/issues/1107)) ([fe90bb6](https://github.com/iamkun/dayjs/commit/fe90bb6944f2ff1969ca975954d303b449dfa95b)), closes [#1105](https://github.com/iamkun/dayjs/issues/1105)
|
||||
* fix Serbian locale grammar (sr, sr-cyrl) ([#1108](https://github.com/iamkun/dayjs/issues/1108)) ([cc87eff](https://github.com/iamkun/dayjs/commit/cc87eff8b75b0d86ce0956516319d402bccae6c0))
|
||||
* Fix typo for "monday" in arabic ([#1067](https://github.com/iamkun/dayjs/issues/1067)) ([2e1e426](https://github.com/iamkun/dayjs/commit/2e1e42650124f30282dc4d710798d576b928f1c7))
|
||||
* support dayjs.add(Duration), dayjs.subtract(Duration) ([#1099](https://github.com/iamkun/dayjs/issues/1099)) ([b1a0294](https://github.com/iamkun/dayjs/commit/b1a02942c5238203aaa04ce9a074c73742324ab7))
|
||||
* update Breton [br] locale relativeTime config ([#1103](https://github.com/iamkun/dayjs/issues/1103)) ([b038bfd](https://github.com/iamkun/dayjs/commit/b038bfdb128889d677c95534d2be29cc30c9e72f))
|
||||
* update Catalan [ca] locale ordinal ([73da380](https://github.com/iamkun/dayjs/commit/73da38024c8b550bdcfbe3ff7e578e742c7aecf2))
|
||||
* update German [de] locale relativeTime config ([#1109](https://github.com/iamkun/dayjs/issues/1109)) ([f6e771b](https://github.com/iamkun/dayjs/commit/f6e771b70f93d19ebb12e6b794aa4628a1796248))
|
||||
* update localeData plugin to add longDateFormat to global localeData ([#1106](https://github.com/iamkun/dayjs/issues/1106)) ([16937d1](https://github.com/iamkun/dayjs/commit/16937d16e053b8c1d4a607622fa2fdbfd9809832))
|
||||
* Update objectSupport plugin to return current date time while parsing empty object ([f56783e](https://github.com/iamkun/dayjs/commit/f56783e14d8cf50916b015e7188b23bb6fbca839))
|
||||
|
||||
## [1.9.1](https://github.com/iamkun/dayjs/compare/v1.9.0...v1.9.1) (2020-09-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix objectSupport plugin to get the correct result (zero-based month) ([#1089](https://github.com/iamkun/dayjs/issues/1089)) ([f95ac15](https://github.com/iamkun/dayjs/commit/f95ac15a4577ae5a3d1ce353872a2cd9fc454bc2))
|
||||
|
||||
# [1.9.0](https://github.com/iamkun/dayjs/compare/v1.8.36...v1.9.0) (2020-09-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add `setDefault` typing to timezone.d.ts ([#1057](https://github.com/iamkun/dayjs/issues/1057)) ([c0f0886](https://github.com/iamkun/dayjs/commit/c0f088620f17260e6e3ebce7697d561b5623f5f3))
|
||||
* fix DST bug in utc plugin ([#1053](https://github.com/iamkun/dayjs/issues/1053)) ([3d73543](https://github.com/iamkun/dayjs/commit/3d7354361f042ced1176d91f9ae9edffe6173425))
|
||||
* Fix optional type for timezone plugin ([#1081](https://github.com/iamkun/dayjs/issues/1081)) ([a6ebcf2](https://github.com/iamkun/dayjs/commit/a6ebcf283a83273562dce5663155e3b3a12ea9a5)), closes [#1079](https://github.com/iamkun/dayjs/issues/1079)
|
||||
* Fix timezone plugin conversion bug ([#1073](https://github.com/iamkun/dayjs/issues/1073)) ([16816a3](https://github.com/iamkun/dayjs/commit/16816a31ff43220aca9d1d179df6b729182abb55))
|
||||
* update duration plugin type file ([#1065](https://github.com/iamkun/dayjs/issues/1065)) ([94af9af](https://github.com/iamkun/dayjs/commit/94af9af27c5bc182cbb24f1845e561dd1d82d776))
|
||||
* update timezone plugin to support getting offset name e.g. EST ([#1069](https://github.com/iamkun/dayjs/issues/1069)) ([cbb755e](https://github.com/iamkun/dayjs/commit/cbb755e5c68d49c5678291f3ce832b32831a056e))
|
||||
* update utc plugin to support keepLocalTime `.utc(true)` ([#1080](https://github.com/iamkun/dayjs/issues/1080)) ([5ce4e0d](https://github.com/iamkun/dayjs/commit/5ce4e0d2f552f3645262537ff7afdc946f5a7e72))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Correct casing for en-sg locale name ([#1048](https://github.com/iamkun/dayjs/issues/1048)) ([2edaddc](https://github.com/iamkun/dayjs/commit/2edaddc22a7eb914f915531f389766217acd7034))
|
||||
|
||||
## [1.8.36](https://github.com/iamkun/dayjs/compare/v1.8.35...v1.8.36) (2020-09-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Amharic (am) locale ([#1046](https://github.com/iamkun/dayjs/issues/1046)) ([cdc49a1](https://github.com/iamkun/dayjs/commit/cdc49a1911c74b7ea96ed222f42796d53715cfed))
|
||||
* Export Duration type in duration plugin ([#1043](https://github.com/iamkun/dayjs/issues/1043)) ([0f20c3a](https://github.com/iamkun/dayjs/commit/0f20c3ac75d9ac1026a15a7bb343d3a150d9b30f))
|
||||
* Fix duration plugin parsing milliseconds bug ([#1042](https://github.com/iamkun/dayjs/issues/1042)) ([fe2301b](https://github.com/iamkun/dayjs/commit/fe2301b22318886aaa89ed1620e0a118e98c2b8a))
|
||||
* Timezone plugin set default timezone ([#1033](https://github.com/iamkun/dayjs/issues/1033)) ([0c2050a](https://github.com/iamkun/dayjs/commit/0c2050a152da708b01edd6150a5013f642b14576))
|
||||
* Timezone plugin should have the same behavior in latest ICU version ([#1032](https://github.com/iamkun/dayjs/issues/1032)) ([de31592](https://github.com/iamkun/dayjs/commit/de315921575cc50c38464b27d0338e30a54d8e2a))
|
||||
* Update Finnish (fi) locale ([#963](https://github.com/iamkun/dayjs/issues/963)) ([cf8b6a0](https://github.com/iamkun/dayjs/commit/cf8b6a096f24b54cbdb95675ac386d8ac85ea616))
|
||||
* Update Polish (pl) , Hungarian (hr) and Lithuanian (lt) localization ([#1045](https://github.com/iamkun/dayjs/issues/1045)) ([638fd39](https://github.com/iamkun/dayjs/commit/638fd394fc24f4188390faf387da6b156e7c6320))
|
||||
|
||||
## [1.8.35](https://github.com/iamkun/dayjs/compare/v1.8.34...v1.8.35) (2020-09-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix BadMutable plugin bug in .diff ([#1023](https://github.com/iamkun/dayjs/issues/1023)) ([40ab6d9](https://github.com/iamkun/dayjs/commit/40ab6d9a53e8047cfca63c611c25dd045372d021))
|
||||
* fix LocaleData plugin to support instance.weekdays() API ([#1019](https://github.com/iamkun/dayjs/issues/1019)) ([a09d259](https://github.com/iamkun/dayjs/commit/a09d259a407b81d1cb6bb5623fad551c775d8674)), closes [#1017](https://github.com/iamkun/dayjs/issues/1017)
|
||||
* Update Dutch (nl) locale to set correct yearStart ([1533a2c](https://github.com/iamkun/dayjs/commit/1533a2cc1475270032da2d87b19fc3d62327e6e3))
|
||||
|
||||
## [1.8.34](https://github.com/iamkun/dayjs/compare/v1.8.33...v1.8.34) (2020-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](https://github.com/iamkun/dayjs/issues/1003)) ([5f446ed](https://github.com/iamkun/dayjs/commit/5f446eda770fa97e895c81a8195b3ba5d082cef0)), closes [#1002](https://github.com/iamkun/dayjs/issues/1002)
|
||||
* support parsing unlimited decimals of millisecond ([#1010](https://github.com/iamkun/dayjs/issues/1010)) ([d1bdd36](https://github.com/iamkun/dayjs/commit/d1bdd36a56e3d1786523a180e3fc18068f609135)), closes [#544](https://github.com/iamkun/dayjs/issues/544)
|
||||
* update Duration plugin to support global locale ([#1008](https://github.com/iamkun/dayjs/issues/1008)) ([1c49c83](https://github.com/iamkun/dayjs/commit/1c49c83e79811eede13db6372b5d65db598aee77)), closes [#1007](https://github.com/iamkun/dayjs/issues/1007)
|
||||
|
||||
## [1.8.33](https://github.com/iamkun/dayjs/compare/v1.8.32...v1.8.33) (2020-08-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add PluralGetSet plugin for plural getters/setters ([#996](https://github.com/iamkun/dayjs/issues/996)) ([f76e3ce](https://github.com/iamkun/dayjs/commit/f76e3ce2fbe5d3e9ed9121086baf55eb0cc4d355))
|
||||
* Add typescript type defs in esm build ([#985](https://github.com/iamkun/dayjs/issues/985)) ([50e3b3c](https://github.com/iamkun/dayjs/commit/50e3b3c6719cb0b4ec6eff394dacd63d5db8f253))
|
||||
* Fix isoWeek Plugin cal bug in UTC mode ([#993](https://github.com/iamkun/dayjs/issues/993)) ([f2e5f32](https://github.com/iamkun/dayjs/commit/f2e5f327aaf12b4572296ec6e107ecc05fcf76e7))
|
||||
* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](https://github.com/iamkun/dayjs/issues/994)) ([22f3d49](https://github.com/iamkun/dayjs/commit/22f3d49405da98db6da56d1673eebcd01b57554b)), closes [#992](https://github.com/iamkun/dayjs/issues/992) [#989](https://github.com/iamkun/dayjs/issues/989)
|
||||
* Fix Timezone plugin UTCOffset rounding bug ([#987](https://github.com/iamkun/dayjs/issues/987)) ([b07182b](https://github.com/iamkun/dayjs/commit/b07182bbdf5aef7f6bf1e88fcd38432e2b8ee465)), closes [#986](https://github.com/iamkun/dayjs/issues/986)
|
||||
* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](https://github.com/iamkun/dayjs/issues/995)) ([747c0fb](https://github.com/iamkun/dayjs/commit/747c0fb4eba6353755b5dad3417fd8d5a408c378))
|
||||
* Update pt-br locale weekStart 0 ([#984](https://github.com/iamkun/dayjs/issues/984)) ([0f881c1](https://github.com/iamkun/dayjs/commit/0f881c18efb02b9d0ba7f76cba92bb504226fa95))
|
||||
|
||||
## [1.8.32](https://github.com/iamkun/dayjs/compare/v1.8.31...v1.8.32) (2020-08-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Experimental Timezone Plugin ([#974](https://github.com/iamkun/dayjs/issues/974)) ([e69caba](https://github.com/iamkun/dayjs/commit/e69caba1b0957241a855aa0ae38db899fa2c3795))
|
||||
* fix parse date string error e.g. '2020/9/30' ([#980](https://github.com/iamkun/dayjs/issues/980)) ([231790d](https://github.com/iamkun/dayjs/commit/231790da62af0494732960c2c50d86ae9bf63ec6)), closes [#979](https://github.com/iamkun/dayjs/issues/979)
|
||||
* update monthDiff function to get more accurate results ([19e8a7f](https://github.com/iamkun/dayjs/commit/19e8a7f2f7582b717f49d446822e39603694433c))
|
||||
* Update UTC plugin to support keepLocalTime ([#973](https://github.com/iamkun/dayjs/issues/973)) ([9f488e5](https://github.com/iamkun/dayjs/commit/9f488e5aca92f0b4c2951459436829d79f86d8d7))
|
||||
|
||||
## [1.8.31](https://github.com/iamkun/dayjs/compare/v1.8.30...v1.8.31) (2020-07-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Rollback LocalePresetType to string ([#968](https://github.com/iamkun/dayjs/issues/968)) ([b342bd3](https://github.com/iamkun/dayjs/commit/b342bd3d84987d6c7587a0c4590d614fb0e670d7))
|
||||
* Update Regex to parse 'YYYY' correctly ([#969](https://github.com/iamkun/dayjs/issues/969)) ([70c1239](https://github.com/iamkun/dayjs/commit/70c123990dcc6bd479fa2b5d7f9985127872a826))
|
||||
|
||||
## [1.8.30](https://github.com/iamkun/dayjs/compare/v1.8.29...v1.8.30) (2020-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Haitian Creole (ht) and Spanish Puerto Rico (es-pr) locale configs ([#958](https://github.com/iamkun/dayjs/issues/958)) ([b2642e2](https://github.com/iamkun/dayjs/commit/b2642e2d1f87734a34808c66e5176cb18bc0414d))
|
||||
* Fix UTC plugin wrong hour bug while adding month or year ([#957](https://github.com/iamkun/dayjs/issues/957)) ([28ae070](https://github.com/iamkun/dayjs/commit/28ae070024ff26685c88ce4cc8747307e86923c9))
|
||||
* Update French (fr) locale to set correct yearStart ([14ab808](https://github.com/iamkun/dayjs/commit/14ab808a7b7e226f2eb2cbe894916a18ed5d967d)), closes [#956](https://github.com/iamkun/dayjs/issues/956)
|
||||
|
||||
## [1.8.29](https://github.com/iamkun/dayjs/compare/v1.8.28...v1.8.29) (2020-07-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Duration plugin supports parse ISO string with week (W) ([#950](https://github.com/iamkun/dayjs/issues/950)) ([f0fc12a](https://github.com/iamkun/dayjs/commit/f0fc12adadcab53fb0577ad8f5e2f1cf784fd8f5))
|
||||
* LocaleData plugin supports locale order ([#938](https://github.com/iamkun/dayjs/issues/938)) ([62f429d](https://github.com/iamkun/dayjs/commit/62f429db73a0a069b1267231dea172b85f4b90e3)), closes [#936](https://github.com/iamkun/dayjs/issues/936)
|
||||
* Update type definition to support array format ([#945](https://github.com/iamkun/dayjs/issues/945)) ([81d4740](https://github.com/iamkun/dayjs/commit/81d4740511d47e34f891b21afeb0449ef8a28688)), closes [#944](https://github.com/iamkun/dayjs/issues/944)
|
||||
* Update type definition to support strict mode ([#951](https://github.com/iamkun/dayjs/issues/951)) ([8d54f3f](https://github.com/iamkun/dayjs/commit/8d54f3f7d4d161e72c767fa09699e70a2b3d681c))
|
||||
|
||||
## [1.8.28](https://github.com/iamkun/dayjs/compare/v1.8.27...v1.8.28) (2020-05-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix CustomParseFormat plugin month index error ([#918](https://github.com/iamkun/dayjs/issues/918)) ([fa2ec7f](https://github.com/iamkun/dayjs/commit/fa2ec7fcb980dcd2c7498dafe2f9ca2e52d735cf)), closes [#915](https://github.com/iamkun/dayjs/issues/915)
|
||||
* Update Ukrainian (uk) locale monthFormat and monthStandalone ([#899](https://github.com/iamkun/dayjs/issues/899)) ([a08756e](https://github.com/iamkun/dayjs/commit/a08756e80bd1d7126fca28c5ad9e382613fc86c4))
|
||||
|
||||
## [1.8.27](https://github.com/iamkun/dayjs/compare/v1.8.26...v1.8.27) (2020-05-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Kinyarwanda (rw) locale ([#903](https://github.com/iamkun/dayjs/issues/903)) ([f355235](https://github.com/iamkun/dayjs/commit/f355235a836540d77880959fb1b614c87e9f7b3e))
|
||||
* Add plugin objectSupport ([#887](https://github.com/iamkun/dayjs/issues/887)) ([52dfb13](https://github.com/iamkun/dayjs/commit/52dfb13a6b84f0a753cc5761192b92416f440961))
|
||||
* Add Turkmen (tk) locale ([#893](https://github.com/iamkun/dayjs/issues/893)) ([a9ca8dc](https://github.com/iamkun/dayjs/commit/a9ca8dcbbd0964c5b9abb4e8a2d620c983cf091a))
|
||||
* Fix CustomParseFormat plugin set locale error ([#896](https://github.com/iamkun/dayjs/issues/896)) ([8035c8a](https://github.com/iamkun/dayjs/commit/8035c8a760549b631252252718db3cdc4ab2f68f))
|
||||
* Fix locale month function bug ([#908](https://github.com/iamkun/dayjs/issues/908)) ([bf347c3](https://github.com/iamkun/dayjs/commit/bf347c36e401f50727fb5afcc537497b54b90d6b))
|
||||
* Update CustomParseFormat plugin to support Array formats ([#906](https://github.com/iamkun/dayjs/issues/906)) ([97856c6](https://github.com/iamkun/dayjs/commit/97856c603ef5fbbeb1cf8a42387479e56a77dbe8))
|
||||
|
||||
## [1.8.26](https://github.com/iamkun/dayjs/compare/v1.8.25...v1.8.26) (2020-04-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix Duration plugin `.toISOString` format bug ([#889](https://github.com/iamkun/dayjs/issues/889)) ([058d624](https://github.com/iamkun/dayjs/commit/058d624808fd2be024ae846bcb2e03885f39b556)), closes [#888](https://github.com/iamkun/dayjs/issues/888)
|
||||
* Fix WeekOfYear plugin bug while using BadMutable plugin ([#884](https://github.com/iamkun/dayjs/issues/884)) ([2977438](https://github.com/iamkun/dayjs/commit/2977438458542573a4500e21f7ba5d1f8442960e))
|
||||
* Update CustomParseFormat plugin strict mode ([#882](https://github.com/iamkun/dayjs/issues/882)) ([db642ac](https://github.com/iamkun/dayjs/commit/db642ac73e52e00d8c41546b2935c9e691cf66e0))
|
||||
* Update RelativeTime plugin default config ([#883](https://github.com/iamkun/dayjs/issues/883)) ([0606f42](https://github.com/iamkun/dayjs/commit/0606f425aef8ccbfc3da3e43cba368130603b0cc))
|
||||
|
||||
## [1.8.25](https://github.com/iamkun/dayjs/compare/v1.8.24...v1.8.25) (2020-04-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](https://github.com/iamkun/dayjs/issues/873)) ([3cea04d](https://github.com/iamkun/dayjs/commit/3cea04d33d54d44bbdd3d026b5c7f67ebf176116)), closes [#849](https://github.com/iamkun/dayjs/issues/849)
|
||||
* Fix Duration plugin get seconds ([#867](https://github.com/iamkun/dayjs/issues/867)) ([62b092d](https://github.com/iamkun/dayjs/commit/62b092d9f9a3db5506ef01f798bdf211f163f53f))
|
||||
* Fix type definition of locale ([9790b85](https://github.com/iamkun/dayjs/commit/9790b853e6113243a7f4a81dd12c6509e406a102))
|
||||
* Fix UTC plugin startOf, endOf bug ([#872](https://github.com/iamkun/dayjs/issues/872)) ([4141084](https://github.com/iamkun/dayjs/commit/4141084ba96d35cadcda3f1e661bf1d0f6c8e4de)), closes [#809](https://github.com/iamkun/dayjs/issues/809) [#808](https://github.com/iamkun/dayjs/issues/808)
|
||||
|
||||
## [1.8.24](https://github.com/iamkun/dayjs/compare/v1.8.23...v1.8.24) (2020-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add config option to RelativeTime plugin ([#851](https://github.com/iamkun/dayjs/issues/851)) ([bd24034](https://github.com/iamkun/dayjs/commit/bd24034b95bfc656024b75ef3f3c986708845fed))
|
||||
* add Duration plugin ([#858](https://github.com/iamkun/dayjs/issues/858)) ([d568273](https://github.com/iamkun/dayjs/commit/d568273223199ca0497f238e2cc3a8d3dcf32d0f))
|
||||
* Add en-in, en-tt locales ([#855](https://github.com/iamkun/dayjs/issues/855)) ([c39fb96](https://github.com/iamkun/dayjs/commit/c39fb96e2a9102c14b004c14a6c073af9d266f2f))
|
||||
* add isToday, isTomorrow, isYesterday plugins ([#857](https://github.com/iamkun/dayjs/issues/857)) ([fc08ab6](https://github.com/iamkun/dayjs/commit/fc08ab68f8a28269802deeab9d6b0473b92cdc51))
|
||||
* Add option callback to Calendar plugin ([#839](https://github.com/iamkun/dayjs/issues/839)) ([b25be90](https://github.com/iamkun/dayjs/commit/b25be9094325295310c8fc5e617fb058be8a5f68))
|
||||
* Fix monthsShort for locale fr ([#862](https://github.com/iamkun/dayjs/issues/862)) ([d2de9a0](https://github.com/iamkun/dayjs/commit/d2de9a0b44b830038ed0094f79bfd40726311f2a))
|
||||
* Update Breton locale (br) meridiem config ([#856](https://github.com/iamkun/dayjs/issues/856)) ([a2a6672](https://github.com/iamkun/dayjs/commit/a2a66720abb788a8f1cffbfd0929b35579f29c72))
|
||||
* Update Ukrainian (uk) locale relative time ([#842](https://github.com/iamkun/dayjs/issues/842)) ([578bc1a](https://github.com/iamkun/dayjs/commit/578bc1a23c6e737783bbac3da12c0ed5d1edcf82))
|
||||
|
||||
## [1.8.23](https://github.com/iamkun/dayjs/compare/v1.8.22...v1.8.23) (2020-03-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Chinese (zh) locale ([f9b8945](https://github.com/iamkun/dayjs/commit/f9b89453166d8b53d33b1d7eefd9942022552e6e))
|
||||
* Fix IsoWeek plugin typescript definition ([#828](https://github.com/iamkun/dayjs/issues/828)) ([30aab0c](https://github.com/iamkun/dayjs/commit/30aab0c7bce85dfac0ae208a891def30f88b5cb4))
|
||||
* Update Arabic (ar) locale relative time ([#836](https://github.com/iamkun/dayjs/issues/836)) ([14044c6](https://github.com/iamkun/dayjs/commit/14044c6fda1229e3f0e5473d3f886bd79589b15f))
|
||||
* Update Slovak (sk) locale, Czech (cs) locale ([#833](https://github.com/iamkun/dayjs/issues/833)) ([f0d451f](https://github.com/iamkun/dayjs/commit/f0d451f795e9ebf752cd854d51b25b11de2343a3))
|
||||
* Update Thai (th) locale relativeTime ([#826](https://github.com/iamkun/dayjs/issues/826)) ([63b7c03](https://github.com/iamkun/dayjs/commit/63b7c03a6dbb0507d60776e8bad6cccde3828b88)), closes [#816](https://github.com/iamkun/dayjs/issues/816)
|
||||
|
||||
## [1.8.22](https://github.com/iamkun/dayjs/compare/v1.8.21...v1.8.22) (2020-03-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add IsoWeek plugin ([#811](https://github.com/iamkun/dayjs/issues/811)) ([28a2207](https://github.com/iamkun/dayjs/commit/28a2207ef9849afbac15dd29267b2e7a09cd3c16))
|
||||
* Fix unsupported locale fallback to previous one ([#819](https://github.com/iamkun/dayjs/issues/819)) ([4868715](https://github.com/iamkun/dayjs/commit/48687152cf5bee6a4c1b8ceea4bda8b9bab9be10))
|
||||
|
||||
## [1.8.21](https://github.com/iamkun/dayjs/compare/v1.8.20...v1.8.21) (2020-02-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Set + Get accept 'D' as the short version of 'date' ([#795](https://github.com/iamkun/dayjs/issues/795)) ([523c038](https://github.com/iamkun/dayjs/commit/523c03880fa8bbad83214494ad02cd606cdb8b30))
|
||||
* Update DayOfYear plugin type ([#799](https://github.com/iamkun/dayjs/issues/799)) ([5809652](https://github.com/iamkun/dayjs/commit/5809652e40245b7759827d9bf317abdcfa75a330))
|
||||
* Update fi (Finnish) locale relativeTime ([#797](https://github.com/iamkun/dayjs/issues/797)) ([4a470fb](https://github.com/iamkun/dayjs/commit/4a470fbd6fef9e051727d0f26d53cc050b85935d))
|
||||
|
||||
## [1.8.20](https://github.com/iamkun/dayjs/compare/v1.8.19...v1.8.20) (2020-02-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Bislama Locale (bi) ([#780](https://github.com/iamkun/dayjs/issues/780)) ([9ac6ab4](https://github.com/iamkun/dayjs/commit/9ac6ab481bc883dd4ecc02caab12c8b2fc218a42))
|
||||
* Fix weekOfYear plugin to support yearStart locale for better week number result ([#769](https://github.com/iamkun/dayjs/issues/769)) ([f00db36](https://github.com/iamkun/dayjs/commit/f00db36e70bc7beaca1abadeb30a9b1fbb3261ee))
|
||||
* Update et (Estonian) locale relativeTime ([#790](https://github.com/iamkun/dayjs/issues/790)) ([d8e0f45](https://github.com/iamkun/dayjs/commit/d8e0f45f6cd2d5e5704b9797929227454c92d1a5))
|
||||
* Update LocaleData plugin to support dayjs.localeData().weekdays() API ([287fed6](https://github.com/iamkun/dayjs/commit/287fed6db9eb4fd979b4861aca4dacbd32422533)), closes [#779](https://github.com/iamkun/dayjs/issues/779)
|
||||
* Update LocaleData plugin to support dayjs.months dayjs.weekdays API ([144c2ae](https://github.com/iamkun/dayjs/commit/144c2ae6e15fbf89e3acd7c8cb9e237c5f6e1348)), closes [#779](https://github.com/iamkun/dayjs/issues/779)
|
||||
* Update pl locale fusional config ([d372475](https://github.com/iamkun/dayjs/commit/d3724758bb27d5b17587b995ba14e7e80dcd1151))
|
||||
|
||||
## [1.8.19](https://github.com/iamkun/dayjs/compare/v1.8.18...v1.8.19) (2020-01-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add UpdateLocale plugin to update a locale's properties ([#766](https://github.com/iamkun/dayjs/issues/766)) ([82ce2ba](https://github.com/iamkun/dayjs/commit/82ce2ba8d7e402e40f6d005d400eb5356a0b0633))
|
||||
* Fix CustomParseFormat Plugin 'YYYY-MM' use first day of the month ([ba709ec](https://github.com/iamkun/dayjs/commit/ba709eca86a71ae648bc68bf67d9abdc229198d4)), closes [#761](https://github.com/iamkun/dayjs/issues/761)
|
||||
* Fix CustomParseFormat Plugin to set correct locale ([66ce23f](https://github.com/iamkun/dayjs/commit/66ce23f2e18c5506e8f1a7ef20d3483a4df80087))
|
||||
* Fix WeekOfYear Plugin wrong calender week number bug ([79b86db](https://github.com/iamkun/dayjs/commit/79b86dbbf3cfd3f1e2165b3d479a7061ad1b6925)), closes [#760](https://github.com/iamkun/dayjs/issues/760)
|
||||
* Update RelativeTime plugin to support function to make additional processing ([#767](https://github.com/iamkun/dayjs/issues/767)) ([4bd9250](https://github.com/iamkun/dayjs/commit/4bd9250fbe7131e2fddfb5fa1b3350e8c2262ca9))
|
||||
* Update ru, uk, cs locale to support relativeTime with plural ([3f080f7](https://github.com/iamkun/dayjs/commit/3f080f7d6bfdc4018cbb7c4d0112ff1ead4ef6b8))
|
||||
|
||||
## [1.8.18](https://github.com/iamkun/dayjs/compare/v1.8.17...v1.8.18) (2019-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add missing locale type definition ([#716](https://github.com/iamkun/dayjs/issues/716)) ([cde5d0b](https://github.com/iamkun/dayjs/commit/cde5d0b91be7b2f5f3098de4aa0b9a4f0f28ea5c))
|
||||
* Fix .locale() handel unsupported locale ([78ec173](https://github.com/iamkun/dayjs/commit/78ec173fcecc1299516ab7b44f4554d431b4b2fd))
|
||||
* Update Italian locale (it) ([#727](https://github.com/iamkun/dayjs/issues/727)) ([5b53e98](https://github.com/iamkun/dayjs/commit/5b53e98c0a3ba0eb9573a9c77caeb907439be9e7))
|
||||
* Update locale (fa) ([#733](https://github.com/iamkun/dayjs/issues/733)) ([9ad2e47](https://github.com/iamkun/dayjs/commit/9ad2e47e0569b23991bb0d5578f49c792c12df08))
|
||||
* Update locale (zh-cn) ([#706](https://github.com/iamkun/dayjs/issues/706)) ([e31e544](https://github.com/iamkun/dayjs/commit/e31e54414fb90e1f54da13a117748ba37f52645d))
|
||||
* Update locale (zh-cn) meridiem ([#735](https://github.com/iamkun/dayjs/issues/735)) ([15d1b81](https://github.com/iamkun/dayjs/commit/15d1b813e7faf5a1f9d1ea6fc673fd27ac49d8b1))
|
||||
* Update LocaleData plugin to support dayjs().longDateFormat() ([#734](https://github.com/iamkun/dayjs/issues/734)) ([aa0f210](https://github.com/iamkun/dayjs/commit/aa0f210a1e3c4f6aba61c3b96f9eb445b43a33f0)), closes [#680](https://github.com/iamkun/dayjs/issues/680)
|
||||
* Update Mongolian (mn) locale relativeTime ([#753](https://github.com/iamkun/dayjs/issues/753)) ([6d51435](https://github.com/iamkun/dayjs/commit/6d51435092c0c94d8e50256d3f0f058cdd15febe))
|
||||
* Update Swedish locale (sv) fix ordinal error ([#745](https://github.com/iamkun/dayjs/issues/745)) ([49670d5](https://github.com/iamkun/dayjs/commit/49670d5ae31e4e21636cc5a8bfe35fef0f6d9e4a)), closes [#743](https://github.com/iamkun/dayjs/issues/743)
|
||||
|
||||
## [1.8.17](https://github.com/iamkun/dayjs/compare/v1.8.16...v1.8.17) (2019-11-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix set utcOffset in utc mode ([d148115](https://github.com/iamkun/dayjs/commit/d148115dad8f1a5afc0a64e9b8163dfeba4616b6))
|
||||
* Update advancedFormat plugin to support w ww wo week tokens … ([#678](https://github.com/iamkun/dayjs/issues/678)) ([26cfa63](https://github.com/iamkun/dayjs/commit/26cfa63a524b803f7966dac5464f9cbf8f63387e)), closes [#676](https://github.com/iamkun/dayjs/issues/676)
|
||||
* Update ka locale weekdays ([f8ca3d4](https://github.com/iamkun/dayjs/commit/f8ca3d4ba1d3cbe41613d3909c0627935a51a0c4))
|
||||
* Update nb locale ([#679](https://github.com/iamkun/dayjs/issues/679)) ([1063b0e](https://github.com/iamkun/dayjs/commit/1063b0e1b5c19a1354d233cc0f21438e7073233a))
|
||||
* Update Polish locale (pl)([#713](https://github.com/iamkun/dayjs/issues/713)) ([30d2f02](https://github.com/iamkun/dayjs/commit/30d2f026b47188833a4f44fee4bab52467d4a718))
|
||||
* Update Ukrainian locale (uk) ([#710](https://github.com/iamkun/dayjs/issues/710)) ([360161c](https://github.com/iamkun/dayjs/commit/360161cac75f597fdd51d9d1ff138601282a1b4b))
|
||||
* UTC plugin set utcOffset value ([#668](https://github.com/iamkun/dayjs/issues/668)) ([8877883](https://github.com/iamkun/dayjs/commit/88778838e71dd309e79cd1a8094d5bea36ca3390))
|
||||
|
||||
## [1.8.16](https://github.com/iamkun/dayjs/compare/v1.8.15...v1.8.16) (2019-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix relativeTime Plugin .FromNow() result error in UTC mode ([a385d5c](https://github.com/iamkun/dayjs/commit/a385d5c))
|
||||
* Handle locale in WeekOfYear plugin ([#658](https://github.com/iamkun/dayjs/issues/658)) ([0e45b0a](https://github.com/iamkun/dayjs/commit/0e45b0a))
|
||||
* LocaleData plugin returns all months and weekdays data when pas no argument ([#645](https://github.com/iamkun/dayjs/issues/645)) ([95e70b4](https://github.com/iamkun/dayjs/commit/95e70b4))
|
||||
* Return null in toJSON if not valid ([#633](https://github.com/iamkun/dayjs/issues/633)) ([19affc8](https://github.com/iamkun/dayjs/commit/19affc8))
|
||||
* Update Danish (da) locale ([#626](https://github.com/iamkun/dayjs/issues/626)) ([ac2ec77](https://github.com/iamkun/dayjs/commit/ac2ec77))
|
||||
* Update Korean locale meridiem ([#642](https://github.com/iamkun/dayjs/issues/642)) ([b457146](https://github.com/iamkun/dayjs/commit/b457146))
|
||||
* update Occitan locale Catalan locale ([#630](https://github.com/iamkun/dayjs/issues/630)) ([fef135e](https://github.com/iamkun/dayjs/commit/fef135e))
|
||||
* update pt-br locale ([#628](https://github.com/iamkun/dayjs/issues/628)) ([ccf596d](https://github.com/iamkun/dayjs/commit/ccf596d))
|
||||
* Update weekdaysShort to some locale files ([#643](https://github.com/iamkun/dayjs/issues/643)) ([cc1f15f](https://github.com/iamkun/dayjs/commit/cc1f15f))
|
||||
|
||||
## [1.8.15](https://github.com/iamkun/dayjs/compare/v1.8.14...v1.8.15) (2019-07-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix dayjs.locale() returns current global locale ([#602](https://github.com/iamkun/dayjs/issues/602)) ([790cd1a](https://github.com/iamkun/dayjs/commit/790cd1a))
|
||||
* Fix incorrect Thai locale translation of July ([#607](https://github.com/iamkun/dayjs/issues/607)) ([43cbfd3](https://github.com/iamkun/dayjs/commit/43cbfd3))
|
||||
* Lowercase french locale months and weekdays ([#615](https://github.com/iamkun/dayjs/issues/615)) ([e5a257c](https://github.com/iamkun/dayjs/commit/e5a257c))
|
||||
* Type - Export Ls object to query all available locales ([#623](https://github.com/iamkun/dayjs/issues/623)) ([f6bfae0](https://github.com/iamkun/dayjs/commit/f6bfae0))
|
||||
* Update nb (Norsk Bokmål) locale ([#604](https://github.com/iamkun/dayjs/issues/604)) ([907f5c9](https://github.com/iamkun/dayjs/commit/907f5c9))
|
||||
* Update types of `.diff` API ([#617](https://github.com/iamkun/dayjs/issues/617)) ([f0f43d2](https://github.com/iamkun/dayjs/commit/f0f43d2))
|
||||
|
||||
## [1.8.14](https://github.com/iamkun/dayjs/compare/v1.8.13...v1.8.14) (2019-05-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix `.format` API returns UTC offset when value is 0 bug ([b254964](https://github.com/iamkun/dayjs/commit/b254964))
|
||||
* Fix QuarterOfYear plugin bug ([#591](https://github.com/iamkun/dayjs/issues/591)) ([434f774](https://github.com/iamkun/dayjs/commit/434f774))
|
||||
* Fix UTC plugin add day DST bug ([#590](https://github.com/iamkun/dayjs/issues/590)) ([86cd839](https://github.com/iamkun/dayjs/commit/86cd839))
|
||||
|
||||
## [1.8.13](https://github.com/iamkun/dayjs/compare/v1.8.12...v1.8.13) (2019-04-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add missing relativeTime and formats for some locales ([#560](https://github.com/iamkun/dayjs/issues/560)) ([96b917e](https://github.com/iamkun/dayjs/commit/96b917e))
|
||||
* Add weekday (locale aware day of the week) plugin ([#569](https://github.com/iamkun/dayjs/issues/569)) ([9007cc5](https://github.com/iamkun/dayjs/commit/9007cc5)), closes [#559](https://github.com/iamkun/dayjs/issues/559)
|
||||
* Allow customizing "am" / "pm" strings with locale meridiem function ([#580](https://github.com/iamkun/dayjs/issues/580)) ([576e93e](https://github.com/iamkun/dayjs/commit/576e93e)), closes [#578](https://github.com/iamkun/dayjs/issues/578)
|
||||
* Fix `.add` day/week decimal rouding bug ([800f6c9](https://github.com/iamkun/dayjs/commit/800f6c9))
|
||||
* Fix `.diff` type definition error ([#565](https://github.com/iamkun/dayjs/issues/565)) ([c4921ae](https://github.com/iamkun/dayjs/commit/c4921ae)), closes [#561](https://github.com/iamkun/dayjs/issues/561)
|
||||
* Fix CustomParseFormat plugin bug ([#568](https://github.com/iamkun/dayjs/issues/568)) ([1f5a9db](https://github.com/iamkun/dayjs/commit/1f5a9db)), closes [#555](https://github.com/iamkun/dayjs/issues/555)
|
||||
* Fix relativeTime plugin Math.round bug ([40bea40](https://github.com/iamkun/dayjs/commit/40bea40))
|
||||
* skip square brackets in buddhistEra, advancedFormat plugins ([#556](https://github.com/iamkun/dayjs/issues/556)) ([9279718](https://github.com/iamkun/dayjs/commit/9279718)), closes [#554](https://github.com/iamkun/dayjs/issues/554)
|
||||
* Update Indonesian locale([#574](https://github.com/iamkun/dayjs/issues/574)) ([0aa7143](https://github.com/iamkun/dayjs/commit/0aa7143))
|
||||
* Update locale month to support both array and function ([#581](https://github.com/iamkun/dayjs/issues/581)) ([b6599d3](https://github.com/iamkun/dayjs/commit/b6599d3))
|
||||
* Update LocalizedFormat plugin lowercase formats logic ([#557](https://github.com/iamkun/dayjs/issues/557)) ([d409304](https://github.com/iamkun/dayjs/commit/d409304))
|
||||
|
||||
## [1.8.12](https://github.com/iamkun/dayjs/compare/v1.8.11...v1.8.12) (2019-04-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add .get API ([7318797](https://github.com/iamkun/dayjs/commit/7318797))
|
||||
* Add 79 locales ([#541](https://github.com/iamkun/dayjs/issues/541)) ([f75a125](https://github.com/iamkun/dayjs/commit/f75a125))
|
||||
* Add Calendar plugin ([d1b9cf9](https://github.com/iamkun/dayjs/commit/d1b9cf9))
|
||||
* Add isoWeeksInYear plugin ([2db8631](https://github.com/iamkun/dayjs/commit/2db8631))
|
||||
* Add Occitan (oc-lnc) locale file ([#551](https://github.com/iamkun/dayjs/issues/551)) ([c30b715](https://github.com/iamkun/dayjs/commit/c30b715))
|
||||
* Add plugin minMax to sopport .max .min ([2870a23](https://github.com/iamkun/dayjs/commit/2870a23))
|
||||
* Fix set Month Year error in last day of the month ([d058f4a](https://github.com/iamkun/dayjs/commit/d058f4a))
|
||||
* Update ko locale weekdaysShort ([#543](https://github.com/iamkun/dayjs/issues/543)) ([317fd3e](https://github.com/iamkun/dayjs/commit/317fd3e))
|
||||
* Update localizedFormat plugin to support lowercase localizable formats (l, ll, lll, llll) ([#546](https://github.com/iamkun/dayjs/issues/546)) ([f2b5ebf](https://github.com/iamkun/dayjs/commit/f2b5ebf))
|
||||
|
||||
## [1.8.11](https://github.com/iamkun/dayjs/compare/v1.8.10...v1.8.11) (2019-03-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](https://github.com/iamkun/dayjs/commit/dde39e9)), closes [#537](https://github.com/iamkun/dayjs/issues/537) [#531](https://github.com/iamkun/dayjs/issues/531)
|
||||
* Add locale support for Azerbaijani language (az) ([#535](https://github.com/iamkun/dayjs/issues/535)) ([eeb20fa](https://github.com/iamkun/dayjs/commit/eeb20fa))
|
||||
* Correct typescript definition `add` ([22a249c](https://github.com/iamkun/dayjs/commit/22a249c)), closes [#531](https://github.com/iamkun/dayjs/issues/531)
|
||||
* Fix CustomParseFormat plugin formatting bug ([#536](https://github.com/iamkun/dayjs/issues/536)) ([8578546](https://github.com/iamkun/dayjs/commit/8578546)), closes [#533](https://github.com/iamkun/dayjs/issues/533)
|
||||
* Update pt locale ([#538](https://github.com/iamkun/dayjs/issues/538)) ([1ac9e1e](https://github.com/iamkun/dayjs/commit/1ac9e1e))
|
||||
|
||||
## [1.8.10](https://github.com/iamkun/dayjs/compare/v1.8.9...v1.8.10) (2019-03-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **locale:** Add nepali (ne) locale ([#524](https://github.com/iamkun/dayjs/issues/524)) ([bdbec01](https://github.com/iamkun/dayjs/commit/bdbec01))
|
||||
* Add WeekYear plugin ([a892608](https://github.com/iamkun/dayjs/commit/a892608))
|
||||
* API .locale() with no argument should return current locale name string ([8d63d88](https://github.com/iamkun/dayjs/commit/8d63d88))
|
||||
* CustomParseFormat correct parse HH:mm:ss with only one digit like 0:12:10 ([600d547](https://github.com/iamkun/dayjs/commit/600d547))
|
||||
* CustomParseFormat plugin parse Do format string ([bf27fda](https://github.com/iamkun/dayjs/commit/bf27fda)), closes [#522](https://github.com/iamkun/dayjs/issues/522)
|
||||
* Expand setters like .year(2000) .hour(12) ([ac532a0](https://github.com/iamkun/dayjs/commit/ac532a0))
|
||||
* Move toObject, toArray API to separate plugin from core ([40a3431](https://github.com/iamkun/dayjs/commit/40a3431))
|
||||
|
||||
## [1.8.9](https://github.com/iamkun/dayjs/compare/v1.8.8...v1.8.9) (2019-03-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add UTC mode with UTC plugin ([#517](https://github.com/iamkun/dayjs/issues/517)) ([caf335c](https://github.com/iamkun/dayjs/commit/caf335c))
|
||||
|
||||
> For plugin developers: Please note, we have changed the name of some method in `Utils` in order to reduce the file size. ([#517](https://github.com/iamkun/dayjs/issues/517)) ([detail](https://github.com/iamkun/dayjs/pull/517/files#diff-2b4ca49d4bb0a774c4d4c1672d7aa781R46))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add locale de-AT ([#515](https://github.com/iamkun/dayjs/issues/515)) ([d93f7b6](https://github.com/iamkun/dayjs/commit/d93f7b6))
|
||||
* Add locale zh-hk ([#516](https://github.com/iamkun/dayjs/issues/516)) ([5fc05a6](https://github.com/iamkun/dayjs/commit/5fc05a6))
|
||||
|
||||
## [1.8.8](https://github.com/iamkun/dayjs/compare/v1.8.7...v1.8.8) (2019-02-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update relativeTime plugin type definition ([de56f2c](https://github.com/iamkun/dayjs/commit/de56f2c))
|
||||
|
||||
## [1.8.7](https://github.com/iamkun/dayjs/compare/v1.8.6...v1.8.7) (2019-02-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add plugin type definitions ([#418](https://github.com/iamkun/dayjs/issues/418)) ([361d437](https://github.com/iamkun/dayjs/commit/361d437))
|
||||
* Add Swahili locale ([#508](https://github.com/iamkun/dayjs/issues/508)) ([b9cee84](https://github.com/iamkun/dayjs/commit/b9cee84))
|
||||
* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](https://github.com/iamkun/dayjs/issues/457)) ([f343206](https://github.com/iamkun/dayjs/commit/f343206))
|
||||
* Update declaration file .diff .isBefore .isSame .isAfter ([#496](https://github.com/iamkun/dayjs/issues/496)) ([4523275](https://github.com/iamkun/dayjs/commit/4523275))
|
||||
* Word orders corrections for locale 'fa' ([#491](https://github.com/iamkun/dayjs/issues/491)) ([56050c2](https://github.com/iamkun/dayjs/commit/56050c2))
|
||||
|
||||
## [1.8.6](https://github.com/iamkun/dayjs/compare/v1.8.5...v1.8.6) (2019-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add Bahasa Melayu (Malaysia) locale ([#485](https://github.com/iamkun/dayjs/issues/485)) ([cb208b0](https://github.com/iamkun/dayjs/commit/cb208b0))
|
||||
* Copy & export built-in en locale to /locale folder as a separate file ([a7e05e0](https://github.com/iamkun/dayjs/commit/a7e05e0))
|
||||
* Fix bug in customParseFormat plugin while month(MM) is '01' ([9884ca5](https://github.com/iamkun/dayjs/commit/9884ca5)), closes [#494](https://github.com/iamkun/dayjs/issues/494)
|
||||
* Fix startOf week bug while week start is not Sunday ([5eaf77b](https://github.com/iamkun/dayjs/commit/5eaf77b))
|
||||
* Implemented isBetween inclusivity ([#464](https://github.com/iamkun/dayjs/issues/464)) ([af2f4f1](https://github.com/iamkun/dayjs/commit/af2f4f1))
|
||||
* Update Swedish and Finnish locales ([#488](https://github.com/iamkun/dayjs/issues/488)) ([f142082](https://github.com/iamkun/dayjs/commit/f142082))
|
||||
* Fix commonJS require ES Module bug in webpack4 ([23f9f3d](https://github.com/iamkun/dayjs/commit/23f9f3d)), check [#492](https://github.com/iamkun/dayjs/issues/492)
|
||||
|
||||
> Get access to ESM code with `import dayjs from 'dayjs/esm'`
|
||||
|
||||
## [1.8.5](https://github.com/iamkun/dayjs/compare/v1.8.4...v1.8.5) (2019-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add en-gb locale ([#478](https://github.com/iamkun/dayjs/issues/478)) ([508c3a7](https://github.com/iamkun/dayjs/commit/508c3a7))
|
||||
* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](https://github.com/iamkun/dayjs/issues/477)) ([#480](https://github.com/iamkun/dayjs/issues/480)) ([#482](https://github.com/iamkun/dayjs/issues/482)) ([767017d](https://github.com/iamkun/dayjs/commit/767017d))
|
||||
* update customParseFormat plugin support hh:mm ([54947cc](https://github.com/iamkun/dayjs/commit/54947cc)), closes [#484](https://github.com/iamkun/dayjs/issues/484)
|
||||
* Update module in package.json ([5c5a7a0](https://github.com/iamkun/dayjs/commit/5c5a7a0))
|
||||
|
||||
## [1.8.4](https://github.com/iamkun/dayjs/compare/v1.8.3...v1.8.4) (2019-02-05)
|
||||
|
||||
* Allow set start day of week in locale && Allow set week in weekOfYear plugin ([1295591](https://github.com/iamkun/dayjs/commit/1295591))
|
||||
### Bug Fixes
|
||||
* update all locale files with correct week start ([5b03412](https://github.com/iamkun/dayjs/commit/5b03412))
|
||||
* update es es-do locale adding weekStart && update weekStart test ([66e42ec](https://github.com/iamkun/dayjs/commit/66e42ec))
|
||||
* Revert default export ([b00da1b](https://github.com/iamkun/dayjs/commit/b00da1b))
|
||||
|
||||
## [1.8.3](https://github.com/iamkun/dayjs/compare/v1.8.2...v1.8.3) (2019-02-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix ios safari YYYY-MM-DD HH:mm parse BUG ([e02ae82](https://github.com/iamkun/dayjs/commit/e02ae82)), closes [#254](https://github.com/iamkun/dayjs/issues/254)
|
||||
|
||||
## [1.8.2](https://github.com/iamkun/dayjs/compare/v1.8.1...v1.8.2) (2019-02-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add missing czech language locale ([#461](https://github.com/iamkun/dayjs/issues/461)) ([7e04004](https://github.com/iamkun/dayjs/commit/7e04004))
|
||||
* Add utcOffset api method and fix calculating diff error in DST ([#453](https://github.com/iamkun/dayjs/issues/453)) ([ce2e30e](https://github.com/iamkun/dayjs/commit/ce2e30e))
|
||||
* Fix it locale error ([#458](https://github.com/iamkun/dayjs/issues/458)) ([f6d9a64](https://github.com/iamkun/dayjs/commit/f6d9a64))
|
||||
* Add DayOfYear plugin (#454)
|
||||
* Fix es locale monthsShort error
|
||||
|
||||
## [1.8.1](https://github.com/iamkun/dayjs/compare/v1.8.0...v1.8.1) (2019-02-02)
|
||||
|
||||
* Add LocalizedFormat plugin supplying format like LTS, LT, LLLL
|
||||
|
||||
* <del>update declaration File with default export (#278)</del>
|
||||
> <del>From v1.8.1, in TypeScript Project, just `import from dayjs from 'dayjs'`</del>
|
||||
* add ES2015 module support (#451)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **format:** reuse matches instead of created when replacing ([#441](https://github.com/iamkun/dayjs/issues/441)) ([10b79d8](https://github.com/iamkun/dayjs/commit/10b79d8))
|
||||
|
||||
# [1.8.0](https://github.com/iamkun/dayjs/compare/v1.7.8...v1.8.0) (2019-01-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add CustomParseFormat plugin and QuarterOfYear plugin ([#450](https://github.com/iamkun/dayjs/issues/450)) ([8f6f63c](https://github.com/iamkun/dayjs/commit/8f6f63c))
|
||||
|
||||
## [1.7.8](https://github.com/iamkun/dayjs/compare/v1.7.7...v1.7.8) (2018-12-13)
|
||||
|
||||
|
||||
### Feature
|
||||
|
||||
* update isSame isBefore isAfter supports units ([fd65464](https://github.com/iamkun/dayjs/commit/fd65464))
|
||||
|
||||
* add greek lithuanian locales
|
||||
|
||||
## [1.7.7](https://github.com/iamkun/dayjs/compare/v1.7.6...v1.7.7) (2018-09-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **DST:** fix daylight saving time DST bug && add test ([#354](https://github.com/iamkun/dayjs/issues/354)) ([6fca6d5](https://github.com/iamkun/dayjs/commit/6fca6d5))
|
||||
|
||||
## [1.7.6](https://github.com/iamkun/dayjs/compare/v1.7.5...v1.7.6) (2018-09-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **add dayjs.unix:** add dayjs.unix to parse timestamp in seconds && locale update ([5711c5e](https://github.com/iamkun/dayjs/commit/5711c5e))
|
||||
|
||||
## [1.7.5](https://github.com/iamkun/dayjs/compare/v1.7.4...v1.7.5) (2018-08-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add isBetween API & update ([b5fc3d1](https://github.com/iamkun/dayjs/commit/b5fc3d1))
|
||||
|
||||
## [1.7.4](https://github.com/iamkun/dayjs/compare/v1.7.3...v1.7.4) (2018-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update set week logic ([60b6325](https://github.com/iamkun/dayjs/commit/60b6325)), closes [#276](https://github.com/iamkun/dayjs/issues/276)
|
||||
|
||||
## [1.7.3](https://github.com/iamkun/dayjs/compare/v1.7.2...v1.7.3) (2018-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **locale-nl:** set correct weekdays and months ([6d089d7](https://github.com/iamkun/dayjs/commit/6d089d7))
|
||||
|
||||
## [1.7.2](https://github.com/iamkun/dayjs/compare/v1.7.1...v1.7.2) (2018-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* DEPRECATED isLeapYear, use IsLeapYear plugin instead ([e2e5116](https://github.com/iamkun/dayjs/commit/e2e5116))
|
||||
|
||||
## [1.7.1](https://github.com/iamkun/dayjs/compare/v1.7.0...v1.7.1) (2018-07-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix week() error near the end of the year ([fa03689](https://github.com/iamkun/dayjs/commit/fa03689))
|
||||
|
||||
# [1.7.0](https://github.com/iamkun/dayjs/compare/v1.6.10...v1.7.0) (2018-07-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Added method `.week()` to retrieve week of the year ([e1c1b1c](https://github.com/iamkun/dayjs/commit/e1c1b1c))
|
||||
* Updated Japanese locae
|
||||
|
||||
## [1.6.10](https://github.com/iamkun/dayjs/compare/v1.6.9...v1.6.10) (2018-06-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add relative locales to russian language ([c7e9898](https://github.com/iamkun/dayjs/commit/c7e9898)), closes [#256](https://github.com/iamkun/dayjs/issues/256)
|
||||
|
||||
## [1.6.9](https://github.com/iamkun/dayjs/compare/v1.6.8...v1.6.9) (2018-06-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add isDayjs => boolean API ([6227c8b](https://github.com/iamkun/dayjs/commit/6227c8b))
|
||||
|
||||
## [1.6.8](https://github.com/iamkun/dayjs/compare/v1.6.7...v1.6.8) (2018-06-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix Advanced format bug in zh-cn ([0c07874](https://github.com/iamkun/dayjs/commit/0c07874)), closes [#242](https://github.com/iamkun/dayjs/issues/242)
|
||||
|
||||
## [1.6.7](https://github.com/iamkun/dayjs/compare/v1.6.6...v1.6.7) (2018-06-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix id locale ([1ebbeb8](https://github.com/iamkun/dayjs/commit/1ebbeb8)), closes [#234](https://github.com/iamkun/dayjs/issues/234)
|
||||
|
||||
<a name="1.6.6"></a>
|
||||
## [1.6.6](https://github.com/iamkun/dayjs/compare/v1.6.5...v1.6.6) (2018-06-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* format API update and locale file update ([5ca48f0](https://github.com/iamkun/dayjs/commit/5ca48f0)), closes [#228](https://github.com/iamkun/dayjs/issues/228)
|
||||
|
||||
<a name="1.6.5"></a>
|
||||
## [1.6.5](https://github.com/iamkun/dayjs/compare/v1.6.4...v1.6.5) (2018-05-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bugfix, utils update and locale file update ([ebcb6d5](https://github.com/iamkun/dayjs/commit/ebcb6d5)), closes [#214](https://github.com/iamkun/dayjs/issues/214)
|
||||
|
||||
<a name="1.6.4"></a>
|
||||
## [1.6.4](https://github.com/iamkun/dayjs/compare/v1.6.3...v1.6.4) (2018-05-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add RelativeTime plugin and locale file update ([c1fbbca](https://github.com/iamkun/dayjs/commit/c1fbbca)), closes [#198](https://github.com/iamkun/dayjs/issues/198)
|
||||
|
||||
<a name="1.6.3"></a>
|
||||
## [1.6.3](https://github.com/iamkun/dayjs/compare/v1.6.2...v1.6.3) (2018-05-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Changing locales locally is immutable from this release ([2cce729](https://github.com/iamkun/dayjs/commit/2cce729)), closes [#182](https://github.com/iamkun/dayjs/issues/182)
|
||||
* instance locale change should be immutable ([84597c9](https://github.com/iamkun/dayjs/commit/84597c9))
|
||||
* Add more locales
|
||||
* english ordinal fix
|
||||
|
||||
<a name="1.6.2"></a>
|
||||
## [1.6.2](https://github.com/iamkun/dayjs/compare/v1.6.1...v1.6.2) (2018-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* change-log update && test new npm release ([aa49cba](https://github.com/iamkun/dayjs/commit/aa49cba)), closes [#163](https://github.com/iamkun/dayjs/issues/163)
|
||||
|
||||
<a name="1.6.1"></a>
|
||||
## [1.6.1](https://github.com/iamkun/dayjs/compare/v1.6.0...v1.6.1) (2018-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add German, Brazilian Portuguese locales
|
||||
* add() & parse() bug fix & add locale de, pt-br ([bf1331e](https://github.com/iamkun/dayjs/commit/bf1331e))
|
||||
|
||||
<a name="1.6.0"></a>
|
||||
# [1.6.0](https://github.com/iamkun/dayjs/compare/v1.5.24...v1.6.0) (2018-05-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Locale && Plugin ([2342c55](https://github.com/iamkun/dayjs/commit/2342c55)), closes [#141](https://github.com/iamkun/dayjs/issues/141)
|
||||
21
node_modules/dayjs/LICENSE
generated
vendored
Normal file
21
node_modules/dayjs/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018-present, iamkun
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
167
node_modules/dayjs/README.md
generated
vendored
Normal file
167
node_modules/dayjs/README.md
generated
vendored
Normal file
@ -0,0 +1,167 @@
|
||||
English | [简体中文](./docs/zh-cn/README.zh-CN.md) | [日本語](./docs/ja/README-ja.md) | [Português Brasileiro](./docs/pt-br/README-pt-br.md) | [한국어](./docs/ko/README-ko.md) | [Español (España)](./docs/es-es/README-es-es.md) | [Русский](./docs/ru/README-ru.md) | [Türkçe](./docs/tr/README-tr.md) | [සිංහල](./docs/si/README-si.md) | [עברית](./docs/he/README-he.md)
|
||||
|
||||
<p align="center"><a href="https://day.js.org/" target="_blank" rel="noopener noreferrer"><img width="550"
|
||||
src="https://user-images.githubusercontent.com/17680888/39081119-3057bbe2-456e-11e8-862c-646133ad4b43.png"
|
||||
alt="Day.js" /></a></p>
|
||||
<p align="center">Fast <b>2kB</b> alternative to Moment.js with the same modern API</p>
|
||||
<p align="center">
|
||||
<a href="https://unpkg.com/dayjs/dayjs.min.js"><img
|
||||
src="https://img.badgesize.io/https://unpkg.com/dayjs/dayjs.min.js?compression=gzip&style=flat-square"
|
||||
alt="Gzip Size"></a>
|
||||
<a href="https://www.npmjs.com/package/dayjs"><img src="https://img.shields.io/npm/v/dayjs.svg?style=flat-square&colorB=51C838"
|
||||
alt="NPM Version"></a>
|
||||
<a href="https://github.com/iamkun/dayjs/actions/workflows/check.yml"><img
|
||||
src="https://img.shields.io/github/actions/workflow/status/iamkun/dayjs/check.yml?style=flat-square" alt="Build Status"></a>
|
||||
<a href="https://codecov.io/gh/iamkun/dayjs"><img
|
||||
src="https://img.shields.io/codecov/c/github/iamkun/dayjs/master.svg?style=flat-square" alt="Codecov"></a>
|
||||
<a href="https://github.com/iamkun/dayjs/blob/master/LICENSE"><img
|
||||
src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="License"></a>
|
||||
<br>
|
||||
<a href="https://saucelabs.com/u/dayjs">
|
||||
<img width="750" src="https://user-images.githubusercontent.com/17680888/40040137-8e3323a6-584b-11e8-9dba-bbe577ee8a7b.png" alt="Sauce Test Status">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
|
||||
|
||||
```js
|
||||
dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
|
||||
```
|
||||
|
||||
* 🕒 Familiar Moment.js API & patterns
|
||||
* 💪 Immutable
|
||||
* 🔥 Chainable
|
||||
* 🌐 I18n support
|
||||
* 📦 2kb mini library
|
||||
* 👫 All browsers supported
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Documentation
|
||||
|
||||
You can find more details, API, and other docs on [day.js.org](https://day.js.org/) website.
|
||||
|
||||
### Installation
|
||||
|
||||
```console
|
||||
npm install dayjs --save
|
||||
```
|
||||
|
||||
📚[Installation Guide](https://day.js.org/docs/en/installation/installation)
|
||||
|
||||
### API
|
||||
|
||||
It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.
|
||||
|
||||
```javascript
|
||||
dayjs('2018-08-08') // parse
|
||||
|
||||
dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display
|
||||
|
||||
dayjs().set('month', 3).month() // get & set
|
||||
|
||||
dayjs().add(1, 'year') // manipulate
|
||||
|
||||
dayjs().isBefore(dayjs()) // query
|
||||
```
|
||||
|
||||
📚[API Reference](https://day.js.org/docs/en/parse/parse)
|
||||
|
||||
### I18n
|
||||
|
||||
Day.js has great support for internationalization.
|
||||
|
||||
But none of them will be included in your build unless you use it.
|
||||
|
||||
```javascript
|
||||
import 'dayjs/locale/es' // load on demand
|
||||
|
||||
dayjs.locale('es') // use Spanish locale globally
|
||||
|
||||
dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance
|
||||
```
|
||||
|
||||
📚[Internationalization](https://day.js.org/docs/en/i18n/i18n)
|
||||
|
||||
### Plugin
|
||||
|
||||
A plugin is an independent module that can be added to Day.js to extend functionality or add new features.
|
||||
|
||||
```javascript
|
||||
import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand
|
||||
|
||||
dayjs.extend(advancedFormat) // use plugin
|
||||
|
||||
dayjs().format('Q Do k kk X x') // more available formats
|
||||
```
|
||||
|
||||
📚[Plugin List](https://day.js.org/docs/en/plugin/plugin)
|
||||
|
||||
### Usage Trend
|
||||
|
||||
<a href="https://npm-compare.com/moment,dayjs/#timeRange=THREE_YEARS" target="_blank">
|
||||
<img src="https://user-images.githubusercontent.com/3455798/270162667-c7bd2ebe-675e-45c6-a2c9-dc67f3b65d6e.png">
|
||||
</a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
||||
|
||||
[[Become a sponsor via Github](https://github.com/sponsors/iamkun/)] [[Become a sponsor via OpenCollective](https://opencollective.com/dayjs#sponsor)]
|
||||
|
||||
<a href="https://toyokumo.co.jp" target="_blank">
|
||||
<img width="70" src="https://user-images.githubusercontent.com/17680888/197092231-2367b5eb-1e43-467e-a311-23f7cd97b086.png">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/alan-eu" target="_blank">
|
||||
<img width="70" src="https://avatars.githubusercontent.com/u/18175329?s=52&v=4">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/sight-and-sound-ministries" target="_blank">
|
||||
<img width="70" src="https://user-images.githubusercontent.com/17680888/232316426-cb99b4cf-0ccb-4e73-a6ce-e16dba6aadf4.png">
|
||||
</a>
|
||||
|
||||
<a href="https://chudovo.com/" target="_blank">
|
||||
<img width="70" src="https://images.opencollective.com/chudovo/3c866f5/logo/256.png?height=256">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/ken-swyfft" target="_blank">
|
||||
<img width="70" src="https://avatars.githubusercontent.com/u/65305317?v=4">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/storyblok" target="_blank">
|
||||
<img width="70" src="https://avatars.githubusercontent.com/u/13880908?s=200&v=4">
|
||||
</a>
|
||||
|
||||
<a href="https://www.exoflare.com/open-source/?utm_source=dayjs&utm_campaign=open_source" target="_blank">
|
||||
<img width="70" src="https://user-images.githubusercontent.com/17680888/162761622-1407a849-0c41-4591-8aa9-f98114ec2092.png">
|
||||
</a>
|
||||
|
||||
<a href="https://bestkru.com/" target="_blank">
|
||||
<img width="70" src="https://avatars.githubusercontent.com/u/159320286" alt="BestKru">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/anonstories" target="_blank"><img width="70" src="https://images.opencollective.com/anonstories/7e826c0/avatar/256.png"></a>
|
||||
|
||||
<a href="https://opencollective.com/datawrapper" target="_blank"><img width="70" src="https://images.opencollective.com/datawrapper/c13e229/logo.png"></a>
|
||||
|
||||
## Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute.
|
||||
|
||||
Please give us a 💖 star 💖 to support us. Thank you.
|
||||
|
||||
And thank you to all our backers! 🙏
|
||||
|
||||
<a href="https://opencollective.com/dayjs/backer/0/website?requireActive=false" target="_blank"><img width="35" src="https://opencollective.com/dayjs/backer/0/avatar.svg?requireActive=false"></a>
|
||||
<a href="https://opencollective.com/dayjs/backer/1/website?requireActive=false" target="_blank"><img width="35" src="https://opencollective.com/dayjs/backer/1/avatar.svg?requireActive=false"></a>
|
||||
<a href="https://opencollective.com/dayjs/backer/2/website?requireActive=false" target="_blank"><img width="35" src="https://opencollective.com/dayjs/backer/2/avatar.svg?requireActive=false"></a>
|
||||
<a href="https://opencollective.com/dayjs/backer/3/website?requireActive=false" target="_blank"><img width="35" src="https://opencollective.com/dayjs/backer/3/avatar.svg?requireActive=false"></a>
|
||||
<br />
|
||||
<a href="https://opencollective.com/dayjs#backers" target="_blank"><img src="https://opencollective.com/dayjs/contributors.svg?width=890" /></a>
|
||||
|
||||
## License
|
||||
|
||||
Day.js is licensed under a [MIT License](./LICENSE).
|
||||
1
node_modules/dayjs/dayjs.min.js
generated
vendored
Normal file
1
node_modules/dayjs/dayjs.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
25
node_modules/dayjs/esm/constant.js
generated
vendored
Normal file
25
node_modules/dayjs/esm/constant.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
export var SECONDS_A_MINUTE = 60;
|
||||
export var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60;
|
||||
export var SECONDS_A_DAY = SECONDS_A_HOUR * 24;
|
||||
export var SECONDS_A_WEEK = SECONDS_A_DAY * 7;
|
||||
export var MILLISECONDS_A_SECOND = 1e3;
|
||||
export var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND;
|
||||
export var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND;
|
||||
export var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND;
|
||||
export var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND; // English locales
|
||||
|
||||
export var MS = 'millisecond';
|
||||
export var S = 'second';
|
||||
export var MIN = 'minute';
|
||||
export var H = 'hour';
|
||||
export var D = 'day';
|
||||
export var W = 'week';
|
||||
export var M = 'month';
|
||||
export var Q = 'quarter';
|
||||
export var Y = 'year';
|
||||
export var DATE = 'date';
|
||||
export var FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ';
|
||||
export var INVALID_DATE_STRING = 'Invalid Date'; // regex
|
||||
|
||||
export var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
|
||||
export var REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
|
||||
429
node_modules/dayjs/esm/index.d.ts
generated
vendored
Normal file
429
node_modules/dayjs/esm/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,429 @@
|
||||
/// <reference path="./locale/index.d.ts" />
|
||||
|
||||
export = dayjs;
|
||||
|
||||
declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs
|
||||
|
||||
declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs
|
||||
|
||||
declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs
|
||||
|
||||
declare namespace dayjs {
|
||||
interface ConfigTypeMap {
|
||||
default: string | number | Date | Dayjs | null | undefined
|
||||
}
|
||||
|
||||
export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap]
|
||||
|
||||
export interface FormatObject { locale?: string, format?: string, utc?: boolean }
|
||||
|
||||
export type OptionType = FormatObject | string | string[]
|
||||
|
||||
export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
|
||||
|
||||
export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date'
|
||||
|
||||
export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates'
|
||||
|
||||
export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort;
|
||||
|
||||
export type OpUnitType = UnitType | "week" | "weeks" | 'w';
|
||||
export type QUnitType = UnitType | "quarter" | "quarters" | 'Q';
|
||||
export type ManipulateType = Exclude<OpUnitType, 'date' | 'dates'>;
|
||||
class Dayjs {
|
||||
constructor (config?: ConfigType)
|
||||
/**
|
||||
* All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one.
|
||||
* ```
|
||||
* dayjs().clone()// => Dayjs
|
||||
* dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/parse/dayjs-clone
|
||||
*/
|
||||
clone(): Dayjs
|
||||
/**
|
||||
* This returns a `boolean` indicating whether the Day.js object contains a valid date or not.
|
||||
* ```
|
||||
* dayjs().isValid()// => boolean
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/parse/is-valid
|
||||
*/
|
||||
isValid(): boolean
|
||||
/**
|
||||
* Get the year.
|
||||
* ```
|
||||
* dayjs().year()// => 2020
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/year
|
||||
*/
|
||||
year(): number
|
||||
/**
|
||||
* Set the year.
|
||||
* ```
|
||||
* dayjs().year(2000)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/year
|
||||
*/
|
||||
year(value: number): Dayjs
|
||||
/**
|
||||
* Get the month.
|
||||
*
|
||||
* Months are zero indexed, so January is month 0.
|
||||
* ```
|
||||
* dayjs().month()// => 0-11
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/month
|
||||
*/
|
||||
month(): number
|
||||
/**
|
||||
* Set the month.
|
||||
*
|
||||
* Months are zero indexed, so January is month 0.
|
||||
*
|
||||
* Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the next year.
|
||||
* ```
|
||||
* dayjs().month(0)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/month
|
||||
*/
|
||||
month(value: number): Dayjs
|
||||
/**
|
||||
* Get the date of the month.
|
||||
* ```
|
||||
* dayjs().date()// => 1-31
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/date
|
||||
*/
|
||||
date(): number
|
||||
/**
|
||||
* Set the date of the month.
|
||||
*
|
||||
* Accepts numbers from 1 to 31. If the range is exceeded, it will bubble up to the next months.
|
||||
* ```
|
||||
* dayjs().date(1)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/date
|
||||
*/
|
||||
date(value: number): Dayjs
|
||||
/**
|
||||
* Get the day of the week.
|
||||
*
|
||||
* Returns numbers from 0 (Sunday) to 6 (Saturday).
|
||||
* ```
|
||||
* dayjs().day()// 0-6
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/day
|
||||
*/
|
||||
day(): 0 | 1 | 2 | 3 | 4 | 5 | 6
|
||||
/**
|
||||
* Set the day of the week.
|
||||
*
|
||||
* Accepts numbers from 0 (Sunday) to 6 (Saturday). If the range is exceeded, it will bubble up to next weeks.
|
||||
* ```
|
||||
* dayjs().day(0)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/day
|
||||
*/
|
||||
day(value: number): Dayjs
|
||||
/**
|
||||
* Get the hour.
|
||||
* ```
|
||||
* dayjs().hour()// => 0-23
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/hour
|
||||
*/
|
||||
hour(): number
|
||||
/**
|
||||
* Set the hour.
|
||||
*
|
||||
* Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the next day.
|
||||
* ```
|
||||
* dayjs().hour(12)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/hour
|
||||
*/
|
||||
hour(value: number): Dayjs
|
||||
/**
|
||||
* Get the minutes.
|
||||
* ```
|
||||
* dayjs().minute()// => 0-59
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/minute
|
||||
*/
|
||||
minute(): number
|
||||
/**
|
||||
* Set the minutes.
|
||||
*
|
||||
* Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next hour.
|
||||
* ```
|
||||
* dayjs().minute(59)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/minute
|
||||
*/
|
||||
minute(value: number): Dayjs
|
||||
/**
|
||||
* Get the seconds.
|
||||
* ```
|
||||
* dayjs().second()// => 0-59
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/second
|
||||
*/
|
||||
second(): number
|
||||
/**
|
||||
* Set the seconds.
|
||||
*
|
||||
* Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next minutes.
|
||||
* ```
|
||||
* dayjs().second(1)// Dayjs
|
||||
* ```
|
||||
*/
|
||||
second(value: number): Dayjs
|
||||
/**
|
||||
* Get the milliseconds.
|
||||
* ```
|
||||
* dayjs().millisecond()// => 0-999
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/millisecond
|
||||
*/
|
||||
millisecond(): number
|
||||
/**
|
||||
* Set the milliseconds.
|
||||
*
|
||||
* Accepts numbers from 0 to 999. If the range is exceeded, it will bubble up to the next seconds.
|
||||
* ```
|
||||
* dayjs().millisecond(1)// => Dayjs
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/millisecond
|
||||
*/
|
||||
millisecond(value: number): Dayjs
|
||||
/**
|
||||
* Generic setter, accepting unit as first argument, and value as second, returns a new instance with the applied changes.
|
||||
*
|
||||
* In general:
|
||||
* ```
|
||||
* dayjs().set(unit, value) === dayjs()[unit](value)
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
* ```
|
||||
* dayjs().set('date', 1)
|
||||
* dayjs().set('month', 3) // April
|
||||
* dayjs().set('second', 30)
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/set
|
||||
*/
|
||||
set(unit: UnitType, value: number): Dayjs
|
||||
/**
|
||||
* String getter, returns the corresponding information getting from Day.js object.
|
||||
*
|
||||
* In general:
|
||||
* ```
|
||||
* dayjs().get(unit) === dayjs()[unit]()
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
* ```
|
||||
* dayjs().get('year')
|
||||
* dayjs().get('month') // start 0
|
||||
* dayjs().get('date')
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/get-set/get
|
||||
*/
|
||||
get(unit: UnitType): number
|
||||
/**
|
||||
* Returns a cloned Day.js object with a specified amount of time added.
|
||||
* ```
|
||||
* dayjs().add(7, 'day')// => Dayjs
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/manipulate/add
|
||||
*/
|
||||
add(value: number, unit?: ManipulateType): Dayjs
|
||||
/**
|
||||
* Returns a cloned Day.js object with a specified amount of time subtracted.
|
||||
* ```
|
||||
* dayjs().subtract(7, 'year')// => Dayjs
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/manipulate/subtract
|
||||
*/
|
||||
subtract(value: number, unit?: ManipulateType): Dayjs
|
||||
/**
|
||||
* Returns a cloned Day.js object and set it to the start of a unit of time.
|
||||
* ```
|
||||
* dayjs().startOf('year')// => Dayjs
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/manipulate/start-of
|
||||
*/
|
||||
startOf(unit: OpUnitType): Dayjs
|
||||
/**
|
||||
* Returns a cloned Day.js object and set it to the end of a unit of time.
|
||||
* ```
|
||||
* dayjs().endOf('month')// => Dayjs
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/manipulate/end-of
|
||||
*/
|
||||
endOf(unit: OpUnitType): Dayjs
|
||||
/**
|
||||
* Get the formatted date according to the string of tokens passed in.
|
||||
*
|
||||
* To escape characters, wrap them in square brackets (e.g. [MM]).
|
||||
* ```
|
||||
* dayjs().format()// => current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'
|
||||
* dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z'
|
||||
* dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/display/format
|
||||
*/
|
||||
format(template?: string): string
|
||||
/**
|
||||
* This indicates the difference between two date-time in the specified unit.
|
||||
*
|
||||
* To get the difference in milliseconds, use `dayjs#diff`
|
||||
* ```
|
||||
* const date1 = dayjs('2019-01-25')
|
||||
* const date2 = dayjs('2018-06-05')
|
||||
* date1.diff(date2) // 20214000000 default milliseconds
|
||||
* date1.diff() // milliseconds to current time
|
||||
* ```
|
||||
*
|
||||
* To get the difference in another unit of measurement, pass that measurement as the second argument.
|
||||
* ```
|
||||
* const date1 = dayjs('2019-01-25')
|
||||
* date1.diff('2018-06-05', 'month') // 7
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/display/difference
|
||||
*/
|
||||
diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
|
||||
/**
|
||||
* This returns the number of **milliseconds** since the Unix Epoch of the Day.js object.
|
||||
* ```
|
||||
* dayjs('2019-01-25').valueOf() // 1548381600000
|
||||
* +dayjs(1548381600000) // 1548381600000
|
||||
* ```
|
||||
* To get a Unix timestamp (the number of seconds since the epoch) from a Day.js object, you should use Unix Timestamp `dayjs#unix()`.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds
|
||||
*/
|
||||
valueOf(): number
|
||||
/**
|
||||
* This returns the Unix timestamp (the number of **seconds** since the Unix Epoch) of the Day.js object.
|
||||
* ```
|
||||
* dayjs('2019-01-25').unix() // 1548381600
|
||||
* ```
|
||||
* This value is floored to the nearest second, and does not include a milliseconds component.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/display/unix-timestamp
|
||||
*/
|
||||
unix(): number
|
||||
/**
|
||||
* Get the number of days in the current month.
|
||||
* ```
|
||||
* dayjs('2019-01-25').daysInMonth() // 31
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/display/days-in-month
|
||||
*/
|
||||
daysInMonth(): number
|
||||
/**
|
||||
* To get a copy of the native `Date` object parsed from the Day.js object use `dayjs#toDate`.
|
||||
* ```
|
||||
* dayjs('2019-01-25').toDate()// => Date
|
||||
* ```
|
||||
*/
|
||||
toDate(): Date
|
||||
/**
|
||||
* To serialize as an ISO 8601 string.
|
||||
* ```
|
||||
* dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z'
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/display/as-json
|
||||
*/
|
||||
toJSON(): string
|
||||
/**
|
||||
* To format as an ISO 8601 string.
|
||||
* ```
|
||||
* dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z'
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/display/as-iso-string
|
||||
*/
|
||||
toISOString(): string
|
||||
/**
|
||||
* Returns a string representation of the date.
|
||||
* ```
|
||||
* dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT'
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/display/as-string
|
||||
*/
|
||||
toString(): string
|
||||
/**
|
||||
* Get the UTC offset in minutes.
|
||||
* ```
|
||||
* dayjs().utcOffset()
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/manipulate/utc-offset
|
||||
*/
|
||||
utcOffset(): number
|
||||
/**
|
||||
* This indicates whether the Day.js object is before the other supplied date-time.
|
||||
* ```
|
||||
* dayjs().isBefore(dayjs('2011-01-01')) // default milliseconds
|
||||
* ```
|
||||
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
|
||||
* ```
|
||||
* dayjs().isBefore('2011-01-01', 'year')// => boolean
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/query/is-before
|
||||
*/
|
||||
isBefore(date?: ConfigType, unit?: OpUnitType): boolean
|
||||
/**
|
||||
* This indicates whether the Day.js object is the same as the other supplied date-time.
|
||||
* ```
|
||||
* dayjs().isSame(dayjs('2011-01-01')) // default milliseconds
|
||||
* ```
|
||||
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
|
||||
* ```
|
||||
* dayjs().isSame('2011-01-01', 'year')// => boolean
|
||||
* ```
|
||||
* Docs: https://day.js.org/docs/en/query/is-same
|
||||
*/
|
||||
isSame(date?: ConfigType, unit?: OpUnitType): boolean
|
||||
/**
|
||||
* This indicates whether the Day.js object is after the other supplied date-time.
|
||||
* ```
|
||||
* dayjs().isAfter(dayjs('2011-01-01')) // default milliseconds
|
||||
* ```
|
||||
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
|
||||
* ```
|
||||
* dayjs().isAfter('2011-01-01', 'year')// => boolean
|
||||
* ```
|
||||
* Units are case insensitive, and support plural and short forms.
|
||||
*
|
||||
* Docs: https://day.js.org/docs/en/query/is-after
|
||||
*/
|
||||
isAfter(date?: ConfigType, unit?: OpUnitType): boolean
|
||||
|
||||
locale(): string
|
||||
|
||||
locale(preset: string | ILocale, object?: Partial<ILocale>): Dayjs
|
||||
}
|
||||
|
||||
export type PluginFunc<T = unknown> = (option: T, c: typeof Dayjs, d: typeof dayjs) => void
|
||||
|
||||
export function extend<T = unknown>(plugin: PluginFunc<T>, option?: T): Dayjs
|
||||
|
||||
export function locale(preset?: string | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string
|
||||
|
||||
export function isDayjs(d: any): d is Dayjs
|
||||
|
||||
export function unix(t: number): Dayjs
|
||||
|
||||
const Ls : { [key: string] : ILocale }
|
||||
}
|
||||
541
node_modules/dayjs/esm/index.js
generated
vendored
Normal file
541
node_modules/dayjs/esm/index.js
generated
vendored
Normal file
@ -0,0 +1,541 @@
|
||||
import * as C from './constant';
|
||||
import en from './locale/en';
|
||||
import U from './utils';
|
||||
var L = 'en'; // global locale
|
||||
|
||||
var Ls = {}; // global loaded locale
|
||||
|
||||
Ls[L] = en;
|
||||
var IS_DAYJS = '$isDayjsObject'; // eslint-disable-next-line no-use-before-define
|
||||
|
||||
var isDayjs = function isDayjs(d) {
|
||||
return d instanceof Dayjs || !!(d && d[IS_DAYJS]);
|
||||
};
|
||||
|
||||
var parseLocale = function parseLocale(preset, object, isLocal) {
|
||||
var l;
|
||||
if (!preset) return L;
|
||||
|
||||
if (typeof preset === 'string') {
|
||||
var presetLower = preset.toLowerCase();
|
||||
|
||||
if (Ls[presetLower]) {
|
||||
l = presetLower;
|
||||
}
|
||||
|
||||
if (object) {
|
||||
Ls[presetLower] = object;
|
||||
l = presetLower;
|
||||
}
|
||||
|
||||
var presetSplit = preset.split('-');
|
||||
|
||||
if (!l && presetSplit.length > 1) {
|
||||
return parseLocale(presetSplit[0]);
|
||||
}
|
||||
} else {
|
||||
var name = preset.name;
|
||||
Ls[name] = preset;
|
||||
l = name;
|
||||
}
|
||||
|
||||
if (!isLocal && l) L = l;
|
||||
return l || !isLocal && L;
|
||||
};
|
||||
|
||||
var dayjs = function dayjs(date, c) {
|
||||
if (isDayjs(date)) {
|
||||
return date.clone();
|
||||
} // eslint-disable-next-line no-nested-ternary
|
||||
|
||||
|
||||
var cfg = typeof c === 'object' ? c : {};
|
||||
cfg.date = date;
|
||||
cfg.args = arguments; // eslint-disable-line prefer-rest-params
|
||||
|
||||
return new Dayjs(cfg); // eslint-disable-line no-use-before-define
|
||||
};
|
||||
|
||||
var wrapper = function wrapper(date, instance) {
|
||||
return dayjs(date, {
|
||||
locale: instance.$L,
|
||||
utc: instance.$u,
|
||||
x: instance.$x,
|
||||
$offset: instance.$offset // todo: refactor; do not use this.$offset in you code
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var Utils = U; // for plugin use
|
||||
|
||||
Utils.l = parseLocale;
|
||||
Utils.i = isDayjs;
|
||||
Utils.w = wrapper;
|
||||
|
||||
var parseDate = function parseDate(cfg) {
|
||||
var date = cfg.date,
|
||||
utc = cfg.utc;
|
||||
if (date === null) return new Date(NaN); // null is invalid
|
||||
|
||||
if (Utils.u(date)) return new Date(); // today
|
||||
|
||||
if (date instanceof Date) return new Date(date);
|
||||
|
||||
if (typeof date === 'string' && !/Z$/i.test(date)) {
|
||||
var d = date.match(C.REGEX_PARSE);
|
||||
|
||||
if (d) {
|
||||
var m = d[2] - 1 || 0;
|
||||
var ms = (d[7] || '0').substring(0, 3);
|
||||
|
||||
if (utc) {
|
||||
return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
|
||||
}
|
||||
|
||||
return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
|
||||
}
|
||||
}
|
||||
|
||||
return new Date(date); // everything else
|
||||
};
|
||||
|
||||
var Dayjs = /*#__PURE__*/function () {
|
||||
function Dayjs(cfg) {
|
||||
this.$L = parseLocale(cfg.locale, null, true);
|
||||
this.parse(cfg); // for plugin
|
||||
|
||||
this.$x = this.$x || cfg.x || {};
|
||||
this[IS_DAYJS] = true;
|
||||
}
|
||||
|
||||
var _proto = Dayjs.prototype;
|
||||
|
||||
_proto.parse = function parse(cfg) {
|
||||
this.$d = parseDate(cfg);
|
||||
this.init();
|
||||
};
|
||||
|
||||
_proto.init = function init() {
|
||||
var $d = this.$d;
|
||||
this.$y = $d.getFullYear();
|
||||
this.$M = $d.getMonth();
|
||||
this.$D = $d.getDate();
|
||||
this.$W = $d.getDay();
|
||||
this.$H = $d.getHours();
|
||||
this.$m = $d.getMinutes();
|
||||
this.$s = $d.getSeconds();
|
||||
this.$ms = $d.getMilliseconds();
|
||||
} // eslint-disable-next-line class-methods-use-this
|
||||
;
|
||||
|
||||
_proto.$utils = function $utils() {
|
||||
return Utils;
|
||||
};
|
||||
|
||||
_proto.isValid = function isValid() {
|
||||
return !(this.$d.toString() === C.INVALID_DATE_STRING);
|
||||
};
|
||||
|
||||
_proto.isSame = function isSame(that, units) {
|
||||
var other = dayjs(that);
|
||||
return this.startOf(units) <= other && other <= this.endOf(units);
|
||||
};
|
||||
|
||||
_proto.isAfter = function isAfter(that, units) {
|
||||
return dayjs(that) < this.startOf(units);
|
||||
};
|
||||
|
||||
_proto.isBefore = function isBefore(that, units) {
|
||||
return this.endOf(units) < dayjs(that);
|
||||
};
|
||||
|
||||
_proto.$g = function $g(input, get, set) {
|
||||
if (Utils.u(input)) return this[get];
|
||||
return this.set(set, input);
|
||||
};
|
||||
|
||||
_proto.unix = function unix() {
|
||||
return Math.floor(this.valueOf() / 1000);
|
||||
};
|
||||
|
||||
_proto.valueOf = function valueOf() {
|
||||
// timezone(hour) * 60 * 60 * 1000 => ms
|
||||
return this.$d.getTime();
|
||||
};
|
||||
|
||||
_proto.startOf = function startOf(units, _startOf) {
|
||||
var _this = this;
|
||||
|
||||
// startOf -> endOf
|
||||
var isStartOf = !Utils.u(_startOf) ? _startOf : true;
|
||||
var unit = Utils.p(units);
|
||||
|
||||
var instanceFactory = function instanceFactory(d, m) {
|
||||
var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this);
|
||||
return isStartOf ? ins : ins.endOf(C.D);
|
||||
};
|
||||
|
||||
var instanceFactorySet = function instanceFactorySet(method, slice) {
|
||||
var argumentStart = [0, 0, 0, 0];
|
||||
var argumentEnd = [23, 59, 59, 999];
|
||||
return Utils.w(_this.toDate()[method].apply( // eslint-disable-line prefer-spread
|
||||
_this.toDate('s'), (isStartOf ? argumentStart : argumentEnd).slice(slice)), _this);
|
||||
};
|
||||
|
||||
var $W = this.$W,
|
||||
$M = this.$M,
|
||||
$D = this.$D;
|
||||
var utcPad = "set" + (this.$u ? 'UTC' : '');
|
||||
|
||||
switch (unit) {
|
||||
case C.Y:
|
||||
return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11);
|
||||
|
||||
case C.M:
|
||||
return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1);
|
||||
|
||||
case C.W:
|
||||
{
|
||||
var weekStart = this.$locale().weekStart || 0;
|
||||
var gap = ($W < weekStart ? $W + 7 : $W) - weekStart;
|
||||
return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M);
|
||||
}
|
||||
|
||||
case C.D:
|
||||
case C.DATE:
|
||||
return instanceFactorySet(utcPad + "Hours", 0);
|
||||
|
||||
case C.H:
|
||||
return instanceFactorySet(utcPad + "Minutes", 1);
|
||||
|
||||
case C.MIN:
|
||||
return instanceFactorySet(utcPad + "Seconds", 2);
|
||||
|
||||
case C.S:
|
||||
return instanceFactorySet(utcPad + "Milliseconds", 3);
|
||||
|
||||
default:
|
||||
return this.clone();
|
||||
}
|
||||
};
|
||||
|
||||
_proto.endOf = function endOf(arg) {
|
||||
return this.startOf(arg, false);
|
||||
};
|
||||
|
||||
_proto.$set = function $set(units, _int) {
|
||||
var _C$D$C$DATE$C$M$C$Y$C;
|
||||
|
||||
// private set
|
||||
var unit = Utils.p(units);
|
||||
var utcPad = "set" + (this.$u ? 'UTC' : '');
|
||||
var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[C.D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[C.Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[C.H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[C.MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[C.S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[C.MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit];
|
||||
var arg = unit === C.D ? this.$D + (_int - this.$W) : _int;
|
||||
|
||||
if (unit === C.M || unit === C.Y) {
|
||||
// clone is for badMutable plugin
|
||||
var date = this.clone().set(C.DATE, 1);
|
||||
date.$d[name](arg);
|
||||
date.init();
|
||||
this.$d = date.set(C.DATE, Math.min(this.$D, date.daysInMonth())).$d;
|
||||
} else if (name) this.$d[name](arg);
|
||||
|
||||
this.init();
|
||||
return this;
|
||||
};
|
||||
|
||||
_proto.set = function set(string, _int2) {
|
||||
return this.clone().$set(string, _int2);
|
||||
};
|
||||
|
||||
_proto.get = function get(unit) {
|
||||
return this[Utils.p(unit)]();
|
||||
};
|
||||
|
||||
_proto.add = function add(number, units) {
|
||||
var _this2 = this,
|
||||
_C$MIN$C$H$C$S$unit;
|
||||
|
||||
number = Number(number); // eslint-disable-line no-param-reassign
|
||||
|
||||
var unit = Utils.p(units);
|
||||
|
||||
var instanceFactorySet = function instanceFactorySet(n) {
|
||||
var d = dayjs(_this2);
|
||||
return Utils.w(d.date(d.date() + Math.round(n * number)), _this2);
|
||||
};
|
||||
|
||||
if (unit === C.M) {
|
||||
return this.set(C.M, this.$M + number);
|
||||
}
|
||||
|
||||
if (unit === C.Y) {
|
||||
return this.set(C.Y, this.$y + number);
|
||||
}
|
||||
|
||||
if (unit === C.D) {
|
||||
return instanceFactorySet(1);
|
||||
}
|
||||
|
||||
if (unit === C.W) {
|
||||
return instanceFactorySet(7);
|
||||
}
|
||||
|
||||
var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[C.MIN] = C.MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[C.H] = C.MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[C.S] = C.MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1; // ms
|
||||
|
||||
var nextTimeStamp = this.$d.getTime() + number * step;
|
||||
return Utils.w(nextTimeStamp, this);
|
||||
};
|
||||
|
||||
_proto.subtract = function subtract(number, string) {
|
||||
return this.add(number * -1, string);
|
||||
};
|
||||
|
||||
_proto.format = function format(formatStr) {
|
||||
var _this3 = this;
|
||||
|
||||
var locale = this.$locale();
|
||||
if (!this.isValid()) return locale.invalidDate || C.INVALID_DATE_STRING;
|
||||
var str = formatStr || C.FORMAT_DEFAULT;
|
||||
var zoneStr = Utils.z(this);
|
||||
var $H = this.$H,
|
||||
$m = this.$m,
|
||||
$M = this.$M;
|
||||
var weekdays = locale.weekdays,
|
||||
months = locale.months,
|
||||
meridiem = locale.meridiem;
|
||||
|
||||
var getShort = function getShort(arr, index, full, length) {
|
||||
return arr && (arr[index] || arr(_this3, str)) || full[index].slice(0, length);
|
||||
};
|
||||
|
||||
var get$H = function get$H(num) {
|
||||
return Utils.s($H % 12 || 12, num, '0');
|
||||
};
|
||||
|
||||
var meridiemFunc = meridiem || function (hour, minute, isLowercase) {
|
||||
var m = hour < 12 ? 'AM' : 'PM';
|
||||
return isLowercase ? m.toLowerCase() : m;
|
||||
};
|
||||
|
||||
var matches = function matches(match) {
|
||||
switch (match) {
|
||||
case 'YY':
|
||||
return String(_this3.$y).slice(-2);
|
||||
|
||||
case 'YYYY':
|
||||
return Utils.s(_this3.$y, 4, '0');
|
||||
|
||||
case 'M':
|
||||
return $M + 1;
|
||||
|
||||
case 'MM':
|
||||
return Utils.s($M + 1, 2, '0');
|
||||
|
||||
case 'MMM':
|
||||
return getShort(locale.monthsShort, $M, months, 3);
|
||||
|
||||
case 'MMMM':
|
||||
return getShort(months, $M);
|
||||
|
||||
case 'D':
|
||||
return _this3.$D;
|
||||
|
||||
case 'DD':
|
||||
return Utils.s(_this3.$D, 2, '0');
|
||||
|
||||
case 'd':
|
||||
return String(_this3.$W);
|
||||
|
||||
case 'dd':
|
||||
return getShort(locale.weekdaysMin, _this3.$W, weekdays, 2);
|
||||
|
||||
case 'ddd':
|
||||
return getShort(locale.weekdaysShort, _this3.$W, weekdays, 3);
|
||||
|
||||
case 'dddd':
|
||||
return weekdays[_this3.$W];
|
||||
|
||||
case 'H':
|
||||
return String($H);
|
||||
|
||||
case 'HH':
|
||||
return Utils.s($H, 2, '0');
|
||||
|
||||
case 'h':
|
||||
return get$H(1);
|
||||
|
||||
case 'hh':
|
||||
return get$H(2);
|
||||
|
||||
case 'a':
|
||||
return meridiemFunc($H, $m, true);
|
||||
|
||||
case 'A':
|
||||
return meridiemFunc($H, $m, false);
|
||||
|
||||
case 'm':
|
||||
return String($m);
|
||||
|
||||
case 'mm':
|
||||
return Utils.s($m, 2, '0');
|
||||
|
||||
case 's':
|
||||
return String(_this3.$s);
|
||||
|
||||
case 'ss':
|
||||
return Utils.s(_this3.$s, 2, '0');
|
||||
|
||||
case 'SSS':
|
||||
return Utils.s(_this3.$ms, 3, '0');
|
||||
|
||||
case 'Z':
|
||||
return zoneStr;
|
||||
// 'ZZ' logic below
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
return str.replace(C.REGEX_FORMAT, function (match, $1) {
|
||||
return $1 || matches(match) || zoneStr.replace(':', '');
|
||||
}); // 'ZZ'
|
||||
};
|
||||
|
||||
_proto.utcOffset = function utcOffset() {
|
||||
// Because a bug at FF24, we're rounding the timezone offset around 15 minutes
|
||||
// https://github.com/moment/moment/pull/1871
|
||||
return -Math.round(this.$d.getTimezoneOffset() / 15) * 15;
|
||||
};
|
||||
|
||||
_proto.diff = function diff(input, units, _float) {
|
||||
var _this4 = this;
|
||||
|
||||
var unit = Utils.p(units);
|
||||
var that = dayjs(input);
|
||||
var zoneDelta = (that.utcOffset() - this.utcOffset()) * C.MILLISECONDS_A_MINUTE;
|
||||
var diff = this - that;
|
||||
|
||||
var getMonth = function getMonth() {
|
||||
return Utils.m(_this4, that);
|
||||
};
|
||||
|
||||
var result;
|
||||
|
||||
switch (unit) {
|
||||
case C.Y:
|
||||
result = getMonth() / 12;
|
||||
break;
|
||||
|
||||
case C.M:
|
||||
result = getMonth();
|
||||
break;
|
||||
|
||||
case C.Q:
|
||||
result = getMonth() / 3;
|
||||
break;
|
||||
|
||||
case C.W:
|
||||
result = (diff - zoneDelta) / C.MILLISECONDS_A_WEEK;
|
||||
break;
|
||||
|
||||
case C.D:
|
||||
result = (diff - zoneDelta) / C.MILLISECONDS_A_DAY;
|
||||
break;
|
||||
|
||||
case C.H:
|
||||
result = diff / C.MILLISECONDS_A_HOUR;
|
||||
break;
|
||||
|
||||
case C.MIN:
|
||||
result = diff / C.MILLISECONDS_A_MINUTE;
|
||||
break;
|
||||
|
||||
case C.S:
|
||||
result = diff / C.MILLISECONDS_A_SECOND;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = diff; // milliseconds
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return _float ? result : Utils.a(result);
|
||||
};
|
||||
|
||||
_proto.daysInMonth = function daysInMonth() {
|
||||
return this.endOf(C.M).$D;
|
||||
};
|
||||
|
||||
_proto.$locale = function $locale() {
|
||||
// get locale object
|
||||
return Ls[this.$L];
|
||||
};
|
||||
|
||||
_proto.locale = function locale(preset, object) {
|
||||
if (!preset) return this.$L;
|
||||
var that = this.clone();
|
||||
var nextLocaleName = parseLocale(preset, object, true);
|
||||
if (nextLocaleName) that.$L = nextLocaleName;
|
||||
return that;
|
||||
};
|
||||
|
||||
_proto.clone = function clone() {
|
||||
return Utils.w(this.$d, this);
|
||||
};
|
||||
|
||||
_proto.toDate = function toDate() {
|
||||
return new Date(this.valueOf());
|
||||
};
|
||||
|
||||
_proto.toJSON = function toJSON() {
|
||||
return this.isValid() ? this.toISOString() : null;
|
||||
};
|
||||
|
||||
_proto.toISOString = function toISOString() {
|
||||
// ie 8 return
|
||||
// new Dayjs(this.valueOf() + this.$d.getTimezoneOffset() * 60000)
|
||||
// .format('YYYY-MM-DDTHH:mm:ss.SSS[Z]')
|
||||
return this.$d.toISOString();
|
||||
};
|
||||
|
||||
_proto.toString = function toString() {
|
||||
return this.$d.toUTCString();
|
||||
};
|
||||
|
||||
return Dayjs;
|
||||
}();
|
||||
|
||||
var proto = Dayjs.prototype;
|
||||
dayjs.prototype = proto;
|
||||
[['$ms', C.MS], ['$s', C.S], ['$m', C.MIN], ['$H', C.H], ['$W', C.D], ['$M', C.M], ['$y', C.Y], ['$D', C.DATE]].forEach(function (g) {
|
||||
proto[g[1]] = function (input) {
|
||||
return this.$g(input, g[0], g[1]);
|
||||
};
|
||||
});
|
||||
|
||||
dayjs.extend = function (plugin, option) {
|
||||
if (!plugin.$i) {
|
||||
// install plugin only once
|
||||
plugin(option, Dayjs, dayjs);
|
||||
plugin.$i = true;
|
||||
}
|
||||
|
||||
return dayjs;
|
||||
};
|
||||
|
||||
dayjs.locale = parseLocale;
|
||||
dayjs.isDayjs = isDayjs;
|
||||
|
||||
dayjs.unix = function (timestamp) {
|
||||
return dayjs(timestamp * 1e3);
|
||||
};
|
||||
|
||||
dayjs.en = Ls[L];
|
||||
dayjs.Ls = Ls;
|
||||
dayjs.p = {};
|
||||
export default dayjs;
|
||||
39
node_modules/dayjs/esm/locale/af.js
generated
vendored
Normal file
39
node_modules/dayjs/esm/locale/af.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
// Afrikaans [af]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'af',
|
||||
weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
|
||||
months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
|
||||
monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
|
||||
weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd, D MMMM YYYY HH:mm'
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'oor %s',
|
||||
past: '%s gelede',
|
||||
s: "'n paar sekondes",
|
||||
m: "'n minuut",
|
||||
mm: '%d minute',
|
||||
h: "'n uur",
|
||||
hh: '%d ure',
|
||||
d: "'n dag",
|
||||
dd: '%d dae',
|
||||
M: "'n maand",
|
||||
MM: '%d maande',
|
||||
y: "'n jaar",
|
||||
yy: '%d jaar'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
40
node_modules/dayjs/esm/locale/am.js
generated
vendored
Normal file
40
node_modules/dayjs/esm/locale/am.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
// Amharic [am]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'am',
|
||||
weekdays: 'እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'),
|
||||
weekdaysShort: 'እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'),
|
||||
weekdaysMin: 'እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ'.split('_'),
|
||||
months: 'ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር'.split('_'),
|
||||
monthsShort: 'ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም'.split('_'),
|
||||
weekStart: 1,
|
||||
yearStart: 4,
|
||||
relativeTime: {
|
||||
future: 'በ%s',
|
||||
past: '%s በፊት',
|
||||
s: 'ጥቂት ሰከንዶች',
|
||||
m: 'አንድ ደቂቃ',
|
||||
mm: '%d ደቂቃዎች',
|
||||
h: 'አንድ ሰዓት',
|
||||
hh: '%d ሰዓታት',
|
||||
d: 'አንድ ቀን',
|
||||
dd: '%d ቀናት',
|
||||
M: 'አንድ ወር',
|
||||
MM: '%d ወራት',
|
||||
y: 'አንድ ዓመት',
|
||||
yy: '%d ዓመታት'
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'MMMM D ፣ YYYY',
|
||||
LLL: 'MMMM D ፣ YYYY HH:mm',
|
||||
LLLL: 'dddd ፣ MMMM D ፣ YYYY HH:mm'
|
||||
},
|
||||
ordinal: function ordinal(n) {
|
||||
return n + "\u129B";
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
41
node_modules/dayjs/esm/locale/ar-dz.js
generated
vendored
Normal file
41
node_modules/dayjs/esm/locale/ar-dz.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// Arabic (Algeria) [ar-dz]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-dz',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
42
node_modules/dayjs/esm/locale/ar-iq.js
generated
vendored
Normal file
42
node_modules/dayjs/esm/locale/ar-iq.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Arabic (Iraq) [ar-iq]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-iq',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
41
node_modules/dayjs/esm/locale/ar-kw.js
generated
vendored
Normal file
41
node_modules/dayjs/esm/locale/ar-kw.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// Arabic (Kuwait) [ar-kw]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-kw',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
27
node_modules/dayjs/esm/locale/ar-ly.js
generated
vendored
Normal file
27
node_modules/dayjs/esm/locale/ar-ly.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Arabic (Lybia) [ar-ly]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-ly',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekStart: 6,
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'D/M/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
42
node_modules/dayjs/esm/locale/ar-ma.js
generated
vendored
Normal file
42
node_modules/dayjs/esm/locale/ar-ma.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Arabic (Morocco) [ar-ma]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-ma',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekStart: 6,
|
||||
weekdaysShort: 'احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
41
node_modules/dayjs/esm/locale/ar-sa.js
generated
vendored
Normal file
41
node_modules/dayjs/esm/locale/ar-sa.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// Arabic (Saudi Arabia) [ar-sa]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-sa',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
42
node_modules/dayjs/esm/locale/ar-tn.js
generated
vendored
Normal file
42
node_modules/dayjs/esm/locale/ar-tn.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Arabic (Tunisia) [ar-tn]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'ar-tn',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
77
node_modules/dayjs/esm/locale/ar.js
generated
vendored
Normal file
77
node_modules/dayjs/esm/locale/ar.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
// Arabic [ar]
|
||||
import dayjs from '../index';
|
||||
var months = 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_');
|
||||
var symbolMap = {
|
||||
1: '١',
|
||||
2: '٢',
|
||||
3: '٣',
|
||||
4: '٤',
|
||||
5: '٥',
|
||||
6: '٦',
|
||||
7: '٧',
|
||||
8: '٨',
|
||||
9: '٩',
|
||||
0: '٠'
|
||||
};
|
||||
var numberMap = {
|
||||
'١': '1',
|
||||
'٢': '2',
|
||||
'٣': '3',
|
||||
'٤': '4',
|
||||
'٥': '5',
|
||||
'٦': '6',
|
||||
'٧': '7',
|
||||
'٨': '8',
|
||||
'٩': '9',
|
||||
'٠': '0'
|
||||
};
|
||||
var locale = {
|
||||
name: 'ar',
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
months: months,
|
||||
monthsShort: months,
|
||||
weekStart: 6,
|
||||
meridiem: function meridiem(hour) {
|
||||
return hour > 12 ? 'م' : 'ص';
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'بعد %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثانية واحدة',
|
||||
m: 'دقيقة واحدة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة واحدة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم واحد',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر واحد',
|
||||
MM: '%d أشهر',
|
||||
y: 'عام واحد',
|
||||
yy: '%d أعوام'
|
||||
},
|
||||
preparse: function preparse(string) {
|
||||
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||||
return numberMap[match];
|
||||
}).replace(/،/g, ',');
|
||||
},
|
||||
postformat: function postformat(string) {
|
||||
return string.replace(/\d/g, function (match) {
|
||||
return symbolMap[match];
|
||||
}).replace(/,/g, '،');
|
||||
},
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'D/M/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
39
node_modules/dayjs/esm/locale/az.js
generated
vendored
Normal file
39
node_modules/dayjs/esm/locale/az.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
// Azerbaijani [az]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'az',
|
||||
weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
|
||||
weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
|
||||
weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
|
||||
months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
|
||||
monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
|
||||
weekStart: 1,
|
||||
formats: {
|
||||
LT: 'H:mm',
|
||||
LTS: 'H:mm:ss',
|
||||
L: 'DD.MM.YYYY',
|
||||
LL: 'D MMMM YYYY г.',
|
||||
LLL: 'D MMMM YYYY г., H:mm',
|
||||
LLLL: 'dddd, D MMMM YYYY г., H:mm'
|
||||
},
|
||||
relativeTime: {
|
||||
future: '%s sonra',
|
||||
past: '%s əvvəl',
|
||||
s: 'bir neçə saniyə',
|
||||
m: 'bir dəqiqə',
|
||||
mm: '%d dəqiqə',
|
||||
h: 'bir saat',
|
||||
hh: '%d saat',
|
||||
d: 'bir gün',
|
||||
dd: '%d gün',
|
||||
M: 'bir ay',
|
||||
MM: '%d ay',
|
||||
y: 'bir il',
|
||||
yy: '%d il'
|
||||
},
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
24
node_modules/dayjs/esm/locale/be.js
generated
vendored
Normal file
24
node_modules/dayjs/esm/locale/be.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// Belarusian [be]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'be',
|
||||
weekdays: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
|
||||
months: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
|
||||
monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
|
||||
weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD.MM.YYYY',
|
||||
LL: 'D MMMM YYYY г.',
|
||||
LLL: 'D MMMM YYYY г., HH:mm',
|
||||
LLLL: 'dddd, D MMMM YYYY г., HH:mm'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
55
node_modules/dayjs/esm/locale/bg.js
generated
vendored
Normal file
55
node_modules/dayjs/esm/locale/bg.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// Bulgarian [bg]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'bg',
|
||||
weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
|
||||
weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
|
||||
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
||||
months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
|
||||
monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
|
||||
weekStart: 1,
|
||||
ordinal: function ordinal(n) {
|
||||
var last2Digits = n % 100;
|
||||
|
||||
if (last2Digits > 10 && last2Digits < 20) {
|
||||
return n + "-\u0442\u0438";
|
||||
}
|
||||
|
||||
var lastDigit = n % 10;
|
||||
|
||||
if (lastDigit === 1) {
|
||||
return n + "-\u0432\u0438";
|
||||
} else if (lastDigit === 2) {
|
||||
return n + "-\u0440\u0438";
|
||||
} else if (lastDigit === 7 || lastDigit === 8) {
|
||||
return n + "-\u043C\u0438";
|
||||
}
|
||||
|
||||
return n + "-\u0442\u0438";
|
||||
},
|
||||
formats: {
|
||||
LT: 'H:mm',
|
||||
LTS: 'H:mm:ss',
|
||||
L: 'D.MM.YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY H:mm',
|
||||
LLLL: 'dddd, D MMMM YYYY H:mm'
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'след %s',
|
||||
past: 'преди %s',
|
||||
s: 'няколко секунди',
|
||||
m: 'минута',
|
||||
mm: '%d минути',
|
||||
h: 'час',
|
||||
hh: '%d часа',
|
||||
d: 'ден',
|
||||
dd: '%d дена',
|
||||
M: 'месец',
|
||||
MM: '%d месеца',
|
||||
y: 'година',
|
||||
yy: '%d години'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
39
node_modules/dayjs/esm/locale/bi.js
generated
vendored
Normal file
39
node_modules/dayjs/esm/locale/bi.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
// Bislama [bi]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'bi',
|
||||
weekdays: 'Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade'.split('_'),
|
||||
months: 'Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'San_Man_Tus_Wen_Tos_Frae_Sar'.split('_'),
|
||||
monthsShort: 'Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis'.split('_'),
|
||||
weekdaysMin: 'San_Ma_Tu_We_To_Fr_Sar'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'h:mm A',
|
||||
LTS: 'h:mm:ss A',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY h:mm A',
|
||||
LLLL: 'dddd, D MMMM YYYY h:mm A'
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'lo %s',
|
||||
past: '%s bifo',
|
||||
s: 'sam seken',
|
||||
m: 'wan minit',
|
||||
mm: '%d minit',
|
||||
h: 'wan haoa',
|
||||
hh: '%d haoa',
|
||||
d: 'wan dei',
|
||||
dd: '%d dei',
|
||||
M: 'wan manis',
|
||||
MM: '%d manis',
|
||||
y: 'wan yia',
|
||||
yy: '%d yia'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
39
node_modules/dayjs/esm/locale/bm.js
generated
vendored
Normal file
39
node_modules/dayjs/esm/locale/bm.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
// Bambara [bm]
|
||||
import dayjs from '../index';
|
||||
var locale = {
|
||||
name: 'bm',
|
||||
weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
|
||||
months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
|
||||
weekStart: 1,
|
||||
weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
|
||||
monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
|
||||
weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
|
||||
ordinal: function ordinal(n) {
|
||||
return n;
|
||||
},
|
||||
formats: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'MMMM [tile] D [san] YYYY',
|
||||
LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
|
||||
LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
|
||||
},
|
||||
relativeTime: {
|
||||
future: '%s kɔnɔ',
|
||||
past: 'a bɛ %s bɔ',
|
||||
s: 'sanga dama dama',
|
||||
m: 'miniti kelen',
|
||||
mm: 'miniti %d',
|
||||
h: 'lɛrɛ kelen',
|
||||
hh: 'lɛrɛ %d',
|
||||
d: 'tile kelen',
|
||||
dd: 'tile %d',
|
||||
M: 'kalo kelen',
|
||||
MM: 'kalo %d',
|
||||
y: 'san kelen',
|
||||
yy: 'san %d'
|
||||
}
|
||||
};
|
||||
dayjs.locale(locale, null, true);
|
||||
export default locale;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user