index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <div class="page">
  3. <van-list
  4. v-model="loadingMore"
  5. :finished="finished"
  6. :immediate-check="false"
  7. :finished-text="total ? '没有更多了' : ''"
  8. @load="onLoadMore"
  9. >
  10. <div class="page-top flex flex-col justify-center items-center">
  11. <!-- <img class="logo" :src="supplierInfo.logo" /> -->
  12. <div class="mt-2 name">
  13. <!-- <span v-text="supplierInfo.shopName"></span> -->
  14. <!--<span>官方授权设备</span>-->
  15. </div>
  16. </div>
  17. <div class="page-content">
  18. <div class="search-title">设备种类查询:</div>
  19. <div class="search-container">
  20. <el-select
  21. v-model="listQuery.productTypeId"
  22. slot="prepend"
  23. placeholder="设备种类"
  24. class="select-type"
  25. >
  26. <template v-for="product in productSelectList">
  27. <el-option
  28. :label="product.name"
  29. :value="product.productTypeId"
  30. :key="product.productTypeId"
  31. ></el-option>
  32. </template>
  33. </el-select>
  34. <el-input
  35. :placeholder="
  36. searchQuery.type === 1 ? '请输入SN码' : '请输入完整的机构名称'
  37. "
  38. v-model="searchQuery.keyword"
  39. class="input-with-select"
  40. >
  41. <el-select
  42. v-model="searchQuery.type"
  43. slot="prepend"
  44. placeholder="请选择"
  45. >
  46. <el-option label="SN码" :value="1"></el-option>
  47. <el-option label="机构名" :value="2"></el-option>
  48. </el-select>
  49. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  50. </el-input>
  51. <el-button class="submit" type="warning" @click="onSearch"
  52. >查询</el-button
  53. >
  54. </div>
  55. <div class="area">
  56. <RossSelectGroup @change="onCityChange" ref="citySelect" />
  57. </div>
  58. <template v-if="list.length > 0 || searchFlag">
  59. <!-- 标题 -->
  60. <div class="title px-4 pt-12 pb-6 md:px-0">
  61. 共<span v-text="total"></span>台设备
  62. </div>
  63. <!-- 列表 -->
  64. <div class="list">
  65. <div
  66. class="section flex justify-between mb-4"
  67. v-for="item in list"
  68. :key="item.productId"
  69. @click="toDetail(item)"
  70. >
  71. <img class="cover" :src="item.productImage" />
  72. <div class="info">
  73. <div class="name" v-text="item.productName"></div>
  74. <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
  75. <el-popover placement="right" title="机构列表" trigger="hover">
  76. <template v-for="club in item.clubList">
  77. <div
  78. @click.stop="toClubDetail(club)"
  79. :key="club.authId"
  80. class="club-item"
  81. >
  82. {{ club.authParty }}
  83. </div>
  84. </template>
  85. <div class="club-name" slot="reference">
  86. 所属机构:
  87. <template v-for="(club, index) in item.clubList">
  88. <span :key="club.authId"
  89. ><i v-if="index !== 0">,</i>{{ club.authParty }}</span
  90. >
  91. </template>
  92. </div>
  93. </el-popover>
  94. </div>
  95. </div>
  96. </div>
  97. <!-- 列表为空 -->
  98. <SimpleEmpty
  99. v-if="!total && !isRequest"
  100. name="icon-empty-device.png"
  101. description="未找到相关设备~"
  102. ></SimpleEmpty>
  103. </template>
  104. </div>
  105. </van-list>
  106. </div>
  107. </template>
  108. <script>
  109. import deviceListMixin from '@/mixins/deviceList'
  110. export default {
  111. layout: 'app-asbl',
  112. mixins: [deviceListMixin],
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .input-with-select {
  117. ::v-deep {
  118. .el-input-group__prepend {
  119. background-color: #fff;
  120. }
  121. }
  122. }
  123. ::v-deep {
  124. .el-button--warning {
  125. background-color: #36bbce;
  126. border-color: #36bbce;
  127. &:hover {
  128. background: #36bbce;
  129. border-color: #36bbce;
  130. }
  131. }
  132. }
  133. // pc 端
  134. @media screen and (min-width: 768px) {
  135. .el-popover {
  136. .club-item {
  137. line-height: 24px;
  138. cursor: pointer;
  139. &:hover {
  140. color: #36bbce;
  141. }
  142. }
  143. }
  144. .page {
  145. @include useTheme() {
  146. position: relative;
  147. min-height: calc(100vh - 80px - 80px);
  148. background-color: #fff;
  149. .page-top {
  150. height: 420px;
  151. background: fetch('pc-banner-device');
  152. background-size: auto 420px;
  153. .logo {
  154. display: block;
  155. width: 120px;
  156. height: 120px;
  157. border-radius: 50%;
  158. background: #fff;
  159. }
  160. .name {
  161. font-size: 30px;
  162. color: #fff;
  163. }
  164. }
  165. .page-content {
  166. width: 1000px;
  167. margin: 0 auto;
  168. .search-title {
  169. font-size: 16px;
  170. color: #404040;
  171. margin: 25px 0;
  172. }
  173. .search-container {
  174. display: flex;
  175. justify-content: space-between;
  176. .input-with-select {
  177. margin: 0 15px;
  178. .el-select {
  179. ::v-deep {
  180. .el-input {
  181. width: 130px;
  182. }
  183. }
  184. }
  185. }
  186. .submit {
  187. width: 295px;
  188. }
  189. }
  190. .title {
  191. font-size: 16px;
  192. color: #404040;
  193. span {
  194. color: fetch('color');
  195. }
  196. }
  197. .list {
  198. display: flex;
  199. align-items: center;
  200. flex-wrap: wrap;
  201. justify-content: space-between;
  202. .empty {
  203. width: 390px;
  204. }
  205. .section {
  206. width: 490px;
  207. height: 136px;
  208. background-color: #f3f5f6;
  209. border-radius: 4px;
  210. box-sizing: border-box;
  211. padding: 16px;
  212. cursor: pointer;
  213. transition: all 0.4s;
  214. &:hover {
  215. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  216. }
  217. .cover {
  218. display: block;
  219. width: 104px;
  220. height: 104px;
  221. }
  222. .info {
  223. width: 336px;
  224. position: relative;
  225. .name {
  226. font-size: 18px;
  227. color: #101010;
  228. font-weight: bold;
  229. margin-bottom: 16px;
  230. margin-top: 4px;
  231. text-overflow: ellipsis;
  232. white-space: nowrap;
  233. overflow: hidden;
  234. }
  235. .code,
  236. .club-name {
  237. position: relative;
  238. font-size: 14px;
  239. color: #666;
  240. line-height: 24px;
  241. text-overflow: ellipsis;
  242. white-space: nowrap;
  243. overflow: hidden;
  244. margin-top: 6px;
  245. span {
  246. color: #1890ff;
  247. }
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. // 移动 端
  257. @media screen and (max-width: 768px) {
  258. .page {
  259. @include useTheme() {
  260. .page-top {
  261. height: 46vw;
  262. background: fetch('h5-banner-device');
  263. background-size: auto 46vw;
  264. .logo {
  265. display: block;
  266. width: 14.8vw;
  267. height: 14.8vw;
  268. border-radius: 50%;
  269. background: #fff;
  270. }
  271. .name {
  272. font-size: 4vw;
  273. color: #fff;
  274. }
  275. }
  276. .page-content {
  277. position: relative;
  278. .search-title {
  279. font-size: 3.4vw;
  280. color: #404040;
  281. margin: 3.2vw;
  282. }
  283. .search-container {
  284. padding: 0 3.2vw;
  285. .select-type {
  286. width: 100%;
  287. }
  288. .input-with-select {
  289. margin: 3.2vw 0;
  290. .el-select {
  291. ::v-deep {
  292. .el-input {
  293. width: 130px;
  294. }
  295. }
  296. }
  297. }
  298. .submit {
  299. width: 100%;
  300. }
  301. }
  302. .title {
  303. font-size: 3.4vw;
  304. color: #404040;
  305. span {
  306. color: fetch('color');
  307. }
  308. }
  309. .list {
  310. display: flex;
  311. align-items: center;
  312. flex-direction: column;
  313. .section {
  314. width: 93.6vw;
  315. height: 26vw;
  316. background-color: #f3f5f6;
  317. border-radius: 4px;
  318. box-sizing: border-box;
  319. padding: 3.2vw;
  320. .cover {
  321. display: block;
  322. width: 19.6vw;
  323. height: 19.6vw;
  324. }
  325. .info {
  326. width: 64vw;
  327. position: relative;
  328. margin-left: 3.2vw;
  329. .name {
  330. font-size: 4vw;
  331. color: #101010;
  332. font-weight: bold;
  333. margin-bottom: 4vw;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. overflow: hidden;
  337. }
  338. .code,
  339. .club-name {
  340. width: 66vw;
  341. position: relative;
  342. font-size: 3vw;
  343. color: #404040;
  344. line-height: 5vw;
  345. text-overflow: ellipsis;
  346. white-space: nowrap;
  347. overflow: hidden;
  348. span {
  349. color: #6d9eff;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. }
  359. </style>