activityDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view>
  3. <u-navbar title="活动详情"></u-navbar>
  4. <view class="main" v-html="info.content">
  5. </view>
  6. <view class="bottom" v-if="!userInfo" >
  7. <u-button @click="issueMethod()">未登录</u-button>
  8. </view>
  9. <view class="bottom" v-else-if="info.status=='77d93870-e1e1-4369-b2b6-629e8645e8d9'" >
  10. <u-button >活动已结束</u-button>
  11. </view>
  12. <view class="bottom" v-else >
  13. <u-button type="primary" v-if="!info.isJoin"
  14. @click="enrollMethod()" >线上报名</u-button>
  15. <u-button v-else >已报名</u-button>
  16. <!-- <u-button type="info">发布作品</u-button> -->
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import * as API from '@/apis/pagejs/activity.js'
  22. export default {
  23. data() {
  24. return {
  25. userInfo:null,
  26. id:'',
  27. info:{},
  28. }
  29. },
  30. onLoad(op){
  31. this.userInfo=this.carhelp.getPersonInfo()
  32. console.log(this.userInfo)
  33. if(op.id){
  34. this.id=op.id
  35. this.getInfo()
  36. }
  37. },
  38. methods: {
  39. joinActivity(){
  40. uni.showLoading({
  41. title: "加载中",
  42. mask: true,
  43. })
  44. API.joinActivity(this.id).then((res) => {
  45. //this.list=response.data.data
  46. this.info.isJoin=true;
  47. uni.hideLoading();
  48. uni.showToast({
  49. title:"报名成功!"
  50. })
  51. }).catch(error => {
  52. uni.showToast({
  53. title: error,
  54. icon: "none"
  55. })
  56. })
  57. },
  58. enrollMethod(){
  59. var _this=this;
  60. uni.showModal({
  61. title:_this.info.title,
  62. content:"确认是否参与本活动报名?",
  63. confirmText:"报名",
  64. showCancel:true,
  65. success: (res)=> {
  66. if(res.confirm){
  67. _this.joinActivity()
  68. }
  69. }
  70. })
  71. },
  72. issueMethod(){
  73. uni.showModal({
  74. title:"提示",
  75. content:"未登录,登录后参与分享活动",
  76. confirmText:"前往登录",
  77. showCancel:true,
  78. success: function (res) {
  79. if(res.confirm){
  80. uni.navigateTo({
  81. url:'/pages/login/index'
  82. })
  83. }
  84. }
  85. })
  86. },
  87. getInfo(){
  88. uni.showLoading({
  89. title: "加载中",
  90. mask: true,
  91. })
  92. API.edit(this.id).then((res) => {
  93. uni.hideLoading();
  94. //this.list=response.data.data
  95. this.info=res.data;
  96. }).catch(error => {
  97. uni.showToast({
  98. title: error,
  99. icon: "none"
  100. })
  101. })
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. page{
  108. padding-bottom: 100px;
  109. }
  110. .main{
  111. margin: 24rpx 32rpx 0 32rpx;
  112. // 活动介绍
  113. .introduction{
  114. margin-top: 24rpx;
  115. font-family: 'Regular';
  116. .title{
  117. color: rgba(16, 16, 16, 1);
  118. font-size: 18px;
  119. line-height: 26px;
  120. }
  121. .content{
  122. color: rgba(51, 51, 51, 1);
  123. line-height: 24px;
  124. margin-top: 16rpx;
  125. }
  126. }
  127. // 活动时间
  128. .date{
  129. font-family: 'Regular';
  130. margin-top: 32rpx;
  131. .title{
  132. color: rgba(16, 16, 16, 1);
  133. font-size: 18px;
  134. line-height: 26px;
  135. }
  136. .item{
  137. margin-top:16rpx;
  138. display: flex;
  139. color: rgba(51, 51, 51, 1);
  140. line-height: 20px;
  141. .item-title{
  142. margin-right: 24rpx;
  143. }
  144. .name{
  145. width: 100rpx;
  146. }
  147. }
  148. }
  149. }
  150. // 积分获取
  151. .integral{
  152. margin-top: 32rpx;
  153. .title{
  154. color: rgba(16, 16, 16, 1);
  155. font-size: 18px;
  156. line-height: 26px;
  157. font-family: 'Regular';
  158. }
  159. .integral-group{
  160. margin-top: 24rpx;
  161. background-color: #fff;
  162. .item{
  163. display: flex;
  164. justify-content: space-between;
  165. line-height: 44px;
  166. padding-left: 16rpx;
  167. color: rgba(51, 51, 51, 1);
  168. font-size: 16px;
  169. border-bottom: solid 1px #e6e6e6;
  170. font-size: 14rpx;
  171. .value{
  172. width: 170rpx;
  173. text-align: center;
  174. }
  175. }
  176. .item1{
  177. color: rgba(16, 16, 16, 1);
  178. font-size: 16px;
  179. }
  180. }
  181. }
  182. .bottom{
  183. padding: 16rpx 32rpx;
  184. background-color: #fff;
  185. position: fixed;
  186. bottom: 0;
  187. left: 0;
  188. right: 0;
  189. font-family: Arial;
  190. }
  191. </style>