activityDetail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <!-- 教研室详情 -->
  3. <view class="activityDetail">
  4. <statusBar :item="navbar"></statusBar>
  5. <!-- 顶部 -->
  6. <view class="backPic" v-for="(item,index) in actItemList" :key="index + 'a' ">
  7. <image src="http://43.139.158.220:5007/img/static/yym/Rectangle 40.png" mode="aspectFill"></image>
  8. <view style="padding: 0 30rpx;margin-bottom: 20px;">
  9. <view class="card">
  10. <view class="cardTop three-font">
  11. {{ item.acName }}
  12. </view>
  13. <view class="col fz-font">
  14. 活动日期:<text>{{ item.begin_at }}~{{ item.endTime }}</text>
  15. </view>
  16. <view class="col fz-font">
  17. 招募人数:<text>0/{{ item.pers }}</text>
  18. </view>
  19. <view class="col fz-font">
  20. 活动地址:<text>{{ item.address }}</text>
  21. <uni-icons type="location" color="#0056a8"
  22. style="position: absolute;right: 10px;top: 0;width: 32rpx;height: 45rpx;"></uni-icons>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 创建者用户名 -->
  28. <view style="padding: 0 30rpx;">
  29. <view class="creator" v-for="(item,index) in actItemList" :key="index + 'b' ">
  30. <image
  31. :src="item.avatar == null ? 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png' : item.avatar"
  32. mode="aspectFill"></image>
  33. <view class="creName btn-font">
  34. {{ item.username }}
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 活动详情 -->
  39. <view class="" style="padding: 0 30rpx;">
  40. <detailBlock :actItemList='actItemList' :item='judge'></detailBlock>
  41. </view>
  42. <!-- 当前成员 -->
  43. <view style="padding: 0 30rpx;">
  44. <view class="member">
  45. <view class="memberTop">
  46. <view class="btn-font">报名情况(已报名0人)</view>
  47. <view class="fz-font" style="color: rgba(0, 0, 0, 0.4);display: flex;align-items: center;"
  48. @click="perList">
  49. <text>查看更多</text>
  50. <image src="http://43.139.158.220:5007/img/static/mine/arrow-right.png"
  51. style="width: 32rpx;height: 32rpx;" mode="aspectFill"></image>
  52. <!-- <uni-icons type="right"></uni-icons> -->
  53. </view>
  54. </view>
  55. <view class="pers">
  56. <!-- <view class="per" v-if="perNum == []" v-for="(item,index) in perNum">
  57. <image :src="item.img"></image>
  58. <view class="perName fz-font">
  59. {{item.Name}}
  60. </view>
  61. </view> -->
  62. <view class="per">
  63. <!-- <image :src="item.img"></image> -->
  64. <view class="perName fz-font">
  65. 暂无人员
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 申请加入 -->
  72. <view class="btnBlock">
  73. <button class="btn" @click="gotoAdd">立即报名</button>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. navbar: {
  82. title: '活动详情',
  83. btn: 1
  84. },
  85. judge: {
  86. isShow: 1,
  87. info: ''
  88. },
  89. actItemList: [],
  90. perNum: []
  91. // perNum: [{
  92. // Name: '陈芬',
  93. // img: 'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (3).png'
  94. // },
  95. // {
  96. // Name: '贺豪杰',
  97. // img: 'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (4).png'
  98. // },
  99. // {
  100. // Name: '张孝迪',
  101. // img: 'http://43.139.158.220:5007/img/static/yym/Ellipse 4.png'
  102. // },
  103. // {
  104. // Name: '马冬梅',
  105. // img: 'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (2).png'
  106. // },
  107. // {
  108. // Name: '康雯妍',
  109. // img: 'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (1).png'
  110. // },
  111. // {
  112. // Name: '张燕琴',
  113. // img: 'http://43.139.158.220:5007/img/static/mine/Avatar.png'
  114. // }
  115. // ]
  116. };
  117. },
  118. methods: {
  119. perList() {
  120. uni.navigateTo({
  121. url: '/pages/dy/dy'
  122. })
  123. },
  124. gotoAdd() {
  125. // console.log(e.currentTarget.dataset['index'], 123);
  126. // let edata = e.currentTarget.dataset['index'];
  127. const routes = getCurrentPages();
  128. const ty = routes[1].options.ty ? routes[1].options.ty : routes[2].options.ty;
  129. const clickedAcId = this.actItemList[0].acId;
  130. console.log(clickedAcId);
  131. uni.navigateTo({
  132. url: '/pages/hd/hd?acId=' + clickedAcId + '&ty=' + ty
  133. })
  134. },
  135. getActivity() {
  136. // 获取当前页面的URL
  137. const routes = getCurrentPages();
  138. console.log(routes);
  139. const acId = routes[1].options.acId ? routes[1].options.acId : routes[2].options.acId;
  140. const ty = routes[1].options.ty ? routes[1].options.ty : routes[2].options.ty;
  141. let data = {
  142. acId: acId,
  143. ty: ty
  144. }
  145. this.$request('/selectActivityID', "POST", data).then(res => {
  146. console.log(res[0]);
  147. // this.activeList=[...this.activeList,...res[0]]
  148. this.actItemList = res[0]
  149. })
  150. },
  151. },
  152. onShow() {
  153. this.getActivity()
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. .activityDetail {
  159. padding-bottom: 80px;
  160. .backPic {
  161. width: 750rpx;
  162. position: relative;
  163. image {
  164. width: 100%;
  165. display: block;
  166. }
  167. .card {
  168. position: absolute;
  169. width: 690rpx;
  170. // height: 150px;
  171. bottom: -20px;
  172. left: 50%;
  173. // padding: 30rpx 16px;
  174. padding: 30rpx;
  175. border-radius: 10px;
  176. background-color: #ffffff;
  177. transform: translate(-50%, 0);
  178. .cardTop {
  179. // display: flex;
  180. // justify-content: center;
  181. // padding-bottom: 5px;
  182. margin-bottom: 5px;
  183. // font-size: 18px;
  184. font-weight: bold;
  185. display: -webkit-box;
  186. word-break: break-all;
  187. text-overflow: ellipsis;
  188. overflow: hidden;
  189. -webkit-box-orient: vertical;
  190. -webkit-line-clamp: 2;
  191. /*设置 需要显示的行数*/
  192. .title {
  193. font-weight: bold;
  194. }
  195. }
  196. .col {
  197. position: relative;
  198. margin-bottom: 10rpx;
  199. color: #999999;
  200. padding-right: 40px;
  201. // font-size: 14px;
  202. width: 100%;
  203. display: -webkit-box;
  204. word-break: break-all;
  205. text-overflow: ellipsis;
  206. overflow: hidden;
  207. -webkit-box-orient: vertical;
  208. -webkit-line-clamp: 2;
  209. /*设置 需要显示的行数*/
  210. text {
  211. color: #333333;
  212. }
  213. }
  214. .tag {
  215. display: flex;
  216. }
  217. }
  218. // background-image: url(http://43.139.158.220:5007/img/static/resource/jqr.png);
  219. }
  220. .creator {
  221. display: flex;
  222. // padding: 10px 30px;
  223. padding: 30rpx 20rpx;
  224. background-color: #ffffff;
  225. align-items: center;
  226. margin-top: 30px;
  227. margin-bottom: 20rpx;
  228. border-radius: 10px;
  229. image {
  230. width: 96rpx;
  231. height: 96rpx;
  232. border-radius: 50%;
  233. margin-right: 20rpx;
  234. }
  235. .creName {
  236. font-weight: bold;
  237. }
  238. }
  239. .member {
  240. background-color: #ffffff;
  241. margin-top: 20rpx;
  242. padding: 30rpx;
  243. border-radius: 10px;
  244. margin-bottom: 30rpx;
  245. .memberTop {
  246. display: flex;
  247. justify-content: space-between;
  248. margin-bottom: 10px;
  249. }
  250. .pers {
  251. display: flex;
  252. justify-content: space-between;
  253. align-items: center;
  254. .per {
  255. // display: inline-block;
  256. display: flex;
  257. flex-direction: column;
  258. // justify-content: center;
  259. align-items: center;
  260. image {
  261. width: 72rpx;
  262. height: 72rpx;
  263. border-radius: 50%;
  264. }
  265. .perName {
  266. // font-size: 14px;
  267. text-align: center;
  268. }
  269. }
  270. }
  271. }
  272. .btnBlock {
  273. position: fixed;
  274. bottom: 0;
  275. width: 750rpx;
  276. background-color: #ffffff;
  277. // padding: 20px 0;
  278. padding: 2vh 0;
  279. .btn {
  280. width: 432rpx;
  281. height: 88rpx;
  282. font-weight: 500;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. margin: auto;
  287. background-color: #0056a8;
  288. color: #ffffff;
  289. }
  290. }
  291. }
  292. </style>