3
0

index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="commodity">
  3. <search></search>
  4. <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  5. <view class="li" v-for="(item,index) in list" :key="index">
  6. <view class="h2_box">
  7. <view class="h2_left">
  8. <view class="btn">
  9. 启动
  10. </view>
  11. <h2>绿卡通{{item.id}}</h2>
  12. </view>
  13. <img src="@/static/images/moreHorizontal@2x.png" alt="" @click="activeId = item.id">
  14. </view>
  15. <p>创建时间:2023-12-23 12:23</p>
  16. <p>所属店铺:燕塘分店</p>
  17. <u-transition :show="item.id == activeId">
  18. <moreShow @moreShowActive="moreShowActive"></moreShow>
  19. </u-transition>
  20. </view>
  21. <view style="height:110rpx;"></view>
  22. </scroll-view>
  23. <view class="footer_btn">
  24. 添加分类
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import moreShow from "@/pagesA/components/more_show/index.vue"
  30. import search from "@/pagesA/components/search/index.vue"
  31. export default {
  32. components: {
  33. search,
  34. moreShow
  35. },
  36. data() {
  37. return {
  38. list: [{
  39. id: 1
  40. }, {
  41. id: 2
  42. }, {
  43. id: 3
  44. }, {
  45. id: 4
  46. }, {
  47. id: 5
  48. }, {
  49. id: 6
  50. }, {
  51. id: 7
  52. }],
  53. scrollTop: 0,
  54. activeId: 0, //当前展开ID
  55. };
  56. },
  57. methods: {
  58. moreShowActive(int) {
  59. console.log(this.activeId, int)
  60. this.activeId = 0 //完成操作置空
  61. },
  62. //触底
  63. lower: function(e) {
  64. console.log(e)
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .strikeBalance {
  71. background-color: #f7f7f7;
  72. }
  73. .footer_btn {
  74. height: 104rpx;
  75. text-align: center;
  76. position: fixed;
  77. bottom: 0rpx;
  78. left: 32rpx;
  79. right: 32rpx;
  80. line-height: 104rpx;
  81. border-radius: 24rpx;
  82. background-color: #363c4f;
  83. font-size: 32rpx;
  84. font-weight: bold;
  85. color: #FFFFFF;
  86. }
  87. .scroll-Y {
  88. background-color: #fff;
  89. height: calc(100vh - 100rpx);
  90. .li {
  91. border-bottom: 2rpx solid #e9e9e9;
  92. padding: 40rpx 32rpx 30rpx;
  93. position: relative;
  94. .h2_box {
  95. display: flex;
  96. align-items: center;
  97. justify-content: space-between;
  98. margin-bottom: 24rpx;
  99. img {
  100. width: 40rpx;
  101. height: 40rpx;
  102. }
  103. .h2_left {
  104. display: flex;
  105. align-items: center;
  106. &>.btn {
  107. background: #DEF6E8;
  108. border-radius: 4rpx;
  109. font-size: 24rpx;
  110. font-weight: 400;
  111. padding: 4rpx 8rpx;
  112. color: #41CF7D;
  113. margin-right: 10rpx;
  114. }
  115. &>h2 {
  116. font-size: 32rpx;
  117. font-weight: 500;
  118. color: #222222;
  119. }
  120. }
  121. }
  122. p {
  123. font-size: 24rpx;
  124. font-weight: 400;
  125. color: #767A80;
  126. padding-bottom: 12rpx;
  127. }
  128. }
  129. }
  130. </style>