绿满眶商城微信小程序-uniapp
zxl
2025-10-24 08dbfed46fea626ebd5c543eff86a403e5300549
pages/order/myOrder.vue
@@ -112,6 +112,17 @@
              >
                优惠券卡包
              </view>
              <!-- 新增:定制商品样式 -->
              <view
                ripple
                shape="circle"
                class="cancel-btn"
                size="mini"
                             v-if="order.customizeFlag === 'CUSTOMIZE'"
                @click="opencustomize(order)"
              >
                定制商品
              </view>
                  <!-- 取消订单 -->
<!--                  <view
                    ripple
@@ -161,7 +172,7 @@
                shape="circle"
                class="cancel-btn"
                size="mini"
                v-if="order.orderStatus === 'COMPLETED'&& order.orderType !=='VIRTUAL'"
                v-if="order.orderStatus === 'COMPLETED'&& order.orderType !=='VIRTUAL'&& order.customizeFlag !=='CUSTOMIZE'"
                @click="buyBack(order)"
              >
                再来一单
@@ -175,6 +186,14 @@
                  </u-button> -->
                </view>
              </view>
            <view style="display: flex;justify-content: space-around;">
               <view class="" @click="callPhone">
                   客服热线: 19980834650
               </view>
               <view class="" @click="copyToClipboard">
                   客服微信: meiyikuang
               </view>
            </view>
            </view>
          </view>
          <uni-load-more :status="tabItem.loadStatus"></uni-load-more>
@@ -241,6 +260,7 @@
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 {
  data() {
@@ -327,6 +347,16 @@
      reason: "", //取消原因
      cancelList: "", //取消列表
      rogShow: false, //显示是否收货
     pageSessionNo:"",
     actionParam:{
           sessionId:'',
           actionType:"PAGE",
           joinType:"SELF",
           pageCode:"ORDER_LIST",
           pageParams:"{}",
           pageStatus:"JOIN",
           pageType:"DETAIL"
        }
    };
  },
@@ -349,7 +379,28 @@
    }
    // this.loadData(this.status);
  },
  onUnload() {
    let   param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let   param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
     getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
      this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let   param = Object.assign({}, this.actionParam);
           userAction(param)
        }
     })
    if(this.$options.filters.tipsToLogin()){
      if (!this.tabCurrentIndex) {
        this.initData(0);
@@ -359,6 +410,7 @@
  },
  onLoad(options) {
     this.actionParam.pageParams = JSON.stringify(options)
    /**
     * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
     * 替换onLoad下代码即可
@@ -386,11 +438,40 @@
    },
  },
  methods: {
     copyToClipboard(){
        uni.setClipboardData({
           data:'meiyikuang',
           success() {
              uni.showToast({
            title: '复制成功',
            icon: 'none'
              })
           }
        })
     },
     callPhone(){
        uni.showModal({
           title:'确认联系客服吗?',
           success(e) {
              if(e.confirm){
                 uni.makePhoneCall({
                    phoneNumber:'19980834650'
                 })
              }
           }
        })
     },
     openCouponPackage(order){
        console.log(order)
      uni.navigateTo({
         url:"/pages/order/cardPack?sn=" + order.sn
      })  
     },
     opencustomize(order){
        console.log(order)
           uni.navigateTo({
              url:"/pages/order/constomize/constomize?sn=" + order.sn
           })
     },
     //再来一单
     buyBack(order){
@@ -650,14 +731,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,
      //       `/pages/order/deliverDetail?order_sn=${order.sn}`,
      // });
     uni.navigateTo({
       url:
         `/pages/order/deliverDetail?order_sn=${order.sn}`,
     });
    },
  },
};