瀏覽代碼

用户选项区分

贾宇博 3 周之前
父節點
當前提交
67ff2bdd41

+ 9 - 0
api/userList.js

@@ -29,4 +29,13 @@ export function systemDictdaTalist() {
 			dictType: 'order_status'
 		}
 	})
+}
+
+// 用户评价小订单
+
+export function usersUserFinishOrder() {
+	return request({
+		url: `/core/users/orders/userFinishOrder`,
+		method: 'post',
+	})
 }

+ 1 - 1
components/Client/new_file.vue

@@ -229,7 +229,7 @@
 			// 只有第一条和第二条可以跳转
 			if (service.key === 1 || service.key === 2) {
 				uni.navigateTo({
-					url: `/pages_home/pages/client/details?dataList=${encodeURIComponent(JSON.stringify(res.data))}`
+					url: `/pages_home/pages/client/details?dataList=${encodeURIComponent(JSON.stringify(res.data))}&serviceCategory=${service.key}`
 				});
 			} else {
 				// 其他条目提示“敬请期待”

+ 8 - 2
pages.json

@@ -53,7 +53,7 @@
 			"style": {
 				"navigationBarTitleText": "分类"
 			}
-		}
+		},
 	],
 	"subPackages": [
 		{
@@ -282,7 +282,13 @@
 				},
 				{
 					"path": "components/Slide/index"
-				}
+				},
+				{
+					"path": "pages/orderItem/userComment",
+					"style": {
+						"navigationBarTitleText": "评论"
+					}
+				},
 			]
 		}
 	],

+ 9 - 10
pages/common/classify/orderlist.vue

@@ -34,19 +34,11 @@
 						<view class="item-right">
 							<view class="rating">评分:9.5</view>
 							<view class="status-tags">
-								<!-- <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"
-									class="action-btn"></up-button>
-								<up-button type="error" text="查看" size="mini" shape="circle" class="action-btn"
-									@click="handlClick(item)"></up-button>
+							    <up-button type="primary" text="沟通" size="mini" shape="circle" class="action-btn"></up-button>
+							    <up-button type="error" text="查看" size="mini" shape="circle" class="action-btn" @click="handlClick(item)"></up-button>
 							</view>
 						</view>
 					</view>
@@ -127,6 +119,13 @@
 			url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
 		});
 	}
