12345678910111213141516171819202122232425262728293031 |
- // lionfish_comshop/components/orderInfo/index.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- orderInfo: {
- type: Object,
- observer: function (t) {
- let real_total = t.real_total * 1;
- let total = t.total * 1;
- var goodsTotal = parseFloat(real_total) - parseFloat(t.shipping_fare);
-
- let disAmount = parseFloat(t.voucher_credit) + parseFloat(t.fullreduction_money);
- disAmount = (disAmount > goodsTotal) ? goodsTotal : disAmount;
- this.setData({
- goodsTotal: goodsTotal.toFixed(2),
- disAmount: disAmount.toFixed(2)
- });
- }
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- disAmount: 0,
- goodsTotal: 0
- }
- })
|