expert.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <view class="content">
  3. <!-- 达人信息 -->
  4. <view class="info">
  5. <image class="info-bg" src="/static/images/expert_top_bg.png"></image>
  6. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  7. <view class="back-box">
  8. <image class="img" src="/static/images/back_white_icon.png"></image>
  9. </view>
  10. <view class="info-block">
  11. <image class="head" src="/static/images/img.png"></image>
  12. <view class="right">
  13. <view class="user">
  14. <text class="name">健康达人</text>
  15. <view class="level">
  16. <image class="icon" src="/static/images/intelligent_icon.png"></image>LV.2
  17. </view>
  18. </view>
  19. <view class="txt">人生没有白走的路,每一步都算数。</view>
  20. <view class="card">
  21. <view class="card-item">
  22. <image class="img" src="/static/images/jinbang_font.png"></image>
  23. <text class="ranking">达人榜 第15名</text>
  24. </view>
  25. <image class="go" src="/static/images/jb_arrow_right_icon.png"></image>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="data-block">
  30. <view class="number-block">
  31. <view class="item">
  32. <text class="number-item">6.2万</text>
  33. <text class="txt-item">粉丝</text>
  34. </view>
  35. <view class="item">
  36. <text class="number-item">6.2万</text>
  37. <text class="txt-item">粉丝</text>
  38. </view>
  39. <view class="item">
  40. <text class="number-item">6.2万</text>
  41. <text class="txt-item">粉丝</text>
  42. </view>
  43. </view>
  44. <!-- 关注 -->
  45. <view class="button">
  46. <image class="icon" src="/static/images/guanzhu_green_icon.png"></image><text>关注</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="vedio-block">
  51. <view class="tab-wrapper">
  52. <!-- 生活号标签 -->
  53. <view class="tab-item" :class="{ active: activeTab === 0 }" @click="switchTab(0)">
  54. <text class="tab-text">生活号(22)</text>
  55. <view v-if="activeTab === 0" class="underline"></view>
  56. </view>
  57. <!-- 直播标签 -->
  58. <view class="tab-item" :class="{ active: activeTab === 1 }" @click="switchTab(1)">
  59. <text class="tab-text">直播</text>
  60. <view v-if="activeTab === 1" class="underline"></view>
  61. </view>
  62. </view>
  63. <!-- 视频文章列表 -->
  64. <mescroll-body bottom="0" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
  65. :down="downOption" :up="upOption">
  66. <view class="list">
  67. <view class="list-item" @click="goLive(item)" v-for="(item,index) in list" :key="index">
  68. <image class="img" v-if="item.liveImgUrl" :src="item.liveImgUrl" mode="widthFix"></image>
  69. <image class="video-icon" src="/static/images/video_icon.png"></image>
  70. <image class="suspension-icon" src="/static/images/suspension.png"></image>
  71. <view class="info-block">
  72. <view class="title">冰乳绿豆糕 冰冰凉凉谁吃谁迷糊! 谁懂,...</view>
  73. <view class="item">
  74. <view class="flex">
  75. <image class="head" src="/static/images/img.png"></image>
  76. <text class="name">崔医生</text>
  77. </view>
  78. <view class="flex">
  79. <image class="icon" src="/static/images/zan_icon.png"></image>
  80. <text>141</text>
  81. </view>
  82. </view>
  83. <view class="card">
  84. <view class="card-item">
  85. <image class="img" src="/static/images/jinbang_font.png"></image>
  86. <text class="ranking">达人榜 第15名</text>
  87. </view>
  88. <image class="go" src="/static/images/jb_arrow_right_icon.png"></image>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </mescroll-body>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import {
  99. liveList
  100. } from '@/api/living.js'
  101. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  102. export default {
  103. mixins: [MescrollMixin],
  104. data() {
  105. return {
  106. activeTab: 0,
  107. // 状态栏的高度
  108. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  109. list: [],
  110. downOption: {
  111. offset: 80,
  112. use: true,
  113. auto: false
  114. },
  115. upOption: {
  116. use: true,
  117. auto: true,
  118. page: {
  119. num: 0,
  120. size: 10
  121. }
  122. },
  123. mescroll: null,
  124. }
  125. },
  126. onLoad() {
  127. // if (!uni.getStorageSync("AppToken")) {
  128. // uni.navigateTo({
  129. // url: '/pages/auth/login'
  130. // });
  131. // }
  132. },
  133. onUnload() {
  134. },
  135. methods: {
  136. switchTab(tab) {
  137. if (this.activeTab === tab) return;
  138. this.activeTab = tab;
  139. this.$emit('change', tab);
  140. },
  141. mescrollInit(mescroll) {
  142. this.mescroll = mescroll;
  143. },
  144. // 下拉刷新回调
  145. downCallback(mescroll) {
  146. this.list = [];
  147. mescroll.resetUpScroll();
  148. },
  149. // 上拉加载回调
  150. upCallback(mescroll) {
  151. const pageNum = mescroll.num;
  152. const pageSize = mescroll.size;
  153. let data = {
  154. pageSize: pageSize,
  155. pageNum: pageNum,
  156. }
  157. liveList(data).then(res => {
  158. if (!res) {
  159. mescroll.endErr();
  160. return;
  161. }
  162. if (res.code == 200) {
  163. let curPageData = Array.isArray(res.data.list) ? res.data.list : [];
  164. let totalSize = Number(res.data.total) || 0;
  165. if (pageNum === 1) {
  166. this.list = [];
  167. }
  168. this.list = this.list.concat(curPageData);
  169. mescroll.endBySize(curPageData.length, totalSize);
  170. } else {
  171. mescroll.endErr();
  172. uni.showToast({
  173. title: res.msg,
  174. icon: 'none'
  175. });
  176. }
  177. }).catch(err => {
  178. mescroll.endErr();
  179. });
  180. },
  181. goLive(item) {
  182. uni.navigateTo({
  183. // &immediate=true
  184. url: `./living?liveId=${item.liveId}`
  185. });
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. .content {
  192. background-color: #111;
  193. min-height: 100vh;
  194. // padding: 24rpx;
  195. // 达人信息
  196. .info {
  197. width: 100%;
  198. height: 600rpx;
  199. position: relative;
  200. z-index: 0;
  201. .info-bg {
  202. position: absolute;
  203. z-index: -1;
  204. width: 100%;
  205. height: 100%;
  206. }
  207. .back-box {
  208. display: flex;
  209. align-items: center;
  210. height: 88rpx;
  211. margin-left: 24rpx;
  212. .img {
  213. width: 48rpx;
  214. height: 48rpx;
  215. }
  216. }
  217. .info-block {
  218. margin-top: 32rpx;
  219. padding: 0 20rpx;
  220. display: flex;
  221. align-items: center;
  222. .head {
  223. width: 160rpx;
  224. height: 160rpx;
  225. margin-right: 20rpx;
  226. border-radius: 50%;
  227. }
  228. .right {
  229. .user {
  230. display: flex;
  231. .name {
  232. font-weight: 500;
  233. font-size: 40rpx;
  234. color: #FFFFFF;
  235. margin-right: 16rpx;
  236. }
  237. .level {
  238. width: 118rpx;
  239. height: 40rpx;
  240. display: flex;
  241. align-items: center;
  242. font-weight: 500;
  243. font-size: 22rpx;
  244. color: #FEF5EA;
  245. background: linear-gradient(90deg, #F5CE3C 0%, #E39414 100%);
  246. border-radius: 20rpx 20rpx 20rpx 20rpx;
  247. padding: 4rpx 12rpx;
  248. box-sizing: border-box;
  249. .icon {
  250. width: 32rpx;
  251. height: 32rpx;
  252. margin-right: 8rpx;
  253. }
  254. }
  255. }
  256. .txt {
  257. font-weight: 400;
  258. font-size: 22rpx;
  259. color: #FFFFFF;
  260. margin: 8rpx 0 16rpx;
  261. }
  262. .card {
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: center;
  266. background: #FFF5EB;
  267. width: 302rpx;
  268. height: 40rpx;
  269. border-radius: 8rpx 8rpx 8rpx 8rpx;
  270. border: 1rpx solid #F3E2D0;
  271. padding: 8rpx;
  272. box-sizing: border-box;
  273. .card-item {
  274. display: flex;
  275. align-items: center;
  276. .img {
  277. width: 48rpx;
  278. height: 24rpx;
  279. margin-right: 8rpx;
  280. }
  281. .ranking {
  282. font-size: 22rpx;
  283. color: #D46C0D;
  284. }
  285. }
  286. .go {
  287. width: 16rpx;
  288. height: 16rpx;
  289. }
  290. }
  291. }
  292. }
  293. .data-block {
  294. padding: 0 20rpx;
  295. margin-top: 30rpx;
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. .number-block {
  300. display: flex;
  301. .item {
  302. margin-right: 32rpx;
  303. display: flex;
  304. flex-direction: column;
  305. align-items: center;
  306. .number-item {
  307. font-family: Roboto, Roboto;
  308. font-weight: 600;
  309. font-size: 36rpx;
  310. color: #FFFFFF;
  311. }
  312. .txt-item {
  313. margin-top: 6rpx;
  314. font-size: 26rpx;
  315. color: rgba(255, 255, 255, 0.7);
  316. }
  317. }
  318. }
  319. .button {
  320. width: 144rpx;
  321. height: 56rpx;
  322. background: #FFFFFF;
  323. border-radius: 28rpx 28rpx 28rpx 28rpx;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. font-size: 24rpx;
  328. color: #02B176;
  329. .icon {
  330. width: 24rpx;
  331. height: 24rpx;
  332. margin-right: 4rpx;
  333. }
  334. }
  335. }
  336. }
  337. //达人视频
  338. .vedio-block {
  339. position: relative;
  340. z-index: 1;
  341. background-color: #FFFFFF;
  342. margin-top: -74rpx;
  343. border-radius: 32rpx 32rpx 0rpx 0rpx;
  344. padding: 26rpx 0;
  345. .tab-wrapper {
  346. display: flex;
  347. height: 88rpx;
  348. padding: 0 40rpx;
  349. position: relative;
  350. .tab-item {
  351. flex: 1;
  352. display: flex;
  353. flex-direction: column;
  354. align-items: center;
  355. justify-content: center;
  356. position: relative;
  357. color: #666666;
  358. &.active {
  359. font-weight: 600;
  360. font-size: 32rpx;
  361. color: #02B176;
  362. }
  363. .tab-text {
  364. font-size: 32rpx;
  365. transition: all 0.3s ease;
  366. }
  367. .underline {
  368. position: absolute;
  369. bottom: 0;
  370. left: 50%;
  371. transform: translateX(-50%);
  372. width: 48rpx;
  373. height: 6rpx;
  374. background: #02B176;
  375. border-radius: 3rpx 3rpx 3rpx 3rpx;
  376. animation: slideIn 0.3s ease;
  377. }
  378. }
  379. }
  380. @keyframes slideIn {
  381. from {
  382. opacity: 0;
  383. transform: translateX(-50%) scaleX(0.5);
  384. }
  385. to {
  386. opacity: 1;
  387. transform: translateX(-50%) scaleX(1);
  388. }
  389. }
  390. .list {
  391. background: #F5F7FA;
  392. padding: 24rpx 24rpx;
  393. display: flex;
  394. justify-content: space-between;
  395. flex-wrap: wrap;
  396. .list-item {
  397. width: 342rpx;
  398. margin-bottom: 18rpx;
  399. position: relative;
  400. display: flex;
  401. flex-direction: column;
  402. .img {
  403. width: 100%;
  404. border-radius: 16rpx 16rpx 0rpx 0rpx;
  405. }
  406. .video-icon {
  407. width: 40rpx;
  408. height: 40rpx;
  409. position: absolute;
  410. top: 20rpx;
  411. right: 20rpx;
  412. }
  413. .suspension-icon{
  414. width: 144rpx;
  415. height: 144rpx;
  416. position: absolute;
  417. top: -14rpx;
  418. right: 0rpx;
  419. }
  420. .info-block {
  421. border-radius: 0rpx 0rpx 16rpx 16rpx;
  422. padding: 12rpx 20rpx 20rpx;
  423. box-sizing: border-box;
  424. width: 100%;
  425. background: #FFFFFF;
  426. display: flex;
  427. flex-direction: column;
  428. .title {
  429. font-weight: 500;
  430. font-size: 28rpx;
  431. color: #333333;
  432. margin-bottom: 20rpx;
  433. }
  434. .item {
  435. display: flex;
  436. justify-content: space-between;
  437. align-items: center;
  438. margin-bottom: 20rpx;
  439. .flex {
  440. display: flex;
  441. align-items: center;
  442. font-size: 22rpx;
  443. color: #999999;
  444. }
  445. .icon {
  446. width: 32rpx;
  447. height: 32rpx;
  448. margin-right: 4rpx;
  449. }
  450. .head{
  451. width: 32rpx;
  452. height: 32rpx;
  453. border-radius: 50%;
  454. margin-right: 8rpx;
  455. }
  456. .name {
  457. color: #757575;
  458. }
  459. }
  460. text {
  461. white-space: nowrap;
  462. overflow: hidden;
  463. text-overflow: ellipsis;
  464. }
  465. .card {
  466. display: flex;
  467. justify-content: space-between;
  468. align-items: center;
  469. background: #FFF5EB;
  470. width: 302rpx;
  471. height: 40rpx;
  472. border-radius: 8rpx 8rpx 8rpx 8rpx;
  473. border: 1rpx solid #F3E2D0;
  474. padding: 8rpx;
  475. box-sizing: border-box;
  476. .card-item {
  477. display: flex;
  478. align-items: center;
  479. .img {
  480. width: 48rpx;
  481. height: 24rpx;
  482. margin-right: 8rpx;
  483. }
  484. .ranking {
  485. font-size: 22rpx;
  486. color: #D46C0D;
  487. }
  488. }
  489. .go {
  490. width: 16rpx;
  491. height: 16rpx;
  492. }
  493. }
  494. }
  495. }
  496. .list-item:nth-child(2n) {
  497. margin-right: 0;
  498. }
  499. }
  500. }
  501. }
  502. </style>