|
@@ -84,14 +84,14 @@ export function loadScript(url, callback) {
|
|
script.async = true;
|
|
script.async = true;
|
|
script.defer = true;
|
|
script.defer = true;
|
|
if (script.readyState) {
|
|
if (script.readyState) {
|
|
- script.onreadystatechange = function () {
|
|
|
|
|
|
+ script.onreadystatechange = function() {
|
|
if (script.readyState === 'loaded' || script.readyState === 'complete') {
|
|
if (script.readyState === 'loaded' || script.readyState === 'complete') {
|
|
script.onreadystatechange = null;
|
|
script.onreadystatechange = null;
|
|
if (callback) callback();
|
|
if (callback) callback();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
} else {
|
|
} else {
|
|
- script.onload = function () {
|
|
|
|
|
|
+ script.onload = function() {
|
|
if (callback) callback();
|
|
if (callback) callback();
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -313,14 +313,17 @@ function _formatMoney(s, n) {
|
|
for (let i = 0; i < l.length; i += 1) {
|
|
for (let i = 0; i < l.length; i += 1) {
|
|
t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? ',' : '');
|
|
t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? ',' : '');
|
|
}
|
|
}
|
|
- return `${t.split('').reverse().join('')}.${r} `;
|
|
|
|
|
|
+ return `${t
|
|
|
|
+ .split('')
|
|
|
|
+ .reverse()
|
|
|
|
+ .join('')}.${r} `;
|
|
}
|
|
}
|
|
|
|
|
|
export function formatMoney(price) {
|
|
export function formatMoney(price) {
|
|
if (typeof price === 'object') {
|
|
if (typeof price === 'object') {
|
|
return `${price.symbol} ${_formatMoney(price.value, 2)} `;
|
|
return `${price.symbol} ${_formatMoney(price.value, 2)} `;
|
|
}
|
|
}
|
|
- return `¥${_formatMoney(price, 2)} `;
|
|
|
|
|
|
+ return `${_formatMoney(price, 2)} `;
|
|
}
|
|
}
|
|
|
|
|
|
export function bindTags(targetList, field, render, def, notFound) {
|
|
export function bindTags(targetList, field, render, def, notFound) {
|
|
@@ -455,7 +458,7 @@ export function randomList(length) {
|
|
|
|
|
|
export function sortListWithOrder(target, order) {
|
|
export function sortListWithOrder(target, order) {
|
|
const list = [];
|
|
const list = [];
|
|
- order.forEach((t) => {
|
|
|
|
|
|
+ order.forEach(t => {
|
|
list.push(target[t]);
|
|
list.push(target[t]);
|
|
});
|
|
});
|
|
return list;
|
|
return list;
|