|
|
|
@ -371,25 +371,25 @@ export default {
|
|
|
|
// 二维码右下角的
|
|
|
|
// 二维码右下角的
|
|
|
|
that.G.roundRect1(ctx, (mycenter - 600) / 2 + 470, qrTop + 475, 136, 136, 80, baseColor);
|
|
|
|
that.G.roundRect1(ctx, (mycenter - 600) / 2 + 470, qrTop + 475, 136, 136, 80, baseColor);
|
|
|
|
// 绘制关注发单号文字
|
|
|
|
// 绘制关注发单号文字
|
|
|
|
that.G.fillTextLineBreak(ctx, "扫一扫关注我的发单号", (mycenter - "扫一扫关注我的发单号".length * 54) / 2 + 40, canvas.height - 515, "扫一扫关注我的发单号".length * 54, 58, "#333", 54, 600); // 总职位
|
|
|
|
that.G.fillTextLineBreak(ctx, "扫一扫关注我的发单号", (mycenter - "扫一扫关注我的发单号".length * 54) / 2 , canvas.height - 515, "扫一扫关注我的发单号".length * 54, 58, that.isLightColor(baseColor) ? '#333' : '#fff', 54, 600); // 总职位
|
|
|
|
|
|
|
|
|
|
|
|
that.G.drawCenteredText(ctx, mycenter, canvas.height - 300, [{ content: "该图片请不要发给工友", color: "#d30000", fontWeight: 500, fontSize: 72 }]);
|
|
|
|
that.G.drawCenteredText(ctx, mycenter, canvas.height - 300, [{ content: "该图片请不要发给工友", color: "#d30000", fontWeight: 500, fontSize: 72 }]);
|
|
|
|
that.G.drawCenteredText(ctx, mycenter, canvas.height - 200, [{ content: "关注后能直接看到单子的代理费/佣金", color: "#333", fontWeight: 500, fontSize: 48 }]);
|
|
|
|
that.G.drawCenteredText(ctx, mycenter, canvas.height - 200, [{ content: "关注后能直接看到单子的代理费/佣金", color: "#333", fontWeight: 500, fontSize: 48 }]);
|
|
|
|
|
|
|
|
|
|
|
|
// 绘制头像背景色
|
|
|
|
// 绘制头像背景色
|
|
|
|
that.G.roundRect_yuan(ctx, (mycenter - 360) / 2, 110, 360, "#ffffff");
|
|
|
|
that.G.roundRect_yuan(ctx, (mycenter - 360) / 2, 110, 360, "#ffffff");
|
|
|
|
uni.getImageInfo({
|
|
|
|
// uni.getImageInfo({
|
|
|
|
src: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/phone.png", // 手机图标图片
|
|
|
|
// src: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/phone.png", // 手机图标图片
|
|
|
|
success(res) {
|
|
|
|
// success(res) {
|
|
|
|
const img = canvas.createImage();
|
|
|
|
// const img = canvas.createImage();
|
|
|
|
console.log("res333", res);
|
|
|
|
// console.log("res333", res);
|
|
|
|
img.src = res.path;
|
|
|
|
// img.src = res.path;
|
|
|
|
img.onload = () => {
|
|
|
|
// img.onload = () => {
|
|
|
|
that.G.roundRect(ctx, img, (mycenter - 800) / 2 + 100, canvas.height - 565, 70, 70, 0);
|
|
|
|
// that.G.roundRect(ctx, img, (mycenter - 800) / 2 + 100, canvas.height - 565, 70, 70, 0);
|
|
|
|
resolve(true);
|
|
|
|
resolve(true);
|
|
|
|
};
|
|
|
|
// };
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fail(err) {
|
|
|
|
fail(err) {
|
|
|
|
@ -469,6 +469,22 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 判断颜色是浅色还是深色
|
|
|
|
|
|
|
|
isLightColor(hexColor, threshold = 180) {
|
|
|
|
|
|
|
|
hexColor = hexColor.replace("#", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hexColor.length === 3) {
|
|
|
|
|
|
|
|
hexColor = hexColor[0] + hexColor[0] + hexColor[1] + hexColor[1] + hexColor[2] + hexColor[2];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const r = parseInt(hexColor.substring(0, 2), 16);
|
|
|
|
|
|
|
|
const g = parseInt(hexColor.substring(2, 4), 16);
|
|
|
|
|
|
|
|
const b = parseInt(hexColor.substring(4, 6), 16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return brightness > threshold;
|
|
|
|
|
|
|
|
},
|
|
|
|
// 设置分享布局
|
|
|
|
// 设置分享布局
|
|
|
|
setShareJobImg(ctx, canvas, mycenter, funObj) {
|
|
|
|
setShareJobImg(ctx, canvas, mycenter, funObj) {
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
|