exchange.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="sub-base-container">
  3. <view class="exchange-card">
  4. <view class="tabs">
  5. <view :class="['tab-item',{active:active === index}]" @click="handleTab(index)"
  6. v-for="(item,index) in tabs" :key="index">{{item}}</view>
  7. </view>
  8. <view class="list" v-show="active === 0">
  9. <view class="item" v-for="(item,index) in 3" :key="index">
  10. <view class="item-info">
  11. <image class="img" src="/static/home/fruit.png"></image>
  12. <view class="cont">
  13. <up-text bold text="牛乳蜂蜜饼干一份"></up-text>
  14. <up-text size="12" color="#999999" text="有限期:2025.06.05至2025.06.23"></up-text>
  15. </view>
  16. </view>
  17. <view class="button">去兑换</view>
  18. </view>
  19. </view>
  20. <view class="list" v-show="active === 1">
  21. <view class="item" v-for="(item,index) in 3" :key="index">
  22. <view class="item-info">
  23. <view class="money">
  24. <view class="sum"><text class="unit">¥</text>50</view>
  25. <view class="tips">满100可用</view>
  26. </view>
  27. <view class="cont">
  28. <up-text bold text="仙桃荔全场优惠券"></up-text>
  29. <up-text bold text="满100减50"></up-text>
  30. <up-text size="12" color="#999999" text="有限期:2025.06.05至2025.06.23"></up-text>
  31. </view>
  32. </view>
  33. <view class="button">去使用</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup>
  40. import config from "@/api/config.js"
  41. import {
  42. ref
  43. } from 'vue';
  44. import { onLoad } from '@dcloudio/uni-app'
  45. onLoad(({type})=>{
  46. active.value = Number(type)
  47. })
  48. const active = ref(0)
  49. const tabs = ["守护兑换", "优惠券"]
  50. const handleTab = (index) => {
  51. active.value = index
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. @import "@/static/style/mixin.scss";
  56. .sub-base-container {
  57. @include ossBg("subTreePage/exchange-bg.png");
  58. min-height: 750rpx;
  59. .exchange-card {
  60. width: 100%;
  61. box-sizing: border-box;
  62. padding: 26rpx 20rpx;
  63. height: calc(100vh - 14vh);
  64. border-radius: 40rpx 40rpx 0 0;
  65. background: #fff;
  66. position: absolute;
  67. top: 14vh;
  68. left: 0;
  69. .tabs {
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. .tab-item {
  74. color: rgba(0, 0, 0, 0.2);
  75. padding: 10rpx 12rpx;
  76. &.active {
  77. font-size: 36rpx;
  78. color: #000;
  79. font-weight: 500;
  80. }
  81. }
  82. .tab-item+.tab-item {
  83. margin-left: 24rpx;
  84. }
  85. }
  86. .button {
  87. font-size: 24rpx;
  88. padding: 14rpx 32rpx;
  89. border-radius: 50rpx;
  90. background: #FFD95E;
  91. font-weight: 500;
  92. }
  93. .list {
  94. .item {
  95. margin-top: 30rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: space-between;
  99. .item-info {
  100. display: flex;
  101. .img {
  102. width: 160rpx;
  103. height: 160rpx;
  104. border-radius: 16rpx;
  105. margin-right: 24rpx;
  106. }
  107. .money {
  108. background-image: linear-gradient(120deg, #ffe3c9, #eebd8f);
  109. border-radius: 16rpx;
  110. padding: 20rpx 30rpx 30rpx;
  111. text-align: center;
  112. color: #322802;
  113. margin-right: 24rpx;
  114. .sum {
  115. font-size: 64rpx;
  116. font-weight: bold;
  117. .unit {
  118. font-size: 30rpx;
  119. margin-right: 6rpx;
  120. }
  121. }
  122. .tips {
  123. color: #000000;
  124. font-size: 24rpx;
  125. margin-top: -12rpx;
  126. }
  127. }
  128. .cont {
  129. line-height: 46rpx;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. /* #ifdef H5 */
  136. .exchange-card{
  137. height: calc(100vh - 14vh - 88rpx);
  138. }
  139. /* #endif */
  140. }
  141. </style>