now-list-page.vue 2.67 KB
<template>
  <view class="page-wrap">
    <!-- 顶部提示栏 -->
    <view class="tip-bar">
      一个任务可提交多次上报记录,每一次作业需如实上报。
    </view>

    <!-- 上报记录列表 -->
    <view class="list-wrap" v-if="reportList.length > 0">
      <view class="report-item" v-for="(item, index) in reportList" :key="index">
        <view class="item-title">【第{{ item.no }}次上报】{{ item.taskName }}</view>
       
        <view class="item-row item-row-bottom">
          <view class="item-time">提交时间:{{ item.submitTime }}</view>
          <view class="look-btn" @click="handleView(item)">查看</view>
        </view>
      </view>
    </view>

    <!-- 暂无数据 -->
    <view class="empty-wrap" v-else>
      <empty-view text="暂无数据"></empty-view>
    </view>

    <!-- 底部固定按钮 -->
    <view class="fixed-bottom-btn-wrap">
      <up-button type="primary" size="large" block @click="handleAddReport">上报本次记录</up-button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'

// 上报记录数据
const reportList = ref([
  {
    no:3,
    taskName:'德胜门东大街月季补植',
    varityName:'果汁阳台月季',
    submitTime:'2026-06-22 14:34:33'
  },
  {
    no:2,
    taskName:'德胜门东大街月季补植',
    varityName:'蓝色风暴月季',
    submitTime:'2026-06-21 10:34:33'
  },
  {
    no:1,
    taskName:'德胜门东大街月季补植',
    varityName:'金丝雀月季',
    submitTime:'2026-06-20 10:34:33'
  }
])

// 查看上报详情
const handleView = (item) => {
  console.log('查看详情', item)
  uni.navigateTo({
    url: `/pages-sub/daily/maintain-manage/finish-plan-detail`
  })
}

// 新增上报记录
const handleAddReport = () => {
  console.log('上报本次记录')
     uni.navigateTo({
    url: `/pages-sub/daily/maintain-manage/add-record`
  })
}
</script>

<style scoped lang="scss">
.page-wrap {
  min-height: 100vh;
  padding-bottom: 120rpx; // 给底部按钮预留空间
  background: #ffffff;
}
// 顶部黄色提示条
.tip-bar {
  background-color: #f9e0a2;
  color: #6b4b00;
  font-size: 28rpx;
  padding:24rpx 20rpx;
  line-height:1.5;
}

.list-wrap {
  padding: 0;
}
.report-item {
  padding:30rpx 24rpx;
  border-bottom:1rpx solid #eee;
  .item-title {
    font-size:32rpx;
    color:#222;
    font-weight:500;
    margin-bottom:20rpx;
  }
  .item-row {
    font-size:28rpx;
    color:#555;
    margin-bottom:12rpx;
  }
  .item-row-bottom {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:0;
  }
  .look-btn {
    font-size:28rpx;
    color:#1989fa;
  }
}
.empty-wrap {
  padding-top: 120rpx;
}

</style>