creation_task.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="total-page page-box task-bg">
  3. <Nav :title="'创建任务'" :genre="1" is_fixed></Nav>
  4. <TaskImgTab @setProductId="setProductId" :list-type="1"></TaskImgTab>
  5. <view class="sys-background-fff m-20 p-20 r-20">
  6. <view class="creation_item row-justify-sb center line-60 sys-bg-BFD2CC r-20 p-30 m-b20"
  7. v-for="(item,index) in creationList" :key="index" @click="onCeationTask(item)">
  8. <view class="row-c">
  9. <image class="wh-60 m-r20" :src="item.product_icon" mode="aspectFill"></image>
  10. <text class="size-28 text-color-12 sys-weight-400">{{item.product_name}}</text>
  11. </view>
  12. <image class="wh-45" src="/static/img/task/task-arrows.png" mode="aspectFill"></image>
  13. </view>
  14. </view>
  15. <en-blank v-if="creationList.length<=0"></en-blank>
  16. </view>
  17. </template>
  18. <script>
  19. import TaskImgTab from "@/common/task/task_ima_tab.vue"
  20. import {getTaskType} from "@/api/task";
  21. import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
  22. export default {
  23. components: {
  24. EnBlank,
  25. TaskImgTab,
  26. },
  27. data() {
  28. return {
  29. typeId:2,
  30. creationList: [ ]
  31. }
  32. },
  33. mounted() {
  34. this.getTaskType()
  35. },
  36. methods: {
  37. setProductId(typeId){
  38. if(this.typeId!==typeId){
  39. this.typeId=typeId
  40. this.getTaskType()
  41. }
  42. },
  43. getTaskType(){
  44. getTaskType({'productType':this.typeId}).then((res)=>{
  45. if(res.code===1){
  46. this.creationList=res.data;
  47. }
  48. })
  49. },
  50. onCeationTask(item) {
  51. uni.navigateTo({
  52. url: `/page_task/information/information?title=${item.product_name}&productId=${item.id}`
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .creation_item:last-child {
  60. margin-bottom: 0;
  61. }
  62. </style>