Commit c6f9ca33 by 李伟康

提交代码

1 parent b3292252
......@@ -62,7 +62,8 @@ export default {
carText = '',
labelList = ['姓名:', '手机:'],
spacing = 0,
textYList = []
textYList = [],
labelEndX = 80
const draw = new Draw(this, {
width: canvasWidth,
height: canvasHeight
......@@ -82,19 +83,19 @@ export default {
}
labelList = [...labelList, '商品名称:', '支付时间:']
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (formContentFirst) {
labelList.push(formDescribeFirst)
valueList.push(formContentFirst)
}
if (formContentSecond) {
labelList.push(formDescribeSecond)
valueList.push(formContentSecond)
}
// if (formContentFirst) {
// labelList.push(formDescribeFirst)
// valueList.push(formContentFirst)
// }
// if (formContentSecond) {
// labelList.push(formDescribeSecond)
// valueList.push(formContentSecond)
// }
labelList.push('支付定金')
valueList.push(`${payPrice}元`)
labelList.map((e, index) => {
if (e == '商品名称:' && draw.getTextWidth(carText, fontSize) + valueX > valueEndX) spacing = 24
if (e == formDescribeSecond && draw.getTextWidth(formContentFirst, fontSize) + valueX > valueEndX) spacing += 24
if ((e == formDescribeSecond && draw.getTextWidth(formContentFirst, fontSize) + valueX > valueEndX) || (draw.getTextWidth(formDescribeFirst, fontSize) + labelX > labelEndX)) spacing += 24
if (index == labelList.length - 1) textYList.push(452)
else textYList.push(index * 32 + 109 + spacing)
})
......@@ -135,7 +136,7 @@ export default {
if ((formDescribeFirst && e === formDescribeFirst) || (formDescribeSecond && e === formDescribeSecond)) {
label.lineNum = 2
label.lineHeight = 24
label.width = 80
label.width = labelEndX
}
}
if (e === '支付定金') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!