+	
+	// 评论
+	const handleComment  = () =>{
+		uni.navigateTo({
+			url: `/pages_classify/pages/orderItem/userComment`
+		});
+	}
 
 	function onChange(tabItem) {
 		emits('fetchData', tabItem.value)

+ 74 - 47
pages_classify/pages/orderItem/orderdetails.vue

@@ -1,27 +1,27 @@
 <template>
 	<view>
-			<view class="address-container">
-			  <view class="address-header">
-			    <!-- 左侧默认标签-->
-			    <up-tag text="默认" type="error" style="width: 40rpx; height: 30rpx; margin-right: 10rpx;"></up-tag>
-			    
-			    <!-- 中间收货人信息 -->
-			    <view class="contact-info">
-			      {{listData.address.name}}
-			      {{listData.address.telephone}}
-			    </view>
-			    
-			    <!-- 右侧图标 -->
-			    <up-icon name="arrow-right" class="arrow-icon"></up-icon>
-			  </view>
-			  
-			  <!-- 下方地址信息 -->
-			  <view class="address-detail">
-			    {{listData.address.provinceName}}
-			    {{listData.address.cityName}}
+		<view class="address-container">
+			<view class="address-header">
+				<!-- 左侧默认标签-->
+				<up-tag text="默认" type="error" style="width: 40rpx; height: 30rpx; margin-right: 10rpx;"></up-tag>
+
+				<!-- 中间收货人信息 -->
+				<view class="contact-info">
+					{{listData.address.name}}
+					{{listData.address.telephone}}
+				</view>
+
+				<!-- 右侧图标 -->
+				<up-icon name="arrow-right" class="arrow-icon"></up-icon>
+			</view>
+
+			<!-- 下方地址信息 -->
+			<view class="address-detail">
+				{{listData.address.provinceName}}
+				{{listData.address.cityName}}
 				{{listData.address.districtName}}
-			  </view>
 			</view>
+		</view>
 
 		<view>
 			<up-card title="志愿者介绍" :head-style="{ height: '80rpx', padding: '20rpx',}">
@@ -50,7 +50,8 @@
 			<up-card title="证书" :head-style="{ height: '80rpx', padding: '20rpx',}">
 				<template #body>
 					<view class="certificate">
-						<image  v-for="item in certificationPictures" :key="item" :src="item" mode="" style="width: 100%;" class="certificate-img"></image>
+						<image v-for="item in certificationPictures" :key="item" :src="item" mode=""
+							style="width: 100%;" class="certificate-img"></image>
 					</view>
 				</template>
 			</up-card>
@@ -64,20 +65,20 @@
 
 					</view>
 					<view class="list-item">
-						<image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image"></image>
+						<image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image">
+						</image>
 						<!-- 状态:orderStatus: 0未开始 ,1进行中,2已完成-->
 						<!-- score如果=null,显示待评价, -->
 
 						<view class="item-info">
-							<view class="info-line">类别:{{ listData.volunteerInfo.projectName }}-{{ listData.volunteerInfo.serviceSubjectName }}</view>
+							<view class="info-line">
+								类别:{{ listData.volunteerInfo.projectName }}-{{ listData.volunteerInfo.serviceSubjectName }}
+							</view>
 							<text>开始日期:{{item.workDate}}</text>
 							<text>开始时间: {{item.workStartTime}}</text>
 						</view>
-						<view class="item-right">
-							<view class="rating" v-if="score === null">待评价</view>
-							<up-tag v-if="item.orderStatus === '0'">未开始</up-tag>
-							<up-tag v-else-if="item.orderStatus === '1'">进行中</up-tag>
-							<up-tag v-else-if="item.orderStatus === '2'">已完成</up-tag>
+						<view class="status-tags">
+							{{dictSortMap[item.orderStatus]}}
 						</view>
 					</view>
 				</up-list-item>
@@ -99,18 +100,40 @@
 		orderInfomainOrderId
 	} from "@/api/userList.js";
 
+
+
+	const props = defineProps({
+		dataList: {
+			typeof: Array,
+			default: () => [],
+		},
+		dictSort: {
+			type: Array,
+			default: () => [], // 默认值
+		},
+		fetchData: Function, // 刷新数据的方法
+	})
+	console.log(props,"props?????????props")
 	const listData = ref(); //志愿者详情数据
 	const orderStatus = ref(0)
 	const score = ref(null)
 	const mainOrderId = ref(''); //志愿者ID
 
