|
|
|
|
@ -75,17 +75,17 @@
|
|
|
|
|
<slot>
|
|
|
|
|
<view class="g_flex_row_center">
|
|
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
|
|
<g-button btnText="扫一扫" size="small" type="default" @clickBtn="handleOpenCamera"></g-button>
|
|
|
|
|
<g-button btnText="保存图片" class="g_ml_16" size="small" type="primary" @clickBtn="saveAppImageCanvas"></g-button>
|
|
|
|
|
<rh-button primaryColor='#00b666' btnText="扫一扫" size="small" type="default" @clickBtn="handleOpenCamera"></rh-button>
|
|
|
|
|
<rh-button primaryColor='#00b666' btnText="保存图片" class="g_ml_16" size="small" type="primary" @clickBtn="saveAppImageCanvas"></rh-button>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef H5 -->
|
|
|
|
|
<g-button btnText="保存图片" size="small" type="primary" @clickBtn="saveH5ImageCanvas"></g-button>
|
|
|
|
|
<rh-button primaryColor='#00b666' btnText="保存图片" size="small" type="primary" @clickBtn="saveH5ImageCanvas"></rh-button>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
|
|
<g-button btnText="保存图片" size="small" type="default" @clickBtn="saveWXImageToAlbum"></g-button>
|
|
|
|
|
<g-button btnText="直接转发" class="g_ml_16" size="small" openType="share" type="primary"></g-button>
|
|
|
|
|
<rh-button primaryColor='#00b666' btnText="保存图片" size="small" type="default" @clickBtn="saveWXImageToAlbum"></rh-button>
|
|
|
|
|
<rh-button primaryColor='#00b666' btnText="直接转发" class="g_ml_16" size="small" openType="share" type="primary"></rh-button>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
</view>
|
|
|
|
|
</slot>
|
|
|
|
|
@ -165,15 +165,15 @@ export default {
|
|
|
|
|
lifetimes: {
|
|
|
|
|
// 组件生命周期函数,在组件实例被从页面节点树移除时执行
|
|
|
|
|
detached() {
|
|
|
|
|
console.log("detacheddetacheddetacheddetacheddetached");
|
|
|
|
|
// console.log("detacheddetacheddetacheddetacheddetached");
|
|
|
|
|
uni.removeStorageSync("poster_img");
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
shareJobImg(newValue, oldValue) {
|
|
|
|
|
console.log("shareJobImg123", newValue);
|
|
|
|
|
// console.log("shareJobImg123", newValue);
|
|
|
|
|
if (newValue) {
|
|
|
|
|
console.log("shareJobImg345", newValue);
|
|
|
|
|
// console.log("shareJobImg345", newValue);
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -190,7 +190,7 @@ export default {
|
|
|
|
|
type: 1,
|
|
|
|
|
},
|
|
|
|
|
(res) => {
|
|
|
|
|
console.log("recommendList", res);
|
|
|
|
|
// console.log("recommendList", res);
|
|
|
|
|
that.appInfo = res;
|
|
|
|
|
reso();
|
|
|
|
|
}
|
|
|
|
|
@ -199,7 +199,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
let that = this;
|
|
|
|
|
console.log("that.appInfo", that.appInfo);
|
|
|
|
|
// console.log("that.appInfo", that.appInfo);
|
|
|
|
|
// #ifdef APP-PLUS || MP-KUAISHOU
|
|
|
|
|
let _env = "app";
|
|
|
|
|
// #endif
|
|
|
|
|
@ -215,14 +215,14 @@ export default {
|
|
|
|
|
env: _env,
|
|
|
|
|
},
|
|
|
|
|
(res) => {
|
|
|
|
|
console.log("获取邀请码:", res);
|
|
|
|
|
// console.log("获取邀请码:", res);
|
|
|
|
|
that.wxCode = "https://daotian.matripe.com.cn" + res.qrcode;
|
|
|
|
|
that.agencyName = res.agencyName;
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
console.log("canvasRes1");
|
|
|
|
|
// console.log("canvasRes1");
|
|
|
|
|
|
|
|
|
|
that.getWXCanvas("https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/canvasBg.png").then((canvasRes) => {
|
|
|
|
|
console.log("canvasRes", canvasRes);
|
|
|
|
|
// console.log("canvasRes", canvasRes);
|
|
|
|
|
that.shareJobImg = canvasRes.tempFilePath;
|
|
|
|
|
that.allowClick = true;
|
|
|
|
|
that.$emit("setImg", that.shareJobImg);
|
|
|
|
|
@ -252,7 +252,7 @@ export default {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
that.allowClick = true;
|
|
|
|
|
that.getAppCanvas("https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/canvasBg.png");
|
|
|
|
|
console.log("canvasRes12");
|
|
|
|
|
// console.log("canvasRes12");
|
|
|
|
|
// #endif
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
@ -344,8 +344,8 @@ export default {
|
|
|
|
|
size: true,
|
|
|
|
|
})
|
|
|
|
|
.exec((res) => {
|
|
|
|
|
console.log("uni 获取节点信息:", res);
|
|
|
|
|
// console.log("sharelImg", sharelImg);
|
|
|
|
|
// console.log("uni 获取节点信息:", res);
|
|
|
|
|
// // console.log("sharelImg", sharelImg);
|
|
|
|
|
const canvas = res[0].node;
|
|
|
|
|
const ctx = canvas.getContext("2d");
|
|
|
|
|
new Promise(function (resolve) {
|
|
|
|
|
@ -353,14 +353,14 @@ export default {
|
|
|
|
|
uni.getImageInfo({
|
|
|
|
|
src: sharelImg, // 网络图片
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res111", res);
|
|
|
|
|
// console.log("res111", res);
|
|
|
|
|
canvas.width = res.width;
|
|
|
|
|
canvas.height = res.height + 250;
|
|
|
|
|
mycenter = canvas.width;
|
|
|
|
|
myheight = canvas.height;
|
|
|
|
|
const img = canvas.createImage();
|
|
|
|
|
img.src = res.path;
|
|
|
|
|
console.log("img111", img);
|
|
|
|
|
// console.log("img111", img);
|
|
|
|
|
img.onload = (info) => {
|
|
|
|
|
// 绘制背景色
|
|
|
|
|
that.G.roundRect1(ctx, 0, 0, canvas.width, canvas.height + 250, 0, baseColor);
|
|
|
|
|
@ -368,7 +368,7 @@ export default {
|
|
|
|
|
that.G.roundRect1(ctx, (mycenter - canvas.width + 120) / 2, 280, canvas.width - 120, canvas.height - 360, 180, "#fff");
|
|
|
|
|
// 绘制关注发单号背景色
|
|
|
|
|
that.G.roundRect1(ctx, (mycenter - 800) / 2, canvas.height - 600, 800, 136, 135, baseColor);
|
|
|
|
|
let qrTop = 1195;
|
|
|
|
|
let qrTop = 1145;
|
|
|
|
|
// 二维码左上角的
|
|
|
|
|
that.G.roundRect1(ctx, (mycenter - 600) / 2 - 5, qrTop, 136, 136, 80, baseColor);
|
|
|
|
|
// 二维码右上角的
|
|
|
|
|
@ -389,7 +389,7 @@ export default {
|
|
|
|
|
// src: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/phone.png", // 手机图标图片
|
|
|
|
|
// success(res) {
|
|
|
|
|
// const img = canvas.createImage();
|
|
|
|
|
// console.log("res333", res);
|
|
|
|
|
// // console.log("res333", res);
|
|
|
|
|
// img.src = res.path;
|
|
|
|
|
// img.onload = () => {
|
|
|
|
|
// that.G.roundRect(ctx, img, (mycenter - 800) / 2 + 100, canvas.height - 565, 70, 70, 0);
|
|
|
|
|
@ -400,18 +400,18 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
console.log("errerrerrerrerrerrerr", err);
|
|
|
|
|
// console.log("errerrerrerrerrerrerr", err);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}).then(() => {
|
|
|
|
|
//使用:
|
|
|
|
|
this.setShareJobImg(ctx, canvas, mycenter)
|
|
|
|
|
.then(function (canvas1) {
|
|
|
|
|
console.log("canvas1", canvas1);
|
|
|
|
|
// console.log("canvas1", canvas1);
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
canvas: canvas1,
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res222", res);
|
|
|
|
|
// console.log("res222", res);
|
|
|
|
|
resolve(res);
|
|
|
|
|
},
|
|
|
|
|
fail(res) {
|
|
|
|
|
@ -518,19 +518,19 @@ export default {
|
|
|
|
|
src: that.wxCode,
|
|
|
|
|
success(res) {
|
|
|
|
|
const img = canvas.createImage();
|
|
|
|
|
console.log("res333", res);
|
|
|
|
|
// console.log("res333", res);
|
|
|
|
|
img.src = res.path;
|
|
|
|
|
img.onload = () => {
|
|
|
|
|
that.G.roundRect(ctx, img, (mycenter - 600) / 2, 1200, 600, 600, 35);
|
|
|
|
|
that.G.roundRect(ctx, img, (mycenter - 600) / 2, 1150, 600, 600, 35);
|
|
|
|
|
let info = that.appInfo;
|
|
|
|
|
console.log("info", info);
|
|
|
|
|
// console.log("info", info);
|
|
|
|
|
if (!info.logo) {
|
|
|
|
|
info.logo = "https://matripe-cms.oss-cn-beijing.aliyuncs.com/ibocai/defaultAvatar.png";
|
|
|
|
|
}
|
|
|
|
|
uni.getImageInfo({
|
|
|
|
|
src: info.logo,
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res444", res);
|
|
|
|
|
// console.log("res444", res);
|
|
|
|
|
const img = canvas.createImage();
|
|
|
|
|
img.src = res.path;
|
|
|
|
|
img.onload = () => {
|
|
|
|
|
@ -541,11 +541,11 @@ export default {
|
|
|
|
|
that.G.roundRect(ctx, img, (mycenter - 300) / 2, 140, 300, 300, 150); // logo
|
|
|
|
|
that.G.fillTextLineBreak(ctx, info.fullName, (mycenter - info.fullName.length * 80) / 2, 600, info.fullName.length * 80, 200, "#333", 80, 600, "left"); // 企业名称
|
|
|
|
|
|
|
|
|
|
that.G.fillTextLineBreak(ctx, `【${info.fullName}】新一代发单号(小程序),海量职位每日更新,线上报名方便快捷,工单状态实时查看。`, numBase - 25, 870, mycenter - 260, 86, "#666", 56, 500, "center"); // slogan
|
|
|
|
|
that.G.fillTextLineBreak(ctx, `【${info.fullName}】新一代发单号(小程序),海量职位每日更新,线上报名方便快捷,工单状态实时查看。`, numBase - 25, 800, mycenter - 260, 86, "#666", 56, 500, "center"); // slogan
|
|
|
|
|
// that.G.fillTextLineBreak(ctx, info.agencyDesp, numBase - 35, 870, mycenter - 260, 86, "#666", 56, 500, "center"); // slogan
|
|
|
|
|
|
|
|
|
|
// that.G.fillTextLineBreak(ctx, "今日更新职位" + info.jobUpdateNum, 140, 400, ("今日更新职位" + info.jobUpdateNum).length * 56, 56, "#999", 56, 500, "left"); // 今日更新职位
|
|
|
|
|
console.log("that.formatNumberAdvanced(info.jobNum)", that.formatNumberAdvanced(info.jobNum));
|
|
|
|
|
// console.log("that.formatNumberAdvanced(info.jobNum)", that.formatNumberAdvanced(info.jobNum));
|
|
|
|
|
const textSegments = [
|
|
|
|
|
// { content: that.formatNumberAdvanced(info.jobNum).toString(), color: "#000", fontWeight: 500, fontSize: 80, space: info.jobNum < 10000 ? 10 : 0 },
|
|
|
|
|
// info.jobNum < 10000 ? null : { content: "万", color: "#000", fontWeight: 500, fontSize: 64, space: 10 },
|
|
|
|
|
@ -555,7 +555,7 @@ export default {
|
|
|
|
|
{ content: that.formatNumberAdvanced(info.downNum).toString(), color: "#000", fontWeight: 500, fontSize: 80, space: 10 },
|
|
|
|
|
{ content: "粉丝", color: "#666", fontWeight: 500, fontSize: 56, space: 40 },
|
|
|
|
|
];
|
|
|
|
|
that.G.drawCenteredText(ctx, mycenter + 20, 745, textSegments);
|
|
|
|
|
// that.G.drawCenteredText(ctx, mycenter + 20, 745, textSegments);
|
|
|
|
|
imgres(canvas);
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|