From 89efee9a2e20fc04b4537d859917b47cf68a814c Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 26 九月 2025 18:28:40 +0800
Subject: [PATCH] 用户行为分享基础埋点

---
 pages/order/myOrder.vue |  122 +++++++++++++++++++++++++++++++++-------
 1 files changed, 99 insertions(+), 23 deletions(-)

diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index da7a01e..6821cde 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'&& order.orderType !=='VIRTUAL'"
+				    @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 +236,14 @@
 </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";
+import { getSessionId, userAction } from "@/api/userAction.js";
 export default {
-  components: {
-    uniLoadMore,
-  },
+
   data() {
     return {
       lightColor: this.$lightColor,
@@ -305,6 +328,16 @@
       reason: "", //鍙栨秷鍘熷洜
       cancelList: "", //鍙栨秷鍒楄〃
       rogShow: false, //鏄剧ず鏄惁鏀惰揣
+	  pageSessionNo:"",
+	  actionParam:{
+	  		sessionId:'',
+	  		actionType:"PAGE",
+	  		joinType:"SELF",
+	  		pageCode:"ORDER_LIST",
+	  		pageParams:"{}",
+	  		pageStatus:"JOIN",
+	  		pageType:"DETAIL"
+	  	}
     };
   },
 
@@ -327,7 +360,28 @@
     }
     // this.loadData(this.status);
   },
+  onUnload() {
+    let	param = this.actionParam;
+    if (this.sendOnShow)return
+    param.pageStatus = "LEAVE"
+    userAction(param)
+  },
+  onHide() {
+    this.startHidenTime = Date.now()
+    let	param = this.actionParam;
+    this.sendOnShow = true;
+    param.pageStatus = "LEAVE"
+    userAction(param)
+  },
   onShow() {
+	  getSessionId().then(res=>{
+	  	this.pageSessionNo = res.data.data
+	  	if(this.pageSessionNo){
+	  	let	param = this.actionParam;
+	  		param.sessionId = this.pageSessionNo
+	  		userAction(param)
+	  	}
+	  })	
     if(this.$options.filters.tipsToLogin()){
       if (!this.tabCurrentIndex) {
         this.initData(0);
@@ -337,6 +391,7 @@
   },
 
   onLoad(options) {
+	  this.actionParam.pageParams = JSON.stringify(options)
     /**
      * 淇app绔偣鍑婚櫎鍏ㄩ儴璁㈠崟澶栫殑鎸夐挳杩涘叆鏃朵笉鍔犺浇鏁版嵁鐨勯棶棰�
      * 鏇挎崲onLoad涓嬩唬鐮佸嵆鍙�
@@ -364,6 +419,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({
@@ -417,18 +498,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 +510,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";
@@ -611,10 +683,14 @@
      * 鏌ョ湅鐗╂祦
      */
     navigateToLogistics(order) {
-      uni.navigateTo({
-        url:
-          "/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
-      });
+      // uni.navigateTo({
+      //   url:
+      //     "/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
+      // });
+	  uni.navigateTo({
+	    url:
+	      `/pages/order/deliverDetail?order_sn=${order.sn}`,
+	  });
     },
   },
 };

--
Gitblit v1.8.0