-
zhangwei
2024-10-09 91be10dcd43367aae04df6330e33d229c216a72e
src/pages/index/index.vue
@@ -1,5 +1,6 @@
<template>
   <view class="full-page" scroll-y   using-sticky>
      <view class="">
      <up-sticky bgColor="#fff">
         <view class="coreshop-ff c-p-10">
            <!-- <up-search placeholder="请点击选择日期" @clear='clear' @clickIcon='clickTime' @custom='search'
@@ -8,10 +9,10 @@
               @search='search'></up-search>
         </view>
      </up-sticky>
      <view v-if="listO.orderList">
         <view v-if="listO.orderList" class="full-page-content">
         <view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30 "
            v-if="listO.orderList.length>0">
            <view class="content c-p-b-18" v-for="(item,index) in listO.orderList" @click='toDetail(item.id)'
               <view class="content c-p-b-18" v-for="(item,index) in listO.orderList" @click='toDetail(item)'
               :key='item.id'>
               <view
                  class="bgblue c-p-l-18 c-p-r-18  c-p-b-10 c-p-t-10 chuany-flex chuany-justify-between chuany-font30">
@@ -60,7 +61,8 @@
                  <view class="redcla">
                     <view class="">
                        <text class="chuany-font40">
                           {{item.workPrice}}<template v-if="item.workPriceMax">~{{item.workPriceMax}}</template>
                              {{item.workPrice}}<template
                                 v-if="item.workPriceMax">~{{item.workPriceMax}}</template>
                        </text>
                        <text class='chuany-font20'>
                           {{item.workerType==0?'元/小时':'元/件'}}
@@ -73,7 +75,8 @@
                        {{item.workerType==0?'元/小时':'元/件'}}
                     </text> -->
                  </view>
                  <up-tag text="去抢活" v-if="identity !== 'enterprise'" type="warning" shape="circle"
                     <up-tag :text="item.isSelectedName?item.isSelectedName:'去抢活'"
                        v-if="identity !== 'enterprise'" type="warning" shape="circle"
                     @click.stop='deliver(item.id)'></up-tag>
                  <!-- <up-tag text="去抢活" type="warning" shape="circle"></up-tag> -->
               </view>
@@ -91,6 +94,7 @@
      </view>
      <fui-date-picker range :show="datePickerShow" type="5" @change="changePicker"
         @cancel="cancel"></fui-date-picker>
      </view>
   </view>
</template>
@@ -160,6 +164,9 @@
   onShow(() => {
      identity.value = $db.get('identity')
      tokenVal = $db.get('userToken')
      state.pageIndex = 1
      state.pageSize = 20
      loadStatus.value = 'loadmore'
      console.log(identity.value);
      PostListPage()
   })
@@ -237,17 +244,20 @@
   const change = (e) => {
      state.currentIdex = e.index
   }
   const toDetail = (val) => {
   const toDetail = (item) => {
      if(!tokenVal){
         return false
      }
      // if (item.isSelectedName && identity.value !== 'enterprise') {
      //    return false
      // }
      if (identity.value !== 'enterprise') {
         uni.navigateTo({
            url: `/pages/detail/detail?orderid=${val}`
            url: `/pages/detail/detail?orderid=${item.id}`
         })
      } else {
         uni.navigateTo({
            url: `/pages/order/detail?orderid=${val}`
            url: `/pages/order/detail?orderid=${item.id}`
         });
      }
   }