activityDetail.vue 4.0 KB

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