Browse Source

接口对接

LiuShu_0203 16 hours ago
parent
commit
e8966999de
4 changed files with 174 additions and 56 deletions
  1. 137 48
      my/order/comments.vue
  2. 21 5
      my/setting/LostandFound.vue
  3. 11 1
      my/setting/LostandFoundtext.vue
  4. 5 2
      pages/order/order.vue

+ 137 - 48
my/order/comments.vue

@@ -12,19 +12,19 @@
 		<view style="background: #FFFFFF;" class="feedback-body">
 			<view class="flex align-center padding-tb-sm">
 				<view>
-					<image v-if="globalImages" :src="globalImages + 'images/order/tiem.png'" style="width: 100rpx;height: 100rpx;" mode=""></image>
+					<image :src="UsertList.avatar" style="width: 100rpx;height: 100rpx;border-radius: 50%;" mode=""></image>
 				</view>
 				<view style="margin-left: 30rpx; line-height: 40rpx;">
-					<view style="color: #999;">司机师傅</view>
-					<view>什么时间段的订单</view>
+					<view style="color: #999;">{{ UsertList.nickName }}</view>
+					<view>{{ data.endTime }}</view>
 				</view>
 			</view>
 			<view class="flex align-center add_name" style="margin: 30rpx 0rpx 4rpx;">
-				<view class="green"></view>出发地点:12312
+				<view class="green"></view>出发地点:{{ data.shipProvince }}{{ data.shipCity }}{{ data.shipDistrict }}{{ data.deliveryAddress }}
 			</view>
 			<image v-if="globalImages" :src="globalImages + 'images/static/upload/up.png'" class="order_up"></image>
 			<view class="flex align-center add_name">
-				<view class="orgin"></view>到达地点:111111
+				<view class="orgin"></view>到达地点:{{ data.deliveryProvince }}{{ data.deliveryCity }}{{ data.deliveryDistrict }}{{ data.shipAddress }}
 			</view>
 		</view>
 		<view style="background: #FFFFFF;" class="feedback-body">
@@ -32,7 +32,15 @@
 				为本次服务评分
 			</view>
 			<view style="display: flex; justify-content: center; margin-bottom: 30rpx;">
-				<u-rate :allow-half="false" :disabled="true" size="58" active-color="#fe6b01" :is-fill="false" :value="3.5" />
+				<u-rate
+				  :allow-half="false"
+				  :disabled="false"
+				  size="58"
+				  active-color="#fe6b01"
+				  :is-fill="false"
+				  v-model="ratevalue"
+				  @change="handleRateChange"
+				/>
 			</view>
 			<view style="font-size: 24rpx;color: #ccc;text-align: center;">点击星星评分</view>
 		</view>
@@ -41,11 +49,10 @@
 				快速评价
 			</view>
 			<view class="flex-container">
-				<view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_1.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>车内整洁</view>
-				<view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_2.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>礼貌热情</view>
-				<view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_3.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>准时到达</view>
-				<view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_4.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>乐于助人</view>
-				<view class="item"><image v-if="globalImages" :src="globalImages + '/images/evaluate/icon_5.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>驾驶平稳</view>
+				<view class="item" v-for="(item, index) in CreditList" :key="index" :class="{ selected: item.selected }" @click="toggleSelect(index)">
+					<image v-if="globalImages" :src="globalImages + item.icon" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>
+					{{ item.description }}
+				</view>
 		  </view>
 		</view>
 		<view style="background: #FFFFFF;" class="feedback-body">
@@ -106,19 +113,31 @@
 					content: '',
 					contact: ''
 				},
-				riderUserId: '',
+				// riderUserId: '',
+				// indentNumber: '',
 				satisfactionFlag: '',
-				globalImages: ''
+				globalImages: '',
+				CreditList: [],
+				// userId: '',
+				// ordersNo: '',
+				// ordersId: '',
+				ratevalue: 0,
+				data: {},
+				UsertList: {}
 			};
 		},
