signPop.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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>连续签到领</text><text style="color: #FFFC76;">芳华币</text>
  13. </view>
  14. <view class="signbox-signnum">{{userSign.signNum==0?'您还没有签到':'已签到'+userSign.signNum+'天'}}</view>
  15. </view>
  16. </view>
  17. <view class="signbox-con">
  18. <view class="signbox-item" v-for="(item,index) in userSign.sign" :key="index">
  19. <block v-if="index<6" >
  20. <view class="imgbox">
  21. <view v-if="index + 1 <= userSign.signNum" class="signdaybox">
  22. <view class="signday">+{{item.signNum}}</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.signNum}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view :style="{color: index + 1 <= userSign.signNum ? '#FF5C03':''}">第{{index + 1}}天</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 ? '#FF5C03':''}">礼包</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. export default {
  55. props: {
  56. userSign: {
  57. type: Object,
  58. default: function(){
  59. return {}
  60. }
  61. }
  62. },
  63. data() {
  64. return {
  65. showAd: false,
  66. signLoading: false,
  67. signNum:0,
  68. integral:0,
  69. sign:[],
  70. user:null,
  71. isDaySign:false,
  72. }
  73. },
  74. methods: {
  75. open() {
  76. this.showAd = true
  77. },
  78. close() {
  79. this.showAd = false
  80. },
  81. goToSign(){
  82. if(this.$isLogin()){
  83. uni.navigateTo({
  84. url: '/pages/user/integral/points'
  85. });
  86. this.close();
  87. }
  88. else{
  89. this.$showLoginPage();
  90. }
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. @mixin u-flex($flexD, $alignI, $justifyC) {
  97. display: flex;
  98. flex-direction: $flexD;
  99. align-items: $alignI;
  100. justify-content: $justifyC;
  101. }
  102. .adbox-close {
  103. display: inline-block;
  104. margin-top: 68rpx;
  105. image {
  106. width: 64rpx;
  107. height: 64rpx;
  108. }
  109. }
  110. .signbox {
  111. width: 100%;
  112. @include u-flex(column, center, center);
  113. .integral_img {
  114. width: 322rpx;
  115. height: 304rpx;
  116. position: relative;
  117. image {
  118. width: 100%;
  119. height: 100%;
  120. position: absolute;
  121. z-index: 6;
  122. left: 46rpx;
  123. bottom: 0;
  124. }
  125. }
  126. &-body {
  127. margin-top: -130rpx;
  128. width: 662rpx;
  129. // height: 608rpx;
  130. padding-bottom: 50rpx;
  131. box-sizing: border-box;
  132. background: #FFFFFF;
  133. border-radius: 32rpx 32rpx 32rpx 32rpx;
  134. position: relative;
  135. overflow: hidden;
  136. }
  137. &-head {
  138. width: 662rpx;
  139. position: relative;
  140. }
  141. &-topbg {
  142. width: 662rpx;
  143. height: auto;
  144. }
  145. &-headcon {
  146. width: 100%;
  147. position: absolute;
  148. bottom: 36rpx;
  149. left: 50%;
  150. transform: translateX(-50%);
  151. font-family: PingFang SC, PingFang SC;
  152. font-weight: 600;
  153. font-size: 40rpx;
  154. color: #FFFFFF;
  155. line-height: 47rpx;
  156. text-shadow: 0px 4px 8px rgba(255,89,2,0.8);
  157. text-align: center;
  158. }
  159. &-signnum {
  160. min-width: 186rpx;
  161. min-height: 48rpx;
  162. margin-top: 18rpx;
  163. padding: 0 24rpx;
  164. display: inline-block;
  165. box-sizing: border-box;
  166. line-height: 48rpx;
  167. text-align: center;
  168. background: #FFFFFF;
  169. border-radius: 24rpx 24rpx 24rpx 24rpx;
  170. font-family: PingFang SC, PingFang SC;
  171. font-weight: 500;
  172. font-size: 26rpx;
  173. color: #FF5C03;
  174. }
  175. &-con {
  176. padding: 44rpx 26rpx;
  177. box-sizing: border-box;
  178. @include u-flex(row, center, space-between);
  179. font-weight: 400;
  180. font-size: 24rpx;
  181. color: #757575;
  182. }
  183. &-item {
  184. text-align: center;
  185. .imgbox {
  186. flex-shrink: 0;
  187. height: 72rpx;
  188. width: 72rpx;
  189. margin-bottom: 4rpx;
  190. @include u-flex(row, center, center);
  191. }
  192. .signdaybox {
  193. position: relative;
  194. image {
  195. width: 24rpx;
  196. height: 24rpx;
  197. position: absolute;
  198. right: 0;
  199. bottom: 0;
  200. }
  201. }
  202. .signday {
  203. flex-shrink: 0;
  204. width: 72rpx;
  205. height: 72rpx;
  206. @include u-flex(row, center, center);
  207. box-sizing: border-box;
  208. background: #FCF0E7;
  209. border-radius: 0rpx 0rpx 0rpx 0rpx;
  210. border: 2rpx dashed rgba(255,92,3,0.5);
  211. border-radius: 50%;
  212. font-weight: 500;
  213. font-size: 22rpx;
  214. color: #FF5C03;
  215. }
  216. .integral-box {
  217. width: 72rpx;
  218. height: 72rpx;
  219. background: linear-gradient( 180deg, #FBE69B 0%, #F2A54E 100%);
  220. border-radius: 50%;
  221. @include u-flex(row, center, center);
  222. &-line {
  223. width: 64rpx;
  224. height: 64rpx;
  225. @include u-flex(row, center, center);
  226. font-weight: 500;
  227. font-size: 22rpx;
  228. color: #FFFFFF;
  229. border-radius: 50%;
  230. position: relative;
  231. background: linear-gradient(180deg, rgba(241, 161, 75, 1), rgba(249, 225, 137, 1));
  232. }
  233. &-con {
  234. width: 60rpx;
  235. height: 60rpx;
  236. border-radius: 50%;
  237. @include u-flex(row, center, center);
  238. background: linear-gradient( 180deg, #FFCD88 0%, #F4B55C 47%, #F49C49 100%);
  239. }
  240. }
  241. }
  242. &-footer {
  243. &-btn {
  244. width: 520rpx;
  245. min-height: 88rpx;
  246. line-height: 88rpx;
  247. background: linear-gradient( 90deg, #FF5701 0%, #FFB501 100%);
  248. box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(238,124,80,0.2);
  249. border-radius: 44rpx 44rpx 44rpx 44rpx;
  250. font-family: PingFang SC, PingFang SC;
  251. font-weight: 600;
  252. font-size: 32rpx;
  253. color: #FFFFFF;
  254. &::after {
  255. border: none;
  256. }
  257. }
  258. }
  259. }
  260. </style>