index.vue 9.3 KB

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