index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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-ross',
  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. // pc 端
  124. @media screen and (min-width: 768px) {
  125. .el-popover {
  126. .club-item {
  127. line-height: 24px;
  128. cursor: pointer;
  129. &:hover {
  130. color: #f3920d;
  131. }
  132. }
  133. }
  134. .page {
  135. @include useTheme() {
  136. position: relative;
  137. min-height: calc(100vh - 80px - 80px);
  138. background-color: #fff;
  139. .page-top {
  140. height: 420px;
  141. background: fetch('pc-banner-device');
  142. background-size: auto 420px;
  143. .logo {
  144. display: block;
  145. width: 120px;
  146. height: 120px;
  147. border-radius: 50%;
  148. background: #fff;
  149. }
  150. .name {
  151. font-size: 30px;
  152. color: #fff;
  153. }
  154. }
  155. .page-content {
  156. width: 1000px;
  157. margin: 0 auto;
  158. .search-title {
  159. font-size: 16px;
  160. color: #404040;
  161. margin: 25px 0;
  162. }
  163. .search-container {
  164. display: flex;
  165. justify-content: space-between;
  166. .input-with-select {
  167. margin: 0 15px;
  168. .el-select {
  169. ::v-deep {
  170. .el-input {
  171. width: 130px;
  172. }
  173. }
  174. }
  175. }
  176. .submit {
  177. width: 295px;
  178. }
  179. }
  180. .title {
  181. font-size: 16px;
  182. color: #404040;
  183. span {
  184. color: fetch('color');
  185. }
  186. }
  187. .list {
  188. display: flex;
  189. align-items: center;
  190. flex-wrap: wrap;
  191. justify-content: space-between;
  192. .empty {
  193. width: 390px;
  194. }
  195. .section {
  196. width: 490px;
  197. height: 136px;
  198. background-color: #f3f5f6;
  199. border-radius: 4px;
  200. box-sizing: border-box;
  201. padding: 16px;
  202. cursor: pointer;
  203. transition: all 0.4s;
  204. &:hover {
  205. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  206. }
  207. .cover {
  208. display: block;
  209. width: 104px;
  210. height: 104px;
  211. }
  212. .info {
  213. width: 336px;
  214. position: relative;
  215. .name {
  216. font-size: 18px;
  217. color: #101010;
  218. font-weight: bold;
  219. margin-bottom: 16px;
  220. margin-top: 4px;
  221. text-overflow: ellipsis;
  222. white-space: nowrap;
  223. overflow: hidden;
  224. }
  225. .code,
  226. .club-name {
  227. position: relative;
  228. font-size: 14px;
  229. color: #666;
  230. line-height: 24px;
  231. text-overflow: ellipsis;
  232. white-space: nowrap;
  233. overflow: hidden;
  234. margin-top: 6px;
  235. span {
  236. color: #1890ff;
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. }
  246. // 移动 端
  247. @media screen and (max-width: 768px) {
  248. .page {
  249. @include useTheme() {
  250. .page-top {
  251. height: 46vw;
  252. background: fetch('h5-banner-device');
  253. background-size: auto 46vw;
  254. .logo {
  255. display: block;
  256. width: 14.8vw;
  257. height: 14.8vw;
  258. border-radius: 50%;
  259. background: #fff;
  260. }
  261. .name {
  262. font-size: 4vw;
  263. color: #fff;
  264. }
  265. }
  266. .page-content {
  267. position: relative;
  268. .search-title {
  269. font-size: 3.4vw;
  270. color: #404040;
  271. margin: 3.2vw;
  272. }
  273. .search-container {
  274. padding: 0 3.2vw;
  275. .select-type {
  276. width: 100%;
  277. }
  278. .input-with-select {
  279. margin: 3.2vw 0;
  280. .el-select {
  281. ::v-deep {
  282. .el-input {
  283. width: 130px;
  284. }
  285. }
  286. }
  287. }
  288. .submit {
  289. width: 100%;
  290. }
  291. }
  292. .title {
  293. font-size: 3.4vw;
  294. color: #404040;
  295. span {
  296. color: fetch('color');
  297. }
  298. }
  299. .list {
  300. display: flex;
  301. align-items: center;
  302. flex-direction: column;
  303. .section {
  304. width: 93.6vw;
  305. height: 26vw;
  306. background-color: #f3f5f6;
  307. border-radius: 4px;
  308. box-sizing: border-box;
  309. padding: 3.2vw;
  310. .cover {
  311. display: block;
  312. width: 19.6vw;
  313. height: 19.6vw;
  314. }
  315. .info {
  316. width: 64vw;
  317. position: relative;
  318. margin-left: 3.2vw;
  319. .name {
  320. font-size: 4vw;
  321. color: #101010;
  322. font-weight: bold;
  323. margin-bottom: 4vw;
  324. text-overflow: ellipsis;
  325. white-space: nowrap;
  326. overflow: hidden;
  327. }
  328. .code,
  329. .club-name {
  330. width: 66vw;
  331. position: relative;
  332. font-size: 3vw;
  333. color: #404040;
  334. line-height: 5vw;
  335. text-overflow: ellipsis;
  336. white-space: nowrap;
  337. overflow: hidden;
  338. span {
  339. color: #6d9eff;
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. </style>