diff --git a/pages/home/index.vue b/pages/home/index.vue index 2f19731..c02c569 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -98,10 +98,10 @@ -
+
- +
@@ -215,7 +215,9 @@ export default { return { scrollTo: "", selectedCity: "全国", - whichOneShow:'', + agencyInfo: uni.getStorageSync("agencyInfo"), + userInfo: uni.getStorageSync("apply-userinfo"), + whichOneShow: "", toTop: false, // 筛序栏顶部状态 getFilterData: { sex: "-1", diff --git a/pages/person/index.vue b/pages/person/index.vue index ff0d28c..e753112 100644 --- a/pages/person/index.vue +++ b/pages/person/index.vue @@ -65,7 +65,7 @@ @clickItem="goPage('/root/bind/order?active=0')" /> - + - + 长按图片转发给微信好友 @@ -348,7 +348,7 @@ export default { success(res) { console.log("res111", res); canvas.width = res.width; - canvas.height = res.height; + canvas.height = res.height + 250; mycenter = canvas.width; myheight = canvas.height; const img = canvas.createImage(); @@ -356,11 +356,11 @@ export default { console.log("img111", img); img.onload = (info) => { // 绘制背景色 - that.G.roundRect1(ctx, 0, 0, canvas.width, canvas.height, 0, baseColor); + that.G.roundRect1(ctx, 0, 0, canvas.width, canvas.height + 250, 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); + that.G.roundRect1(ctx, (mycenter - 800) / 2, canvas.height - 600, 800, 136, 135, baseColor); let qrTop = 1195; // 二维码左上角的 that.G.roundRect1(ctx, (mycenter - 600) / 2 - 5, qrTop, 136, 136, 80, baseColor); @@ -370,7 +370,11 @@ export default { 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.fillTextLineBreak(ctx, "扫一扫关注我的发单号", (mycenter - "扫一扫关注我的发单号".length * 54) / 2 + 40, canvas.height - 515, "扫一扫关注我的发单号".length * 54, 58, "#333", 54, 600); // 总职位 + + 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.roundRect_yuan(ctx, (mycenter - 360) / 2, 110, 360, "#ffffff"); @@ -381,7 +385,7 @@ export default { 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); + that.G.roundRect(ctx, img, (mycenter - 800) / 2 + 100, canvas.height - 565, 70, 70, 0); resolve(true); }; }, @@ -507,9 +511,9 @@ export default { { 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 }, + { content: "粉丝", color: "#666", fontWeight: 500, fontSize: 56, space: 40 }, ]; - that.G.drawCenteredText(ctx, mycenter , 745, textSegments); + that.G.drawCenteredText(ctx, mycenter, 745, textSegments); imgres(canvas); }; }, diff --git a/root/detail/job.vue b/root/detail/job.vue index 5a71744..da2e1de 100644 --- a/root/detail/job.vue +++ b/root/detail/job.vue @@ -557,7 +557,7 @@ export default { let path; console.log("that.loginInfo", that.loginInfo); // 职位id_职位项目方_分享人_分享人团队 - path = `/root/detail/job?scene=id=${that.jobDetail.id}_${that.jobDetail.agencyId}_${that.shareUserId || that.loginInfo.user.id}_${that.sharreUserAgencyId || that.loginInfo.agencyId}`; + path = `/root/detail/job?scene=id=${that.jobDetail.id}_${that.jobDetail.agencyId}_${that.shareUserId || that.loginInfo.user.id}_${that.shareUserAgencyId ? (that.isFans == 2 ? that.loginInfo.agencyId : that.shareUserAgencyId) : that.loginInfo.agencyId}`; return { promise: new Promise((resolve, reject) => { uni.showLoading({ @@ -678,25 +678,29 @@ export default { }, onLoad(options) { console.log("详情", options); - + let loginUrl; if (options.id) { this.uid = options.id; + loginUrl = "/root/person/loginIndex?type=detail&path=/root/detail/job"; } else if (options.scene) { var sceneStr = decodeURIComponent(options.scene); var sceneJson = this.G.sceneToJson(sceneStr); console.log("sceneJson===", sceneJson); + console.log('id对应的角色','职位id_职位项目方_分享人_分享人团队'); // 职位id_职位项目方_分享人_分享人团队 this.uid = sceneJson.id.split("_")[0]; //职位id this.shareJobAgencyId = sceneJson.id.split("_")[1]; //职位项目方id this.shareUserId = sceneJson.id.split("_")[2]; //分享人id this.shareUserAgencyId = sceneJson.id.split("_")[3]; //分享人团队id this.isSharePage = true; + loginUrl = `/root/person/loginIndex?type=detail&path=/root/detail/job&scene=${JSON.stringify(sceneJson)}`; } this.from = options.from || "home"; if (!uni.getStorageSync("apply-token")) { console.log("apply-token"); + console.log("options.scene", options.scene); uni.reLaunch({ - url: "/root/person/loginIndex?type=detail&path=/root/detail/job&scene=" + options.scene, + url: loginUrl, }); return; } @@ -988,8 +992,9 @@ export default { if (that.isFans !== false) { params.isFans = that.isFans; } - that.shareUserId && (params.agencyUserId = that.shareUserId); - that.shareUserAgencyId && (params.shareUserAgencyId = that.shareUserAgencyId); + that.shareUserId && (params.agencyUserId = that.isFans == 2 ? '' : that.shareUserId); + // 如果粉丝自己报名,要把自己的id传到报名页,而不是传分享人的 + that.shareUserAgencyId && (params.shareUserAgencyId = that.isFans == 2 ? that.loginInfo.agencyId : that.shareUserAgencyId); uni.navigateTo({ url: `/root/home/quickApplication?params=${JSON.stringify(params)}`, }); diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index de7e1f4..33e72e0 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -37,7 +37,7 @@
- +
@@ -245,6 +245,7 @@ export default { onShow() { let that = this; that.isLogin = uni.getStorageSync("apply-token") ? true : false; // uni.getStorageSync("apply-token"); + console.log("that.isLogin", that.isLogin); this.loginInfo = uni.getStorageSync("apply-userinfo"); that.G.Get("/checkUserLogin", {}, (res) => { console.log("checkUserLogin", res); @@ -299,10 +300,12 @@ export default { return new Promise((reso, reject) => { that.G.Get(that.api.login_agencyInfo, {}, (aRes) => { console.log("获取团队信息:", aRes); - that.disabled = aRes.agency.fullName ? true : false; - that.agencyInfo = { ...aRes.agency, fullName: aRes.agency.fullName ? aRes.agency.fullName : that.agencyInfo.fullName }; + if (aRes.agency) { + that.disabled = aRes.agency.fullName ? true : false; + that.agencyInfo = { ...aRes.agency, fullName: aRes.agency.fullName ? aRes.agency.fullName : that.agencyInfo.fullName }; + uni.setStorageSync("agencyInfo", aRes.agency); + } - uni.setStorageSync("agencyInfo", aRes.agency); setTimeout(() => { reso(); }, 200); @@ -679,17 +682,22 @@ export default { let that = this; this.isLogin = true; console.log("successLogin", e); - that.getDefault("init"); - if (that.info.recordStatus == 3 || that.info.recordStatus == 4 || that.info.recordStatus == 6) { - that.handleSubmit(); - } else { - if (that.info.recordStatus == 5) { - uni.showToast({ - title: "已发起关注申请, 正在等待通过", - icon: "none", - }); - } - } + that.getAgencyInfo().then(() => { + that.getAgencyById().then(() => { + // that.query.page++; + if (that.info.recordStatus == 3 || that.info.recordStatus == 4 || that.info.recordStatus == 6) { + that.handleSubmit(); + } else { + if (that.info.recordStatus == 5) { + uni.showToast({ + title: "已发起关注申请, 正在等待通过", + icon: "none", + }); + } + } + that.getDefault("init"); + }); + }); }, jobLogin() { let that = this; diff --git a/root/home/quickApplication.vue b/root/home/quickApplication.vue index b3aeabe..ef6c147 100644 --- a/root/home/quickApplication.vue +++ b/root/home/quickApplication.vue @@ -157,10 +157,10 @@ export default { uni.setNavigationBarTitle({ title: params.title ? params.title : "报名", }); - if (params.type == 1 || params.type == 2) that.jobType = params.type; + if (params.type == 1 || params.type == 2) that.jobType = params.type; if (params.agencyId) that.updateInfo.upAgencyId = params.agencyId; - - params.isFans && (that.isFans = params.isFans); + + (params.isFans === 0 || params.isFans) && (that.isFans = params.isFans); params.agencyUserId && (that.updateInfo.agencyUserId = params.agencyUserId); // 分享人id params.shareUserAgencyId && (that.updateInfo.agencyId = params.shareUserAgencyId); // 分享人团队id this.updateInfo.interviewTimeStr = ""; @@ -321,7 +321,7 @@ export default { icon: "", label: "报名职位", result: that.updateInfo.jobName, - path: "/root/other/search?from=record", + path: '', placeholder: "请选择报名职位", fontColor: that.updateInfo.jobName == "请选择报名职位" ? "g_c_9" : "g_c_3", tip: "applia-job", diff --git a/root/person/loginIndex.vue b/root/person/loginIndex.vue index eaeb2f3..ae1082e 100644 --- a/root/person/loginIndex.vue +++ b/root/person/loginIndex.vue @@ -128,7 +128,8 @@ export default { console.log("options", options); this.fromPageType = options.type; if (options.type == "detail") { - this.currentId = options.scene; + this.currentId = `id%3D${JSON.parse(options.scene).id}`; + console.log('this.currentId',this.currentId); } }, goHome() { diff --git a/utils/common.js b/utils/common.js index 2ac06b8..f6a40ec 100644 --- a/utils/common.js +++ b/utils/common.js @@ -1260,7 +1260,7 @@ let data = { let totalWidth = 0; segments.forEach((segment) => { ctx.font = `${segment.fontWeight} ${segment.fontSize}px Arial`; - totalWidth += ((ctx.measureText(segment.content).width) + segment.space || 0); + totalWidth += ((ctx.measureText(segment.content).width) + (segment.space || 0)); }); return totalWidth; }, @@ -1269,7 +1269,7 @@ let data = { // 计算总宽度 const totalWidth = this.calculateTotalWidth(ctx, textSegments); - + console.log('totalWidth', totalWidth, textSegments); // 计算起始X坐标(居中位置) const centerX = x; const startX = (centerX - totalWidth) / 2; @@ -1288,7 +1288,7 @@ let data = { ctx.fillText(segment.content, currentX, centerY); // 更新X坐标,为下一段文本做准备, 文本长度为1的时候,使用字体大小 - currentX += ((ctx.measureText(segment.content).width) + segment.space || 0); + currentX += ((ctx.measureText(segment.content).width) + (segment.space || 0)); }); }, /**