Browse Source

优化uploader页面,Indicator.vue添加render传参

pull/19/head
zyronon 4 years ago
parent
commit
ccaf2f5aaa
  1. 3
      src/api/user.js
  2. BIN
      src/assets/img/icon/b8z.png
  3. 59
      src/components/Indicator.vue
  4. 29
      src/components/Video.vue
  5. 8
      src/config/index.js
  6. 19
      src/pages/Test.vue
  7. 3
      src/pages/home/Index2.vue
  8. 365
      src/pages/me/Uploader.less
  9. 210
      src/pages/me/Uploader.vue

3
src/api/user.js

@ -4,4 +4,7 @@ export default {
friends(params, data) { friends(params, data) {
return request({url: '/user/friends', method: 'get', params, data}) return request({url: '/user/friends', method: 'get', params, data})
}, },
author(params, data) {
return request({url: '/user/author', method: 'get', params, data})
},
} }

BIN
src/assets/img/icon/b8z.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

59
src/components/Indicator.vue

@ -1,19 +1,3 @@
<template>
<div class="indicator-ctn" :class="fixed?'fixed':''">
<div class="tabs" ref="tabs">
<div class="tab"
:style="{width : tabStyleWidth}"
v-for="(item,index) in tabTexts"
:class="currentSlideItemIndex === index?'active':''"
@click="changeIndex(index)">
<span>{{ item }}</span></div>
</div>
<div class="indicator"
ref="indicator"
:style="{width : tabStyleWidth}"
></div>
</div>
</template>
<script> <script>
import bus from "../utils/bus"; import bus from "../utils/bus";
@ -36,6 +20,10 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
tabRender: {
type: Function,
default: null
},
//slidListslidListindicator //slidListslidListindicator
name: { name: {
type: String, type: String,
@ -51,6 +39,38 @@ export default {
} }
}, },
computed: {}, computed: {},
render() {
/*
* <div class="tabs" ref="tabs">
<div class="tab"
style="{width : tabStyleWidth}"
v-for="(item,index) in tabTexts"
:class="currentSlideItemIndex === index?'active':''"
@click="changeIndex(index)">
<span>{{ item }}</span></div>
</div>
* */
return (
<div className={this.fixed ? 'fixed indicator-ctn' : 'indicator-ctn'}>
{this.tabRender ?
this.tabRender() :
<div className="tabs" ref="tabs">
{
this.tabTexts.map((item, index) => {
return (
<div className={this.currentSlideItemIndex === index ? 'active tab' : 'tab'}
style={{width: this.tabStyleWidth}}>
< span> {item}</span>
</div>
)
})
}
</div>
}
<div className="indicator" ref="indicator" style={{width: this.tabStyleWidth}}/>
</div>
)
},
mounted() { mounted() {
this.initTabs() this.initTabs()
bus.on(this.name + '-moved', this.move) bus.on(this.name + '-moved', this.move)
@ -125,6 +145,13 @@ export default {
&.active { &.active {
color: white; color: white;
} }
img {
margin-left: .5rem;
@width: 1.2rem;
width: @width;
height: @width;
}
} }
} }

29
src/components/Video.vue

