Forráskód Böngészése

用户订单/志愿者订单状态修改---用户下单优化

贾宇博 2 hete%!(EXTRA string=óta)
szülő
commit
472d08542b

+ 5 - 5
pages/classify.vue

@@ -49,7 +49,7 @@
 
 	const {
 		order_status,
-		lrr_service_status
+		// lrr_service_status
 	} = useDict('order_status', 'lrr_service_status');
 
 	provide('order_status', order_status); //订单/服务状态
@@ -76,19 +76,19 @@
 		},
 		{
 			name: "待服务",
-			value: "0",
+			value: "1",
 		},
 		{
 			name: "进行中",
-			value: "1",
+			value: "3",
 		},
 		{
 			name: "已完成",
-			value: "2",
+			value: "4",
 		},
 		{
 			name: "已取消",
-			value: "3",
+			value: "2",
 		}
 	]
 

+ 2 - 2
pages/common/classify/orderlist.vue

@@ -67,11 +67,11 @@
 		},
 		{
 			name: "待支付",
-			value: "1",
+			value: "0",
 		},
 		{
 			name: "待服务",
-			value: "0",
+			value: "1",
 		},
 		{
 			name: "进行中",

+ 121 - 90
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -74,7 +74,8 @@
 							type="daterange"></uniDatetimePickerMy>
 					</view>
 					<view>
-						<its-calendar v-if="show" :businessDuration="listData.businessDuration" :timeArr="doorToDoorTimeArr" :timeHostArr="timeHostArr" @getByDate="getByDate"
+						<its-calendar v-if="show" :businessDuration="listData.businessDuration"
+							:timeArr="doorToDoorTimeArr" :timeHostArr="timeHostArr" @getByDate="getByDate"
 							@getByTime="getByTime"></its-calendar>
 					</view>
 				</view>
@@ -99,7 +100,6 @@
 				<up-cell-group>
 					<view @click="jumpToAddressSelect" style="display: flex; align-items: center; padding: 10px;">
 						<up-icon name="more-dot-fill" size="16" />
-
 						<view v-if="selectedAddress" style="margin-left: 8px; flex: 1;">
 							<view class="address-display">
 								<text class="address-line">
@@ -113,20 +113,19 @@
 						</view>
 						<text v-else style="margin-left: 8px; font-size: 14px;">请选择服务地址</text>
 					</view>
-					<view class="card-container" v-for="(item, index) in selectedTimes" :key="index">
-						<image class="card-image" :src="listData.volunteerPicture" mode="aspectFill"></image>
-						<view class="card-content"> <!-- Content container -->
-							<view class="info-item">服务项目:{{listData.projectName}}</view>
-							<view class="Telephone">服务时长:{{listData.businessDuration}}</view>
-							<view class="date">日期:{{item.date}}</view>
-							<view class="time">
-								时间:{{ item.time }}
-								<!-- <span v-for="(i,ind) in item.timeArr" :key="ind">
-									{{i}} 
-								</span> -->
+					<scroll-view scroll-y style="height: 460rpx;">
+						<view class="card-container" v-for="(item, index) in selectedTimes" :key="index">
+							<image class="card-image" :src="listData.volunteerPicture" mode="aspectFill"></image>
+							<view class="card-content">
+								<view class="info-item">服务项目:{{listData.projectName}}</view>
+								<view class="Telephone">服务时长:{{listData.businessDuration}}</view>
+								<view class="date">日期:{{item.date}}</view>
+								<view class="time">
+									时间:{{ item.time }}
+								</view>
 							</view>
 						</view>
-					</view>
+					</scroll-view>
 				</up-cell-group>
 			</view>
 
@@ -142,7 +141,7 @@
 				<!-- 钱包支付选项 -->
 				<view class="payment-option">
 					<view class="option-left">
-						<image src="/static/my/钱包.png" class="payment-icon"></image>
+						<image src="/static/钱包.png" class="payment-icon"></image>
 						<text class="option-text">钱包</text>
 					</view>
 					<up-radio-group v-model="radiovalue1" placement="column">
@@ -218,7 +217,7 @@
 
 	const src = ref('http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg')
 	const businessPrice = ref() //价格
-	const addressId = ref('')//用户下单地址
+	const addressId = ref('') //用户下单地址
 	const volunteerId = ref(''); // 存储志愿者ID
 	const serviceCategory = ref('') //存储大类别
 	const businessManagementId = ref('') //具体分类id
@@ -332,7 +331,7 @@
 
 	// 获取传递的参数
 	onLoad(async (options) => {
-		const option = JSON.parse(decodeURIComponent(options.params));		
+		const option = JSON.parse(decodeURIComponent(options.params));
 		const {
 			volunteerId: id,
 			serviceCategory: categoy,
@@ -371,7 +370,7 @@
 			console.error('接口返回的日期范围为空');
 			doorToDoorTimeArr.value = [];
 			timeHostArr.value = []; // 清空时间段
-			
+
 		}
 	};
 
@@ -396,20 +395,20 @@
 		try {
 			const res = await volunteergetTimesByDate(params);
 			const TArr = res.data.map((item) => {
-				
+
 				// 初始化disabled变量
 				let disabled = false
-				if (item.hasReservation === 1) (disabled = true)
-				
+				if (item.hasReservation === 1)(disabled = true)
+
 				let itemTime = item.timeStamp > 9999999999 ? item.timeStamp : item.timeStamp * 1000;
-				
-				if (new Date().getTime() > itemTime) (disabled = true)
-				
+
+				if (new Date().getTime() > itemTime)(disabled = true)
+
 				return {
 					...item,
 					hours: item.reservationTime,
 					timeStamp: new Date(`${date} ${item.reservationTime}`).getTime() / 1000,
-					date:date,
+					date: date,
 					checked: false,
 					disabled
 				}
@@ -422,7 +421,7 @@
 			}
 
 			// 填充时间段数组
-			timeHostArr.value = Array(doorToDoorTimeArr.value.length).fill(TArr);			
+			timeHostArr.value = Array(doorToDoorTimeArr.value.length).fill(TArr);
 		} catch (error) {
 			console.error('获取排班时间失败:', error);
 		}
@@ -432,7 +431,7 @@
 		if (timeObj.clicked) {
 			return;
 		}
-		
+
 		if (timeObj.checked) { // 选中 添加到已选时间数组
 			selectedTimes.value.push({
 				date: timeObj.date,
@@ -489,74 +488,74 @@
 		}
 		return []
 	})
-	
-	
-	
+
+
+
 	// 确认购买
 	const handlConfiRmpurchase = () => {
 		if (!selectedAddress.value) {
-		    uni.showToast({
-		      title: '请先选择收货地址',
-		      icon: 'none',
-		      duration: 2000,
-		    });
-		    return; // 阻止购买
-		  }
-		
-		  // 如果有地址,执行购买逻辑
-		  proceedToPayment();
+			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
-	  	});
-	  }
+		// 定义要发送的数据
+		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
+			});
+		}
 	};
 
 
