index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="signUp">
  3. <image class="good-img" :src="info.activityCover" mode="aspectFit"></image>
  4. <view class="goods-info">
  5. <view class="goods-name">
  6. {{info.activityName}}
  7. </view>
  8. <view class="price-box">
  9. <view class="left">
  10. <view class="unit">
  11. </view>
  12. <view class="price">
  13. {{info.price}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="list">
  19. <view class="item">
  20. <view class="label">
  21. 活动时间
  22. </view>
  23. <view class="value">
  24. {{info.activityStartTime}} 至 {{info.activityEndTime}}
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="label">
  29. 报名时间
  30. </view>
  31. <view class="value">
  32. {{info.signupStartTime}} 至 {{info.signupEndTime}}
  33. </view>
  34. </view>
  35. <view class="item" v-if="info.address">
  36. <view class="label">
  37. 活动地址
  38. </view>
  39. <view class="value">
  40. {{info.address}}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="sub-title">
  45. 活动详情
  46. </view>
  47. <view class="desc-box">
  48. <rich-text class="goods-desc" :nodes="info.activityDetail"></rich-text>
  49. </view>
  50. <view class="buy-box">
  51. <button class="buy-btn" type="default" @click="handleSignUp">报名</button>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {getActivityDetail} from '@/api/activity.js'
  57. export default {
  58. data() {
  59. return {
  60. id:0,
  61. info: {},
  62. }
  63. },
  64. methods: {
  65. handleSignUp(){
  66. let that = this
  67. let {activityStartTime,activityEndTime,limited,activityName,id,price,shopId} = this.info
  68. let obj = {
  69. activityStartTime,
  70. activityEndTime,
  71. limited,
  72. activityName,
  73. id,
  74. price,
  75. shopId
  76. }
  77. if (uni.getStorageSync('token')) {
  78. uni.setStorageSync('activity',JSON.stringify(obj) )
  79. uni.navigateTo({
  80. url:'/signUp/makeOut?id='+this.info.dataCollectId
  81. })
  82. } else {
  83. uni.showModal({
  84. title:'请登录',
  85. confirmText:'去登录',
  86. success(res){
  87. console.log(res);
  88. if(res.confirm){
  89. uni.navigateTo({
  90. url:`/login/login/login?redirect=/signUp/index&scene=${that.id}`
  91. })
  92. }
  93. }
  94. })
  95. }
  96. },
  97. getActivityDetail(id){
  98. getActivityDetail({id}).then(res=>{
  99. if (res.state == 'Success') {
  100. this.info = res.content
  101. this.info.activityDetail = res.content.activityDetail.replace(/<img/gi, '<img class="img_class" ')
  102. uni.setNavigationBarTitle({
  103. title:this.info.activityName
  104. })
  105. }
  106. })
  107. }
  108. },
  109. onLoad(options) {
  110. this.id = decodeURIComponent(options.scene)
  111. this.getActivityDetail(this.id)
  112. }
  113. }
  114. </script>
  115. <style lang="scss" >
  116. .signUp{
  117. background: #F9F9F9;
  118. padding-bottom: 200rpx;
  119. min-height: 100vh;
  120. .good-img{
  121. width: 100%;
  122. height: 750rpx;
  123. vertical-align: bottom;
  124. }
  125. .goods-info{
  126. padding: 24rpx;
  127. margin-bottom: 20rpx;
  128. background: #fff;
  129. .price-box{
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. margin-top: 20rpx;
  134. .left{
  135. display: flex;
  136. align-items: flex-end;
  137. .unit{
  138. font-size: 20rpx;
  139. color: $uni-color-primary;
  140. font-weight: bold;
  141. }
  142. .price{
  143. font-size: 36rpx;
  144. color: $uni-color-primary;
  145. font-weight: bold;
  146. }
  147. }
  148. }
  149. .goods-name{
  150. font-size: 32rpx;
  151. color: #222222;
  152. font-weight: bold;
  153. }
  154. }
  155. .sub-title{
  156. font-weight: 600;
  157. font-size: 28rpx;
  158. color: #222222;
  159. padding: 24rpx;
  160. border-radius: 16rpx 16rpx 0 0;
  161. background: #fff;
  162. }
  163. .desc-box{
  164. .goods-desc{
  165. color: #222222;
  166. font-size: 24rpx;
  167. .img_class{
  168. max-width: 100%!important;
  169. vertical-align: bottom;
  170. }
  171. }
  172. }
  173. .list{
  174. background: #fff;
  175. margin-bottom: 20rpx;
  176. .item{
  177. padding: 24rpx;
  178. border-top:1rpx solid #F0F0F0;
  179. .label{
  180. font-weight: 600;
  181. font-size: 28rpx;
  182. color: #222222;
  183. }
  184. .value{
  185. font-weight: 300;
  186. font-size: 24rpx;
  187. color: #AAAAAA;
  188. margin-top: 16rpx;
  189. line-height: 40rpx;
  190. }
  191. }
  192. }
  193. .buy-box{
  194. position: fixed;
  195. bottom: 0%;
  196. left: 0%;
  197. width: 100%;
  198. background: #fff;
  199. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  200. border-top: 1rpx solid #EEEEEE;
  201. box-sizing: border-box;
  202. .buy-btn{
  203. width: 702rpx;
  204. height: 80rpx;
  205. line-height: 80rpx;
  206. text-align: center;
  207. background: $uni-color-primary;
  208. border-radius: 40rpx;
  209. font-weight: 600;
  210. font-size: 28rpx;
  211. color: #FFFFFF;
  212. }
  213. }
  214. }
  215. </style>