Activity.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <u-popup :show="show" @close="close" mode="center" :round="16" :overlayStyle="{background: 'rgba(0, 0, 0, 0.6)'}">
  3. <view class="activity-popup-container ">
  4. <view class="popup-content white-bg">
  5. <image src="/static/images/enter/activity/img_sanzi.png" class="fan-deco" mode="aspectFit"></image>
  6. <view class="main-title u-f-ajc">广场舞大赛</view>
  7. <view class="sub-title es-mt-14 u-f-ajc">丰厚奖品等你来拿</view>
  8. <view class="awards-box es-mt-28">
  9. <view class="u-f-ajc awards-title-box">
  10. <view class="awards-title u-f-ajc">活动奖励</view>
  11. </view>
  12. <scroll-view :scroll-y="true" class="awards-boxContent es-mt-20">
  13. <view class="award-item" :class="{fistOne:index==0}" v-for="(item, index) in activityData.prize"
  14. :key="index">
  15. <view class="dot"></view>
  16. <text>{{item.prizeLevel}}:{{item.prizeName}}</text>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. <view class="time-info">报名时间:{{activityData.registrationStartTime}}到{{activityData.registrationEndTime}}
  21. </view>
  22. <view class="u-f-ajc">
  23. <view class="join-btn" @click="handleJoin">
  24. 立即参与
  25. </view>
  26. </view>
  27. </view>
  28. <view class="bottom-controls">
  29. <view class="dont-remind u-f u-f-ac" @click="updateActivityShowFun()">
  30. <image v-if="!reminder" src="/static/images/enter/activity/icon_square.png" class="es-icon-28"
  31. mode="aspectFit"></image>
  32. <image v-else src="/static/images/enter/activity/icon_select_square.png" class="es-icon-28"
  33. mode="aspectFit">
  34. </image>
  35. <text class="remind-text">下次不再提醒我</text>
  36. </view>
  37. <view class="close-btn" @click="close()">
  38. <u-icon name="close-circle" color="#fff" size="30"></u-icon>
  39. </view>
  40. </view>
  41. </view>
  42. </u-popup>
  43. </template>
  44. <script>
  45. import {
  46. updateActivityShow
  47. } from '@/api/activity.js'
  48. export default {
  49. name: 'Activity',
  50. props: {
  51. show: {
  52. type: Boolean,
  53. default: false
  54. },
  55. activityData: {
  56. type: Object,
  57. default: {}
  58. }
  59. },
  60. data() {
  61. return {
  62. awards: [],
  63. activityTime: '',
  64. dontRemindValue: [],
  65. reminder: false,
  66. }
  67. },
  68. created() {},
  69. methods: {
  70. close() {
  71. this.$emit('close');
  72. },
  73. handleJoin() {
  74. uni.navigateTo({
  75. url: '/pages_enter/activity/detail'
  76. });
  77. this.close();
  78. },
  79. async updateActivityShowFun() {
  80. const res = await updateActivityShow({
  81. activityId: 1
  82. })
  83. if (res.code == 200) {
  84. this.reminder = !this.eminder
  85. uni.showToast({
  86. icon: 'none',
  87. title: '设置成功!'
  88. })
  89. setTimeout(() => {
  90. this.$emit('close');
  91. }, 1000)
  92. } else {
  93. uni.showToast({
  94. icon: 'none',
  95. title: result.msg
  96. })
  97. }
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .activity-popup-container {
  104. width: 640rpx;
  105. background: transparent;
  106. }
  107. ::v-deep .u-popup__content {
  108. background-color: transparent !important;
  109. }
  110. .popup-content {
  111. background-color: #FFFFFF;
  112. background-image: url('/static/images/enter/activity/bg_popup_dance.png');
  113. background-repeat: no-repeat;
  114. background-size: 100% 274rpx;
  115. border-radius: 32rpx;
  116. padding: 40rpx;
  117. text-align: center;
  118. position: relative;
  119. overflow: visible;
  120. .fan-deco {
  121. position: absolute;
  122. top: -60rpx;
  123. right: -20rpx;
  124. width: 180rpx;
  125. height: 180rpx;
  126. }
  127. .main-title {
  128. font-family: HelloFont WenYiHei, HelloFont WenYiHei;
  129. font-weight: bold;
  130. font-size: 64rpx;
  131. color: #550500;
  132. text-align: left;
  133. font-style: normal;
  134. text-transform: none;
  135. // background: linear-gradient(270deg, #E82426 0%, #F6886D 100%);
  136. }
  137. .sub-title {
  138. font-family: PingFang SC, PingFang SC;
  139. font-weight: 500;
  140. font-size: 32rpx;
  141. color: #550500;
  142. text-align: left;
  143. font-style: normal;
  144. text-transform: none;
  145. }
  146. .awards-box {
  147. background: #FFEFEF;
  148. border-radius: 16rpx 16rpx 16rpx 16rpx;
  149. border: 4rpx solid #FFB9C0;
  150. padding: 0 40rpx 28rpx;
  151. text-align: left;
  152. margin-bottom: 30rpx;
  153. .awards-boxContent {
  154. height: 300rpx;
  155. padding-bottom: 20rpx;
  156. }
  157. .awards-title-box {
  158. // position: absolute;
  159. // top: 0;
  160. // left: 0;
  161. // right: 0;
  162. // padding-top: 74rpx;
  163. .awards-title {
  164. // position: absolute;
  165. // top: 0;
  166. font-family: Inter, Inter;
  167. font-weight: bold;
  168. font-size: 28rpx;
  169. color: #FFFFFF;
  170. text-align: left;
  171. font-style: normal;
  172. text-transform: none;
  173. width: 278rpx;
  174. height: 54rpx;
  175. background: linear-gradient(90deg, #FF4640 0%, #FEA56B 100%);
  176. border-radius: 0 0 65rpx 65rpx;
  177. }
  178. }
  179. .fistOne {
  180. // margin-top: 74rpx;
  181. }
  182. .award-item {
  183. display: flex;
  184. align-items: center;
  185. font-size: 28rpx;
  186. color: #222222;
  187. margin-bottom: 20rpx;
  188. .dot {
  189. width: 12rpx;
  190. height: 12rpx;
  191. background: #FF3245;
  192. border-radius: 50%;
  193. margin-right: 16rpx;
  194. }
  195. }
  196. }
  197. .time-info {
  198. font-size: 26rpx;
  199. color: #B22222;
  200. margin-bottom: 30rpx;
  201. }
  202. .join-btn {
  203. width: 368rpx;
  204. height: 84rpx;
  205. line-height: 90rpx;
  206. background: linear-gradient(90deg, #FF7F50, #FF1493);
  207. border-radius: 45rpx;
  208. color: #fff;
  209. font-size: 34rpx;
  210. font-weight: bold;
  211. text-align: center;
  212. box-shadow: 0 8rpx 20rpx rgba(255, 20, 147, 0.3);
  213. }
  214. }
  215. .bottom-controls {
  216. margin-top: 40rpx;
  217. display: flex;
  218. flex-direction: column;
  219. align-items: center;
  220. .dont-remind {
  221. margin-bottom: 40rpx;
  222. .remind-text {
  223. color: #fff;
  224. font-size: 28rpx;
  225. margin-left: 16rpx;
  226. }
  227. }
  228. .close-btn {
  229. // No specific styles needed, u-icon is sufficient
  230. }
  231. }
  232. </style>