industrySelect.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div class="all_industry">
  3. <!-- 选择大区 -->
  4. <ul class="industry_sel">
  5. <li
  6. v-for="(item,index) in industry"
  7. :key="index"
  8. @click="addClass(index)"
  9. :class="{chooseOne:index==current}"
  10. >{{ item.text }}</li>
  11. </ul>
  12. <!-- end:选择大区 -->
  13. <button>确定</button>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. industry: [
  21. { text: '全部' },
  22. { text: '电力' },
  23. { text: '石油石化天然气' },
  24. { text: '市政交通运输' },
  25. { text: '五金建材机械' },
  26. { text: '农林水利环保' },
  27. { text: '冶金矿产重工' },
  28. { text: '医药化工' },
  29. { text: '电子电器通信' },
  30. { text: '轻工食品日用品' },
  31. { text: '办公展览停车场建筑' },
  32. { text: '商业酒店住宅建筑' },
  33. { text: '医疗文教娱乐建筑' },
  34. { text: '工业仓储行政建筑' },
  35. { text: '绿化生态旅游' },
  36. { text: '其他' },
  37. ],
  38. }
  39. },
  40. methods:{
  41. chooseOne: function(index){
  42. this.current=index;
  43. }
  44. }
  45. }
  46. </script>
  47. <style>
  48. .all_industry button {
  49. width: 100%;
  50. height: 50px;
  51. line-height: 50px;
  52. position: fixed;
  53. background-color: #ff5c5c;
  54. text-align: center;
  55. bottom: 0;
  56. left: 0;
  57. right: 0;
  58. color: #fff;
  59. font-size: 18px;
  60. border: 0;
  61. outline: none;
  62. }
  63. .industry_sel {
  64. width: 100%;
  65. background-color: #fff;
  66. text-align: left;
  67. height: 100%;
  68. padding: 0 1.5rem;
  69. padding-bottom: 50px;
  70. }
  71. .industry_sel li {
  72. color: #202020;
  73. line-height: 60px;
  74. transition: 0.2s;
  75. position: relative;
  76. background-image: url('../static/img/icon_select.png');
  77. background-position: right center;
  78. background-size: 20px;
  79. background-repeat: no-repeat;
  80. }
  81. .industry_sel li.active {
  82. color: #ff5c5c;
  83. background-image: url('../static/img/icon_selected.png');
  84. transition: 0.2s;
  85. }
  86. .industry_sel li::after{
  87. position: absolute;
  88. content: '';
  89. display: block;
  90. height: 1px;
  91. left: 0;
  92. bottom: 0;
  93. right: 0;
  94. background-color: #f0f0f0;
  95. margin-right: -1.5rem;
  96. }
  97. </style>