subIndustry.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="all_industry">
  3. <tit :tname="name"/>
  4. <!-- 选择大区 -->
  5. <ul class="industry_sel">
  6. <li
  7. v-for="(item,index) in industry"
  8. :key="index"
  9. @click="chooseOne(index)"
  10. :class="{active:index==current}"
  11. >{{ item.text }}</li>
  12. </ul>
  13. <!-- end:选择大区 -->
  14. <button>确定</button>
  15. </div>
  16. </template>
  17. <script>
  18. import tit from '~/components/titles.vue'
  19. export default {
  20. data() {
  21. return {
  22. name:'选择行业',
  23. industry: [
  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. { text: '工业仓储行政建筑' },
  38. { text: '绿化生态旅游' },
  39. { text: '其他' },
  40. ],
  41. }
  42. },
  43. methods:{
  44. chooseOne: function(index){
  45. this.current=index;
  46. }
  47. },
  48. components:{
  49. tit,
  50. }
  51. }
  52. </script>
  53. <style>
  54. .all_industry button {
  55. width: 100%;
  56. height: 50px;
  57. line-height: 50px;
  58. position: fixed;
  59. background-color: #ff5c5c;
  60. text-align: center;
  61. bottom: 0;
  62. max-width: 500px;
  63. color: #fff;
  64. font-size: 18px;
  65. border: 0;
  66. outline: none;
  67. }
  68. .industry_sel {
  69. width: 100%;
  70. background-color: #fff;
  71. text-align: left;
  72. height: 100%;
  73. padding: 0 1.5rem;
  74. padding-bottom: 50px;
  75. }
  76. .industry_sel li {
  77. color: #202020;
  78. line-height: 60px;
  79. transition: 0.2s;
  80. position: relative;
  81. background-image: url('../../static/img/icon_select.png');
  82. background-position: right center;
  83. background-size: 20px;
  84. background-repeat: no-repeat;
  85. }
  86. .industry_sel li.active {
  87. color: #ff5c5c;
  88. background-image: url('../../static/img/icon_selected.png');
  89. transition: 0.2s;
  90. }
  91. .industry_sel li::after{
  92. position: absolute;
  93. content: '';
  94. display: block;
  95. height: 1px;
  96. left: 0;
  97. bottom: 0;
  98. right: 0;
  99. background-color: #f0f0f0;
  100. margin-right: -1.5rem;
  101. }
  102. </style>