hookehuyr

fix(订单管理): 修复评价功能中review数据路径错误并更新提示方式

修复订单评价功能中review数据的访问路径错误,从order.review改为order.details.review
同时将Toast提示替换为Taro.showToast以保持一致性
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-07-14 16:13:28 4 + * @LastEditTime: 2025-07-14 17:03:37
5 * @FilePath: /jgdl/src/pages/myOrders/index.vue 5 * @FilePath: /jgdl/src/pages/myOrders/index.vue
6 * @Description: 订单管理页面 6 * @Description: 订单管理页面
7 --> 7 -->
...@@ -625,11 +625,11 @@ const rateOrder = (orderId) => { ...@@ -625,11 +625,11 @@ const rateOrder = (orderId) => {
625 currentRateOrder.value = order 625 currentRateOrder.value = order
626 626
627 // 检查是否已有评价 627 // 检查是否已有评价
628 - if (order.review) { 628 + if (order.details.review) {
629 // 已评价,显示只读模式 629 // 已评价,显示只读模式
630 isReadOnlyMode.value = true 630 isReadOnlyMode.value = true
631 - rateContent.value = order.review.content 631 + rateContent.value = order.details.review.note
632 - rateScore.value = order.review.rating 632 + rateScore.value = order.details.review.rating
633 } else { 633 } else {
634 // 未评价,显示编辑模式 634 // 未评价,显示编辑模式
635 isReadOnlyMode.value = false 635 isReadOnlyMode.value = false
...@@ -669,7 +669,7 @@ const submitRate = async () => { ...@@ -669,7 +669,7 @@ const submitRate = async () => {
669 submittingRate.value = true 669 submittingRate.value = true
670 670
671 const response = await reviewOrderAPI({ 671 const response = await reviewOrderAPI({
672 - detail_id: currentRateOrder.value.id, 672 + detail_id: currentRateOrder.value.details.id,
673 rating: rateScore.value, 673 rating: rateScore.value,
674 note: rateContent.value 674 note: rateContent.value
675 }) 675 })
...@@ -685,7 +685,11 @@ const submitRate = async () => { ...@@ -685,7 +685,11 @@ const submitRate = async () => {
685 } 685 }
686 order.status = 5 686 order.status = 5
687 } 687 }
688 - Toast.success(response.msg || '评价提交成功') 688 + Taro.showToast({
689 + title: response.msg || '评价提交成功',
690 + icon: 'success',
691 + duration: 2000
692 + })
689 closeRatePopup() 693 closeRatePopup()
690 } else { 694 } else {
691 throw new Error(response.msg || '提交失败') 695 throw new Error(response.msg || '提交失败')
......