tanxue 3 päivää sitten
vanhempi
commit
8d2fc69294
3 muutettua tiedostoa jossa 102 lisäystä ja 28 poistoa
  1. 44 0
      common/styles/global/pages.scss
  2. 10 1
      pages/admin/ShouYe/shouye.vue
  3. 48 27
      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'

+ 48 - 27
pages/admin/haibao/index.vue

@@ -7,7 +7,7 @@
 		<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 == menu.id }"
+				      :class="{ active: selectedCategory === Number(menu.id) }"
 				      @click="menuBtn(menu.id)">
 				  {{ menu.name }}
 				</view>
@@ -42,37 +42,58 @@ function goUpPage() {
 	})
 }
 
-function getHaibaoListData(data) {
-		httpApi.getHaibaoList({zyId:data}).then(res =>{
-			cardData.value = res.data;
-		})
-	}
+// 加载海报列表
+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){
-	getHaibaoListData(id);
-	selectedCategory.value = id;
-	console.log('selectedCategory.value',selectedCategory.value);
+// 菜单按钮点击
+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 cardBtn(data) {
+    uni.redirectTo({
+        url: `/pages/admin/haibao/haibaoInfo?cardId=${data}&menuId=${selectedCategory.value}`
+    });
 }
-function pageInit(){
-	httpApi.getHaibaoOpsZhiye().then(res =>{
-		menuData.value = res.data;
-		if(menuData.value){
-			selectedCategory.value = menuData.value[0].id;
-			getHaibaoListData(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 = res.data;
-		menuBtn(data.menuId);
-	})
+
+// 从详情页返回时恢复状态
+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) => {
 	// 详情页返回