@@ -566,6 +565,38 @@
 </script>
 
 <style scoped>
+	/* 添加卡片样式 */
+	.card-container {
+		display: flex;
+		padding: 20rpx;
+		margin: 10rpx;
+		background-color: #fff;
+		border-radius: 10rpx;
+		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
+	}
+
+	.card-image {
+		width: 120rpx;
+		height: 120rpx;
+		border-radius: 10rpx;
+		margin-right: 20rpx;
+	}
+
+	.card-content {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+	}
+
+	.info-item,
+	.Telephone,
+	.date,
+	.time {
+		font-size: 26rpx;
+		margin-bottom: 8rpx;
+	}
+
 	.box {
 		height: 100vh;
 		width: 100vw;

+ 1 - 2
pages_mine/components/setupUser/Add.vue

@@ -21,8 +21,7 @@
 			<up-form-item label="年龄" prop="age" borderBottom labelWidth="70">
 				<up-input v-model="modelForm.age" border="none" placeholder="请输入年龄"></up-input>
 			</up-form-item>
-			<up-form-item label="手机号" prop="telephone" borderBottom
-				:style="{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }" labelWidth="70">
+			<up-form-item label="手机号" prop="telephone" borderBottom labelWidth="70">
 				<up-input v-model="modelForm.telephone" border="none" placeholder="请输入手机号"></up-input>
 			</up-form-item>
 			<up-form-item label="地区" prop="area" borderBottom @click="()=> addressShow = true" labelWidth="70">

+ 63 - 37
pages_mine/pages/selectAddress/edit.vue

@@ -36,7 +36,7 @@
 					</view>
 				</pickerAddress>
 				<template #right>
-					<up-icon name="arrow-right"></up-icon>
+					<up-icon name="map" size="22" @click="onCityWx"></up-icon>
 				</template>
 			</up-form-item>
 			<up-form-item label="地址" prop="address" borderBottom labelWidth="70">
@@ -211,42 +211,68 @@
 		labelFlag.value = false;
 	}
 
