123456789101112131415 |
- import currency from "../../../utils/currency";
- let CNY = value => currency(value, {
- symbol: "¥",
- precision: 2
- }).format();
- function getPrice(price, w, l, divide) {
- return CNY(CNY(currency(price).multiply(w).multiply(l).divide(divide)))
- }
- module.exports = {
- getItem: (item, showname = 'showPrice', pname = 'price', divide = 1000000) => {
- item[showname] = getPrice(item[pname], item.width, item.length, divide)
- return item
- }
- }
|