details.vue 5.4 KB

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