Browse Source

ztb

feature/v1.6
xpz2018 4 years ago
parent
commit
174b00cf67
6 changed files with 169 additions and 76 deletions
  1. 8
      app.json
  2. 82
      pages/agent/order-detail/item-money-info/index.js
  3. 3
      pages/agent/order-detail/item-money-info/index.json
  4. 136
      pages/agent/order-detail/item-money-info/index.wxml
  5. 13
      pages/formate.wxs
  6. 3
      pages/home/user-info/index.wxml

8
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"
}
}

82
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
})
}
}
})
})

3
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"
}
}

136
pages/agent/order-detail/item-money-info/index.wxml

@ -1,22 +1,23 @@
<!--pages/agent/detail/money-info/money-info.wxml-->
<wxs module="agent" src="../../../agent/index.wxs"></wxs>
<wxs module="formate" src="../../../../pages/formate.wxs"></wxs>
<!-- 预付款 -->
<view class="bg-white" style="padding: 24rpx 30rpx;margin-top:16rpx"
wx:if="{{item.activityOrderAuditPassNum!=null&&item.activityOrderAuditPassNum >= 1}}">
<view class="text-df text-gray" style="solid #f3f3f3;padding-bottom:24rpx">首款信息</view>
<view class="flex flex-justify text-sg">
<text class="text-black">预计总金额</text>
<text style="color:#F5222D">{{formate.formateAmount(item.preTotalMoney)}}元</text>
<text style="">{{formate.formateAmount(item.preTotalMoney)}}元</text>
</view>
<view class="flex flex-justify text-sm" style="margin-top:2rpx">
<text class="text-gray">结算单价 x 净重</text>
<view class="text-gray">{{formate.formatePrice(item.unitPrice)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.netWeight)}}</view>
<view class="text-gray">{{formate.formatePrice2(item.unitPrice)}} x
{{formate.formateWeight3(item.weightnoteInfo.netWeight)}}</view>
</view>
<view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx">
<text class="text-black">首笔应收金额</text>
<text style="color:#F5222D">{{formate.formateAmount(item.prepayMoney)}}元</text>
<text style="">{{formate.formateAmount(item.prepayMoney)}}元</text>
</view>
<view class="flex flex-justify text-sm" style="margin-top:2rpx">
<text class="text-gray">预估总金额 x {{agent.getActivitySettleType(orderInfo.activitySettleType)}}</text>
@ -24,18 +25,22 @@
{{agent.getActivitySettleType(orderInfo.activitySettleType)}}</view>
</view>
<view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx">
<text class="text-black">代卖费</text>
<text style="color:#F5222D">{{formate.formateAmount(item.proxyAmount) || 0}}元</text>
<text class="text-black">代卖费总额</text>
<text style="">{{formate.formateAmount(item.proxyAmount) || 0}}元</text>
</view>
<view class="flex flex-justify text-sm" style="margin-top:2rpx" wx:if="{{item.proxySellerSettleType==0}}">
<text class="text-gray">代卖费单价 x 净重</text>
<view class="text-gray">{{formate.formatePrice(item.unitSurcharge)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.netWeight)}}</view>
<view class="text-gray">{{formate.formatePrice2(item.unitSurcharge)}} x
{{formate.formateWeight3(item.weightnoteInfo.netWeight)}}</view>
</view>
<view class="flex text-sg"
style="justify-content: flex-end;margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black text-bold">首笔实收金额:</text>
<text class="text-gray" style="color:#F5222D">{{formate.formateAmount(item.preSettleMoney)}}元</text>
<view class="flex text-sg" style="justify-content: flex-end;margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black text-bold">首笔货款金额:</text>
<van-popover placement="topRight" content="{{firstMoneyStringTip}}" body-style="width: 684rpx;">
<view style="flex flex-center">
<text class="text-gray" style="color:#F5222D">{{formate.formateAmount(item.preSettleMoney)}}元</text>
<text class="cuIcon-question text-gray" style="font-size:36rpx"></text>
</view>
</van-popover>
</view>
</view>
<!-- 尾款 只有活动订单才会有这个字段,并且这个字段=2表示第二次审核了 -->
@ -44,48 +49,48 @@
<view class="text-df text-gray" style="solid #f3f3f3;padding-bottom:24rpx">尾款信息</view>
<view class="flex flex-justify text-sg">
<text class="text-black">未结算金额</text>
<text style="color:#F5222D">{{formate.formateAmount(item.unSettleMoney)}}元</text>
<text style="">{{formate.formateAmount(item.unSettleMoney)}}元</text>
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx" wx:if="{{item.proxySellerSettleType==1}}">
<text class="text-gray">单价 x 结算重量 - 首笔应收金额</text>
<view class="text-gray">{{formate.formatePrice(item.unitPrice)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}} -
<view class="text-gray">{{formate.formatePrice2(item.unitPrice)}} x
{{formate.formateWeight3(item.weightnoteInfo.settleWeight)}} -
{{formate.formateAmount(item.prepayMoney)}}元</view>
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx" wx:if="{{item.proxySellerSettleType==0}}">
<text class="text-gray">单价 x 净重 - 首笔应收金额</text>
<view class="text-gray">{{formate.formatePrice(item.unitPrice)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.netWeight)}} -
<view class="text-gray">{{formate.formatePrice2(item.unitPrice)}} x
{{formate.formateWeight3(item.weightnoteInfo.netWeight)}} -
{{formate.formateAmount(item.prepayMoney)}}元</view>
</view>
<!-- <view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx"
wx:if="{{item.adjustMoney && item.adjustMoney != 0}}">
<text class="text-black">调节费</text>
<text style="color:#F5222D">-{{formate.formateAmount(item.adjustMoney)}}元</text>
</view> -->
<view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black">补贴与扣款</text>
<view wx:if="{{isShowtotalOtherAmount==false}}" class="flex flex-justify text-sg"
style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black">纸厂补贴与扣款</text>
<text style="color:#F5222D">{{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元</text>
</view>
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx"
wx:if="{{item.refundSubsidy!=null&&item.refundSubsidy!=0}}">
<text class="text-black">返还补贴</text>
<text style="">{{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元</text>
</view>
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx"
wx:if="{{item.adjustMoney}}">
<text class="text-black">调节费</text>
<text style="">{{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元</text>
</view>
<view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black text-bold">尾款实收金额:</text>
<text style="color:#F5222D">{{formate.formateAmount(item.finalPayMoney)}}元</text>
<text class="text-black text-bold">尾款金额:</text>
<van-popover placement="topRight" content="{{secondMoneyStringTip}}" body-style="width: 684rpx;">
<view style="flex flex-center">
<text class="text-gray" style="color:#F5222D">{{formate.formateAmount(item.finalPayMoney)}}元</text>
<text class="cuIcon-question text-gray" style="font-size:36rpx"></text>
</view>
</van-popover>
</view>
<view class="flex flex-justify text-sg" style=";margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<!-- <view class="flex flex-justify text-sg" style=";margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:24rpx">
<text class="text-black text-bold">总收款金额:</text>
<view class="flex">
<text style="color:#F5222D">{{formate.formateAmount(item.finalSettlePrice)}}元</text>
<van-popover placement="topRight" mask="{{true}}">
<view style="padding-right:18rpx">
<van-icon name="question-o" size="30px" />
</view>
<view slot="content" style="max-width:640rpx;padding:24rpx">
<text
style="word-wrap: break-word;word-break: break-all;white-space: pre-line">ContentContentContentContentContentConteContentContentContentContentContentConteContentContentCon</text>
</view>
</van-popover>
</view>
</view>
<text style="color:#F5222D">{{formate.formateAmount(item.finalSettlePrice)}}元</text>
</view> -->
</view>
</view>
<!-- 全款 非活动订单,或者一次性付款的活动订单 , 在待审核和待结算,已完成下 , 显示全款信息, -->
@ -97,45 +102,46 @@
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx">
<text class="text-gray">结算单价 x 结算重量</text>
<view class="text-gray">{{formate.formatePrice(item.weightnoteInfo.settleUtiPrice)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}}</view>
<view class="text-gray">{{formate.formatePrice2(item.weightnoteInfo.settleUtiPrice)}} x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}}</view>
</view>
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx">
<text class="text-black">代卖费</text>
<text style="color:#F5222D">{{formate.formateAmount(item.surcharge) || 0}}元</text>
<text class="text-black">代卖费总额</text>
<text style="">{{formate.formateAmount(item.surcharge) || 0}}元</text>
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx" wx:if="{{item.proxySellerSettleType==1}}">
<text class="text-gray">代卖费单价 x 结算重量</text>
<view class="text-gray">{{formate.formatePrice(item.unitSurcharge==null?0:item.unitSurcharge)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}}</view>
<view class="text-gray">{{formate.formatePrice2(item.unitSurcharge==null?0:item.unitSurcharge)}} x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}}</view>
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx" wx:elif="{{item.proxySellerSettleType==0}}">
<text class="text-gray">代卖费单价 x 净重</text>
<view class="text-gray">{{formate.formatePrice(item.unitSurcharge)}}元/吨 x
{{formate.formateWeight(item.weightnoteInfo.netWeight)}}</view>
<view class="text-gray">{{formate.formatePrice2(item.unitSurcharge)}} x
{{formate.formateWeight(item.weightnoteInfo.netWeight)}}</view>
</view>
<!-- <view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx"
wx:if="{{item.adjustMoney && item.adjustMoney}}">
<text class="text-black">调节费</text>
<text style="color:#F5222D">{{item.adjustMoney > 0 ? '+' : ''}}{{formate.formateAmount(item.adjustMoney)}}元</text>
</view> -->
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx"
wx:if="{{item.adjustMoney && item.adjustMoney}}">
<text class="text-black">补贴与扣款</text>
wx:if="{{isShowtotalOtherAmount==false}}">
<text class="text-black">纸厂补贴与扣款</text>
<text style="">{{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元</text>
</view>
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx" wx:if="{{item.refundSubsidy!=null&&item.refundSubsidy!=0}}">
<text class="text-black">返还补贴</text>
<text style="">{{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元</text>
</view>
<view class="flex flex-justify text-xs" style="margin-top:2rpx">
<text class="text-gray">补贴单价单价 x 结算重量</text>
<view class="text-gray">{{formate.formatePrice2(item.unitRefundSubsidy==null?0:item.unitRefundSubsidy)}} x
{{formate.formateWeight(item.weightnoteInfo.settleWeight)}}</view>
</view>
<view class="flex flex-justify text-sg" style="margin-top:20rpx;border-top:2rpx solid #f3f3f3;padding-top:16rpx"
wx:if="{{item.adjustMoney}}">
<text class="text-black">调节费</text>
<text style="">{{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元</text>
</view>
<view class="flex flex-justify text-sg" style="margin-top:24rpx;border-top:2rpx solid #f3f3f3;padding-top:20rpx">
<text class="text-black text-bold">总收款金额:</text>
<view class="flex">
<text style="color:#F5222D">{{formate.formateAmount(item.weightnoteInfo.settlePrice)}}元</text>
<van-popover placement="topRight" mask="{{true}}">
<view style="margin-left:12rpx">
<van-icon name="question-o" size="40rpx" />
</view>
<view slot="content" style="max-width:640rpx;padding:24rpx">
<text style="word-wrap: break-word;word-break: break-all;white-space: pre-line">ContentContentContentContentContentConteContentContentContentContentContentConteContentContentCon</text>
</view>
</van-popover>
</view>
</view>
</view>

13
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,

3
pages/home/user-info/index.wxml

@ -15,8 +15,7 @@
<view slot="title" class="flex flex-justify">
<view class="text-black">实名制认证</view>
<view class="flex flex-center">
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' :
'未实名认证'}}</text>
<text class="{{userInfo.isAuth == 1 ? 'text-blue' : 'text-gray'}}">{{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}}</text>
<text class="text-sg" wx:if="{{userInfo.isAuth != 1 && userInfo.userType == 1}}">去认证</text>
</view>
</view>

Loading…
Cancel
Save