diff --git a/pages.json b/pages.json index 170252a..98ac722 100644 --- a/pages.json +++ b/pages.json @@ -4,8 +4,8 @@ "path": "pages/home/index", "style": { "navigationBarTitleText": "报名助手", - "backgroundColor": "#caf1e0", - "backgroundColorTop": "#caf1e0" + "backgroundColor": "#fff", + "backgroundColorTop": "#fff" } }, { diff --git a/pages/home/index.vue b/pages/home/index.vue index 072e04d..2df63f5 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -8,7 +8,7 @@ - +
@@ -27,12 +27,12 @@
-
+
-
+
{{ sortList.list[sortList.active].showName }} @@ -42,7 +42,7 @@
- + 筛选 @@ -214,6 +214,7 @@ export default { return { scrollTo: "", selectedCity: "全国", + toTop: false, // 筛序栏顶部状态 getFilterData: { sex: "-1", ageRangeStr: "", @@ -223,7 +224,7 @@ export default { jobCategoryLabelObjects: [], }, background: { - backgroundColor: "#caf1e0", + backgroundColor: "#fff", }, customList: [ { @@ -364,6 +365,23 @@ export default { } } }, + checkScroll() { + let that = this; + uni + .createSelectorQuery() + .select("#tttop") + .boundingClientRect((data) => { + // console.log("data", data); + if (data.top <= 0) { + that.toTop = true; + } else { + that.toTop = false; + } + // domTopInfo.value[id] = data.top; + // scrollTop.value = data.top - 200; + }) + .exec(); + }, handleOpenCamera() { let that = this; that.G.handleScanCode(); diff --git a/root/bind/myMain.vue b/root/bind/myMain.vue index bc6d84b..3f5689a 100644 --- a/root/bind/myMain.vue +++ b/root/bind/myMain.vue @@ -328,7 +328,7 @@ export default { return new Promise((resolve) => { var mycenter = 0; //文字左右居中显示 var myheight = 0; //文字高度 - var baseColor = this.agencyInfo.themeColor || '#52cd8d'; //背景色 + var baseColor = this.agencyInfo.themeColor || "#52cd8d"; //背景色 const query = uni.createSelectorQuery().in(this); query .select("#canvasId") @@ -355,43 +355,42 @@ export default { img.src = res.path; console.log("img111", img); img.onload = (info) => { - // 绘制背景色 - that.G.roundRect1(ctx, 0, 0, canvas.width, canvas.height, 0, baseColor); - // 绘制中间白色背景 - 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 - 300, 800, 136, 135 , baseColor); - let qrTop = 1195 - // 二维码左上角的 - that.G.roundRect1(ctx, (mycenter - 600 ) / 2 - 5, qrTop, 136, 136, 80, baseColor); - // 二维码右上角的 - that.G.roundRect1(ctx, (mycenter - 600 ) / 2 + 470, qrTop, 136, 136, 80, baseColor); - // 二维码左下角的 - that.G.roundRect1(ctx, (mycenter - 600 ) / 2 - 5, 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 - 215, '扫一扫关注我的发单号'.length * 54, 58, "#333", 54, 600); // 总职位 - - // 绘制头像背景色 - that.G.roundRect_yuan(ctx, (mycenter - 360 ) / 2, 110, 360, "#ffffff"); - uni.getImageInfo({ - src: 'https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/phone.png', // 手机图标图片 - success(res) { - const img = canvas.createImage(); - console.log("res333", res); - img.src = res.path; - img.onload = () => { - that.G.roundRect(ctx, img, (mycenter - 800 ) / 2 + 100, canvas.height - 265, 70, 70, 0); - resolve(true); - } - } - }) - + // 绘制背景色 + that.G.roundRect1(ctx, 0, 0, canvas.width, canvas.height, 0, baseColor); + // 绘制中间白色背景 + 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 - 300, 800, 136, 135, baseColor); + let qrTop = 1195; + // 二维码左上角的 + that.G.roundRect1(ctx, (mycenter - 600) / 2 - 5, qrTop, 136, 136, 80, baseColor); + // 二维码右上角的 + that.G.roundRect1(ctx, (mycenter - 600) / 2 + 470, qrTop, 136, 136, 80, baseColor); + // 二维码左下角的 + that.G.roundRect1(ctx, (mycenter - 600) / 2 - 5, 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 - 215, "扫一扫关注我的发单号".length * 54, 58, "#333", 54, 600); // 总职位 + + // 绘制头像背景色 + that.G.roundRect_yuan(ctx, (mycenter - 360) / 2, 110, 360, "#ffffff"); + uni.getImageInfo({ + src: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/phone.png", // 手机图标图片 + success(res) { + const img = canvas.createImage(); + console.log("res333", res); + img.src = res.path; + img.onload = () => { + that.G.roundRect(ctx, img, (mycenter - 800) / 2 + 100, canvas.height - 265, 70, 70, 0); + resolve(true); + }; + }, + }); }; }, fail(err) { - console.log('errerrerrerrerrerrerr',err); - }, + console.log("errerrerrerrerrerrerr", err); + }, }); }).then(() => { //使用: @@ -466,7 +465,7 @@ export default { }, }); }, - // 设置分享布局 + // 设置分享布局 setShareJobImg(ctx, canvas, mycenter, funObj) { let that = this; return new Promise((imgres) => { @@ -491,38 +490,26 @@ export default { const img = canvas.createImage(); img.src = res.path; img.onload = () => { - // info.jobNum = 10000 - // info.recruitmentJobNum = 1000 - // info.downNum = 32 - let numBase = 150 - let numBase2 = numBase + (ctx.measureText(info.jobNum.toString()).width + ctx.measureText("总职位").width + 150) - let numBase3 = numBase2 + (ctx.measureText(info.recruitmentJobNum.toString()).width + ctx.measureText("在招数").width + 150) + // info.jobNum = 10000 + // info.recruitmentJobNum = 1000 + // info.downNum = 32 + let numBase = 150; + let numBase2 = numBase + (ctx.measureText(info.jobNum.toString()).width + ctx.measureText("总职位").width + 150); + let numBase3 = numBase2 + (ctx.measureText(info.recruitmentJobNum.toString()).width + ctx.measureText("在招数").width + 150); 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.agencyDesp ,numBase , 870,mycenter - 360, 86, "#666", 56, 500,'left'); // slogan - - // that.G.fillTextLineBreak(ctx, "今日更新职位" + info.jobUpdateNum, 140, 400, ("今日更新职位" + info.jobUpdateNum).length * 56, 56, "#999", 56, 500, "left"); // 今日更新职位 - let jobL =info.jobNum.toString().length - let recL =info.recruitmentJobNum.toString().length - let downL =info.downNum.toString().length - // if(){ + that.G.fillTextLineBreak(ctx, info.agencyDesp, numBase - 40, 870, mycenter - 240, 86, "#666", 56, 500, "center"); // slogan - // } - that.G.fillTextLineBreak(ctx, info.jobNum.toString(), numBase, 760, info.jobNum.toString().length * 80, 88, "#000", 80, 500); // 总职位 - that.G.fillTextLineBreak(ctx, info.recruitmentJobNum.toString(), numBase2, 760, info.recruitmentJobNum.toString().length * 80, 88, "#000", 80, 500); // 在招数 - that.G.fillTextLineBreak(ctx, info.downNum.toString(),numBase3, 760, info.downNum.toString().length * 80, 88, "#000", 80, 500); // 粉丝数 - - - console.log('info.jobNum.toString().length * 88',info.jobNum.toString().length * 88); - - - // that.G.fillTextLineBreak(ctx, "总职位",numBase + (info.jobNum.toString().length <=1 ?70 * 2 :info.jobNum.toString().length * 70), 755, "总职位".length * 56, 56, "#666", 56, 400); // 总职位 - // that.G.fillTextLineBreak(ctx, "在招数", numBase2 + (info.recruitmentJobNum.toString().length <=1 ?70 * 2 :info.recruitmentJobNum.toString().length * 70), 755, "在招数".length * 56, 56, "#666", 56, 400); // 在招数 - // that.G.fillTextLineBreak(ctx, "粉丝", numBase3 + (info.downNum.toString().length <=1 ?60 * 2 :info.downNum.toString().length * 60), 755, "粉丝".length * 56, 56, "#666", 56, 400); // 粉丝数 - - that.G.fillTextLineBreak(ctx, "总职位",numBase + (info.jobNum.toString().length <=1 ?60 * 2 :info.jobNum.toString().length * 50), 755, "总职位".length * 56, 56, "#666", 56, 400); // 总职位 - that.G.fillTextLineBreak(ctx, "在招数", numBase2 + (info.recruitmentJobNum.toString().length <=1 ?60 * 2 :info.recruitmentJobNum.toString().length * 50), 755, "在招数".length * 56, 56, "#666", 56, 400); // 在招数 - that.G.fillTextLineBreak(ctx, "粉丝", numBase3 + (info.downNum.toString().length <=1 ?40 * 2 :info.downNum.toString().length * 50), 755, "粉丝".length * 56, 56, "#666", 56, 400); // 粉丝数 + // that.G.fillTextLineBreak(ctx, "今日更新职位" + info.jobUpdateNum, 140, 400, ("今日更新职位" + info.jobUpdateNum).length * 56, 56, "#999", 56, 500, "left"); // 今日更新职位 + const textSegments = [ + { content: info.jobNum.toString(), color: "#000", fontWeight: 500, fontSize: 80, space: 20 }, + { content: "总职位", color: "#666", fontWeight: 500, fontSize: 56, space: 80 }, + { content: info.recruitmentJobNum.toString(), color: "#000", fontWeight: 500, fontSize: 80, space: 20 }, + { content: "在招数", color: "#666", fontWeight: 500, fontSize: 56, space: 80 }, + { content: info.downNum.toString(), color: "#000", fontWeight: 500, fontSize: 80, space: 20 }, + { content: "粉丝", color: "#666", fontWeight: 500, fontSize: 56, space: 40 }, + ]; + that.G.drawCenteredText(ctx, mycenter , 745, textSegments); imgres(canvas); }; }, diff --git a/root/detail/fellow.vue b/root/detail/fellow.vue index 99f085e..5b744bf 100644 --- a/root/detail/fellow.vue +++ b/root/detail/fellow.vue @@ -1,9 +1,9 @@ diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index 3aa3521..9eb7b82 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -1,7 +1,7 @@