From 38d111cb6defedff3bf06314ca30d22a01faae22 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 09 二月 2026 16:30:36 +0800
Subject: [PATCH] 功能开发

---
 mini-program/pages/index/index.vue |  359 ++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 252 insertions(+), 107 deletions(-)

diff --git a/mini-program/pages/index/index.vue b/mini-program/pages/index/index.vue
index 0173946..6e87813 100644
--- a/mini-program/pages/index/index.vue
+++ b/mini-program/pages/index/index.vue
@@ -1,85 +1,99 @@
 <template>
 	<view class="index">
-		<!-- <view class="zhezhao"></view> -->
+		<view class="zhezhao" v-show="view" @click="view = null"></view>
 		<view class="head">
-			<view class="head-title">
-				<view class="head-title-left" @click="jumpList">
-					<image src="/static/ic_paihang@2x.png" mode="widthFix"></image>
-					<text>鎺掕姒�</text>
-				</view>
-				<view class="head-title-name">閫夋嫨鐐瑰皢鑰佸笀</view>
-				<view class="head-title-left" style="opacity: 0;">
-					<image src="/static/ic_paihang@2x.png" mode="widthFix"></image>
-					<text>鎺掕姒�</text>
-				</view>
-			</view>
 			<view class="head-search">
 				<view class="head-search-input">
-					<u-search placeholder="璇疯緭鍏ヨ�佸笀濮撳悕" height="36" :showAction="false"></u-search>
+					<view class="head-title-left" @click="jumpList">
+						<image src="/static/ic_paihang@2x.png" mode="widthFix"></image>
+						<text>鎺掕姒�</text>
+					</view>
+					<view class="head-search-input-right">
+						<u-search placeholder="璇疯緭鍏ヨ�佸笀濮撳悕" height="36" v-model="form.name" :showAction="false" @search="search" @clear="search"></u-search>
+					</view>
 				</view>
 				<view class="cate">
-					<view class="cate-item">
-						<text>鍟嗕笟鍖栫被鍨�</text>
-						<image src="/static/ar_open7@2x.png" mode="widthFix"></image>
+					<view class="cate-item" @click="clickRow(1)">
+						<text :style="{ fontWeight: (view === 1 || form.bustypeIdList.length > 0) ? 'bold' : '', color: (view === 1 || form.bustypeIdList.length > 0) ? '#222222' : '' }">{{form.bustypeIdList.length > 0 ? form.bustypeName : '鍟嗕笟鍖栫被鍨�'}}</text>
+						<image src="/static/ar_open_sel8@2x.png" mode="widthFix" v-if="view === 1"></image>
+						<image src="/static/ar_open_sel@2x.png" mode="widthFix" v-else-if="view !== 1 && form.bustypeIdList.length > 0"></image>
+						<image src="/static/ar_open7@2x.png" mode="widthFix" v-else></image>
 					</view>
-					<view class="cate-item">
-						<text>鎿呴暱棰嗗煙</text>
-						<image src="/static/ar_open7@2x.png" mode="widthFix"></image>
+					<view class="cate-item" @click="clickRow(2)">
+						<text :style="{ fontWeight: (view === 2 || form.fieldIdList.length > 0) ? 'bold' : '', color: (view === 2 || form.fieldIdList.length > 0) ? '#222222' : '' }">鎿呴暱棰嗗煙</text>
+						<image src="/static/ar_open_sel8@2x.png" mode="widthFix" v-if="view === 2"></image>
+						<image src="/static/ar_open_sel@2x.png" mode="widthFix" v-else-if="view !== 2 && form.fieldIdList.length > 0"></image>
+						<image src="/static/ar_open7@2x.png" mode="widthFix" v-else></image>
 					</view>
-					<view class="cate-item">
-						<text>榛樿鎺掑簭</text>
-						<image src="/static/ar_open7@2x.png" mode="widthFix"></image>
+					<view class="cate-item" @click="clickRow(3)">
+						<text :style="{ fontWeight: (view === 3 || form.orderByType) ? 'bold' : '', color: (view === 3 || form.orderByType) ? '#222222' : '' }">{{form.orderByType ? form.orderByName : '榛樿鎺掑簭'}}</text>
+						<image src="/static/ar_open_sel8@2x.png" mode="widthFix" v-if="view === 3"></image>
+						<image src="/static/ar_open_sel@2x.png" mode="widthFix" v-else-if="view !== 3 && form.orderByType"></image>
+						<image src="/static/ar_open7@2x.png" mode="widthFix" v-else></image>
 					</view>
 				</view>
