index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="sign-container">
  3. <view
  4. class="header"
  5. :style="{
  6. backgroundImage: `url(${$setting.IMAGE_URL}/sign/bg.png)`
  7. } "
  8. >
  9. <view
  10. class="icon"
  11. :style="{
  12. backgroundImage: `url(${$setting.IMAGE_URL}/sign/icon.png)`
  13. } "
  14. />
  15. <view class="been-sign">已连续签到1天</view>
  16. <view class="tips">在连续签到6天立得50金</view>
  17. </view>
  18. <view class="content dir-left-wrap">
  19. <view
  20. v-for="(item,index) in sign"
  21. :key="index"
  22. class="item main-center cross-center"
  23. :class="{active: index === 0}"
  24. >
  25. <view class="left-box dir-top-wrap cross-center">
  26. <text class="title">{{ item.name }}</text>
  27. <view class="icon">
  28. <image src="@/static/image/gold.png" />
  29. </view>
  30. <view class="number">{{ item.number }}金币</view>
  31. </view>
  32. <view v-if="(index + 1) === sign.length" class="right-box">
  33. <image src="@/static/image/gold-bag.png" />
  34. </view>
  35. </view>
  36. </view>
  37. <view class="btn">立即签到</view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. sign: [
  45. { name: '第一天', number: 3 },
  46. { name: '第二天', number: 3 },
  47. { name: '第三天', number: 3 },
  48. { name: '第四天', number: 3 },
  49. { name: '第五天', number: 3 },
  50. { name: '第六天', number: 3 },
  51. { name: '第七天', number: 3 }
  52. ]
  53. }
  54. },
  55. computed: {},
  56. methods: {}
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .sign-container{
  61. padding: 20rpx;
  62. font-size: 28rpx;
  63. .header{
  64. background-repeat: no-repeat;
  65. background-size: 100% 100%;
  66. height: 300rpx;
  67. border-radius: 10rpx;
  68. position: relative;
  69. margin-top: 100rpx;
  70. padding-top: 80rpx;
  71. .icon{
  72. background-repeat: no-repeat;
  73. background-size: 100%;
  74. height: 180rpx;
  75. width: 240rpx;
  76. position: absolute;
  77. top: -50%;
  78. transform: translateY(30%) translateX(-50%);
  79. left: 50%;
  80. }
  81. .been-sign{
  82. background: linear-gradient(303deg, #FF74B9, #6EEBE8, #FFFFFF);
  83. -webkit-background-clip: text;
  84. color: transparent;
  85. text-align: center;
  86. margin-bottom: 30rpx;
  87. font-size: 46rpx;
  88. font-weight: bold;
  89. }
  90. .tips{
  91. color: $info-color;
  92. text-align: center;
  93. width: 500rpx;
  94. margin: 0 auto;
  95. border-radius: 30rpx;
  96. padding: 12rpx 0;
  97. background: #1f2336;
  98. font-size: 26rpx;
  99. }
  100. }
  101. .content{
  102. margin-top: 40rpx;
  103. .item{
  104. color: $default-color;
  105. width: calc(#{660rpx}/4);
  106. background: #1B1E32;
  107. border-radius: 10rpx;
  108. padding: 40rpx 0;
  109. margin-bottom: 20rpx;
  110. margin-right: 20rpx;
  111. &.active{
  112. background: linear-gradient(221deg, #6EEBE8, #FF74B9);
  113. }
  114. &:nth-child(4){
  115. margin-right: 0;
  116. }
  117. &:last-child{
  118. flex: 1;
  119. margin-right: 0;
  120. }
  121. .left-box{
  122. .icon{
  123. image{
  124. width: 100rpx;
  125. height: 100rpx;
  126. }
  127. }
  128. .number{
  129. color: $primary-color;
  130. }
  131. }
  132. .right-box{
  133. margin-bottom: -100rpx;
  134. margin-right: -20rpx;
  135. margin-left: 40rpx;
  136. image{
  137. width: 160rpx;
  138. height: 160rpx;
  139. }
  140. }
  141. }
  142. }
  143. .btn{
  144. width: 690rpx;
  145. margin: 80rpx auto 0;
  146. padding: 24rpx 0;
  147. color: $default-color;
  148. background: linear-gradient(270deg, #FB3651 0%, #FF8999 100%);
  149. border-radius: 45px;
  150. text-align: center;
  151. }
  152. }
  153. </style>