From c22e91296d532873b70cb51bf5510bf7738f3f1a Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期三, 09 七月 2025 18:01:36 +0800 Subject: [PATCH] 完成小程序商户端查看订单发货查看物流 --- pages/order/myOrder.vue | 46 ++++++++++++++++++++++++++++++++++------------ 1 files changed, 34 insertions(+), 12 deletions(-) diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue index 91e50a5..e808a50 100644 --- a/pages/order/myOrder.vue +++ b/pages/order/myOrder.vue @@ -143,8 +143,18 @@ > 閫�娆�/鍞悗 </view> + <view + ripple + shape="circle" + class="cancel-btn" + size="mini" + v-if="order.orderStatus === 'COMPLETED' " + @click="buyBack(order)" + > + 鍐嶆潵涓�鍗� + </view> <!-- TODO 鍚庣画瀹屽杽 --> - <!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if=" +<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if=" order.orderStatus === 'CANCELLED' || order.orderStatus === 'COMPLETE' " @click="reBuy(order)"> @@ -214,9 +224,10 @@ <script> import '@/components/uview-components/uview-ui'; -import { getOrderList, cancelOrder, confirmReceipt } from "@/api/order.js"; +import { getOrderXcxList, cancelOrder, confirmReceipt } from "@/api/order.js"; import { getClearReason } from "@/api/after-sale.js"; import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js"; +import {buyBack} from "@/api/trade.js"; export default { data() { @@ -362,6 +373,26 @@ }, }, methods: { + //鍐嶆潵涓�鍗� + buyBack(order){ + console.log(JSON.stringify(order)) + const param = order.orderItems.map(item => { + return { + skuId: item.skuId, + num: item.num + } + }) + console.log('------------------>',JSON.stringify(param)) + buyBack(param).then(res=>{ + console.log('------------------->',res) + if(res.data.code==200){ + uni.navigateTo({ + url: "/pages/order/fillorder?way=CART" + }) + } + }) + + }, // 鍞悗 applyService(order) { uni.navigateTo({ @@ -415,18 +446,9 @@ */ pay(val) { if (val.sn) { - // #ifdef MP-WEIXIN - new LiLiWXPay({ - sn: val.sn, - price: val.flowPrice, - orderType: "ORDER", - }).pay(); - // #endif - // #ifndef MP-WEIXIN uni.navigateTo({ url: "/pages/cart/payment/payOrder?order_sn=" + val.sn, }); - // #endif } }, @@ -436,7 +458,7 @@ loadData(index) { this.params.pageNumber = this.navList[index].pageNumber; // this.params.tag = this.orderStatus[index].orderStatus; - getOrderList(this.params).then((res) => { + getOrderXcxList(this.params).then((res) => { uni.stopPullDownRefresh(); if (!res.data.success) { this.navList[index].loadStatus = "noMore"; -- Gitblit v1.8.0