details.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <CommonTopBanner title="共编村史">
  3. <FlexCol v-if="isJoined" :padding="30" :gap="20">
  4. <Image
  5. src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_1.jpg"
  6. mode="widthFix"
  7. radius="radius.md"
  8. :width="690"
  9. />
  10. <FlexRow align="center" :gap="10" backgroundColor="white" :padding="20" radius="radius.md">
  11. <FlexRow flexBasis="50%">
  12. <Text :fontSize="30" text="已点亮:" />
  13. <Width :width="20" />
  14. <Text :fontSize="30" color="primary" :text="decodeURIComponent(querys.name)" />
  15. </FlexRow>
  16. <FlexRow flexBasis="50%" align="center">
  17. <Text :fontSize="30" color="text.content" :text="`文化积分: `" />
  18. <Text :fontSize="40" fontFamily="SongtiSCBlack" color="primary" :text="querys.points" />
  19. <Width :width="20" />
  20. <Text :fontSize="40" fontFamily="SongtiSCBlack" color="primary" :text="`Lv.${querys.level}`" />
  21. </FlexRow>
  22. </FlexRow>
  23. <BackgroundBox
  24. backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxMid.png"
  25. :backgroundCutBorder="32"
  26. :backgroundCutBorderSize="36"
  27. :padding="24"
  28. >
  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. </BackgroundBox>
  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. <FlexCol v-else padding="padding.md">
  62. <FlexCol
  63. center
  64. gap="gap.lg"
  65. border="primary"
  66. backgroundColor="background.tertiary"
  67. radius="radius.md"
  68. padding="padding.md"
  69. >
  70. <Image
  71. src="https://xy.wenlvti.net/app_static/images/village/PlaceholderVolunteer.png"
  72. mode="widthFix"
  73. :width="200"
  74. :height="200"
  75. />
  76. <Text>您还不是当前村社的志愿者</Text>
  77. <Text>欢迎注册,加入志愿者队伍,点亮村落</Text>
  78. <FlexRow gap="gap.md">
  79. <Button type="primary" @click="goJoin">去点亮村落</Button>
  80. <Button @click="back()">返回</Button>
  81. </FlexRow>
  82. </FlexCol>
  83. </FlexCol>
  84. </CommonTopBanner>
  85. </template>
  86. <script setup lang="ts">
  87. import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
  88. import { useAuthStore } from '@/store/auth';
  89. import { useCollectStore } from '@/store/collect';
  90. import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
  91. import { useUserTools } from '@/common/composeabe/UserTools';
  92. import { onMounted, ref } from 'vue';
  93. import { back, navTo } from '@/components/utils/PageAction';
  94. import Icon from '@/components/basic/Icon.vue';
  95. import Text from '@/components/basic/Text.vue';
  96. import Touchable from '@/components/feedback/Touchable.vue';
  97. import Height from '@/components/layout/space/Height.vue';
  98. import FlexCol from '@/components/layout/FlexCol.vue';
  99. import Image from '@/components/basic/Image.vue';
  100. import FlexRow from '@/components/layout/FlexRow.vue';
  101. import CollectModuleList from './components/CollectModuleList.vue';
  102. import XBarSpace from '@/components/layout/space/XBarSpace.vue';
  103. import Width from '@/components/layout/space/Width.vue';
  104. import Alert from '@/components/feedback/Alert.vue';
  105. import Result from '@/components/feedback/Result.vue';
  106. import Button from '@/components/basic/Button.vue';
  107. import { CollectableModulesIdMap } from './forms/forms';
  108. import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
  109. import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
  110. const { querys } = useLoadQuerys({
  111. name: '',
  112. points: 0,
  113. level: 0,
  114. villageId: 0,
  115. villageVolunteerId: 0,
  116. });
  117. const authStore = useAuthStore();
  118. const { canCollect, isEmpty } = useCollectStore();
  119. const { getIsJoinedVillage } = useUserTools();
  120. const { goForm } = useTaskEntryForm();
  121. const isJoined = ref(false);
  122. function goCollect() {
  123. /* if (!canCollect('collect')) {
  124. uni.showToast({
  125. title: '您当前没有可采编随手记的权限',
  126. icon: 'none',
  127. duration: 2000
  128. });
  129. return;
  130. } */
  131. goForm(CollectableModulesIdMap['collect'], 1, '随手记')
  132. }
  133. function goJoin() {
  134. navTo('/pages/home/light/submit', {
  135. villageId: querys.value.villageId,
  136. });
  137. }
  138. onMounted(async () => {
  139. isJoined.value = await getIsJoinedVillage(querys.value.villageId);
  140. });
  141. </script>