Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 素质测评合并
This commit is contained in:
36
package-lock.json
generated
36
package-lock.json
generated
@@ -1,6 +1,38 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-ui": "^1.5.11",
|
||||
"dayjs": "^1.11.19",
|
||||
"sm-crypto": "^0.3.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@dcloudio/uni-ui": {
|
||||
"version": "1.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
|
||||
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
|
||||
},
|
||||
"node_modules/dayjs": {
|
||||
"version": "1.11.19",
|
||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
||||
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
|
||||
},
|
||||
"node_modules/jsbn": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
|
||||
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
|
||||
},
|
||||
"node_modules/sm-crypto": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jsbn": "^1.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-ui": {
|
||||
"version": "1.5.11",
|
||||
@@ -19,7 +51,7 @@
|
||||
},
|
||||
"sm-crypto": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
|
||||
"requires": {
|
||||
"jsbn": "^1.1.0"
|
||||
|
||||
@@ -21,15 +21,25 @@
|
||||
</view>
|
||||
<view class="companyinfo-right">
|
||||
<view class="row1">{{ companyInfo?.companyName }}</view>
|
||||
<view class="row2">
|
||||
{{ companyInfo?.scale }}
|
||||
<view class="row2" v-if="companyInfo?.industry || companyInfo?.scale">
|
||||
<dict-tree-Label
|
||||
v-if="companyInfo?.industry"
|
||||
dictType="industry"
|
||||
:value="companyInfo?.industry"
|
||||
></dict-tree-Label>
|
||||
<span v-if="companyInfo?.industry && companyInfo?.scale"> · </span>
|
||||
<dict-Label
|
||||
v-if="companyInfo?.scale"
|
||||
dictType="scale"
|
||||
:value="companyInfo?.scale"
|
||||
></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="conetent-info" :class="{ expanded: isExpanded }">
|
||||
<view class="info-title">公司介绍</view>
|
||||
<view class="info-desirption">{{
|
||||
companyInfo.companyIntroduction
|
||||
companyInfo.description
|
||||
}}</view>
|
||||
<!-- <view class="info-title title2">公司地址</view>
|
||||
<view class="locationCompany"></view> -->
|
||||
@@ -46,32 +56,39 @@
|
||||
<view class="views">
|
||||
<view class="Detail-title"><text class="title">在招职位</text></view>
|
||||
<template v-if="companyInfo.jobInfoList.length != 0">
|
||||
<view v-for="job in companyInfo.jobInfoList" :key="job.id">
|
||||
<!-- @click="navTo(`/packageA/pages/post/post?jobId=${JSON.stringify(job)}`)" -->
|
||||
<view class="cards" :style="getItemBackgroundStyle('bj2.png')">
|
||||
<view class="card-company">
|
||||
<text class="company">{{ job.jobTitle }}</text>
|
||||
<view class="salary"> ¥{{ job.salaryRange }}/月 </view>
|
||||
</view>
|
||||
<view class="card-tags">
|
||||
<view class="tag jy">
|
||||
<image :src="`${baseUrl}/jobfair/jy.png`" mode=""></image>
|
||||
{{ job.experienceRequirement }}
|
||||
</view>
|
||||
<view class="tag xl">
|
||||
<image :src="`${baseUrl}/jobfair/xx.png`" mode=""></image>
|
||||
{{ job.educationRequirement }}
|
||||
</view>
|
||||
<view class="tag yd" v-if="job.jobRequirement">
|
||||
<image :src="`${baseUrl}/jobfair/lx-1.png`" mode=""></image>
|
||||
{{ job.jobRequirement }}
|
||||
<view v-for="job in companyInfo.jobInfoList" :key="job.jobId" class="job-card-wrapper">
|
||||
<view class="cards" @click="navTo(`/packageA/pages/post/post?jobId=${job.jobId}`)">
|
||||
<view class="card-header">
|
||||
<view class="card-title-row">
|
||||
<text class="job-title">{{ job.jobTitle }}</text>
|
||||
<view class="card-pay">
|
||||
<view class="pay-text">
|
||||
<text class="salary-amount">¥{{ formatSalary(job.minSalary, job.maxSalary) }}</text>
|
||||
<text class="salary-unit">/月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-companyName">
|
||||
<image :src="`${baseUrl}/jobfair/hd.png`" mode=""></image>
|
||||
{{ job.jobDescription }}
|
||||
</view>
|
||||
|
||||
<view class="card-tags" v-if="job.experience || job.education">
|
||||
<view class="tag tag-experience" v-if="job.experience">
|
||||
<image class="tag-icon" :src="`${baseUrl}/jobfair/jy.png`" mode="aspectFit"></image>
|
||||
<view class="tag-text">
|
||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tag tag-education" v-if="job.education">
|
||||
<image class="tag-icon" :src="`${baseUrl}/jobfair/xx.png`" mode="aspectFit"></image>
|
||||
<view class="tag-text">
|
||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-location" v-if="job.jobLocation">
|
||||
<image class="location-icon" src="/static/icon/point3.png" mode="aspectFit"></image>
|
||||
<text class="location-text">{{ job.jobLocation }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -90,7 +107,7 @@ import config from "@/config.js";
|
||||
import { storeToRefs } from "pinia";
|
||||
import useLocationStore from "@/stores/useLocationStore";
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const { $api, navTo, vacanciesTo, navBack } = inject("globalFunction");
|
||||
const { $api, navTo, vacanciesTo, navBack, parseQueryParams } = inject("globalFunction");
|
||||
const isExpanded = ref(false);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
@@ -101,9 +118,16 @@ const pageState = reactive({
|
||||
});
|
||||
const companyInfo = ref({
|
||||
jobInfoList: [],
|
||||
companyName: '',
|
||||
scale: '',
|
||||
industry: '',
|
||||
description: '',
|
||||
isCollection: false
|
||||
});
|
||||
|
||||
const baseUrl = config.imgBaseUrl;
|
||||
const companyIdRef = ref(null);
|
||||
|
||||
const getItemBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
|
||||
backgroundSize: "100% 100%", // 覆盖整个容器
|
||||
@@ -111,14 +135,167 @@ const getItemBackgroundStyle = (imageName) => ({
|
||||
backgroundRepeat: "no-repeat",
|
||||
});
|
||||
|
||||
// 获取公司详情
|
||||
function getCompanyDetail(companyId) {
|
||||
if (!companyId) {
|
||||
console.error('companyId 不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
// 尝试获取公司详情,如果接口不存在,可能公司详情会包含在职位数据中
|
||||
$api.createRequest(`/app/company/${companyId}`).then((resData) => {
|
||||
if (resData && resData.data) {
|
||||
const data = resData.data;
|
||||
companyInfo.value = {
|
||||
...companyInfo.value,
|
||||
...data,
|
||||
companyName: data.name || data.companyName || data.company?.name || '',
|
||||
scale: data.scale || data.company?.scale || '',
|
||||
industry: data.industry || data.company?.industry || '',
|
||||
description: data.description || data.companyIntroduction || data.introduction || data.company?.introduction || '',
|
||||
isCollection: data.isCollection || false,
|
||||
// 如果接口直接返回了职位列表,也设置进去
|
||||
jobInfoList: data.jobInfoList || data.jobs || data.list || companyInfo.value.jobInfoList || []
|
||||
};
|
||||
console.log('companyInfo',companyInfo.value);
|
||||
}
|
||||
// 获取在招职位列表
|
||||
getCompanyJobs(companyId);
|
||||
}).catch((error) => {
|
||||
console.error('获取公司详情失败:', error);
|
||||
// 如果获取公司详情失败,尝试通过职位列表接口获取公司信息
|
||||
// 或者直接获取职位列表
|
||||
getCompanyJobs(companyId);
|
||||
});
|
||||
}
|
||||
|
||||
// 获取公司在招职位列表
|
||||
function getCompanyJobs(companyId) {
|
||||
if (!companyId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用正确的 API 路径:/app/company/job/{companyId}
|
||||
$api.createRequest(`/app/company/job/${companyId}`, {}, 'GET').then((resData) => {
|
||||
console.log('获取职位列表返回数据:', resData);
|
||||
if (resData) {
|
||||
// 优先检查 rows 字段(根据实际返回的数据结构)
|
||||
if (resData.rows && Array.isArray(resData.rows)) {
|
||||
companyInfo.value.jobInfoList = resData.rows;
|
||||
}
|
||||
// 如果返回的是数组
|
||||
else if (Array.isArray(resData)) {
|
||||
companyInfo.value.jobInfoList = resData;
|
||||
}
|
||||
// 如果返回的是对象,包含列表字段
|
||||
else if (resData.data) {
|
||||
if (Array.isArray(resData.data)) {
|
||||
companyInfo.value.jobInfoList = resData.data;
|
||||
} else if (resData.data.rows && Array.isArray(resData.data.rows)) {
|
||||
companyInfo.value.jobInfoList = resData.data.rows;
|
||||
} else if (resData.data.list && Array.isArray(resData.data.list)) {
|
||||
companyInfo.value.jobInfoList = resData.data.list;
|
||||
} else if (resData.data.jobInfoList && Array.isArray(resData.data.jobInfoList)) {
|
||||
companyInfo.value.jobInfoList = resData.data.jobInfoList;
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('获取在招职位列表失败:', error);
|
||||
companyInfo.value.jobInfoList = [];
|
||||
});
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
companyInfo.value = JSON.parse(options.job);
|
||||
console.log(companyInfo.value, "companyInfo.value");
|
||||
console.log('options',options);
|
||||
let companyId = null;
|
||||
|
||||
// 优先从 options 中获取 companyId(小程序和 H5 都支持)
|
||||
if (options && options.companyId) {
|
||||
companyId = decodeURIComponent(options.companyId);
|
||||
}
|
||||
// 如果 options 中没有,尝试从 URL 解析(仅 H5 环境)
|
||||
else {
|
||||
// 使用 try-catch 包裹,避免在小程序环境中访问 window.location 报错
|
||||
try {
|
||||
// #ifdef H5
|
||||
const params = parseQueryParams();
|
||||
companyId = params.companyId;
|
||||
// #endif
|
||||
} catch (e) {
|
||||
console.warn('解析 URL 参数失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('companyId', companyId);
|
||||
|
||||
if (companyId) {
|
||||
companyIdRef.value = companyId;
|
||||
getCompanyDetail(companyId);
|
||||
} else {
|
||||
console.error('未获取到 companyId 参数');
|
||||
// 如果参数名是 job,尝试兼容旧的方式
|
||||
if (options && options.job) {
|
||||
try {
|
||||
const parsedData = JSON.parse(options.job);
|
||||
if (parsedData.companyId) {
|
||||
companyIdRef.value = parsedData.companyId;
|
||||
getCompanyDetail(parsedData.companyId);
|
||||
} else {
|
||||
companyInfo.value = { ...companyInfo.value, ...parsedData };
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('解析 job 参数失败:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 仅在 H5 环境中从 URL 获取参数(小程序环境中 onShow 不会传递 URL 参数)
|
||||
// #ifdef H5
|
||||
try {
|
||||
const params = parseQueryParams();
|
||||
const companyId = params.companyId;
|
||||
|
||||
if (companyId && companyId !== companyIdRef.value) {
|
||||
companyIdRef.value = companyId;
|
||||
getCompanyDetail(companyId);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('onShow 中解析 URL 参数失败:', e);
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
|
||||
function expand() {
|
||||
isExpanded.value = !isExpanded.value;
|
||||
}
|
||||
|
||||
// 格式化薪资范围
|
||||
function formatSalary(minSalary, maxSalary) {
|
||||
if (minSalary && maxSalary) {
|
||||
return `${minSalary}-${maxSalary}`;
|
||||
} else if (minSalary) {
|
||||
return `${minSalary}起`;
|
||||
} else if (maxSalary) {
|
||||
return `最高${maxSalary}`;
|
||||
}
|
||||
return '面议';
|
||||
}
|
||||
|
||||
// 截断文本,超过指定长度显示省略号
|
||||
function truncateText(text, maxLength) {
|
||||
if (!text) return '';
|
||||
if (text.length <= maxLength) return text;
|
||||
return text.substring(0, maxLength) + '...';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -259,94 +436,136 @@ image {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cards {
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
.job-card-wrapper {
|
||||
margin-top: 22rpx;
|
||||
padding-bottom: 18rpx;
|
||||
|
||||
.card-company {
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cards {
|
||||
padding: 30rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.08);
|
||||
border-radius: 24rpx;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0rpx 1rpx 8rpx 0rpx rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
margin-bottom: 0;
|
||||
|
||||
.card-title-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.company {
|
||||
font-weight: 600;
|
||||
.job-title {
|
||||
flex: 1;
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
text-align: left;
|
||||
word-break: break-all;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.salary {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #F83A3C;
|
||||
white-space: nowrap;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card-companyName {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
margin-top: 23rpx;
|
||||
.card-pay {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
|
||||
.pay-text {
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
line-height: 45rpx;
|
||||
white-space: nowrap;
|
||||
|
||||
.salary-amount {
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.salary-unit {
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #4C6EFB;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 25rpx 0 35rpx;
|
||||
image{
|
||||
gap: 10rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F4F4F4;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
white-space: nowrap;
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
|
||||
.tag-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.jy {
|
||||
background: #D9EDFF;
|
||||
color: #0086FF;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.xl {
|
||||
background: #FFF1D5;
|
||||
color: #FF7F01;
|
||||
.tag-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.yd {
|
||||
background: #FFD8D8;
|
||||
color: #F83A3C;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
border-radius: 4rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
line-height: 30rpx;
|
||||
.card-location {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.location-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 4rpx;
|
||||
margin-top: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.location-text {
|
||||
flex: 1;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
line-height: 25rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.card-bottom {
|
||||
margin-top: 32rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的浏览" :show-bg-image="false" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="collection-content">
|
||||
<view class="collection-search">
|
||||
<view class="search-content">
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的收藏" :show-bg-image="false" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="collection-content">
|
||||
<view class="header">
|
||||
<view class="button-click" :class="{ active: type === 0 }" @click="changeType(0)">工作职位</view>
|
||||
|
||||
@@ -16,25 +16,52 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
// 获取雷达图数据
|
||||
function getRadarData() {
|
||||
if (!props.value || !props.value.radarChart) {
|
||||
// 如果没有数据,使用默认值0
|
||||
const defaultRadarChart = {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
};
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [defaultRadarChart.education, defaultRadarChart.age, defaultRadarChart.location,
|
||||
defaultRadarChart.skill, defaultRadarChart.experience, defaultRadarChart.salary].map((item) => item * 0.05);
|
||||
return { labels, data };
|
||||
}
|
||||
|
||||
const { skill, experience, education, salary, age, location } = props.value.radarChart;
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [education, age, location, skill, experience, salary].map((item) => item * 0.05);
|
||||
return { labels, data };
|
||||
}
|
||||
|
||||
// 监听页面初始化
|
||||
onMounted(() => {
|
||||
if (Object.keys(props.value).length > 0) {
|
||||
rawRadarChart();
|
||||
}
|
||||
// 延迟执行,确保 canvas 已经渲染
|
||||
setTimeout(() => {
|
||||
const { labels, data } = getRadarData();
|
||||
rawRadarChart(labels, data);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// 监听 props.value 变化
|
||||
watch(
|
||||
() => props.value,
|
||||
(newVal) => {
|
||||
if (newVal && Object.keys(newVal).length > 0) {
|
||||
const { skill, experience, education, salary, age, location } = newVal.radarChart;
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [education, age, location, skill, experience, salary].map((item) => item * 0.05);
|
||||
if (newVal) {
|
||||
// 延迟执行,确保数据更新完成
|
||||
setTimeout(() => {
|
||||
const { labels, data } = getRadarData();
|
||||
rawRadarChart(labels, data);
|
||||
}, 50);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: false } // deep 递归监听对象内部变化
|
||||
{ deep: true, immediate: true } // deep 递归监听对象内部变化,immediate 立即执行一次
|
||||
);
|
||||
|
||||
function rawRadarChart(labels, data) {
|
||||
|
||||
@@ -208,7 +208,20 @@ const jobInfo = ref({});
|
||||
const state = reactive({});
|
||||
const mapCovers = ref([]);
|
||||
const jobIdRef = ref();
|
||||
const raderData = ref({});
|
||||
// 竞争力分析数据,初始化为包含默认值的完整结构,确保雷达图能正常渲染
|
||||
const raderData = ref({
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
});
|
||||
const videoPalyerRef = ref(null);
|
||||
const explainUrlRef = ref('');
|
||||
|
||||
@@ -246,10 +259,17 @@ onLoad((option) => {
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 仅在 H5 环境中从 URL 获取参数(小程序环境中 onShow 不会传递 URL 参数)
|
||||
// #ifdef H5
|
||||
try {
|
||||
const option = parseQueryParams(); // 兼容微信内置浏览器
|
||||
if (option.jobId) {
|
||||
initLoad(option);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('onShow 中解析 URL 参数失败:', e);
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
|
||||
function initLoad(option) {
|
||||
@@ -317,8 +337,59 @@ function getTextWidth(text, size = 12) {
|
||||
|
||||
function getCompetivetuveness(jobId) {
|
||||
$api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => {
|
||||
raderData.value = resData.data;
|
||||
currentStep.value = resData.data.matchScore * 0.04;
|
||||
// 如果接口返回的数据为 null 或空,使用默认值0
|
||||
if (resData && resData.data) {
|
||||
// 确保 radarChart 字段存在,如果不存在则使用默认值
|
||||
const radarChart = resData.data.radarChart || {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
};
|
||||
|
||||
raderData.value = {
|
||||
matchScore: resData.data.matchScore || 0,
|
||||
rank: resData.data.rank || 0,
|
||||
percentile: resData.data.percentile || 0,
|
||||
radarChart: radarChart
|
||||
};
|
||||
currentStep.value = (resData.data.matchScore || 0) * 0.04;
|
||||
} else {
|
||||
// 接口返回 null 或空数据时,使用默认值0
|
||||
raderData.value = {
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
};
|
||||
currentStep.value = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
// 接口请求失败时,使用默认值0
|
||||
console.error('获取竞争力分析失败:', error);
|
||||
raderData.value = {
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
};
|
||||
currentStep.value = 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
<image src="../../../static/images/train/bj.jpg" class="bjImg" mode=""></image>
|
||||
<div class="con-box">
|
||||
<div class="header">
|
||||
<div>正确率:0%</div>
|
||||
<div>用时:00:00</div>
|
||||
<div class="headBtn">暂停</div>
|
||||
<div>正确率:{{accuracyRate}}%</div>
|
||||
<div>用时:{{formattedTime}}</div>
|
||||
<div class="headBtn" v-if="isRunning" @click="pause">暂停</div>
|
||||
<div class="headBtn" v-if="!isRunning" @click="start">继续</div>
|
||||
</div>
|
||||
<div class="problemCard">
|
||||
<div v-for="(item,index) in problemData" :key="index">
|
||||
@@ -37,15 +38,15 @@
|
||||
<span>错误</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="analysis">
|
||||
<div class="analysisHead correct">
|
||||
<div class="analysis" v-if="analysis">
|
||||
<div class="analysisHead correct" v-if="judgWhether=='正确'">
|
||||
<div>回答正确!</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!-- <div class="analysisHead errors" v-if="judgWhether=='错误'">
|
||||
<div class="analysisHead errors" v-if="judgWhether=='错误'">
|
||||
<div>回答错误!</div>
|
||||
<div></div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">正确答案:</div>
|
||||
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
|
||||
@@ -66,38 +67,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="problemBtns">
|
||||
<div class="events">提交答案</div>
|
||||
<div>下一题</div>
|
||||
<div v-if="analysis&&judgWhether!=''&&questionIndex!=problemData.length" @click="questionIndex.value+=1">下一题</div>
|
||||
<div v-else :class="(radio==''&&radio2==''&&checkList.length==0&&isRunning)?'events':''">提交答案</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="footerLeft">
|
||||
<div class="zuo events"></div>
|
||||
<div class="you"></div>
|
||||
<div style="text-align: center;font-size: 24rpx;">
|
||||
<image :src="urls+'wsc.png'" mode=""></image>
|
||||
<div class="zuo" :class="questionIndex==1?'events':''" @click="questionIndex-=1"></div>
|
||||
<div class="you" :class="questionIndex==problemData.length?'events':''" @click="questionIndex+=1"></div>
|
||||
<div @click="collect(1)" style="text-align: center;font-size: 24rpx;" v-if="(problemData[questionIndex - 1]?.isCollect || 0)!=1">
|
||||
<image :src="urls+'wsc.png'" mode="" style="width: 34rpx;height: 32rpx;"></image>
|
||||
<div>收藏</div>
|
||||
</div>
|
||||
<!-- <div style="text-align: center;font-size: 24rpx;">
|
||||
<image :src="urls+'video-sc.png'" mode=""></image>
|
||||
<div @click="collect(0)" style="text-align: center;font-size: 24rpx;" v-if="(problemData[questionIndex - 1]?.isCollect || 0)==1">
|
||||
<image :src="urls+'video-sc.png'" mode="" style="width: 34rpx;height: 32rpx;"></image>
|
||||
<div>取消</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="footerBtn">完成练习</div>
|
||||
<div class="footerLeft">
|
||||
<div>
|
||||
<div class="icons" style="background-color: #1CADF5;">√</div>
|
||||
<div class="texts" style="color: #1CADF5;">1</div>
|
||||
<div class="texts" style="color: #1CADF5;">{{correctIndex}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="icons" style="background-color: #FF6668;">×</div>
|
||||
<div class="texts" style="color: #FF6668;">0</div>
|
||||
<div class="texts" style="color: #FF6668;">{{errorsIndex}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div @click="dialogVisible=true">
|
||||
<div><span style="color: #1CADF5;">{{questionIndex}}</span>/{{problemData.length}}</div>
|
||||
<div>题号</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,18 +109,22 @@
|
||||
<div>题号</div>
|
||||
<div style="font-size: 40rpx;" @click="clones()">×</div>
|
||||
</div>
|
||||
<div class="questionNums">
|
||||
<div class="questions" :class="item.whether=='正确'?'questionCorrect':item.whether=='错误'?'questionError':questionIndex==(index+1)?'questionsActive':''" @click="switchs(index)" v-for="(item,index) in problemList" :key="index">{{index+1}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api,urls , navTo, vacanciesTo, formatTotal, config } = inject('globalFunction');
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
|
||||
const userInfo = ref({});
|
||||
const Authorization = ref('');
|
||||
const radio = ref('');
|
||||
const radio2 = ref('');
|
||||
const checkList = ref([]);
|
||||
@@ -127,30 +132,121 @@ const questionIndex = ref(1);
|
||||
const correctIndex = ref(0);
|
||||
const errorsIndex = ref(0);
|
||||
const accuracyRate = ref(0);
|
||||
const dialogVisible = ref(true);
|
||||
const problemData = reactive([
|
||||
{
|
||||
type:'single',
|
||||
content:"君不见黄河之水天上来,下一句是?",
|
||||
fraction:5,
|
||||
trainChooses:"奔流到海不复回,朝如青丝暮成雪,人生得意须尽欢,莫使金樽空对月",
|
||||
},{
|
||||
type:'multiple',
|
||||
content:"以下哪些是欧姆定律的适用条件?",
|
||||
fraction:8,
|
||||
trainChooses:"线性电阻,恒定温度,金属导体,半导体材料",
|
||||
const elapsedTime = ref(0);
|
||||
const analysis = ref(false);
|
||||
const judgWhether = ref('');
|
||||
const isRunning = ref(false);
|
||||
const dialogVisible = ref(false);
|
||||
const problemData = ref([]);
|
||||
const problemList = ref([]);
|
||||
let timer = null;
|
||||
const formattedTime = computed(() => {
|
||||
const minutes = Math.floor(elapsedTime.value / 60)
|
||||
const seconds = elapsedTime.value % 60
|
||||
return `${padTime(minutes)}:${padTime(seconds)}`
|
||||
});
|
||||
watch(questionIndex, (newVal, oldVal) => {
|
||||
radio.value=""
|
||||
radio2.value=""
|
||||
checkList.value=[]
|
||||
analysis.value=false
|
||||
judgWhether.value=""
|
||||
});
|
||||
|
||||
},{
|
||||
type:'judge',
|
||||
content:"功率越大的电器,其电阻值越小",
|
||||
fraction:2,
|
||||
trainChooses:[
|
||||
"正确",
|
||||
"错误",
|
||||
]
|
||||
// watch(problemData, (newVal, oldVal) => {
|
||||
// problemList.value=[];
|
||||
// newVal.forEach((item,i)=>{
|
||||
// problemList.value.push({index:i+1,whether:""})
|
||||
// })
|
||||
// });
|
||||
|
||||
onLoad((options) => {
|
||||
userInfo.value = uni.getStorageSync('userInfo') || {};
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
queryData();
|
||||
});
|
||||
onShow(()=>{
|
||||
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
if (timer) {
|
||||
clearInterval(timer); // 清除定时器
|
||||
timer = null; // 防止内存泄漏,确保下次不会再误用已清除的定时器
|
||||
}
|
||||
]);
|
||||
});
|
||||
function queryData(){
|
||||
problemData.value=[]
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/trainPractice/getQuestions', {
|
||||
userId: userInfo.value.userId
|
||||
},'post',9100,header).then((resData) => {
|
||||
resData.forEach((item,i)=>{
|
||||
problemData.value.push(item)
|
||||
problemList.value.push({index:i+1,whether:""})
|
||||
})
|
||||
start()
|
||||
accuracyRates()
|
||||
});
|
||||
}
|
||||
function collect(is){
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/questionUser/addOrUpdateCollect', {
|
||||
userId: userInfo.value.userId,
|
||||
questionId:problemData.value[this.questionIndex-1].questionId,
|
||||
collect:is
|
||||
},'post',9100,header).then((resData) => {
|
||||
problemData.value[questionIndex.value-1].isCollect=is
|
||||
});
|
||||
};
|
||||
//正确率
|
||||
function accuracyRates(){
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/trainPractice/getCount', {
|
||||
userId: userInfo.value.userId,
|
||||
},'post',9100,header).then((resData) => {
|
||||
// debugger
|
||||
// accuracyRate.value=resData.truePresent
|
||||
});
|
||||
};
|
||||
//提交答案
|
||||
function submit(){
|
||||
let indexs=questionIndex.value-1
|
||||
let parm={
|
||||
questionId:problemData.value[indexs].questionId,
|
||||
userId:userInfo.value.userId,
|
||||
answer:this.problemData.value[indexs].answer
|
||||
}
|
||||
if(problemData.value[indexs].type=='single'){
|
||||
parm.submitAnswer=radio.value
|
||||
}else if(this.problemData[indexs].type=='multiple'){
|
||||
parm.submitAnswer=this.checkList.join(',')
|
||||
}else if(this.problemData[indexs].type=='judge'){
|
||||
parm.submitAnswer=this.radio2
|
||||
}
|
||||
startTrainingApi.submitAnswer(parm).then((res)=>{
|
||||
|
||||
if(res&&res.code==200){
|
||||
this.analysis=true
|
||||
this.judgWhether=res.msg
|
||||
this.problemList[indexs].whether=res.msg
|
||||
if(res.msg=='正确'){
|
||||
this.correctIndex++
|
||||
}else if(res.msg=='错误'){
|
||||
this.errorsIndex++
|
||||
}
|
||||
this.accuracyRates()
|
||||
}
|
||||
})
|
||||
};
|
||||
function selected(i){
|
||||
radio.value=i
|
||||
};
|
||||
@@ -194,9 +290,28 @@ function indexToLetter(index) {
|
||||
// 将索引转换为对应的字母
|
||||
return String.fromCharCode(65 + index);
|
||||
};
|
||||
function padTime(time) {
|
||||
return time < 10 ? `0${time}` : time
|
||||
};
|
||||
function start() {
|
||||
if (isRunning.value) return
|
||||
isRunning.value = true
|
||||
timer = setInterval(() => {
|
||||
elapsedTime.value++
|
||||
}, 1000)
|
||||
};
|
||||
function pause() {
|
||||
if (!isRunning.value) return
|
||||
clearInterval(timer)
|
||||
isRunning.value = false
|
||||
};
|
||||
function clones(){
|
||||
dialogVisible.value=false
|
||||
}
|
||||
};
|
||||
function switchs(i){
|
||||
questionIndex.value=(i+1)
|
||||
dialogVisible.value=false
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -358,20 +473,20 @@ function clones(){
|
||||
font-size: 30rpx;
|
||||
text-align: center
|
||||
.zuo{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-top: 2px solid #666
|
||||
border-left: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
margin-left: 50rpx;
|
||||
margin-left: 60rpx;
|
||||
}
|
||||
.you{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-right: 2px solid #666
|
||||
border-bottom: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
margin-left: 30rpx;
|
||||
// margin-left: 30rpx;
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
.icons{
|
||||
@@ -423,6 +538,36 @@ function clones(){
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.questionNums{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.questions{
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2px solid #E0E0E0;
|
||||
font-size: 28rpx;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.questionsActive{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #409EFF;
|
||||
}
|
||||
.questionCorrect{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #64BC38;
|
||||
color: #6BC441;
|
||||
}
|
||||
.questionError{
|
||||
background-color: #FFF1F0;
|
||||
border: 2px solid #F56C6C;
|
||||
color: #F36B6B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<view class="video-detail-container">
|
||||
<!-- 视频播放组件 -->
|
||||
<view class="video-wrapper">
|
||||
<video id="myVideo" :src="videoInfo.currentUrl" :poster="trainVideoImgUrl+ videoInfo.cover"
|
||||
enable-danmu controls style="width: 100%;"></video>
|
||||
<video id="myVideo" :src="videoInfo.currentUrl" :poster="trainVideoImgUrl+ videoInfo.cover" @seeked="onSeeked"
|
||||
enable-danmu controls style="width: 100%;" @pause="onPause" @timeupdate="onTimeupdate" @ended="onEnded"></video>
|
||||
</view>
|
||||
</view>
|
||||
<view class="video-info" :style="getItemBackgroundStyle('video-bj2.png')">
|
||||
@@ -21,18 +21,18 @@
|
||||
<view class="info-detail">
|
||||
<view class="info-left">
|
||||
<view class="info-item">
|
||||
<image class="icon-img" src="../../../static/images/train/zs.png" mode=""></image>
|
||||
<image class="icon-img" :src="baseUrl+'/train/zs.png'" mode=""></image>
|
||||
<view class="info-label">
|
||||
分类:
|
||||
</view>
|
||||
<view class="info-value">
|
||||
<view class="info-value" :data-content="getCategoryLabelByValue(videoInfo.category)">
|
||||
{{getCategoryLabelByValue(videoInfo.category)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-right">
|
||||
<view class="info-item">
|
||||
<image class="icon-img" src="../../../static/images/train/zs.png" mode=""></image>
|
||||
<image class="icon-img" :src="baseUrl+'/train/zs.png'" mode=""></image>
|
||||
<view class="info-label">
|
||||
等级:
|
||||
</view>
|
||||
@@ -41,7 +41,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<image class="icon-img" src="../../../static/images/train/zs.png" mode=""></image>
|
||||
<image class="icon-img" :src="baseUrl+'/train/zs.png'" mode=""></image>
|
||||
<view class="info-label">
|
||||
讲师:
|
||||
</view>
|
||||
@@ -54,7 +54,7 @@
|
||||
<view class="info-detail">
|
||||
<view class="info-left">
|
||||
<view class="info-item">
|
||||
<image class="icon-img" src="../../../static/images/train/zs.png" mode=""></image>
|
||||
<image class="icon-img" :src="baseUrl+'/train/zs.png'" mode=""></image>
|
||||
<view class="info-label">
|
||||
时长:
|
||||
</view>
|
||||
@@ -65,7 +65,7 @@
|
||||
</view>
|
||||
<view class="info-right">
|
||||
<view class="info-item">
|
||||
<image class="icon-img" src="../../../static/images/train/zs.png" mode=""></image>
|
||||
<image class="icon-img" :src="baseUrl+'/train/zs.png'" mode=""></image>
|
||||
<view class="info-label">
|
||||
发布时间:
|
||||
</view>
|
||||
@@ -77,14 +77,14 @@
|
||||
</view>
|
||||
<view class="video-intro" :style="videoIntroBackgroundStyle('video-bj.png')">
|
||||
<view class="intro-title">
|
||||
<image class="intro-img1" src="../../../static/images/train/video-kc.png" mode=""></image>
|
||||
<image class="intro-img1" :src="baseUrl+'/train/video-kc.png'" mode=""></image>
|
||||
<view class="title1">
|
||||
课程
|
||||
</view>
|
||||
<view class="title2">
|
||||
简介
|
||||
</view>
|
||||
<image class="intro-img2" src="../../../static/images/train/video-sc.png" mode=""></image>
|
||||
<image class="intro-img2" :src="baseUrl+'/train/video-sc.png'" mode=""></image>
|
||||
</view>
|
||||
<view class="intro-content">
|
||||
{{videoInfo.introduce}}
|
||||
@@ -105,6 +105,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="video-title" v-if="videoInfo.trainClassList && videoInfo.trainClassList.length>0">
|
||||
<text>课程章节</text>
|
||||
<view class="title-line"></view>
|
||||
</view>
|
||||
<view class="chapter-box" v-if="videoInfo.trainClassList && videoInfo.trainClassList.length>0">
|
||||
<view class="chapter-item" :class="{ active: currentChapter === index}" @click="chapterChange(item,index)" v-for="(item ,index) in videoInfo.trainClassList" :key="index">
|
||||
<view class="chapter-left">
|
||||
<view class="chapter-number">
|
||||
{{ index + 1 }}
|
||||
</view>
|
||||
<view class="chapter-info">
|
||||
{{item.className}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="chapter-icon" v-if="currentChapter === index">
|
||||
<uni-icons type="videocam" size="24"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -114,7 +133,7 @@
|
||||
|
||||
<script setup>
|
||||
import { inject, reactive,ref, onMounted, onUnmounted, nextTick } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onLoad,onHide,onUnload } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
|
||||
@@ -126,11 +145,11 @@ const videoInfo=ref({})
|
||||
const trainVideoImgUrl=config.trainVideoImgUrl
|
||||
const categories=ref([])
|
||||
const levalLabels=ref([])
|
||||
const videoContext = ref(null);
|
||||
const videoUrl = ref('');
|
||||
const posterUrl = ref('');
|
||||
const videoTitle = ref('');
|
||||
const latestTime = ref(0)
|
||||
const totalTime=ref(0)
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const pageEnterTime = ref(0)
|
||||
const currentChapter = ref(0)
|
||||
const getItemBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/train/${imageName})`,
|
||||
backgroundSize: '100% 100%', // 覆盖整个容器
|
||||
@@ -146,21 +165,21 @@ const videoIntroBackgroundStyle = (imageName) => ({
|
||||
const params = reactive({
|
||||
videoId: '',
|
||||
userId: ''
|
||||
})
|
||||
})
|
||||
onLoad((options) => {
|
||||
console.log("options",options)
|
||||
getHeart()
|
||||
pageEnterTime.value = Date.now() // 记录毫秒时间戳
|
||||
videoId.value=options.id
|
||||
userId.value=uni.getStorageSync('userInfo').userId
|
||||
getDictionary()
|
||||
getData()
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化视频上下文
|
||||
// nextTick(() => {
|
||||
// videoContext.value = uni.createVideoContext('videoPlayer');
|
||||
// });
|
||||
});
|
||||
onHide(() => {
|
||||
updateVideoInfo() // 用缓存值,不要调 getCurrentTime
|
||||
reportPageDuration()
|
||||
})
|
||||
onUnload(() => {
|
||||
updateVideoInfo()
|
||||
reportPageDuration()
|
||||
})
|
||||
function getData() {
|
||||
params.videoId=videoId.value
|
||||
params.userId=userId.value
|
||||
@@ -172,16 +191,35 @@ function getData() {
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/trainVideo/model', params,'post',9100,header).then((resData) => {
|
||||
console.log("resData",resData)
|
||||
videoInfo.value=resData
|
||||
videoInfo.value.currentUrl=trainVideoImgUrl+videoInfo.value.trainClassList[0].url
|
||||
console.log("videoInfo.value.currentUrl",videoInfo.value.currentUrl)
|
||||
videoInfo.value.percentage=(videoInfo.value.process/(videoInfo.value.hour*60))*100
|
||||
console.log("videoInfo",videoInfo.value)
|
||||
videoInfo.value.percentage=((videoInfo.value.process/(videoInfo.value.hour*60))*100).toFixed(2)
|
||||
videoInfo.value.uploadTime=videoInfo.value.uploadTime.split(' ')[0]
|
||||
});
|
||||
}
|
||||
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}` }: {}
|
||||
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
|
||||
if (resData.code == 200) {
|
||||
getUserInfo();
|
||||
} else {
|
||||
navTo('/packageB/login')
|
||||
}
|
||||
});
|
||||
}
|
||||
function getUserInfo(){
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token')
|
||||
}
|
||||
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
|
||||
userId.value=resData.info.userId
|
||||
getData()
|
||||
});
|
||||
}
|
||||
function getDictionary(){
|
||||
$api.myRequest('/system/public/dict/data/type/train_category', {},'get',9100).then((resData) => {
|
||||
$api.myRequest('/system/public/dict/data/type/question_classification', {},'get',9100).then((resData) => {
|
||||
categories.value=resData.data
|
||||
});
|
||||
$api.myRequest('/system/public/dict/data/type/train_level', {},'get',9100).then((resData) => {
|
||||
@@ -204,13 +242,76 @@ function getLevelLabelByValue(value) {
|
||||
const item = levalLabels.value.find(item => item.dictValue === String(value))
|
||||
return item ? item.dictLabel : '暂无等级'
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
// 组件卸载时停止播放并退出全屏
|
||||
if (videoContext.value) {
|
||||
videoContext.value.pause();
|
||||
videoContext.value.exitFullScreen();
|
||||
function onPause(e){
|
||||
updateVideoInfo()
|
||||
}
|
||||
function onEnded(e){
|
||||
updateVideoInfo()
|
||||
}
|
||||
function onTimeupdate(e){
|
||||
latestTime.value = e.detail.currentTime
|
||||
}
|
||||
function onSeeked(){
|
||||
updateVideoInfo()
|
||||
}
|
||||
// 更新播放时长
|
||||
function updateVideoInfo(){
|
||||
totalTime.value=0
|
||||
if(currentChapter.value>0){
|
||||
videoInfo.value.trainClassList.forEach((item,index)=>{
|
||||
if(index<currentChapter.value){
|
||||
totalTime.value+=Number(item.hour)
|
||||
}
|
||||
})
|
||||
}
|
||||
totalTime.value+=Number(latestTime.value)
|
||||
let paramsData={
|
||||
userId:userId.value,
|
||||
videoId:videoId.value,
|
||||
collect:'',
|
||||
process:Math.floor(Number(totalTime.value))
|
||||
}
|
||||
let header={
|
||||
'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("视频播放时长更新成功")
|
||||
});
|
||||
}
|
||||
}
|
||||
// 计算并上报停留时长
|
||||
function reportPageDuration() {
|
||||
const duration = Date.now() - pageEnterTime.value // 毫秒
|
||||
const durationSeconds = Math.floor(duration / 1000) // 转为秒
|
||||
if (durationSeconds > 0) {
|
||||
let paramsData={
|
||||
type:'video',
|
||||
hour:durationSeconds,
|
||||
videoId:videoId.value,
|
||||
userId:userId.value,
|
||||
title:videoInfo.value.videoTitle
|
||||
}
|
||||
let header={
|
||||
'Authorization':uni.getStorageSync('Padmin-Token'),
|
||||
'Content-Type': "application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/userHour/add', paramsData,'post',9100,header).then((resData) => {
|
||||
console.log("学习时长更新成功")
|
||||
});
|
||||
}
|
||||
}
|
||||
function chapterChange(video,index){
|
||||
currentChapter.value=index
|
||||
videoInfo.value.currentUrl=trainVideoImgUrl+video.url
|
||||
}
|
||||
onUnmounted(() => {
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -277,15 +378,20 @@ onUnmounted(() => {
|
||||
.icon-img{
|
||||
width: 24rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
.info-label{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #0068C8;
|
||||
min-width: 86rpx;
|
||||
}
|
||||
.info-value{
|
||||
font-size: 28rpx;
|
||||
color: #404040;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.video-intro{
|
||||
padding: 20rpx;
|
||||
@@ -326,6 +432,7 @@ onUnmounted(() => {
|
||||
box-shadow: 0px 0px 10px 0px rgba(0,48,107,0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.progress-info{
|
||||
display: flex;
|
||||
@@ -335,4 +442,51 @@ onUnmounted(() => {
|
||||
color: #333333;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.chapter-box{
|
||||
background: linear-gradient(0deg, #DFEDFF 0%, #F8FCFF 100%);
|
||||
box-shadow: 0px 0px 10px 0px rgba(0,48,107,0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
.chapter-item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 24rpx;
|
||||
border-radius: 12rpx;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
margin-bottom: 16rpx;
|
||||
border: 2rpx solid #F0F0F0;
|
||||
background: #F9F9F9;
|
||||
}
|
||||
.chapter-item.active {
|
||||
background-color: #e6f7ff;
|
||||
color: #409EFF;
|
||||
}
|
||||
.chapter-left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chapter-number{
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background: #cccccc;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
margin-right: 16rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.chapter-item.active .chapter-number {
|
||||
background: #409EFF;
|
||||
color: #fff;
|
||||
}
|
||||
.chapter-info {
|
||||
font-size: 28rpx;
|
||||
color: #303133;
|
||||
}
|
||||
</style>
|
||||
|
||||
231
pages.json
231
pages.json
@@ -1,21 +1,17 @@
|
||||
{
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "喀什智慧就业平台",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/mine",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -23,8 +19,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom",
|
||||
// "enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -32,7 +26,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "招聘会",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -40,7 +33,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "补全信息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -48,14 +40,12 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业信息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/complete-info/components/map-location-picker",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择地址",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "选择地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -63,68 +53,55 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "附近",
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/userTypeTest",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户类型测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "用户类型测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/tabbar-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "TabBar测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "TabBar测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/homepage-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页内容测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "首页内容测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/tabbar-user-type-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "TabBar用户类型测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "TabBar用户类型测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/company-search-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业搜索功能测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "企业搜索功能测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/company-mine-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业我的页面测试",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "企业我的页面测试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/job/publishJob",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布岗位"
|
||||
// "navigationStyle": "custom",
|
||||
// "disableScroll": false,
|
||||
// "enablePullDownRefresh": false,
|
||||
// "onReachBottomDistance": 50,
|
||||
// "backgroundColor": "#f5f5f5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/job/companySearch",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择企业",
|
||||
"navigationStyle": "custom",
|
||||
"disableScroll": false,
|
||||
"enablePullDownRefresh": false,
|
||||
"backgroundColor": "#f5f5f5"
|
||||
@@ -138,16 +115,12 @@
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white",
|
||||
"enablePullDownRefresh": false
|
||||
// #ifdef H5
|
||||
// "navigationStyle": "custom"
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/search/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -155,7 +128,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -172,71 +144,70 @@
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"subpackages": [{
|
||||
"subpackages": [
|
||||
{
|
||||
"root": "packageA",
|
||||
"pages": [
|
||||
{
|
||||
"path" : "pages/addWorkExperience/addWorkExperience",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "添加工作经历",
|
||||
"path": "pages/addWorkExperience/addWorkExperience",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加工作经历",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "pages/choiceness/choiceness",
|
||||
"style": {
|
||||
"navigationBarTitleText": "精选",
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/post/post",
|
||||
"style": {
|
||||
"navigationBarTitleText": "职位详情",
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/UnitDetails/UnitDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "单位详情"
|
||||
// "navigationBarBackgroundColor": "#4778EC",
|
||||
// "navigationBarTextStyle": "white"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/exhibitors/exhibitors",
|
||||
"style": {
|
||||
"navigationBarTitleText": "参展单位",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationBarTextStyle": "black"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/myResume/myResume",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的简历",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/Intendedposition/Intendedposition",
|
||||
"style": {
|
||||
"navigationBarTitleText": "投递记录",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/collection/collection",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的收藏",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -244,31 +215,27 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的浏览",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/addPosition/addPosition",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加岗位",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/selectDate/selectDate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/personalInfo/personalInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -276,7 +243,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "求职期望",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -292,8 +258,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "精选企业",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -316,8 +281,7 @@
|
||||
"path": "pages/tiktok/tiktok",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -350,75 +314,59 @@
|
||||
"root": "packageB",
|
||||
"pages": [
|
||||
{
|
||||
"path" : "jobFair/detail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "招聘会详情",
|
||||
"path": "jobFair/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "招聘会详情",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "login",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "登录",
|
||||
"path": "login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "技能评价",
|
||||
"path": "train/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "技能评价",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/practice/startPracticing",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "专项训练",
|
||||
"path": "train/practice/startPracticing",
|
||||
"style": {
|
||||
"navigationBarTitleText": "专项训练",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/video/videoList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "视频学习",
|
||||
"path": "train/video/videoList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "视频学习",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/video/videoDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "视频详情",
|
||||
"path": "train/video/videoDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "视频详情",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/mockExam/examList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "模拟考试",
|
||||
"path": "train/mockExam/examList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "模拟考试",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "train/mockExam/viewGrades",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "查看成绩",
|
||||
"path": "train/mockExam/viewGrades",
|
||||
"style": {
|
||||
"navigationBarTitleText": "查看成绩",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -427,17 +375,18 @@
|
||||
"root": "packageRc",
|
||||
"pages": [
|
||||
{
|
||||
"path" : "pages/index/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "高校毕业生智慧就业"
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "高校毕业生智慧就业"
|
||||
}
|
||||
} , {
|
||||
},
|
||||
{
|
||||
"path": "pages/personalList/personalList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加帮扶"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "pages/daiban/daiban",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待办任务"
|
||||
@@ -449,23 +398,55 @@
|
||||
"navigationBarTitleText": "待办详情"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/demand/demandail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增需求"
|
||||
}
|
||||
} , {
|
||||
},
|
||||
{
|
||||
"path": "pages/daiban/addbangfu",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加帮扶"
|
||||
}
|
||||
} , {
|
||||
},
|
||||
{
|
||||
"path": "pages/service/serviceDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务"
|
||||
}
|
||||
} , {
|
||||
},
|
||||
{
|
||||
"path": "pages/needs/needDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "需求"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/daiban/daibandetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待办详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/demand/demandail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增需求"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/daiban/addbangfu",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加帮扶"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/service/serviceDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/needs/needDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "需求"
|
||||
@@ -665,8 +646,6 @@
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"navigationBarTitleTextSize": "18px"
|
||||
// "enablePullDownRefresh": false,
|
||||
// "navigationStyle": "custom"
|
||||
},
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
<view class="app-container">
|
||||
<!-- 顶部头部区域 -->
|
||||
<view class="container-header">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序使用 image 标签作为背景 -->
|
||||
<image class="header-bg-image" src="/static/icon/background2.png" mode="aspectFill"></image>
|
||||
<!-- #endif -->
|
||||
<view class="header-top">
|
||||
<view
|
||||
class="header-btnLf button-click"
|
||||
@@ -507,14 +511,33 @@ function getNextDates({ startDate = "", count = 6 }) {
|
||||
}
|
||||
|
||||
.app-container .container-header {
|
||||
position: relative;
|
||||
/* #ifndef MP-WEIXIN */
|
||||
background: url("@/static/icon/background2.png") 0 0 no-repeat;
|
||||
background-size: 100% 400rpx;
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
/* 小程序使用 image 标签,背景样式在 image 上设置 */
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
/* #ifdef MP-WEIXIN */
|
||||
.app-container .container-header .header-bg-image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
.app-container .container-header .header-top {
|
||||
display: flex;
|
||||
line-height: calc(88rpx - 14rpx);
|
||||
padding: 16rpx 44rpx 14rpx 44rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.app-container .container-header .header-top .header-btnLf {
|
||||
@@ -551,6 +574,7 @@ function getNextDates({ startDate = "", count = 6 }) {
|
||||
padding: 0 24rpx;
|
||||
width: calc(100% - 48rpx);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.app-container .container-header .header-input .iconsearch {
|
||||
|
||||
@@ -701,9 +701,43 @@ const handleServiceClick = (serviceType) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 处理直播按钮点击
|
||||
// 处理直播按钮点击 - 跳转微信视频号
|
||||
const handleLiveClick = () => {
|
||||
$api.msg('该功能正在开发中');
|
||||
// #ifdef MP-WEIXIN
|
||||
const feedId = 'sphKH1AEeLfTJJE';
|
||||
|
||||
// 使用微信原生 API 打开视频号直播
|
||||
if (typeof wx !== 'undefined' && wx.openChannelsUserProfile) {
|
||||
wx.openChannelsUserProfile({
|
||||
// feedId: feedId,
|
||||
finderUserName: feedId, // 视频号 finderUserName,如果feedId足够可以留空
|
||||
success: (res) => {
|
||||
console.log('打开视频号成功', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开视频号失败', err);
|
||||
$api.msg(err.errMsg || '无法打开直播,请稍后重试');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 如果 API 不存在,尝试使用 uni API
|
||||
uni.openChannelsLive({
|
||||
feedId: feedId,
|
||||
success: (res) => {
|
||||
console.log('打开视频号成功', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开视频号失败', err);
|
||||
$api.msg('无法打开直播,请检查微信版本或稍后重试');
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
// 非微信小程序环境提示
|
||||
$api.msg('该功能仅在微信小程序中可用');
|
||||
// #endif
|
||||
};
|
||||
|
||||
// 跳转到测试页面
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的" back-gorund-color="#F4F4F4">
|
||||
<AppLayout back-gorund-color="#F4F4F4">
|
||||
<!-- 自定义tabbar -->
|
||||
<CustomTabBar :currentPage="4" />
|
||||
<!-- 企业用户信息卡片 -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="附近" :use-scroll-view="false">
|
||||
<AppLayout :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
@@ -19,10 +19,10 @@
|
||||
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<oneComponent v-show="currentIndex === 0" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<twoComponent v-show="currentIndex === 1" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<threeComponent v-show="currentIndex === 2" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<fourComponent v-show="currentIndex === 3" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<oneComponent v-if="index === 0" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<twoComponent v-if="index === 1" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<threeComponent v-if="index === 2" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<fourComponent v-if="index === 3" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
Reference in New Issue
Block a user