-		onLoad(e) {
+		onLoad(option) {
 			waitForGlobalImages().then((path) => {
 			    console.log('✅ 全局图片路径:', path)
 			    this.globalImages = path
 			  })
-			console.log(e)
-			this.riderUserId = e.riderUserId
-			this.indentNumber = e.indentNumber
+			// this.riderUserId = e.riderUserId
+			// this.indentNumber = e.indentNumber
+			// this.userId = e.userId
+			// this.ordersNo = e.ordersNo
+			// this.ordersId = e.ordersId
+			this.data = JSON.parse(decodeURIComponent(option.data))
+			
 			// console.log(this.riderUserId,'........',this.indentNumber)
 			// let deviceInfo = {
 			// 	appid: plus.runtime.appid,
@@ -131,6 +150,18 @@
 			// 	net: '' + plus.networkinfo.getCurrentType()
 			// };
 			// this.sendDate = Object.assign(deviceInfo, this.sendDate);
+			
+			this.$Request.getT('/app/credit/getCreditList?isDriver=0').then(res => {
+				if (res.code === 0) {
+					this.CreditList = res.data
+				}
+			});
+			
+			this.$Request.getT('/user/getUserById?id=' + this.data.driverUserId).then(res => {
+				if (res.code === 0) {
+					this.UsertList = res.data
+				}
+			});
 		},
 		methods: {
 			close(e) {
@@ -179,6 +210,22 @@
 			// 		urls: this.imageList
 			// 	});
 			// },
+			handleRateChange(value) {
+				console.log('用户评分:', value);
+				this.ratevalue = value
+				// 你可以这里处理逻辑,比如赋值给 sendData.content、上传等
+			},
+			toggleSelect(index) {
+			  const item = this.CreditList[index];
+			  item.selected = !item.selected;
+		
+			  // 更新 textarea 内容
+			  const selectedDescriptions = this.CreditList
+				.filter(i => i.selected)
+				.map(i => i.description);
+		
+			  this.sendDate.content = selectedDescriptions.join(',');
+			},
 			send() {
 				//发送反馈
 				// console.log(JSON.stringify(this.sendDate), '11111');
@@ -190,6 +237,43 @@
 					});
 					return;
 				}
+				
+				const selectedItems = this.CreditList.filter(i => i.selected);
+				const totalScore = selectedItems.reduce((sum, i) => sum + i.score, 0);
+				const types = totalScore >= 0 ? 1 : 0;
+				const data = {
+					userId: this.data.userId,
+					type: types,
+					score: totalScore,
+					remark: this.sendDate.content,
+					orderNo: this.data.ordersNo,
+					isDriver: 1,
+					ordersId: this.data.ordersId,
+					star: this.ratevalue
+				}
+				
+				this.$Request.postT("/user/updateUserCredit", data).then(res => {
+					if (res.code == 0) {
+						uni.showModal({
+							title: '提示',
+							content: '评价成功',
+							showCancel: false
+						});
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: res.msg,
+							showCancel: false
+						});
+					}
+				}).catch(err => {
+					uni.showModal({
+						title: '提示',
+						content: '网络错误,请重试',
+						showCancel: false
+					});
+				});
+				
 				// if (this.value = 0) {
 				// 	uni.showToast({
 				// 		icon: 'none',
@@ -199,36 +283,36 @@
 				// }
 				// uni.report( this.sendDate,'意见反馈');
 				// console.log("uni.report( '意见反馈',this.sendDate)", uni.report('意见反馈', this.sendDate))
-				uni.report('意见反馈', this.sendDate);
-				console.log(this.indentNumber, this.satisfactionFlag)
-				this.$queue.showLoading('加载中...');
-				this.$Request
-					.postJson('/app/indent/userEvaluate', {
-						// state: this.value,
-						// title: this.sendDate.contact,
-						// evaluateMessage: JSON.stringify(this.sendDate.content),
-						evaluateMessage: this.sendDate.content,
-						// riderUserId: this.riderUserId,
-						indentNumber: this.indentNumber,
-						satisfactionFlag: this.value
-					})
-					.then(res => {
-						if (res.code == 0) {
-							uni.showToast({
-								title: '评论成功'
-							});
-							setTimeout(function() {
-								uni.navigateBack();
-							}, 1000);
-						} else {
-							uni.hideLoading();
-							uni.showModal({
-								showCancel: false,
-								title: '评论失败',
-								content: res.msg
-							});
-						}
-					});
+				// uni.report('意见反馈', this.sendDate);
+				// console.log(this.indentNumber, this.satisfactionFlag)
+				// this.$queue.showLoading('加载中...');
+				// this.$Request
+				// 	.postJson('/app/indent/userEvaluate', {
+				// 		// state: this.value,
+				// 		// title: this.sendDate.contact,
+				// 		// evaluateMessage: JSON.stringify(this.sendDate.content),
+				// 		evaluateMessage: this.sendDate.content,
+				// 		// riderUserId: this.riderUserId,
+				// 		indentNumber: this.indentNumber,
+				// 		satisfactionFlag: this.value
+				// 	})
+				// 	.then(res => {
+				// 		if (res.code == 0) {
+				// 			uni.showToast({
+				// 				title: '评论成功'
+				// 			});
+				// 			setTimeout(function() {
+				// 				uni.navigateBack();
+				// 			}, 1000);
+				// 		} else {
+				// 			uni.hideLoading();
+				// 			uni.showModal({
+				// 				showCancel: false,
+				// 				title: '评论失败',
+				// 				content: res.msg
+				// 			});
+				// 		}
+				// 	});
 			}
 		}
 	};
