details.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <FlexCol v-if="isJoined" :padding="30" :gap="20">
  3. <Image
  4. src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_1.jpg"
  5. mode="widthFix"
  6. radius="radius.md"
  7. :width="690"
  8. />
  9. <FlexRow align="center" :gap="10" backgroundColor="white" :padding="20" radius="radius.md">
  10. <FlexRow flexBasis="50%">
  11. <Text :fontSize="30" text="已点亮:" />
  12. <Width :width="20" />
  13. <Text :fontSize="30" color="primary" :text="decodeURIComponent(querys.name)" />
  14. </FlexRow>
  15. <FlexRow flexBasis="50%" align="center">
  16. <Text :fontSize="30" color="text.content" :text="`文化积分: `" />
  17. <Text :fontSize="40" fontFamily="Rockwell" color="primary" :text="querys.points" />
  18. <Width :width="20" />
  19. <Text :fontSize="40" fontFamily="Rockwell" color="primary" :text="`Lv.${querys.level}`" />
  20. </FlexRow>
  21. </FlexRow>
  22. <Touchable
  23. direction="column"
  24. touchable
  25. radius="radius.md"
  26. :padding="30"
  27. align="center"
  28. backgroundColor="background.primary"
  29. @click="goCollect"
  30. >
  31. <Icon icon="edit-filling" color="primary" :size="100" />
  32. <Height :height="20" />
  33. <Text :fontSize="34">写随手记</Text>
  34. <Text :fontSize="22" color="gray">写随手记,记录下村社文化发现和思考,自动分类</Text>
  35. <Text :fontSize="22" color="gray">也可点击下方进入指定的分类采集信息</Text>
  36. </Touchable>
  37. <FlexCol :gap="20">
  38. <Alert
  39. v-if="!authStore.isAdmin && isEmpty"
  40. type="warning"
  41. message="您当前没有可完成的任务"
  42. description="请联系管理员认领可采编栏目"
  43. />
  44. <CollectModuleList
  45. :villageId="querys.villageId"
  46. :villageVolunteerId="querys.villageVolunteerId"
  47. :taskName="''"
  48. :taskTitle="''"
  49. :taskPid="0"
  50. />
  51. </FlexCol>
  52. <XBarSpace />
  53. </FlexCol>
  54. <FlexCol v-else padding="padding.md">
  55. <FlexCol
  56. center
  57. gap="gap.lg"
  58. border="primary"
  59. backgroundColor="background.tertiary"
  60. radius="radius.md"
  61. padding="padding.md"
  62. >
  63. <Image
  64. src="https://xy.wenlvti.net/app_static/images/village/PlaceholderVolunteer.png"
  65. mode="widthFix"
  66. :width="200"
  67. :height="200"
  68. />
  69. <Text>您还不是当前村社的志愿者</Text>
  70. <Text>欢迎注册,加入志愿者队伍,点亮村落</Text>
  71. <FlexRow gap="gap.md">
  72. <Button type="primary" @click="goJoin">去点亮村落</Button>
  73. <Button @click="back()">返回</Button>
  74. </FlexRow>
  75. </FlexCol>
  76. </FlexCol>
  77. </template>
  78. <script setup lang="ts">
  79. import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
  80. import { useAuthStore } from '@/store/auth';
  81. import { useCollectStore } from '@/store/collect';
  82. import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
  83. import { useUserTools } from '@/common/composeabe/UserTools';
  84. import { onMounted, ref } from 'vue';
  85. import { back, navTo } from '@/components/utils/PageAction';
  86. import Icon from '@/components/basic/Icon.vue';
  87. import Text from '@/components/basic/Text.vue';
  88. import Touchable from '@/components/feedback/Touchable.vue';
  89. import Height from '@/components/layout/space/Height.vue';
  90. import FlexCol from '@/components/layout/FlexCol.vue';
  91. import Image from '@/components/basic/Image.vue';
  92. import FlexRow from '@/components/layout/FlexRow.vue';
  93. import CollectModuleList from './components/CollectModuleList.vue';
  94. import XBarSpace from '@/components/layout/space/XBarSpace.vue';
  95. import Width from '@/components/layout/space/Width.vue';
  96. import Alert from '@/components/feedback/Alert.vue';
  97. import Result from '@/components/feedback/Result.vue';
  98. import Button from '@/components/basic/Button.vue';
  99. const { querys } = useLoadQuerys({
  100. name: '',
  101. points: 0,
  102. level: 0,
  103. villageId: 0,
  104. villageVolunteerId: 0,
  105. });
  106. const authStore = useAuthStore();
  107. const { canCollect, isEmpty } = useCollectStore();
  108. const { getIsJoinedVillage } = useUserTools();
  109. const { goForm } = useTaskEntryForm();
  110. const isJoined = ref(false);
  111. function goCollect() {
  112. /* if (!canCollect('collect')) {
  113. uni.showToast({
  114. title: '您当前没有可采编随手记的权限',
  115. icon: 'none',
  116. duration: 2000
  117. });
  118. return;
  119. } */
  120. goForm('collect', 1, '随手记')
  121. }
  122. function goJoin() {
  123. navTo('/pages/home/light/submit', {
  124. villageId: querys.value.villageId,
  125. });
  126. }
  127. onMounted(async () => {
  128. isJoined.value = await getIsJoinedVillage(querys.value.villageId);
  129. });
  130. </script>