Parcourir la source

下单地址id修改,分类志愿者图片修改

贾宇博 il y a 3 semaines
Parent
commit
0fdfb791d6

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

@@ -21,7 +21,7 @@
 				<up-list-item v-for="(item, index) in dataList" :key="index">
 					<view class="list-item">
 						<!-- 左侧图片 -->
-						<image src="/static/img/dd.png" mode="aspectFill" class="item-image"></image>
+						<image :src="item.volunteerPicture" mode="aspectFill" class="item-image"></image>
 
 						<!-- 中间信息 -->
 						<view class="item-info">

+ 4 - 2
pages_classify/pages/orderItem/orderdetails.vue

@@ -17,7 +17,9 @@
 			  
 			  <!-- 下方地址信息 -->
 			  <view class="address-detail">
-			    {{listData.address.address}}
+			    {{listData.address.provinceName}}
+			    {{listData.address.cityName}}
+				{{listData.address.districtName}}
 			  </view>
 			</view>
 
@@ -62,7 +64,7 @@
 
 					</view>
 					<view class="list-item">
-						<image src="/static/img/dd.png" mode="aspectFill" class="item-image"></image>
+						<image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image"></image>
 						<!-- 状态:orderStatus: 0未开始 ,1进行中,2已完成-->
 						<!-- score如果=null,显示待评价, -->
 

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

@@ -70,7 +70,6 @@
 		])
 
 		function handleChane(addressId, item) {
-			console.log('当前选中的 addressId:', addressId);
 			const selectedItem = dataList.value.find(item => item.addressId === addressId);
 			 console.log('准备发送的数据:', JSON.stringify(selectedItem));
 			emits('update:modelValue', false)

+ 4 - 3
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -220,6 +220,7 @@
 
 	const src = ref('http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg')
 	const businessPrice = ref() //价格
+	const addressId = ref('')//用户下单地址
 	const volunteerId = ref(''); // 存储志愿者ID
 	const serviceCategory = ref('') //存储大类别
 	const businessManagementId = ref('') //具体分类id
@@ -292,9 +293,9 @@
 
 	// 新增:处理子组件传回的地址数据
 	const handleAddressUpdate = (newAddress) => {
+		console.log(newAddress,'接受到的数据')
 		selectedAddress.value = newAddress;
 		addressFlag.value = false; // 关闭选择器
-		console.log('selectedAddress更新后:', JSON.stringify(selectedAddress.value)); // 添加这行
 	};
 	// 详情底部底部数据
 	const options = ref([{
@@ -489,11 +490,11 @@
 				startTime: "8:00",
 				serviceDuration: 4,
 				paymentMethod: 1,
-				addressId: 7,
 				volunteerId: volunteerId.value,
 				remark: remark.value,
 				businessManagementId: businessManagementId.value,
 				volunteerInfoId: listData.value.volunteerInfoId,
+				addressId:selectedAddress.value.addressId,
 			},
 			workDateList: []
 		};
@@ -523,7 +524,7 @@
 		} catch (error) {
 			uni.showToast({
 				title: '支付失败',
-				icon: 'success', // 或者 'none'
+				icon: 'error', // 或者 'none'
 				duration: 1500, // 显示时间,单位毫秒,默认1500
 				mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
 			});

+ 4 - 30
pages_mine/components/setupUser/Add.vue

@@ -25,16 +25,6 @@
 				:style="{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }" labelWidth="70">
 				<up-input v-model="modelForm.telephone" border="none" placeholder="请输入手机号"></up-input>
 			</up-form-item>
-			<up-form-item label="是否有传染疾病" prop="isContagion" borderBottom labelWidth="150">
-				<up-radio-group v-model="modelForm.isContagion" placement="row" @change="handleContagionChange">
-					<up-radio :customStyle="{marginRight: '16px'}" v-for="(item, index) in isContagionOption"
-						:key="index" :label="item.name" :name="item.key"></up-radio>
-				</up-radio-group>
-			</up-form-item>
-			<up-form-item v-show="showContagionContent" label="传染病内容" prop="haveContagion" borderBottom
-				labelWidth="100">
-				<up-input v-model="modelForm.haveContagion" border="none" placeholder="请输入传染病内容"></up-input>
-			</up-form-item>
 			<up-form-item label="地区" prop="area" borderBottom @click="()=> addressShow = true" labelWidth="70">
 				<pickerAddress @change="addressChange"
 					:selectValue="[ modelForm.provinceInd, modelForm.cityInd, modelForm.districtInd ]">
@@ -74,8 +64,6 @@
 		label: '',
 		age: '',
 		telephone: '',
-		isContagion: '',
-		haveContagion: '',
 
 		provinceName: '', // 省
 		provinceCode: '',
@@ -91,7 +79,8 @@
 
 		address: ''
 	})
-	// 回显把provinceName,cityName,districtName字段拼接
+	
+	
 	const rulesForm = ref({
 		name: {
 			type: 'string',
@@ -140,17 +129,7 @@
 		value: 1,
 	}, ]);
 
