|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="p-root-sharejob g_w_all g_bg_f_5" hover-class="none" hover-stop-propagation="false">
|
|
|
|
|
<scroll-view class="m-list" id="listBox" :style="{ height: `calc(${navInfo.windowHeight}px)` }" :scroll-y="true" @scrolltolower="reachBottom">
|
|
|
|
|
<scroll-view class="m-list" id="listBox" :style="{ height: `calc(100vh - 74px)` }" :scroll-y="true" @scrolltolower="reachBottom">
|
|
|
|
|
<!-- <div class="g_kuaishou"> -->
|
|
|
|
|
<div>
|
|
|
|
|
<div class="sticky g_bg_f">
|
|
|
|
|
@ -410,6 +410,7 @@ export default {
|
|
|
|
|
title: item.jobName,
|
|
|
|
|
address: item.district + item.age,
|
|
|
|
|
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
|
|
|
|
|
salaryClassifyValue: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : "月薪",
|
|
|
|
|
logo: item.agencyLogo,
|
|
|
|
|
time: that.G.setDeadLine(item.updateTime, "jiaofu"),
|
|
|
|
|
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
|
|
|
|
|
@ -432,6 +433,8 @@ export default {
|
|
|
|
|
title: item.jobName,
|
|
|
|
|
address: item.district + item.age,
|
|
|
|
|
price: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : that.G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
|
|
|
|
|
salaryClassifyValue: item.salaryClassify != 7 ? that.G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : "月薪",
|
|
|
|
|
|
|
|
|
|
logo: item.agencyLogo,
|
|
|
|
|
time: that.G.setDeadLine(item.updateTime, "jiaofu"),
|
|
|
|
|
fuWuFei: that.G.setReturnFee(item.returnFee, item.returnFeeType),
|
|
|
|
|
@ -448,6 +451,8 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("that.query.list", that.query.list);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
goCity() {
|
|
|
|
|
@ -549,7 +554,7 @@ export default {
|
|
|
|
|
getCode() {
|
|
|
|
|
var that = this;
|
|
|
|
|
let _env = uni.getAccountInfoSync().miniProgram.envVersion;
|
|
|
|
|
console.log('_env',_env);
|
|
|
|
|
console.log("_env", _env);
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
// if (this.checkedList.length == 1) {
|
|
|
|
|
// that.G.Get(that.api.get_singlejob_QRcode + `/${that.checkedList[0].id}`, {}, (res) => {
|
|
|
|
|
@ -560,7 +565,7 @@ export default {
|
|
|
|
|
// } else {
|
|
|
|
|
that.G.Get(that.api.get_job_QRcode, { storeJobIds: that.checkedList.map((item) => item.id).join(","), env: _env }, (res) => {
|
|
|
|
|
console.log("get_job_QRcode", res);
|
|
|
|
|
that.currCode = res.qrcode;
|
|
|
|
|
that.currCode = res;
|
|
|
|
|
resolve();
|
|
|
|
|
});
|
|
|
|
|
// }
|
|
|
|
|
@ -606,64 +611,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}).then(() => {
|
|
|
|
|
const fillTextLineBreak = (ctx, text, x, y, lw, lh, color = "#333", font = "32", weight = "500") => {
|
|
|
|
|
var i = 0;
|
|
|
|
|
var n = 0;
|
|
|
|
|
var r = -1;
|
|
|
|
|
var initHeight = 0;
|
|
|
|
|
ctx.font = weight + " " + font + "px Arial"; //字体大小
|
|
|
|
|
console.log("text", text);
|
|
|
|
|
ctx.fillStyle = color; //字体颜色
|
|
|
|
|
while (i < text.length) {
|
|
|
|
|
while (ctx.measureText(text.substring(n, i)).width < lw && i < text.length) {
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
r++;
|
|
|
|
|
ctx.fillText(text.substring(n, i), x, y + lh * r);
|
|
|
|
|
n = i;
|
|
|
|
|
}
|
|
|
|
|
initHeight = lh * r;
|
|
|
|
|
// uni.setStorageSync("initHeight", initHeight);
|
|
|
|
|
};
|
|
|
|
|
const roundRect = (ctx, img, bg_x, bg_y, bg_w, bg_h, bg_r) => {
|
|
|
|
|
// 开始绘制
|
|
|
|
|
ctx.save();
|
|
|
|
|
ctx.beginPath();
|
|
|
|
|
ctx.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5);
|
|
|
|
|
ctx.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2);
|
|
|
|
|
ctx.arc(bg_x + bg_w - bg_r, bg_y + bg_h - bg_r, bg_r, 0, Math.PI * 0.5);
|
|
|
|
|
ctx.arc(bg_x + bg_r, bg_y + bg_h - bg_r, bg_r, Math.PI * 0.5, Math.PI);
|
|
|
|
|
ctx.clip();
|
|
|
|
|
ctx.drawImage(img, bg_x, bg_y, bg_w, bg_h);
|
|
|
|
|
// 恢复之前保存的绘图上下文
|
|
|
|
|
ctx.restore();
|
|
|
|
|
};
|
|
|
|
|
const roundRect_yuan = (ctx, x, y, size) => {
|
|
|
|
|
// 开始绘制
|
|
|
|
|
ctx.save(); // 保存
|
|
|
|
|
ctx.beginPath(); // 开始绘制
|
|
|
|
|
// ctx.arc(100, 75, 50, 0, 2 * Math.PI)
|
|
|
|
|
ctx.arc(size / 2 + x, size / 2 + y, size / 2, 0, Math.PI * 2, false);
|
|
|
|
|
ctx.clip();
|
|
|
|
|
// 恢复之前保存的绘图上下文
|
|
|
|
|
ctx.restore();
|
|
|
|
|
};
|
|
|
|
|
function roundRect1(ctx, x, y, w, h, r, color) {
|
|
|
|
|
//绘制圆角矩形(无填充色))
|
|
|
|
|
ctx.save();
|
|
|
|
|
ctx.fillStyle = color;
|
|
|
|
|
ctx.strokeStyle = color;
|
|
|
|
|
ctx.lineJoin = "round"; //交点设置成圆角
|
|
|
|
|
ctx.lineWidth = r;
|
|
|
|
|
ctx.strokeRect(x + r / 2, y + r / 2, w - r, h - r);
|
|
|
|
|
ctx.fillRect(x + r, y + r, w - r * 2, h - r * 2);
|
|
|
|
|
ctx.stroke();
|
|
|
|
|
ctx.closePath();
|
|
|
|
|
}
|
|
|
|
|
//使用:
|
|
|
|
|
console.log(canvas);
|
|
|
|
|
if (type == "setJob") {
|
|
|
|
|
this.setShareJobImg(ctx, canvas, { roundRect1, roundRect_yuan, roundRect, fillTextLineBreak })
|
|
|
|
|
this.setShareJobImg(ctx, canvas)
|
|
|
|
|
.then(function (canvas1) {
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
canvas: canvas1,
|
|
|
|
|
@ -796,7 +747,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
_G.fillTextLineBreak(ctx, "丨" + item.age, logoLeft + ctx.measureText(item.district).width, baseTop + ageTop + baseMiddle * index, 500 * 2, 20, "#333", monthlyPaySize); // 年龄
|
|
|
|
|
|
|
|
|
|
_G.fillTextLineBreak(ctx, that.appInfo.fullName || that.appInfo.agencyName, mycenter - ctx.measureText(that.appInfo.fullName || that.appInfo.agencyName).width / 2, fubiaotiTop, 400 * 2, 20, "#fff", monthlyPaySize, "600"); // 代理名称
|
|
|
|
|
_G.fillTextLineBreak(ctx, that.userInfo.fullName || that.userInfo.agencyName, mycenter - ctx.measureText(that.userInfo.fullName || that.userInfo.agencyName).width / 2, fubiaotiTop, 400 * 2, 20, "#fff", monthlyPaySize, "600"); // 代理名称
|
|
|
|
|
|
|
|
|
|
if (that.checkedList.length == 1) {
|
|
|
|
|
// roundRect1(ctx, mycenter - 600 / 2, baseTop + 750, 600, 560, 32, "#fff");
|
|
|
|
|
@ -864,23 +815,29 @@ export default {
|
|
|
|
|
salaryClassifyValueTop = 10;
|
|
|
|
|
monthlyPaySize = 32;
|
|
|
|
|
console.log(123);
|
|
|
|
|
that.checkedList.forEach((item, index) => {
|
|
|
|
|
try {
|
|
|
|
|
that.checkedList.forEach((item, index) => {
|
|
|
|
|
if (index <= 2) {
|
|
|
|
|
let labelLeft = 0;
|
|
|
|
|
console.log("item1", item);
|
|
|
|
|
_G.roundRect1(ctx, 32, baseTop - 60 + baseMiddle * index, 776, roundRectHeight, 24, "#fff");
|
|
|
|
|
_G.fillTextLineBreak(ctx, item.jobName, logoLeft, baseTop + baseMiddle * index, 800, 20, "#333", titleSize, "500"); // 岗位标题
|
|
|
|
|
_G.fillTextLineBreak(ctx, item.cus_price == "月薪" ? item.monthlyPay : item.salaryClassifyValue, salaryClassifyValueLeft + 500, baseTop - 10 + salaryClassifyValueTop + baseMiddle * index, 400, 20, "#ff4400", titleSize - 4, "600"); // 时薪
|
|
|
|
|
// 薪资位置更新(保留副本)
|
|
|
|
|
// _G.fillTextLineBreak(ctx, item.cus_price == "月薪" ? item.monthlyPay : item.salaryClassifyValue, salaryClassifyValueLeft + 500, baseTop - 10 + salaryClassifyValueTop + baseMiddle * index, 400, 20, "#ff4400", titleSize - 4, "600"); // 时薪
|
|
|
|
|
_G.fillTextLineBreak(ctx, item.cus_price == "月薪" ? item.monthlyPay : item.salaryClassifyValue, canvas.width - ctx.measureText(item.cus_price == "月薪" ? item.monthlyPay : item.salaryClassifyValue).width - 40 , baseTop + ageTop + baseMiddle * index, 400, 20, "#ff4400", titleSize - 4, "600"); // 时薪
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// _G.fillTextLineBreak(ctx, item.monthlyPay, salaryClassifyValueLeft + ctx.measureText(item.salaryClassifyValue + " ").width, baseTop + salaryClassifyValueTop + baseMiddle * index, 400 , 20, "#ff4400", monthlyPaySize, "400"); // 月工资
|
|
|
|
|
// }, 0);
|
|
|
|
|
_G.fillTextLineBreak(ctx, item.district, logoLeft, baseTop + ageTop + baseMiddle * index, 500, 20, "#999", monthlyPaySize); // 省市
|
|
|
|
|
_G.fillTextLineBreak(ctx, item.age, logoLeft + ctx.measureText(item.district).width, baseTop + ageTop + baseMiddle * index, 500, 20, "#999", monthlyPaySize); // 年龄
|
|
|
|
|
_G.fillTextLineBreak(ctx, "丨" + item.age, logoLeft + ctx.measureText(item.district).width, baseTop + ageTop + baseMiddle * index, 500, 20, "#999", monthlyPaySize); // 年龄
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
imgres(canvas);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log('error',error);
|
|
|
|
|
}
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// },500);
|
|
|
|
|
imgres(canvas);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
saveToalbum() {
|
|
|
|
|
|