job.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="job-page">
  3. <image
  4. class="job-header-image"
  5. src="https://wwgj.wenlvti.net/uploads/20260318/e94fb36598d415e39e7cd3d4bd6f915a.png"
  6. mode="widthFix"
  7. />
  8. <view class="job-buttons">
  9. <view class="job-button" @click="goToPage('volunteer')">
  10. <view class="job-button-content">
  11. <text class="job-button-text">巡查志愿者</text>
  12. <text class="job-button-subtext">需招募岗位数:{{ summary.volunteer || 0 }}</text>
  13. </view>
  14. </view>
  15. <view class="job-button" @click="goToPage('xuanjiang')">
  16. <view class="job-button-content">
  17. <text class="job-button-text">宣讲志愿者</text>
  18. <text class="job-button-subtext">需招募岗位数:{{ summary.xuanjiang || 0 }}</text>
  19. </view>
  20. </view>
  21. <view class="job-button" @click="goToPage('publicize')">
  22. <view class="job-button-content">
  23. <text class="job-button-text">传播志愿者</text>
  24. <text class="job-button-subtext">需招募岗位数:{{ summary.publicize || 0 }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. summary: {
  35. title: '',
  36. volunteer: 0,
  37. xuanjiang: 0,
  38. publicize: 0
  39. }
  40. };
  41. },
  42. onShow() {
  43. this.getVolunteerNumber();
  44. },
  45. methods: {
  46. getVolunteerNumber() {
  47. this.$api.getVolunteerNumber({ main_body_id: 1 }, (res) => {
  48. const responseData = res && res.data ? res.data : res || {};
  49. const summary = responseData.summary || {};
  50. this.summary = {
  51. title: summary.title || '',
  52. volunteer: Number(summary.volunteer) || 0,
  53. xuanjiang: Number(summary.xuanjiang) || 0,
  54. publicize: Number(summary.publicize) || 0
  55. };
  56. });
  57. },
  58. goToPage(type) {
  59. const urlMap = {
  60. volunteer: '/index_fenbao/SaoMaBaoMing/saoMaBaoMing',
  61. xuanjiang: '/index_fenbao/SaoMaBaoMing/district',
  62. publicize: '/index_fenbao/SaoMaBaoMing/district'
  63. };
  64. uni.navigateTo({
  65. url: `${urlMap[type]}?type=${type}`
  66. });
  67. }
  68. }
  69. };
  70. </script>
  71. <style scoped>
  72. .job-page {
  73. min-height: 100vh;
  74. box-sizing: border-box;
  75. padding: 25% 0 0 0;
  76. background-image: url('https://wwgj.wenlvti.net/uploads/20260318/2663cbc99de9048f820be7badf3fb1e6.png');
  77. background-repeat: no-repeat;
  78. background-position: center top;
  79. background-size: 100% 100%;
  80. }
  81. .job-header-image {
  82. display: block;
  83. width: 80%;
  84. margin: 0 auto;
  85. }
  86. .job-buttons {
  87. display: flex;
  88. flex-direction: column;
  89. align-items: center;
  90. padding-top: 130rpx;
  91. }
  92. .job-button {
  93. width: 76%;
  94. aspect-ratio: 22/8;
  95. margin-bottom: 80rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. background-image: url('https://wwgj.wenlvti.net/uploads/20260318/b85db3427f60df0b7522ee47d4bf9781.png');
  100. background-repeat: no-repeat;
  101. background-position: center;
  102. background-size: 100% 100%;
  103. }
  104. .job-button:last-child {
  105. margin-bottom: 0;
  106. }
  107. .job-button-content {
  108. display: flex;
  109. flex-direction: column;
  110. align-items: center;
  111. justify-content: center;
  112. }
  113. .job-button-text {
  114. color: #ffffff;
  115. font-size: 40rpx;
  116. font-weight: 600;
  117. letter-spacing: 16rpx;
  118. text-indent: 16rpx;
  119. line-height: 1;
  120. }
  121. .job-button-subtext {
  122. margin-top: 18rpx;
  123. color: #ffffff;
  124. font-size: 24rpx;
  125. line-height: 1.2;
  126. }
  127. </style>