小程序端确认收货
This commit is contained in:
		@@ -188,6 +188,39 @@ Page({
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  // 订单状态:已发货,点击确认收货
 | 
			
		||||
  confirmReceipt() {
 | 
			
		||||
    // 点击确认收货按钮
 | 
			
		||||
    wx.showModal({
 | 
			
		||||
      title: '是否确认收货?',
 | 
			
		||||
      content: '未收到货时请不要点击确认',
 | 
			
		||||
      complete: (res) => {
 | 
			
		||||
        if (res.confirm) {
 | 
			
		||||
          (async () => {
 | 
			
		||||
            this.clearPageData()
 | 
			
		||||
            let confirmResult = await orderService.confirmOrder(this.data.orderId)
 | 
			
		||||
            console.log("confirmResult", confirmResult)
 | 
			
		||||
            this.onLoad(this.data._options)
 | 
			
		||||
            this.refreshMyOrderPage()
 | 
			
		||||
            wx.showModal({
 | 
			
		||||
              title: '操作结果',
 | 
			
		||||
              content: confirmResult || "操作失败,请重试",
 | 
			
		||||
              showCancel: false,
 | 
			
		||||
              complete: (res) => {
 | 
			
		||||
                // wx.navigateBack({
 | 
			
		||||
                //   delta: getCurrentPages().length - 1
 | 
			
		||||
                // })
 | 
			
		||||
                // wx.navigateTo({
 | 
			
		||||
                //   url: "/pages/shop/orderDetail?orderId=" + this.data.orderId,
 | 
			
		||||
                // })
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          })();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  loadPageData() {
 | 
			
		||||
    (async () => {
 | 
			
		||||
      console.log("orderId", this.data.orderId)
 | 
			
		||||
 
 | 
			
		||||
@@ -45,6 +45,8 @@
 | 
			
		||||
  <view wx:if="{{order.cancelDate}}">订单取消时间:{{order.cancelDate}}</view>
 | 
			
		||||
  <view wx:if="{{order.shipDate}}">订单发货时间:{{order.shipDate}}</view>
 | 
			
		||||
  <view wx:if="{{order.deliverDate}}">确认收货时间:{{order.deliverDate}}</view>
 | 
			
		||||
  <view wx:if="{{order.expressId}}">发货快递单号:{{order.expressId}}</view>
 | 
			
		||||
  <view wx:if="{{order.comment}}">发货备注信息:{{order.comment}}</view>
 | 
			
		||||
</view>
 | 
			
		||||
 | 
			
		||||
<view class="good-list-title">订单详情</view>
 | 
			
		||||
@@ -86,10 +88,12 @@
 | 
			
		||||
    <!-- Cancelled -->
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Cancelled' }}" class="txt txt-disabled">❕无法操作已取消订单</view>
 | 
			
		||||
    <!-- Processing -->
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Processing' }}" class="txt txt-disabled">当前订单尚未发货,可以取消</view>
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Processing' }}" class="btn btn-hollow" bindtap="cancelPayment">取消订单</view>
 | 
			
		||||
    <!-- Shipped -->
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Shipped' }}" class="txt txt-disabled">当前订单不可取消,请耐心等待</view>
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Shipped' }}" class="btn btn-solid" bindtap="confirmReceipt">确认收货</view>
 | 
			
		||||
    <!-- Delivered -->
 | 
			
		||||
    <view wx:if="{{ orderStatusCode == 'Delivered' }}" class="txt txt-done">✅订单已送达</view>
 | 
			
		||||
  </view>
 | 
			
		||||
</view>
 | 
			
		||||
</view>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user