index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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><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-ross',
  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. position: relative;
  132. min-height: calc(100vh - 80px - 80px);
  133. background-color: #fff;
  134. }
  135. .page-top {
  136. height: 420px;
  137. @include themify($themes) {
  138. background: themed('pc-banner-device');
  139. }
  140. background-size: auto 420px;
  141. .logo {
  142. display: block;
  143. width: 120px;
  144. height: 120px;
  145. border-radius: 50%;
  146. background: #fff;
  147. }
  148. .name {
  149. font-size: 30px;
  150. color: #fff;
  151. }
  152. }
  153. .page-content {
  154. width: 1000px;
  155. margin: 0 auto;
  156. .search-title {
  157. font-size: 16px;
  158. color: #404040;
  159. margin: 25px 0;
  160. }
  161. .search-container {
  162. display: flex;
  163. justify-content: space-between;
  164. .input-with-select {
  165. margin: 0 15px;
  166. .el-select {
  167. ::v-deep {
  168. .el-input {
  169. width: 130px;
  170. }
  171. }
  172. }
  173. }
  174. .submit {
  175. width: 295px;
  176. }
  177. }
  178. .title {
  179. font-size: 16px;
  180. color: #404040;
  181. span {
  182. @include themify($themes) {
  183. color: themed('color');
  184. }
  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. @media screen and (max-width: 768px) {
  246. .page-top {
  247. height: 46vw;
  248. @include themify($themes) {
  249. background: themed('h5-banner-device');
  250. background-size: auto 46vw;
  251. }
  252. .logo {
  253. display: block;
  254. width: 14.8vw;
  255. height: 14.8vw;
  256. border-radius: 50%;
  257. background: #fff;
  258. }
  259. .name {
  260. font-size: 4vw;
  261. color: #fff;
  262. }
  263. }
  264. .page-content {
  265. position: relative;
  266. .search-title {
  267. font-size: 3.4vw;
  268. color: #404040;
  269. margin: 3.2vw;
  270. }
  271. .search-container {
  272. padding: 0 3.2vw;
  273. .select-type {
  274. width: 100%;
  275. }
  276. .input-with-select {
  277. margin: 3.2vw 0;
  278. .el-select {
  279. ::v-deep {
  280. .el-input {
  281. width: 130px;
  282. }
  283. }
  284. }
  285. }
  286. .submit {
  287. width: 100%;
  288. }
  289. }
  290. .title {
  291. font-size: 3.4vw;
  292. color: #404040;
  293. span {
  294. @include themify($themes) {
  295. color: themed('color');
  296. }
  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. </style>