Răsfoiți Sursa

feat(退款): 添加协商历史页面功能

实现退款订单协商历史查看功能,包含以下改动:
- 在 pages.json 中注册协商历史页面路由
- 在退款详情页将协商历史按钮从占位提示改为实际跳转
- 在 API 模块中添加协商历史数据接口
- 新增协商历史页面组件,支持查看协商记录、用户信息和凭证图片预览
ylong 2 zile în urmă
părinte
comite
2724c5dc48

+ 3 - 0
api/modules/mall.js

@@ -92,6 +92,9 @@ export const useMallApi = (Vue, vm) => {
         // 退款申请-拒绝协商
         refundDisposeRefuseAjax: (data) => vm.$u.post('/token/shop/order/refundDisposeRefuse', data),
 
+        // 退款订单-协商历史
+        refundDisposeListAjax: (params) => vm.$u.get('/token/shop/order/refundDisposeList', params),
+
         // 减钱分享信息
         clickReduceInviteAjax: (params) => vm.$u.get('/token/shop/order/clickReduceInvite', params),
         

+ 192 - 0
pages-car/pages/negotiation-history.vue

@@ -0,0 +1,192 @@
+<template>
+	<view class="negotiation-history-page">
+		<view class="history-list" v-if="list.length > 0">
+			<view class="history-item" v-for="(item, index) in list" :key="index">
+				<!-- 左侧头像 -->
+				<view class="avatar-box">
+					<image class="avatar" :src="item.imgPath || '/static/default-avatar.png'" mode="aspectFill"></image>
+				</view>
+				
+				<!-- 右侧内容 -->
+				<view class="content-box">
+					<view class="user-info">
+						<text class="name">{{ item.userName || '用户' }}</text>
+						<text class="time">{{ item.createTime }}</text>
+					</view>
+					
+					<view class="message-card">
+						<view class="msg-title" v-if="item.title">{{ item.title }}</view>
+						<view class="msg-content" v-if="item.content">
+							<text>{{ item.content }}</text>
+						</view>
+						
+						<!-- 凭证图片 -->
+						<view class="img-grid" v-if="item.imgList && item.imgList.length > 0">
+							<image 
+								class="grid-img" 
+								v-for="(img, imgIndex) in item.imgList" 
+								:key="imgIndex" 
+								:src="img" 
+								mode="aspectFill"
+								@click="previewImage(item.imgList, imgIndex)"
+							></image>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<!-- 空状态 -->
+		<view class="empty-box" v-else-if="!loading">
+			<u-empty text="暂无协商历史" mode="history"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				refundOrderId: '',
+				list: [],
+				loading: true
+			};
+		},
+		onLoad(options) {
+			if (options.refundOrderId) {
+				this.refundOrderId = options.refundOrderId;
+				this.getList();
+			}
+		},
+		methods: {
+			getList() {
+				this.loading = true;
+				uni.showLoading({ title: '加载中' });
+				this.$u.api.refundDisposeListAjax({ refundOrderId: this.refundOrderId }).then(res => {
+					uni.hideLoading();
+					this.loading = false;
+					if (res.code == 200) {
+						this.list = res.data || [];
+					} else {
+						uni.showToast({
+							title: res.msg || '获取失败',
+							icon: 'none'
+						});
+					}
+				}).catch(() => {
+					uni.hideLoading();
+					this.loading = false;
+				});
+			},
+			previewImage(imgList, current) {
+				uni.previewImage({
+					urls: imgList,
+					current: current
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.negotiation-history-page {
+		min-height: 100vh;
+		background-color: #F5F5F5;
+		padding: 30rpx;
+		
+		.history-list {
+			background-color: #fff;
+			border-radius: 16rpx;
+			padding: 30rpx 20rpx;
+			
+			.history-item {
+				display: flex;
+				margin-bottom: 40rpx;
+				
+				&:last-child {
+					margin-bottom: 0;
+					
+					.content-box {
+						border-bottom: none;
+					}
+				}
+				
+				.avatar-box {
+					width: 80rpx;
+					margin-right: 20rpx;
+					flex-shrink: 0;
+					
+					.avatar {
+						width: 80rpx;
+						height: 80rpx;
+						border-radius: 50%;
+						background-color: #eee;
+					}
+				}
+				
+				.content-box {
+					flex: 1;
+					padding-bottom: 40rpx;
+					border-bottom: 1rpx solid #F0F0F0;
+					
+					.user-info {
+						display: flex;
+						flex-direction: column;
+						margin-bottom: 16rpx;
+						
+						.name {
+							font-size: 28rpx;
+							font-weight: bold;
+							color: #666;
+							margin-bottom: 6rpx;
+						}
+						
+						.time {
+							font-size: 24rpx;
+							color: #999;
+						}
+					}
+					
+					.message-card {
+						.msg-title {
+							font-size: 28rpx;
+							font-weight: bold;
+							color: #333;
+							margin-bottom: 10rpx;
+						}
+						
+						.msg-content {
+							font-size: 28rpx;
+							color: #333;
+							line-height: 1.6;
+							word-break: break-all;
+						}
+						
+						.img-grid {
+							display: flex;
+							flex-wrap: wrap;
+							margin-top: 20rpx;
+							
+							.grid-img {
+								width: 160rpx;
+								height: 160rpx;
+								border-radius: 8rpx;
+								margin-right: 16rpx;
+								margin-bottom: 16rpx;
+								background-color: #f8f8f8;
+								
+								&:nth-child(3n) {
+									margin-right: 0;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		
+		.empty-box {
+			padding-top: 200rpx;
+		}
+	}
+</style>

+ 4 - 2
pages-car/pages/refund-detail.vue

@@ -327,8 +327,10 @@
 				});
 			},
 			goToHistory() {
-				// 跳转协商历史页面 (如果有)
-				uni.showToast({ title: '协商历史功能开发中', icon: 'none' });
+				// 跳转协商历史页面
+				uni.navigateTo({
+					url: `/pages-car/pages/negotiation-history?refundOrderId=${this.refundOrderId}`
+				});
 			},
 			navigateToCustomerService() {
 				// 联系客服

+ 6 - 0
pages.json

@@ -380,6 +380,12 @@
                     "style": {
                         "navigationBarTitleText": "填写退货物流"
                     }
+                },
+                {
+                    "path": "pages/negotiation-history",
+                    "style": {
+                        "navigationBarTitleText": "协商历史"
+                    }
                 }
             ]
         },