index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. <h2>欧阳娜娜</h2>
  9. </view>
  10. <img src="@/static/images/moreHorizontal@2x.png" alt="" @click="activeId = item.id">
  11. </view>
  12. <p>角色权限:管理者</p>
  13. <p>手机号码:15902021122</p>
  14. <view class="footer">
  15. <view>启动状态:<text class="status" :class="index % 2 === 0 ?'status_close' :'status_open'">关闭</text>
  16. </view>
  17. <view>所属店铺:<text class="status">燕塘分店</text></view>
  18. </view>
  19. <u-transition :show="item.id == activeId">
  20. <moreShow @moreShowActive="moreShowActive"></moreShow>
  21. </u-transition>
  22. </view>
  23. <view style="height:110rpx;"></view>
  24. </scroll-view>
  25. <view class="footer_btn">
  26. 添加店员
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import moreShow from "@/pagesA/components/more_show/index.vue"
  32. import search from "@/pagesA/components/search/index.vue"
  33. export default {
  34. components: {
  35. search,
  36. moreShow
  37. },
  38. data() {
  39. return {
  40. list: [{
  41. id: 1
  42. }, {
  43. id: 2
  44. }, {
  45. id: 3
  46. }, {
  47. id: 4
  48. }, {
  49. id: 5
  50. }, {
  51. id: 6
  52. }, {
  53. id: 7
  54. }],
  55. scrollTop: 0,
  56. activeId: 0, //当前展开ID
  57. };
  58. },
  59. methods: {
  60. moreShowActive(int) {
  61. console.log(this.activeId, int)
  62. this.activeId = 0 //完成操作置空
  63. },
  64. //触底
  65. lower: function(e) {
  66. console.log(e)
  67. },
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .strikeBalance {
  73. background-color: #f7f7f7;
  74. }
  75. .footer_btn {
  76. height: 104rpx;
  77. text-align: center;
  78. position: fixed;
  79. bottom: 0rpx;
  80. left: 32rpx;
  81. right: 32rpx;
  82. line-height: 104rpx;
  83. border-radius: 24rpx;
  84. background-color: #363c4f;
  85. font-size: 32rpx;
  86. font-weight: bold;
  87. color: #FFFFFF;
  88. }
  89. .scroll-Y {
  90. background-color: #fff;
  91. height: calc(100vh - 100rpx);
  92. .li {
  93. border-bottom: 2rpx solid #e9e9e9;
  94. padding: 40rpx 32rpx 30rpx;
  95. position: relative;
  96. .h2_box {
  97. display: flex;
  98. align-items: center;
  99. justify-content: space-between;
  100. margin-bottom: 24rpx;
  101. img {
  102. width: 40rpx;
  103. height: 40rpx;
  104. }
  105. .h2_left {
  106. display: flex;
  107. align-items: center;
  108. &>h2 {
  109. font-size: 32rpx;
  110. font-weight: 500;
  111. color: #222222;
  112. }
  113. }
  114. }
  115. p {
  116. font-size: 24rpx;
  117. font-weight: 400;
  118. color: #767A80;
  119. padding-bottom: 12rpx;
  120. }
  121. .footer {
  122. margin-top: 20rpx;
  123. display: flex;
  124. align-items: center;
  125. &>view {
  126. flex: 1;
  127. flex-shrink: 0;
  128. margin-right: 20rpx;
  129. background: #F9F9F9;
  130. border-radius: 8rpx;
  131. padding: 20rpx;
  132. font-size: 24rpx;
  133. font-weight: 400;
  134. color: #767A80;
  135. &>.status {
  136. font-size: 28rpx;
  137. color: #333333;
  138. }
  139. &>.status_open {
  140. color: #27AE60;
  141. }
  142. &>.status_close {
  143. color: #EB5757;
  144. }
  145. }
  146. }
  147. }
  148. }
  149. </style>