| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573 |
- <template>
- <view class="content">
- <!-- 达人信息 -->
- <view class="info">
- <image class="info-bg" src="/static/images/expert_top_bg.png"></image>
- <view class="status_bar" :style="{height: statusBarHeight}"></view>
- <view class="back-box">
- <image class="img" src="/static/images/back_white_icon.png"></image>
- </view>
- <view class="info-block">
- <image class="head" src="/static/images/img.png"></image>
- <view class="right">
- <view class="user">
- <text class="name">健康达人</text>
- <view class="level">
- <image class="icon" src="/static/images/intelligent_icon.png"></image>LV.2
- </view>
- </view>
- <view class="txt">人生没有白走的路,每一步都算数。</view>
- <view class="card">
- <view class="card-item">
- <image class="img" src="/static/images/jinbang_font.png"></image>
- <text class="ranking">达人榜 第15名</text>
- </view>
- <image class="go" src="/static/images/jb_arrow_right_icon.png"></image>
- </view>
- </view>
- </view>
- <view class="data-block">
- <view class="number-block">
- <view class="item">
- <text class="number-item">6.2万</text>
- <text class="txt-item">粉丝</text>
- </view>
- <view class="item">
- <text class="number-item">6.2万</text>
- <text class="txt-item">粉丝</text>
- </view>
- <view class="item">
- <text class="number-item">6.2万</text>
- <text class="txt-item">粉丝</text>
- </view>
- </view>
- <!-- 关注 -->
- <view class="button">
- <image class="icon" src="/static/images/guanzhu_green_icon.png"></image><text>关注</text>
- </view>
- </view>
- </view>
- <view class="vedio-block">
- <view class="tab-wrapper">
- <!-- 生活号标签 -->
- <view class="tab-item" :class="{ active: activeTab === 0 }" @click="switchTab(0)">
- <text class="tab-text">生活号(22)</text>
- <view v-if="activeTab === 0" class="underline"></view>
- </view>
- <!-- 直播标签 -->
- <view class="tab-item" :class="{ active: activeTab === 1 }" @click="switchTab(1)">
- <text class="tab-text">直播</text>
- <view v-if="activeTab === 1" class="underline"></view>
- </view>
- </view>
- <!-- 视频文章列表 -->
- <mescroll-body bottom="0" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
- :down="downOption" :up="upOption">
- <view class="list">
- <view class="list-item" @click="goLive(item)" v-for="(item,index) in list" :key="index">
- <image class="img" v-if="item.liveImgUrl" :src="item.liveImgUrl" mode="widthFix"></image>
- <image class="video-icon" src="/static/images/video_icon.png"></image>
- <image class="suspension-icon" src="/static/images/suspension.png"></image>
- <view class="info-block">
- <view class="title">冰乳绿豆糕 冰冰凉凉谁吃谁迷糊! 谁懂,...</view>
- <view class="item">
- <view class="flex">
- <image class="head" src="/static/images/img.png"></image>
- <text class="name">崔医生</text>
- </view>
- <view class="flex">
- <image class="icon" src="/static/images/zan_icon.png"></image>
- <text>141</text>
- </view>
- </view>
- <view class="card">
- <view class="card-item">
- <image class="img" src="/static/images/jinbang_font.png"></image>
- <text class="ranking">达人榜 第15名</text>
- </view>
- <image class="go" src="/static/images/jb_arrow_right_icon.png"></image>
- </view>
- </view>
- </view>
-
-
- </view>
- </mescroll-body>
- </view>
- </view>
- </template>
- <script>
- import {
- liveList
- } from '@/api/living.js'
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- activeTab: 0,
- // 状态栏的高度
- statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
- list: [],
- downOption: {
- offset: 80,
- use: true,
- auto: false
- },
- upOption: {
- use: true,
- auto: true,
- page: {
- num: 0,
- size: 10
- }
- },
- mescroll: null,
- }
- },
- onLoad() {
- // if (!uni.getStorageSync("AppToken")) {
- // uni.navigateTo({
- // url: '/pages/auth/login'
- // });
- // }
- },
- onUnload() {
- },
- methods: {
- switchTab(tab) {
- if (this.activeTab === tab) return;
- this.activeTab = tab;
- this.$emit('change', tab);
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- // 下拉刷新回调
- downCallback(mescroll) {
- this.list = [];
- mescroll.resetUpScroll();
- },
- // 上拉加载回调
- upCallback(mescroll) {
- const pageNum = mescroll.num;
- const pageSize = mescroll.size;
- let data = {
- pageSize: pageSize,
- pageNum: pageNum,
- }
- liveList(data).then(res => {
- if (!res) {
- mescroll.endErr();
- return;
- }
- if (res.code == 200) {
- let curPageData = Array.isArray(res.data.list) ? res.data.list : [];
- let totalSize = Number(res.data.total) || 0;
- if (pageNum === 1) {
- this.list = [];
- }
- this.list = this.list.concat(curPageData);
- mescroll.endBySize(curPageData.length, totalSize);
- } else {
- mescroll.endErr();
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- }).catch(err => {
- mescroll.endErr();
- });
- },
- goLive(item) {
- uni.navigateTo({
- // &immediate=true
- url: `./living?liveId=${item.liveId}`
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- background-color: #111;
- min-height: 100vh;
- // padding: 24rpx;
- // 达人信息
- .info {
- width: 100%;
- height: 600rpx;
- position: relative;
- z-index: 0;
- .info-bg {
- position: absolute;
- z-index: -1;
- width: 100%;
- height: 100%;
- }
- .back-box {
- display: flex;
- align-items: center;
- height: 88rpx;
- margin-left: 24rpx;
- .img {
- width: 48rpx;
- height: 48rpx;
- }
- }
- .info-block {
- margin-top: 32rpx;
- padding: 0 20rpx;
- display: flex;
- align-items: center;
- .head {
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- border-radius: 50%;
- }
- .right {
- .user {
- display: flex;
- .name {
- font-weight: 500;
- font-size: 40rpx;
- color: #FFFFFF;
- margin-right: 16rpx;
- }
- .level {
- width: 118rpx;
- height: 40rpx;
- display: flex;
- align-items: center;
- font-weight: 500;
- font-size: 22rpx;
- color: #FEF5EA;
- background: linear-gradient(90deg, #F5CE3C 0%, #E39414 100%);
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- padding: 4rpx 12rpx;
- box-sizing: border-box;
- .icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 8rpx;
- }
- }
- }
- .txt {
- font-weight: 400;
- font-size: 22rpx;
- color: #FFFFFF;
- margin: 8rpx 0 16rpx;
- }
- .card {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: #FFF5EB;
- width: 302rpx;
- height: 40rpx;
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- border: 1rpx solid #F3E2D0;
- padding: 8rpx;
- box-sizing: border-box;
- .card-item {
- display: flex;
- align-items: center;
- .img {
- width: 48rpx;
- height: 24rpx;
- margin-right: 8rpx;
- }
- .ranking {
- font-size: 22rpx;
- color: #D46C0D;
- }
- }
- .go {
- width: 16rpx;
- height: 16rpx;
- }
- }
- }
- }
- .data-block {
- padding: 0 20rpx;
- margin-top: 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .number-block {
- display: flex;
- .item {
- margin-right: 32rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .number-item {
- font-family: Roboto, Roboto;
- font-weight: 600;
- font-size: 36rpx;
- color: #FFFFFF;
- }
- .txt-item {
- margin-top: 6rpx;
- font-size: 26rpx;
- color: rgba(255, 255, 255, 0.7);
- }
- }
- }
- .button {
- width: 144rpx;
- height: 56rpx;
- background: #FFFFFF;
- border-radius: 28rpx 28rpx 28rpx 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
- color: #02B176;
- .icon {
- width: 24rpx;
- height: 24rpx;
- margin-right: 4rpx;
- }
- }
- }
- }
- //达人视频
- .vedio-block {
- position: relative;
- z-index: 1;
- background-color: #FFFFFF;
- margin-top: -74rpx;
- border-radius: 32rpx 32rpx 0rpx 0rpx;
- padding: 26rpx 0;
- .tab-wrapper {
- display: flex;
- height: 88rpx;
- padding: 0 40rpx;
- position: relative;
- .tab-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- position: relative;
- color: #666666;
- &.active {
- font-weight: 600;
- font-size: 32rpx;
- color: #02B176;
- }
- .tab-text {
- font-size: 32rpx;
- transition: all 0.3s ease;
- }
- .underline {
- position: absolute;
- bottom: 0;
- left: 50%;
- transform: translateX(-50%);
- width: 48rpx;
- height: 6rpx;
- background: #02B176;
- border-radius: 3rpx 3rpx 3rpx 3rpx;
- animation: slideIn 0.3s ease;
- }
- }
- }
- @keyframes slideIn {
- from {
- opacity: 0;
- transform: translateX(-50%) scaleX(0.5);
- }
- to {
- opacity: 1;
- transform: translateX(-50%) scaleX(1);
- }
- }
- .list {
- background: #F5F7FA;
- padding: 24rpx 24rpx;
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- .list-item {
- width: 342rpx;
- margin-bottom: 18rpx;
- position: relative;
- display: flex;
- flex-direction: column;
- .img {
- width: 100%;
- border-radius: 16rpx 16rpx 0rpx 0rpx;
- }
- .video-icon {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- top: 20rpx;
- right: 20rpx;
- }
- .suspension-icon{
- width: 144rpx;
- height: 144rpx;
- position: absolute;
- top: -14rpx;
- right: 0rpx;
- }
- .info-block {
- border-radius: 0rpx 0rpx 16rpx 16rpx;
- padding: 12rpx 20rpx 20rpx;
- box-sizing: border-box;
- width: 100%;
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- .title {
- font-weight: 500;
- font-size: 28rpx;
- color: #333333;
- margin-bottom: 20rpx;
- }
- .item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- .flex {
- display: flex;
- align-items: center;
- font-size: 22rpx;
- color: #999999;
- }
- .icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 4rpx;
- }
- .head{
- width: 32rpx;
- height: 32rpx;
- border-radius: 50%;
- margin-right: 8rpx;
- }
- .name {
- color: #757575;
- }
- }
- text {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .card {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: #FFF5EB;
- width: 302rpx;
- height: 40rpx;
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- border: 1rpx solid #F3E2D0;
- padding: 8rpx;
- box-sizing: border-box;
- .card-item {
- display: flex;
- align-items: center;
- .img {
- width: 48rpx;
- height: 24rpx;
- margin-right: 8rpx;
- }
- .ranking {
- font-size: 22rpx;
- color: #D46C0D;
- }
- }
- .go {
- width: 16rpx;
- height: 16rpx;
- }
- }
- }
- }
- .list-item:nth-child(2n) {
- margin-right: 0;
- }
- }
- }
- }
- </style>
|