applyList.vue 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="page-container">
  3. <vb-list :query-fun="apis.amActivity.activityApi.listApply" :query-params="queryParams" :dataLength="10" :height="listHeight">
  4. <template #item="{ item }">
  5. <vb-cell-group>
  6. <view class="d-fcv">
  7. <view class="px-15 py-10" @click="onGoAmDetail(item)">
  8. <!-- <image class="br-round w-50px h-50px r-40px" :src="checkUrl(item.avatar)" mode="aspectFill"></image> -->
  9. <vb-avatar :src="checkUrl(item.avatar)" :size="50" :name="item.name" />
  10. </view>
  11. <view class="flex-column justify-around">
  12. <view class="my-5">
  13. {{ item.name }}
  14. <text
  15. v-if="item.auditStatus == '0'"
  16. class="px-5 py-2 mx-5 bg-gray-3 border border-1 border-vb text-vb br-10 fs-10"
  17. >
  18. 待审核
  19. </text>
  20. <text v-else-if="item.auditStatus == '1'" class="px-5 py-2 mx-5 bg-vb text-white br-10 fs-10">
  21. 已通过
  22. </text>
  23. <text v-else-if="item.auditStatus == '2'" class="px-5 py-2 mx-5 bg-danger text-white br-10 fs-10">
  24. 已拒绝
  25. </text>
  26. <template class="ms-20" v-if="activity.needCost">
  27. <text v-if="isCost(item)" class="px-5 py-2 mx-5 bg-success text-white br-10 fs-10">
  28. 已付 {{ Number(item.cost) }}
  29. </text>
  30. <text v-else class="px-5 py-2 mx-5 bg-gray-3 border border-1 border-vb text-vb br-10 fs-10">
  31. 未付费
  32. </text>
  33. </template>
  34. </view>
  35. <view class="my-5 text-gray-6">{{ item.createTime }}</view>
  36. </view>
  37. </view>
  38. </vb-cell-group>
  39. </template>
  40. </vb-list>
  41. </view>
  42. </template>
  43. <script lang="ts" setup>
  44. import dayjs from "dayjs"
  45. import apis from "@/api"
  46. import route from "@/route"
  47. import configs from "@/core/config"
  48. import { checkUrl } from "@/core/utils"
  49. import appStore from "@/stores"
  50. const wHeight = uni.getWindowInfo().windowHeight
  51. const topHeight = ref(25)
  52. const listHeight = computed(() => {
  53. return wHeight - topHeight.value - 15
  54. })
  55. const params = route.getRouteParams("activityDetail")
  56. const activityId = params.id
  57. const activity = ref<any>({
  58. needCost: "0",
  59. })
  60. const queryParams = ref({
  61. activityId: activityId,
  62. orderByColumn: "createTime",
  63. isAsc : "desc"
  64. })
  65. const formatAvatarUrl = (item: any) => {
  66. return item.avatar ? configs.baseUrl + item.avatar : "/static/images/avatars/empty.png"
  67. }
  68. const isCost = function (item: any) {
  69. return item.costStatus == 1
  70. }
  71. function onGoAmDetail(item: any) {
  72. if (!appStore.amProfileStore.notDemo()) {
  73. return
  74. }
  75. route.navigate("alumnusDetail", { id: item.amId })
  76. }
  77. function loadActivity() {
  78. if (activity.value) {
  79. apis.amActivity.activityApi.getActivity(activityId).then((res) => {
  80. if (res) {
  81. activity.value = res
  82. }
  83. })
  84. }
  85. }
  86. function init() {
  87. loadActivity()
  88. }
  89. onMounted(init)
  90. </script>
  91. <style scoped></style>