// pages/agent/detail/pound-info/pound-info.js Component({ options: { addGlobalClass: true, multipleSlots: true }, /** * 组件的属性列表 */ properties: { orderInfo: { type: Object, value: null }, item: { type: Object, value: null } }, //组件的生命周期 lifetimes: { created: function () { // 在组件实例刚刚被创建时执行 }, attached: function () { // 在组件实例进入页面节点树时执行 // console.log(this.data.item) this.data.item.otherAmountDtoList.forEach(element => { if (element.amount != null&&element.amount!=0) { this.setData({ isShowtotalOtherAmount: false }) } }); }, detached: function () { // 在组件实例被从页面节点树移除时执行 }, }, /** * 组件的初始数据 */ data: { isShowtotalOtherAmount: true, }, /** * 组件的方法列表 */ methods: { } })