From 38eedaffe0226ade6284a63765545db5c4aa705c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Mon, 15 Sep 2025 11:56:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=94=AE=E5=90=8E=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/afterSale.js | 1 + packages/myOrders/awaitRated/awaitRated.vue | 90 +++++-------- packages/myOrders/evaluate/index.vue | 99 +++++--------- packages/myOrders/index/index.vue | 92 +++++++++---- packages/myOrders/orderDetails/index.vue | 57 ++++++-- packages/myOrders/rated/rated.css | 4 +- packages/myOrders/rated/rated.vue | 137 ++++++++++++-------- packages/shop/groupPurchaseSubmit/index.vue | 1 + 8 files changed, 264 insertions(+), 217 deletions(-) diff --git a/api/afterSale.js b/api/afterSale.js index 0259ea76..ab705635 100644 --- a/api/afterSale.js +++ b/api/afterSale.js @@ -7,4 +7,5 @@ export const apiArr = { revokeApply: "/api/v2/wechat/commodity/after-sales/revoke-apply", //撤销售后申请 changeGoodsList: "/api/v2/wechat/commodity/after-sales/change-goods-list", //商品售后换货商品列表 updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请 + createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价 }; diff --git a/packages/myOrders/awaitRated/awaitRated.vue b/packages/myOrders/awaitRated/awaitRated.vue index 689d16e4..13c5376e 100644 --- a/packages/myOrders/awaitRated/awaitRated.vue +++ b/packages/myOrders/awaitRated/awaitRated.vue @@ -2,24 +2,20 @@ - {{ item.orderName }} - {{ item.orderNumber }} + {{ item.supplier_name }} + {{ item.order_no }} - + - - {{ product.tag }} + + 当日达 - {{ product.name }} - {{ product.spec }} - {{ product.unit }} + {{ product.goods_name }} + {{ product.goods_spec }} + {{ product.sales_price }}/{{ product.goods_unit }} - + + --> + - + @@ -164,14 +164,27 @@ export default { showTkPopup: false,//申请退款 afterSaleItem: '',//操作对象 afterSaleList: [],//售后列表 + selectStatus: '',//选中的status + evaluateStatus: '',//评价状态 }; }, methods: { selectTab(index, item) { this.selectedTab = index; - if (index !== 6) { - this.getOrderList(); + if (index == 6) { + this.evaluateStatus = 2; + this.selectStatus = '' + } else if (index == 7) { + this.evaluateStatus = 1; + this.selectStatus = '' + } else if (index == 2) { + this.selectStatus = 6; + this.evaluateStatus = '' + } else { + this.selectStatus = index; + this.evaluateStatus = '' } + this.getOrderList(); }, // 取消订单 cancelOrder(item) { @@ -181,7 +194,6 @@ export default { // 处理订单取消事件 handleOrderCancelled(data) { - console.log("🚀 ~ handleOrderCancelled ~ 取消原因:", data.reason); const params = { order_id: this.afterSaleItem.id, method: 1, @@ -195,7 +207,6 @@ export default { // 售后按钮 afterSale(item) { - console.log("🚀 ~ afterSale ~ item:", item) this.afterSaleGoods = item.commodity_order_item_list; // 保存完整的订单对象 this.afterSaleOrderItem = item; @@ -206,7 +217,6 @@ export default { // request(afterSaleApi.isAllow, "POST", { // order_id: item.id, // }).then((res) => { - // console.log("🚀 ~ afterSale ~ res:", res) // if (res.data.is_allow_after_sales) { // this.afterSaleGoods = res.data.allow_items; // // this.selectedAsGood = item.commodity_order_item_list[0].id; @@ -219,8 +229,6 @@ export default { // 处理退款提交事件 handleRefundSubmitted(data) { - console.log("🚀 ~ handleRefundSubmitted ~ handleRefundSubmitted:", this.afterSaleOrderItem) - console.log("🚀 ~ handleRefundSubmitted ~ 退款申请提交成功:", data); const params = { nick_name: uni.getStorageSync("nickName"), order_id: this.afterSaleOrderItem.id, @@ -236,7 +244,6 @@ export default { receiving_address: data.merchantAddress, change_goods_id: data.changeServiceId } - console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params) // request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { // this.getOrderList(); // }); @@ -256,8 +263,6 @@ export default { // 处理退款确认事件 handleRefundConfirmed(data) { - console.log("🚀 ~ handleRefundConfirmed ~ handleRefundConfirmed:", this.afterSaleItem) - console.log("🚀 ~ handleRefundConfirmed ~ 退款原因:", data.reason); const params = { nick_name: uni.getStorageSync("nickName"), order_id: this.afterSaleItem.id, @@ -267,7 +272,6 @@ export default { refund_amount: this.afterSaleItem.total_amount, order_status: 3 } - console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params) request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { this.getOrderList(); }); @@ -284,7 +288,6 @@ export default { order_id: item.id, method: 2, } - console.log("🚀 ~ confirmReceiving ~ params:", params) request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => { this.getOrderList(); }); @@ -293,7 +296,44 @@ export default { }); }, goToPay(item) { - console.log(item); + // 创建转换后的商品数组 + const transformedItems = item.commodity_order_item_list.map(goods => ({ + checked: true, + commodity_goods_info: { + commodity_brief: "", + commodity_id: goods.goods_id, + commodity_pic: goods.commodity_pic, + goods_alias: goods.goods_name, + goods_carousel: "", + goods_detail_pic: "", + goods_intro: goods.goods_name, + goods_name: goods.goods_name, + goods_no: "", + goods_spec: goods.goods_spec, + goods_status: 1, + goods_unit: goods.goods_unit, + goods_video: "", + group_buy_activity_info: null, + id: goods.id, + is_same_day: goods.is_same_day || false, + is_support_same_day: goods.is_support_same_day || 2, + market_price: goods.sales_price, + sales_price: goods.sales_price, + stock_quantity: goods.stock_quantity + }, + commodity_id: goods.goods_id, + count: goods.count, + create_time: item.create_time, + goods_id: goods.id, + group_buy_id: 0, + id: goods.id, + supplier_id: item.supplier_id, + supplier_name: item.supplier_name, + update_time: item.update_time, + user_id: item.user_id + })); + + NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`) }, toDetails(item) { NavgateTo( @@ -305,8 +345,8 @@ export default { NavgateTo(`/packages/myOrders/logistics/index`); }, - orderEvaluate() { - NavgateTo(`/packages/myOrders/orderEvaluate/index`); + orderEvaluate(item) { + NavgateTo(`/packages/myOrders/evaluate/index?item=${JSON.stringify(item)}`); }, getOrderStatus(order_status) { @@ -331,8 +371,10 @@ export default { }, getOrderList() { + this.orderData = [] request(afterSaleApi.orderList, "POST", { - order_status: this.selectedTab, + order_status: this.selectStatus, + evaluate_status: this.evaluateStatus, user_id: uni.getStorageSync("userId"), }).then((res) => { res.order_list.forEach(item => { diff --git a/packages/myOrders/orderDetails/index.vue b/packages/myOrders/orderDetails/index.vue index fdae495e..c63606b2 100644 --- a/packages/myOrders/orderDetails/index.vue +++ b/packages/myOrders/orderDetails/index.vue @@ -140,17 +140,17 @@ - + - + - + - + @@ -267,17 +267,56 @@ export default { }); }, gotoPayment() { - // 跳转到支付页面 - // uni.navigateTo({ - // url: "/kitchen/pay/index", - // }); + // 创建转换后的商品数组 + const transformedItems = this.orderInfo.commodity_order_item_list.map(goods => ({ + checked: true, + commodity_goods_info: { + commodity_brief: "", + commodity_id: goods.goods_id, + commodity_pic: goods.commodity_pic, + goods_alias: goods.goods_name, + goods_carousel: "", + goods_detail_pic: "", + goods_intro: goods.goods_name, + goods_name: goods.goods_name, + goods_no: "", + goods_spec: goods.goods_spec, + goods_status: 1, + goods_unit: goods.goods_unit, + goods_video: "", + group_buy_activity_info: null, + id: goods.id, + is_same_day: goods.is_same_day || false, + is_support_same_day: goods.is_support_same_day || 2, + market_price: goods.sales_price, + sales_price: goods.sales_price, + stock_quantity: goods.stock_quantity + }, + commodity_id: goods.goods_id, + count: goods.count, + create_time: this.orderInfo.create_time, + goods_id: goods.id, + group_buy_id: 0, + id: goods.id, + supplier_id: this.orderInfo.supplier_id, + supplier_name: this.orderInfo.supplier_name, + update_time: this.orderInfo.update_time, + user_id: this.orderInfo.user_id + })); + + NavgateTo(`/packages/shop/groupPurchaseSubmit/index?shopCarList=${JSON.stringify(transformedItems)}`) }, checkLogistics() { NavgateTo(`/packages/myOrders/logistics/index`); }, orderEvaluate() { - NavgateTo(`/packages/myOrders/orderEvaluate/index`); + NavgateTo(`/packages/myOrders/evaluate/index?item=${JSON.stringify(this.orderInfo)}`); + }, + + // 售后按钮 + afterSale() { + NavgateTo(`/packages/myOrders/afterSale/index`); } }, }; diff --git a/packages/myOrders/rated/rated.css b/packages/myOrders/rated/rated.css index 10f3ad8a..027accfc 100644 --- a/packages/myOrders/rated/rated.css +++ b/packages/myOrders/rated/rated.css @@ -66,8 +66,8 @@ } .image-item image { - width: 80rpx; - height: 80rpx; + width: 100%; + height: 100%; } .image-text { diff --git a/packages/myOrders/rated/rated.vue b/packages/myOrders/rated/rated.vue index 74c71192..69cb35b8 100644 --- a/packages/myOrders/rated/rated.vue +++ b/packages/myOrders/rated/rated.vue @@ -1,44 +1,38 @@