@@ -488,7 +572,7 @@
 	}
 	
 	.item {
-	  flex-basis: calc(33.33% - 30rpx);
+	  /* flex-basis: calc(33.33% - 30rpx); */
 	  text-align: center;
 	  border-radius: 8rpx;
 	  border: 1px solid #999; /* 为了便于观察布局,添加边框 */
@@ -496,4 +580,9 @@
 	  margin: 15rpx 10rpx;
 	  line-height: 50rpx;
 	}
+	
+	.selected {
+	  background-color: #fcf6ec;
+	  border: 1rpx solid #fe6b01;
+	}
 </style>

+ 21 - 5
my/setting/LostandFound.vue

@@ -1,12 +1,17 @@
 <template>
 	<view class="lost-container">
 		<!-- 自定义导航栏 -->
-		<view class="custom-navbar">
+		<view class="custom-navbar" :style="{
+			backgroundImage: `url(${globalImages}imgs/static/image/up.png)`,
+			backgroundRepeat: 'repeat',
+			backgroundSize: 'cover'
+		  }">
 			<view class="nav-left">
 				<view class="back-btn" @click="goBack">‹</view>
 				<view class="title-box">
 					<view class="main-title">丢了东西</view>
 					<view class="sub-title">快速发布失物信息</view>
+					<view style="border: 3rpx solid #fe6b01; margin-top: 30rpx;width: 160rpx;"></view>
 				</view>
 			</view>
 			<view class="nav-right">
@@ -39,10 +44,13 @@
 </template>
 
 <script>
+	import {
+		waitForGlobalImages
+	} from '@/utils/globalImageLoader'
 	export default {
 		data() {
 			return {
-				globalImages: getApp().globalData.globalImages || '', // 图片前缀路径
+				globalImages: '', // 图片前缀路径
 				lostItems: []
 			};
 		},
@@ -52,6 +60,10 @@
 					this.lostItems = res.data;
 				}
 			});
+			waitForGlobalImages().then((path) => {
+				console.log('✅ 全局图片路径:', path)
+				this.globalImages = path
+			})
 		},
 		methods: {
 			goNav(url) {
@@ -82,13 +94,14 @@
 	}
 
 	.custom-navbar {
+		height: 420rpx;
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
 		padding: var(--status-bar-height, 30rpx) 30rpx 30rpx;
-		background: linear-gradient(to right, #ff7e5f, #feb47b);
+		/* background: linear-gradient(to right, #ff7e5f, #feb47b); */
 		/* 渐变背景 */
-		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
+		/* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03); */
 		/* color: #fff; */
 		margin-bottom: 30rpx;
 	}
@@ -96,6 +109,8 @@
 	.nav-left {
 		/* display: flex; */
 		align-items: center;
+		position: absolute;
+		top: 70rpx;
 	}
 
 	.back-btn {
@@ -108,6 +123,7 @@
 	.title-box {
 		display: flex;
 		flex-direction: column;
+		margin-top: 30rpx;
 	}
 
 	.main-title {
@@ -118,7 +134,7 @@
 	.sub-title {
 		font-size: 34rpx;
 		/* color: #f0f0f0; */
-		margin-top: 6rpx;
+		margin-top: 18rpx;
 	}
 
 	.nav-icon {

+ 11 - 1
my/setting/LostandFoundtext.vue

@@ -35,7 +35,7 @@
 				<image v-if="globalImages" :src="globalImages + 'images/my/chat2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
 				在线客服
 			</view>
-			<view class="pay_btns2">
+			<view class="pay_btns2" @click="bindPhone(12312312312)">
 				<image v-if="globalImages" :src="globalImages + 'images/my/phone2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
 				热线电话
 			</view>
@@ -83,6 +83,16 @@
 		methods: {
 			submit() {
 				this.show = true
+			},
+			bindPhone(list) {
+				if (list) {
+					console.log(list, 'listlistlist');
+					uni.makePhoneCall({
+						phoneNumber: '114' //仅为示例
+					});
+				} else {
+					this.$queue.showToast('手机号获取失败!');
+				}
 			}
 		}
 	}

+ 5 - 2
pages/order/order.vue

@@ -365,9 +365,12 @@
 					})
 				}
 				// #endif
+				// uni.navigateTo({
+				// 	url: '/my/order/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
+				// 		.riderUserId + '&userId=' + e.userId + '&ordersNo=' + e.ordersNo + '&ordersId=' + e.ordersId
+				// })
 				uni.navigateTo({
-					url: '/my/order/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
-						.riderUserId
+				  url: '/my/order/comments?data=' + encodeURIComponent(JSON.stringify(e))
 				})
 			},
 			bindtousu(e) { //投诉