index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="submit_main">
  3. <view class="img-banner">
  4. <image mode="aspectFill" src="https://mn.wenlvti.net/app_static/xiangan/banner_submit.jpg"></image>
  5. </view>
  6. <view class="main">
  7. <template v-if="!villageListLoader.content.value?.length">
  8. <view class="cat">
  9. <text>村庄认领</text>
  10. </view>
  11. <u-button type="primary" @click="goClamVillage">
  12. <text>+</text>
  13. 认领新村庄
  14. </u-button>
  15. </template>
  16. <view class="cat">
  17. <text>已认领村庄</text>
  18. </view>
  19. <RequireLogin unLoginMessage="登录后查看我认领的村庄">
  20. <SimplePageContentLoader
  21. :loader="villageListLoader"
  22. :showEmpty="villageListLoader.content.value?.length == 0"
  23. :emptyView="{
  24. text: '你还没有认领的村庄',
  25. button: true,
  26. buttonText: '去认领',
  27. buttonClick: goClamVillage,
  28. }"
  29. >
  30. <view class="village-list">
  31. <view
  32. v-for="item in villageListLoader.content.value"
  33. :key="item.id"
  34. class="item"
  35. >
  36. <ImageWrapper
  37. mode="aspectFill"
  38. :src="item.image"
  39. width="154rpx"
  40. height="154rpx"
  41. />
  42. <view class="info">
  43. <view class="name">{{ item.villageName }}</view>
  44. <view class="d-flex flex-row align-center">
  45. <view class="btn p-1 pl-2 pr-2" @click="navTo('/pages/inherit/village/details', { id: item.villageId })">
  46. <text class="iconfont icon-view"></text>预览
  47. </view>
  48. <view class="btn p-1 pl-2 pr-2 active" @click="goSubmitDigPage(item)">
  49. <text class="iconfont icon-search"></text>采编
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </SimplePageContentLoader>
  56. </RequireLogin>
  57. <view class="cat">
  58. <text>我的贡献</text>
  59. </view>
  60. <RequireLogin unLoginMessage="登录后贡献,加入排行榜">
  61. <view class="retribution">
  62. <view class="item">
  63. <text class="iconfont icon-total-points"></text>
  64. <view class="num">{{ volunteerInfoLoader.content.value?.points }}</view>
  65. <view>文化积分</view>
  66. </view>
  67. <view>
  68. <text class="iconfont icon-art-arrow"></text>
  69. </view>
  70. <view class="item">
  71. <text class="iconfont icon-level"></text>
  72. <view class="level">Lv.{{ volunteerInfoLoader.content.value?.level }}</view>
  73. <view>等级</view>
  74. </view>
  75. </view>
  76. </RequireLogin>
  77. </view>
  78. </view>
  79. </template>
  80. <script setup lang="ts">
  81. import VillageApi, { VillageListItem } from '@/api/inhert/VillageApi';
  82. import ImageWrapper from '@/common/components/ImageWrapper.vue';
  83. import RequireLogin from '@/common/components/RequireLogin.vue';
  84. import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
  85. import { useReqireLogin } from '@/common/composeabe/RequireLogin';
  86. import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
  87. import { navTo } from '@imengyu/imengyu-utils/dist/uniapp/PageAction';
  88. const villageListLoader = useSimpleDataLoader(async () => await VillageApi.getClaimedVallageList(), true);
  89. const volunteerInfoLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerInfo(), true);
  90. const rankListLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerRanklist(), true);
  91. const { requireLogin } = useReqireLogin();
  92. function goClamVillage() {
  93. requireLogin(() => navTo('forms/village_claim'), '登录后才能认领村庄哦!');
  94. }
  95. function goSubmitDigPage(item: VillageListItem) {
  96. navTo('details', {
  97. id: item.villageId,
  98. name: item.villageName,
  99. villageVolunteerId: item.villageVolunteerId,
  100. points: volunteerInfoLoader.content.value?.points,
  101. level: volunteerInfoLoader.content.value?.level,
  102. })
  103. }
  104. </script>
  105. <style lang="scss">
  106. .submit_main {
  107. .img-banner{
  108. border-radius: 0;
  109. height: 466rpx;
  110. }
  111. .cat{
  112. font-weight: 600;
  113. display: flex;
  114. margin: 36rpx 0 40rpx;
  115. align-items: center;
  116. text{
  117. display: block;
  118. font-size: 36rpx;
  119. color: #312520;
  120. flex:1;
  121. }
  122. .btn{
  123. border-radius: 28rpx;
  124. border: 1px solid #999999;
  125. font-size: 27rpx;
  126. color: #666666;
  127. padding:15rpx 28rpx;
  128. display: inline-block;
  129. margin-left: 18rpx;
  130. &.active{
  131. color:#fff;
  132. background: #FF8719;
  133. border-color: #FF8719;
  134. }
  135. }
  136. }
  137. .village-list{
  138. .item{
  139. background: #FFFFFF;
  140. border-radius: 10rpx;
  141. padding:18rpx 14rpx 11rpx;
  142. display: flex;
  143. margin-bottom: 27rpx;
  144. image,.image-wrapper {
  145. border-radius: 10rpx;
  146. width: 154rpx;
  147. height: 154rpx;
  148. display: block;
  149. margin-right: 25rpx;
  150. overflow: hidden;
  151. }
  152. .info{
  153. .name{
  154. font-size: 30rpx;
  155. color: #333333;
  156. margin-bottom: 35rpx;
  157. margin-top: 14rpx;
  158. }
  159. .btn{
  160. border-radius: 10rpx;
  161. border: 1px solid #25515E;
  162. padding:16rpx 44rpx;
  163. font-size: 28rpx;
  164. color:#25515E;
  165. margin-right: 34rpx;
  166. display: inline-block;
  167. &.active{
  168. background: #FF8719;
  169. color:#fff;
  170. border-color: #FF8719;
  171. }
  172. text.iconfont{
  173. display: inline-block;
  174. margin-right: 15rpx;
  175. font-size: 36rpx;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. .retribution{
  182. background: #FFFFFF;
  183. border-radius: 10rpx;
  184. display: flex;
  185. justify-content: space-around;
  186. .item{
  187. text-align: center;
  188. font-size: 24rpx;
  189. color: #312520;
  190. padding: 35rpx 0 33rpx;
  191. text.iconfont{
  192. font-size: 56rpx;
  193. color:#25515E;
  194. display: block;
  195. }
  196. .num{
  197. font-weight: 600;
  198. font-size: 48rpx;
  199. color: #FF8719;
  200. margin-top: 12rpx;
  201. line-height: 48rpx;
  202. margin-bottom: 15rpx;
  203. }
  204. .level{
  205. margin-top: 12rpx;
  206. margin-bottom: 15rpx;
  207. font-family: Rockwell;
  208. font-size: 44rpx;
  209. line-height: 48rpx;
  210. color: #FF8719;
  211. }
  212. }
  213. }
  214. .people-list{
  215. .item{
  216. width: 100%;
  217. display: flex;
  218. align-items: center;
  219. padding: 28rpx 21rpx 28rpx 10rpx;
  220. text-align: left;
  221. .rank{
  222. position: relative;
  223. top:inherit;
  224. left:inherit;
  225. margin-right: 25rpx;
  226. width: 77rpx;
  227. }
  228. .info{
  229. flex:1;
  230. }
  231. .level{
  232. font-family: Rockwell;
  233. font-size: 36rpx;
  234. color: #FF8719;
  235. }
  236. image.avatar{
  237. margin-bottom: 0;
  238. margin-right: 51rpx;
  239. background-color: #efefef;
  240. border-radius: 50%;
  241. }
  242. }
  243. }
  244. }
  245. </style>