details.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <CommonTopBanner title="共编村史">
  3. <FlexCol v-if="isJoined || authStore.isAdmin || isManagement" :padding="30" :gap="20">
  4. <Image
  5. :src="bannerLoader.content.value?.[0].image"
  6. mode="widthFix"
  7. radius="radius.md"
  8. :width="690"
  9. />
  10. <FlexRow justify="space-between" align="center" :gap="10" backgroundColor="white" :padding="20" radius="radius.md">
  11. <FlexRow>
  12. <Text :fontSize="30" :text="isJoined ? '已认领:' : '未认领:'" />
  13. <Width :width="20" />
  14. <Text :fontSize="30" color="primary" :text="decodeURIComponent(querys.name)" />
  15. </FlexRow>
  16. <FlexRow align="center">
  17. <Text :fontSize="30" color="text.content" :text="`文化积分: `" />
  18. <Width :width="20" />
  19. <Text :fontSize="40" fontFamily="SongtiSCBlack" color="primary" :text="volunteerInfo?.points" />
  20. <Width :width="20" />
  21. <Text :fontSize="40" fontFamily="SongtiSCBlack" color="primary" :text="`Lv.${volunteerInfo?.level}`" />
  22. <Width :width="20" />
  23. <Touchable direction="row" align="center" :gap="10" @click="navTo('/pages/dig/about/point')">
  24. <Icon icon="help-filling" color="primary" :size="40" />
  25. </Touchable>
  26. </FlexRow>
  27. </FlexRow>
  28. <BoxMid :padding="24">
  29. <Touchable
  30. direction="column"
  31. touchable
  32. flex="1"
  33. padding="padding.md"
  34. align="center"
  35. @click="goCollect"
  36. >
  37. <Icon icon="edit-filling" color="primary" :size="100" />
  38. <Height :height="20" />
  39. <Text :fontSize="34">写随手记</Text>
  40. <Text :fontSize="22" color="gray">写随手记,记录下村社文化发现和思考,自动分类</Text>
  41. <Text :fontSize="22" color="gray">也可点击下方进入指定的分类采集信息</Text>
  42. </Touchable>
  43. </BoxMid>
  44. <FlexCol :gap="20">
  45. <Alert
  46. v-if="!authStore.isAdmin && isEmpty"
  47. type="warning"
  48. message="您当前没有可完成的任务"
  49. description="请联系管理员认领可采编栏目"
  50. />
  51. <CollectModuleList
  52. :villageId="querys.villageId"
  53. :villageVolunteerId="querys.villageVolunteerId"
  54. :taskName="''"
  55. :taskTitle="''"
  56. :taskPid="0"
  57. />
  58. </FlexCol>
  59. <XBarSpace />
  60. </FlexCol>
  61. <NotVolTip v-else @goJoin="goJoin">
  62. </NotVolTip>
  63. </CommonTopBanner>
  64. </template>
  65. <script setup lang="ts">
  66. import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
  67. import { useAuthStore } from '@/store/auth';
  68. import { useCollectStore } from '@/store/collect';
  69. import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
  70. import { useUserTools } from '@/common/composeabe/UserTools';
  71. import { onMounted, ref } from 'vue';
  72. import { back, navTo } from '@/components/utils/PageAction';
  73. import BannerApi from '@/api/system/Banner';
  74. import Icon from '@/components/basic/Icon.vue';
  75. import Text from '@/components/basic/Text.vue';
  76. import Touchable from '@/components/feedback/Touchable.vue';
  77. import Height from '@/components/layout/space/Height.vue';
  78. import FlexCol from '@/components/layout/FlexCol.vue';
  79. import Image from '@/components/basic/Image.vue';
  80. import FlexRow from '@/components/layout/FlexRow.vue';
  81. import CollectModuleList from './components/CollectModuleList.vue';
  82. import XBarSpace from '@/components/layout/space/XBarSpace.vue';
  83. import Width from '@/components/layout/space/Width.vue';
  84. import Alert from '@/components/feedback/Alert.vue';
  85. import Result from '@/components/feedback/Result.vue';
  86. import Button from '@/components/basic/Button.vue';
  87. import { CollectableModulesIdMap } from './forms/forms';
  88. import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
  89. import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
  90. import NotVolTip from '../home/components/NotVolTip.vue';
  91. import BoxMid from '@/common/components/box/BoxMid.vue';
  92. import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
  93. const { querys } = useLoadQuerys({
  94. name: '',
  95. villageId: 0,
  96. villageVolunteerId: 0,
  97. });
  98. const authStore = useAuthStore();
  99. const { canCollect, isEmpty } = useCollectStore();
  100. const { getIsJoinedVillage, getIsManagement, getIsVolunteer, volunteerInfo } = useUserTools();
  101. const { goForm } = useTaskEntryForm();
  102. const isJoined = ref(false);
  103. const isManagement = ref(false);
  104. const bannerLoader = useSimpleDataLoader(async () => {
  105. return (await BannerApi.getBannerList({
  106. keywords: '亮乡源大众版挖掘内页',
  107. })).map(p => ({
  108. image: p.image,
  109. url: p.url,
  110. }));
  111. });
  112. function goCollect() {
  113. /* if (!canCollect('collect')) {
  114. uni.showToast({
  115. title: '您当前没有可采编随手记的权限',
  116. icon: 'none',
  117. duration: 2000
  118. });
  119. return;
  120. } */
  121. goForm(CollectableModulesIdMap['collect'], 1, '随手记')
  122. }
  123. function goJoin() {
  124. navTo('/pages/home/light/submit-volunteer', {
  125. villageId: querys.value.villageId,
  126. });
  127. }
  128. async function loadVolunteerInfo() {
  129. await getIsVolunteer();
  130. isManagement.value = await getIsManagement(querys.value.villageId);
  131. isJoined.value = await getIsJoinedVillage(querys.value.villageId);
  132. }
  133. onMounted(async () => {
  134. await loadVolunteerInfo();
  135. });
  136. defineExpose({
  137. onPageBack(name: string, param: any) {
  138. if (name === 'registerDone')
  139. loadVolunteerInfo();
  140. }
  141. })
  142. </script>