javascript - Questions about calculating the total price of different products
女神的闺蜜爱上我2017-06-08 11:02:08
0
4
910
Now there are different products with different calculation formulas, such as product A, the calculation formula is: quantity X duration X unit price. Product B: unit price * quantity. Please store the calculation formula and match it by yourself.
Give each product a flag directly, and then save the company in turn. When matching, you only need to match the flag to find the formula.
Constructor, determines the execution content based on the parameters passed in
If it is product A
No result will be returned