activityPop.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <adMask :show="showAd" @close="close">
  3. <view class="signbox">
  4. <view class="integral_img">
  5. <image src="@/static/images/ad/integral_img.png" mode="heightFix"></image>
  6. </view>
  7. <view class="signbox-body">
  8. <view class="signbox-head">
  9. <image class="signbox-topbg" src="@/static/images/ad/Frame.png" mode="widthFix"></image>
  10. <view class="signbox-headcon">
  11. <view>
  12. <text>{{activeName}}</text>
  13. </view>
  14. <view class="signbox-signnum"></view>
  15. </view>
  16. </view>
  17. <view class="signbox-con">
  18. <view class="signbox-item" v-for="(item,index) in days" :key="index">
  19. <!-- <block v-if="index<8" > -->
  20. <view class="imgbox">
  21. <view v-if=" item.isSign" class="signdaybox">
  22. <view class="signday">+{{item.number}}</view>
  23. <image src="@/static/images/integral/sign_in_on_icon.png" mode="aspectFill"></image>
  24. </view>
  25. <view v-else class="integral-box">
  26. <view class="integral-box-line">
  27. <view class="integral-box-con">
  28. +{{item.number}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view :style="{color: item.isSign ? '#FF5030':''}">{{item.date}}号</view>
  34. <!-- </block>
  35. <block v-else>
  36. <view class="imgbox">
  37. <image class="imgbox" src="@/static/images/integral/gift_img.png" mode="aspectFill"></image>
  38. </view>
  39. <view :style="{color: 7 <= userSign.signNum ? '#FF5030':''}">礼包</view>
  40. </block> -->
  41. </view>
  42. </view>
  43. <view class="signbox-footer">
  44. <button class="signbox-footer-btn" @click="goToSign()" :loading="signLoading" :disabled="signLoading">立即领取</button>
  45. </view>
  46. </view>
  47. <view class="adbox-close">
  48. <image src="@/static/images/ad/close_icon.png" @click="close"></image>
  49. </view>
  50. </view>
  51. </adMask>
  52. </template>
  53. <script>
  54. import {getUserActiveLog,userActiveLogSign} from "@/api/activity.js"
  55. export default {
  56. props: {
  57. userSign: {
  58. type: Object,
  59. default: function(){
  60. return {}
  61. }
  62. }
  63. },
  64. data() {
  65. return {
  66. showAd: false,
  67. signLoading: false,
  68. signNum:0,
  69. integral:0,
  70. sign:[],
  71. user:null,
  72. isDaySign:false,
  73. days:[],
  74. activeName:''
  75. }
  76. },
  77. mounted() {
  78. this.getUserActiveLogFun()
  79. },
  80. methods: {
  81. getUserActiveLogFun(){
  82. getUserActiveLog().then(res=>{
  83. if(res.code == 200 ){
  84. this.activeName = res.activeName
  85. this.days = res.days
  86. }else{
  87. uni.showToast({
  88. title:res.msg,
  89. icon:'none'
  90. })
  91. }
  92. })
  93. },
  94. open() {
  95. this.showAd = true
  96. },
  97. close() {
  98. this.showAd = false
  99. },
  100. goToSign(){
  101. if(this.$isLogin()){
  102. if(this.$isLogin()){
  103. userActiveLogSign().then(res=>{
  104. if(res.code ==200){
  105. this.close();
  106. }
  107. uni.showToast({
  108. title:res.msg,
  109. icon:'none'
  110. })
  111. })
  112. }
  113. }
  114. else{
  115. this.$showLoginPage();
  116. }
  117. },
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. @mixin u-flex($flexD, $alignI, $justifyC) {
  123. display: flex;
  124. flex-direction: $flexD;
  125. align-items: $alignI;
  126. justify-content: $justifyC;
  127. }
  128. .adbox-close {
  129. display: inline-block;
  130. margin-top: 68rpx;
  131. image {
  132. width: 64rpx;
  133. height: 64rpx;
  134. }
  135. }
  136. .signbox {
  137. width: 100%;
  138. @include u-flex(column, center, center);
  139. .integral_img {
  140. width: 322rpx;
  141. height: 304rpx;
  142. position: relative;
  143. image {
  144. width: 100%;
  145. height: 100%;
  146. position: absolute;
  147. z-index: 6;
  148. left: 46rpx;
  149. bottom: 0;
  150. }
  151. }
  152. &-body {
  153. margin-top: -130rpx;
  154. width: 662rpx;
  155. // height: 608rpx;
  156. padding-bottom: 50rpx;
  157. box-sizing: border-box;
  158. background: #FFFFFF;
  159. border-radius: 32rpx 32rpx 32rpx 32rpx;
  160. position: relative;
  161. overflow: hidden;
  162. }
  163. &-head {
  164. width: 662rpx;
  165. position: relative;
  166. }
  167. &-topbg {
  168. width: 662rpx;
  169. height: auto;
  170. }
  171. &-headcon {
  172. width: 100%;
  173. position: absolute;
  174. bottom: 36rpx;
  175. left: 50%;
  176. transform: translateX(-50%);
  177. font-family: PingFang SC, PingFang SC;
  178. font-weight: 600;
  179. font-size: 40rpx;
  180. color: #FFFFFF;
  181. line-height: 47rpx;
  182. text-shadow: 0px 4px 8px rgba(255,89,2,0.8);
  183. text-align: center;
  184. }
  185. &-signnum {
  186. min-width: 186rpx;
  187. min-height: 48rpx;
  188. margin-top: 18rpx;
  189. padding: 0 24rpx;
  190. display: inline-block;
  191. box-sizing: border-box;
  192. line-height: 48rpx;
  193. text-align: center;
  194. // background: #FFFFFF;
  195. border-radius: 24rpx 24rpx 24rpx 24rpx;
  196. font-family: PingFang SC, PingFang SC;
  197. font-weight: 500;
  198. font-size: 26rpx;
  199. color: #FF5030;
  200. }
  201. &-con {
  202. padding: 44rpx 26rpx;
  203. box-sizing: border-box;
  204. @include u-flex(row, center, space-between);
  205. font-weight: 400;
  206. font-size: 24rpx;
  207. color: #757575;
  208. }
  209. &-item {
  210. text-align: center;
  211. .imgbox {
  212. flex-shrink: 0;
  213. height: 72rpx;
  214. width: 72rpx;
  215. margin-bottom: 4rpx;
  216. @include u-flex(row, center, center);
  217. }
  218. .signdaybox {
  219. position: relative;
  220. image {
  221. width: 24rpx;
  222. height: 24rpx;
  223. position: absolute;
  224. right: 0;
  225. bottom: 0;
  226. }
  227. }
  228. .signday {
  229. flex-shrink: 0;
  230. width: 72rpx;
  231. height: 72rpx;
  232. @include u-flex(row, center, center);
  233. box-sizing: border-box;
  234. background: #FCF0E7;
  235. border-radius: 0rpx 0rpx 0rpx 0rpx;
  236. border: 2rpx dashed rgba(255,92,3,0.5);
  237. border-radius: 50%;
  238. font-weight: 500;
  239. font-size: 22rpx;
  240. color: #FF5030;
  241. }
  242. .integral-box {
  243. width: 72rpx;
  244. height: 72rpx;
  245. background: linear-gradient( 180deg, #FBE69B 0%, #F2A54E 100%);
  246. border-radius: 50%;
  247. @include u-flex(row, center, center);
  248. &-line {
  249. width: 64rpx;
  250. height: 64rpx;
  251. @include u-flex(row, center, center);
  252. font-weight: 500;
  253. font-size: 22rpx;
  254. color: #FFFFFF;
  255. border-radius: 50%;
  256. position: relative;
  257. background: linear-gradient(180deg, rgba(241, 161, 75, 1), rgba(249, 225, 137, 1));
  258. }
  259. &-con {
  260. width: 60rpx;
  261. height: 60rpx;
  262. border-radius: 50%;
  263. @include u-flex(row, center, center);
  264. background: linear-gradient( 180deg, #FFCD88 0%, #F4B55C 47%, #F49C49 100%);
  265. }
  266. }
  267. }
  268. &-footer {
  269. &-btn {
  270. width: 520rpx;
  271. min-height: 88rpx;
  272. line-height: 88rpx;
  273. background: linear-gradient( 90deg, #FF5701 0%, #FFB501 100%);
  274. box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(238,124,80,0.2);
  275. border-radius: 44rpx 44rpx 44rpx 44rpx;
  276. font-family: PingFang SC, PingFang SC;
  277. font-weight: 600;
  278. font-size: 32rpx;
  279. color: #FFFFFF;
  280. &::after {
  281. border: none;
  282. }
  283. }
  284. }
  285. }
  286. </style>