activityDetail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view>
  3. <view class="header">
  4. <image class="header-image" :src="list.main_image"></image>
  5. </view>
  6. <view class="main">
  7. <view class="main-title">活动信息</view>
  8. <view class="main-card">
  9. <view class="card-item">
  10. <view class="item-name">活动标题:</view>
  11. <view class="item-content" style="color: black;">{{list.title}}</view>
  12. </view>
  13. <view class="card-item">
  14. <view class="item-name">开始时间:</view>
  15. <view class="item-content">{{list.start_time}}</view>
  16. </view>
  17. <view class="card-item">
  18. <view class="item-name">活动地址:</view>
  19. <view class="item-content">{{list.address}}</view>
  20. </view>
  21. <!-- <view class="card-item">
  22. <view class="item-name">活动内容:</view>
  23. <view class="item-content"><u-parse :content="list.content"></u-parse></view>
  24. </view> -->
  25. <view class="card-item">
  26. <view class="item-name">参加人数:</view>
  27. <view class="item-content">{{list.join_num}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="actDetail">
  32. <view class="actDetail-title">活动详情</view>
  33. <view class="actDetail-content">
  34. <u-parse :content="list.content"></u-parse>
  35. </view>
  36. </view>
  37. <view class="bottomEmpty"></view>
  38. <view class="bottomArea">
  39. <view class="bottomButton" v-if="join_status == false" @tap="submit">立即报名</view>
  40. <view class="bottomButton-exist" v-if="join_status == true">已报名</view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. var _this;
  46. export default {
  47. data() {
  48. return {
  49. actId: 0,
  50. list: {},
  51. join_status: false,
  52. userinfo: null,
  53. }
  54. },
  55. onLoad(option) {
  56. _this = this;
  57. _this.actId = option.id || 0;
  58. _this.userinfo = uni.getStorageSync('userinfo') || false;
  59. _this.getMore();
  60. },
  61. methods: {
  62. pageRefresh: function() {
  63. _this.getMore();
  64. },
  65. submit() {
  66. _this.$req.ajax({
  67. path: "activity/joinActivity",
  68. data: {
  69. id: _this.actId,
  70. userid: _this.userinfo.id,
  71. }
  72. }).then((data) => {
  73. _this.pageRefresh();
  74. console.log("加入", data)
  75. }).catch((err) => {
  76. uni.showModal({
  77. title: '信息提示',
  78. content: err,
  79. showCancel: false
  80. });
  81. });
  82. },
  83. getMore() {
  84. _this.$req.ajax({
  85. path: "activity/detailActivity",
  86. data: {
  87. id: _this.actId,
  88. userid: _this.userinfo.id,
  89. }
  90. }).then((data) => {
  91. _this.join_status = data.join_status
  92. _this.list = data.list;
  93. console.log("详情数据", data)
  94. }).catch((err) => {
  95. uni.showModal({
  96. title: '信息提示',
  97. content: err,
  98. showCancel: false
  99. });
  100. });
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. .header {
  107. margin: 30rpx 20rpx;
  108. .header-image {
  109. width: 100%;
  110. height: 400rpx;
  111. border-radius: 20rpx;
  112. }
  113. }
  114. .main {
  115. margin: 0 20rpx 30rpx;
  116. .main-title {
  117. font-size: 35rpx;
  118. font-weight: bold;
  119. margin-bottom: 30rpx;
  120. }
  121. .main-card {
  122. padding: 0 20rpx;
  123. border-radius: 20rpx;
  124. background-color: #FFFFFF;
  125. box-shadow: 5rpx 5rpx 10rpx 2rpx rgba(149, 149, 149, 0.3);
  126. .card-item {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. padding: 30rpx 0;
  131. border-bottom: 1rpx solid #f1f1f1;
  132. .item-name {
  133. width: 25%;
  134. }
  135. .item-content {
  136. flex: 1;
  137. text-align: right;
  138. color: #999999;
  139. }
  140. // .item-content {
  141. // flex: 1;
  142. // text-align: right;
  143. // overflow: hidden;
  144. // text-overflow: ellipsis;
  145. // -webkit-line-clamp: 1;
  146. // display: -webkit-box;
  147. // -webkit-box-orient: vertical;
  148. // }
  149. }
  150. }
  151. }
  152. .actDetail {
  153. margin: 0 20rpx;
  154. padding: 20rpx 20rpx;
  155. border-radius: 20rpx;
  156. background-color: #FFFFFF;
  157. box-shadow: 5rpx 5rpx 10rpx 2rpx rgba(149, 149, 149, 0.3);
  158. .actDetail-title {
  159. font-size: 35rpx;
  160. font-weight: bold;
  161. margin-bottom: 30rpx;
  162. }
  163. }
  164. .bottomEmpty {
  165. margin-top: 80rpx;
  166. height: 130rpx;
  167. }
  168. .bottomArea {
  169. position: fixed;
  170. bottom: 0;
  171. z-index: 100;
  172. width: 100%;
  173. height: 130rpx;
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. background-color: #FFFFFF;
  178. box-shadow: -10rpx -12rpx 12rpx 2rpx rgba(52, 85, 73, 0.16);
  179. .bottomButton {
  180. margin: 0 28rpx;
  181. width: 696rpx;
  182. height: 90rpx;
  183. line-height: 90rpx;
  184. background: #CA151C;
  185. font-size: 33rpx;
  186. text-align: center;
  187. color: #FFFFFF;
  188. border-radius: 10rpx;
  189. }
  190. .bottomButton-exist {
  191. margin: 0 28rpx;
  192. width: 696rpx;
  193. height: 90rpx;
  194. line-height: 90rpx;
  195. background: #e8e8e8;
  196. font-size: 33rpx;
  197. text-align: center;
  198. border-radius: 10rpx;
  199. }
  200. }
  201. </style>