Ver Fonte

Merge remote-tracking branch 'origin/2025北京诚祥App' into 2025北京诚祥App

wangxy há 4 dias atrás
pai
commit
81521d8097
3 ficheiros alterados com 162 adições e 1 exclusões
  1. 44 0
      common/styles/global/pages.scss
  2. 10 1
      pages/admin/ShouYe/shouye.vue
  3. 108 0
      pages/admin/haibao/index.vue

+ 44 - 0
common/styles/global/pages.scss

@@ -1528,4 +1528,48 @@
 		}
 		.tip-text{font-size: 24rpx;color: #666;line-height: 1.8;}
 	}
+}
+
+/* 职业海报 */
+.phone-haibao-page{
+	width: 100%;height: 100vh;background-color: #fff;
+	display: flex;flex-direction: column;
+	.haibao-body-box{
+		display: flex;flex: 1;border-top: 1rpx solid #f0f0f0;overflow: hidden;
+	}
+	.haibao-menu-box{
+		width: 170rpx;border-right: 1rpx solid #f0f0f0;overflow-y: auto;
+		.menu-item-box{
+			width: 100%;height: 72rpx;line-height: 72rpx;font-size: 28rpx;
+			box-sizing: border-box;padding: 0 10rpx;
+			border-bottom: 1rpx solid #f0f0f0;text-align: center;@include single-line-ellipsis();
+		}
+		.active{background-color: #3fd2a1;color: #fff;}
+	}
+	.haibao-show-box{
+		flex: 1;overflow: hidden;display: flex;flex-direction: column;
+		.haibao-title{
+			width: 100%;height: 72rpx;line-height: 72rpx;font-size: 24rpx;color: #666;
+			border-bottom: 1rpx solid #f0f0f0;box-sizing: border-box;padding:0 20rpx;
+		}
+		.card-list-box{
+			display: flex;flex-wrap: wrap;box-sizing: border-box;padding: 20rpx;overflow-y: auto;
+			
+		}
+		.haibao-card-box{
+			width: 31%;margin-right: 3.5%;font-size: 0;margin-bottom: 20rpx;
+			img{width: 100%;height: 240rpx;border-radius: 8rpx;}
+			.card-name{font-size: 24rpx;color: #666;text-align: center;margin-top: 6rpx;}
+		}
+		.haibao-card-box:nth-child(3n){margin-right: 0;}
+	}
+}
+
+.phone-haibao-info-page{
+	width: 100%;height: 100vh;background-color: #fff;
+	display: flex;flex-direction: column;background-color: #202020;
+	.haibao-info-body-box{
+		box-sizing: border-box;padding: 24rpx;
+		img{width: 100%;}
+	}
 }

+ 10 - 1
pages/admin/ShouYe/shouye.vue

@@ -94,11 +94,15 @@
 			
 		</view>
 		<view class="card-list-box">
-			<view class="card-list-title">面试管理</view>
+			<view class="card-list-title">其他服务</view>
 			<view @click="goToPage('ycms')" class="card-item-box">
 				<icon class="index-icon ycms-icon"></icon>
 				<text>远程面试</text>
 			</view>
+			<view @click="goToPage('zyhb')" class="card-item-box">
+				<icon class="index-icon ycms-icon"></icon>
+				<text>职业海报</text>
+			</view>
 		</view>
 		<!-- 页面底端 -->
 		<customTabbarAdminVue :current-tab="0"></customTabbarAdminVue>
@@ -331,6 +335,11 @@
 				url: '/pages/admin/mianshi/index'
 			})
 			break;
+			case 'zyhb':
+			uni.navigateTo({
+				url: '/pages/admin/haibao/index'
+			})
+			break;
 			case 'demo':
 				uni.redirectTo({
 					url: '/pages/demo/demo2'

+ 108 - 0
pages/admin/haibao/index.vue

@@ -0,0 +1,108 @@
+<template>
+	<view class="phone-haibao-page">
+		<view class="icon-title-navBar-box">
+			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">职业海报</text>
+		</view>
+		<view class="haibao-body-box">
+			<view class="haibao-menu-box">
+				<view v-for="menu in menuData" :key="menu.id" class="menu-item-box"
+				      :class="{ active: selectedCategory === Number(menu.id) }"
+				      @click="menuBtn(menu.id)">
+				  {{ menu.name }}
+				</view>
+			</view>
+			<view class="haibao-show-box">
+				<view class="haibao-title">共{{cardData.length}}个海报</view>
+				<view class="card-list-box">
+					<view v-for="item in cardData" :key="item.id" class="haibao-card-box"
+					      @click="cardBtn(item.id)">
+						  <img :src="item.image"/>
+						  <view class="card-name">{{ item.name }}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+	
+</template>
+
+<script setup>
+import * as httpApi from '@/api/haibao.js'	
+import { ref, reactive } from "vue"
+import {onLoad} from "@dcloudio/uni-app";
+const menuData = ref([])
+const cardData = ref([])
+// 当前选中的分类
+const selectedCategory = ref(null)
+
+function goUpPage() {
+	uni.redirectTo({
+		url: `/pages/admin/ShouYe/shouye`
+	})
+}
+
+// 加载海报列表
+function getHaibaoListData(zyId) {
+    if (zyId == null) return;
+    httpApi.getHaibaoList({ zyId }).then(res => {
+        cardData.value = Array.isArray(res.data) ? res.data : [];
+    }).catch(err => {
+        console.error('获取海报列表失败:', err);
+        cardData.value = [];
+        uni.showToast({ title: '加载失败', icon: 'none' });
+    });
+}
+	
+// 菜单按钮点击
+function menuBtn(id) {
+    const numericId = Number(id);
+    selectedCategory.value = numericId;
+    getHaibaoListData(numericId);
+}
+
+// 海报卡片点击
+function cardBtn(data) {
+    uni.redirectTo({
+        url: `/pages/admin/haibao/haibaoInfo?cardId=${data}&menuId=${selectedCategory.value}`
+    });
+}
+
+// 首次进入页面初始化
+function pageInit() {
+    httpApi.getHaibaoOpsZhiye().then(res => {
+        menuData.value = Array.isArray(res.data) ? res.data : [];
+        if (menuData.value.length > 0) {
+            const firstId = Number(menuData.value[0].id);
+            selectedCategory.value = firstId;
+            getHaibaoListData(firstId);
+        }
+    }).catch(err => {
+        console.error('初始化职业失败:', err);
+        menuData.value = [];
+        uni.showToast({ title: '职业加载失败', icon: 'none' });
+    });
+}
+
+// 从详情页返回时恢复状态
+function pageRecover(data) {
+    httpApi.getHaibaoOpsZhiye().then(res => {
+        menuData.value = Array.isArray(res.data) ? res.data : [];
+        const menuId = Number(data.menuId);
+        menuBtn(menuId); 
+    }).catch(err => {
+        console.error('页面加载:', err);
+        uni.showToast({ title: '页面加载失败', icon: 'none' });
+    });
+}
+onLoad((options) => {
+	// 详情页返回
+	if(options.menuId){
+		pageRecover(options)
+	}else{
+		// 首页进入
+		pageInit()
+	}
+	
+})
+</script>