- 引入decimal.js提升金额计算精度 - 重构成本计算方法,明确区分各类费用构成 - 优化采购预览界面,增加计算明细展示 - 改进开票信息展示样式和计算公式说明 - 完善纸箱重量和销售金额的精确计算 - 调整界面布局,提升用户体验和信息可读性 - 修复成本项过滤逻辑,确保数据准确性 - 新增快速导航功能,便于页面内快速定位 - 更新图标资源,支持计算器和指南针图标 - 优化数字格式化处理,统一保留合适的小数位数
77 lines
1.4 KiB
TypeScript
77 lines
1.4 KiB
TypeScript
import { View, type ViewProps } from "@tarojs/components";
|
|
import classNames from "classnames";
|
|
import React from "react";
|
|
|
|
export type IconNames =
|
|
| "calculator"
|
|
| "compass"
|
|
| "eye"
|
|
| "eye-slash"
|
|
| "phone-flip"
|
|
| "address-book"
|
|
| "pen-to-square"
|
|
| "location-dot"
|
|
| "clock"
|
|
| "user-tie"
|
|
| "receipt"
|
|
| "file-signature"
|
|
| "chart-line"
|
|
| "chart-pie"
|
|
| "right-left"
|
|
| "circle-check"
|
|
| "bell"
|
|
| "chart-bar"
|
|
| "user-switch"
|
|
| "circle-question"
|
|
| "key"
|
|
| "arrow-right-from-bracket"
|
|
| "house"
|
|
| "check"
|
|
| "comment-dots"
|
|
| "circle-xmark"
|
|
| "phone"
|
|
| "weight-scale"
|
|
| "minus"
|
|
| "clipboard-list"
|
|
| "folder"
|
|
| "file-invoice"
|
|
| "camera"
|
|
| "id-card"
|
|
| "truck"
|
|
| "credit-card"
|
|
| "lock"
|
|
| "money-bill"
|
|
| "chevron-right"
|
|
| "circle-info"
|
|
| "user"
|
|
| "chevron-down"
|
|
| "plus"
|
|
| "chevron-left";
|
|
|
|
interface IconProps extends ViewProps {
|
|
name: IconNames;
|
|
size?: number;
|
|
color?: string;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
const icon: React.FC<IconProps> = (props) => {
|
|
const { name, size, color = "var(--color-primary)" } = props;
|
|
const rootStyle = {
|
|
fontSize: Number.isInteger(size)
|
|
? `calc(var(--scale-factor) * ${size}px)`
|
|
: "calc(var(--text-xs) * 2)",
|
|
color,
|
|
};
|
|
|
|
return (
|
|
<View
|
|
{...props}
|
|
className={classNames(`iconfont icon-${name}`, props.className)}
|
|
style={rootStyle}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default icon;
|