绿满眶商城微信小程序-uniapp
peng
2 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
pages/order/orderDetail.vue
@@ -141,15 +141,15 @@
          <view class="title">服务</view>
        </view>
        <view class="customer-list">
          <view class="customer-service"
<!--       <view class="customer-service"
            v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true"
            @click="onCancel(order.sn)">取消订单</view>
            @click="onCancel(order.sn)">取消订单</view> -->
          <view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
          <view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType == 'PINTUAN'"
            @click="ByUserMessage(order)">查看拼团信息</view>
            <view class="customer-service"
            @click="contact(order.storeId)">联系客服</view>
         <view class="customer-service" v-if="order.orderStatus==='COMPLETED'"
         <view class="customer-service" v-if="order.orderStatus==='COMPLETED' && order.orderType !=='VIRTUAL'"
         @click="buyBack"
         >再来一单</view>
        </view>
@@ -263,14 +263,14 @@
</template>
<script>
import '@/components/uview-components/uview-ui'
import '@/pages/subComponents/uview-components/uview-ui'
import { getExpress, getPackage ,buyBack} from "@/api/trade.js";
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
import shares from "@/pages/subComponents/m-share/index.vue"; //分享
import shares from "@/pages/order/m-share/index.vue"; //分享
import { getClearReason } from "@/api/after-sale.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  components: {
    shares,
@@ -325,9 +325,43 @@
     orderPackage:"",
     //商品信息再来一单使用
     skuList:[],
     pageSessionNo:"",
     actionParam:{
           sessionId:'',
           actionType:"PAGE",
           joinType:"SELF",
           pageCode:"ORDER_DETAIL",
           pageParams:"{}",
           pageStatus:"JOIN",
           pageType:"DETAIL"
        }
    };
  },
  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)
        }
     })
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    this.loadData(options.sn);
    this.sn = options.sn;
  },
@@ -374,9 +408,9 @@
    },
    // 获取物流信息
    loadLogistics(sn) {
      getExpress(sn).then((res) => {
        this.logisticsList = res.data.result;
      });
      // getExpress(sn).then((res) => {
      //   this.logisticsList = res.data.result;
      // });
    },
    // 分享当前拼团信息