selectGoods.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="container">
  3. <view class="gap"></view>
  4. <view class="body">
  5. <!-- 左边区域 -->
  6. <view class="left">
  7. <view class="left_item" :class="{ active: active_left === index }" v-for="(item, index) in leftList" :key="index" @click="handleChange(index)">
  8. {{ item }}
  9. </view>
  10. </view>
  11. <!-- 右边区域 -->
  12. <view class="right">
  13. <view class="right_item" :class="{ active: active_right === index }" v-for="(item, index) in rightList" :key="index" @click="handleChange2(index)">
  14. {{ item }}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. active_left: 0,
  25. active_right: 0,
  26. leftList: ['其他', '水电'],
  27. rightList: ['下水道', '安全指示牌', '消费应急灯', '排水管道', '吊顶', '风扇', '没电']
  28. }
  29. },
  30. methods: {
  31. handleChange(index) {
  32. this.active_left = index
  33. },
  34. handleChange2(index) {
  35. this.active_right = index
  36. uni.navigateBack(1)
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .container {
  43. width: 100vw;
  44. height: 100vh;
  45. .gap {
  46. height: 10rpx;
  47. background-color: #f2f2f2;
  48. }
  49. .body {
  50. display: flex;
  51. height: calc(100vh - 10rpx);
  52. .left {
  53. box-sizing: border-box;
  54. padding: 15rpx;
  55. width: 198rpx;
  56. border-right: 1rpx solid #ccc;
  57. overflow-y: auto;
  58. .left_item {
  59. width: 100%;
  60. height: 80rpx;
  61. line-height: 80rpx;
  62. text-align: center;
  63. font-size: 28rpx;
  64. overflow: hidden;
  65. white-space: nowrap;
  66. text-overflow: ellipsis;
  67. }
  68. .active {
  69. color: #6fb6b8;
  70. }
  71. }
  72. .right {
  73. box-sizing: border-box;
  74. padding: 30rpx 40rpx;
  75. width: 552rpx;
  76. overflow-y: auto;
  77. .right_item {
  78. float: left;
  79. box-sizing: border-box;
  80. padding: 10rpx 30rpx;
  81. margin: 0 32rpx 37rpx 0;
  82. height: 50rpx;
  83. line-height: 30rpx;
  84. text-align: center;
  85. color: #808080;
  86. font-size: 28rpx;
  87. border-radius: 53rpx;
  88. background-color: #e6e6e6;
  89. overflow: hidden;
  90. white-space: nowrap;
  91. text-overflow: ellipsis;
  92. }
  93. .active {
  94. color: #fff;
  95. background-color: #6fb6b8;
  96. }
  97. }
  98. }
  99. }
  100. </style>