首页卡片开发

This commit is contained in:
冯辉
2025-10-24 16:54:52 +08:00
parent 92ee5c5311
commit 2d6370b796
22 changed files with 896 additions and 205 deletions

View File

@@ -2,11 +2,7 @@
<view class="publish-job-page">
<!-- 头部导航 -->
<view class="header">
<view class="header-left" @click="goBack">
<image src="@/static/icon/back.png" class="back-icon"></image>
</view>
<view class="header-title">发布岗位</view>
<view class="header-right"></view>
</view>
<!-- 主要内容 -->
@@ -216,10 +212,12 @@
<!-- 底部操作按钮 -->
<view class="footer">
<view class="btn-group">
<button class="btn btn-cancel" @click="goBack">取消</button>
<button class="btn btn-publish" @click="publishJob">发布岗位</button>
</view>
</view>
<!-- 自定义tabbar -->
<CustomTabBar :currentPage="1" />
</view>
</template>
@@ -282,7 +280,9 @@ const calculateScrollViewHeight = () => {
const windowHeight = systemInfo.windowHeight;
const headerHeight = 100; // 头部高度
const footerHeight = 120; // 底部按钮高度
const scrollHeight = windowHeight - headerHeight - footerHeight;
const tabbarHeight = 88; // 自定义tabbar高度
const extraPadding = 50; // 额外间距,确保内容不被遮挡
const scrollHeight = windowHeight - headerHeight - footerHeight - tabbarHeight - extraPadding;
scrollViewHeight.value = `${scrollHeight}px`;
};
const userType = ref(Number(userStore.userInfo.isCompanyUser));
@@ -417,10 +417,6 @@ const handleCompanySelected = (company) => {
formData.companyId = company.id;
};
// 返回上一页
const goBack = () => {
uni.navigateBack();
};
// 发布岗位
const publishJob = async () => {
@@ -464,10 +460,10 @@ const publishJob = async () => {
icon: 'success'
});
// 延迟返回
setTimeout(() => {
goBack();
}, 1500);
uni.redirectTo({
url: '/pages/index/index'
});
} else {
uni.showToast({
title: response.msg || '发布失败',
@@ -565,18 +561,6 @@ const validateForm = () => {
background: #fff;
border-bottom: 1rpx solid #eee;
.header-left {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
.back-icon {
width: 40rpx;
height: 40rpx;
}
}
.header-title {
font-size: 36rpx;
@@ -864,23 +848,22 @@ const validateForm = () => {
}
.bottom-safe-area {
height: 120rpx;
height: 250rpx;
background: transparent;
}
.footer {
position: fixed;
bottom: 0;
bottom: 140rpx;
left: 0;
right: 0;
background: #fff;
padding: 20rpx 30rpx;
padding: 25rpx 30rpx;
border-top: 1rpx solid #eee;
z-index: 100;
.btn-group {
display: flex;
gap: 20rpx;
.btn {
flex: 1;
@@ -890,11 +873,6 @@ const validateForm = () => {
font-weight: 500;
border: none;
&.btn-cancel {
background: #f5f5f5;
color: #666;
}
&.btn-publish {
background: #256BFA;
color: #fff;