subKeywords.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="sub_key">
  3. <tit :tname="name"/>
  4. <!-- 关键词列表 -->
  5. <ul class="stage_box">
  6. <li v-for="(item,index) in stages" :key="index">
  7. {{ item.text }}
  8. <img src="../../static/img/icon_delete.png">
  9. </li>
  10. </ul>
  11. <div class="add_box">
  12. <input type="text" placeholder="输入关键词">
  13. <button>+&nbsp;添加</button>
  14. </div>
  15. <p>提示:最多添加10个关键词?</p>
  16. </div>
  17. </template>
  18. <script>
  19. import tit from '~/components/titles.vue'
  20. export default {
  21. data() {
  22. return {
  23. name: '自定义关键词',
  24. stages: [
  25. { text: '电源' },
  26. { text: '工程筹备' },
  27. { text: '主体施工' },
  28. { text: '设备安装' },
  29. { text: '电源' },
  30. { text: '工程筹备' },
  31. { text: '主体施工' },
  32. { text: '设备安装' }
  33. ]
  34. }
  35. },
  36. methods: {
  37. chooseOne: function(index) {
  38. this.current = index
  39. }
  40. },
  41. components: {
  42. tit
  43. }
  44. }
  45. </script>
  46. <style>
  47. .sub_key {
  48. }
  49. .sub_key p{
  50. color: #ccc;
  51. font-size: 12px;
  52. padding-left: 2rem;
  53. margin-top: 10px;
  54. }
  55. .sub_key .stage_box {
  56. width: 100%;
  57. padding: 0 1.5rem;
  58. }
  59. .sub_key .stage_box li {
  60. background-color: #f2f2fa;
  61. border-radius: 4px;
  62. padding: 6px 12px;
  63. display: inline-block;
  64. margin-right: 10px;
  65. text-align: center;
  66. margin-top: 20px;
  67. }
  68. .sub_key .stage_box li img {
  69. width: 10px;
  70. vertical-align: middle;
  71. margin-left: 6px;
  72. }
  73. .sub_key .stage_box li::after {
  74. position: absolute;
  75. content: '';
  76. display: block;
  77. height: 1px;
  78. left: 0;
  79. bottom: 0;
  80. right: 0;
  81. background-color: #f0f0f0;
  82. margin-right: -1.5rem;
  83. margin-left: -1.5rem;
  84. }
  85. .sub_key .stage_box li.active {
  86. background-image: url('../../static/img/icon_selected.png');
  87. color: #ff5c5c;
  88. }
  89. .add_box {
  90. width: 100%;
  91. border-radius: 8px;
  92. position: relative;
  93. margin-top: 20px;
  94. padding: 0 1.5rem;
  95. }
  96. .add_box input {
  97. height: 40px;
  98. line-height: 40px;
  99. border: 1px solid #f0f0f0;
  100. width: 100%;
  101. padding-left: 1rem;
  102. padding-right: 8rem;
  103. border-radius: 8px;
  104. outline: none;
  105. }
  106. .add_box button {
  107. height: 40px;
  108. line-height: 40px;
  109. position: absolute;
  110. top: 0;
  111. right: 1.5rem;
  112. background-color: #ff5c5c;
  113. text-align: center;
  114. border: none;
  115. outline: none;
  116. color: #fff;
  117. padding: 0 20px;
  118. border-radius: 8px;
  119. }
  120. </style>