-				<!-- <view class="sou">
-					<view class="sou-cate">
-						<view class="sou-cate-item active">鍩硅鎻愭垚</view>
-						<view class="sou-cate-item">璋堝崟鎴愪氦</view>
-						<view class="sou-cate-item">涓诲姩钀ラ攢</view>
-					</view>
-					<view class="sou-list">
-						<view class="sou-list-item">
-							<text :style="{ color: '#2E68C4' }">鑾峰绫�</text>
-							<image src="/static/ic_selete@2x.png" mode="widthFix"></image>
+				<view class="sou" v-if="view">
+					<scroll-view scroll-y class="sou-list" v-show="view === 1">
+						<view class="sou-list-item" v-for="(item, index) in list1" :key="index" @click="clickSearch(index, 1)">
+							<text :style="{ color: item.active ? '#2E68C4' : '' }">{{item.name}}</text>
+							<image src="/static/ic_selete@2x.png" mode="widthFix" v-if="item.active"></image>
 						</view>
-						<view class="sou-list-item"><text>甯傚満绫�</text></view>
-						<view class="sou-list-item"><text>璁捐绫�</text></view>
-						<view class="sou-list-item"><text>鍩硅绫�</text></view>
-					</view>
-				</view> -->
+					</scroll-view>
+					<scroll-view scroll-y class="sou-cate" v-show="view === 2">
+						<view class="sou-cate-list">
+							<view :class="{'sou-cate-item': true, 'active': item.active}" v-for="(item, index) in list2" :key="index" @click="clickSearch(index, 2)">{{item.name}}</view>
+						</view>
+					</scroll-view>
+					<scroll-view scroll-y class="sou-list" v-show="view === 3">
+						<view class="sou-list-item" v-for="(item, index) in list3" :key="index" @click="clickSearch(index, 3)">
+							<text :style="{ color: item.active ? '#2E68C4' : '' }">{{item.name}}</text>
+							<image src="/static/ic_selete@2x.png" mode="widthFix" v-if="item.active"></image>
+						</view>
+					</scroll-view>
+				</view>
 			</view>
 		</view>
 		<view class="list">
-			<view class="item" v-for="(item, index) in 10" :key="index" @click="jump">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="jump(item)">
 				<view class="item-tx">
-					<image src="/static/logo.png" mode="widthFix"></image>
+					<image :src="item.fullImgurl" mode="widthFix"></image>
 				</view>
 				<view class="item-info">
 					<view class="item-info-a">
-						<text>鍒樻案鎱�</text>
-						<text>P6锝滈攢鍞煿璁笀</text>
+						<text>{{item.name}}</text>
+						<template v-if="item.levelName && item.positon">
+							<text>{{item.levelName}}锝渰{item.positon}}</text>
+						</template>
+						<template v-if="item.levelName && !item.positon">
+							<text>{{item.levelName}}</text>
+						</template>
+						<template v-if="!item.levelName && item.positon">
+							<text>{{item.positon}}</text>
+						</template>
 					</view>
-					<view class="item-info-b">
-						<view class="item-info-b-row">甯傚満绫�</view>
-						<view class="item-info-b-row">鑾峰绫�</view>
-						<view class="item-info-b-row">鍩硅绫�</view>
+					<view class="item-info-b" v-if="item.typeList && item.typeList.length > 0">
+						<view class="item-info-b-row" v-for="(child, i) in item.typeList" :key="i">{{child.name}}</view>
 					</view>
 					<view class="item-info-c">
 						<view class="item-info-c-item">
 							<view class="item-info-c-item-label">浠庝笟骞撮檺锛�</view>
-							<view class="item-info-c-item-val">10骞�</view>
+							<view class="item-info-c-item-val">{{item.workYears}}骞�</view>
 						</view>
 						<view class="item-info-c-item">
 							<view class="item-info-c-item-label">杩戝崐骞存湇鍔″晢鍦烘暟锛�</view>
-							<view class="item-info-c-item-val">38涓�</view>
+							<view class="item-info-c-item-val">{{item.serveNum}}涓�</view>
 						</view>
 					</view>
-					<view class="item-info-d">
-						浠庝簨璁捐鍟嗕笟鍖栧凡鏈夊骞达紝鎿呴暱鍚勭椋庢牸锛屾湇鍔″ぇ瀹㈡埛瓒呰繃50鎴封��<text>鏇村</text>
+					<view class="item-info-d" v-if="item.isShow">
+						 <!-- @click.stop="zhankai(item)" -->
+						{{item.zhankai ? item.content : item.contentCopy}}<text>{{item.zhankai ? '鏀惰捣' : '鏇村'}}</text>
 					</view>
-					<view class="item-info-price">
+					<view class="item-info-d" v-else>
+						{{item.content}}
+					</view>
+					<view class="item-info-price" v-if="item.fee">
 						<text>鏍囧噯鏀惰垂</text>
