index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <!-- 优惠活动 -->
  3. <view>
  4. <view class="discountInfo" :class="discountInfo.show === true ? 'on' : ''">
  5. <view class="title">优惠活动<text class="iconfont icon-guanbi5" @click="closeDiscount"></text></view>
  6. <view class="list">
  7. <view class="item acea-row row-top" v-for="(item,index) in discountInfo.discount" :key="index" @click="goList(item)">
  8. <view class="label">{{item.title}}</view>
  9. <view class="info">{{item.desc}}</view>
  10. <view class="iconfont icon-jiantou"></view>
  11. </view>
  12. </view>
  13. <slot name="bottom"></slot>
  14. </view>
  15. <view class="mask" @touchmove.prevent :hidden="discountInfo.show === false" @click="closeDiscount"></view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. discountInfo: {
  22. type: Object,
  23. default: () => {}
  24. },
  25. },
  26. data() {
  27. return {};
  28. },
  29. mounted() {},
  30. methods: {
  31. closeDiscount(){
  32. this.$emit('myevent');
  33. },
  34. goList(item){
  35. uni.navigateTo({
  36. url: `/pages/activity/discount/index?promotions_type=${item.promotions_type}`
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style scoped lang="scss">
  43. .discountInfo{
  44. position: fixed;
  45. bottom: 0;
  46. width: 100%;
  47. left: 0;
  48. background-color: #F5F5F5;
  49. z-index: 280;
  50. border-radius: 16rpx 16rpx 0 0;
  51. transform: translate3d(0, 100%, 0);
  52. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  53. padding-bottom: 22rpx;
  54. padding-bottom: calc(22rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  55. padding-bottom: calc(22rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  56. .title{
  57. font-size: 32rpx;
  58. color: #282828;
  59. text-align: center;
  60. margin: 38rpx 0 36rpx 0;
  61. position: relative;
  62. .iconfont{
  63. position: absolute;
  64. right: 30rpx;
  65. top:0;
  66. font-size: 36rpx;
  67. }
  68. }
  69. .list{
  70. height: 750rpx;
  71. margin: 0 30rpx;
  72. overflow-x: hidden;
  73. overflow-y: auto;
  74. .item{
  75. margin-bottom: 14rpx;
  76. background-color: #fff;
  77. border-radius: 12rpx;
  78. padding: 30rpx 20rpx;
  79. position: relative;
  80. .label{
  81. font-size: 20rpx;
  82. color: var(--view-theme);
  83. background-color: var(--view-minorColorT);
  84. border-radius: 4rpx;
  85. padding: 2rpx 8rpx;
  86. }
  87. .info{
  88. max-width: 510rpx;
  89. font-size: 24rpx;
  90. color: #666;
  91. margin-left: 16rpx;
  92. }
  93. .iconfont{
  94. font-size: 30rpx;
  95. position: absolute;
  96. top:50%;
  97. margin-top: -15rpx;
  98. right: 10rpx;
  99. }
  100. }
  101. }
  102. }
  103. .discountInfo.on{
  104. transform: translate3d(0, 0, 0);
  105. }
  106. </style>