Преглед изворни кода

订单服务状态/用户评论页面布局修改

贾宇博 пре 3 недеља
родитељ
комит
12ecaeed35

+ 1 - 1
api/volunteerDetailsApi/details.js

@@ -28,7 +28,7 @@ export function dictListlrData(params) {
 		params:{
 			pageNum: 1,
 			pageSize: 10,
-			dictType: lrr_service_category,
+			dictType: order_status,
 		}
 	})
 }

+ 1 - 1
pages/classify.vue

@@ -53,7 +53,7 @@
 	} = useDict('order_status', 'lrr_service_status');
 
 	provide('order_status', order_status); //订单/服务状态
-	provide('lrr_service_status', lrr_service_status); //订单/服务状态
+	// provide('lrr_service_status', lrr_service_status); //订单/服务状态
 
 
 	const userType = uni.getStorageSync('userType') //读取本地存储

+ 2 - 2
pages/common/orderList/listItem.vue

@@ -11,7 +11,7 @@
                         {{ data.name }}
                     </view>
                     <view v-if="data.score || ['0', '1'].includes(String(data.orderStatus))">
-                        <dict-tag :options="lrr_service_status" :value="String(data.orderStatus)" />
+                        <dict-tag :options="order_status" :value="String(data.orderStatus)" />
                     </view>
                     <text v-else class="color-blue ">
                         待评价
@@ -63,7 +63,7 @@ console.log('datadata',props.data);
 
 const inject_click = inject('onClick');
 
-const lrr_service_status = inject('lrr_service_status');
+const order_status = inject('order_status');
 
 const btn_style = ` width: 120rpx; height: 50rpx; font-size: 24rpx;border-radius: 25rpx;margin-left: 12rpx;`;
 

+ 18 - 46
pages_classify/pages/orderItem/orderdetails.vue

@@ -3,7 +3,7 @@
 		<view class="address-container">
 			<view class="address-header">
 				<!-- 左侧默认标签-->
-				<up-tag text="默认" type="error" style="width: 40rpx; height: 30rpx; margin-right: 10rpx;"></up-tag>
+				<up-tag text="默认" type="error"></up-tag>
 
 				<!-- 中间收货人信息 -->
 				<view class="contact-info">
@@ -62,7 +62,6 @@
 				<up-list-item v-for="(item, index) in listData.secondOrderList" :key="index">
 					<view class="Wrap-top">
 						<text>第一节课</text>
-
 					</view>
 					<view class="list-item">
 						<image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image">
@@ -73,19 +72,16 @@
 							</view>
 							<text>开始日期:{{item.workDate}}</text>
 							<text>开始时间: {{item.workStartTime}}</text>
-							
-							
-							{{dictSortMap[item.orderStatus]}}
 						</view>
-						<view class="status-tags">
-							{{dataList.dictLabel}}
+						<view class="right-corner-container">
+							<text> {{dictSortMap[item.orderStatus]}}</text>
+							<up-button type="error" text="评论" size="mini" @click="handlButClick"
+								:customStyle="hadlClickError"></up-button>
 						</view>
 					</view>
-					<view>
-						<up-button type="primary" text="评论" @click="handlButClick"></up-button>
-					</view>
 				</up-list-item>
 			</up-list>
+
 		</view>
 	</view>
 </template>
@@ -120,7 +116,7 @@
 		}
 		return []
 	})