-						<text>2900</text>
+						<text>{{item.fee}}</text>
 					</view>
 				</view>
 			</view>
@@ -91,22 +105,138 @@
 	export default {
 		data() {
 			return {
-				
+				form: {
+					orderByType: '',
+					orderByName: '',
+					fieldIdList: [],
+					bustypeIdList: [],
+					bustypeName: '',
+					name: ''
+				},
+				list1: [],
+				list2: [],
+				list3: [
+					{ name: '榛樿鎺掑簭', id: '', active: true },
+					{ name: '鏀惰垂浠庨珮鍒颁綆', id: '0', active: false },
+					{ name: '鏀惰垂浠庝綆鍒伴珮', id: '1', active: false },
+					{ name: '绛夌骇浠庨珮鍒颁綆', id: '2', active: false },
+					{ name: '绛夌骇浠庝綆鍒伴珮', id: '3' , active: false},
+					{ name: '鏈嶅姟鏁颁粠楂樺埌浣�', id: '4', active: false }
+				],
+				view: null,
+				page: 1,
+				next: true,
+				list: []
 			}
 		},
-		onLoad() {
-
+		async onLoad() {
+			await this.$onLaunched;
+			this.getCategary()
+			this.getList()
+		},
+		onReachBottom() {
+			this.getList()
 		},
 		methods: {
-			jump() {
+			getList() {
+				if (!this.next) return
+				this.$u.api.memberPage({
+					capacity: 10,
+					page: this.page,
+					model: {
+						orderByType: this.form.orderByType ? this.form.orderByType : 3,
+						orderByName: this.form.orderByName,
+						fieldIdList: this.form.fieldIdList,
+						bustypeIdList: this.form.bustypeIdList,
+						bustypeName: this.form.bustypeName,
+						name: this.form.name
+					}
+				}).then(res => {
+					if (res.code === 200) {
+						res.data.records.forEach(item => {
+							item.isShow = false
+							if (item.content && item.content.length > 30) {
+								item.isShow = true
+								item.zhankai = false
+								item.contentCopy = item.content.substring(0, 30) + '...'
+							}
+						})
+						this.page++
+						this.list.push(...res.data.records)
+						if (res.data.total === this.list.length) {
+							this.next = false
+						}
+					}
+				})
+			},
+			search() {
+				this.next = true
+				this.page = 1
+				this.list = []
+				this.getList()
+			},
+			clickSearch(i, type) {
+				if (type === 1) {
+					if (this.list1[i].id) {
+						this.form.bustypeIdList = [this.list1[i].id]
+					} else {
+						this.form.bustypeIdList = []
+					}
+					this.form.bustypeName = this.list1[i].name
+					this.list1.forEach((item, index) => {
+						item.active = index === i
+					})
+					this.view = null
+				} else if (type === 2) {
+					this.list2[i].active = !this.list2[i].active
+					this.form.fieldIdList = this.list2.filter(item => item.active).map(item => item.id)
+					this.$forceUpdate()
+				} else {
+					this.form.orderByType = this.list3[i].id
+					this.form.orderByName = this.list3[i].name
+					this.list3.forEach((item, index) => {
+						item.active = index === i
+					})
+					this.view = null
+				}
+				this.search()
+			},
+			clickRow(view) {
+				if (view === this.view) {
+					this.view = null
+				} else {
+					this.view = view
+				}
+			},
+			getCategary() {
+				this.$u.api.categoryList({ type: 1 })
+					.then(res => {
+						if (res.code === 200) {
+							res.data.active = false
+							this.list1 = res.data
+							this.list1.unshift({ name: '鍏ㄩ儴', id: null, active: true })
+						}
+					})
+				this.$u.api.categoryList({ type: 2 })
+					.then(res => {
+						if (res.code === 200) {
+							res.data.active = false
+							this.list2 = res.data
+						}
+					})
+			},
+			jump(item) {
 				uni.navigateTo({
-					url: '/pages/details/details'
+					url: '/pages/details/details?id=' + item.id
 				})
 			},
 			jumpList() {
 				uni.navigateTo({
 					url: '/pages/ranking-list/ranking-list'
 				})
+			},
+			zhankai(item) {
+				item.zhankai = !item.zhankai
 			}
 		}
 	}
@@ -128,7 +258,7 @@
 				width: 100%;
 				background: #FFFFFF;
 				border-radius: 8rpx;
-				padding: 24rpx;
+				padding: 30rpx;
 				box-sizing: border-box;
 				display: flex;
 				align-items: flex-start;
@@ -181,26 +311,30 @@
 					}
 					.item-info-a {
 						display: flex;
-						align-items: center;
+						align-items: flex-start;
 						text {
 							&:nth-child(1) {
+								flex-shrink: 0;
 								font-weight: 600;
 								font-size: 30rpx;
 								color: #222222;
 							}
 							&:nth-child(2) {
+								width: 280rpx;
 								font-weight: 400;
 								font-size: 24rpx;
 								color: #777777;
 								margin-left: 10rpx;
+								margin-top: 7rpx;
 							}
 						}
 					}
 					.item-info-b {
+						width: 80%;
 						display: flex;
 						flex-wrap: wrap;
 						align-items: center;
-						margin-top: 8rpx;
+						margin-top: 16rpx;
 						.item-info-b-row {
 							padding: 0 8rpx;
 							box-sizing: border-box;
@@ -212,8 +346,9 @@
 							font-size: 22rpx;
 							color: #2E68C4;
 							margin-right: 8rpx;
+							margin-bottom: 8rpx;
 							&:last-child {
-								margin: 0;
+								margin-right: 0;
 							}
 						}
 					}
@@ -240,12 +375,14 @@
 					}
 					.item-info-d {
 						width: 100%;
+						line-height: 40rpx;
 						font-weight: 400;
 						font-size: 24rpx;
 						color: #333333;
 						margin-top: 20rpx;
 						text {
 							color: #2E68C4;
+							margin-left: 10rpx;
 						}
 					}
 				}
