MrShi
21 小时以前 8a899e63502939dbf034b90ba46741e0faa9023c
small-program/shop/pages/write-off-a/write-off-a.vue
@@ -156,9 +156,9 @@
      <view class="footer" >
         <view class="footer-btns">
            <view class="btn you"  v-if="info.status >0 || info.status <=7  "   @click="printerOrder1()" >打印标签</view>
            <view class="btn you"  v-if="info.status ===1 ||info.status ===4  "   @click="show0=true" >收件核销</view>
            <view class="btn you"  v-if="info.status ===1 ||info.status ===4  "   @click="confirmWriteOff()"  >收件核销</view>
            <view class="btn you" v-if="info.status ===5 &&(info.overdueStatus ==0 || info.overdueStatus == 1)"  @click="show2=true" >确认到店</view>
            <view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)"  @click="show1=true"  >取件核销</view>
            <view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)"  @click="confirmPickup()"  >取件核销</view>
<!--             <view class="btn you" v-if="info.status ===4"  @click="show3=true"  >确认收件</view>
 -->         </view>
      </view>
@@ -167,7 +167,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="chooseAndUploadImage(3)">
                        <view class="upload-plus">+</view>
@@ -284,7 +284,7 @@
   export default {
      computed: {
         ...mapState(['navHeight', 'statusbarHeight'])
         ...mapState(['navHeight', 'statusbarHeight', 'latitude', 'longitude'])
      },
      data() {
         return {
@@ -295,8 +295,9 @@
            show3:false,
            show2:false,
            info:{},
            latitude: null,
            longitude: null,
            inRadius: false,
            // latitude: null,
            // longitude: null,
            photoList:[],
            photoList1:[],
            photoList3:[],
@@ -345,26 +346,75 @@
            orderId: this.id,
            images:[]
         }
         this.positioning()
         this.getOrderDetail0()
         this.checkRadiusAndGetDetail()
      },
      methods:{
         // 定位
         positioning() {
            var that = this;
         confirmPickup() {
            if (!this.inRadius) {
               uni.showToast({
                  title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                  icon: 'none'
               })
               return
            }
            this.show1 = true
         },
         // 确认收件核销
         confirmWriteOff() {
            if (!this.inRadius) {
               uni.showToast({
                  title: '您当前位置与收货地址距离超出范围,请在地址附近重新拍照',
                  icon: 'none'
               })
               return
            }
            this.show0 = true
         },
         async checkRadiusAndGetDetail() {
            uni.getLocation({
               type: 'gcj02',
               highAccuracyExpireTime: 3000,
               isHighAccuracy: true,
               success: function (addr) {
                  if(!addr){
                     return
               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
                  }
                  that.latitude=addr.latitude
                  that.longitude=addr.longitude
                  this.getOrderDetail0()
               },
               fail: () => {
                  uni.showToast({
                     title: '请先打开位置服务',
                     icon: 'none'
                  })
                  this.getOrderDetail0()
               }
            });
            })
         },
         // // 定位
         // positioning() {
         //    var that = this;
         //    uni.getLocation({
         //       type: 'gcj02',
         //       highAccuracyExpireTime: 3000,
         //       isHighAccuracy: true,
         //       success: function (addr) {
         //          if(!addr){
         //             return
         //          }
         //          that.latitude=addr.latitude
         //          that.longitude=addr.longitude
         //       }
         //    });
         // },
         async chooseAndUploadImage(maxCount = 3) {
            const currentCount = this.form.images.length
            const remainingCount = maxCount - currentCount
@@ -619,12 +669,14 @@
         },
         async shopVerifyOrderDo(){
            var that =this
            if (!this.form.images || this.form.images.length == 0) {
               uni.showToast({
                  title: '请上传收件图片',
                  icon: 'warn'
               })
               return
            if (this.info.type === 1) {
               if (!this.form.images || this.form.images.length == 0) {
                  uni.showToast({
                     title: '请上传收件图片',
                     icon: 'warn'
                  })
                  return
               }
            }
            let res = await that.$u.api.shopVerifyOrder(this.form);
            if (res.code === 200 ) { 
@@ -659,14 +711,20 @@
               this.info = res.data 
               if(res.data.status === 1 ||res.data.status === 4 ){
                  that.actionType = 0
                  that.show0 = true
                  if (this.inRadius) {
                     that.show0 = true
                  }
                  //info.overdueStatus ==0 || info.overdueStatus == 1
               }else if(res.data.status === 5 && (res.data.overdueStatus ==4 || res.data.overdueStatus == 2)){
                  that.actionType = 1
                  that.show1 = true
                  if (this.inRadius) {
                     that.show1 = true
                  }
               }else if(res.data.status === 5 && (res.data.overdueStatus ==0 || res.data.overdueStatus == 1)){
                  that.actionType = 1
                  that.show2 = true
                  if (this.inRadius) {
                     that.show2 = true
                  }
               }else{
                  /* uni.showToast({
                     title:'订单状态已流转,当前无法核验!',