MrShi
2025-08-21 a223d5e29e9384f720ae98c44cbe10f8fa4f73e7
small-program/pages/demand-hall/demand-hall.vue
@@ -11,7 +11,7 @@
      <view class="index-wu" v-if="!isLogin">
         <image src="/static/icon/default_login@2x.png" mode="widthFix"></image>
         <text>您还没有登录,请登录后查看订单</text>
         <button>登录</button>
         <button @click="toLogin">登录</button>
      </view>
      
      <!-- 已登陆 -->
@@ -50,7 +50,7 @@
                  <view class="index-list-item-head-r" v-if="item.status === 2">已接单</view>
                  <view class="index-list-item-head-r" v-if="item.status === 3">进行中</view>
                  <view class="index-list-item-head-r" v-if="item.status === 2 && item.isUpdate === 1">已修改,待接单方确认</view>
                  <view class="index-list-item-head-r hui" v-if="item.status === 4">已完成</view>
                  <view class="index-list-item-head-r hui" v-if="item.status === 4 && item.commentStatus !== 0">已完成</view>
                  <view class="index-list-item-head-r hui" v-if="item.status === 99">已取消</view>
                  <view class="index-list-item-head-r" v-if="item.status === 4 && item.commentStatus === 0">待评价</view>
               </view>
@@ -75,7 +75,7 @@
                     <image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image>
                     <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image>
                     <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image>
                     <text>{{item.location}}</text>
                     <text>{{address.location}}</text>
                  </view>
               </view>
               <template v-if="[0, 2].includes(item.type)">
@@ -98,9 +98,9 @@
                     <view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click.stop="orderId = item.id, show = true">取消订单</view>
                     <view class="eidt-phone" v-if="[2].includes(item.status)">联系师傅</view>
                     <view class="eidt-phone" v-if="item.status === 4 && item.commentStatus === 0">评价订单</view>
                     <view class="eidt-btn" v-if="[0,1,2].includes(item.status)" @click.stop="jumpEdit(item)">修改订单</view>
                     <view class="eidt-btn" v-if="[0,1,2].includes(item.status) && item.type !== 2" @click.stop="jumpEdit(item)">修改订单</view>
                     <view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) ||  (item.type === 2 && item.status === 3)" @click.stop="jumpEdit(item)">继续支付</view>
                     <view class="eidt-btn" v-if="item.status === 2" @click.stop="startJobs(item.id)">开始作业</view>
                     <!-- <view class="eidt-btn" v-if="item.status === 2" @click.stop="startJobs(item.id)">开始作业</view> -->
                     <view class="eidt-btn" v-if="item.status === 3" @click.stop="jumpDesc(item)">完成并支付</view>
                  </view>
               </view>
@@ -118,7 +118,7 @@
                     <text v-else-if="item.type === 1">运货单-{{item.categoryName}}-{{item.carUnit}}</text>
                     <text v-else-if="item.type === 2">订餐单</text>
                     <view class="tips" v-if="item.acceptType === 1">系统派单</view>
                     <view class="tips1" v-if="item.acceptType === 0">手动接单</view>
                     <view class="tips1" v-if="item.acceptType === 0">自主抢单</view>
                  </view>
                  <view class="index-list-item-head-r" v-if="item.status === 2">已接单</view>
                  <view class="index-list-item-head-r" v-if="item.status === 3">进行中</view>
@@ -146,7 +146,7 @@
                     <image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image>
                     <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image>
                     <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image>
                     <text>{{item.location}}</text>
                     <text>{{address.location}}</text>
                  </view>
               </view>
               <template v-if="[0, 2].includes(item.type)">
@@ -206,19 +206,21 @@
      onShow(options) {
         this.typeViewId = 0
         if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
            console.log('已登陆')
            this.isLogin = true
            if (!this.isOnce) {
               this.commentStatus = ''
               this.orderList = []
               this.next = true
               this.page = 1
               this.getOrderList()
            }
         } else {
            this.isLogin = false
            console.log('未登陆')
         }
         if (this.userInfo && this.userInfo.useIdentity == 1) {
            this.typeViewId = 1
         } else {
            this.typeViewId = 0
         }
         if (!this.isOnce) {
            this.commentStatus = ''
            this.orderList = []
            this.next = true
            this.page = 1
            this.getOrderList()
         }
      },
      data() {
@@ -270,15 +272,23 @@
         this.getOrderList()
      },
      methods: {
         toLogin() {
            uni.navigateTo({
               url: '/pages/login/login'
            })
         },
         startJobs(orderId) {
            this.$u.api.begin({ orderId })
               .then(res => {
                  this.status = ''
                  this.commentStatus = ''
                  this.orderList = []
                  this.next = true
                  this.page = 1
                  this.getOrderList()
                  if (res.code === 200) {
                     this.status = ''
                     this.commentStatus = ''
                     this.orderList = []
                     this.next = true
                     this.page = 1
                     this.getOrderList()
                  }
               })
         },
         jumpDesc(item) {
@@ -310,11 +320,14 @@
            this.$u.api.cancelOrder({
               orderId: this.orderId
            }).then(res => {
               this.show = false
               this.orderList = []
               this.next = true
               this.page = 1
               this.getOrderList()
               if (res.code === 200) {
                  this.show = false
                  this.orderList = []
                  this.next = true
                  this.page = 1
                  this.getOrderList()
               }
            })
         },
         phoneCall(phoneNumber) {