-function addressChange(info) {
-    console.log(info, '>>>>data');
-    
-    if (!info || !info.data) {
-        console.error('Invalid address change info:', info);
-        return;
-    }
-    
-    if (!Array.isArray(info.data) || info.data.length < 3) {
-        console.error('Invalid address data:', info.data);
-        return;
-    }
-    
-    const code = Array.isArray(info.code) ? info.code : ['', '', ''];
-    
-    let indexArray;
-    if (Array.isArray(info.index)) {
-        indexArray = info.index;
-    } else if (info.index && typeof info.index[Symbol.iterator] === 'function') {
-        indexArray = Array.from(info.index);
-    } else {
-        indexArray = [0, 0, 0];
-    }
-    
-    modelForm.value.provinceName = info.data[0] || '';
-    modelForm.value.provinceCode = code[0] || '';
-    modelForm.value.provinceInd = indexArray[0] || 0;
-    
-    modelForm.value.cityName = info.data[1] || '';
-    modelForm.value.cityCode = code[1] || '';
-    modelForm.value.cityInd = indexArray[1] || 0;
-    
-    modelForm.value.districtName = info.data[2] || '';
-    modelForm.value.districtCode = code[2] || '';
-    modelForm.value.districtInd = indexArray[2] || 0;
-}
+	function addressChange(info) {
+		console.log(info, '>>>>data');
+
+		if (!info || !info.data) {
+			console.error('Invalid address change info:', info);
+			return;
+		}
+
+		if (!Array.isArray(info.data) || info.data.length < 3) {
+			console.error('Invalid address data:', info.data);
+			return;
+		}
+
+		const code = Array.isArray(info.code) ? info.code : ['', '', ''];
+
+		let indexArray;
+		if (Array.isArray(info.index)) {
+			indexArray = info.index;
+		} else if (info.index && typeof info.index[Symbol.iterator] === 'function') {
+			indexArray = Array.from(info.index);
+		} else {
+			indexArray = [0, 0, 0];
+		}
+
+		modelForm.value.provinceName = info.data[0] || '';
+		modelForm.value.provinceCode = code[0] || '';
+		modelForm.value.provinceInd = indexArray[0] || 0;
+
+		modelForm.value.cityName = info.data[1] || '';
+		modelForm.value.cityCode = code[1] || '';
+		modelForm.value.cityInd = indexArray[1] || 0;
+
+		modelForm.value.districtName = info.data[2] || '';
+		modelForm.value.districtCode = code[2] || '';
+		modelForm.value.districtInd = indexArray[2] || 0;
+	}
+
+	function onCityWx(row) {
+		console.log('地区选点', row);
+		wx.chooseLocation({
+			success: function(res) {
+				const result = splitAddress(res.address);
+				console.log(res, result);
+				modelForm.value.provinceName = result.province
+				modelForm.value.cityName = result.city
+				modelForm.value.districtName = result.district
+				modelForm.value.address = result.detail
+				modelForm.value.longitude = res.longitude
+				modelForm.value.latitude = res.latitude
+
+
+			},
+			fail: function(err) {
+				console.log(err);
+				uni.showToast({
+					title: '获取地址失败',
+					icon: 'error',
+				});
+			},
+		})
+	}
+
 	// 提交编辑
 	async function handleSubmit() {
 		try {

+ 1 - 1
pages_mine/pages/setupUser/Address.vue

@@ -57,7 +57,7 @@
 	
 	const handleQux = () =>{
 		uni.navigateBack({
-			delta:1
+			delta:-1
 		})
 	}
 	const hadlClickEdit = {

BIN
static/钱包.png