hd.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view class="hd">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="top" v-for="(item,index) in actItemList" :key="index">
  5. <view class="card">
  6. <image class="image" :src="item.pic" mode="aspectFill"></image>
  7. <view class="text">
  8. <view class="text_title">
  9. <view class="manage bqZ-font">类型</view>
  10. <view class="t1 bmTit-font">{{ item.acName }}</view>
  11. </view>
  12. <view class="col sZw-font">
  13. 活动日期:{{ item.begin_at }}~{{ item.endTime }}
  14. </view>
  15. <view class="col sZw-font">
  16. 招募人数:0/{{ item.pers }}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- <uni-card :is-shadow="false"> -->
  22. <view class="xinxi">
  23. <view class="card2">
  24. <view class="hdxx">
  25. <view class="xxTit btn-font">活动信息</view>
  26. <view class="textcolor">
  27. <view class="name sZw-font">
  28. 姓名:
  29. <input type="text" style=" text-align: right;" maxlength="10" placeholder="请输入姓名"
  30. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="nickname" />
  31. </view>
  32. <view class="name sZw-font">
  33. 联系方式:
  34. <input type="text" style=" text-align: right;" maxlength="10" placeholder="请输入联系方式"
  35. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="telephone" />
  36. </view>
  37. <view class="name sZw-font">
  38. 单位:
  39. <input type="text" style=" text-align: right;" maxlength="10" placeholder="请输入单位"
  40. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="units" />
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- </uni-card> -->
  47. <view class="buttons">
  48. <view class="button-container">
  49. <button @click="button1Action" class="btn1 sZw-font">清空填写信息</button>
  50. <!-- <text class="button-spacing"></text> -->
  51. <!-- 添加间距 -->
  52. <button @click="gotoSign" class="btn2 sZw-font">申请加入</button>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. navBarData: {
  62. title: '活动报名',
  63. btn: 1
  64. },
  65. nickname: '',
  66. telephone: '',
  67. units: '',
  68. actItemList:[]
  69. };
  70. },
  71. methods: {
  72. button1Action() {
  73. this.nickname = ''
  74. this.telephone = ''
  75. this.units = ''
  76. },
  77. gotoSign() {
  78. // 这里添加按钮2点击后触发的动作
  79. if(this.nickname.trim() === '' || this.telephone.trim() === '') {
  80. uni.showToast({
  81. title: '请填写完整的表单内容',
  82. icon: 'none'
  83. });
  84. return;
  85. }
  86. uni.navigateTo({
  87. url: '/pages/Sign/Sign'
  88. })
  89. },
  90. getActivity() {
  91. // 获取当前页面的URL
  92. const routes = getCurrentPages();
  93. console.log(routes);
  94. const acId = routes[2].options.acId
  95. const ty = routes[2].options.ty
  96. let data = {
  97. acId: acId,
  98. ty: ty
  99. }
  100. this.$request('/selectActivityID', "POST", data).then(res => {
  101. console.log(res[0]);
  102. // this.activeList=[...this.activeList,...res[0]]
  103. this.actItemList = res[0]
  104. })
  105. },
  106. },
  107. onShow() {
  108. this.getActivity()
  109. }
  110. };
  111. </script>
  112. <style lang="scss" scoped>
  113. .hd {
  114. .top{
  115. width: 690rpx;
  116. height: 192rpx;
  117. background-color: #ffffff;
  118. margin: auto;
  119. margin-top: 30rpx;
  120. // padding: 24rpx;
  121. padding: 16rpx 24rpx;
  122. border-radius: 10rpx;
  123. .col{
  124. color: #999999;
  125. }
  126. }
  127. .card {
  128. // margin-top: 40rpx;
  129. display: flex;
  130. .image {
  131. flex-shrink: 0;
  132. width: 160rpx;
  133. height: 160rpx;
  134. border-radius: 4px;
  135. }
  136. .text {
  137. margin-left: 10px; // 增加一点空间
  138. display: flex;
  139. flex-direction: column;
  140. justify-content: space-between;
  141. .text_title {
  142. display: flex;
  143. align-items: center;
  144. .manage {
  145. // padding:4rpx 12rpx 4rpx 12rpx;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. width: 68rpx;
  150. height: 36rpx;
  151. border-radius: 5rpx;
  152. color: #00b2b6;
  153. border: 1px solid #00b2b6;
  154. // border-radius: 10rpx;
  155. margin-right: 10rpx;
  156. }
  157. .t1 {
  158. color: black;
  159. width: 350rpx;
  160. font-weight: 550;
  161. overflow:hidden;
  162. text-overflow:ellipsis;
  163. white-space:nowrap;
  164. }
  165. }
  166. }
  167. }
  168. .xinxi{
  169. background-color: #ffffff;
  170. width: 690rpx;
  171. // height: 272rpx;
  172. margin: auto;
  173. margin-top: 20rpx;
  174. padding: 20rpx 24rpx;
  175. border-radius: 12rpx;
  176. }
  177. .hdxx {
  178. .xxTit {
  179. color: black;
  180. // font-size: 18px;
  181. // font-weight: 400px;
  182. line-height: 42px;
  183. }
  184. .textcolor {
  185. color: #999999;
  186. line-height: 42px;
  187. .name {
  188. display: flex;
  189. justify-content: space-between;
  190. margin-bottom: 20rpx;
  191. .nickname {
  192. width: 350rpx;
  193. text-align: end;
  194. // padding-right: 10rpx;
  195. // margin-right: 10rpx;
  196. font-size: 28rpx;
  197. color: rgb(153, 153, 153);
  198. }
  199. }
  200. }
  201. }
  202. .buttons {
  203. background-color: white;
  204. position: fixed;
  205. bottom: 0;
  206. left: 0;
  207. width: 100%;
  208. display: flex;
  209. justify-content: space-around;
  210. align-items: center;
  211. height: 137rpx;
  212. // padding-bottom: 50rpx;
  213. // font-size: 30rpx;
  214. .button-container {
  215. width: 100%;
  216. display: flex;
  217. justify-content: space-around;
  218. .btn1{
  219. width: 326rpx;
  220. height: 71rpx;
  221. border: 1px solid #666666;
  222. border-radius: 50px;
  223. height: 70rpx;
  224. line-height: 70rpx;
  225. // font-size: 35rpx;
  226. color: #666666;
  227. }
  228. .btn2{
  229. width: 326rpx;
  230. height: 71rpx;
  231. background-color: #0056a8;
  232. border-radius: 50px;
  233. height: 70rpx;
  234. line-height: 70rpx;
  235. color: #ffffff;
  236. }
  237. }
  238. }
  239. }
  240. </style>