@ -5,8 +5,8 @@
<!--</template>--> <!--</template>-->
<template> <template>
<div class="bg-video" v-bind:style="{'height':height+'px'}"> <div class="bg-video" v-bind:style="{'height':height+'px'}">
<!-- <video :src="video.videoUrl" poster="../assets/img/icon/components/video/loading.gif" ref="video" muted :autoplay="play" loop>--> <!-- <video :src="video.videoUrl" poster="../assets/img/icon/components/video/loading.gif" ref="video" muted :autoplay="play" loop>-->
<!-- poster="../assets/img/poster/1.jpg"--> <!-- poster="../assets/img/poster/1.jpg"-->
<video :src="video.video" <video :src="video.video"
:poster="video.origin_cover" :poster="video.origin_cover"
@ -24,7 +24,7 @@
<div :style="{opacity:isMove?0:1}" class="normal"> <div :style="{opacity:isMove?0:1}" class="normal">
<div class="toolbar mb1r"> <div class="toolbar mb1r">
<div class="avatar-ctn mb2r"> <div class="avatar-ctn mb2r">
<img class="avatar" src="../assets/img/icon/head-image.jpeg" alt="" <img class="avatar" :src="lVideo.author.avatar" alt=""
@click.stop="$emit('goUserInfo')"> @click.stop="$emit('goUserInfo')">
<transition name="fade"> <transition name="fade">
<div v-if="!isAttention" @click.stop="attention" class="options" ref="attention-option"> <div v-if="!isAttention" @click.stop="attention" class="options" ref="attention-option">
@ -43,16 +43,16 @@
<!-- <transition name="loved">--> <!-- <transition name="loved">-->
<!-- </transition>--> <!-- </transition>-->
</div> </div>
<span>{{ $likeNum(lVideo.likeNum) }}</span> <span>{{ $likeNum(lVideo.digg_count) }}</span>
</div> </div>
<div class="message mb2r" @click.stop="$emit('showComments')"> <div class="message mb2r" @click.stop="$emit('showComments')">
<!-- <div class="message mb15p" @click.stop="showComment">--> <!-- <div class="message mb15p" @click.stop="showComment">-->
<img src="../assets/img/icon/message.svg" alt="" class="message-image"> <img src="../assets/img/icon/message.svg" alt="" class="message-image">
<span>{{ $likeNum(lVideo.commentNum) }}</span> <span>{{ $likeNum(lVideo.comment_count) }}</span>
</div> </div>
<div v-if="!isMy" class="share mb4r" @click.stop="$emit('showShare')"> <div v-if="!isMy" class="share mb4r" @click.stop="$emit('showShare')">
<img src="../assets/img/icon/share.svg" alt="" class="share-image"> <img src="../assets/img/icon/share.svg" alt="" class="share-image">
<span>{{ $likeNum(lVideo.sharedNum) }}</span> <span>{{ $likeNum(lVideo.share_count) }}</span>
</div> </div>
<div v-else class="share mb4r" @click.stop="$emit('showShare')"> <div v-else class="share mb4r" @click.stop="$emit('showShare')">
<img src="../assets/img/icon/share.svg" alt="" class="share-image"> <img src="../assets/img/icon/share.svg" alt="" class="share-image">
@ -61,19 +61,20 @@
<img class="music1" src="../assets/img/icon/home/music1.png" alt=""> <img class="music1" src="../assets/img/icon/home/music1.png" alt="">
<img class="music2" src="../assets/img/icon/home/music2.png" alt=""> <img class="music2" src="../assets/img/icon/home/music2.png" alt="">
<div class="music-bg"> <div class="music-bg">
<img class="music" src="../assets/img/icon/head-image.jpeg" alt="" @click.stop="globalMethods.$nav('/music')"> <img class="music" :src="lVideo.music.cover" alt=""
@click.stop="globalMethods.$nav('/music')">
</div> </div>
</div> </div>
</div> </div>
<div class="content ml1r mb1r" v-if="!isMy"> <div class="content ml1r mb1r" v-if="!isMy">
<div class="name mb1r">@TTentau</div> <div class="name mb1r">{{ lVideo.author.name }}</div>
<div class="description mb1r"> <div class="description mb1r">
吴三二的光年之外, 您的浏览器不支持 video 标签 您的浏览器不支持 video 标签 {{ lVideo.desc }}
</div> </div>
<div class="music " @click.stop="$nav('/music')"> <div class="music " @click.stop="$nav('/music')">
<img src="../assets/img/icon/music.svg" alt="" class="music-image"> <img src="../assets/img/icon/music.svg" alt="" class="music-image">
<!-- <marquee behavior=scroll direction=left align=middle scrollamount=4> 吴三二 - 光年之外</marquee>--> <!-- <marquee behavior=scroll direction=left align=middle scrollamount=4> 吴三二 - 光年之外</marquee>-->
<div behavior=scroll direction=left align=middle scrollamount=4> 吴三二 - 光年之外</div> <div behavior=scroll direction=left align=middle scrollamount=4> {{ lVideo.music.title }}</div>
</div> </div>
</div> </div>
<div v-else class="comment-status"> <div v-else class="comment-status">
@ -153,7 +154,7 @@ export default {
}, },
data() { data() {
return { return {
globalMethods:globalMethods, globalMethods: globalMethods,
duration: 0, duration: 0,
step: 0, step: 0,
currentTime: 0, currentTime: 0,
@ -196,7 +197,7 @@ export default {
}) })
}, },
methods: { methods: {
$likeNum(v){ $likeNum(v) {
return globalMethods.$likeNum(v) return globalMethods.$likeNum(v)
}, },
$duration(v) { $duration(v) {
@ -278,7 +279,7 @@ export default {
this.pageX = e.touches[0].pageX this.pageX = e.touches[0].pageX
}, },
move(e) { move(e) {
if (this.isPlaying)return if (this.isPlaying) return
this.isMove = true this.isMove = true
let video = this.$refs.video let video = this.$refs.video
video.pause() video.pause()
@ -288,7 +289,7 @@ export default {
globalMethods.$stopPropagation(e) globalMethods.$stopPropagation(e)
}, },
end(e) { end(e) {
if (this.isPlaying)return if (this.isPlaying) return
console.log('end', e) console.log('end', e)
setTimeout(() => { setTimeout(() => {
this.isMove = false this.isMove = false

8
src/config/index.js

@ -1,8 +1,8 @@
export default { export default {
baseUrl: 'http://192.168.0.103/index.php/v1', baseUrl: 'http://192.168.0.105/index.php/v1',
filePreview:'http://192.168.0.103/static/uploads/', filePreview:'http://192.168.0.105/static/uploads/',
// baseUrl: 'http://192.168.10.164//index.php/v1', // baseUrl: 'http://192.168.10.164/index.php/v1',
// filePreview:'http://192.168.10.164/static/uploads/' // filePreview:'http://192.168.10.164/static/uploads/'
// baseUrl: 'http://localhost//index.php/v1', // baseUrl: 'http://localhost/index.php/v1',
// filePreview:'http://localhost/static/uploads/' // filePreview:'http://localhost/static/uploads/'
} }

19
src/pages/Test.vue

@ -1,31 +1,18 @@
<template> <template>
<div class="Test"> <div class="Test">
<BaseHeader> <Uploader/>
<template v-slot:center>
<span class="f16">申报学校信息</span>
</template>
</BaseHeader>
<div class="content">
<ConfirmDialog
title="设置备注名"
ok-text="确认"
v-model:visible="showFollowSetting"
>
<Search mode="light" v-model="t" :isShowSearchIcon="false"/>
</ConfirmDialog>
</div>
</div> </div>
</template> </template>
<script> <script>
import ConfirmDialog from "../components/dialog/ConfirmDialog"; import ConfirmDialog from "../components/dialog/ConfirmDialog";
import Search from "../components/Search"; import Search from "../components/Search";
import Uploader from "./me/Uploader";
export default { export default {
name: "Test", name: "Test",
components: { components: {
ConfirmDialog, Uploader
Search
}, },
props: {}, props: {},
data() { data() {

3
src/pages/home/Index2.vue

@ -107,6 +107,8 @@
</SlideItem> </SlideItem>
<SlideItem style="font-size: 40px;overflow:auto;"> <SlideItem style="font-size: 40px;overflow:auto;">
<Uploader <Uploader
:isOnThisPage="baseActiveIndex === 1"
:author="this.videos[this.videoActiveIndex]?.author"
@toggleCanMove="e => this.canMove = e" @toggleCanMove="e => this.canMove = e"
@back="baseActiveIndex = 0" @back="baseActiveIndex = 0"
@showFollowSetting="showFollowSetting = true" @showFollowSetting="showFollowSetting = true"
@ -446,7 +448,6 @@ export default {
test: '', test: '',
videoActiveIndex: 0, videoActiveIndex: 0,
baseActiveIndex: 0, baseActiveIndex: 0,
activeIndex: 1, activeIndex: 1,

365
src/pages/me/Uploader.less

@ -11,16 +11,6 @@
opacity: 0; opacity: 0;
} }
.recommend-enter-active,
.recommend-leave-active {
transition: all 0.3s ease;
}
.recommend-enter-from,
.recommend-leave-to {
transform: translateY(-100%);
}
.FromBottomDialog { .FromBottomDialog {
left: inherit; left: inherit;
} }
@ -297,11 +287,9 @@
color: white; color: white;
height: 12rem; height: 12rem;
background-image: url('../../assets/img/header-bg.png'); background-image: url('../../assets/img/header-bg.png');
//background-image: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEBAQEBAPEBAPEBAPDw8QDw8NEA8OFRIWFhURFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGBAQGC0dHR0tLS0rKy0tLS0tLS0tKy0tKy0tLSstLS0tLS0tLSstLSstLS0tKy0tLS0tLS0tLisrN//AABEIAKgBLAMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAAAwECBAUGB//EAD8QAAIBAgMFAwgIBQQDAAAAAAABAgMRBBIhBSIxQXFRYbEGEyMyUnKBkRWCkqGissHRFEJic/AkNIPhBzNT/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAeEQEBAQEAAwEBAQEAAAAAAAAAARECEiExA0FRE//aAAwDAQACEQMRAD8A+QgUTJTPS4mRLpi4stF6hDETAiIRBpiAEwZcZoRaJBKCLZSbF7BYuMaXYmxewWGGqWCxewWGGqWCxewWLhpeULDLENEw1SwWLWCxcNVsRYvYLDCUmtw+KKIvivV+KFxZnPbpL6MiWRCLNEXQRYsyAaVUiLY+pwM5YiAuQyAJuRcLlbhUhci4XC6oSicpKQZ1aBaBMUTBA1aJKIXEtYJqSWWsSkBVEl7EqBUq1LVdBmQStHc1wSauiudLyhlG5QyBCspGUdlBxKEuJGUdlCw0JyhlHZSHEBOQMg3KGUaaVlIyjsoZSrrHjI7j6ozUuBt2gtx9UYsOtPiY/rpz8PQ1R0KIeloRdLaIsXZE0DSprQzM2NGSSAoVLMqwIuQwIYUXJKkgMsCQqnV5PQci/UsMii0EQuBaIASisi1MIYTEESVTXG5akgo9haUdTLNLqcS+HlZ5eT4dSMjJnTv15dTSVqsFiaEsyT58H3MvYmsYXYiw2xGUaFWJyjFEtlGhOULFq1WEFeUkra6vUXQxdOfqzTfZez+Q1fGpcSLDspVxGslWJsXyhlKMW0l6N9V4mT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+7Vm+Y499WzDCbmZ1u4iVZm9c8apSKqRn86DqsaY1Z+o1SXFX63MCqsmNZr9gY35m3w7npxXO4z6PXGLv1VjFHEvklfqdLBYxNapJrs1uY79e46flJuVzpQ31f2l4nUq1471mmy1TEwSu1f4I51bFO+7ouzLFGebb/F/Tmc/KvGo9bmGvLeYxzd+JmqPVnSuMjr4V7kehzKvrPqx+HqLKrmao9X1F+JzPbZhpbnxZMpGalLd+JLNSs2ezJMo2LZFxqzle4XF3Ai+JQBYmxzdUATYiwAAWCwAAWCwAAWAugAAIoAAA00MZJaPVD8RWzJW4czn2G0arXQG1E0VTGOzFyNM4GQAWGqAABosmFypITF6cuI+lO1zOmTGYXGmVUTJlc5VzBV7ipE5irCYZFi5PUkgEi8XoWzC0wuXU8V2yLlAGr4r3C5QBpgAAMNgAAAAAAAAAAAAAAAAAAAAAAAAACYAAAoAAAAAAAAAJgAACgAAAAAAAAAAAAJgAABj/2Q==');
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
box-sizing: border-box; box-sizing: border-box;
} }
@ -311,241 +299,268 @@
border-radius: 1rem 1rem 0 0; border-radius: 1rem 1rem 0 0;
.detail-wrapper { .detail-wrapper {
padding: 0 2rem 0 2rem; padding: 0 2rem 1.5rem 2rem;
}
.head { .head {
width: 100%; width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
transform: translateY(-2rem);
.head-image {
background: black;
padding: 2px;
border-radius: 50%;
width: 8rem;
height: 8rem;
}
.heat {
margin-top: 1rem;
width: calc(100% - 12rem);
color: @second-text-color;
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
align-items: center;
.num { box-sizing: border-box;
margin-top: .5rem; transform: translateY(-2rem);
color: white;
font-size: 1.6rem; .head-image {
font-weight: bold; background: black;
margin-right: 3px; padding: 2px;
border-radius: 50%;
width: 8rem;
height: 8rem;
} }
.text { .heat {
font-size: 1.2rem; margin-top: 1rem;
margin-right: 10px; width: calc(100% - 12rem);
color: @second-text-color;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; justify-content: space-between;
}
}
}
.description { .num {
font-size: 1.2rem; margin-top: .5rem;
color: white; color: white;
transform: translateY(-2rem); font-size: 1.6rem;
font-weight: bold;
margin-right: 3px;
}
.number { .text {
color: @second-text-color; font-size: 1.2rem;
padding-bottom: 2rem; margin-right: 10px;
border-bottom: 1px solid @line-color; display: flex;
display: flex; align-items: center;
align-items: center; flex-direction: column;
img { }
width: 1.6rem;
margin-left: .5rem;
} }
} }
} .description {
font-size: 1.2rem;
color: white;
transform: translateY(-2rem);
.signature { .number {
color: @second-text-color; color: @second-text-color;
display: flex; padding-bottom: 2rem;
align-items: center; border-bottom: 1px solid @line-color;
margin-bottom: .5rem; display: flex;
align-items: center;
img { img {
height: 1.2rem; width: 1.6rem;
margin-left: .6rem; margin-left: .5rem;
} }
} }
.more { }
color: @second-text-color;
display: flex;
.item { .signature {
padding: .2rem .5rem; color: white;
border-radius: .2rem;
background: @second-btn-color-tran;
font-size: 1rem;
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: .5rem; margin-bottom: .5rem;
img { img {
height: 1rem; height: 1.2rem;
margin-right: .2rem; margin-left: .6rem;
} }
} }
}
.other { .more {
display: flex; color: @second-text-color;
margin-bottom: 2rem;
.item {
margin-right: 2.5rem;
display: flex; display: flex;
img { .item {
margin-right: .8rem; padding: .2rem .5rem;
border-radius: .4rem; border-radius: .2rem;
background: @second-btn-color-tran; background: @second-btn-color-tran;
padding: .8rem; font-size: 1rem;
height: 2.2rem;
}
.right {
display: flex; display: flex;
justify-content: space-between; align-items: center;
flex-direction: column; margin-right: .5rem;
.top {
color: white;
font-size: 1.4rem;
}
.bottom { img {
color: @second-text-color; height: 1rem;
font-size: 1.2rem; margin-right: .2rem;
} }
} }
} }
}
.my-buttons {
margin-top: 2rem;
overflow: hidden;
display: flex;
justify-content: flex-end;
align-items: center;
@width: 3.6rem;
.follow-display { .other {
flex: 1; display: flex;
overflow: hidden; margin-bottom: 2rem;
.follow-wrapper { .item {
width: 200%; margin-right: 2.5rem;
display: flex; display: flex;
flex-wrap: nowrap;
transition: all .3s ease;
&.follow-wrapper-followed { img {
transform: translate3d(-50%, 0, 0); margin-right: .8rem;
border-radius: .4rem;
background: @second-btn-color-tran;
padding: .8rem;
height: 2.2rem;
} }
.no-follow { .right {
width: calc(100% - 0.5rem);
color: white;
border-radius: .2rem;
background: @primary-btn-color;
height: @width;
display: flex; display: flex;
align-items: center; justify-content: space-between;
justify-content: center; flex-direction: column;
margin-right: .5rem;
box-sizing: border-box;
span { .top {
margin-left: .2rem; color: white;
font-size: 1.4rem;
}
.bottom {
color: @second-text-color;
font-size: 1.2rem;
} }
} }
}
}
.followed { .my-buttons {
width: 100%; margin-top: 2rem;
overflow: hidden;
display: flex;
justify-content: flex-end;
align-items: center;
@width: 3.6rem;
.follow-display {
flex: 1;
overflow: hidden;
.follow-wrapper {
width: 200%;
display: flex; display: flex;
justify-content: space-around; flex-wrap: nowrap;
align-items: center; transition: all .3s ease;
&.follow-wrapper-followed {
transform: translate3d(-50%, 0, 0);
}
.l-button { .no-follow {
width: calc(100% - 0.5rem);
color: white; color: white;
border-radius: .2rem; border-radius: .2rem;
background: @second-btn-color; background: @primary-btn-color;
height: @width; height: @width;
width: 50%;
margin-right: .5rem;
box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: .5rem;
box-sizing: border-box;
span { span {
margin-left: .2rem; margin-left: .2rem;
} }
}
img { .followed {
transform: rotate(180deg); width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
.l-button {
color: white;
border-radius: .2rem;
background: @second-btn-color;
height: @width;
width: 50%;
margin-right: .5rem;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
span {
margin-left: .2rem;
}
img {
transform: rotate(180deg);
}
} }
} }
} }
img {
@width: 1.4rem;
width: @width;
height: @width;
}
} }
}
.option { .option {
position: relative; position: relative;
width: @width; width: @width;
height: @width; height: @width;
font-size: 1.2rem; font-size: 1.2rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: .2rem; border-radius: .2rem;
background: @second-btn-color; background: @second-btn-color;
color: white; color: white;
&.option-recommend { &.option-recommend {
img { .arrow {
transform: rotate(0deg); transform: rotate(0deg);
}
} }
} }
}
img { .loading {
transform: rotate(180deg); @width: 1.2rem;
@width: 1.6rem; width: @width;
width: @width; height: @width;
height: @width; animation: rotate .6s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg)
}
to {
transform: rotate(360deg)
}
}
}
.arrow {
transition: transform .3s ease;
transform: rotate(180deg);
@width: 1.6rem;
width: @width;
height: @width;
}
}
} }
.recommend { .recommend {
transition: all .3s ease; transition: all .3s ease;
height: 22rem; height: 22rem;
margin-top: 1.5rem; overflow: hidden;
&.hidden {
height: 0;
}
.title { .title {
padding: 0 2rem 0 2rem; padding: 0 2rem 0 2rem;

210
src/pages/me/Uploader.vue

@ -10,8 +10,8 @@
</div> </div>
</transition> </transition>
<transition name="fade"> <transition name="fade">
<div class="follow-btn" :class="{followed:isFollowed}" v-if="floatFixed" @click="followButton"> <div class="follow-btn" :class="{followed:localAuthor.is_follow}" v-if="floatFixed" @click="followButton">
{{ isFollowed ? '私信' : '关注' }} {{ localAuthor.is_follow ? '私信' : '关注' }}
</div> </div>
</transition> </transition>
<div class="right"> <div class="right">
@ -30,49 +30,50 @@
@touchmove="touchMove($event)" @touchmove="touchMove($event)"
@touchend="touchEnd($event)"> @touchend="touchEnd($event)">
<div ref="desc" class="desc"> <div ref="desc" class="desc">
<header ref="header" @click="previewImg = require('../../assets/img/header-bg.png')"></header> <header ref="header"
:style='{backgroundImage: `url(${localAuthor.cover})`}'
@click="previewImg = localAuthor.cover"></header>
<div class="detail"> <div class="detail">
<div class="detail-wrapper"> <div class="detail-wrapper">
<div class="head"> <div class="head">
<img src="../../assets/img/icon/avatar/2.png" class="head-image" <img :src="localAuthor.avatar" class="head-image"
@click="previewImg = require('../../assets/img/icon/avatar/2.png')"> @click="previewImg = localAuthor.avatar">
<div class="heat"> <div class="heat">
<div class="text"> <div class="text">
<span>获赞</span> <span>获赞</span>
<span class="num">18</span> <span class="num">{{ localAuthor.favoriting_count }}</span>
</div> </div>
<div class="text"> <div class="text">
<span>粉丝</span> <span>粉丝</span>
<span class="num">62</span> <span class="num">{{ localAuthor.follower_count }}</span>
</div> </div>
<div class="text"> <div class="text">
<span>关注</span> <span>关注</span>
<span class="num">8</span> <span class="num">{{ localAuthor.following_count }}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="description"> <div class="description">
<p class="name f22 mt1r mb1r">ttentau</p> <p class="name f22 mt1r mb1r">{{ localAuthor.nickname }}</p>
<div class="number mb1r"> <div class="number mb1r">
<span class="mr1r">私密账号</span> <span>抖音号{{ localAuthor.unique_id }}</span>
<span>抖音号605128307</span>
<img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/my-card')"> <img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/my-card')">
</div> </div>
<div class="signature f12"> <div class="signature f12" v-if="localAuthor.desc">
<span class="text">{{ userinfo.desc }}</span> <span class="text">{{ localAuthor.desc }}</span>
</div> </div>
<div class="more"> <div class="more">
<div class="age item" v-if="userinfo.birthday"> <div class="age item" v-if="localAuthor.birthday">
<img v-if="userinfo.sex === '女'" src="../../assets/img/icon/me/woman.png" alt=""> <img v-if="localAuthor.sex === '0'" src="../../assets/img/icon/me/woman.png" alt="">
<img v-if="userinfo.sex === '男'" src="../../assets/img/icon/me/man.png" alt=""> <img v-if="localAuthor.sex === '1'" src="../../assets/img/icon/me/man.png" alt="">
<span>{{ filterAge(userinfo.birthday) }}</span> <span>{{ filterAge(localAuthor.birthday) }}</span>
</div> </div>
<div class="item" v-if="userinfo.location"> <div class="item" v-if="localAuthor.location">
{{ userinfo.location }} {{ localAuthor.location }}
</div> </div>
<div class="item" v-if="userinfo.school.name"> <div class="item" v-if="localAuthor.school?.name">
{{ userinfo.school.name }} {{ localAuthor.school?.name }}
</div> </div>
</div> </div>
@ -95,8 +96,8 @@
</div> </div>
<div class="my-buttons"> <div class="my-buttons">
<div class="follow-display"> <div class="follow-display">
<div class="follow-wrapper" :class="isFollowed ? 'follow-wrapper-followed' : ''"> <div class="follow-wrapper" :class="localAuthor.is_follow ? 'follow-wrapper-followed' : ''">
<div class="no-follow" @click="isFollowed = true"> <div class="no-follow" @click="localAuthor.is_follow = true">
<img src="../../assets/img/icon/add-white.png" alt=""> <img src="../../assets/img/icon/add-white.png" alt="">
<span>关注</span> <span>关注</span>
</div> </div>
@ -114,49 +115,49 @@
<div class="option" <div class="option"
:class="isShowRecommend?'option-recommend':''" :class="isShowRecommend?'option-recommend':''"
@click="toggleRecommend"> @click="toggleRecommend">
<img src="../../assets/img/icon/arrow-up-white.png" alt=""> <img v-if="loadings.showRecommend" class="loading" src="../../assets/img/icon/loading-gray.png" alt="">
<img v-else class="arrow" src="../../assets/img/icon/arrow-up-white.png" alt="">
</div> </div>
</div> </div>
</div> </div>
<transition name="recommend"> <div class="recommend" :class="{hidden:!isShowRecommend}">
<div class="recommend" v-if="isShowRecommend"> <div class="title">
<div class="title"> <div class="left">
<div class="left"> <span>你可能感兴趣</span>
<span>你可能感兴趣</span> <img src="../../assets/img/icon/about-gray.png">
<img src="../../assets/img/icon/about-gray.png">
</div>
<div class="right" @click="$nav('/find-acquaintance')">
<span>查看更多</span>
<back direction="right"></back>
</div>
</div> </div>
<div class="friends" <div class="right" @click="$nav('/find-acquaintance')">
@touchstart="friendsTouchStart" <span>查看更多</span>
@touchend="friendsTouchEnd"> <back direction="right"></back>
<div class="friend" v-for="item in friends.all"> </div>
<img :style="item.select?'opacity: .5;':''" class="avatar" :src="$imgPreview(item.avatar)" alt=""> </div>
<span class="name">{{ item.name }}</span> <div class="friends"
<span class="tips">可能感兴趣的人</span> @touchstart="friendsTouchStart"
<b-button type="primary">关注</b-button> @touchend="friendsTouchEnd">
<div class="close"> <div class="friend" v-for="item in friends.all">
<back img="close" scale=".6"></back> <img :style="item.select?'opacity: .5;':''" class="avatar" :src="$imgPreview(item.avatar)" alt="">
</div> <span class="name">{{ item.name }}</span>
<span class="tips">可能感兴趣的人</span>
<b-button type="primary">关注</b-button>
<div class="close">
<back img="close" scale=".6"></back>
</div> </div>
<div class="more" @click="$nav('/find-acquaintance')"> </div>
<div class="notice"> <div class="more" @click="$nav('/find-acquaintance')">
<div>点击查看</div> <div class="notice">
<div>更多好友</div> <div>点击查看</div>
</div> <div>更多好友</div>
</div> </div>
</div> </div>
</div> </div>
</transition> </div>
</div> </div>
</div> </div>
<Indicator <Indicator
name="videoList" name="videoList"
tabStyleWidth="50%" tabStyleWidth="50%"
:tabTexts="['作品','喜欢']" :tabRender="tabRender"
v-model:active-index="contentIndex"> v-model:active-index="contentIndex">
</Indicator> </Indicator>
<SlideRowList <SlideRowList
@ -207,10 +208,33 @@ import FromBottomDialog from "../../components/dialog/FromBottomDialog";
export default { export default {
name: "Me", name: "Me",
components: {FromBottomDialog, Posters, Indicator}, components: {FromBottomDialog, Posters, Indicator},
props: {
author: {
type: Object,
default: {}
},
isOnThisPage: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
isFollowed: false, tabRender: () => {
isShowRecommend: false, return (
<div className="tabs" ref="tabs">
<div className={this.contentIndex === 0 ? 'active tab' : 'tab'} style="width:50%">
<span>作品 {this.localAuthor.video_count}</span>
</div>
<div className={this.contentIndex === 1 ? 'active tab' : 'tab'} style="width:50%">
<span>喜欢</span>
<img src={require('../../assets/img/icon/components/follow/lock.png')} alt=""/>
</div>
</div>
)
},
isShowRecommend: false,//
isLoadRecommendFriends: false,//friends.all
previewImg: '', previewImg: '',
contentIndex: 0, contentIndex: 0,
baseActiveIndex: 0, baseActiveIndex: 0,
@ -266,11 +290,13 @@ export default {
loading1: false, loading1: false,
loading2: false, loading2: false,
loading3: false, loading3: false,
showRecommend: false
}, },
tempScroll: false, tempScroll: false,
acceleration: 1.2, acceleration: 1.2,
sprint: 15, sprint: 15,
canScroll: true canScroll: true,
localAuthor: {}
} }
}, },
computed: { computed: {
@ -296,6 +322,40 @@ export default {
contentIndex(newVal, oldVal) { contentIndex(newVal, oldVal) {
this.changeIndex(newVal, oldVal) this.changeIndex(newVal, oldVal)
}, },
'author.id'(newVal) {
this.localAuthor = this.author
console.log('变了', newVal)
this.videos = {
my: {
list: [],
total: -1,
pageNo: 0
},
private: {
list: [],
total: -1
},
like: {
list: [],
total: -1
},
collect: {
video: {
list: [],
total: -1,
},
audio: {
list: [],
total: -1,
}
},
}
},
isOnThisPage(newVal) {
if (newVal) {
this.getAuthor()
}
}
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
@ -305,15 +365,44 @@ export default {
this.refs.maxSlideHeight = this.$refs.videoSlideRowList.wrapperHeight this.refs.maxSlideHeight = this.$refs.videoSlideRowList.wrapperHeight
this.initSlideHeight = this.bodyHeight - 50 - this.refs.descHeight this.initSlideHeight = this.bodyHeight - 50 - this.refs.descHeight
this.canTransformY = this.refs.descHeight - this.floatHeight this.canTransformY = this.refs.descHeight - this.floatHeight
this.changeIndex(0, null) this.getAuthor()
}) })
this.videoItemHeight = this.bodyWidth / 3 * 1.2 + 2 this.videoItemHeight = this.bodyWidth / 3 * 1.2 + 2
bus.on('baseSlide-moved', () => this.canScroll = false) bus.on('baseSlide-moved', () => this.canScroll = false)
bus.on('baseSlide-end', () => this.canScroll = true) bus.on('baseSlide-end', () => this.canScroll = true)
}, },
methods: { methods: {
async getAuthor() {
this.changeIndex(0, null)
// let res = await this.$api.user.author({id: this.author.id})
let res = await this.$api.user.author({id: '54884802577'})
if (res.code === this.SUCCESS) {
this.localAuthor = {...this.localAuthor, ...res.data}
this.refreshDescHeight()
}
},
toggleRecommend() { toggleRecommend() {
this.isShowRecommend = !this.isShowRecommend if (this.isLoadRecommendFriends) {
this.isShowRecommend = !this.isShowRecommend
this.refreshDescHeight()
} else {
this.loadings.showRecommend = true
setTimeout(() => {
this.loadings.showRecommend = false
this.isLoadRecommendFriends = true
this.isShowRecommend = !this.isShowRecommend
this.refreshDescHeight()
}, 1000)
}
},
refreshDescHeight() {
//nextTick
setTimeout(() => {
let desc = $('.desc')
this.refs.descHeight = desc.height()
this.initSlideHeight = this.bodyHeight - 50 - this.refs.descHeight
this.canTransformY = this.refs.descHeight - this.floatHeight
}, 300)
}, },
friendsTouchStart() { friendsTouchStart() {
this.$emit('toggleCanMove', false) this.$emit('toggleCanMove', false)
@ -322,10 +411,10 @@ export default {
this.$emit('toggleCanMove', true) this.$emit('toggleCanMove', true)
}, },
followButton() { followButton() {
if (this.isFollowed) { if (this.localAuthor.is_follow) {
this.$nav('/message/chat') this.$nav('/message/chat')
} else { } else {
this.isFollowed = true this.localAuthor.is_follow = true
} }
}, },
setLoadingFalse() { setLoadingFalse() {
@ -685,6 +774,7 @@ export default {
return transformY return transformY
}, },
filterAge(age) { filterAge(age) {
if (!age) return
let date = new Date(age) let date = new Date(age)
return new Date().getFullYear() - date.getFullYear() return new Date().getFullYear() - date.getFullYear()
} }

Loading…
Cancel
Save