diff --git a/api/common.js b/api/common.js new file mode 100644 index 0000000..df59b98 --- /dev/null +++ b/api/common.js @@ -0,0 +1,5 @@ +let commonInfo = { + common_getQRCode:"/qrcode/params/get",// 获取邀请码 +} + +export default commonInfo; \ No newline at end of file diff --git a/api/index.js b/api/index.js index a471984..6835510 100644 --- a/api/index.js +++ b/api/index.js @@ -5,6 +5,7 @@ import jobInfo from './job.js'; import orderInfo from './order.js'; import personInfo from './person.js'; import wyyxInfo from './wyyx.js'; +import commonInfo from './common.js'; let testInfo = {// 测试接口 testUrl:"/overall/store/job/list",// 来源:稻田 小程序首页列表 @@ -18,4 +19,4 @@ let baseInfo = {// 公共接口 getConfig:"/yishoudan/weixin/config/getConfig", } -export default Object.assign(testInfo,baseInfo,loginInfo,userInfo,bindInfo,jobInfo,orderInfo,personInfo,wyyxInfo); \ No newline at end of file +export default Object.assign(testInfo,baseInfo,loginInfo,userInfo,bindInfo,jobInfo,orderInfo,personInfo,commonInfo,wyyxInfo); \ No newline at end of file diff --git a/api/job.js b/api/job.js index f97ff45..a1d8364 100644 --- a/api/job.js +++ b/api/job.js @@ -11,7 +11,7 @@ let jobInfo = { job_getDetailInList: "/assistant/custom/job/v2/getInfo",// 职位列表获取职位详情 get_job_QRcode: "/yishoudan/custom/job/batchqrcodeUniForAssistant", // 分享多个职位的海报二维码 get_sharejob_list: "/yishoudan/custom/job/getShareJobs", // 获取分享职位的列表 - + get_getJobText: "/yishoudan/custom/job/getJobText", // 获取分享职位的通告 job_delJob: "/yishoudan/custom/job/del",// 删除职位 job_updateStatus: "/assistant/custom/job/ignore/add",// 更新状态 job_getPolicyPerson: '/yishoudan/custom/job/getPolicyStr',// 获取自有职位政策 diff --git a/components/button.vue b/components/button.vue index 674a73e..028be43 100644 --- a/components/button.vue +++ b/components/button.vue @@ -124,7 +124,9 @@ export default { }, methods: { handleClick() { - this.$emit("clickBtn"); + if (!this.loading) { + this.$emit("clickBtn"); + } }, getphonenumber(e) { this.$emit("clickTel", e); diff --git a/components/list/job.vue b/components/list/job.vue index 0e4691c..7f9485c 100644 --- a/components/list/job.vue +++ b/components/list/job.vue @@ -39,7 +39,7 @@ - + {{ item.district }}{{ item.district ? "丨" : "" }}{{ (item.gender || "-") + "丨" + item.age }} diff --git a/pages/home/index.vue b/pages/home/index.vue index a7c9c39..fbc234c 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -101,10 +101,10 @@
- + diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index f981b76..c71da22 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -80,14 +80,14 @@
- +
- +
@@ -187,6 +187,7 @@ export default { numSlot: [], showPage: false, fromShare: false, + btnLoading: false, background: { backgroundColor: "transparent", }, @@ -245,6 +246,7 @@ export default { }, ], from: "", + fromQRCode: false, // 是否来自扫码的判断 jobDetailShow: true, loginInfo: {}, isSelf: false, // 是否是自己的信息判断 @@ -307,6 +309,7 @@ export default { console.log("sceneJson===", sceneJson); this.inviteUserId = sceneJson.id.split("_")[1]; //被关注团队的邀请人id this.uid = sceneJson.id.split("_")[0]; // 被关注团队的id + this.fromQRCode = true; // 被关注团队的id } else { this.uid = options.id; this.isShowMore = options.isShowMore ? true : false; @@ -331,7 +334,7 @@ export default { // 已登录状态 that.getAgencyInfo().then(() => { that.getAgencyById().then(() => { - if (that.from !== "apply") { + if (that.fromQRCode) { if (that.info.recordStatus == 1) { uni.switchTab({ url: "/pages/home/index", @@ -772,6 +775,10 @@ export default { _code = 1; // 账号搜索 } } + if (that.btnLoading) { + return; + } + that.btnLoading = true; this.G.Get(this.api.bind_subscribeSubmit + "/" + that.uid, { agencyId: that.agencyInfo.id, agencyName: that.agencyInfo.fullName, source: _code, remark: " " }, (res) => { that.getAgencyInfo().then(() => { that.getAgencyById().then(() => { @@ -782,6 +789,7 @@ export default { title: "申请成功", icon: "none", }); + that.btnLoading = false; that.submitConfirm = false; uni.navigateTo({ url: "/root/person/inviteFollowSuccess", @@ -872,7 +880,17 @@ export default { this.G.isLogin(); if (this.G.isLogin()) { if (that.loginInfo.agencyId) { - that.submitConfirm = true; + // that.submitConfirm = true; + that.G.handleConfirm({ + confirmText: "确认", + title: "是否确认关注该发单号?", + content: "关注发单号后可浏览职位详情及工单报名", + success: (res) => { + if (res.confirm) { + this.finallySubmit(); + } + }, + }); } else { that.G.handleConfirm({ cancelText: "创建团队", diff --git a/root/home/quickApplication.vue b/root/home/quickApplication.vue index 1e50e9a..f5b9487 100644 --- a/root/home/quickApplication.vue +++ b/root/home/quickApplication.vue @@ -90,7 +90,7 @@ 取消 - + @@ -219,7 +219,7 @@ export default { agreeRadio: ["agree"], jobData: [], zhengceTextList: [], - btnLaoding: false, + btnLoading: false, }; }, onShow() { @@ -468,10 +468,10 @@ export default { }); return false; } - if (that.btnLaoding) { + if (that.btnLoading) { return false; } - that.btnLaoding = true; + that.btnLoading = true; let submitInfo = { ...that.updateInfo, @@ -513,7 +513,7 @@ export default { duration: 2000, }); // that.persenInfo = []; - that.btnLaoding = false; + that.btnLoading = false; // that.$forceUpdate(); setTimeout(() => { diff --git a/root/home/shareJob.vue b/root/home/shareJob.vue index a0b1dc4..c3d759b 100644 --- a/root/home/shareJob.vue +++ b/root/home/shareJob.vue @@ -96,7 +96,7 @@ - + @@ -138,7 +138,7 @@ export default { console.log(res); uni.hideLoading(); resolve({ - title: "你想找的厂都有,立即查看??", + title: "你想找的厂都有,立即查看", imageUrl: res.tempFilePath, path: `/root/home/shareList?scene=i=${arr.join("_")},u=${this.userInfo.agencyId}_${this.userInfo.id}`, // path: '/pages/shareList/index' @@ -352,12 +352,11 @@ export default { ...that.getFilterData, pageNum: that.query.page, pageSize: that.query.size, - agencyId: that.tabInfo.active == 2 ? uni.getStorageSync("apply-agencyId") : "", + agencyId: that.tabInfo.active == 1 ? uni.getStorageSync("apply-agencyId") : "", classify: that.tabInfo.list[that.tabInfo.active].classify, sortTag: that.query.sortTag, keys: that.keyword, cityName: that.selectedCity == "全国" ? "" : that.selectedCity, - tip: that.tabInfo.list[that.tabInfo.active].tip, }; if (that.tabInfo.list[that.tabInfo.active].classify == 1) { params.jobType = 2; @@ -495,36 +494,29 @@ export default { * 复制转发选中职位的通告信息 */ copyTrans() { + var that = this; if (this.checkedList.length > 0) { - let str = ""; - this.checkedList.forEach((item, index) => { - console.log(item); - // console.log(item.jobDesp); - let subStr; - if (item.jobInfoWithoutReturnFee) { - // 通告中是否有职位名的判断, 没有就手动拼接 - // if (item.jobInfo.indexOf(item.jobName) > -1) { - // subStr = item.jobInfo + (this.userInfo.agencyStatus == 1 ? (this.userInfo.noticeEndStr ? this.userInfo.noticeEndStr : "\n\n详情咨询:" + this.userInfo.tel) : "\n\n详情咨询:" + (this.serviceInfo.userName || "") + (this.serviceInfo.workPhone || "-")) + (index < this.checkedList.length - 1 ? "\n\n\n" : ""); - // } else { - subStr = item.jobInfoWithoutReturnFee; - // } - } - str += subStr; - }); - uni.setClipboardData({ - data: str, - success(res) { - uni.getClipboardData({ - success(res) { - console.log(res.data); // data - uni.showToast({ - title: "通告内容已复制", - icon: "none", - duration: 1500, - }); - }, - }); - }, + let ids = ""; + ids = this.checkedList.map((item) => item.id).join("_"); + that.G.Get(that.api.get_getJobText, { storeJobIds: ids }, (res) => { + console.log(res); + let str = ""; + res.forEach((item, index) => { + console.log(item); + if (item.jobInfoWithoutReturnFee) { + str += item.jobInfoWithoutReturnFee + "\n"; + } + }); + uni.setClipboardData({ + data: str, + success(res) { + uni.showToast({ + title: "通告内容已复制", + icon: "none", + duration: 1500, + }); + }, + }); }); } }, @@ -556,6 +548,8 @@ export default { }, getCode() { var that = this; + let _env = uni.getAccountInfoSync().miniProgram.envVersion; + 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) => { @@ -564,7 +558,7 @@ export default { // resolve(); // }); // } else { - that.G.Get(that.api.get_job_QRcode, { storeJobIds: that.checkedList.map((item) => item.id).join(",") }, (res) => { + 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; resolve(); diff --git a/root/home/shareList.vue b/root/home/shareList.vue index 4990dc7..1f486be 100644 --- a/root/home/shareList.vue +++ b/root/home/shareList.vue @@ -1,6 +1,6 @@ @@ -30,9 +30,12 @@ export default { }, isLogin: true, loading: false, + QRCodeId: null, }; }, onLoad(options) { + let that = this; + console.log("options", options); if (options.scene) { console.log("XXXXXXXXXXXX"); @@ -41,24 +44,47 @@ export default { console.log(sceneStr); var sceneJson = this.G.sceneToJson(sceneStr); console.log("sceneJson===", sceneJson); - this.sceneStoreJobId = sceneJson.i; - let u = sceneJson.u.split("_"); - this.shareUserInfo = { - agencyId: u[0], - agencyUserId: u[1], - }; + that.G.Get("/checkUserLogin", {}, (res) => { + console.log("checkUserLogin", res); + if (res) { + // 已登录状态 + if (sceneJson.i) { + that.sceneStoreJobId = sceneJson.i; + let u = sceneJson.u.split("_"); + that.shareUserInfo = { + agencyId: u[0], + agencyUserId: u[1], + }; + that.getUserRole().then(() => { + that.getList(); + }); + } else { + that.QRCodeId = sceneJson.id; + that.getId().then(() => { + that.getUserRole().then(() => { + that.getList(); + }); + }); + } + } else { + uni.reLaunch({ + url: `/root/person/loginIndex?type=shareList&path=/root/home/shareList&scene=${JSON.stringify(sceneJson)}`, + }); + } + }); + + // this.sceneStoreJobId = sceneJson.i; + // let u = sceneJson.u.split("_"); + // this.sceneStoreJobId = sceneJson.u; uni.setStorageSync("AGENCY_USER_ID", sceneJson.u); // app.globalData.sceneStoreJobId = sceneJson.ids - this.getUserRole().then(() => { - this.getList(); - }); - } - if (uni.getStorageSync("apply-userinfo")) { - this.isLogin = true; - } else { - this.isLogin = false; } + // if (uni.getStorageSync("apply-userinfo")) { + // this.isLogin = true; + // } else { + // this.isLogin = false; + // } }, onShow() {}, methods: { @@ -72,6 +98,21 @@ export default { }); }); }, + getId() { + let that = this; + return new Promise((resolve, reject) => { + this.G.Get(this.api.common_getQRCode, { id: that.QRCodeId }, (res) => { + console.log("resresresresresres++++++++++++++", res); + let params = JSON.parse(res.params); + that.sceneStoreJobId = params.storeJobIds; + that.shareUserInfo = { + agencyId: params.agencyId, + agencyUserId: params.userId, + }; + resolve(); + }); + }); + }, getList($type = "init") { let that = this; that.G.Get( diff --git a/root/person/loginIndex.vue b/root/person/loginIndex.vue index ae1082e..4e71e61 100644 --- a/root/person/loginIndex.vue +++ b/root/person/loginIndex.vue @@ -127,7 +127,7 @@ export default { setOptions(options) { console.log("options", options); this.fromPageType = options.type; - if (options.type == "detail") { + if (options.type == "detail" || options.type == "shareList") { this.currentId = `id%3D${JSON.parse(options.scene).id}`; console.log('this.currentId',this.currentId); } @@ -306,7 +306,7 @@ export default { uni.switchTab({ url: "/pages/home/index", }); - } else if (that.fromPageType == "detail") { + } else if (that.fromPageType == "detail" || that.fromPageType == "shareList") { uni.reLaunch({ url: `${that.path}?scene=${that.currentId}`, });