industrySelect.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. max-width: 500px;
  57. color: #fff;
  58. font-size: 18px;
  59. border: 0;
  60. outline: none;
  61. }
  62. .industry_sel {
  63. width: 100%;
  64. background-color: #fff;
  65. text-align: left;
  66. height: 100%;
  67. padding: 0 1.5rem;
  68. padding-bottom: 50px;
  69. }
  70. .industry_sel li {
  71. color: #202020;
  72. line-height: 60px;
  73. transition: 0.2s;
  74. position: relative;
  75. background-image: url('../static/img/icon_select.png');
  76. background-position: right center;
  77. background-size: 20px;
  78. background-repeat: no-repeat;
  79. }
  80. .industry_sel li.active {
  81. color: #ff5c5c;
  82. background-image: url('../static/img/icon_selected.png');
  83. transition: 0.2s;
  84. }
  85. .industry_sel li::after{
  86. position: absolute;
  87. content: '';
  88. display: block;
  89. height: 1px;
  90. left: 0;
  91. bottom: 0;
  92. right: 0;
  93. background-color: #f0f0f0;
  94. margin-right: -1.5rem;
  95. }
  96. </style>