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 () {