wlzboy
5 天以前 3bbd80a63ac7728ac01b641a48a26befcb171a0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
  <scroll-view class="create-task-container" scroll-y="true">
    <view class="task-category-container">
      <view class="header">
        <view class="title">选择任务类型</view>
        <view class="subtitle">请选择您要创建的任务类型</view>
      </view>
 
      <view class="category-list">
        <view class="category-item" v-for="(category, index) in taskCategories" :key="index"
          @click="selectTaskCategory(category)">
          <view class="icon">
            <uni-icons :type="category.icon" size="30" :color="category.color"></uni-icons>
          </view>
          <view class="info">
            <view class="name">{{ category.name }}</view>
            <view class="desc">{{ category.description }}</view>
          </view>
          <view class="arrow">
            <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
          </view>
        </view>
      </view>
    </view>
  </scroll-view>
</template>
 
<script>
export default {
  data() {
    return {
      taskCategories: [
        {
          type: 'emergency',
          name: '转运任务',
          icon: 'hospital',
          color: '#E54D42',
          description: '紧急医疗转运任务',
          taskType: 'EMERGENCY_TRANSFER',
          page: '/pagesTask/create-emergency'
        },
        {
          type: 'normal',
          name: '维修保养',
          icon: 'repair',
          color: '#007AFF',
          description: '设备维修、保养等日常任务',
          taskType: 'MAINTENANCE',
          page: '/pagesTask/create-normal'
        },
        {
          type: 'normal',
          name: '加油',
          icon: 'fuel',
          color: '#1AAD19',
          description: '车辆加油等任务',
          taskType: 'FUEL',
          page: '/pagesTask/create-normal'
        },
 
        {
          type: 'welfare',
          name: '福祉车',
          icon: 'car',
          color: '#F37B1D',
          description: '老年人、残疾人等特殊群体用车服务',
          taskType: 'WELFARE',
          page: '/pagesTask/create-welfare'
        }
      ]
    }
  },
  methods: {
    selectTaskCategory(category) {
      // 跳转到对应的任务创建页面
      uni.navigateTo({
        url: `${category.page}?categoryName=${category.name}&categoryType=${category.type}&taskType=${category.taskType}`
      })
    }
  }
}
</script>
 
<style lang="scss">
.create-task-container {
  padding: 20rpx;
  background-color: #f5f5f5;
  min-height: 100vh;
 
  .task-category-container {
    .header {
      text-align: center;
      padding: 40rpx 0;
 
      .title {
        font-size: 40rpx;
        font-weight: bold;
        color: #333;
        margin-bottom: 20rpx;
      }
 
      .subtitle {
        font-size: 28rpx;
        color: #666;
      }
    }
 
    .category-list {
      .category-item {
        display: flex;
        align-items: center;
        background-color: white;
        border-radius: 15rpx;
        padding: 30rpx;
        margin-bottom: 20rpx;
        box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
 
        .icon {
          margin-right: 20rpx;
        }
 
        .info {
          flex: 1;
 
          .name {
            font-size: 32rpx;
            font-weight: bold;
            margin-bottom: 10rpx;
          }
 
          .desc {
            font-size: 26rpx;
            color: #666;
          }
        }
 
        .arrow {
          margin-left: 20rpx;
        }
      }
    }
  }
}
</style>