zhangwei
2024-08-26 79745a1b12fa6d69edd3a353cb11b8ae02b8d4aa
src/pages/order/detail.vue
@@ -2,37 +2,40 @@
   <view class="">
      <scroll-view enable-flex="true">
         <view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30">
            <view class="content " v-for="(item,index) in list2" @click='toDetail' :key='item.id'>
            <view class="content ">
               <view class="bgblue c-p-18 chuany-flex chuany-justify-between chuany-font34 chuany-text-bold">
                  <text class=''>
                     {{item.time}}
                  </text>
                  <view class="chuany-flex chuany-flex-direction">
                     <text class=''>
                        {{$util.formatDate(detailItem.wordStartTime,true)}}
                     </text>
                     <text>{{$util.formatDate(detailItem.wordEndTime,true)}}</text>
                  </view>
                  <text>
                     招{{item.zhaodao}}/{{item.peoplenum}}人
                     招{{detailItem.worderCounted}}/{{detailItem.worderCount}}人
                  </text>
               </view>
               <view class="c-p-18 chuany-font44 chuany-text-bold">
                  {{item.name}}
                  {{detailItem.orderName}}
               </view>
               <view class="chuany-flex c-p-l-18">
               <!-- <view class="chuany-flex c-p-l-18">
                  <up-tag class='c-p-r-14' :text="item" plain v-for="(item,index) in item.tags" :key="index">
                  </up-tag>
               </view>
               </view> -->
               <view class="chuany-flex chuany-flex-direction">
                  <text class='c-p-18'>
                     要求:{{item.yaoqiu}}
                     要求:{{detailItem.demand}}
                  </text>
                  <text class='c-p-l-18 c-p-b-16'>
                     地址:{{item.adress}}
                     地址:{{detailItem.worderAddress}}
                  </text>
               </view>
               <view class='chuany-flex chuany-justify-between c-p-l-18 c-p-r-18'>
                  <view class="redcla">
                     <text class="chuany-font40 chuany-text-bold">
                        {{item.price}}
                        {{detailItem.workPrice}}
                     </text>
                     <text class='chuany-font20'>
                        元/小时
                        {{detailItem.workerType==0?'元/小时':'元/件'}}
                     </text>
                  </view>
                  <!-- <up-tag text="去抢活" type="warning" shape="circle"></up-tag> -->
@@ -40,20 +43,24 @@
               </view>
            </view>
         </view>
         <view class="coreshop-ff">
         <view class="coreshop-ff" v-if="detailItem.orderBidding&&detailItem.orderBidding.length>0">
            <up-list>
               <up-list-item>
                  <up-cell title="周先生">
               <up-list-item v-for="(item,index) in detailItem.orderBidding" :key="item.id" @click.stop="toWorkDetail">
                  <up-cell :title="item.workerName">
                     <template #icon>
                        <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg"
                        <up-avatar shape="square" size="35" :src="item.workerAvatar"
                           customStyle="margin: -3px 5px -3px 0"></up-avatar>
                     </template>
                     <template #right-icon>
                        <up-button class="button-layout__item" text="查看" size="mini" type="primary"></up-button>
                     <template #right-icon v-if="item.isSelected">
                        <up-button class="button-layout__item" text="查看" size="mini" type="primary" @click="toView"></up-button>
                     </template>
                     <template #right-icon v-else>
                        <up-button class="button-layout__item" text="确认" size="mini" type="success"
                           @click="selectBtn(item)"></up-button>
                     </template>
                  </up-cell>
               </up-list-item>
               <up-list-item>
               <!-- <up-list-item>
                  <up-cell title="李先生">
                     <template #icon>
                        <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/2.jpg"
@@ -74,6 +81,21 @@
                        <up-button class="button-layout__item" text="确认" size="mini" type="success"></up-button>
                     </template>
                  </up-cell>
               </up-list-item> -->
            </up-list>
         </view>
         <view class="coreshop-ff" v-else>
            <up-list>
               <up-list-item>
                  <up-cell title="暂无投递" class="u-cell__title-text_wu">
                     <!-- <template #icon>
                        <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg"
                           customStyle="margin: -3px 5px -3px 0"></up-avatar>
                     </template>
                     <template #right-icon>
                        <up-button class="button-layout__item" text="查看" size="mini" type="primary"></up-button>
                     </template> -->
                  </up-cell>
               </up-list-item>
            </up-list>
         </view>
@@ -84,33 +106,68 @@
<script setup>
   import {
      onLoad,
      onShow,
      onReachBottom
   } from "@dcloudio/uni-app";
   import {
      reactive,
      ref
      ref,
      getCurrentInstance
   } from 'vue';
   const {
      $upload,
      $api,
      $util,
      $db
   } = getCurrentInstance().appContext.config.globalProperties
   const detailItem = ref({})
   let orderid = ref('')
   onLoad((option) => {
      console.log(option,'========');
      let {
         orderid
      } = option
      getOrder(orderid)
      orderid.value = orderid
      // detailItem.value = JSON.parse($db.get('detailItem'))
   })
   let state = reactive({
      currentIdex: 0
   })
   const list2 = reactive([{
      id: 1,
      time: '明天 19:00-23:00',
      name: '临时工',
      tags: ['4小时', '可无经验', '手脚麻利'],
      adress: '武侯区桂溪街道4.0km',
      yaoqiu: '不限',
      price: 50,
      peoplenum: 3,
      zhaodao: 1
   }]);
   const click = () => {
   }
   const change = (e) => {
      state.currentIdex = e.index
   }
   const toDetail = (e) => {
   const toView = (e) => {
      uni.navigateTo({
         url: '/pages/detail/detail'
         url: 'pages/checkin/index'
      })
   }
   const toWorkDetail = (e) => {
      uni.navigateTo({
         url: '/pages/order/worker'
      })
   }
   const selectBtn = (item) => {
      $api.saveQueRen({orderBiddingId:item.id}).then(res => {
         if(res.code==1){
            $util.showToast({
               title: "确认成功!",
               icon: "success"
            })
            getOrder(orderid.value)
         }
      })
   }
   const getOrder=(orderid) =>{
      $api.getOrder(orderid).then(res => {
         if (res.code == 1) {
            detailItem.value = res.data
         }
      })
   }
</script>
@@ -139,4 +196,8 @@
   .redcla {
      color: #f05348;
   }
   .u-cell__title-text_wu {
      text-align: center;
   }
</style>