Browse Source

用户端列表修改

贾宇博 3 weeks ago
parent
commit
a4f2d018db

+ 22 - 10
api/userList.js

@@ -2,19 +2,31 @@ import request from '../utils/request'
 
 //用户订单列表
 export function userMainOrderList(data) {
-    return request({
-        url: `/core/users/orders/mainOrderList`,
-        method: 'get',
-        params: data
-    })
+	return request({
+		url: `/core/users/orders/mainOrderList`,
+		method: 'get',
+		params: data
+	})
 }
 
 
 // 用户订单列表详情
-
 export function orderInfomainOrderId(mainOrderId) {
-  return request({
-    url: `/core/users/orders/orderInfo/${mainOrderId}`,
-    method: 'get',
-  })
+	return request({
+		url: `/core/users/orders/orderInfo/${mainOrderId}`,
+		method: 'get',
+	})
 }
+
+//获取用户订单列表状态
+export function systemDictdaTalist() {
+	return request({
+		url: `/system/dict/data/list`,
+		method: 'get',
+		params: {
+			pageNum: 1,
+			pageSize: 10,
+			dictType: 'order_status'
+		}
+	})
+}

+ 36 - 22
api/volunteerDetailsApi/details.js

@@ -1,31 +1,35 @@
 import upload from '@/utils/upload'
 import request from '@/utils/request'
-
+const lrr_service_category = 'service_category';
 
 // 获取选择项健值第一项
-export function typeOptionSelect(params = {}) {
-	return request({
-		url: '/system/dict/data/list',
-		method: 'get',
-		params
-	})
-}
-
-// 获取选择项健值第二项
-export function dictListlrRstudy(params = {}) {
-	return request({
-		url: '/system/dict/data/list',
-		method: 'get',
-		params
-	})
-}
+// export function typeOptionSelect(params = {}) {
+// 	return request({
+// 		url: '/system/dict/data/list',
+// 		method: 'get',
+// 		params
+// 	})
+// }
+
+// // 获取选择项健值第二项
+// export function dictListlrRstudy(params = {}) {
+// 	return request({
+// 		url: '/system/dict/data/list',
+// 		method: 'get',
+// 		params
+// 	})
+// }
 
 // 获取选择项健值第三项
-export function dictListlrData(params = {}) {
+export function dictListlrData(params) {
 	return request({
 		url: '/system/dict/data/list',
 		method: 'get',
-		params
+		params:{
+			pageNum: 1,
+			pageSize: 10,
+			dictType: lrr_service_category,
+		}
 	})
 }
 
@@ -43,11 +47,11 @@ export function getDetailsvolunteerId(data) {
 
 
 // 获取志愿者列表信息
-export function volunteerinfolist(params) {
+export function volunteerinfolist(data) {
   return request({
     url: '/core/volunteer/info/list',
-    method: 'get',
-	params:params
+    method: 'post',
+	data:data
   })
 }
 
@@ -103,3 +107,13 @@ export function volunteerSeachgetTreeList(params) {
 	params:params,
   });
 }
+
+
+// 获取服务类型健值
+export function volunteerDataList(params) {
+  return request({
+    url: 'system/dict/data/list',  
+    method: 'get',
+	params:params,
+  });
+}

+ 19 - 37
components/Client/new_file.vue

@@ -5,7 +5,7 @@
 				<view class="serve-title client-title" v-if="userType == 2">注册专区</view>
 				<swiper :indicator-dots="true" class="swiper" v-if="serveiceList && serveiceList.length > 0">
 					<swiper-item>
-						<up-grid :border="false" col="5" >
+						<up-grid :border="false" col="5">
 							<up-grid-item v-for="(item, index) in serveiceList.slice(0,10)" :key="index"
 								:custom-style="custmoStyle" @click="handleGridClick(item)">
 								<view class="grid-box">
@@ -19,9 +19,9 @@
 						</up-grid>
 					</swiper-item>
 					<swiper-item>
-						<up-grid :border="false" col="5" >
-							<up-grid-item v-for="(item, index) in serveiceList.slice(10,serveiceList.length)" :key="index"
-								:custom-style="custmoStyle" @click="handleGridClick(item)">
+						<up-grid :border="false" col="5">
+							<up-grid-item v-for="(item, index) in serveiceList.slice(10,serveiceList.length)"
+								:key="index" :custom-style="custmoStyle" @click="handleGridClick(item)">
 								<view class="grid-box">
 									<view class="grid-icon">
 										<image :src="item.icon" class="service-img" mode="aspectFit" />
@@ -53,9 +53,6 @@
 		computed,
 		provide
 	} from 'vue';
-	// import {
-	// 	typeOptionSelect
-	// } from "@/api/volunteerDetailsApi/details.js"
 	import {
 		workDate,
 		getDataTime,
@@ -63,6 +60,7 @@
 	} from '@/api/volunteer.js'
 	import {
 		volunteerSeachgetTreeList,
+		volunteerDataList
 	} from "@/api/volunteerDetailsApi/details.js"
 	import Calendar from '../../components/uni-calendar/components/uni-calendar/uni-calendar.vue'
 
@@ -83,8 +81,7 @@
 	const selected = ref([])
 
 	// 普通用户
