|
@@ -11,8 +11,8 @@
|
|
<span v-else class="salary w-600">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
|
|
<span v-else class="salary w-600">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
|
|
</view>
|
|
</view>
|
|
<!-- 职位地区 收藏职位 -->
|
|
<!-- 职位地区 收藏职位 -->
|
|
- <view class="d-flex justify-space-between mt-5 align-baseline">
|
|
|
|
- <view style="font-size: 14px;">
|
|
|
|
|
|
+ <view class="d-flex justify-space-between mt-5 align-center">
|
|
|
|
+ <view style="font-size: 14px; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 30px;">
|
|
<span>
|
|
<span>
|
|
<span>{{positionInfo?.area?.str ?? '全国' }}</span>
|
|
<span>{{positionInfo?.area?.str ?? '全国' }}</span>
|
|
<span class="viewider-mx" v-if="positionInfo?.eduName">|</span>
|
|
<span class="viewider-mx" v-if="positionInfo?.eduName">|</span>
|
|
@@ -22,7 +22,7 @@
|
|
</span>
|
|
</span>
|
|
</view>
|
|
</view>
|
|
<!-- 收藏职位 -->
|
|
<!-- 收藏职位 -->
|
|
- <view @click="handleCollection">
|
|
|
|
|
|
+ <view @click="handleCollection" style="width: 36px;">
|
|
<uni-icons
|
|
<uni-icons
|
|
:type="isCollection ? 'heart-filled' : 'heart'"
|
|
:type="isCollection ? 'heart-filled' : 'heart'"
|
|
color="#fc6d5e"
|
|
color="#fc6d5e"
|
|
@@ -304,9 +304,11 @@ const getImageTempRatio = (url) => {
|
|
maxLine:最多绘制的行数
|
|
maxLine:最多绘制的行数
|
|
**/
|
|
**/
|
|
//处理文字多出省略号显示
|
|
//处理文字多出省略号显示
|
|
|
|
+const enterpriseNameLines = ref(0)
|
|
const dealWords = (ctx, fontSize, text, maxWidth, x, y, maxLine, isEnterpriseName) => {
|
|
const dealWords = (ctx, fontSize, text, maxWidth, x, y, maxLine, isEnterpriseName) => {
|
|
ctx.setFontSize(fontSize);//设置字体大小
|
|
ctx.setFontSize(fontSize);//设置字体大小
|
|
var allRow = Math.ceil(ctx.measureText(text).width / maxWidth);//实际总共能分多少行
|
|
var allRow = Math.ceil(ctx.measureText(text).width / maxWidth);//实际总共能分多少行
|
|
|
|
+ enterpriseNameLines.value = allRow
|
|
var count = allRow >= maxLine ? maxLine : allRow;//实际能分多少行与设置的最大显示行数比,谁小就用谁做循环次数
|
|
var count = allRow >= maxLine ? maxLine : allRow;//实际能分多少行与设置的最大显示行数比,谁小就用谁做循环次数
|
|
var endPos = 0;//当前字符串的截断点
|
|
var endPos = 0;//当前字符串的截断点
|
|
for (var j = 0; j < count; j++) {
|
|
for (var j = 0; j < count; j++) {
|
|
@@ -327,7 +329,7 @@ const dealWords = (ctx, fontSize, text, maxWidth, x, y, maxLine, isEnterpriseNam
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//如果当前的字符串宽度小于最大宽度就直接输出
|
|
//如果当前的字符串宽度小于最大宽度就直接输出
|
|
- ctx.fillText(nowStr.slice(0), x, (isEnterpriseName ? y + 20 : y) + (j + 1) * 30);
|
|
|
|
|
|
+ ctx.fillText(nowStr.slice(0), x, (isEnterpriseName ? y + 2 : y) + (j + 1) * 30);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -348,10 +350,9 @@ const createPoster = async () => {
|
|
|
|
|
|
// 工作地区、工作经验、学历要求
|
|
// 工作地区、工作经验、学历要求
|
|
context.setFillStyle('#6c6e7b')
|
|
context.setFillStyle('#6c6e7b')
|
|
- context.setFontSize(20)
|
|
|
|
const area = areaName.value + ' | '
|
|
const area = areaName.value + ' | '
|
|
const combinationText = area + (positionInfo.value.expName || '') + (positionInfo.value.eduName ? ' | ' + positionInfo.value.eduName : '')
|
|
const combinationText = area + (positionInfo.value.expName || '') + (positionInfo.value.eduName ? ' | ' + positionInfo.value.eduName : '')
|
|
- context.fillText(combinationText, 40, 130)
|
|
|
|
|
|
+ dealWords(context, 20, combinationText, 350, 40, 100, 1) // 上下文、字号、文本、最大宽度、x、y、行数
|
|
|
|
|
|
// 薪资
|
|
// 薪资
|
|
context.setFontSize(22)
|
|
context.setFontSize(22)
|
|
@@ -380,7 +381,8 @@ const createPoster = async () => {
|
|
// 企业行业类型、规模
|
|
// 企业行业类型、规模
|
|
context.setFontSize(20)
|
|
context.setFontSize(20)
|
|
let industry = industryName && industryName.length > 6 ? `${industryName.slice(0, 7)}...` : industryName
|
|
let industry = industryName && industryName.length > 6 ? `${industryName.slice(0, 7)}...` : industryName
|
|
- context.fillText(`${industry || ''}${scaleName ? ' | ' + scaleName : ''}`, 150, 310)
|
|
|
|
|
|
+ context.setFillStyle('#6c6e7b')
|
|
|
|
+ context.fillText(`${industry || ''}${scaleName ? ' | ' + scaleName : ''}`, 150, enterpriseNameLines.value === 1 ? 280 : 310)
|
|
|
|
|
|
context.draw(false, () =>{
|
|
context.draw(false, () =>{
|
|
wx.canvasToTempFilePath({
|
|
wx.canvasToTempFilePath({
|