addGoods.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="container">
  3. <!-- 输入框区域 -->
  4. <view class="search">
  5. <img src="../../static/images/repairsImg/search.png" />
  6. <input type="text" placeholder="请输入搜索内容" />
  7. </view>
  8. <!-- 耗材区域 -->
  9. <view class="body">
  10. <view class="body_left">
  11. <view class="left_item" :class="{ active: activeIndex === index }" v-for="(item, index) in list" :key="index" @click="handleChange(index)">{{ item }}</view>
  12. </view>
  13. <view class="body_right">
  14. <view class="right_item" :class="{ active: activeIndex2 === index2 }" v-for="(ele, index2) in List2" :key="index2" @click="handleChange2(index2)">{{ ele }}</view>
  15. </view>
  16. </view>
  17. <!-- 备注区域 -->
  18. <view class="notes" v-if="activeIndex === 4">
  19. <view class="notes_title">备注</view>
  20. <view class="notes_textarea">
  21. <textarea placeholder-style="color:#CCCCCC" placeholder="请输入您的备注" maxlength="150" @input="handleInput"></textarea>
  22. <view class="notes_num">{{ textLength }}/150</view>
  23. </view>
  24. </view>
  25. <view class="notes2" v-else></view>
  26. <view class="btn">确认</view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. textLength: 0,
  34. activeIndex: 0,
  35. activeIndex2: 0,
  36. list: ['水电', '木工类', '行政楼', '泥工类', '其他'],
  37. List2: ['下水道', '安全指示牌', '消费应急灯', '排水管道', '吊顶', '风扇', '没电']
  38. }
  39. },
  40. methods: {
  41. handleChange(index) {
  42. this.activeIndex = index
  43. },
  44. handleChange2(index) {
  45. this.activeIndex2 = index
  46. },
  47. handleInput(e) {
  48. // console.log(e.detail.value.length)
  49. this.textLength = e.detail.value.length
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .container {
  56. display: flex;
  57. flex-direction: column;
  58. width: 100vw;
  59. overflow-y: auto;
  60. .search {
  61. display: flex;
  62. align-items: center;
  63. margin: 30rpx auto 30rpx;
  64. width: 690rpx;
  65. height: 80rpx;
  66. border-radius: 4rpx;
  67. background-color: #f2f2f2;
  68. img {
  69. margin: 0 20rpx;
  70. width: 40rpx;
  71. height: 40rpx;
  72. }
  73. input {
  74. flex: 1;
  75. padding: 10rpx;
  76. }
  77. }
  78. .body {
  79. display: flex;
  80. height: 686rpx;
  81. border-top: 1rpx solid #e5e5e5;
  82. .body_left {
  83. box-sizing: border-box;
  84. padding: 30rpx;
  85. width: 199rpx;
  86. border-right: 1rpx solid #cccccc;
  87. overflow-y: auto;
  88. .left_item {
  89. height: 80rpx;
  90. font-size: 28rpx;
  91. font-weight: bold;
  92. }
  93. .active {
  94. color: #6fb6b8;
  95. }
  96. }
  97. .body_right {
  98. flex: 1;
  99. box-sizing: border-box;
  100. padding: 35rpx 30rpx;
  101. overflow-y: auto;
  102. .right_item {
  103. float: left;
  104. box-sizing: border-box;
  105. padding: 10rpx 30rpx;
  106. margin: 0 20rpx 37rpx 0;
  107. height: 50rpx;
  108. line-height: 30rpx;
  109. text-align: center;
  110. color: #808080;
  111. font-size: 28rpx;
  112. border-radius: 53rpx;
  113. background-color: #e6e6e6;
  114. overflow: hidden;
  115. white-space: nowrap;
  116. text-overflow: ellipsis;
  117. }
  118. .active {
  119. color: #fff;
  120. background-color: #6fb6b8;
  121. }
  122. }
  123. }
  124. .notes {
  125. box-sizing: border-box;
  126. padding: 0 30rpx;
  127. border-top: 1rpx solid #e5e5e5;
  128. .notes_title {
  129. display: flex;
  130. align-items: center;
  131. height: 88rpx;
  132. font-size: 32rpx;
  133. font-weight: bold;
  134. }
  135. .notes_textarea {
  136. position: relative;
  137. height: 284rpx;
  138. border: 1rpx solid #e5e5e5;
  139. textarea {
  140. box-sizing: border-box;
  141. padding: 16rpx 20rpx 75rpx;
  142. width: 100%;
  143. font-size: 32rpx;
  144. }
  145. .notes_num {
  146. position: absolute;
  147. right: 20rpx;
  148. bottom: 14rpx;
  149. color: #a6a6a6;
  150. font-size: 32rpx;
  151. }
  152. }
  153. }
  154. .notes2 {
  155. height: 150rpx;
  156. }
  157. .btn {
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. margin: 55rpx auto 65rpx;
  162. width: 690rpx;
  163. height: 100rpx;
  164. color: #fff;
  165. font-size: 32rpx;
  166. border-radius: 12rpx;
  167. background-color: #6fb6b8;
  168. }
  169. }
  170. </style>