search.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <img class="logo" :src="supplierInfo.logo" />
  5. <div class="mt-2 name">
  6. <span v-text="supplierInfo.shopName"></span><span>官方授权设备</span>
  7. </div>
  8. </div>
  9. <div class="page-content">
  10. <div class="title">SN码或机构名称:</div>
  11. <el-input
  12. placeholder="请输入设备SN码或机构名称搜索查询"
  13. v-model="keyword"
  14. class="input-with-select"
  15. >
  16. <el-select
  17. v-model="type"
  18. slot="prepend"
  19. placeholder="请选择"
  20. class="select-with-input"
  21. >
  22. <el-option label="SN码" value="1"></el-option>
  23. <el-option label="机构名" value="2"></el-option>
  24. </el-select>
  25. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  26. </el-input>
  27. <div class="button flex justify-center items-center" @click="onSearch">
  28. 查询
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import { mapGetters } from 'vuex'
  35. export default {
  36. layout: 'app-ross',
  37. data() {
  38. return {
  39. keyword: '',
  40. type: '1',
  41. }
  42. },
  43. computed: {
  44. ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  45. },
  46. methods: {
  47. onSearch() {
  48. if (!this.keyword) {
  49. this.$toast('请输入要查询的内容')
  50. return
  51. }
  52. this.$router.push(
  53. `${this.routePrefix}/approve/device/list?type=${
  54. this.type
  55. }&keyword=${encodeURIComponent(this.keyword)}&id=${
  56. this.$route.query.id
  57. }`
  58. )
  59. },
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .el-input {
  65. & > ::v-deep {
  66. .el-input.is-active .el-input__inner,
  67. .el-input__inner:focus {
  68. @include themify($themes) {
  69. border-color: themed('color');
  70. }
  71. }
  72. }
  73. }
  74. .input-with-select {
  75. ::v-deep {
  76. .el-input-group__prepend {
  77. background-color: #fff;
  78. }
  79. }
  80. }
  81. // pc 端
  82. @media screen and (min-width: 768px) {
  83. .el-input {
  84. ::v-deep {
  85. .el-select .el-input {
  86. width: 130px;
  87. }
  88. }
  89. }
  90. .page {
  91. position: relative;
  92. min-height: calc(100vh - 80px - 80px);
  93. background-color: #fff;
  94. }
  95. .page-top {
  96. height: 420px;
  97. @include themify($themes) {
  98. background: themed('pc-banner-device');
  99. }
  100. background-size: auto 420px;
  101. .logo {
  102. display: block;
  103. width: 120px;
  104. height: 120px;
  105. border-radius: 50%;
  106. background: #fff;
  107. }
  108. .name {
  109. font-size: 30px;
  110. color: #fff;
  111. }
  112. }
  113. .page-content {
  114. width: 518px;
  115. margin: 0 auto;
  116. .title {
  117. font-size: 18px;
  118. line-height: 24px;
  119. color: #282828;
  120. margin: 68px 0 12px;
  121. }
  122. .el-input {
  123. height: 46px;
  124. font-size: 16px;
  125. .el-input__icon {
  126. font-size: 24px;
  127. line-height: 46px;
  128. margin-left: 12px;
  129. }
  130. ::v-deep {
  131. & > .el-input__inner {
  132. height: 46px;
  133. padding-left: 55px;
  134. font-size: 18px;
  135. }
  136. }
  137. }
  138. .button {
  139. width: 295px;
  140. height: 50px;
  141. margin: 0 auto;
  142. border-radius: 4px;
  143. margin-top: 90px;
  144. cursor: pointer;
  145. @include themify($themes) {
  146. background-color: themed('color');
  147. color: #fff;
  148. }
  149. }
  150. }
  151. }
  152. // 移动 端
  153. @media screen and (max-width: 768px) {
  154. .el-input {
  155. ::v-deep {
  156. .select-with-input .el-input {
  157. width: 22vw;
  158. .el-input__inner {
  159. padding-left: 2.4vw;
  160. }
  161. }
  162. }
  163. }
  164. .page-top {
  165. height: 46vw;
  166. @include themify($themes) {
  167. background: themed('h5-banner-device');
  168. background-size: auto 46vw;
  169. }
  170. .logo {
  171. display: block;
  172. width: 14.8vw;
  173. height: 14.8vw;
  174. border-radius: 50%;
  175. background: #fff;
  176. }
  177. .name {
  178. font-size: 4vw;
  179. color: #fff;
  180. }
  181. }
  182. .page-content {
  183. position: relative;
  184. padding: 0 4.2vw;
  185. .title {
  186. font-size: 3.4vw;
  187. line-height: 4.5vw;
  188. color: #666;
  189. margin: 18vw 0 1.6vw;
  190. }
  191. .el-input {
  192. font-size: 3.4vw;
  193. .el-input__icon {
  194. font-size: 5.4vw;
  195. }
  196. }
  197. .button {
  198. height: 12vw;
  199. margin: 0 auto;
  200. border-radius: 2px;
  201. margin-top: 12.8vw;
  202. font-size: 3.6vw;
  203. cursor: pointer;
  204. @include themify($themes) {
  205. background-color: themed('color');
  206. color: #fff;
  207. }
  208. }
  209. }
  210. }
  211. </style>