绿满眶商城微信小程序-uniapp
peng
2025-07-09 c22e91296d532873b70cb51bf5510bf7738f3f1a
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)">
@@ -217,6 +227,7 @@
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
      }
    },