diff --git a/packageA/pages/jobExpect/jobExpect.vue b/packageA/pages/jobExpect/jobExpect.vue index 6ec0376..7542a16 100644 --- a/packageA/pages/jobExpect/jobExpect.vue +++ b/packageA/pages/jobExpect/jobExpect.vue @@ -81,10 +81,16 @@ const fromValue = reactive({ area: '', jobTitleId: [], }); -onLoad(async () => { +const needSkill = ref(false); + +onLoad(async (options) => { // 初始化字典数据 await getDictData(); initLoad(); + // 检查是否需要继续跳转到技能页面 + if (options && options.needSkill === 'true') { + needSkill.value = true; + } }); const confirm = () => { if (!fromValue.jobTitleId) { @@ -94,7 +100,12 @@ const confirm = () => { $api.msg('完成'); state.disbleDate = true; getUserResume().then(() => { - navBack(); + // 如果需要继续跳转到技能页面,则跳转到个人信息页面(携带 needSkill 标记,便于返回两级) + if (needSkill.value) { + navTo('/packageA/pages/personalInfo/personalInfo?needSkill=true'); + } else { + navBack(); + } }); }); }; diff --git a/packageA/pages/personalInfo/personalInfo.vue b/packageA/pages/personalInfo/personalInfo.vue index 10fe842..e67daa0 100644 --- a/packageA/pages/personalInfo/personalInfo.vue +++ b/packageA/pages/personalInfo/personalInfo.vue @@ -150,6 +150,8 @@ const openSelectPopup = (config) => { }; const percent = ref('0%'); +// 当从“先职位后技能”链路进入时,提交后需直接返回职业规划页 +const needGoBackTwoStep = ref(false); const state = reactive({ educationText: '', politicalAffiliationText: '', @@ -168,7 +170,10 @@ const fromValue = reactive({ // 移除重复的onLoad定义,已在上方实现 // 在onLoad中初始化数据,确保页面加载时就能获取技能信息 -onLoad(() => { +onLoad((options = {}) => { + if (options.needSkill === 'true') { + needGoBackTwoStep.value = true; + } // 初始化页面数据 initLoad(); }); @@ -369,7 +374,12 @@ const confirm = () => { $api.createRequest('/app/user/resume', params, 'post').then((resData) => { $api.msg('完成'); getUserResume().then(() => { - navBack(); + // 如果从“缺职位+技能”链路进入,回退两层直接返回职业规划页 + if (needGoBackTwoStep.value) { + navBack({ delta: 2 }); + } else { + navBack(); + } }); }); }; diff --git a/packageB/train/index.vue b/packageB/train/index.vue index 4703b17..578970f 100644 --- a/packageB/train/index.vue +++ b/packageB/train/index.vue @@ -58,8 +58,57 @@ const { $api, navTo, vacanciesTo, formatTotal, config } = inject('globalFunction import useUserStore from '@/stores/useUserStore'; import useDictStore from '@/stores/useDictStore'; -function jumps(url){ - navTo(url); +onLoad(() => { + thirdLogin() +}); + +async function jumps(url){ + if(await thirdLogin()){ + navTo(url); + } +} + + +async function thirdLogin(){ + let form={} + if (uni.getStorageSync('userInfo').isCompanyUser=='1') { + form={ + usertype: '1', + idno: uni.getStorageSync('userInfo').idCard, + name: uni.getStorageSync('userInfo').name, + enterprisecode:"", + enterprisename: "", + contactperson: "", + contactphone: "", + } + }else if (uni.getStorageSync('userInfo').isCompanyUser=='0') { + form={ + usertype: "2", + enterprisecode: uni.getStorageSync('userInfo').idCard, + enterprisename: uni.getStorageSync('userInfo').name, + contactperson: "", + contactphone: "", + idno: "", + name: "" + } + }else{ + uni.showToast({ + icon: 'none', + title: '请先登录' + }) + return false; + } + var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100); + if (resLogin.code=='200') { + uni.setStorageSync('Padmin-Token', resLogin.data.access_token) + return true; + }else{ + uni.showToast({ + icon: 'none', + title: '单点异常' + }) + return false; + } } diff --git a/packageB/train/video/videoDetail.vue b/packageB/train/video/videoDetail.vue index fea32f3..d17e85c 100644 --- a/packageB/train/video/videoDetail.vue +++ b/packageB/train/video/videoDetail.vue @@ -202,12 +202,10 @@ function getData() { function getHeart() { const raw = uni.getStorageSync("Padmin-Token"); const token = typeof raw === "string" ? raw.trim() : ""; - const headers = token ? { Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {} + const headers = token ? { Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}; $api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => { if (resData.code == 200) { getUserInfo(); - } else { - navTo('/packageB/login') } }); } @@ -218,6 +216,7 @@ function getUserInfo(){ $api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => { userId.value=resData.info.userId getData() + updateVideoInfo() }); } function getDictionary(){ @@ -277,15 +276,20 @@ function updateVideoInfo(){ 'Authorization':uni.getStorageSync('Padmin-Token'), 'Content-Type': "application/x-www-form-urlencoded" } - if(videoInfo.value.isCollect===null && videoInfo.value.process ===null){ - $api.myRequest('/train/public/videoUser/add', paramsData,'post',9100,header).then((resData) => { - console.log("视频播放时长更新成功") - }); - }else{ - $api.myRequest('/train/public/videoUser/update', paramsData,'post',9100,header).then((resData) => { - console.log("视频播放时长更新成功") - }); - } + + $api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, header).then((resData) => { + if (resData.code == 200) { + if(videoInfo.value.isCollect===null && videoInfo.value.process ===null){ + $api.myRequest('/train/public/videoUser/add', paramsData,'post',9100,header).then((resData) => { + console.log("视频播放时长更新成功") + }); + }else{ + $api.myRequest('/train/public/videoUser/update', paramsData,'post',9100,header).then((resData) => { + console.log("视频播放时长更新成功") + }); + } + } + }) } // 计算并上报停留时长 function reportPageDuration() { diff --git a/packageB/train/video/videoList.vue b/packageB/train/video/videoList.vue index 90996a5..5efd2d0 100644 --- a/packageB/train/video/videoList.vue +++ b/packageB/train/video/videoList.vue @@ -80,7 +80,8 @@ const getItemBackgroundStyle = (imageName) => ({ }); const trainVideoImgUrl=config.trainVideoImgUrl -onLoad(() => { +onLoad(async () => { + await thirdLogin() getDataList('refresh'); }); @@ -135,8 +136,53 @@ function getDataList(type = 'add') { // 播放视频 -function playVideo(video) { - navTo(`/packageB/train/video/videoDetail?id=${video.videoId}`); +async function playVideo(video) { + if(await thirdLogin()){ + navTo(`/packageB/train/video/videoDetail?id=${video.videoId}`); + } +} + + +async function thirdLogin(){ + let form={} + if (uni.getStorageSync('userInfo').isCompanyUser=='1') { + form={ + usertype: '1', + idno: uni.getStorageSync('userInfo').idCard, + name: uni.getStorageSync('userInfo').name, + enterprisecode:"", + enterprisename: "", + contactperson: "", + contactphone: "", + } + }else if (uni.getStorageSync('userInfo').isCompanyUser=='0') { + form={ + usertype: "2", + enterprisecode: uni.getStorageSync('userInfo').idCard, + enterprisename: uni.getStorageSync('userInfo').name, + contactperson: "", + contactphone: "", + idno: "", + name: "" + } + }else{ + uni.showToast({ + icon: 'none', + title: '请先登录' + }) + return false; + } + var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100); + if (resLogin.code=='200') { + uni.setStorageSync('Padmin-Token', resLogin.data.access_token) + return true; + }else{ + uni.showToast({ + icon: 'none', + title: '单点异常' + }) + return false; + } } diff --git a/packageRc/pages/index/index.vue b/packageRc/pages/index/index.vue index d7a1f3d..6d9ff81 100644 --- a/packageRc/pages/index/index.vue +++ b/packageRc/pages/index/index.vue @@ -1,7 +1,7 @@