-	const isContagionOption = ref([{
-			name: '是',
-			key: 1,
-			disabled: false,
-		},
-		{
-			name: '否',
-			key: 0,
-			disabled: false,
-		}
-	])
+
 	const relaTionsHip = ref([{
 			name: '父母'
 		}, {
@@ -220,12 +199,7 @@
 
 	}
 
-	function handleContagionChange(value) {
-		showContagionContent.value = value === 1; // 显示传染病内容输入框
-		if (value === 0) {
-			modelForm.value.haveContagion = ''; // 清空输入框
-		}
-	}
+	
 	// 预留校验函数
 	function handleVerify() {
 		// formRef.value

+ 45 - 58
pages_mine/pages/selectAddress/edit.vue

@@ -25,16 +25,6 @@
 				:style="{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }" labelWidth="70">
 				<up-input v-model="modelForm.telephone" border="none" placeholder="请输入手机号"></up-input>
 			</up-form-item>
-			<up-form-item label="是否有传染疾病" prop="isContagion" borderBottom labelWidth="150">
-				<up-radio-group v-model="modelForm.isContagion" placement="row" @change="handleContagionChange">
-					<up-radio :customStyle="{marginRight: '16px'}" v-for="(item, index) in isContagionOption"
-						:key="index" :label="item.name" :name="item.key"></up-radio>
-				</up-radio-group>
-			</up-form-item>
-			<up-form-item v-show="showContagionContent" label="传染病内容" prop="haveContagion" borderBottom
-				labelWidth="100">
-				<up-input v-model="modelForm.haveContagion" border="none" placeholder="请输入传染病内容"></up-input>
-			</up-form-item>
 			<up-form-item label="地区" prop="area" borderBottom @click="()=> addressShow = true" labelWidth="70">
 				<pickerAddress @change="addressChange"
 					:selectValue="[ modelForm.provinceInd, modelForm.cityInd, modelForm.districtInd ]">
@@ -58,7 +48,8 @@
 		<up-action-sheet :show="labelFlag" :actions="relaTionsHip" @select="sexSelectsHip"
 			@close="labelFlag = false"></up-action-sheet>
 		<view class="Wrapper-Btn">
-			<up-button @click="handleQux" type="error" :plain="true" :hairline="true" text="取消" :customStyle="hadlClickEdit"></up-button>
+			<up-button @click="handleQux" type="error" :plain="true" :hairline="true" text="取消"
+				:customStyle="hadlClickEdit"></up-button>
 			<up-button type="error" @click="handleSubmit" text="编辑" :customStyle="hadlClickEdit" />
 		</view>
 	</view>
@@ -70,6 +61,7 @@
 		reactive,
 		computed,
 	} from 'vue';
+
 	import {
 		onLoad
 	} from '@dcloudio/uni-app';
@@ -80,7 +72,7 @@
 
 	const formRef = ref(null)
 
-	// 获取页面传递的参数
+
 	// 获取页面传递的参数
 	onLoad((options) => {
 		if (options) {
@@ -90,18 +82,15 @@
 			options.provinceName = decodeURIComponent(decodeURIComponent(options.provinceName || ''));
 			options.name = decodeURIComponent(decodeURIComponent(options.name || ''));
 			options.address = decodeURIComponent(decodeURIComponent(options.address || ''));
-			options.haveContagion = decodeURIComponent(decodeURIComponent(options.haveContagion || ''));
 			modelForm.value = {
 				...modelForm.value,
 				...options,
 				sex: options.sex ? Number(options.sex) : '',
 				age: options.age ? Number(options.age) : '',
-				isContagion: options.isContagion ? Number(options.isContagion) : '',
 				provinceName: options.provinceName || '',
 				cityName: options.cityName || '',
 				districtName: options.districtName || '',
 			};
-			showContagionContent.value = options.isContagion === 1;
 		}
 	});
 
@@ -111,8 +100,6 @@
 		label: '',
 		age: '',
 		telephone: '',
-		isContagion: '',
-		haveContagion: '',
 
 		provinceName: '', // 省
 		provinceCode: '',
@@ -166,8 +153,7 @@
 	let labelFlag = ref(false)
 	let addressShow = ref(false)
 	let index = ref(0)
-	// 新增一个响应式变量,控制传染病内容的显示
-	const showContagionContent = ref(false);
+
 
 	const sexOptions = ref([{
 		name: '男',
@@ -177,17 +163,6 @@
 		value: 1,
 	}, ]);
 
-	const isContagionOption = ref([{
-			name: '是',
-			key: 1,
-			disabled: false,
-		},
-		{
-			name: '否',
-			key: 0,
-			disabled: false,
-		}
-	])
 	const relaTionsHip = ref([{
 			name: '父母'
 		}, {
@@ -236,29 +211,42 @@
 		labelFlag.value = false;
 	}
 
-	function addressChange(info) {
-
-		console.log(info, '>>>>data');
-
-		const {
-			data,
-			code,
-			index
-		} = info
-
-		modelForm.value.provinceName = data[0]
-		modelForm.value.provinceCode = code[0]
-		modelForm.value.provinceInd = index[0]
-
-		modelForm.value.cityName = data[1]
-		modelForm.value.cityCode = code[1]
-		modelForm.value.cityInd = index[1]
-
-		modelForm.value.districtName = data[2]
-		modelForm.value.districtCode = code[2]
-		modelForm.value.districtInd = index[2]
-	}
-
+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;
+}
 	// 提交编辑
 	async function handleSubmit() {
 		try {
@@ -269,7 +257,6 @@
 			const submitData = {
 				...modelForm.value,
 				sex: modelForm.value.sex,
-				isContagion: modelForm.value.isContagion
 			};
 
 			// 3. 显示加载中提示(可选)
@@ -301,7 +288,7 @@
 
 				// 7. 跳转页面
 				uni.navigateTo({
-					url:'/pages_mine/pages/selectAddress/index'
+					url: '/pages_mine/pages/selectAddress/index'
 				});
 			} else {
 				uni.showToast({
@@ -318,9 +305,9 @@
 			});
 		}
 	}
-	const handleQux = () =>{
+	const handleQux = () => {
 		uni.navigateBack({
-			delta:1
+			delta: 1
 		})
 	}
 	const hadlClickEdit = {
@@ -330,7 +317,7 @@
 </script>
 
 <style scoped>
-	.Wrapper-Btn{
+	.Wrapper-Btn {
 		display: flex;
 		justify-content: center;
 		align-items: center;