Commit 7290b389 by 姜雷

修改星期显示

parent ccabf1e5
...@@ -21,8 +21,7 @@ export function parseTime(time, cFormat) { ...@@ -21,8 +21,7 @@ export function parseTime(time, cFormat) {
}; };
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]; let value = formatObj[key];
if (key === 'a') if (key === 'a') return ['日', '一', '二', '三', '四', '五', '六'][value];
return ['一', '二', '三', '四', '五', '六', '日'][value - 1];
if (result.length > 0 && value < 10) { if (result.length > 0 && value < 10) {
value = '0' + value; value = '0' + value;
} }
...@@ -358,8 +357,9 @@ export const formatterMoneyToDouble = val => { ...@@ -358,8 +357,9 @@ export const formatterMoneyToDouble = val => {
export const formatPrice = price => { export const formatPrice = price => {
var result = [], var result = [],
counter = 0; counter = 0;
price = (price || 0).toString().split(''); price = (price || 0).toFixed(2).split('');
for (var i = price.length - 1; i >= 0; i--) { result.push(price.slice(-3).join(''));
for (var i = price.length - 4; i >= 0; i--) {
counter++; counter++;
result.unshift(price[i]); result.unshift(price[i]);
if (!(counter % 3) && i != 0) { if (!(counter % 3) && i != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment