Commit c6f9ca33 by 李伟康

提交代码

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