star-list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <template>
  2. <div class="page">
  3. <div class="page-content">
  4. <!-- 标题 -->
  5. <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
  6. <div>明星机构</div>
  7. <div>共<span v-text="total" class="font-bold"></span>家明星机构</div>
  8. </div>
  9. <!-- 列表 -->
  10. <div class="list">
  11. <template v-for="item in list">
  12. <div
  13. class="section flex justify-between mb-4"
  14. :key="item.authId"
  15. @click="toDetail(item)"
  16. >
  17. <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
  18. <div class="info">
  19. <div class="name" v-text="item.authParty"></div>
  20. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  21. <div class="address">
  22. {{ formatAddress(item.area, item.address) }}
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import { mapGetters } from 'vuex'
  33. import { drawLogo, debounce } from '@/utils'
  34. export default {
  35. layout: 'app-ross',
  36. data() {
  37. return {
  38. finished: false,
  39. isRequest: true,
  40. list: [],
  41. }
  42. },
  43. computed: {
  44. ...mapGetters(['authUserId', 'routePrefix']),
  45. total() {
  46. return this.list.length
  47. },
  48. },
  49. mounted() {
  50. this.initData()
  51. },
  52. methods: {
  53. // 绘制logo的方法
  54. drawLogo,
  55. // 查看详情
  56. toDetail(item) {
  57. const url = `${this.routePrefix}/approve/club/detail?id=${item.authId}`
  58. this.$router.push(url)
  59. },
  60. // 初始化页面数据
  61. async initData() {
  62. // 获取机构列表
  63. this.fetchList()
  64. },
  65. fetchList: debounce(async function () {
  66. try {
  67. // 自定义加载图标
  68. this.$toast.loading({
  69. message: '正在获取明星机构...',
  70. duration: 0,
  71. })
  72. const res = await this.$http.api.getAuthClubStarList({
  73. authUserId: this.authUserId,
  74. })
  75. this.list = res.data
  76. } catch (error) {
  77. console.log(error)
  78. } finally {
  79. this.$toast.clear()
  80. }
  81. }, 400),
  82. // 格式化地址
  83. formatAddress(a1, a2) {
  84. let resutl = ''
  85. if (typeof a1 === 'string') {
  86. resutl += a1
  87. }
  88. if (typeof a2 === 'string') {
  89. resutl += a2
  90. }
  91. return resutl || '暂无'
  92. },
  93. },
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .el-input {
  98. ::v-deep {
  99. & > {
  100. .el-input.is-active .el-input__inner,
  101. .el-input__inner:focus {
  102. @include themify($themes) {
  103. border-color: themed('color');
  104. }
  105. }
  106. }
  107. }
  108. }
  109. // pc 端
  110. @media screen and (min-width: 768px) {
  111. .page {
  112. position: relative;
  113. min-height: calc(100vh - 80px - 80px);
  114. background-color: #fff;
  115. }
  116. .page-top {
  117. height: 530px;
  118. @include themify($themes) {
  119. background-image: themed('pc-banner-club');
  120. }
  121. background-size: cover;
  122. background-position: center;
  123. }
  124. .page-content {
  125. position: relative;
  126. width: 1000px;
  127. margin: 0 auto;
  128. .title {
  129. font-size: 16px;
  130. color: #404040;
  131. span {
  132. @include themify($themes) {
  133. color: themed('color');
  134. }
  135. }
  136. }
  137. .filter {
  138. padding: 48px 0 105px;
  139. .search {
  140. width: 640px;
  141. margin: 0 auto;
  142. .el-input {
  143. height: 46px;
  144. font-size: 16px;
  145. .el-input__icon {
  146. font-size: 24px;
  147. line-height: 46px;
  148. margin-left: 12px;
  149. }
  150. ::v-deep {
  151. & > .el-input__inner {
  152. height: 46px;
  153. padding-left: 55px;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. .navbar {
  160. position: absolute;
  161. top: 240px;
  162. right: -168px;
  163. width: 120px;
  164. border-radius: 16px;
  165. background: #fff;
  166. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  167. padding: 24px 0;
  168. box-sizing: border-box;
  169. z-index: 2;
  170. .link {
  171. &:hover {
  172. .icon {
  173. &.icon-device {
  174. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png)
  175. no-repeat center center,
  176. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  177. background-size: 48px, 100%;
  178. }
  179. &.icon-doctor {
  180. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png)
  181. no-repeat center center,
  182. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  183. background-size: 48px, 100%;
  184. }
  185. }
  186. .text {
  187. @include themify($themes) {
  188. color: themed('color');
  189. }
  190. }
  191. }
  192. span {
  193. display: block;
  194. }
  195. .icon {
  196. width: 72px;
  197. height: 72px;
  198. // background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  199. background-color: #f6f6f7;
  200. border-radius: 12px;
  201. &.icon-device {
  202. background: url(~assets/theme-images/ross/pc-nav-entry-device.png)
  203. no-repeat center center #f6f6f7;
  204. background-size: 48px;
  205. }
  206. &.icon-doctor {
  207. background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png)
  208. no-repeat center center #f6f6f7;
  209. background-size: 48px;
  210. }
  211. }
  212. .text {
  213. font-size: 16px;
  214. color: #404040;
  215. margin-top: 8px;
  216. }
  217. }
  218. }
  219. .list {
  220. display: flex;
  221. align-items: center;
  222. justify-content: space-between;
  223. flex-wrap: wrap;
  224. .empty {
  225. width: 390px;
  226. }
  227. .section {
  228. width: 490px;
  229. height: 136px;
  230. background-color: #f3f5f6;
  231. border-radius: 4px;
  232. box-sizing: border-box;
  233. padding: 16px;
  234. cursor: pointer;
  235. transition: all 0.4s;
  236. &:hover {
  237. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  238. }
  239. .cover {
  240. display: block;
  241. width: 104px;
  242. height: 104px;
  243. }
  244. .info {
  245. position: relative;
  246. margin-left: 12px;
  247. width: 330px;
  248. .name {
  249. width: 200px;
  250. font-size: 18px;
  251. color: #101010;
  252. font-weight: bold;
  253. margin-bottom: 24px;
  254. text-overflow: ellipsis;
  255. white-space: nowrap;
  256. overflow: hidden;
  257. }
  258. .mobile,
  259. .address {
  260. width: 268px;
  261. position: relative;
  262. font-size: 14px;
  263. color: #404040;
  264. padding-left: 24px;
  265. line-height: 24px;
  266. text-overflow: ellipsis;
  267. white-space: nowrap;
  268. margin-top: 6px;
  269. overflow: hidden;
  270. &::after {
  271. content: '';
  272. display: block;
  273. width: 16px;
  274. height: 16px;
  275. position: absolute;
  276. left: 0;
  277. top: 50%;
  278. transform: translateY(-50%);
  279. background-size: 16px;
  280. background-repeat: no-repeat;
  281. }
  282. }
  283. .mobile {
  284. &::after {
  285. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  286. }
  287. }
  288. .address {
  289. &::after {
  290. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  291. }
  292. }
  293. .distance {
  294. position: absolute;
  295. font-size: 14px;
  296. color: #404040;
  297. top: 2px;
  298. right: 0;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. }
  305. // 移动 端
  306. @media screen and (max-width: 768px) {
  307. .page-top {
  308. height: 100vw;
  309. @include themify($themes) {
  310. background: themed('h5-banner-club');
  311. }
  312. background-size: 100vw 100vw !important;
  313. .logo {
  314. display: block;
  315. width: 14.8vw;
  316. height: 14.8vw;
  317. border-radius: 50%;
  318. background: #fff;
  319. }
  320. .name {
  321. font-size: 4vw;
  322. color: #fff;
  323. }
  324. }
  325. .page-content {
  326. position: relative;
  327. .title {
  328. font-size: 3.4vw;
  329. color: #404040;
  330. span {
  331. @include themify($themes) {
  332. color: themed('color');
  333. }
  334. }
  335. }
  336. .filter {
  337. padding: 6.4vw 3.2vw 12.8vw;
  338. }
  339. .navbar {
  340. position: fixed;
  341. top: 50% !important;
  342. right: 3.2vw;
  343. left: unset !important;
  344. width: 14vw;
  345. border-radius: 1.6vw;
  346. background: #fff;
  347. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  348. padding: 2.8vw 0;
  349. box-sizing: border-box;
  350. z-index: 2;
  351. span {
  352. display: block;
  353. }
  354. .icon {
  355. position: relative;
  356. width: 7.2vw;
  357. height: 7.2vw;
  358. border-radius: 1.2vw;
  359. background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  360. &.icon-device,
  361. &.icon-doctor {
  362. &::after {
  363. content: '';
  364. display: block;
  365. width: 4.8vw;
  366. height: 4.8vw;
  367. position: absolute;
  368. left: 50%;
  369. top: 50%;
  370. transform: translate(-50%, -50%);
  371. background-size: 4.8vw !important;
  372. }
  373. }
  374. &.icon-device {
  375. &::after {
  376. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png)
  377. no-repeat center;
  378. }
  379. }
  380. &.icon-doctor {
  381. &::after {
  382. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png)
  383. no-repeat center;
  384. }
  385. }
  386. }
  387. .text {
  388. font-size: 2.4vw;
  389. color: #f3920d;
  390. margin-top: 1.2vw;
  391. }
  392. }
  393. }
  394. .list {
  395. display: flex;
  396. align-items: center;
  397. flex-direction: column;
  398. .section {
  399. width: 93.6vw;
  400. height: 26vw;
  401. background-color: #f3f5f6;
  402. border-radius: 4px;
  403. box-sizing: border-box;
  404. padding: 3.2vw;
  405. .cover {
  406. display: block;
  407. width: 19.6vw;
  408. height: 19.6vw;
  409. }
  410. .info {
  411. position: relative;
  412. margin-left: 3.2vw;
  413. .name {
  414. width: 48vw;
  415. font-size: 4vw;
  416. color: #101010;
  417. font-weight: bold;
  418. margin-bottom: 4vw;
  419. text-overflow: ellipsis;
  420. white-space: nowrap;
  421. overflow: hidden;
  422. }
  423. .mobile,
  424. .address {
  425. width: 66vw;
  426. position: relative;
  427. font-size: 3vw;
  428. color: #404040;
  429. padding-left: 5vw;
  430. line-height: 5vw;
  431. text-overflow: ellipsis;
  432. white-space: nowrap;
  433. overflow: hidden;
  434. &::after {
  435. content: '';
  436. display: block;
  437. width: 4vw;
  438. height: 4vw;
  439. position: absolute;
  440. left: 0;
  441. top: 50%;
  442. transform: translateY(-50%);
  443. background-size: 4vw 4vw;
  444. background-repeat: no-repeat;
  445. }
  446. }
  447. .mobile {
  448. &::after {
  449. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  450. }
  451. }
  452. .address {
  453. &::after {
  454. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  455. }
  456. }
  457. .distance {
  458. position: absolute;
  459. font-size: 3vw;
  460. color: #404040;
  461. top: 0.8vw;
  462. right: 0;
  463. }
  464. }
  465. }
  466. }
  467. }
  468. </style>