-	
+
 	const dictSortMap = computed(() => {
 		let mapObj = {}
 		dataList.value.forEach((item => {
@@ -131,14 +127,12 @@
 
 	//获取用户订单列表状态
 	async function getData() {
-		console.log('进入');
 		try {
 			const res = await systemDictdaTalist().catch(err => {
 				console.error('接口请求失败:', err);
 				throw err; // 重新抛出以进入 catch 块
 			});
 			dataList.value = res.rows;
-			console.log(dataList.value, 'dataList.value');
 		} catch (e) {
 			console.error('获取数据异常:', e); // 确保这里打印错误
 		}
@@ -154,10 +148,14 @@
 	onLoad(async (options) => {
 		mainOrderId.value = options.mainOrderId;
 		const res = await orderInfomainOrderId(mainOrderId.value)
-		console.log(res, '>>>>>>>res>>>>>>>>132')
 		listData.value = res.data;
 	});
 
+	const hadlClickError = {
+		width: '150rpx',
+		height:'50rpx',
+		marginTop: '70rpx'
+	}
 	onMounted(() => {
 		getData()
 	})
@@ -251,10 +249,7 @@
 		font-weight: bold;
 	}
 
-
-
 	/* 上课时间 */
-
 	.Wrap-top {
 		display: flex;
 		justify-content: space-between;
@@ -267,6 +262,7 @@
 		padding: 24rpx;
 		align-items: flex-start;
 		gap: 24rpx;
+		position: relative;
 	}
 
 	.item-image {
@@ -289,37 +285,13 @@
 		line-height: 1.6;
 	}
 
-	.item-right {
+	.right-corner-container {
 		display: flex;
 		flex-direction: column;
 		align-items: flex-end;
-		gap: 16rpx;
-		min-width: 160rpx;
-	}
-
-	.rating {
-		font-size: 28rpx;
-		color: #f39c12;
-		font-weight: bold;
-	}
-
-	.tag {
-		transform: scale(0.9);
-		/* 缩小标签尺寸 */
-	}
-
-	.action-btn {
-		margin-top: 18rpx;
-		width: 100%;
-	}
-
-	.certificate {
-		display: flex;
-		flex-direction: column;
-
-	}
-
-	.certificate-img {
-		margin-bottom: 24rpx;
+		position: absolute;
+		right: 24rpx;
+		top: 24rpx;
+		gap: 10rpx;
 	}
 </style>

+ 167 - 54
pages_classify/pages/orderItem/userComment.vue

@@ -1,51 +1,59 @@
 <template>
-	<view>
-		<view>
-			服务评价:
-			<up-image :show-loading="true" :src="src" width="80px" height="80px" @click="click"></up-image>
+	<view class="container">
+		<!-- 服务评价标题(固定在最上方) -->
+		<view class="evaluation-title">服务评价:</view>
+
+		<!-- 图片和信息区域 -->
+		<view class="info-section">
+			<up-image :show-loading="true" :src="src" width="80px" height="80px" @click="click"
+				class="info-image"></up-image>
+			<view class="info-text">
+				<text class="project-name">服务类型:{{ projectName }}</text>
+				<text class="volunteer-name">姓名:{{ volunteerName }}</text>
+			</view>
 		</view>
-		<view>
-			<view>
-				<text>服务礼仪:</text>
-				<template>
-					<up-rate :count="count" v-model="IfonForm.protocolScore" count="5"></up-rate>
-				</template>
+
+		<!-- 评分区域 - 修改为星星和文字都在左边 -->
+		<view class="rating-section">
+			<view class="rating-item">
+				<text class="rating-label">服务礼仪:</text>
+				<up-rate :count="count" v-model="IfonForm.protocolScore" count="5" class="rating-stars"></up-rate>
 			</view>
-			<view>
-				<text>着装整洁:</text>
-				<template>
-					<up-rate :count="count" v-model="IfonForm.clothingScore" count="5"></up-rate>
-				</template>
+			<view class="rating-item">
+				<text class="rating-label">着装整洁:</text>
+				<up-rate :count="count" v-model="IfonForm.clothingScore" count="5" class="rating-stars"></up-rate>
 			</view>
-			<view>
-				<text>专业能力:</text>
-				<template>
-					<up-rate :count="count" v-model="IfonForm.abilityScore" count="5"></up-rate>
-				</template>
+			<view class="rating-item">
+				<text class="rating-label">专业能力:</text>
+				<up-rate :count="count" v-model="IfonForm.abilityScore" count="5" class="rating-stars"></up-rate>
 			</view>
-			<view>
-				<text>服务质量:</text>
-				<template>
-					<up-rate :count="count" v-model="IfonForm.qualityScore" count="5"></up-rate>
-				</template>
+			<view class="rating-item">
+				<text class="rating-label">服务质量:</text>
+				<up-rate :count="count" v-model="IfonForm.qualityScore" count="5" class="rating-stars"></up-rate>
 			</view>
 		</view>
 
-		<view class="service-info order-card">
-			<!-- 回顯 -->
+
+
+		<!-- 图片上传区域 -->
+		<view class="upload-section">
 			<view class="upload-box">
 				<view class="upload-img-item" v-for="(item, index) in fileList" :key="item.url">
-					<view class="delete-icon" @click="deletePic(index)"><up-icon name="close-circle-fill"
-							color="#f64a1f" size="18"></up-icon></view>
-					<img class="upload-img" :src="item.url" :alt="item.fileName" srcset="">
+					<view class="delete-icon" @click="deletePic(index)">
+						<up-icon name="close-circle-fill" color="#f64a1f" size="18"></up-icon>
+					</view>
+					<img class="upload-img" :src="item.url" :alt="item.fileName">
 				</view>
 				<img src="/static/img/upload.png" alt="" class="upload-img" @click="uploadClick('img')"
 					v-if="fileList.length < 10">
 			</view>
 		</view>
-
-		<up-textarea v-model="IfonForm.userReview" placeholder="请输入评论内容"></up-textarea>
-		<up-button type="error" text="发布" @click="handlButClick"></up-button>
+		<!-- 文本区域 -->
+		<up-textarea v-model="IfonForm.userReview" placeholder="请输入评论内容" class="comment-textarea"></up-textarea>
+		<!-- 发布按钮 -->
+		<view class="button-section">
+			<up-button type="error" text="发布" @click="handlButClick" class="submit-button"></up-button>
+		</view>
 	</view>
 </template>
 
@@ -67,8 +75,9 @@
 
 	const count = ref(4);
 	const fileList = ref([]);
-	const src = ref('https://cdn.uviewui.com/uview/album/1.jpg');
-
+	const src = ref('');
+	const projectName = ref('');
+	const volunteerName = ref('');
 
 
 	const IfonForm = ref({
@@ -76,7 +85,7 @@
 		clothingScore: 0, //服装整洁
 		abilityScore: 0, //专业能力
 		qualityScore: 0, //服务质量
-		userReview:'',
+		userReview: '',
 	})
 
 
@@ -98,13 +107,13 @@
 		// 提取所有图片的 URL
 		const imageUrls = fileList.value.map(item => item.url);
 		const volunteerInfoId = IfonForm.value.volunteerInfoId;
-		const secondOrderId = IfonForm.value.secondOrderId; 
+		const secondOrderId = IfonForm.value.secondOrderId;
 		try {
 			const params = {
 				...IfonForm.value,
 				images: imageUrls,
 				volunteerInfoId: volunteerInfoId,
-				secondOrderId: secondOrderId, 
+				secondOrderId: secondOrderId,
 			}
 			console.log(params, 'params>>>')
 			const res = await usersUserFinishOrder(params)
@@ -128,25 +137,129 @@
 
 	}
 
-onLoad(async (options) => {
-	const data = JSON.parse(decodeURIComponent(options.data));
-	console.log(data, '》》》》》》 获取传递的 listData'); // 获取传递的 listData
+	onLoad(async (options) => {
+		const data = JSON.parse(decodeURIComponent(options.data));
+		console.log(data, '》》》》》》 获取传递的 listData');
 
-	const secondOrderList = data.secondOrderList || [];
-	
-	// 获取第一个 secondOrderId
-	const secondOrderId = secondOrderList.length > 0 ? secondOrderList[0].secondOrderId : null;
+		// 设置图片
+		if (data.volunteerInfo?.volunteerPicture) {
+			src.value = data.volunteerInfo.volunteerPicture;
+		} else {
+			src.value = '/static/default-avatar.png';
+		}
 
-	// 如果 secondOrderId 存在,则设置到 IfonForm 中
-	if (secondOrderId) {
-		IfonForm.value.secondOrderId = secondOrderId;
-	}
+		// 设置项目名称和志愿者姓名
+		projectName.value = data.volunteerInfo?.projectName || '未知项目';
+		volunteerName.value = data.volunteerInfo?.name || '未知姓名';
 
-	// 获取 volunteerInfoId
-	const volunteerInfoId = data.volunteerInfo?.volunteerInfoId || data.volunteerInfoId;
-	IfonForm.value.volunteerInfoId = volunteerInfoId;
-});
+		const secondOrderList = data.secondOrderList || [];
+		// 获取第一个 secondOrderId
+		const secondOrderId = secondOrderList.length > 0 ? secondOrderList[0].secondOrderId : null;
+		// 如果 secondOrderId 存在,则设置到 IfonForm 中
+		if (secondOrderId) {
+			IfonForm.value.secondOrderId = secondOrderId;
+		}
+		// 获取 volunteerInfoId
+		const volunteerInfoId = data.volunteerInfo?.volunteerInfoId || data.volunteerInfoId;
+		IfonForm.value.volunteerInfoId = volunteerInfoId;
+	});
 </script>
 
-<style>
+<style scoped>
+	.container {
+		display: flex;
+		flex-direction: column;
+		padding: 20rpx;
+	}
+
+	.evaluation-title {
+		font-size: 32rpx;
+		font-weight: bold;
+		margin-bottom: 30rpx;
+	}
+
+	.info-section {
+		display: flex;
+		align-items: center;
+		margin-bottom: 30rpx;
+	}
+
+	.info-image {
+		margin-right: 20rpx;
+	}
+
+	.info-text {
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+	}
+
+	.project-name,
+	.volunteer-name {
+		font-size: 28rpx;
+		margin-bottom: 10rpx;
+	}
+
+	.rating-section {
+		margin-bottom: 30rpx;
+	}
+
+	.rating-item {
+		display: flex;
+		align-items: center;
+		margin-bottom: 20rpx;
+	}
+
+	.rating-label {
+		font-size: 28rpx;
+		margin-right: 15rpx;
+		min-width: 120rpx;
+		/* 保持标签宽度一致 */
+	}
+
+	.rating-stars {
+		margin-left: 0;
+		/* 移除左边距,使星星紧贴文字 */
+	}
+
+	.comment-textarea {
+		margin-bottom: 20rpx;
+	}
+
+	.upload-section {
+		margin-bottom: 30rpx;
+	}
+
+	.upload-box {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	.upload-img-item {
+		position: relative;
+		margin-right: 20rpx;
+		margin-bottom: 20rpx;
+	}
+
+	.delete-icon {
+		position: absolute;
+		top: -10rpx;
+		right: -10rpx;
+		z-index: 1;
+	}
+
+	.upload-img {
+		width: 150rpx;
+		height: 150rpx;
+		border-radius: 8rpx;
+	}
+
+	.button-section {
+		display: flex;
+		justify-content: flex-end;
+	}
+
+	.submit-button {
+		width: 200rpx;
+	}
 </style>

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

@@ -10,11 +10,10 @@
 						<!-- 中间信息(姓名/类别等) -->
 						<view class="card-info">
 							<view class="info-item">姓名:{{listData.name}}</view>
-							<view class="info-item">服务项目:{{listData.projectName}}</view>
+							<view class="info-item">服务项目:{{listData.businessTierName}}</view>
 							<view v-if="serviceSubjectName != null" class="info-item">类别:{{ listData.projectTypeName }}
 							</view>
 							<view class="Telephone">服务时长:{{listData.businessDuration}}</view>
-							<view class="Telephone">科目:{{listData.serviceSubjectName}}</view>
 							<view class="Telephone">电话:{{listData.phonenumber}}</view>
 						</view>
 
@@ -151,7 +150,6 @@
 							:label="item.name" :name="item.name"></up-radio>
 					</up-radio-group>
 				</view>
-
 				<up-line></up-line>
 
 				<!-- 微信支付选项 -->