coupons.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <ax-body title="">
  3. <view class="tabs-body">
  4. <view class="tabs-box">
  5. <view class="item-tabs" :class="{active:currentIndex===item.id}" v-for="item in tabsList" :key="item.id" @click="handleTabClick(item)">{{item.text}}({{item.id}})</view>
  6. </view>
  7. <view style="height: 100rpx;"></view>
  8. <view class="list-body">
  9. <view class="coupons-list-box" :style="{opacity:`${currentIndex===3?'0.5':''}`}" v-for="item in 3">
  10. <image class="coupons-bg-img" src="../../static/img/coupons-new.png" mode=""></image>
  11. <view class="coupons-content-box">
  12. <view class="coupons-left">
  13. <view class="left-price">10<text>元</text></view>
  14. <view class="left-rules">满100元可用</view>
  15. </view>
  16. <view class="coupons-center">
  17. <view class="coupons-title">优惠券名称优惠券名称</view>
  18. <view class="coupons-valid">有效期:领取后60天</view>
  19. <view class="coupons-range">平台所有充电桩可用</view>
  20. </view>
  21. <view class="coupons-right">
  22. <view class="coupons-dayrules" v-if="currentIndex===0">每日限领一次</view>
  23. <view class="coupons-getbtn" v-if="currentIndex===0">立即领取</view>
  24. <view class="coupons-getbtn" v-if="currentIndex===2">查看订单</view>
  25. </view>
  26. </view>
  27. <view class="ribbon" :style="{backgroundColor:`${currentIndex===3?'#e8e8e8':''}`,color:`${currentIndex===3?'#8c8c8c':''}`}">{{tabsList[currentIndex].text}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </ax-body>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. currentIndex: 0 ,// 默认选中第一个选项卡
  38. tabsList:[{
  39. text:'待领取',
  40. id:0
  41. },{
  42. text:'待使用',
  43. id:1
  44. },{
  45. text:'已使用',
  46. id:2
  47. },{
  48. text:'已过期',
  49. id:3
  50. },]
  51. };
  52. },
  53. methods: {
  54. // 处理选项卡点击
  55. handleTabClick(e) {
  56. this.currentIndex = e.id;
  57. }
  58. }
  59. };
  60. </script>
  61. <style>
  62. @import url("coupons");
  63. </style>