ZBLOG

if (item.code === loan'){ for(const loan of item.child){const Index= loan.path.split('.')[1]let contractCode; me.overDueInfoIndexloan.pathl=Index const child overduePeriod = loan.child.find(val =>val.code === "overduePeriod") //loanCharacter值为Y的时候...

您提供的代码片段似乎是不完整的,并且包含了一些语法错误和不一致之处。我可以帮助您修正这些问题或补充内容。以下是一个简化并整理后的示例,尝试保持原意,同时改正一些语法错误:

if (item.code === 'loan') {
    for (const loan of item.child) {
        const index = loan.path.split('.')[1];
        let contractCode;
        me.overDueInfoIndex[loan.path] = index;

        const childOverduePeriod = loan.child.find(val => val.code === "overduePeriod");
        
        // 隐藏 totalPaymentAmount 当 loanCharacter 值为 Y 时
        const childLoanCharacter = loan.child.find(val => val.code === "loanCharacter");
        
        if (childLoanCharacter && childLoanCharacter.value === "Y") {
            Object.assign(authMapLoan, { totalPaymentAmount: "productLine" });
        }

        const childProductLine = loan.child.find(val => val.code === "productLine");

        if (childProductLine && !childProductLine.ifVirtual) {
            Object.assign(authMapLoan, { installmentLoanAmount: /* appropriate value */ });
            
            const productLine = childProductLine.line;
            const indexIsRolloverWhite = loan.child.findIndex(val => val.code === 'isRolloverWhite');

            // 处理子元素
            loan.child = loan.child.reduce((arr, child) => {
                // 逾期天数
                if (child.code == 'overduePeriod') {
                    // 如果 title 中有括号,则替换掉
                    if (child.title.includes("(") && child.title.includes(")")) {
                        child.title = child.title.replace('(', '(').replace(')', ')');
                    }
                    
                    // 逾期天数为0时入催状态后面加上(无欠款)
                    if (child.code == 'loanStatus' && childOverduePeriod && childOverduePeriod.value == '0') {
                        child.valueMap[child.value] += `(${lang('NO DEBT')})`;
                    }
                }

                // 记录合同号
                if (child.code === 'contractCode') {
                    contractCode = child.value;
                    me.loanPathContractCodes[loan.path] = child.value;
                }

                // 控制展示逻辑
                if (child.code === 'allowCollNextPayment' && !child.value) return arr;

                const DEFAULT_SHOW = !(child.code in authMapLoan);
                const AUTH_SHOW = (child.code in authMapLoan) && canI(authMapLoan[child.code]);

                if (DEFAULT_SHOW || AUTH_SHOW) {
                    arr.push(child);
                }
                
                return arr;
            }, []);
        }
    }
}

请根据您的具体需求调整上述代码。确保在实际使用中,这段代码符合您的逻辑和数据结构。如果有特定的问题或者功能需要实现,请告诉我,我会尽力帮助您!


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:http://sdn.0voice.com/?id=7585

分享:
扫描分享到社交APP
val.code === "overduePeriod") //loanCharacter值为Y的时候...&appkey=&pic=&searchPic=true")' title="分享到新浪微博" class="weibo"> val.code === "overduePeriod") //loanCharacter值为Y的时候...")' title="分享到QQ好友" class="qq"> val.code === "overduePeriod") //loanCharacter值为Y的时候...")' title="分享到QQ空间" class="qqzone">
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?