index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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. <div class="area">
  55. <RossSelectGroup @change="onCityChange" ref="citySelect" />
  56. </div>
  57. <template v-if="list.length > 0 || searchFlag">
  58. <!-- 标题 -->
  59. <div class="title px-4 pt-12 pb-6 md:px-0">
  60. 共<span v-text="total"></span>台设备
  61. </div>
  62. <!-- 列表 -->
  63. <div class="list">
  64. <div
  65. class="section flex justify-between mb-4"
  66. v-for="item in list"
  67. :key="item.productId"
  68. @click="toDetail(item)"
  69. >
  70. <img class="cover" :src="item.productImage" />
  71. <div class="info">
  72. <div class="name" v-text="item.productName"></div>
  73. <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
  74. <el-popover placement="right" title="机构列表" trigger="hover">
  75. <template v-for="club in item.clubList">
  76. <div
  77. @click.stop="toClubDetail(club)"
  78. :key="club.authId"
  79. class="club-item"
  80. >
  81. {{ club.authParty }}
  82. </div>
  83. </template>
  84. <div class="club-name" slot="reference">
  85. 所属机构:
  86. <template v-for="(club, index) in item.clubList">
  87. <span :key="club.authId"
  88. ><i v-if="index !== 0">,</i>{{ club.authParty }}</span
  89. >
  90. </template>
  91. </div>
  92. </el-popover>
  93. </div>
  94. </div>
  95. </div>
  96. <!-- 列表为空 -->
  97. <SimpleEmpty
  98. v-if="!total && !isRequest"
  99. name="icon-empty-device.png"
  100. description="未找到相关设备~"
  101. ></SimpleEmpty>
  102. </template>
  103. </div>
  104. </van-list>
  105. </div>
  106. </template>
  107. <script>
  108. import deviceListMixin from '@/mixins/deviceList'
  109. export default {
  110. layout: 'app-ph',
  111. mixins: [deviceListMixin],
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .input-with-select {
  116. ::v-deep {
  117. .el-input-group__prepend {
  118. background-color: #fff;
  119. }
  120. }
  121. }
  122. // pc 端
  123. @media screen and (min-width: 768px) {
  124. .el-popover {
  125. .club-item {
  126. line-height: 24px;
  127. cursor: pointer;
  128. &:hover {
  129. color: #bc1724;
  130. }
  131. }
  132. }
  133. .page {
  134. @include useTheme() {
  135. position: relative;
  136. min-height: calc(100vh - 80px - 80px);
  137. background-color: #fff;
  138. .page-top {
  139. height: 420px;
  140. background: fetch('pc-banner-device');
  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. color: fetch('color');
  184. }
  185. }
  186. .list {
  187. display: flex;
  188. align-items: center;
  189. flex-wrap: wrap;
  190. justify-content: space-between;
  191. .empty {
  192. width: 390px;
  193. }
  194. .section {
  195. width: 490px;
  196. height: 136px;
  197. background-color: #f3f5f6;
  198. border-radius: 4px;
  199. box-sizing: border-box;
  200. padding: 16px;
  201. cursor: pointer;
  202. transition: all 0.4s;
  203. &:hover {
  204. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  205. }
  206. .cover {
  207. display: block;
  208. width: 104px;
  209. height: 104px;
  210. }
  211. .info {
  212. width: 336px;
  213. position: relative;
  214. .name {
  215. font-size: 18px;
  216. color: #101010;
  217. font-weight: bold;
  218. margin-bottom: 16px;
  219. margin-top: 4px;
  220. text-overflow: ellipsis;
  221. white-space: nowrap;
  222. overflow: hidden;
  223. }
  224. .code,
  225. .club-name {
  226. position: relative;
  227. font-size: 14px;
  228. color: #666;
  229. line-height: 24px;
  230. text-overflow: ellipsis;
  231. white-space: nowrap;
  232. overflow: hidden;
  233. margin-top: 6px;
  234. span {
  235. color: #1890ff;
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. // 移动 端
  246. @media screen and (max-width: 768px) {
  247. .page {
  248. @include useTheme() {
  249. .page-top {
  250. height: 46vw;
  251. background: fetch('h5-banner-device');
  252. background-size: auto 46vw;
  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. color: fetch('color');
  296. }
  297. }
  298. .list {
  299. display: flex;
  300. align-items: center;
  301. flex-direction: column;
  302. .section {
  303. width: 93.6vw;
  304. height: 26vw;
  305. background-color: #f3f5f6;
  306. border-radius: 4px;
  307. box-sizing: border-box;
  308. padding: 3.2vw;
  309. .cover {
  310. display: block;
  311. width: 19.6vw;
  312. height: 19.6vw;
  313. }
  314. .info {
  315. width: 64vw;
  316. position: relative;
  317. margin-left: 3.2vw;
  318. .name {
  319. font-size: 4vw;
  320. color: #101010;
  321. font-weight: bold;
  322. margin-bottom: 4vw;
  323. text-overflow: ellipsis;
  324. white-space: nowrap;
  325. overflow: hidden;
  326. }
  327. .code,
  328. .club-name {
  329. width: 66vw;
  330. position: relative;
  331. font-size: 3vw;
  332. color: #404040;
  333. line-height: 5vw;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. overflow: hidden;
  337. span {
  338. color: #6d9eff;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. }
  347. }
  348. </style>