sign.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="sign-area">
  3. <view class="sign-top pos-r bg-base dflex dflex-flow-c">
  4. <view class="ft-white margin-top-sm fwb" style="font-size: 70rpx">{{data.member_integral || 750}}</view>
  5. <view class="btn-line ft-black fs-xs border-radius-big" @click="toDetail">积分明细</view>
  6. </view>
  7. <view class="sign-content margin pos-a">
  8. <view class="bg-main border-radius padding">
  9. <view class="title">
  10. <view class="fwb fs">
  11. <text class="d">已累计签到</text>
  12. <text class="ft-base margin-left-sm fwb">{{data.sign_cnt || 6}}天</text>
  13. </view>
  14. </view>
  15. <view class="dflex-b margin-top">
  16. <view class="dflex-c dflex-flow-c" v-for="(item, index) in weeks" :key="index">
  17. <view :class="{ active: item.sign }" class="iconfont iconxuanzhong"></view>
  18. <view>{{item.name}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="margin-top-xl">
  23. <view class="tac margin fs-xs">
  24. <text>连续签到{{data.sign_in_full || 7}}天</text>
  25. <text class="margin-left-xs">可额外获得{{ data.sign_in_full_integral || '10' }}积分</text>
  26. </view>
  27. <view class="w-full margin-top">
  28. <view class="dflex-b border-radius-big">
  29. <view class="tac padding-tb-sm flex1 bg-base" v-if="!signed" @click="toSign">立即签到</view>
  30. <view class="tac padding-tb-sm flex1 bg-disabled" v-else>今日已签到</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="pos-f pos-bottom padding tac w-full bg-warn fs-xs">有200积分即将在2021.12.30过期</view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. weeks: [],
  43. data: {},
  44. signed: false,
  45. }
  46. },
  47. onShow() {
  48. this.loadData();
  49. },
  50. methods: {
  51. loadData(){
  52. this.weeks = [];
  53. this.weeks.push({ name: '周一', sign: true });
  54. this.weeks.push({ name: '周二', sign: true });
  55. this.weeks.push({ name: '周三', sign: true });
  56. this.weeks.push({ name: '周四', sign: true });
  57. this.weeks.push({ name: '周五', sign: false });
  58. this.weeks.push({ name: '周六', sign: false });
  59. this.weeks.push({ name: '周日', sign: false });
  60. },
  61. toDetail() {
  62. uni.navigateTo({
  63. url: '/pages/user/integral/detail'
  64. });
  65. },
  66. toSign() {
  67. if (this.signed) {
  68. this.$api.msg('已签到,明天再来吧')
  69. return;
  70. }
  71. this.signed = true;
  72. this.$api.msg('恭喜签到成功');
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="less">
  78. page {
  79. overflow: hidden;
  80. background-color: #f5f5f5;
  81. }
  82. .sign-area {
  83. .sign-top {
  84. left: -10%;
  85. width: 120%;
  86. height: 360rpx;
  87. padding: 0rpx 10%;
  88. border-bottom-right-radius: 50%;
  89. border-bottom-left-radius: 50%;
  90. .btn-line {
  91. padding: 10rpx 30rpx;
  92. border: 1px solid #333;
  93. }
  94. }
  95. .bg-disabled {
  96. background-color: #c0c4cd !important;
  97. color: #fff !important;
  98. }
  99. .sign-content {
  100. top: 240rpx; left: 0; right: 0;
  101. margin: 0 50rpx;
  102. .iconfont {
  103. color: #c0c4cd;
  104. font-size: 50rpx;
  105. }
  106. }
  107. }
  108. </style>