@@ -262,49 +399,44 @@
 		}
 		.head {
 			width: 100%;
-			height: 260rpx;
+			height: 172rpx;
+			padding-top: 12rpx;
+			box-sizing: border-box;
 			position: sticky;
 			top: 0;
 			left: 0;
 			z-index: 9;
 			background-color: #ffffff;
-			.head-title {
-				width: 100%;
-				height: 88rpx;
-				padding: 0 30rpx;
-				box-sizing: border-box;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-				.head-title-left {
-					display: flex;
-					align-items: center;
-					image {
-						width: 40rpx;
-						height: 40rpx;
-					}
-					text {
-						font-weight: 400;
-						font-size: 26rpx;
-						color: #2E68C4;
-						margin-left: 8rpx;
-					}
-				}
-				.head-title-name {
-					font-weight: 500;
-					font-size: 32rpx;
-					color: #111111;
-				}
-			}
 			.head-search {
 				width: 100%;
 				height: 172rpx;
 				.head-search-input {
 					width: 100%;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
 					padding: 0 30rpx;
 					box-sizing: border-box;
 					height: 72rpx;
-					margin-top: 12rpx;
+					.head-title-left {
+						flex-shrink: 0;
+						display: flex;
+						align-items: center;
+						margin-right: 30rpx;
+						image {
+							width: 40rpx;
+							height: 40rpx;
+						}
+						text {
+							font-weight: 400;
+							font-size: 26rpx;
+							color: #2E68C4;
+							margin-left: 8rpx;
+						}
+					}
+					.head-search-input-right {
+						flex: 1;
+					}
 				}
 				.sou {
 					width: 100%;
@@ -314,29 +446,42 @@
 					background-color: #ffffff;
 					.sou-cate {
 						width: 100%;
+						max-height: 480rpx;
 						padding: 0 0 30rpx 0;
 						box-sizing: border-box;
-						display: flex;
-						align-items: center;
-						justify-content: space-between;
-						.active {
-							background: rgba(46,104,196,0.1) !important;
-							color: #2E68C4 !important;
-						}
-						.sou-cate-item {
-							width: 216rpx;
-							height: 72rpx;
-							line-height: 72rpx;
-							text-align: center;
-							background: #F7F7F7;
-							border-radius: 8rpx;
-							font-weight: 400;
-							font-size: 28rpx;
-							color: #333333;
+						.sou-cate-list {
+							width: 100%;
+							display: flex;
+							align-items: center;
+							// justify-content: space-between;
+							flex-wrap: wrap;
+							.active {
+								background: rgba(46,104,196,0.1) !important;
+								color: #2E68C4 !important;
+							}
+							.sou-cate-item {
+								padding: 0 15rpx;
+								box-sizing: border-box;
+								height: 72rpx;
+								line-height: 72rpx;
+								text-align: center;
+								background: #F7F7F7;
+								border-radius: 8rpx;
+								font-weight: 400;
+								font-size: 28rpx;
+								color: #333333;
+								margin-top: 20rpx;
+								margin-right: 15rpx;
+								&:last-child {
+									margin-right: 0 !important;
+								}
+							}
 						}
 					}
 					.sou-list {
 						width: 100%;
+						max-height: 480rpx;
+						overflow-y: scroll;	
 						display: flex;
 						flex-direction: column;
 						.sou-list-item {

--
Gitblit v1.9.3