job.vue 3.7 KB

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