From da1e3dbfc622f7f581d19a56c7e4d3abe13563e1 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 09 七月 2025 18:02:59 +0800
Subject: [PATCH] 上家发布商品功能
---
pages/order/myOrder.vue | 52 ++++++++++++++++++++++++++++++++++++----------------
1 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index da7a01e..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)">
@@ -213,14 +223,13 @@
</template>
<script>
-import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
-import { getOrderList, cancelOrder, confirmReceipt } from "@/api/order.js";
+import '@/components/uview-components/uview-ui';
+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 {
- components: {
- uniLoadMore,
- },
+
data() {
return {
lightColor: this.$lightColor,
@@ -364,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({
@@ -417,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
}
},
@@ -438,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