File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
views/mall/home/components Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ export const fenToYuan = (price: string | number): string => {
313
313
*/
314
314
export const calculateRelativeRate = ( value ?: number , reference ?: number ) => {
315
315
// 防止除0
316
- if ( ! reference ) return 0
316
+ if ( ! reference || reference == 0 ) return 0
317
317
318
318
return ( ( 100 * ( ( value || 0 ) - reference ) ) / reference ) . toFixed ( 0 )
319
319
}
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ const getOrderCountTrendComparison = async (
186
186
dates .push (item .value .date )
187
187
if (series .length === 2 ) {
188
188
series [0 ].data .push (fenToYuan (item ?.value ?.orderPayPrice || 0 )) // 当前金额
189
- series [1 ].data .push (fenToYuan ( item ?.value ?.orderPayCount || 0 ) ) // 当前数量
189
+ series [1 ].data .push (item ?.value ?.orderPayCount || 0 ) // 当前数量
190
190
} else {
191
191
series [0 ].data .push (fenToYuan (item ?.reference ?.orderPayPrice || 0 )) // 对照金额
192
192
series [1 ].data .push (fenToYuan (item ?.value ?.orderPayPrice || 0 )) // 当前金额
You can’t perform that action at this time.
0 commit comments