-	const serviceList1 = [
-		{
+	const serviceList1 = [{
 			icon: '/static/Tioimages/1v专业指导.png',
 			name: '陪伴陪聊',
 			key: 1,
@@ -142,8 +139,7 @@
 	]
 
 	//志愿者
-	const serviceList2 = [
-		{
+	const serviceList2 = [{
 			icon: '/static/Tioimages/1v专业指导.png',
 			name: '陪伴陪聊',
 			key: 1,
@@ -205,44 +201,30 @@
 		},
 	]
 
-	const serveiceList =computed(()=>{
-		console.log('userType ____>',userType);
-		
-		if(userType === 1){
+	const serveiceList = computed(() => {
+		console.log('userType ____>', userType);
+
+		if (userType === 1) {
 			return serviceList1
 		}
 		return serviceList2
 	})
 
-	const parentIdMap = {
-		'孩子陪护': 2,
-		'陪伴陪聊': 1,
-		'家庭助理': 3,
-		'健康管理': 4,
-		'家庭清洁': 5,
-		'家务帮手': 6,
-		'资讯与服务': 7,
-	};
-
-	// const getParentId = (service) => parentIdMap[service.name] || 1;
-
+	
 
+	
 	// 宫格点击事件
 	const handleGridClick = async (service) => {
-		
-		// const service = serveiceList.value[index]; // 获取点击的服务条目
-		console.log('index',service);
+
 		
 		// 用户
 		if (userType == 1) {
 
 			// 动态获取 parentId
-			// const parentId = getParentId(service); // 通过服务条目动态获取 parentId
 			const params = {
-				parentId: service.key
+				parentId: service.key,
 			}
 			const res = await volunteerSeachgetTreeList(params)
-			console.log(res, '>>>>>dictSort = null')
 
 			// 只有第一条和第二条可以跳转
 			if (service.key === 1 || service.key === 2) {
@@ -258,7 +240,7 @@
 			}
 		}
 		// 志愿者
-		if (userType == 2 ) {
+		if (userType == 2) {
 			if (service.key !== 7) {
 				const res = await getVolunteerInfo({
 					serviceCategory: service.key
@@ -426,9 +408,9 @@
 		height: 78rpx;
 	}
 
-.swiper {
-	height: 340rpx;
-}
+	.swiper {
+		height: 340rpx;
+	}
 
 	.grid-text {
 		font-size: 14px;

+ 191 - 178
pages/classify.vue

@@ -16,210 +16,223 @@
 			</view>
 		</view>
 		<!-- 用户 -->
-		<OrderList :dataList="dataList" @fetchData="getListData" v-else />
+		<OrderList :dataList="dataList" :dictSort="dictData" @fetchData="getListData" v-else />
 	</view>
 </template>
 
 <script setup>
-import {
-	ref
-} from 'vue';
-import List from '@/pages/common/orderList/index.vue';
-import {
-	provide
-} from 'vue';
-import {
-	getVolunteerOrderList
-} from '@/api/volunteer.js'
-import {
-	onMounted
-} from 'vue';
-import {
-	useDict
-} from '@/utils/dict.js';
-import {
-	onLoad,
-	onShow
-} from '@dcloudio/uni-app';
-import OrderList from '@/pages/common/classify/orderlist.vue'
-import {
-	userMainOrderList
-} from "@/api/userList.js"
-
-const {
-	order_status,
-	lrr_service_status
-} = useDict('order_status', 'lrr_service_status');
-
-provide('order_status', order_status); //订单/服务状态
-provide('lrr_service_status', lrr_service_status); //订单/服务状态
-
-
-const userType = uni.getStorageSync('userType') //读取本地存储
-
-// 用户/志愿者 识别标识
-const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
-
-const tab = ref('');
-const tabKey = ref(0);
-const dataList = ref([]) //用户
-const data = ref([]); //志愿者
-
-/**
- * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
- */
-const column = [{
-	name: "全部",
-	value: "",
-},
-{
-	name: "待服务",
-	value: "0",
-},
-{
-	name: "进行中",
-	value: "1",
-},
-{
-	name: "已完成",
-	value: "2",
-},
-{
-	name: "已取消",
-	value: "3",
-}
-]
-
-const column2 = [{
-	name: "全部",
-	value: "",
-},
-{
-	name: "待支付",
-	value: "1",
-},
-{
-	name: "待服务",
-	value: "2",
-},
-{
-	name: "进行中",
-	value: "3",
-},
-{
-	name: "已完成",
-	value: "4",
-},
-{
-	name: "已取消",
-	value: "5",
+	import {
+		ref
+	} from 'vue';
+	import List from '@/pages/common/orderList/index.vue';
+	import {
+		provide
+	} from 'vue';
+	import {
+		getVolunteerOrderList
+	} from '@/api/volunteer.js'
+	import {
+		onMounted
+	} from 'vue';
+	import {
+		useDict
+	} from '@/utils/dict.js';
+	import {
+		onLoad,
+		onShow
+	} from '@dcloudio/uni-app';
+	import OrderList from '@/pages/common/classify/orderlist.vue'
+	import {
+		userMainOrderList,
+		systemDictdaTalist
+	} from "@/api/userList.js"
+
+	const {
+		order_status,
+		lrr_service_status
+	} = useDict('order_status', 'lrr_service_status');
+
+	provide('order_status', order_status); //订单/服务状态
+	provide('lrr_service_status', lrr_service_status); //订单/服务状态
+
+
+	const userType = uni.getStorageSync('userType') //读取本地存储
+
+	// 用户/志愿者 识别标识
+	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
+
+	const tab = ref('');
+	const tabKey = ref(0);
+	const dataList = ref([]) //用户
+	const data = ref([]); //志愿者
+	// 定义存储字典数据的响应式变量
+	const dictData = ref([]);
+	/**
+	 * 	0待支付 1已支付 2支付超时或取消 3进行中 4已完成 5申请退款中 6已退款 7部分退款 8 待确认
+	 */
+	const column = [{
+			name: "全部",
+			value: "",
+		},
+		{
+			name: "待服务",
+			value: "0",
+		},
+		{
+			name: "进行中",
+			value: "1",
+		},
+		{
+			name: "已完成",
+			value: "2",
+		},
+		{
+			name: "已取消",
+			value: "3",
+		}
+	]
+
+	const column2 = [{
+			name: "全部",
+			value: "",
+		},
+		{
+			name: "待支付",
+			value: "1",
+		},
+		{
+			name: "待服务",
+			value: "2",
+		},
+		{
+			name: "进行中",
+			value: "3",
+		},
+		{
+			name: "已完成",
+			value: "4",
+		},
+		{
+			name: "已取消",
+			value: "5",
+		}
+	]
+
+	//获取用户订单列表状态
+	async function getData() {
+  console.log('进入');
+  try {
+    const res = await systemDictdaTalist().catch(err => {
+      console.error('接口请求失败:', err);
+      throw err; // 重新抛出以进入 catch 块
+    });
+    console.log(res, '用户状态获取成功');
+    dictData.value = res.rows;
+    console.log(dictData.value, 'dictData.value');
+  } catch (e) {
+    console.error('获取数据异常:', e); // 确保这里打印错误
+  }
 }
-]
 
+	async function getList() {
+		try {
+			uni.hideLoading();
+			uni.showLoading({
+				title: '数据加载中...'
+			});
 
-async function getList() {
-	console.log(userType, '>>>>>>userType');
-	try {
-		uni.hideLoading();
-		uni.showLoading({
-			title: '数据加载中...'
-		});
-
-		// 判断 userType 来决定调用哪个接口
-		let res;
-		if (userType === 1) {
-			// 如果 userType 是 1,调用 userMainOrderList 接口
-			res = await getListData();
-		} else if (userType === 2) {
-			// 如果 userType 是 2,调用 getVolunteerOrderList 接口
-			res = await getVolunteerOrderList({
-				orderStatus: tab.value
+			// 判断 userType 来决定调用哪个接口
+			let res;
+			if (userType === 1) {
+				// 如果 userType 是 1,调用 userMainOrderList 接口
+				res = await getListData();
+			} else if (userType === 2) {
+				// 如果 userType 是 2,调用 getVolunteerOrderList 接口
+				res = await getVolunteerOrderList({
+					orderStatus: tab.value
+				});
+				data.value = res.data;
+			}
+
+		} catch (error) {
+			console.log('error', error);
+			uni.showToast({
+				title: error.msg,
+				icon: 'error',
 			});
-			data.value = res.data;
+		} finally {
+			uni.hideLoading();
 		}
-
-	} catch (error) {
-		console.log('error', error);
-		uni.showToast({
-			title: error.msg,
-			icon: 'error',
-		});
-	} finally {
-		uni.hideLoading();
 	}
-}
-const getListData = async (orderStatus = tab.value) => {
-	const res = await userMainOrderList({
-		orderStatus: orderStatus
-	});
-	dataList.value = res.data
-}
-/**
- * 1: 查看
- * 2:沟通
- * 3:上传照片
- */
-function btnClick(row, type) {
-	console.log('btnClick', type, row, row.orderStatus);
-	if (type === 1 && row.orderStatus === '2') {
-		uni.navigateTo({
-			url: `/pages_classify/pages/order/index?orderId=${row.secondOrderId}`
+	const getListData = async (orderStatus = tab.value) => {
+		const res = await userMainOrderList({
+			orderStatus: orderStatus
 		});
-		return;
+		dataList.value = res.data
 	}
-	if (type === 1) {
+	/**
+	 * 1: 查看
+	 * 2:沟通
+	 * 3:上传照片
+	 */
+	function btnClick(row, type) {
+		if (type === 1 && row.orderStatus === '2') {
+			uni.navigateTo({
+				url: `/pages_classify/pages/order/index?orderId=${row.secondOrderId}`
+			});
+			return;
+		}
+		if (type === 1) {
+
+			uni.navigateTo({
+				url: `/pages_classify/pages/handle/index?orderId=${row.secondOrderId}`
+			});
+			return
+		}
 
+		//前往沟通
 		uni.navigateTo({
-			url: `/pages_classify/pages/handle/index?orderId=${row.secondOrderId}`
+			url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.secondOrderId}`
 		});
-		return
-	}
-
-	//前往沟通
-	uni.navigateTo({
-		url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.secondOrderId}`
-	});
 
-}
-provide('onClick', btnClick);
+	}
+	provide('onClick', btnClick);
 
 
-function onChange(tabItem) {
-	console.log('onChange called with tabItem:', tabItem); // 确认是否进入 onChange
-	tab.value = tabItem.value;
-	getList();
-	console.log('change', tabItem, tab.value);
-}
+	function onChange(tabItem) {
+		tab.value = tabItem.value;
+		getList();
+	}
 
 
 
-onMounted(() => {
-	getList()
-	getListData()
-})
+	onMounted(() => {
+		getList()
+		getListData()
+		getData()
+	})
 
 
-onShow(() => {
-	const params = getApp().globalData.switchTabParams || {};
-	tabKey.value = params.tabKey || 0;
-	console.log('cc', params, tabKey.value);
-	onChange(column[tabKey.value])
-	// 使用后建议清除参数,避免重复读取 
-	getApp().globalData.switchTabParams = null;
+	onShow(() => {
+		const params = getApp().globalData.switchTabParams || {};
+		tabKey.value = params.tabKey || 0;
+		onChange(column[tabKey.value])
+		// 使用后建议清除参数,避免重复读取 
+		getApp().globalData.switchTabParams = null;
 
-})
+	})
 </script>
 
 <style lang="scss" scoped>
-.classify-main {
-	height: 100vh;
-
-	.list {
-		position: fixed;
-		top: 50px;
-		bottom: 0px;
-		left: 0px;
-		right: 0px;
+	.classify-main {
+		height: 100vh;
+
+		.list {
+			position: fixed;
+			top: 50px;
+			bottom: 0px;
+			left: 0px;
+			right: 0px;
+		}
 	}
-}
 </style>

+ 64 - 48
pages/common/classify/orderlist.vue

@@ -34,9 +34,13 @@
 						<view class="item-right">
 							<view class="rating">评分:9.5</view>
 							<view class="status-tags">
-								<up-tag v-if="item.orderStatus == '0'" type="info">未开始</up-tag>
-								<up-tag v-else-if="item.orderStatus == '1'" type="warning">进行中</up-tag>
-								<up-tag v-else-if="item.orderStatus == '2'" type="success">已完成</up-tag>
+								<!-- <view class="item-right">
+									<up-tag>{{ getStatusLabel(item.orderStatus) }}</up-tag>
+								</view> -->
+								<!-- <view v-for="(item, index) in dictSort" :key="index">
+									{{ item.dictValue }} - {{ item.dictLabel }}
+								</view> -->
+								{{dictSortMap[item.orderStatus]}}
 							</view>
 							<view class="Wrap-Btn">
 								<up-button type="primary" text="沟通" size="mini" shape="circle"
@@ -53,42 +57,43 @@
 </template>
 
 <script setup>
-import {
-	ref,
-	onMounted
-} from "vue"
-
-// const tab = ref('')
-const userType = uni.getStorageSync('userType') //读取本地存储
-
-// 用户/志愿者 识别标识
-const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
-const orderStatus = ref(0)
-const column2 = [{
-	name: "全部",
-	value: "",
-},
-{
-	name: "待支付",
-	value: "1",
-},
-{
-	name: "待服务",
-	value: "2",
-},
-{
-	name: "进行中",
-	value: "3",
-},
-{
-	name: "已完成",
-	value: "4",
-},
-{
-	name: "已取消",
-	value: "5",
-}
-]
+	import {
+		ref,
+		onMounted,
+		computed
+	} from "vue"
+
+
+	const userType = uni.getStorageSync('userType') //读取本地存储
+
+	// 用户/志愿者 识别标识
+	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
+	const orderStatus = ref(0)
+	const column2 = [{
+			name: "全部",
+			value: "",
+		},
+		{
+			name: "待支付",
+			value: "1",
+		},
+		{
+			name: "待服务",
+			value: "0",
+		},
+		{
+			name: "进行中",
+			value: "3",
+		},
+		{
+			name: "已完成",
+			value: "4",
+		},
+		{
+			name: "已取消",
+			value: "2",
+		}
+	]
 
 
 	const props = defineProps({
@@ -96,23 +101,34 @@ const column2 = [{
 			typeof: Array,
 			default: () => [],
 		},
+		dictSort: {
+			type: Array,
+			default: () => [], // 默认值
+		},
+		fetchData: Function, // 刷新数据的方法
 	})
 
+
 	const emits = defineEmits([
 		'fetchData'
 	])
+	
+	const dictSortMap = computed(() => {
+		let mapObj = {}
+		props.dictSort.forEach((item => {
+			mapObj[item.dictValue] = item.dictLabel
+		}))
+		return mapObj
+	})
 
-
-const handlClick = (item) => {
-	const mainOrderId = item.mainOrderId; // 获取详情id
-	uni.navigateTo({
-		url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
-	});
-}
+	const handlClick = (item) => {
+		const mainOrderId = item.mainOrderId; // 获取详情id
+		uni.navigateTo({
+			url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
+		});
+	}
 
 	function onChange(tabItem) {
-		console.log(tabItem,'>>>>>>>>>>>>tabItem')
-		// tab.value = tabItem.value;
 		emits('fetchData', tabItem.value)
 	}
 </script>

+ 213 - 196
pages/index.vue

@@ -54,238 +54,255 @@
 </template>
 
 <script setup>
-import {
-	ref,
-	reactive,
-	onMounted
-} from 'vue';
-import {
-	onLoad,
-	onShow,
-	onReachBottom
-} from "@dcloudio/uni-app";
-import RankingList from '@/pages/common/rankingList/index.vue';
-import ServIces from "@/components/Services/services.vue"
-import {
-	Client
-} from "@/components/Client/new_file.vue"
-import {
-	volunteerinfolist,
-} from "@/api/volunteerDetailsApi/details.js"
-import {
-	slideshow
-} from '@/api/home.js'
-
-const total = ref(0)
-const listData = ref([])
-const rightList = ref([])
-const leftList = ref([])
-const userType = uni.getStorageSync('userType') //读取本地存储
-const globalData = ref({
-	statusBarHeight: 47,
-	navBarHeight: 91
-});
-const data = reactive({
-	address: '重庆市',
-	queryValue: ''
-})
-const list3 = ref([]);
-const ValueZone = ref([]);
-const hotList = ref([])
-
-// 分页
-const pages = ref({
-	current: 1,
-	pageSize: 10,
-	total: 0
-})
-
-
-
-const loadmoreInfo = ref({
-	status: 'loadmore',
-	loadingText: '努力加载中...',
-	loadmoreText: '点击加载更多~',
-	nomoreText: '已经到底啦~'
-})
-
-// 加载更多
-async function handleLoadmore(e) {
-	if (pages.value.current < Math.ceil(pages.value.total / pages.value.pageSize)) {
-		pages.value.current += 1;
-		loadmoreInfo.value.status = 'loading';
-		await getList();
-	} else {
-		loadmoreInfo.value.status = 'nomore';
+	import {
+		ref,
+		reactive,
+		onMounted
+	} from 'vue';
+	import {
+		provide
+	} from 'vue';
+	import {
+		onLoad,
+		onShow,
+		onReachBottom
+	} from "@dcloudio/uni-app";
+	import RankingList from '@/pages/common/rankingList/index.vue';
+	import ServIces from "@/components/Services/services.vue"
+	import {
+		Client
+	} from "@/components/Client/new_file.vue"
+	import {
+		volunteerinfolist,
+	} from "@/api/volunteerDetailsApi/details.js"
+	import {
+		slideshow
+	} from '@/api/home.js'
+	import {
+		useDict
+	} from '@/utils/dict.js';
+	
+
+	const total = ref(0)
+	const listData = ref([])
+	const rightList = ref([])
+	const leftList = ref([])
+	const list3 = ref([]);
+	const ValueZone = ref([]);
+	const hotList = ref([])
+	const userType = uni.getStorageSync('userType') //读取本地存储
+
+	const {
+		lrr_service_category
+	} = useDict('lrr_service_category');
+
+	const globalData = ref({
+		statusBarHeight: 47,
+		navBarHeight: 91
+	});
+	const data = reactive({
+		address: '重庆市',
+		queryValue: ''
+	})
+
+	// 分页
+	const pages = ref({
+		current: 1,
+		pageSize: 10,
+		total: 0,
+		serviceCategory: '',
+		appStatus:"2",
+	})
+
+	const loadmoreInfo = ref({
+		status: 'loadmore',
+		loadingText: '努力加载中...',
+		loadmoreText: '点击加载更多~',
+		nomoreText: '已经到底啦~'
+	})
+
+	// 加载更多
+	async function handleLoadmore(e) {
+		if (pages.value.current < Math.ceil(pages.value.total / pages.value.pageSize)) {
+			pages.value.current += 1;
+			loadmoreInfo.value.status = 'loading';
+			await getList();
+		} else {
+			loadmoreInfo.value.status = 'nomore';
+		}
 	}
-}
-
 
-const getList = async () => {
-	try {
-		loadmoreInfo.value.status = 'loading';
 
-		// 请求时传递分页参数
-		const res = await volunteerinfolist({
-			pageNum: pages.value.current, // 当前页码
-			pageSize: pages.value.pageSize // 每页大小
-		});
+	const getList = async () => {
+		try {
+			loadmoreInfo.value.status = 'loading';
+
+			const params = {
+			    pageNum: pages.value.current,
+			    pageSize: pages.value.pageSize,
+			    serviceCategory: pages.value.serviceCategory || '',
+				appStatus:pages.value.appStatus,
+			  };
+			  console.log('请求参数:', params); // 调试输出
+			
+			  const res = await volunteerinfolist(params);
+
+			if (!res || !res.rows) {
+				return;
+			}
+
+			// 判断是否已经到了最后一页
+			if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
+				loadmoreInfo.value.status = 'nomore';
+			} else {
+				loadmoreInfo.value.status = 'loadmore';
+			}
+
+			// 将数据分成左右两列
+			res.rows.forEach((item, index) => {
+				index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item);
+			});
+
+			pages.value.total = res.total;
+		} catch (error) {
+			leftList.value = [];
+			rightList.value = [];
+			loadmoreInfo.value.status = 'loadmore';
+			pages.value.total = 0;
+			console.error('Error fetching data:', error);
+		}
+	};
 
-		console.log(res, '>>>>>>>res');
 
-		if (!res || !res.rows) {
-			return;
+	onReachBottom(() => {
+		if (pages.value.current < Math.ceil(pages.value.total / pages.value.pageSize)) {
+			pages.value.current = pages.value.current + 1
+			loadmoreInfo.value.status = 'nomore'
+			getList()
 		}
+	})
 
-		// 判断是否已经到了最后一页
-		if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
-			loadmoreInfo.value.status = 'nomore';
-		} else {
-			loadmoreInfo.value.status = 'loadmore';
-		}
 
-		// 将数据分成左右两列
-		res.rows.forEach((item, index) => {
-			index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item);
-		});
 
-		pages.value.total = res.total;
-	} catch (error) {
-		leftList.value = [];
-		rightList.value = [];
-		loadmoreInfo.value.status = 'loadmore';
-		pages.value.total = 0;
-		console.error('Error fetching data:', error);
-	}
-};
+	const getBanners = async () => {
+		try {
+			const res = await slideshow(7);
+			if (res.code === 200 && res.data.picture) {
+				list3.value = res.data.picture.split(',');
+			}
 
+			const value_res = await slideshow(8);
+			if (value_res.code === 200 && value_res.data.picture) {
+				ValueZone.value = value_res.data.picture.split(',');
+			}
 
-onReachBottom(() => {
-	if (pages.value.current < Math.ceil(pages.value.total / pages.value.pageSize)) {
-		pages.value.current = pages.value.current + 1
-		loadmoreInfo.value.status = 'nomore'
-		getList()
-	}
-})
+			const hot_res = await slideshow(11);
+			if (hot_res.code === 200 && hot_res.data.picture) {
+				hotList.value = hot_res.data.picture.split(',');
+			}
+		} catch (error) {
+			console.log('error', error);
 
+		}
+	}
 
+	onShow(() => {
+		getList()
+		getBanners();
+		// getListData()
+		// 在 App.vue  中初始化 
+		uni.getSystemInfo({
+			success: (res) => {
+				const statusBarHeight = res.statusBarHeight;
+				const navBarHeight = res.platform === 'android' ? 48 : 44 + res.statusBarHeight;
+				globalData.value = {
+					statusBarHeight,
+					navBarHeight
+				};
+				console.log('statusBarHeight', statusBarHeight, navBarHeight);
+
+			}
+		});
+	})
+</script>
 
-const getBanners = async () => {
-	try {
-		const res = await slideshow(7);
-		if (res.code === 200 && res.data.picture) {
-			list3.value = res.data.picture.split(',');
+<style scoped lang="scss">
+	.main-content {
+		background: rgba(255, 255, 255, 1);
+
+		.home-banner {
+			display: flex;
+			align-items: flex-end;
+			justify-content: space-between;
+			// background: rgba(255, 255, 255, 1);
+			// background-color: #ED806A;
+			background-color: rgba(221, 60, 62, 1);
+			box-shadow: 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 2.08rpx 4.17rpx rgba(0, 0, 0, 0.05);
+			padding: 20rpx 16rpx;
+			color: #fff;
+			position: fixed;
+			top: 0px;
+			left: 0px;
+			right: 0;
+			z-index: 99;
 		}
 
-		const value_res = await slideshow(8);
-		if (value_res.code === 200 && value_res.data.picture) {
-			ValueZone.value = value_res.data.picture.split(',');
+		.home-banner-left {
+			display: flex;
+			align-items: center;
+			width: 30%;
 		}
 
-		const hot_res = await slideshow(11);
-		if (hot_res.code === 200 && hot_res.data.picture) {
-			hotList.value = hot_res.data.picture.split(',');
+		.home-banner-center {
+			flex: 1;
+			font-size: 38rpx;
 		}
-	} catch (error) {
-		console.log('error', error);
 
-	}
-}
+		.home-banner-rigth {
+			width: 30%;
+		}
 
-onShow(() => {
-	getList()
-	getBanners();
+		.home-main {
+			padding: 12px 16px 0;
 
-	// 在 App.vue  中初始化 
-	uni.getSystemInfo({
-		success: (res) => {
-			const statusBarHeight = res.statusBarHeight;
-			const navBarHeight = res.platform === 'android' ? 48 : 44 + res.statusBarHeight;
-			globalData.value = { statusBarHeight, navBarHeight };
-			console.log('statusBarHeight', statusBarHeight, navBarHeight);
 
 		}
-	});
-})
-</script>
 
-<style scoped lang="scss">
-.main-content {
-	background: rgba(255, 255, 255, 1);
-
-	.home-banner {
-		display: flex;
-		align-items: flex-end;
-		justify-content: space-between;
-		// background: rgba(255, 255, 255, 1);
-		// background-color: #ED806A;
-		background-color: rgba(221, 60, 62, 1);
-		box-shadow: 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 2.08rpx 4.17rpx rgba(0, 0, 0, 0.05);
-		padding: 20rpx 16rpx;
-		color: #fff;
-		position: fixed;
-		top: 0px;
-		left: 0px;
-		right: 0;
-		z-index: 99;
-	}
-
-	.home-banner-left {
-		display: flex;
-		align-items: center;
-		width: 30%;
+		.home-ranking {
+			padding: 24rpx 16px;
+		}
 	}
 
-	.home-banner-center {
-		flex: 1;
-		font-size: 38rpx;
+	.hot-box-title {
+		padding: 0 32rpx;
 	}
 
-	.home-banner-rigth {
-		width: 30%;
+	.hot-swiper {
+		padding: 24rpx 32rpx 0;
 	}
 
-	.home-main {
-		padding: 12px 16px 0;
+	.hot-box {
+		padding: 24rpx 32rpx;
+		display: grid;
+		grid-template-columns: repeat(2, 1fr);
+		gap: 8rpx;
 
 
+		.hot-item {
+			// padding: 32rpx 16rpx;
+			// border-radius: 10rpx;
+		}
 	}
 
-	.home-ranking {
-		padding: 24rpx 16px;
+	.home-grid2 {
+		margin-bottom: 32rpx;
+		background: #fff;
+		padding: 12px 0;
+		border-radius: 8px;
 	}
-}
-
-.hot-box-title {
-	padding: 0 32rpx;
-}
-
-.hot-swiper {
-	padding: 24rpx 32rpx 0;
-}
-
-.hot-box {
-	padding: 24rpx 32rpx;
-	display: grid;
-	grid-template-columns: repeat(2, 1fr);
-	gap: 8rpx;
-
 
-	.hot-item {
-		// padding: 32rpx 16rpx;
-		// border-radius: 10rpx;
+	.home-g-bgc {
+		background: #f7f7f7;
+		padding: 24rpx;
 	}
-}
-
-.home-grid2 {
-	margin-bottom: 32rpx;
-	background: #fff;
-	padding: 12px 0;
-	border-radius: 8px;
-}
-
-.home-g-bgc {
-	background: #f7f7f7;
-	padding: 24rpx;
-}
 </style>

+ 0 - 3
pages_home/components/volunteerSide/adresss.vue

@@ -71,10 +71,7 @@
 
 		function handleChane(addressId, item) {
 			const selectedItem = dataList.value.find(item => item.addressId === addressId);
-			 console.log('准备发送的数据:', JSON.stringify(selectedItem));
 			emits('update:modelValue', false)
-
-
 			emits('update:addressInfo',selectedItem)
 		}
 

+ 75 - 55
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -241,16 +241,16 @@
 	const showSum = ref(false);
 	const remark = ref('') //备注
 	const radiovalue1 = ref('苹果');
+	const selectedAddress = ref(null);
+	const addressFlag = ref(false)
+
+	const addressInfo = ref(null)
 	// Radio 单选框数据
 	const radiolist1 = reactive([{
 		name: '',
 		disabled: false,
 	}, ]);
 
-	const selectedAddress = ref(null);
-	const addressFlag = ref(false)
-
-	const addressInfo = ref(null)
 
 	// 详情底部立即购买弹框
 	const buttonClick = (e) => {
@@ -477,59 +477,79 @@
 		}
 		return []
 	})
+	
+	
+	
 	// 确认购买
-	const handlConfiRmpurchase = async () => {
-		// 定义要发送的数据
-		const orderData = {
-			orders: {
-				serviceOnePrice: businessPrice.value,
-				serviceTotalPrice: computeMoney.value, //需要传获取到的总价
-				serviceCategory: serviceCategory.value, //大类别参数
-				totalTimes: totalTimes.value, //点击的次数
-				serviceStartDate: "2025-04-18",
-				startTime: "8:00",
-				serviceDuration: 4,
-				paymentMethod: 1,
-				volunteerId: volunteerId.value,
-				remark: remark.value,
-				businessManagementId: businessManagementId.value,
-				volunteerInfoId: listData.value.volunteerInfoId,
-				addressId:selectedAddress.value.addressId,
-			},
-			workDateList: []
-		};
-		// 转换所有选择的时间
-		selectedTimes.value.forEach(item => {
-			orderData.workDateList.push({
-				workDate: item.date,
-				workStartTime: item.time
-			});
-		});
-
-		try {
-			const res = await ordersCreateOrder(orderData);
-			if (res.code == 200) {
-				uni.showToast({
-					title: '支付成功',
-					icon: 'success', // 或者 'none'
-					duration: 1500, // 显示时间,单位毫秒,默认1500
-					mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
-				});
-				setTimeout(() => {
-					uni.reLaunch({
-						url: '/pages/index'
-					});
-				}, 1500)
-			}
-		} catch (error) {
-			uni.showToast({
-				title: '支付失败',
-				icon: 'error', // 或者 'none'
-				duration: 1500, // 显示时间,单位毫秒,默认1500
-				mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
-			});
-		}
+	const handlConfiRmpurchase = () => {
+		if (!selectedAddress.value) {
+		    uni.showToast({
+		      title: '请先选择收货地址',
+		      icon: 'none',
+		      duration: 2000,
+		    });
+		    return; // 阻止购买
+		  }
+		
+		  // 如果有地址,执行购买逻辑
+		  proceedToPayment();
+		
+
+	
 	};
+	
+	const proceedToPayment = async () => {
+	  // 定义要发送的数据
+	  const orderData = {
+	  	orders: {
+	  		serviceOnePrice: businessPrice.value,
+	  		serviceTotalPrice: computeMoney.value, //需要传获取到的总价
+	  		serviceCategory: serviceCategory.value, //大类别参数
+	  		totalTimes: totalTimes.value, //点击的次数
+	  		serviceStartDate: "2025-04-18",
+	  		startTime: "8:00",
+	  		serviceDuration: 4,
+	  		paymentMethod: 1,
+	  		volunteerId: volunteerId.value,
+	  		remark: remark.value,
+	  		businessManagementId: businessManagementId.value,
+	  		volunteerInfoId: listData.value.volunteerInfoId,
+	  		addressId:selectedAddress.value.addressId,
+	  	},
+	  	workDateList: []
+	  };
+	  // 转换所有选择的时间
+	  selectedTimes.value.forEach(item => {
+	  	orderData.workDateList.push({
+	  		workDate: item.date,
+	  		workStartTime: item.time
+	  	});
+	  });
+	  try {
+	  	const res = await ordersCreateOrder(orderData);
+	  	if (res.code == 200) {
+	  		uni.showToast({
+	  			title: '支付成功',
+	  			icon: 'success', // 或者 'none'
+	  			duration: 1500, // 显示时间,单位毫秒,默认1500
+	  			mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
+	  		});
+	  		setTimeout(() => {
+	  			uni.reLaunch({
+	  				url: '/pages/index'
+	  			});
+	  		}, 1500)
+	  	}
+	  } catch (error) {
+	  	uni.showToast({
+	  		title: '支付失败',
+	  		icon: 'error', // 或者 'none'
+	  		duration: 1500, // 显示时间,单位毫秒,默认1500
+	  		mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
+	  	});
+	  }
+	};
+
 
 	onMounted(async () => {
 		await getListTime()

+ 87 - 36
pages_home/pages/client/details.vue

@@ -31,8 +31,8 @@
 			<!-- 瀑布流 -->
 			<view v-if="userType == '1'">
 				<up-waterfall v-model="flowList">
-					<template #left :listData="listData">
-						<view class="demo-warter" v-for="(item, index) in listData" :key="index"
+					<template #left>
+						<view class="demo-warter" v-for="(item, index) in leftList" :key="index"
 							@click="goToDetail(item)">
 							<up-lazy-load threshold="-450" border-radius="10" :image="item.volunteerPicture"
 								:index="index"></up-lazy-load>
@@ -51,7 +51,7 @@
 							</view>
 						</view>
 					</template>
-					<template #right :rightList="rightList">
+					<template #right>
 						<view class="demo-warter" v-for="(item, index) in rightList" :key="index"
 							@click="goToDetail(item)">
 							<up-lazy-load threshold="-450" border-radius="10" :image="item.volunteerPicture"
@@ -73,6 +73,9 @@
 					</template>
 				</up-waterfall>
 			</view>
+			<up-loadmore style="margin-top: 40rpx;" :status="loadmoreInfo.status"
+				:loadmoreText="loadmoreInfo.loadingText" :loadingText="loadmoreInfo.loadmoreText"
+				:nomoreText="loadmoreInfo.nomoreText" @loadmore="handleLoadmore" v-if="userType == 1" />
 
 		</view>
 	</view>
@@ -87,8 +90,11 @@
 		nextTick
 	} from 'vue';
 	import {
-		onLoad
-	} from '@dcloudio/uni-app';
+		onLoad,
+		onShow,
+		onReachBottom
+	} from "@dcloudio/uni-app";
+
 	import {
 		typeOptionSelect,
 		volunteerInfoList,
@@ -98,9 +104,6 @@
 		volunteerSeachgetTreeList,
 		volunteerinfolist
 	} from "@/api/volunteerDetailsApi/details.js"
-	import {
-		useRoute
-	} from 'vue-router';
 
 
 	const value1 = ref(1)
@@ -110,11 +113,17 @@
 	const flowList = ref([]); //list数据
 	const listData = ref([])
 	const rightList = ref([])
+	const currentTabs2 = ref(0)
+	const total = ref(0)
+	const serviceCategory = ref('')
+	const leftList = ref([])
+	const showDropdown = ref(false)
+
+
+
 	const defaultTab = ref({
 		dictValue: 1
 	});
-	const currentTabs2 = ref(0)
-	const total = ref(0)
 
 
 	const userType = uni.getStorageSync('userType') //读取本地存储
@@ -122,31 +131,18 @@
 	// 用户/志愿者 识别标识
 	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
 
-	// 获取当前路由对象
-	const route = useRoute();
-
-	// 存储服务名称
-	const serviceName = ref('');
 
-	const showDropdown = ref(false)
 
 	function handlTabs(item, index) {
-		console.log(index, typeof index, '>>>>index');
-		console.log(item, '>>>>item');
 		currentTabs2.value = 0
 		list2.value = item.children
-
 	}
 
 	function clickList2(item, index) {
-		console.log(index, typeof index, '>>>>index99999');
-		console.log(item, '>>>>item9999');
-		// list2.value = item.children
 		currentTabs2.value = index
 	}
 
 	function toggleDropdown() {
-		console.log("点击了")
 		showDropdown.value = !showDropdown.value
 	}
 
@@ -171,38 +167,93 @@
 
 	onLoad((options) => {
 		const dataList = JSON.parse(decodeURIComponent(options.dataList));
-		// businessName
-		console.log(dataList, '>>>>>option');
-		// data.value = option;
-
 		list1.value = dataList
 		list2.value = dataList[0].children
+	})
+
+	// 分页
+	const pages = ref({
+		current: 1,
+		pageSize: 10,
+		total: 0
+	})
 
+
+
+	const loadmoreInfo = ref({
+		status: 'loadmore',
+		loadingText: '努力加载中...',
+		loadmoreText: '点击加载更多~',
+		nomoreText: '已经到底啦~'
 	})
 
+
+	// 加载更多
+	async function handleLoadmore(e) {
+		if (pages.value.current < Math.ceil(pages.value.total / pages.value.pageSize)) {
+			pages.value.current += 1;
+			loadmoreInfo.value.status = 'loading';
+			await getList();
+		} else {
+			loadmoreInfo.value.status = 'nomore';
+		}
+	}
+
+
+	// const getListAdderss = async () => {
+	// 	const res = await volunteerDataList()
+	// 	console.log(res, 'volunteerDataList>>>>>>>>>>')
+	// }
+	
+
 	const getList = async () => {
 		try {
-			const res = await volunteerinfolist();
+			loadmoreInfo.value.status = 'loading';
+
+			// 请求时传递分页参数
+			const res = await volunteerinfolist({
+				pageNum: pages.value.current, // 当前页码
+				pageSize: pages.value.pageSize, // 每页大小
+				serviceCategory: serviceCategory.value
+			});
+
+			console.log(res, '>>>>>>>res');
+
 			if (!res || !res.rows) {
-				console.error('No data returned from API');
 				return;
 			}
 
-			let leftArr = [];
-			let rightArr = [];
+			// 判断是否已经到了最后一页
+			if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
+				loadmoreInfo.value.status = 'nomore';
+			} else {
+				loadmoreInfo.value.status = 'loadmore';
+			}
 
-			(res.rows || []).forEach((item, index) => {
-				index % 2 !== 0 ? leftArr.push(item) : rightArr.push(item);
+			// 将数据分成左右两列
+			res.rows.forEach((item, index) => {
+				index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item);
 			});
 
-			listData.value = leftArr;
-			rightList.value = rightArr;
-			total.value = res.rows;
+			pages.value.total = res.total;
 		} catch (error) {
+			leftList.value = [];
+			rightList.value = [];
+			loadmoreInfo.value.status = 'loadmore';
+			pages.value.total = 0;
 			console.error('Error fetching data:', error);
 		}
 	};
 
+	onReachBottom(() => {
+		if (loadmoreInfo.value.status !== 'nomore') { // 更宽松的条件
+			loadmoreInfo.value.status = 'loading';
+			pages.value.current += 1;
+			getList();
+		}
+	})
+
+
 
 	onMounted(() => {
 		getList()