From b8452670a1e2b3f415f8111a3c179f3a9a838b11 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期二, 16 九月 2025 10:52:17 +0800
Subject: [PATCH] 页面调整

---
 pages/order/myOrder.vue |   84 +++++++++++++++++++++++++++++-------------
 1 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index 820e33b..c55c741 100644
--- a/pages/order/myOrder.vue
+++ b/pages/order/myOrder.vue
@@ -101,8 +101,19 @@
                     @click="waitPay(order)"
                     >绔嬪嵆浠樻</view
                   >
+				  <!-- 鏂板锛氫紭鎯犲埜鍗″寘鎸夐挳 -->
+				  <view
+				    ripple
+				    shape="circle"
+				    class="cancel-btn"
+				    size="mini"
+					v-if="order.couponFlag === 'COUPON'&& order.orderStatus ==='COMPLETED'"
+				    @click="openCouponPackage(order)"
+				  >
+				    浼樻儬鍒稿崱鍖�
+				  </view>
                   <!-- 鍙栨秷璁㈠崟 -->
-                  <view
+<!--                  <view
                     ripple
                     class="cancel-btn"
                     shape="circle"
@@ -111,7 +122,7 @@
                     @click="onCancel(order.sn)"
                   >
                     鍙栨秷璁㈠崟
-                  </view>
+                  </view> -->
                   <!-- 绛夊緟鏀惰揣 -->
                   <view
                     ripple
@@ -138,13 +149,25 @@
                     shape="circle"
                     class="cancel-btn"
                     size="mini"
-                    v-if="order.groupAfterSaleStatus && ( order.groupAfterSaleStatus.includes('NOT_APPLIED') || order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
+                    v-if="order.groupAfterSaleStatus &&
+					 ( order.groupAfterSaleStatus.includes('NOT_APPLIED') 
+					 || order.groupAfterSaleStatus.includes('PART_AFTER_SALE')||order.orderStatus === 'UNDELIVERED')"
                     @click="applyService(order)"
                   >
                     閫�娆�/鍞悗
                   </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,21 +236,13 @@
 </template>
 
 <script>
-import UEmpty from '@/uview-components/uview-ui/components/u-empty/u-empty.vue';
-import UImage from '@/uview-components/uview-ui/components/u-image/u-image.vue';
-import UPopup from '@/uview-components/uview-ui/components/u-popup/u-popup.vue';
-import URadioGroup from '@/uview-components/uview-ui/components/u-radio-group/u-radio-group.vue';
-import URadio from '@/uview-components/uview-ui/components/u-radio/u-radio.vue';
-import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue';
-import UToast from '@/uview-components/uview-ui/components/u-toast/u-toast.vue';
-import UModal from '@/uview-components/uview-ui/components/u-modal/u-modal.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: {
-    UEmpty,UImage,UPopup,URadioGroup,URadio,UButton,UToast,UModal
-  },
+
   data() {
     return {
       lightColor: this.$lightColor,
@@ -371,6 +386,32 @@
     },
   },
   methods: {
+	  openCouponPackage(order){
+		  console.log(order)
+		uni.navigateTo({
+			url:"/pages/order/cardPack?sn=" + order.sn
+		})  
+	  },
+	  //鍐嶆潵涓�鍗�
+	  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({
@@ -424,18 +465,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
       }
     },
 
@@ -445,7 +477,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