diff --git a/app.json b/app.json index 5feb4cc..82bf67a 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,5 @@ { - "pages":[ + "pages": [ "pages/login/index", "pages/index/index", "pages/home/user-info/index", @@ -67,8 +67,8 @@ ] } ], - "window":{ - "backgroundTextStyle":"light", + "window": { + "backgroundTextStyle": "light", "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "", @@ -79,4 +79,4 @@ }, "workers": "workers", "sitemapLocation": "sitemap.json" -} +} \ No newline at end of file diff --git a/pages/agent/order-detail/item-money-info/index.js b/pages/agent/order-detail/item-money-info/index.js index 08fc25f..0e26a7a 100644 --- a/pages/agent/order-detail/item-money-info/index.js +++ b/pages/agent/order-detail/item-money-info/index.js @@ -1,4 +1,6 @@ // pages/agent/detail/money-info/money-info.js +const math = require('../../../../utils/math') + Component({ options: { addGlobalClass: true, @@ -8,7 +10,81 @@ Component({ * 组件的属性列表 */ properties: { - orderInfo: { type: Object, value: null }, - item: { type: Object, value: null } + orderInfo: { + type: Object, + value: null + }, + item: { + type: Object, + value: null + } + }, + /** + * 组件的初始数据 + */ + data: { + isShowtotalOtherAmount: true, + firstMoneyStringTip: '', + secondMoneyStringTip: '' + }, + //组件的生命周期 + lifetimes: { + attached: function () { + // 在组件实例进入页面节点树时执行 + if (this.data.item.otherAmountDtoList.length) { + this.data.item.otherAmountDtoList.forEach(element => { + if (element.amount != null && element.amount != 0) { + this.setData({ + isShowtotalOtherAmount: false + }) + } + }) + } + //首笔货款金额tiptip提示 + var firstFkbl = (this.data.item.activitySettleType == 0 ? '(×首付70%)' : (this.data.item.activitySettleType == 1 ? '(×首付85%)' : (this.data.item.activitySettleType == 2 ? '(×首付100%)' : ''))) + var firstLeft = '预估总金额' + firstFkbl + '-代码费总额' + + var rightFkbl = (this.data.item.activitySettleType == 0 ? '70%' : (this.data.item.activitySettleType == 1 ? '85%' : '100%')) + var rightJsdj = (math.times(this.data.item.unitPrice, 1000) + '元/吨') + var rightJsjz = (math.divide(this.data.item.weightnoteInfo.netWeight, 1000) + '吨') + var rightDmf = this.data.item.unitSurcharge > 0 ? ('-' + math.times(this.data.item.unitSurcharge, 1000) + '元/吨') : (this.data.item.unitSurcharge < 0 ? math.times(this.data.item.unitSurcharge, 1000) + '元/吨' : '') + var rightJz = math.times(this.data.item.unitSurcharge, 1000) + '吨' + this.setData({ + firstMoneyStringTip: firstLeft + '=' + rightJsdj + '×' + rightJsjz + '×' + rightFkbl + rightDmf + '×' + rightJz + }) + //尾款金额toptip提示 + var secondLeft = '结算单价x结算重量-首笔货款金额' + firstFkbl + '+' + (this.data.isShowtotalOtherAmount == false ? '纸厂补贴与扣款' : '') + '+返还补贴+调节费' + if (this.data.item.unitPrice) { + var secondJsdj = (math.times(this.data.item.unitPrice, 1000) + '元/吨') + } else { + var secondJsdj = '0' + } + if (this.data.item.weightnoteInfo.settleWeight) { + var secondJszl = (math.divide(this.data.item.weightnoteInfo.settleWeight, 1000) + '吨') + } else { + var secondJszl = '0' + } + if (this.data.item.weightnoteInfo.netWeight) { + var secondJsjz = (math.divide(this.data.item.weightnoteInfo.netWeight, 1000) + '吨') + } else { + var secondJsjz = '0' + } + if (this.data.item.preSettleMoney) { + var secondSbhkje = this.data.item.preSettleMoney > 0 ? '+' + this.data.item.preSettleMoney : this.data.item.preSettleMoney + } else { + var secondSbhkje = '+0元' + } + var secondzcbtykk = (this.data.isShowtotalOtherAmount == true ? '' : (this.data.item.totalOtherAmount > 0 ? '+' + this.data.item.totalOtherAmount : '' + this.data.item.totalOtherAmount)) + '元' + if (this.data.item.unitRefundSubsidy) { + var secondbtdj = (math.times(this.data.item.unitRefundSubsidy, 1000) + '元/吨') + } else { + var secondbtdj = '0元/吨' + } + + var secondfhbt = (this.data.itemrefundSubsidy == 0 ? '' : (this.data.itemrefundSubsidy > 0 ? '+' + this.data.itemrefundSubsidy : (this.data.itemrefundSubsidy < 0 ? this.data.itemrefundSubsidy : '0'))) + '元' + this.setData({ + secondMoneyStringTip: secondLeft + '=' + secondJsdj + '×' + secondJszl + secondSbhkje + secondzcbtykk + '+' + secondbtdj + '×' + secondJsjz + '+' + secondfhbt + }) + } } -}) +}) \ No newline at end of file diff --git a/pages/agent/order-detail/item-money-info/index.json b/pages/agent/order-detail/item-money-info/index.json index 2df1db8..4112756 100644 --- a/pages/agent/order-detail/item-money-info/index.json +++ b/pages/agent/order-detail/item-money-info/index.json @@ -1,7 +1,6 @@ { "component": true, "usingComponents": { - "van-popover": "/components/popover/index", - "van-icon": "/components/icon/index" + "van-popover": "/components/popover/index" } } \ No newline at end of file diff --git a/pages/agent/order-detail/item-money-info/index.wxml b/pages/agent/order-detail/item-money-info/index.wxml index 0516f99..38e5a15 100644 --- a/pages/agent/order-detail/item-money-info/index.wxml +++ b/pages/agent/order-detail/item-money-info/index.wxml @@ -1,22 +1,23 @@ + 首款信息 预计总金额 - {{formate.formateAmount(item.preTotalMoney)}}元 + {{formate.formateAmount(item.preTotalMoney)}}元 结算单价 x 净重 - {{formate.formatePrice(item.unitPrice)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.netWeight)}}吨 + {{formate.formatePrice2(item.unitPrice)}} x + {{formate.formateWeight3(item.weightnoteInfo.netWeight)}} 首笔应收金额 - {{formate.formateAmount(item.prepayMoney)}}元 + {{formate.formateAmount(item.prepayMoney)}}元 预估总金额 x {{agent.getActivitySettleType(orderInfo.activitySettleType)}} @@ -24,18 +25,22 @@ {{agent.getActivitySettleType(orderInfo.activitySettleType)}} - 代卖费 - {{formate.formateAmount(item.proxyAmount) || 0}}元 + 代卖费总额 + {{formate.formateAmount(item.proxyAmount) || 0}}元 代卖费单价 x 净重 - {{formate.formatePrice(item.unitSurcharge)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.netWeight)}}吨 + {{formate.formatePrice2(item.unitSurcharge)}} x + {{formate.formateWeight3(item.weightnoteInfo.netWeight)}} - - 首笔实收金额: - {{formate.formateAmount(item.preSettleMoney)}}元 + + 首笔货款金额: + + + {{formate.formateAmount(item.preSettleMoney)}}元 + + + @@ -44,48 +49,48 @@ 尾款信息 未结算金额 - {{formate.formateAmount(item.unSettleMoney)}}元 + {{formate.formateAmount(item.unSettleMoney)}}元 单价 x 结算重量 - 首笔应收金额 - {{formate.formatePrice(item.unitPrice)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.settleWeight)}}吨 - + {{formate.formatePrice2(item.unitPrice)}} x + {{formate.formateWeight3(item.weightnoteInfo.settleWeight)}} - {{formate.formateAmount(item.prepayMoney)}}元 单价 x 净重 - 首笔应收金额 - {{formate.formatePrice(item.unitPrice)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.netWeight)}}吨 - + {{formate.formatePrice2(item.unitPrice)}} x + {{formate.formateWeight3(item.weightnoteInfo.netWeight)}} - {{formate.formateAmount(item.prepayMoney)}}元 - - - 补贴与扣款 + + 纸厂补贴与扣款 {{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元 + + 返还补贴 + {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 + + + 调节费 + {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 + - 尾款实收金额: - {{formate.formateAmount(item.finalPayMoney)}}元 + 尾款金额: + + + {{formate.formateAmount(item.finalPayMoney)}}元 + + + - + @@ -97,45 +102,46 @@ 结算单价 x 结算重量 - {{formate.formatePrice(item.weightnoteInfo.settleUtiPrice)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.settleWeight)}}吨 + {{formate.formatePrice2(item.weightnoteInfo.settleUtiPrice)}} x + {{formate.formateWeight(item.weightnoteInfo.settleWeight)}} - 代卖费 - {{formate.formateAmount(item.surcharge) || 0}}元 + 代卖费总额 + {{formate.formateAmount(item.surcharge) || 0}}元 代卖费单价 x 结算重量 - {{formate.formatePrice(item.unitSurcharge==null?0:item.unitSurcharge)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.settleWeight)}}吨 + {{formate.formatePrice2(item.unitSurcharge==null?0:item.unitSurcharge)}} x + {{formate.formateWeight(item.weightnoteInfo.settleWeight)}} 代卖费单价 x 净重 - {{formate.formatePrice(item.unitSurcharge)}}元/吨 x - {{formate.formateWeight(item.weightnoteInfo.netWeight)}}吨 + {{formate.formatePrice2(item.unitSurcharge)}} x + {{formate.formateWeight(item.weightnoteInfo.netWeight)}} - + - 补贴与扣款 + wx:if="{{isShowtotalOtherAmount==false}}"> + 纸厂补贴与扣款 {{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元 + + + 返还补贴 + {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 + + + 补贴单价单价 x 结算重量 + {{formate.formatePrice2(item.unitRefundSubsidy==null?0:item.unitRefundSubsidy)}} x + {{formate.formateWeight(item.weightnoteInfo.settleWeight)}} + + + 调节费 + {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 + 总收款金额: - {{formate.formateAmount(item.weightnoteInfo.settlePrice)}}元 - - - - - - ContentContentContentContentContentConteContentContentContentContentContentConteContentContentCon - - - \ No newline at end of file diff --git a/pages/formate.wxs b/pages/formate.wxs index 934e432..0e8ab90 100644 --- a/pages/formate.wxs +++ b/pages/formate.wxs @@ -66,6 +66,10 @@ function formateWeight(weight) { return (parseFloat(weight) / 1000).toFixed(1) } +function formateWeight3 (value) { + return (parseFloat(value) / 1000).toFixed(1) + '吨' +} + function formatePrice(weight) { return (parseFloat(weight) * 1000).toFixed(0) } @@ -124,10 +128,19 @@ function formateDescripe (value) { return '- -' } +function formatePrice2 (value) { + if (value || value == 0) { + return (parseFloat(value) * 1000).toFixed(1) + '元/吨' + } + return '' +} + module.exports = { numberFormat: numberFormat, formateAmount: formateAmount, formatePrice: formatePrice, + formatePrice2: formatePrice2, + formateWeight3: formateWeight3, formateWeight: formateWeight, formatTime: formatTime, formateDate: formateDate, diff --git a/pages/home/user-info/index.wxml b/pages/home/user-info/index.wxml index b7f968d..459aea7 100644 --- a/pages/home/user-info/index.wxml +++ b/pages/home/user-info/index.wxml @@ -15,8 +15,7 @@ 实名制认证 - {{userInfo.isAuth == 1 ? '已认证' : - '未实名认证'}} + {{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}} 去认证