index.vue 8.6 KB

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