Browse Source

分享海报调整样式

lifanagju_citu 2 months ago
parent
commit
098dff88f6
1 changed files with 7 additions and 7 deletions
  1. 7 7
      pagesB/jobFair/jobFairEntShare.vue

+ 7 - 7
pagesB/jobFair/jobFairEntShare.vue

@@ -49,7 +49,7 @@ const getEntPositionList = async () => {
   }
   try {
     const params = {
-      pageSize: 2, 
+      pageSize: 3, 
       pageNo: 1,
       jobFairId,
       enterpriseId,
@@ -145,8 +145,8 @@ const createPoster = async () => {
 
   // 企业头像
   context.save()
-  const secondImgWidth = 80
-  const secondImgHeight = 80
+  const secondImgWidth = 120
+  const secondImgHeight = 120
   const x = (540 - secondImgWidth) / 2
   const y = 788 - secondImgHeight - 460
   context.beginPath()
@@ -158,7 +158,7 @@ const createPoster = async () => {
   
   // 企业名称
   const maxTextWidth = 400
-  const fontStyle = 'bold 18px Arial'
+  const fontStyle = 'bold 24px Arial'
   context.font = fontStyle
   let truncatedText = entName
   while (context.measureText(truncatedText + '...').width > maxTextWidth && truncatedText.length > 0) {
@@ -174,8 +174,8 @@ const createPoster = async () => {
   const tagPaddingLeftRight = 20
   const tagPaddingTopBottom = 10
   const tagRadius = 8
-  const tagSpacing = 30
-  let tagY = textY + tagSpacing
+  const tagSpacing = 22
+  let tagY = textY + tagSpacing + 10
   positionNameList.forEach((tag) => {
     let truncatedTag = tag
     while (context.measureText(truncatedTag + '...').width > maxTextWidth - 2 * tagPaddingLeftRight && truncatedTag.length > 0) {
@@ -200,7 +200,7 @@ const createPoster = async () => {
     context.closePath()
     context.fill()
 
-    context.font = '16px Arial'
+    context.font = '18px Arial'
     context.fillStyle = '#fff'
     context.fillText(truncatedTag, tagX + tagPaddingLeftRight, tagY + tagPaddingTopBottom + 10)