贾宇博 3 nedēļas atpakaļ
vecāks
revīzija
3317dd42a7

+ 2 - 1
api/userList.js

@@ -33,9 +33,10 @@ export function systemDictdaTalist() {
 
 // 用户评价小订单
 
-export function usersUserFinishOrder() {
+export function usersUserFinishOrder(data) {
 	return request({
 		url: `/core/users/orders/userFinishOrder`,
 		method: 'post',
+		data:data
 	})
 }

+ 1 - 3
components/Client/new_file.vue

@@ -214,9 +214,7 @@
 
 	
 	// 宫格点击事件
-	const handleGridClick = async (service) => {
-
-		
+	const handleGridClick = async (service) => {		
 		// 用户
 		if (userType == 1) {
 

+ 2 - 2
pages.json

@@ -53,7 +53,7 @@
 			"style": {
 				"navigationBarTitleText": "分类"
 			}
-		},
+		}
 	],
 	"subPackages": [
 		{
@@ -288,7 +288,7 @@
 					"style": {
 						"navigationBarTitleText": "评论"
 					}
-				},
+				}
 			]
 		}
 	],

+ 1 - 2
pages/login.vue

@@ -4,14 +4,13 @@
 			<image :src="imagePath" mode="aspectFit" style="width: 100rpx;height: 100rpx;"></image>
 			<text class="title">金邻助家</text>
 		</view>
-
 		<up-popup :show="show" mode="bottom" @close="close" @open="open">
 			<view class="popup-content">
 				<!-- 上方头像 -->
 				<up-avatar :src="src" class="avatar"></up-avatar>
 
 				<!-- 下方按钮 -->
-				<up-button type="success" shape="circle" class="button" @click="handleLogin">获取微信授权登录</up-button>
+				<up-button type="error" shape="circle" class="button" @click="handleLogin">获取微信授权登录</up-button>
 			</view>
 			<view class="xieyi text-center">
 				<text class="text-grey1">登录即代表同意</text>

+ 37 - 25
pages_classify/pages/orderItem/orderdetails.vue

@@ -67,9 +67,6 @@
 					<view class="list-item">
 						<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 }}
@@ -78,9 +75,12 @@
 							<text>开始时间: {{item.workStartTime}}</text>
 						</view>
 						<view class="status-tags">
-							{{dictSortMap[item.orderStatus]}}
+							{{dataList.dictLabel}}
 						</view>
 					</view>
+					<view>
+						<up-button type="primary" text="评论" @click="handlButClick"></up-button>
+					</view>
 				</up-list-item>
 			</up-list>
 		</view>
@@ -94,27 +94,19 @@
 	} from '@dcloudio/uni-app'
 	import {
 		ref,
-		computed
+		computed,
+		onMounted
 	} from "vue";
 	import {
 		orderInfomainOrderId
 	} from "@/api/userList.js";
+	import {
+		systemDictdaTalist
+	} 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 dataList = ref([])
 	const orderStatus = ref(0)
 	const score = ref(null)
 	const mainOrderId = ref(''); //志愿者ID
@@ -126,13 +118,29 @@
 		return []
 	})
 
-	const dictSortMap = computed(() => {
-		let mapObj = {}
-		props.dictSort.forEach((item => {
-			mapObj[item.dictValue] = item.dictLabel
-		}))
-		return mapObj
-	})
+	//获取用户订单列表状态
+	async function getData() {
+		console.log('进入');
+		try {
+			const res = await systemDictdaTalist().catch(err => {
+				console.error('接口请求失败:', err);
+				throw err; // 重新抛出以进入 catch 块
+			});
+			console.log(res, '用户状态获取成功');
+			dataList.value = res.rows;
+			console.log(dataList.value, 'dataList.value');
+		} catch (e) {
+			console.error('获取数据异常:', e); // 确保这里打印错误
+		}
+	}
+	
+	const handlButClick = (item) =>{
+		const listData = encodeURIComponent(JSON.stringify(item.listData));
+		console.log(listData,'>>>>>>>>>>listData')
+		uni.navigateTo({
+			url: `/pages_classify/pages/orderItem/userComment?volunteerInfo=${listData}`
+		})
+	}
 
 	// 获取传递的参数
 	onLoad(async (options) => {
@@ -140,6 +148,10 @@
 		const res = await orderInfomainOrderId(mainOrderId.value)
 		listData.value = res.data;
 	});
