MrShi
13 小时以前 b806c4ad52a661a1e5f0695650ec1a7e42f01633
small-program/shop/pages/write-off-a/write-off-a.vue
@@ -7,6 +7,7 @@
            <view class="nr-status-type"  v-if="info.type === 1">同城寄送</view>
            <view class="nr-status-type1"  v-if="info.type === 1 && info.isUrgent === 0">标速达</view>
            <view class="nr-status-type1"  v-if="info.type === 1 && info.isUrgent === 1">极速达</view>
            <view class="nr-status-type2" v-if="info.exceptionStatus === 1">异常转存</view>
         </view>
         <view class="item" style="padding: 10rpx;" v-if="info.type ===1 && info.status===4">
            <map name="mapAddr"></map>
@@ -200,7 +201,7 @@
            <view class="tc-contemt">
               <view class="tc-contemt-title" >确认取件</view>
               <view class="input-c">
                  <view class="input-label">拍照取件<text style="color: red;">*</text><text style="color: #666666;">(最多3张照片)</text></view>
                  <view class="input-label">拍照取件<text style="color: red;" v-if="info.type === 1">*</text><text style="color: #666666;">(最多3张照片)</text></view>
                  <view class="upload-row">
                     <view class="upload-box" @click="chooseAndUploadImage1(3)">
                        <view class="upload-plus">+</view>
@@ -349,7 +350,8 @@
         this.checkRadiusAndGetDetail()
      },
      methods:{
         confirmPickup() {
         async confirmPickup() {
            await this.checkRadiusAndGetDetail()
            if (!this.inRadius) {
               uni.showToast({
                  title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
@@ -359,8 +361,8 @@
            }
            this.show1 = true
         },
         // 确认收件核销
         confirmWriteOff() {
         async confirmWriteOff() {
            await this.checkRadiusAndGetDetail()
            if (!this.inRadius) {
               uni.showToast({
                  title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
@@ -371,32 +373,36 @@
            this.show0 = true
         },
         async checkRadiusAndGetDetail() {
            uni.getLocation({
               type: 'gcj02',
               success: async (res) => {
                  const radiusRes = await this.$u.api.checkShopOperationRadius({
                     lat: res.latitude,
                     lng: res.longitude,
                     orderId: this.id
                  })
                  if (radiusRes.code === 200) {
                     if (!radiusRes.data) {
                        uni.showToast({
                           title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                           icon: 'none'
                        })
            return new Promise((resolve) => {
               uni.getLocation({
                  type: 'gcj02',
                  success: async (res) => {
                     const radiusRes = await this.$u.api.checkShopOperationRadius({
                        lat: res.latitude,
                        lng: res.longitude,
                        orderId: this.id
                     })
                     if (radiusRes.code === 200) {
                        if (!radiusRes.data) {
                           uni.showToast({
                              title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                              icon: 'none'
                           })
                        }
                        this.inRadius = radiusRes.data
                     }
                     this.inRadius = radiusRes.data
                     this.getOrderDetail0()
                     resolve()
                  },
                  fail: () => {
                     uni.showToast({
                        title: '请先打开位置服务',
                        icon: 'none'
                     })
                     this.getOrderDetail0()
                     resolve()
                  }
                  this.getOrderDetail0()
               },
               fail: () => {
                  uni.showToast({
                     title: '请先打开位置服务',
                     icon: 'none'
                  })
                  this.getOrderDetail0()
               }
               })
            })
         },
         // // 定位
@@ -614,17 +620,19 @@
            } 
         }, 
         async storeOutOrderDo(){
            uni.showToast({
               title: '操作成功',
               icon: 'success'
            })
            var that =this
            if (!this.form1.images || this.form1.images.length == 0) {
               uni.showToast({
                  title:'请上传取件图片',
                  icon: 'warn'
               })
               return
            if (this.info.type === 1) {
               if (!this.form1.images || this.form1.images.length == 0) {
                  uni.showToast({
                     title: '请上传取件图片',
                     icon: 'warn'
                  })
                  return
               }
            } else {
               if (!this.form1.images || this.form1.images.length == 0) {
                  delete this.form1.images
               }
            }
            let res = await that.$u.api.storeOutOrder(this.form1);
            if (res.code === 200 ) { 
@@ -677,6 +685,10 @@
                  })
                  return
               }
            } else {
               if (!this.form.images || this.form.images.length == 0) {
                  delete this.form.images
               }
            }
            let res = await that.$u.api.shopVerifyOrder(this.form);
            if (res.code === 200 ) { 
@@ -685,7 +697,7 @@
                  icon: 'success'
               })
                 uni.$emit('updateOrder',{info:this.info,delete:0})
                 that.printerOrder()
               //   that.printerOrder()
                setTimeout(function(){
                   that.getOrderDetail()
                },1000) 
@@ -1021,6 +1033,19 @@
               color: #10B2FA;
               margin-left: 16rpx;
            }
            .nr-status-type2 {
               width: 158rpx;
               height: 38rpx;
               display: flex;
               align-items: center;
               justify-content: center;
               background: #FFFFFF;
               border-radius: 8rpx;
               font-weight: 400;
               font-size: 24rpx;
               color: #FF0000;
               margin-left: 16rpx;
            }
         }
         .nr-desc {
            font-weight: 400;