wlzboy
2026-03-24 6676a35122fd9c97d1b1679c211bc8a9b97f08f2
app/pages/task/create.vue
@@ -26,18 +26,20 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {
      taskCategories: [
        {
          type: 'emergency',
          name: '急救转运',
          name: '转运任务',
          icon: 'hospital',
          color: '#E54D42',
          description: '紧急医疗转运任务',
          taskType: 'EMERGENCY_TRANSFER',
          page: '/pages/task/create-emergency'
          page: '/pagesTask/create-emergency'
        },
        {
          type: 'normal',
@@ -46,7 +48,7 @@
          color: '#007AFF',
          description: '设备维修、保养等日常任务',
          taskType: 'MAINTENANCE',
          page: '/pages/task/create-normal'
          page: '/pagesTask/create-normal'
        },
        {
          type: 'normal',
@@ -55,23 +57,34 @@
          color: '#1AAD19',
          description: '车辆加油等任务',
          taskType: 'FUEL',
          page: '/pages/task/create-normal'
          page: '/pagesTask/create-normal'
        },
        {
          type: 'welfare',
          name: '福祉车',
          icon: 'car',
          color: '#F37B1D',
          description: '老年人、残疾人等特殊群体用车服务',
          taskType: 'WELFARE',
          page: '/pages/task/create-welfare'
        }
        // {
        //   type: 'welfare',
        //   name: '福祉车',
        //   icon: 'car',
        //   color: '#F37B1D',
        //   description: '老年人、残疾人等特殊群体用车服务',
        //   taskType: 'WELFARE',
        //   page: '/pagesTask/create-welfare'
        // }
      ]
    }
  },
  computed: {
    ...mapState({
      canCreateTask: state => state.user.canCreateTask
    })
  },
  methods: {
    selectTaskCategory(category) {
      // 检查是否有创建任务的权限
      if (this.canCreateTask !== '1') {
        this.$modal.msgError('您没有权限创建任务')
        return
      }
      // 跳转到对应的任务创建页面
      uni.navigateTo({
        url: `${category.page}?categoryName=${category.name}&categoryType=${category.type}&taskType=${category.taskType}`