es6-template-literals-nested
&es6-template-literals-condition
orderGift += `
<div class="order-gift cut-line">
<div class="title">
<span class="gf-lf">赠豆</span>
<span class="gf-rt">${parseFloat(dadouoff).toFixed(2)}</span>
</div>
${
totalReduceMoney
?
`
<div class="title">
<span class="gf-lf">满减</span>
<span class="gf-rt">${parseFloat(totalReduceMoney).toFixed(2)}</span>
</div>
`
:
``
}
<div class="money">
<span class="gf-lf">订单金额</span>
<span class="gf-rt">${parseFloat(sum).toFixed(2)}</span>
</div>
</div>
`;
MDN links
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/template_strings