H5端首页显示内容修改

This commit is contained in:
冯辉
2025-11-18 10:57:59 +08:00
parent 7ee291158e
commit 5c7bd3a6bc
5 changed files with 40 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
export default {
// baseUrl: 'http://39.98.44.136:8080', // 测试
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
baseUrl: 'http://222.80.110.161:11111/api/ks', // 测试
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
LCBaseUrl:'http://10.110.145.145:9100',//招聘、培训、帮扶

28
package-lock.json generated
View File

@@ -1,4 +1,6 @@
{
"name": "ks-app",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
@@ -27,35 +29,9 @@
"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",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
},
"dayjs": {
"version": "1.11.19",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": {
"jsbn": "^1.1.0"
}
}
}
}

View File

@@ -129,7 +129,7 @@
// 根据公司ID获取公司详情
function getCompanyDetailsById(companyId) {
// 使用全局注入的$api调用接口
$api.createRequest('/app/company/' + companyId, 'GET', 9100).then((resData) => {
$api.createRequest('/app/company/' + companyId).then((resData) => {
if (resData && resData.code === 200 && resData.data) {
console.log('Company details:', resData.data);
// 确保数据格式符合页面需求,并为关键字段提供默认值

View File

@@ -443,6 +443,32 @@ function getClass(index) {
return '';
}
}
// 格式化发布时间
function formatPublishTime(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
const now = new Date();
const diffTime = Math.abs(now - date);
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
if (diffDays === 0) {
return '今天发布';
} else if (diffDays === 1) {
return '昨天发布';
} else if (diffDays < 7) {
return `${diffDays}天前发布`;
} else if (diffDays < 30) {
const weeks = Math.floor(diffDays / 7);
return `${weeks}周前发布`;
} else {
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
}
}
</script>
<style lang="stylus" scoped>

View File

@@ -32,12 +32,14 @@
</view>
<!-- 企业用户直播按钮 -->
<!-- #ifndef H5 -->
<view class="company-live-button press-button" @click.stop="handleLiveClick">
<view class="live-icon">
<uni-icons type="videocam-filled" size="16" color="#FFFFFF"></uni-icons>
</view>
<view class="live-text">直播</view>
</view>
<!-- #endif -->
</view>
</view>
@@ -51,14 +53,17 @@
<text class="inpute">职位名称薪资要求等</text>
</view>
<!-- 直播入口按钮 -->
<!-- #ifndef H5 -->
<view class="live-button press-button" @click="handleLiveClick">
<view class="live-icon">
<uni-icons type="videocam-filled" size="16" color="#FFFFFF"></uni-icons>
</view>
<view class="live-text">直播</view>
</view>
<!-- #endif -->
<!-- <view class="chart button-click">职业图谱</view> -->
</view>
<!-- #ifndef H5 -->
<view class="cards" v-if="shouldShowJobSeekerContent">
<view class="card press-button" @click="handleNearbyClick">
<view class="card-title">附近工作</view>
@@ -69,8 +74,10 @@
<view class="card-text">优选职得信赖</view>
</view> -->
</view>
<!-- #endif -->
<!-- 服务功能网格 -->
<!-- #ifndef H5 -->
<view class="service-grid" v-if="shouldShowJobSeekerContent">
<view class="service-item press-button" @click="handleServiceClick('service-guidance')">
<view class="service-icon service-icon-1">
@@ -145,6 +152,7 @@
<view class="service-title">测试页面</view>
</view>
</view>
<!-- #endif -->
</view>
<!-- 企业用户内容 -->
@@ -401,10 +409,10 @@
</scroll-view>
</view>
<!-- 筛选 -->
<select-filter ref="selectFilterModel"></select-filter>
<select-filter ref="selectFilterModel" />
<!-- 微信授权登录弹窗 -->
<WxAuthLogin ref="wxAuthLoginRef" @success="handleLoginSuccess"></WxAuthLogin>
<WxAuthLogin ref="wxAuthLoginRef" @success="handleLoginSuccess" />
<!-- <view class="maskFristEntry" v-if="maskFristEntry">
<view class="entry-content">