+
+	onMounted(() => {
+		getData()
+	})
 </script>
 
 <style scoped>

+ 73 - 45
pages_classify/pages/orderItem/userComment.vue

@@ -6,31 +6,47 @@
 			<view>
 				<text>服务礼仪:</text>
 				<template>
-					<up-rate :count="count" v-model="value"></up-rate>
+					<up-rate :count="count" v-model="IfonForm.protocolScore"></up-rate>
 				</template>
 			</view>
 			<view>
 				<text>着装整洁:</text>
 				<template>
-					<up-rate :count="count" v-model="value"></up-rate>
+					<up-rate :count="count" v-model="IfonForm.clothingScore"></up-rate>
 				</template>
 			</view>
 			<view>
 				<text>专业能力:</text>
 				<template>
-					<up-rate :count="count" v-model="value"></up-rate>
+					<up-rate :count="count" v-model="IfonForm.abilityScore"></up-rate>
 				</template>
 			</view>
 			<view>
 				<text>服务质量:</text>
 				<template>
-					<up-rate :count="count" v-model="value"></up-rate>
+					<up-rate :count="count" v-model="IfonForm.qualityScore"></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>
+		<!-- <up-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
+			:maxCount="10"></up-upload> -->
+		<view class="service-info order-card">
+			<!-- <view class="font-title">图片上传</view> -->
+
+			<!-- 回顯 -->
+			<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>
+				<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="primary" text="发布" @click="handlButClick"></up-button>
 	</view>
 </template>
 <!-- /** 评分 */
@@ -60,56 +76,68 @@ private Integer qualityScore; -->
 	import {
 		usersUserFinishOrder
 	} from "@/api/userList.js";
-	const value1 = ref(''); //文本域
+	import {
+		onLoad,
+	} from '@dcloudio/uni-app';
+	import {
+		wxUploadFile
+	} from '@/utils/wxRequest.js'
+
+
 	const count = ref(4);
-	const value = ref(0);
-	const fileList1 = ref([]);
+	const fileList = ref([]);
 	const src = ref('https://cdn.uviewui.com/uview/album/1.jpg');
-	
-	
+
+
+
 	const IfonForm = ref({
-		protocolScore:'',//服务礼仪
-		clothingScore:'',//服装整洁
-		abilityScore:'',//专业能力
-		qualityScore:'',//服务质量
+		protocolScore: 0, //服务礼仪
+		clothingScore: 0, //服装整洁
+		abilityScore: 0, //专业能力
+		qualityScore: 0, //服务质量
+		userReview: '',
+		serviceOnePrice: 0,
 	})
-	
-	const getList = async() =>{
-		const res = await usersUserFinishOrder()
-		console.log(res,'usersUserFinishOrder>>>>>')
-	}
+
+
 
 	// 删除图片
 	const deletePic = (event) => {
-		fileList1.value.splice(event.index, 1);
+		fileList.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: '上传中',
+
+
+	const uploadClick = async (type) => {
+		const res = await wxUploadFile(type);
+		fileList.value = [...fileList.value, ...res];
+		console.log('xxxxres', res, fileList.value);
+	}
+
+	const handlButClick = async () => {
+		// 提取所有图片的 URL
+		const imageUrls = fileList.value.map(item => item.url);
+
+		try {
+			const params = {
+				...IfonForm.value,
+				images: imageUrls,
+			}
+			console.log(params, 'params>>>')
+			const res = await usersUserFinishOrder(params)
+			console.log(res, 'usersUserFinishOrder>>>>>')
+			uni.showToast({
+				title: '评价提交成功',
+				icon: 'success'
 			});
-		});
-		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,
+		} catch (e) {
+			uni.showToast({
+				title: '提交失败,请重试',
+				icon: 'error'
 			});
-			fileListLen++;
 		}
-	};
-	
-	onMounted(getList)
+
+	}
 </script>
 
 <style>