From 9c438f7fb55ec63a884515afe62bcc3c5cc47cf9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-A1SENDA\\HUzy" <472860318@qq.com> Date: Mon, 31 May 2021 18:39:33 +0800 Subject: [PATCH] ----- --- .../agent/detail/item-money-info/money-info.js | 16 +++++++++------- pages/agent/detail/pound-info/pound-info.js | 17 ++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/pages/agent/detail/item-money-info/money-info.js b/pages/agent/detail/item-money-info/money-info.js index 7da8f41..bac3976 100644 --- a/pages/agent/detail/item-money-info/money-info.js +++ b/pages/agent/detail/item-money-info/money-info.js @@ -36,13 +36,15 @@ Component({ attached: function () { // 在组件实例进入页面节点树时执行 // console.log(this.data.item) - this.data.item.otherAmountDtoList.forEach(element => { - if (element.amount != null&&element.amount!=0) { - this.setData({ - isShowtotalOtherAmount: false - }) - } - }); + if(this.data.item.otherAmountDtoList.length){ + this.data.item.otherAmountDtoList.forEach(element => { + if (element.amount != null&&element.amount!=0) { + this.setData({ + isShowtotalOtherAmount: false + }) + } + }); + } console.log(this.data) console.log(this.data.isShowtotalOtherAmount) //首笔货款金额tiptip提示 diff --git a/pages/agent/detail/pound-info/pound-info.js b/pages/agent/detail/pound-info/pound-info.js index 60e88ac..cba385a 100644 --- a/pages/agent/detail/pound-info/pound-info.js +++ b/pages/agent/detail/pound-info/pound-info.js @@ -19,13 +19,16 @@ Component({ attached: function () { // 在组件实例进入页面节点树时执行 // console.log(this.data.item) - this.data.item.otherAmountDtoList.forEach(element => { - if (element.amount != null&&element.amount!=0) { - this.setData({ - isShowtotalOtherAmount: false - }) - } - }); + if(this.data.item.otherAmountDtoList.length){ + this.data.item.otherAmountDtoList.forEach(element => { + if (element.amount != null&&element.amount!=0) { + this.setData({ + isShowtotalOtherAmount: false + }) + } + }); + } + }, detached: function () {