doum
2026-04-25 9287e9a02f9a9a85b0c4dc49f04d1426af4a0ede
small-program/shop/pages/write-off/write-off.vue
@@ -2,12 +2,12 @@
   <view class="box">
      <view class="title">输入核验码</view>
      <view class="input">
         <input type="number" v-model="code" placeholder="请输入6位取件码" />
         <input type="number" v-model="code" placeholder="请输入6位核验码" />
      </view>
      <view class="btn" v-if="!loading" @click="confirmDo">确认</view>
      <view class="btn1" v-if="loading" >正在查询</view>
      <view class="footer" @click="scanCodeDo">
         <image src="/shop/images/ic_saoma@2x.png" mode="widthFix"></image>
         <image  src="/shop/static/images/ic_saoma@2x.png" mode="widthFix"></image>
         <text>扫码核销</text>
      </view>
      <u-popup :show="show1" round="15" :safeAreaInsetBottom="false" mode="center">
@@ -15,7 +15,7 @@
            <view class="tc-contemt">
               <view class="tc-contemt-title">订单查询结果</view>
               <view class="tc-contemt-nr">
                  订单【{{info.code}}】不满足核销条件!
                  该订单不满足核销条件!
               </view>
            </view>
            <view class="tc-btn">
@@ -30,7 +30,7 @@
   import { mapState } from 'vuex'
   export default {
      computed: {
         ...mapState(['navHeight', 'statusbarHeight'])
         ...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
      },
      data() {
         return {
@@ -42,11 +42,13 @@
         };
      },
      onShow() {
         // this.loading =false
         // this.show1 =false
         // this.info={}
         // this.code =''
         // this.checkShopLogin()
         this.loading =false
         this.show1 =false
         this.info={}
         this.code =''
         this.checkShopLogin()
      },
      onLoad(options) {
      },
      methods:{
         scanCodeDo(){
@@ -73,10 +75,10 @@
               this.getShopDetail()
            }
         },
         jumpWriteoffA(){
            if(this.info && this.info.orderId){
         jumpWriteoffA(type){
            if(this.info && this.info.id){
               uni.navigateTo({
                  url: '/pagesA/pages/write-off-a/write-off-a?id='+this.info.orderId
                  url: '/shop/pages/write-off-a/write-off-a?id='+this.info.id+'&type='+type
               })
            }
         },
@@ -89,32 +91,32 @@
            }
            this.loading =true
            var that =this 
            that.$u.api.getOrderDetailByCode({exchangeCode:this.code,tokenType:1  })
            .then(res=>{
               console.log(res)
               if (res.code === 200) {
                  that.info = res.data
                  if(res.data.orderStatus == 1 && res.data.receiveType ==1){
                     that.jumpWriteoffA()
                  }else{
                     this.show1 = !this.show1
                     this.loading =false
                  }
               }
            }).catch(e=>{
            try{
               that.$u.api.shopOrderDetail({verifyCode:this.code,tokenType:1  })
               .then(res=>{
                  console.log(res)
                  if (res.code === 200) {
                     that.info = res.data
                     if(res.data.status === 1 || res.data.status === 5 || res.data.status === 3){
                        that.jumpWriteoffA(0)
                     } else{
                        this.show1 = !this.show1
                     }
                  }
                  this.loading =false
               })
            }catch(e){
               this.loading =false
            }).finally(e=>{
               // this.loading =false
            })
            }
         },
         checkShopLogin(){
            var that =this
            if( this.shopInfo ==null || this.shopInfo.id==null ||  this.shopToken==null || this.shopToken==''){
            if( this.shopInfo ==null  ||  this.shopToken==null || this.shopToken == ''){
               uni.navigateTo({
                  url: '/pages/login/login'
                  url: '/shop/pages/login/login'
               })
            } 
         },
         }
      }
   }
</script>