star-list.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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-content">
  11. <!-- 标题 -->
  12. <div class="title flex justify-between px-4 pt-8 pb-8 md:px-0">
  13. <div>明星机构</div>
  14. <div>共<span v-text="total"></span>家明星机构</div>
  15. </div>
  16. <!-- 列表 -->
  17. <div class="list">
  18. <template v-for="item in list">
  19. <div
  20. class="section flex justify-between mb-4"
  21. :key="item.authId"
  22. @click="toDetail(item)"
  23. >
  24. <img class="cover" :src="item.logo || drawLogo(item.clubName)" />
  25. <div class="info">
  26. <div class="name" v-text="item.clubName"></div>
  27. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  28. <div class="address">
  29. {{ formatAddress(item.area, item.address) }}
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <div class="empty" v-for="i in emptyList" :key="'empty-' + i"></div>
  35. </div>
  36. <!-- 列表为空 -->
  37. <SimpleEmpty
  38. v-if="!total && !isRequest"
  39. name="icon-empty-club.png"
  40. description="敬请期待~"
  41. ></SimpleEmpty>
  42. </div>
  43. </van-list>
  44. </div>
  45. </template>
  46. <script>
  47. import clubStarListMixin from '@/mixins/clubStarList'
  48. export default {
  49. layout: 'app-ph',
  50. mixins: [clubStarListMixin],
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. // pc 端
  55. @media screen and (min-width: 768px) {
  56. .page {
  57. @include useTheme() {
  58. position: relative;
  59. min-height: calc(100vh - 80px - 80px);
  60. background-color: #fff;
  61. .page-top {
  62. height: 420px;
  63. background: fetch('pc-banner-club');
  64. background-size: auto 420px;
  65. .logo {
  66. display: block;
  67. width: 120px;
  68. height: 120px;
  69. border-radius: 50%;
  70. background: #fff;
  71. }
  72. .name {
  73. font-size: 30px;
  74. color: #fff;
  75. }
  76. .logo,
  77. .name {
  78. transform: translateY(-60px);
  79. }
  80. }
  81. .page-content {
  82. width: 1200px;
  83. margin: 0 auto;
  84. .search {
  85. position: absolute;
  86. left: 50%;
  87. top: 260px;
  88. transform: translateX(-50%);
  89. }
  90. .city {
  91. position: absolute;
  92. left: 50%;
  93. top: 320px;
  94. transform: translateX(-50%);
  95. z-index: 9;
  96. }
  97. .title {
  98. font-size: 16px;
  99. color: #404040;
  100. span {
  101. color: fetch('color');
  102. }
  103. }
  104. .list {
  105. display: flex;
  106. align-items: center;
  107. justify-content: space-between;
  108. flex-wrap: wrap;
  109. .empty {
  110. width: 390px;
  111. }
  112. .section {
  113. width: 390px;
  114. height: 108px;
  115. background-color: #f3f5f6;
  116. border-radius: 4px;
  117. box-sizing: border-box;
  118. padding: 12px;
  119. cursor: pointer;
  120. transition: all 0.4s;
  121. &:hover {
  122. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  123. }
  124. .cover {
  125. display: block;
  126. width: 84px;
  127. height: 84px;
  128. }
  129. .info {
  130. position: relative;
  131. margin-left: 12px;
  132. .name {
  133. width: 200px;
  134. font-size: 16px;
  135. color: #101010;
  136. font-weight: bold;
  137. margin-bottom: 16px;
  138. text-overflow: ellipsis;
  139. white-space: nowrap;
  140. overflow: hidden;
  141. }
  142. .mobile,
  143. .address {
  144. width: 268px;
  145. position: relative;
  146. font-size: 14px;
  147. color: #404040;
  148. padding-left: 24px;
  149. line-height: 24px;
  150. text-overflow: ellipsis;
  151. white-space: nowrap;
  152. overflow: hidden;
  153. &::after {
  154. content: '';
  155. display: block;
  156. width: 16px;
  157. height: 16px;
  158. position: absolute;
  159. left: 0;
  160. top: 50%;
  161. transform: translateY(-50%);
  162. background-size: 16px;
  163. background-repeat: no-repeat;
  164. }
  165. }
  166. .mobile {
  167. &::after {
  168. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  169. }
  170. }
  171. .address {
  172. &::after {
  173. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  174. }
  175. }
  176. .distance {
  177. position: absolute;
  178. font-size: 12px;
  179. color: #404040;
  180. top: 2px;
  181. right: 0;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. }
  189. }
  190. // 移动 端
  191. @media screen and (max-width: 768px) {
  192. .page {
  193. @include useTheme() {
  194. .page-top {
  195. height: 46vw;
  196. background: fetch('h5-banner-club');
  197. background-size: auto 46vw;
  198. .logo {
  199. display: block;
  200. width: 14.8vw;
  201. height: 14.8vw;
  202. border-radius: 50%;
  203. background: #fff;
  204. }
  205. .name {
  206. font-size: 4vw;
  207. color: #fff;
  208. }
  209. }
  210. .page-content {
  211. position: relative;
  212. .search {
  213. position: absolute;
  214. left: 50%;
  215. top: 0;
  216. transform: translate(-50%, -50%);
  217. }
  218. .city {
  219. position: relative;
  220. z-index: 9;
  221. padding-top: 12vw;
  222. }
  223. .title {
  224. font-size: 3.4vw;
  225. color: #404040;
  226. span {
  227. color: fetch('color');
  228. }
  229. }
  230. .list {
  231. display: flex;
  232. align-items: center;
  233. flex-direction: column;
  234. .section {
  235. width: 93.6vw;
  236. height: 26vw;
  237. background-color: #f3f5f6;
  238. border-radius: 4px;
  239. box-sizing: border-box;
  240. padding: 3.2vw;
  241. .cover {
  242. display: block;
  243. width: 19.6vw;
  244. height: 19.6vw;
  245. }
  246. .info {
  247. position: relative;
  248. margin-left: 3.2vw;
  249. .name {
  250. width: 48vw;
  251. font-size: 4vw;
  252. color: #101010;
  253. font-weight: bold;
  254. margin-bottom: 4vw;
  255. text-overflow: ellipsis;
  256. white-space: nowrap;
  257. overflow: hidden;
  258. }
  259. .mobile,
  260. .address {
  261. width: 66vw;
  262. position: relative;
  263. font-size: 3vw;
  264. color: #404040;
  265. padding-left: 5vw;
  266. line-height: 5vw;
  267. text-overflow: ellipsis;
  268. white-space: nowrap;
  269. overflow: hidden;
  270. &::after {
  271. content: '';
  272. display: block;
  273. width: 4vw;
  274. height: 4vw;
  275. position: absolute;
  276. left: 0;
  277. top: 50%;
  278. transform: translateY(-50%);
  279. background-size: 4vw 4vw;
  280. background-repeat: no-repeat;
  281. }
  282. }
  283. .mobile {
  284. &::after {
  285. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  286. }
  287. }
  288. .address {
  289. &::after {
  290. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  291. }
  292. }
  293. .distance {
  294. position: absolute;
  295. font-size: 3vw;
  296. color: #404040;
  297. top: 0.8vw;
  298. right: 0;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. }
  305. }
  306. }
  307. </style>