-	const certificationPictures =computed(()=>{
-		if(listData.value.volunteerInfo.certificationPicture){
+	const certificationPictures = computed(() => {
+		if (listData.value.volunteerInfo.certificationPicture) {
 			return listData.value.volunteerInfo.certificationPicture.split(',')
 		}
 		return []
 	})
 
+	const dictSortMap = computed(() => {
+		let mapObj = {}
+		props.dictSort.forEach((item => {
+			mapObj[item.dictValue] = item.dictLabel
+		}))
+		return mapObj
+	})
+
 	// 获取传递的参数
 	onLoad(async (options) => {
 		mainOrderId.value = options.mainOrderId;
@@ -121,32 +144,34 @@
 
 <style scoped>
 	.address-container {
-	  padding: 20rpx;
-	  border: 1rpx solid #eee;
-	  border-radius: 10rpx;
+		padding: 20rpx;
+		border: 1rpx solid #eee;
+		border-radius: 10rpx;
 	}
-	
+
 	.address-header {
-	  display: flex;
-	  align-items: center;
-	  margin-bottom: 10rpx;
+		display: flex;
+		align-items: center;
+		margin-bottom: 10rpx;
 	}
-	
+
 	.contact-info {
-	  flex: 1;  /* 占据剩余空间 */
-	  font-size: 28rpx;
-	  margin-left: 25rpx;
+		flex: 1;
+		/* 占据剩余空间 */
+		font-size: 28rpx;
+		margin-left: 25rpx;
 	}
-	
+
 	.arrow-icon {
-	  margin-left: auto;  /* 将图标推到最右侧 */
+		margin-left: auto;
+		/* 将图标推到最右侧 */
 	}
-	
+
 	.address-detail {
-	  font-size: 26rpx;
-	  color: #666;
+		font-size: 26rpx;
+		color: #666;
 	}
-	
+
 	.card-container {
 		display: flex;
 		position: relative;
@@ -266,11 +291,13 @@
 		margin-top: 18rpx;
 		width: 100%;
 	}
+
 	.certificate {
 		display: flex;
 		flex-direction: column;
 
 	}
+
 	.certificate-img {
 		margin-bottom: 24rpx;
 	}

+ 116 - 0
pages_classify/pages/orderItem/userComment.vue

@@ -0,0 +1,116 @@
+<template>
+	<view>
+		服务评价
+		<up-image :show-loading="true" :src="src" width="80px" height="80px" @click="click"></up-image>
+		<view>
+			<view>
+				<text>服务礼仪:</text>
+				<template>
+					<up-rate :count="count" v-model="value"></up-rate>
+				</template>
+			</view>
+			<view>
+				<text>着装整洁:</text>
+				<template>
+					<up-rate :count="count" v-model="value"></up-rate>
+				</template>
+			</view>
+			<view>
+				<text>专业能力:</text>
+				<template>
+					<up-rate :count="count" v-model="value"></up-rate>
+				</template>
+			</view>
+			<view>
+				<text>服务质量:</text>
+				<template>
+					<up-rate :count="count" v-model="value"></up-rate>
+				</template>
+			</view>
+		</view>
+		<up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
+			:maxCount="10"></up-upload>
+			<up-textarea v-model="value1" placeholder="请输入内容" ></up-textarea>
+	</view>
+</template>
+<!-- /** 评分 */
+@Excel(name = "服务礼仪")
+@ApiModelProperty("服务礼仪")
+private Integer protocolScore;
+
+/** 评分 */
+@Excel(name = "服装整洁")
+@ApiModelProperty("服装整洁")
+private Integer clothingScore;
+
+/** 评分 */
+@Excel(name = "专业能力")
+@ApiModelProperty("专业能力")
+private Integer abilityScore;
+
+/** 评分 */
+@Excel(name = "服务质量")
+@ApiModelProperty("服务质量")
+private Integer qualityScore; -->
+<script setup>
+	import {
+		onMounted,
+		ref
+	} from 'vue';
+	import {
+		usersUserFinishOrder
+	} from "@/api/userList.js";
+	const value1 = ref(''); //文本域
+	const count = ref(4);
+	const value = ref(0);
+	const fileList1 = ref([]);
+	const src = ref('https://cdn.uviewui.com/uview/album/1.jpg');
+	
+	
+	const IfonForm = ref({
+		protocolScore:'',//服务礼仪
+		clothingScore:'',//服装整洁
+		abilityScore:'',//专业能力
+		qualityScore:'',//服务质量
+	})
+	
+	const getList = async() =>{
+		const res = await usersUserFinishOrder()
+		console.log(res,'usersUserFinishOrder>>>>>')
+	}
+
+	// 删除图片
+	const deletePic = (event) => {
+		fileList1.value.splice(event.index, 1);
+	};
+
+	// 新增图片
+	const afterRead = async (event) => {
+		// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+		let lists = [].concat(event.file);
+		let fileListLen = fileList1.value.length;
+		lists.map((item) => {
+			fileList1.value.push({
+				...item,
+				status: 'uploading',
+				message: '上传中',
+			});
+		});
+		for (let i = 0; i < lists.length; i++) {
+			const result = await uploadFilePromise(lists[i].url);
+			let item = fileList1.value[fileListLen];
+			fileList1.value.splice(fileListLen, 1, {
+				...item,
+				status: 'success',
+				message: '',
+				url: result,
+			});
+			fileListLen++;
+		}
+	};
+	
+	onMounted(getList)
+</script>
+
+<style>
+</style>

+ 2 - 0
pages_home/pages/client/details.vue

@@ -167,6 +167,8 @@
 
 	onLoad((options) => {
 		const dataList = JSON.parse(decodeURIComponent(options.dataList));
+		
+		serviceCategory.value = options.serviceCategory
 		list1.value = dataList
 		list2.value = dataList[0].children
 	})