index.vue 9.3 KB

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