| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <view class="my-task-container">
- <!-- 顶部导航栏 -->
- <view class="nav-header">
- <view class="nav-left" @click="goBack">
- <u-icon name="arrow-left" size="20" color="#333"></u-icon>
- </view>
- <text class="nav-title">我的任务</text>
- <view class="nav-right"></view>
- </view>
- <!-- 选项卡区域 -->
- <view class="tabs-wrap">
- <u-tabs
- :list="tabList"
- :current="currentTab"
- @change="tabChange"
- lineWidth="40rpx"
- lineHeight="6rpx"
- lineColor="#FF5A1F"
- :inactiveStyle="{
- fontSize: '30rpx',
- color: '#999',
- lineHeight: '80rpx',
- }"
- :activeStyle="{
- fontWeight: 600,
- fontSize: '32rpx',
- color: '#333',
- lineHeight: '80rpx',
- }"
- itemStyle="flex: 1; height: 88rpx;"
- :scrollable="false"
- ></u-tabs>
- </view>
- <!-- 任务列表区域 -->
- <scroll-view scroll-y class="task-list-scroll" @scrolltolower="loadMore">
- <view class="task-list">
- <!-- 任务项 1 -->
- <view class="task-item">
- <image class="task-img" src="@/static/image/points/icon_cash_task.png" mode="aspectFill"></image>
- <view class="task-info">
- <view class="task-title">新人必做任务易上手</view>
- <view class="task-time">03-12 15:38前提交</view>
- <view class="task-bottom">
- <view class="status-badge passed">已通过</view>
- <view class="task-reward-wrap">
- <text class="task-reward">+2.35</text>
- <text class="task-reward-unit">元</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 任务项 2 -->
- <view class="task-item">
- <image class="task-img" src="@/static/image/points/icon_cash_task.png" mode="aspectFill"></image>
- <view class="task-info">
- <view class="task-title">新人必做任务易上手</view>
- <view class="task-time">03-12 15:38前提交</view>
- <view class="task-bottom">
- <view class="status-badge passed">已通过</view>
- <view class="task-reward-wrap">
- <text class="task-reward">+2.35</text>
- <text class="task-reward-unit">元</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 任务项 3 -->
- <view class="task-item">
- <image class="task-img" src="@/static/image/points/icon_cash_task.png" mode="aspectFill"></image>
- <view class="task-info">
- <view class="task-title">新人必做任务易上手</view>
- <view class="task-time">03-12 15:38前提交</view>
- <view class="task-bottom">
- <view class="status-badge passed">已通过</view>
- <view class="task-reward-wrap">
- <text class="task-reward">+2.35</text>
- <text class="task-reward-unit">元</text>
- </view>
- </view>
- </view>
- </view>
-
- <!-- 底部提示 -->
- <view class="loading-more">没有更多了</view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- currentTab: 1, // 默认选中"已通过"
- tabList: [
- { name: '进行中' },
- { name: '已通过' },
- { name: '未通过' }
- ]
- };
- },
- methods: {
- goBack() {
- uni.navigateBack();
- },
- tabChange(item) {
- this.currentTab = item.index;
- // TODO: 切换标签时重新加载对应状态的数据
- },
- loadMore() {
- console.log('触底加载更多数据...');
- // TODO: 实现上拉加载逻辑
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .my-task-container {
- height: 100vh;
- background-color: #F7F8FA; /* 背景色偏淡蓝 */
- display: flex;
- flex-direction: column;
- }
- /* 顶部导航栏固定 */
- .nav-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 80rpx 30rpx 20rpx; /* 适配状态栏高度 */
- background-color: transparent; /* 背景透明融入全局 */
- flex-shrink: 0;
- background-color: #fff;
- }
- .nav-left, .nav-right {
- width: 60rpx;
- display: flex;
- align-items: center;
- }
- .nav-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- flex: 1;
- text-align: center;
- }
- /* Tabs 区域固定 */
- .tabs-wrap {
- background-color: transparent;
- flex-shrink: 0;
- padding: 0 40rpx;
- margin-bottom: 20rpx;
- background-color: #fff;
- }
- /* 列表滚动区域占满剩余空间 */
- .task-list-scroll {
- flex: 1;
- height: 0; /* 配合 flex:1 实现滚动 */
- }
- .task-list {
- padding: 0 30rpx 40rpx;
- }
- .task-item {
- display: flex;
- padding: 30rpx;
- background-color: #fff;
- border-radius: 20rpx;
- margin-bottom: 24rpx;
- box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.02);
- }
- .task-img {
- width: 160rpx;
- height: 160rpx;
- border-radius: 20rpx;
- flex-shrink: 0;
- background-color: #f5f5f5; /* 占位色 */
- }
- .task-info {
- flex: 1;
- margin-left: 24rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .task-title {
- font-size: 32rpx;
- color: #333;
- font-weight: bold;
- line-height: 1.4;
- margin-bottom: 8rpx;
- }
- .task-time {
- font-size: 24rpx;
- color: #999;
- margin-bottom: auto;
- }
- .task-bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 16rpx;
- }
- .status-badge {
- font-size: 22rpx;
- padding: 4rpx 16rpx;
- border-radius: 6rpx;
- }
- .status-badge.passed {
- color: #27C282;
- background-color: #E2F6EC;
- }
- .task-reward-wrap {
- display: flex;
- align-items: baseline;
- }
- .task-reward {
- font-size: 32rpx;
- color: #FF5A1F;
- font-weight: bold;
- }
- .task-reward-unit {
- font-size: 24rpx;
- color: #FF5A1F;
- margin-left: 4rpx;
- }
- .loading-more {
- text-align: center;
- color: #999;
- font-size: 24rpx;
- padding: 20rpx 0;
- }
- </style>
|